@codesoul-co/hypha-memory / provider-pagination
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/provider-pagination.ts - Exports: 5
Using this module
Use the Provider pagination module for binding external or local providers to Hypha ports. It exports 3 functions, 2 interfaces.
Import from the package entrypoint
ts
import {
beginProviderPage,
encodeProviderCursor,
finishProviderPage,
} from '@codesoul-co/hypha-memory';
import type {
ProviderPageContext,
ProviderPaginationBudget,
} from '@codesoul-co/hypha-memory';Usage patterns
- Use the 2 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The module exposes 3 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
beginProviderPage | function | beginProviderPage(providerId: string, scope: ManagedMemoryScope, pagination: PaginationRequest | undefined, nowMs?: number): ProviderPageContext | Begin Provider Page function with 1 public call signature; parameters and return types are listed below. |
encodeProviderCursor | function | encodeProviderCursor(envelope: ProviderCursorEnvelope): string | Encode Provider Cursor function with 1 public call signature; parameters and return types are listed below. |
finishProviderPage | function | finishProviderPage(context: ProviderPageContext, providerId: string, scope: ManagedMemoryScope, records: unknown[], nextProviderCursor?: string, nowMs?: number): { nextCursor?: string; hasMore: boolean; } | Finish Provider Page function with 1 public call signature; parameters and return types are listed below. |
ProviderPageContext | interface | interface ProviderPageContext | Provider Page Context interface with 5 public fields or methods. |
ProviderPaginationBudget | interface | interface ProviderPaginationBudget | Provider Pagination Budget interface with 5 public fields or methods. |
beginProviderPage
Begin Provider Page function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { beginProviderPage } from '@codesoul-co/hypha-memory'; - Source module:
provider-pagination
Declaration
text
export declare function beginProviderPage(providerId: string, scope: ManagedMemoryScope, pagination: PaginationRequest | undefined, nowMs?: number): ProviderPageContext;Call signature
text
beginProviderPage(providerId: string, scope: ManagedMemoryScope, pagination: PaginationRequest | undefined, nowMs?: number): ProviderPageContextParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
providerId | string | Yes | Required parameter; accepted values are defined by the type column. |
scope | ManagedMemoryScope | Yes | Required parameter; accepted values are defined by the type column. |
pagination | PaginationRequest | Yes | Required parameter; accepted values are defined by the type column. |
nowMs | number | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
ProviderPageContext - Description: The return contract is defined by the type shown above.
encodeProviderCursor
Encode Provider Cursor function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { encodeProviderCursor } from '@codesoul-co/hypha-memory'; - Source module:
provider-pagination
Declaration
text
export declare function encodeProviderCursor(envelope: ProviderCursorEnvelope): string;Call signature
text
encodeProviderCursor(envelope: ProviderCursorEnvelope): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
envelope | ProviderCursorEnvelope | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
finishProviderPage
Finish Provider Page function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { finishProviderPage } from '@codesoul-co/hypha-memory'; - Source module:
provider-pagination
Declaration
text
export declare function finishProviderPage(context: ProviderPageContext, providerId: string, scope: ManagedMemoryScope, records: unknown[], nextProviderCursor?: string, nowMs?: number): {
nextCursor?: string;
hasMore: boolean;
};Call signature
text
finishProviderPage(context: ProviderPageContext, providerId: string, scope: ManagedMemoryScope, records: unknown[], nextProviderCursor?: string, nowMs?: number): { nextCursor?: string; hasMore: boolean; }Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
context | ProviderPageContext | Yes | Required parameter; accepted values are defined by the type column. |
providerId | string | Yes | Required parameter; accepted values are defined by the type column. |
scope | ManagedMemoryScope | Yes | Required parameter; accepted values are defined by the type column. |
records | unknown[] | Yes | Required parameter; accepted values are defined by the type column. |
nextProviderCursor | string | No | Optional parameter; accepted values are defined by the type column. |
nowMs | number | No | Optional parameter; accepted values are defined by the type column. |
Returns
- Type:
{ nextCursor?: string; hasMore: boolean; } - Description: The return contract is defined by the type shown above.
ProviderPageContext
Provider Page Context interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { ProviderPageContext } from '@codesoul-co/hypha-memory'; - Source module:
provider-pagination
Declaration
text
export interface ProviderPageContext {
providerCursor?: string;
envelope?: ProviderCursorEnvelope;
budget: ProviderPaginationBudget;
startedAt: string;
nowMs: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
budget | property | budget: ProviderPaginationBudget | Public property; its type, readonly modifier and optionality are shown in the signature. |
envelope | property | envelope?: ProviderCursorEnvelope | Public property; its type, readonly modifier and optionality are shown in the signature. |
nowMs | property | nowMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
providerCursor | property | providerCursor?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
startedAt | property | startedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ProviderPaginationBudget
Provider Pagination Budget interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { ProviderPaginationBudget } from '@codesoul-co/hypha-memory'; - Source module:
provider-pagination
Declaration
text
export interface ProviderPaginationBudget {
maxPages: number;
maxItems: number;
maxBytes: number;
maxDurationMs: number;
maxCalls: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
maxBytes | property | maxBytes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxCalls | property | maxCalls: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxDurationMs | property | maxDurationMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxItems | property | maxItems: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
maxPages | property | maxPages: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
