Align shared reference and opaque cursor contracts
This commit is contained in:
+34
-55
@@ -27,6 +27,27 @@ export type InventoryType = {
|
||||
groupId?: number;
|
||||
volume?: number;
|
||||
};
|
||||
export type {
|
||||
LocationFact,
|
||||
LocationReader,
|
||||
ReferenceCategoryRecord,
|
||||
ReferenceConstellationRecord,
|
||||
ReferenceGroupRecord,
|
||||
ReferenceIdSelection,
|
||||
ReferenceListOptions,
|
||||
ReferenceReader,
|
||||
ReferenceReaderHandle,
|
||||
ReferenceReaderPort,
|
||||
ReferenceRegionRecord,
|
||||
ReferenceRepository,
|
||||
ReferenceSearchOptions,
|
||||
ReferenceStationEvidence,
|
||||
ReferenceStationRecord,
|
||||
ReferenceStationSelection,
|
||||
ReferenceSystemRecord,
|
||||
ReferenceSystemSelection,
|
||||
ReferenceTypeRecord,
|
||||
} from './reference';
|
||||
/** Integer cents (0.01 ISK), serialized as decimal text. No floating-point accumulation. */
|
||||
export type Isk = string;
|
||||
export type ValuationMethod = 'reference_estimate' | 'immediate_liquidation' | 'expected_sell_order' | 'replacement';
|
||||
@@ -41,10 +62,6 @@ export interface CharacterAssetRepository {
|
||||
characters(userId: UserId): Promise<Character[]>;
|
||||
assets(userId: UserId, characterId: number): Promise<Asset[]>;
|
||||
}
|
||||
export interface ReferenceRepository {
|
||||
types(ids: number[]): Promise<InventoryType[]>;
|
||||
version(): Promise<string>;
|
||||
}
|
||||
export interface MarketEstimates {
|
||||
estimates(typeIds: number[]): Promise<PriceSnapshot>;
|
||||
}
|
||||
@@ -401,6 +418,19 @@ export type InventoryCursorPin = {
|
||||
export type InventoryCursorPosition = { offset: number; lastItemId: DecimalId | null };
|
||||
export type InventoryCursor = { token: string };
|
||||
export type InventoryCursorState = { token: string; pin: InventoryCursorPin; status: 'active' | 'exhausted'; position: InventoryCursorPosition };
|
||||
/** Server-resolved values supplied on every continuation lookup; no caller signature is required. */
|
||||
export type InventoryCursorLookup = {
|
||||
token: string;
|
||||
callerUserId: UserId;
|
||||
queryFingerprint: string;
|
||||
selectedResources: readonly SelectedResource[];
|
||||
authorizationRevisions: Readonly<Record<string, AuthorizationRevision>>;
|
||||
authorizationEpochs: Readonly<Record<string, AuthorizationEpoch>>;
|
||||
snapshotGenerations: Readonly<Record<string, SnapshotGeneration>>;
|
||||
referenceVersion: ReferenceVersion | null;
|
||||
priceVersion: PriceVersion | null;
|
||||
now: number;
|
||||
};
|
||||
export type InventoryQuery = {
|
||||
/** Resolved from the verified session; never accepted as caller authority. */
|
||||
callerUserId: UserId;
|
||||
@@ -436,57 +466,6 @@ export type InventoryQueryResult =
|
||||
| { status: 'ready'; rows: readonly InventoryRow[]; summary: InventorySummary; nextCursor: null; pageState: 'after_end'; provenance: CompleteReportProvenance }
|
||||
| { status: 'partial' | 'stale' | 'authorization_required' | 'unavailable'; rows: readonly InventoryRow[]; summary: InventorySummary | null; reason: string; provenance?: ReportProvenance };
|
||||
|
||||
export type ReferenceCategoryRecord = { id: number; name: string; published?: boolean };
|
||||
export type ReferenceGroupRecord = { id: number; categoryId: number; name: string; published?: boolean };
|
||||
export type ReferenceTypeRecord = { id: number; name: string; categoryId: number; groupId: number; published?: boolean; volume?: number };
|
||||
export type ReferenceRegionRecord = { id: number; name: string | null };
|
||||
export type ReferenceConstellationRecord = { id: number; name: string | null; regionId: number | null };
|
||||
export type ReferenceSystemRecord = {
|
||||
id: number; name: string; constellationId: number; regionId: number | null;
|
||||
x: number; y: number; z: number; securityStatus: number; securityClass: string | null;
|
||||
};
|
||||
export type ReferenceStationRecord = {
|
||||
id: number; systemId: number; systemName: string | null; regionId: number | null;
|
||||
name: string | null; typeId: number | null; ownerId: number | null;
|
||||
x: number | null; y: number | null; z: number | null;
|
||||
};
|
||||
export type ReferenceSearchOptions = { query: string; categoryId?: number; groupId?: number; published?: boolean; limit?: number; offset?: number };
|
||||
export type ReferenceListOptions = { ids?: number[]; query?: string; limit?: number; offset?: number };
|
||||
export type ReferenceIdSelection = number[] | ReferenceListOptions | undefined;
|
||||
export type ReferenceGroupSelection = number[] | (ReferenceListOptions & { categoryId?: number }) | undefined;
|
||||
export type ReferenceSystemSelection = number[] | (ReferenceListOptions & { constellationId?: number; regionId?: number }) | undefined;
|
||||
export type ReferenceStationSelection = number[] | (ReferenceListOptions & { systemId?: number }) | undefined;
|
||||
|
||||
/** Structural mirror of T03's indexed reader; records stay immutable/version-pinned. */
|
||||
export interface ReferenceReader extends ReferenceRepository {
|
||||
searchTypes(options: ReferenceSearchOptions): Promise<ReferenceTypeRecord[]>;
|
||||
searchTypesByName(query: string, options?: Omit<ReferenceSearchOptions, 'query'>): Promise<ReferenceTypeRecord[]>;
|
||||
categories(selection?: ReferenceIdSelection): Promise<ReferenceCategoryRecord[]>;
|
||||
groups(selection?: ReferenceGroupSelection): Promise<ReferenceGroupRecord[]>;
|
||||
regions(selection?: ReferenceIdSelection): Promise<ReferenceRegionRecord[]>;
|
||||
constellations(selection?: ReferenceIdSelection): Promise<ReferenceConstellationRecord[]>;
|
||||
systems(selection?: ReferenceSystemSelection): Promise<ReferenceSystemRecord[]>;
|
||||
stations(selection?: ReferenceStationSelection): Promise<ReferenceStationRecord[]>;
|
||||
}
|
||||
export interface ReferenceReaderHandle extends ReferenceReader {
|
||||
readonly pinnedVersion: ReferenceVersion;
|
||||
close(): void;
|
||||
}
|
||||
/** Main reader owns a manifest-pinned handle; callers use one handle across calls. */
|
||||
export interface ReferenceReaderPort extends ReferenceReader {
|
||||
pin(): ReferenceReaderHandle;
|
||||
}
|
||||
export type LocationFact = {
|
||||
kind: 'region' | 'system' | 'station' | 'unknown';
|
||||
id: DecimalId;
|
||||
name: string | null;
|
||||
parentId: DecimalId | null;
|
||||
referenceVersion: ReferenceVersion;
|
||||
};
|
||||
/** Narrow adapter over a pinned T03 reader; unknown IDs remain explicit. */
|
||||
export interface LocationReader {
|
||||
location(id: DecimalId): Promise<LocationFact>;
|
||||
}
|
||||
|
||||
export type WalletBalanceComponent = {
|
||||
component: 'wallet_balance';
|
||||
|
||||
Reference in New Issue
Block a user