/** * CesiumPlus types for g1-papi * Pure TypeScript implementation (no Angular dependencies) */ /** * Avatar data structure */ export interface CesiumPlusAvatar { _content_type?: string; _content?: string; } /** * Geographic point */ export interface CesiumPlusGeoPoint { lat: number; lon: number; } /** * Social media link */ export interface CesiumPlusSocial { type: string; url: string; } /** * Full CesiumPlus profile */ export interface CesiumPlusProfile { pubkey: string; title?: string; description?: string; address?: string; city?: string; avatar?: CesiumPlusAvatar; geoPoint?: CesiumPlusGeoPoint; socials?: CesiumPlusSocial[]; tags?: string[]; time?: number; version?: number; issuer?: string; hash?: string; signature?: string; } /** * Profile data for saving (without signature fields) */ export interface CesiumPlusProfileData { title: string; description?: string; address?: string; city?: string; geoPoint?: CesiumPlusGeoPoint; avatar?: { _content_type: string; _content: string; }; socials?: CesiumPlusSocial[]; tags?: string[]; } /** * Elasticsearch search result wrapper */ export interface CesiumPlusSearchResult { took: number; timed_out: boolean; hits: { total: number; max_score: number; hits: CesiumPlusSearchHit[]; }; } /** * Individual search hit from Elasticsearch */ export interface CesiumPlusSearchHit { _index: string; _type: string; _id: string; _score: number; _source: { title?: string; avatar?: CesiumPlusAvatar; description?: string; city?: string; }; } /** * Single profile response from API */ export interface CesiumPlusProfileResponse { _index: string; _type: string; _id: string; _version: number; found: boolean; _source?: CesiumPlusProfile; } /** * Node summary response (health check) */ export interface CesiumPlusNodeSummary { duniter: { software: string; version: string; status: number; }; } /** * Signature function type - provided by the caller */ export type SignFunction = (message: Uint8Array) => Promise; /** * Client configuration options */ export interface CesiumPlusClientOptions { /** CesiumPlus pod endpoint URL */ endpoint?: string; /** Enable profile caching (default: true) */ cache?: boolean; /** Cache TTL in milliseconds (default: 300000 = 5 minutes) */ cacheTTL?: number; /** Request timeout in milliseconds (default: 10000) */ timeout?: number; } /** * Search options */ export interface SearchOptions { /** Maximum results to return (default: 20) */ limit?: number; /** Offset for pagination (default: 0) */ offset?: number; } /** * Cache entry with TTL support */ export interface CacheEntry { value: T; timestamp: number; }