import type { ServiceLogsOptions } from './service-logs-options.js'; /** * The GraphQL shape returned by Hosting, which is deliberately declared here * rather than imported: this package is published, and the SDU packages that * own the equivalent REST DTO are private. */ export interface ServiceReplicaLog { replicaName: string; lines: string[]; } /** * Replica names are full K8s pod names, e.g. * `d-8ip51mklekzyxmtk-5ihjg3ycvjkpnmb2-ax-media-service-bb9c8cfmfq`. Everything * up to and including the service ID is identical across replicas of the * service that was asked for, so only the trailing segment carries * information -- and 60+ characters in front of every line is unreadable. * `--json` keeps the full name. */ export declare const toShortReplicaName: (replicaName: string, serviceId: string) => string; /** * Reads an age such as `30s`, `5m`, `2h` or `1d` into seconds, matching how * `kubectl logs --since` and `docker logs --since` are written. A bare number * is read as seconds. Returns undefined when the value cannot be read. */ export declare const parseSinceToSeconds: (since: string | undefined) => number | undefined; interface OrderedLine { /** RFC3339 timestamp Kubernetes recorded for the line, used for ordering. */ sortKey: string; replicaName: string; timestamp: string; message: string; } /** * Pads the fractional seconds to a fixed width so timestamps can be ordered by * plain string comparison. * * RFC3339Nano permits a variable-length fraction, and comparing those directly * misorders them: `.12Z` is earlier than `.1201Z`, but sorts after it because * `Z` compares above `0`. Padding avoids that while keeping the precision a * `Date` would round away. A value that does not parse is returned unchanged * and simply orders lexicographically. */ export declare const toTimestampSortKey: (timestamp: string) => string; /** * Merges every replica's lines into one chronological stream. * * The keys are RFC3339 UTC strings of identical shape, so comparing them as * strings orders them correctly and preserves the sub-millisecond precision * that parsing into a `Date` would discard. Sorting is stable, so lines sharing * a timestamp keep their original per-replica order. */ export declare const mergeReplicaLines: (replicas: ServiceReplicaLog[]) => OrderedLine[]; export declare const getServiceLogs: (args: Required> & ServiceLogsOptions) => Promise; /** * Validate arguments for reading service logs. */ export declare const validateServiceLogsArgs: (args: ServiceLogsOptions) => [ServiceLogsOptions, string[]]; export {};