import type { Interfaces } from '@oclif/core'; import { Command } from '@oclif/core'; import { type ApiTarget } from './lib/api.js'; import type { AnyOperationDefinition, OperationInput, OperationInputIsOptional, OperationPathParamsFor, OperationRequest, OperationResponse } from './lib/contracts/types.js'; import type { Environment } from './lib/config.js'; export type InferredFlags = Interfaces.InferredFlags<(typeof BaseCommand)['baseFlags'] & T['flags']>; export type InferredArgs = Interfaces.InferredArgs; /** * Abstract base command for all formant commands. * Provides global --env flag, --json support, and authenticated API helpers. */ export declare abstract class BaseCommand extends Command { static enableJsonFlag: boolean; static baseFlags: { dev: Interfaces.BooleanFlag; stage: Interfaces.BooleanFlag; toon: Interfaces.BooleanFlag; full: Interfaces.BooleanFlag; field: Interfaces.OptionFlag; }; protected flags: InferredFlags; protected args: InferredArgs; /** Resolved environment based on --dev / --stage flags. */ protected get env(): Environment; /** Returns true when --toon flag is active. */ toonEnabled(): boolean; /** * Returns true when either --json or --toon is active. * Overriding this ensures human-readable output is suppressed for both flags, * without requiring changes to individual command files. */ jsonEnabled(): boolean; /** * Called by oclif when jsonEnabled() is true and run() returns successfully. * When --toon is active, encodes the result as TOON instead of JSON. * * Note: must write to process.stdout directly — this.log() is suppressed * by oclif whenever jsonEnabled() returns true. */ protected logJson(json: unknown): void; init(): Promise; /** * Make an authenticated GET/POST request to a Formant API. * Automatically uses the correct environment from --dev/--stage flags. */ protected api(target: ApiTarget, path: string, options?: { body?: unknown; method?: 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT'; query?: Record; timeoutMs?: number; }): Promise; /** * Make an authenticated API request using a typed operation contract. */ protected callOperation(operation: TOperation, ...args: OperationInputIsOptional, OperationRequest> extends true ? [input?: OperationInput, OperationRequest>] : [input: OperationInput, OperationRequest>]): Promise>; /** * Make an authenticated API request using a known operation id. * Useful for operations that exist in the known operation catalog * but do not yet have a strongly-typed key under `operations.*`. */ protected callKnownOperation(operationId: string, input?: { body?: unknown; pathParams?: Record; query?: Record; timeoutMs?: number; }): Promise; /** * Get the organization ID from the authenticated session. * Uses the cached login token so no extra network call if already authenticated. */ protected getOrgId(): Promise; protected catch(err: Error & { exitCode?: number; }): Promise; /** * Normalize a date string to ISO 8601 datetime format. * Accepts both simple dates (2026-01-01) and full datetime strings. */ protected normalizeDateTime(dateStr: string): string; }