import { Command } from 'commander'; import { JsonFormatter } from '../lib/json-formatter.js'; import { ICommand } from '../lib/command-registry.js'; import { GreprApiClient } from '../lib/api-client.js'; import { ApiClientFactoryOptions } from '../lib/api-client-factory.js'; import { OutputFormat } from '../lib/output-format.js'; import { CommandOption, MergeConfiguration } from '../types.js'; export interface CrudCommandOptions extends ApiClientFactoryOptions { quiet?: boolean; timezone?: string; output?: string; format?: OutputFormat; sort?: string; color?: boolean; timestamps?: boolean; jobState?: boolean; maxDepth?: number; maxLines?: number; fields?: string[]; } export interface CrudCreateUpdateOptions extends CrudCommandOptions { resourceFile: string; } /** * Base class for CRUD commands (job:*, integration:*, dataset:*) * Provides common functionality for create, read, update, delete operations */ export declare abstract class CrudCommand implements ICommand { protected formatter: JsonFormatter | null; protected apiClient: GreprApiClient | null; /** * Get the command prefix (e.g., 'job', 'integration', 'dataset') */ abstract getCommandPrefix(): string; /** * Get singular resource name for messages (e.g., 'job', 'integration', 'dataset') */ abstract getResourceName(): string; /** * Execute get operation */ executeGet(_resourceId: string, _options: T): Promise; /** * Execute create operation */ executeCreate(_options: CrudCreateUpdateOptions): Promise; /** * Execute update operation */ executeUpdate(_resourceId: string, _options: CrudCreateUpdateOptions): Promise; /** * Execute delete operation */ executeDelete(_resourceId: string, _options: T): Promise; /** * Whether this command supports get operations */ protected supportsGet(): boolean; /** * Whether this command supports create operations */ protected supportsCreate(): boolean; /** * Subclasses override this when they register their own `:create` command * (e.g. JobCrudCommand registers a version with extra streaming-format * options). Returning true tells addToProgram to skip the default create * registration so the command isn't double-registered. */ protected hasCustomCreate(): boolean; /** * Whether this command supports update operations */ protected supportsUpdate(): boolean; /** * Whether this command supports delete operations */ protected supportsDelete(): boolean; /** * Get command-specific options for get command */ protected getGetOptions(): CommandOption[]; /** * Get command-specific options for update command */ protected getUpdateOptions(): CommandOption[]; /** * Add this command to the program */ addToProgram(program: Command, mergeConfiguration: MergeConfiguration): void; /** The format actually in effect, including the env-var default. */ protected resolveFormat(options: T): OutputFormat; /** * Setup formatter for output */ protected setupFormatter(options: T): void; /** * Create API client using shared factory */ protected createApiClient(options: T): GreprApiClient; /** * Format and output single resource */ protected formatAndOutputSingle(resource: Record, options: T): Promise; /** * Load resource definition from file */ protected loadResourceFromFile(resourceFile: string): Promise; /** * Show success message for create operation */ protected showCreateSuccess(createdResource: Record, options: T): void; /** * Show success message for update operation */ protected showUpdateSuccess(resourceId: string, options: T): void; /** * Show success message for delete operation */ protected showDeleteSuccess(resourceId: string, options: T): void; } //# sourceMappingURL=crud-command.d.ts.map