import type { NqlQueryMetadata, NqlQueryOwner } from "../queries"; import type { CollaboratorsConfig } from "../types"; export interface SharedView { /** UUID. */ id: string; name: string; owner: NqlQueryOwner; nql: string; /** Whether the view is active or archived. */ status?: string; display_name?: string; tags?: string[]; schema?: unknown; is_owned?: boolean; } export interface OwnedView { /** UUID. */ id: string; name: string; owner: NqlQueryOwner; nql: string; /** Whether the view is active or archived. */ status?: string; collaborators: CollaboratorsConfig; metadata: NqlQueryMetadata; display_name?: string; tags?: string[]; schema?: unknown; is_owned?: boolean; } export interface ViewOwner { company_id: number; company_name: string; company_slug?: string; } export interface CreateViewRequest { name: string; nql: string; collaborators: CollaboratorsConfig; display_name?: string; tags?: string[]; } export interface UpdateViewRequest { collaborators?: CollaboratorsConfig; display_name?: string; tags?: string[]; } export type View = OwnedView | SharedView; /** * Query parameters accepted by `GET /v2/views`. */ export interface GetViewsParams { page?: number; per_page?: number; /** `true` returns only owned views; `false` only shared-with-you views. */ is_owned?: boolean; /** Filters by tag. OR-d together when multiple are given. */ tag?: string | string[]; /** Filters by owning company id. OR-d together when multiple are given. */ company_id?: number | number[]; /** Filters by view status. */ status?: string; /** Free-text keyword search. */ q?: string; }