Monument

Reports

Report definitions, saved views, grouped data, and export workflows.

externalpermissionstable15 procedures
queryreports.definitions.listInferred output

List report definitions for the organization.

Input
{
  limit?: number | undefined;
  offset?: number | undefined;
  category?: string | undefined;
  source?: "user" | "system" | undefined;
  baseEntity?: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates" | undefined;
  visibility?: "organization" | "private" | undefined;
} | undefined
Output
{
  data: Array<{
    id: string;
    organizationId: string;
    name: string;
    description: string | null;
    category: string | null;
    baseEntity: BaseEntityType;
    config: ReportConfig;
    visibility: ReportVisibility | null;
    source: ReportSource | null;
    createdByResourceId: string | null;
    createdAt: Date;
    updatedAt: Date | null;
    deletedAt: Date | null;
  }>;
  total: number;
  limit: number;
  offset: number;
}
queryreports.definitions.getByIdInferred output

Get a single report definition by ID.

Input
{
  id: string;
}
Output
{
  id: string;
  organizationId: string;
  name: string;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
  description: string | null;
  config: ReportConfig;
  category: string | null;
  source: ReportSource | null;
  createdByResourceId: string | null;
  baseEntity: BaseEntityType;
  visibility: ReportVisibility | null;
} | null
mutationreports.definitions.createInferred output

Create a new report definition.

Input
{
  name: string;
  config: {
    columns: Array<{
      id: string;
      type: "property";
      name: string;
      displayOrder: number;
      field: string;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    } | {
      id: string;
      type: "aggregation";
      name: string;
      source: string;
      displayOrder: number;
      aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      sourceFilters?: Array<{
        field: string;
        operator: string;
        value?: string | number | boolean | null | undefined;
        values?: Array<string | number | boolean | null> | undefined;
      }> | undefined;
    } | {
      id: string;
      type: "formula";
      name: string;
      displayOrder: number;
      expression: string;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    } | {
      id: string;
      type: "date_series";
      name: string;
      source: string;
      displayOrder: number;
      aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
      dateField: string;
      periodType: "year" | "day" | "week" | "month" | "quarter";
      periods: number;
      periodDirection: "past" | "future";
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      sourceFilters?: Array<{
        field: string;
        operator: string;
        value?: string | number | boolean | null | undefined;
        values?: Array<string | number | boolean | null> | undefined;
      }> | undefined;
      headerFormat?: string | undefined;
      includeTotal?: boolean | undefined;
    } | {
      id: string;
      type: "comparison";
      name: string;
      displayOrder: number;
      currentColumnId: string;
      previousColumnId: string;
      show: "difference" | "percentage_change" | "both";
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      positiveIsGood?: boolean | undefined;
    } | {
      id: string;
      type: "percentage_of_total";
      name: string;
      scope: "grand_total" | "group_total";
      displayOrder: number;
      sourceColumnId: string;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    } | {
      id: string;
      type: "time_series";
      name: string;
      mode: "value" | "cumulative" | "change";
      displayOrder: number;
      periodType: "year" | "day" | "week" | "month" | "quarter";
      periods: number;
      periodDirection: "past" | "future";
      sourceColumnId: string;
      entityDateFields: Array<{
        dateField: string;
        entity: string;
      }>;
      startDate?: string | undefined;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      headerFormat?: string | undefined;
      includeTotal?: boolean | undefined;
      changeType?: "percentage" | "absolute" | undefined;
      compareTo?: "previous_period" | "same_period_last_year" | undefined;
      headerStyle?: "numeric" | "auto" | "verbose" | "compact" | undefined;
    }>;
    search?: {
      primaryFields: Array<string>;
      searchGroupLabels: boolean;
    } | undefined;
    filters?: Array<{
      id: string;
      operator: string;
      target: "source" | "row" | "computed";
      value?: unknown;
      values?: Array<unknown> | undefined;
      columnId?: string | undefined;
      sourceField?: string | undefined;
      isUserEditable?: boolean | undefined;
      taskTypeIds?: Array<string> | undefined;
      propagate?: "self" | "subtree" | undefined;
    }> | undefined;
    groupings?: Array<{
      id: string;
      columnId: string;
      level: number;
    }> | undefined;
    sortings?: Array<{
      columnId: string;
      direction: "asc" | "desc";
    }> | undefined;
    rowAction?: {
      type: "navigate" | "sidebar" | "none";
      route?: string | undefined;
      sidebarType?: string | undefined;
    } | undefined;
    rowContextActions?: Array<{
      id: string;
      action: {
        type: "navigate";
        route: string;
      } | {
        type: "sidebar";
        sidebarType: string;
      } | {
        type: "mutation";
        procedure: string;
        confirmMessage?: string | undefined;
      };
      label: string;
      icon?: string | undefined;
      condition?: {
        operator: string;
        columnId: string;
        value?: unknown;
      } | undefined;
    }> | undefined;
  };
  baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
  description?: string | undefined;
  category?: string | undefined;
  source?: "user" | "system" | undefined;
  visibility?: "organization" | "private" | undefined;
}
Output
{
  id: string;
  organizationId: string;
  name: string;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
  description: string | null;
  config: ReportConfig;
  category: string | null;
  source: ReportSource | null;
  createdByResourceId: string | null;
  baseEntity: BaseEntityType;
  visibility: ReportVisibility | null;
}
mutationreports.definitions.updateInferred output

Update a report definition.

Input
{
  id: string;
  name?: string | undefined;
  description?: string | null | undefined;
  config?: {
    columns: Array<{
      id: string;
      type: "property";
      name: string;
      displayOrder: number;
      field: string;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    } | {
      id: string;
      type: "aggregation";
      name: string;
      source: string;
      displayOrder: number;
      aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      sourceFilters?: Array<{
        field: string;
        operator: string;
        value?: string | number | boolean | null | undefined;
        values?: Array<string | number | boolean | null> | undefined;
      }> | undefined;
    } | {
      id: string;
      type: "formula";
      name: string;
      displayOrder: number;
      expression: string;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    } | {
      id: string;
      type: "date_series";
      name: string;
      source: string;
      displayOrder: number;
      aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
      dateField: string;
      periodType: "year" | "day" | "week" | "month" | "quarter";
      periods: number;
      periodDirection: "past" | "future";
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      sourceFilters?: Array<{
        field: string;
        operator: string;
        value?: string | number | boolean | null | undefined;
        values?: Array<string | number | boolean | null> | undefined;
      }> | undefined;
      headerFormat?: string | undefined;
      includeTotal?: boolean | undefined;
    } | {
      id: string;
      type: "comparison";
      name: string;
      displayOrder: number;
      currentColumnId: string;
      previousColumnId: string;
      show: "difference" | "percentage_change" | "both";
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      positiveIsGood?: boolean | undefined;
    } | {
      id: string;
      type: "percentage_of_total";
      name: string;
      scope: "grand_total" | "group_total";
      displayOrder: number;
      sourceColumnId: string;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    } | {
      id: string;
      type: "time_series";
      name: string;
      mode: "value" | "cumulative" | "change";
      displayOrder: number;
      periodType: "year" | "day" | "week" | "month" | "quarter";
      periods: number;
      periodDirection: "past" | "future";
      sourceColumnId: string;
      entityDateFields: Array<{
        dateField: string;
        entity: string;
      }>;
      startDate?: string | undefined;
      visible?: boolean | undefined;
      defaultValue?: number | undefined;
      width?: number | null | undefined;
      align?: "left" | "center" | "right" | undefined;
      format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
      formatOptions?: {
        currencyCode?: string | undefined;
        icon?: string | undefined;
        decimalPlaces?: number | undefined;
        trueLabel?: string | undefined;
        falseLabel?: string | undefined;
        statusMap?: Record<string, {
          variant: "default" | "outline" | "destructive" | "secondary";
          label: string;
        }> | undefined;
        subtitleField?: string | undefined;
        prefix?: string | undefined;
        suffix?: string | undefined;
        progressActualField?: string | undefined;
        progressBudgetField?: string | undefined;
        progressValueFormat?: "number" | "hours" | "currency" | undefined;
        relationType?: string | undefined;
      } | undefined;
      totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
      headerFormat?: string | undefined;
      includeTotal?: boolean | undefined;
      changeType?: "percentage" | "absolute" | undefined;
      compareTo?: "previous_period" | "same_period_last_year" | undefined;
      headerStyle?: "numeric" | "auto" | "verbose" | "compact" | undefined;
    }>;
    search?: {
      primaryFields: Array<string>;
      searchGroupLabels: boolean;
    } | undefined;
    filters?: Array<{
      id: string;
      operator: string;
      target: "source" | "row" | "computed";
      value?: unknown;
      values?: Array<unknown> | undefined;
      columnId?: string | undefined;
      sourceField?: string | undefined;
      isUserEditable?: boolean | undefined;
      taskTypeIds?: Array<string> | undefined;
      propagate?: "self" | "subtree" | undefined;
    }> | undefined;
    groupings?: Array<{
      id: string;
      columnId: string;
      level: number;
    }> | undefined;
    sortings?: Array<{
      columnId: string;
      direction: "asc" | "desc";
    }> | undefined;
    rowAction?: {
      type: "navigate" | "sidebar" | "none";
      route?: string | undefined;
      sidebarType?: string | undefined;
    } | undefined;
    rowContextActions?: Array<{
      id: string;
      action: {
        type: "navigate";
        route: string;
      } | {
        type: "sidebar";
        sidebarType: string;
      } | {
        type: "mutation";
        procedure: string;
        confirmMessage?: string | undefined;
      };
      label: string;
      icon?: string | undefined;
      condition?: {
        operator: string;
        columnId: string;
        value?: unknown;
      } | undefined;
    }> | undefined;
  } | undefined;
  category?: string | null | undefined;
  source?: "user" | "system" | undefined;
  visibility?: "organization" | "private" | undefined;
}
Output
{
  id: string;
  organizationId: string;
  name: string;
  description: string | null;
  category: string | null;
  baseEntity: BaseEntityType;
  config: ReportConfig;
  visibility: ReportVisibility | null;
  source: ReportSource | null;
  createdByResourceId: string | null;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
}
mutationreports.definitions.deleteInferred output

Soft delete a report definition.

Input
{
  id: string;
}
Output
{
  success: boolean;
  error: string;
} | {
  success: boolean;
  error?: undefined;
}
mutationreports.definitions.duplicateInferred output

Duplicate a report definition.

Input
{
  id: string;
  name: string;
}
Output
{
  id: string;
  organizationId: string;
  name: string;
  createdAt: Date;
  updatedAt: Date | null;
  deletedAt: Date | null;
  description: string | null;
  config: ReportConfig;
  category: string | null;
  source: ReportSource | null;
  createdByResourceId: string | null;
  baseEntity: BaseEntityType;
  visibility: ReportVisibility | null;
} | null
queryreports.defaults.getInferred output

Get the organization default report for a base entity. If the stored default was deleted or is not visible to the current user, falls back to the first visible Entity:<baseEntity report.

Input
{
  baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
}
Output
{
  reportId: string | null;
  report: {
    id: string;
    organizationId: string;
    name: string;
    description: string | null;
    category: string | null;
    baseEntity: BaseEntityType;
    config: ReportConfig;
    visibility: ReportVisibility | null;
    source: ReportSource | null;
    createdByResourceId: string | null;
    createdAt: Date;
    updatedAt: Date | null;
    deletedAt: Date | null;
  } | null;
}
mutationreports.defaults.setInferred output

Set the organization default report for a base entity.

Input
{
  baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
  reportId: string | null;
}
Output
{
  success: boolean;
  error: string;
  reportId: null;
} | {
  success: boolean;
  reportId: string | null;
  error?: undefined;
}
queryreports.executeInferred output

Execute a report and return results. v2: Can execute either by: - reportId: Load definition from database - columns + baseEntity: Execute ad-hoc configuration (separate params instead of nested config)

Input
{
  columns?: Array<{
    id: string;
    type: "property";
    name: string;
    displayOrder: number;
    field: string;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
  } | {
    id: string;
    type: "aggregation";
    name: string;
    source: string;
    displayOrder: number;
    aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    sourceFilters?: Array<{
      field: string;
      operator: string;
      value?: string | number | boolean | null | undefined;
      values?: Array<string | number | boolean | null> | undefined;
    }> | undefined;
  } | {
    id: string;
    type: "formula";
    name: string;
    displayOrder: number;
    expression: string;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
  } | {
    id: string;
    type: "date_series";
    name: string;
    source: string;
    displayOrder: number;
    aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
    dateField: string;
    periodType: "year" | "day" | "week" | "month" | "quarter";
    periods: number;
    periodDirection: "past" | "future";
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    sourceFilters?: Array<{
      field: string;
      operator: string;
      value?: string | number | boolean | null | undefined;
      values?: Array<string | number | boolean | null> | undefined;
    }> | undefined;
    headerFormat?: string | undefined;
    includeTotal?: boolean | undefined;
  } | {
    id: string;
    type: "comparison";
    name: string;
    displayOrder: number;
    currentColumnId: string;
    previousColumnId: string;
    show: "difference" | "percentage_change" | "both";
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    positiveIsGood?: boolean | undefined;
  } | {
    id: string;
    type: "percentage_of_total";
    name: string;
    scope: "grand_total" | "group_total";
    displayOrder: number;
    sourceColumnId: string;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
  } | {
    id: string;
    type: "time_series";
    name: string;
    mode: "value" | "cumulative" | "change";
    displayOrder: number;
    periodType: "year" | "day" | "week" | "month" | "quarter";
    periods: number;
    periodDirection: "past" | "future";
    sourceColumnId: string;
    entityDateFields: Array<{
      dateField: string;
      entity: string;
    }>;
    startDate?: string | undefined;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    headerFormat?: string | undefined;
    includeTotal?: boolean | undefined;
    changeType?: "percentage" | "absolute" | undefined;
    compareTo?: "previous_period" | "same_period_last_year" | undefined;
    headerStyle?: "numeric" | "auto" | "verbose" | "compact" | undefined;
  }> | undefined;
  search?: string | undefined;
  baseEntity?: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates" | undefined;
  reportId?: string | undefined;
  filters?: Array<{
    id: string;
    operator: string;
    target: "source" | "row" | "computed";
    value?: unknown;
    values?: Array<unknown> | undefined;
    columnId?: string | undefined;
    sourceField?: string | undefined;
    isUserEditable?: boolean | undefined;
    taskTypeIds?: Array<string> | undefined;
    propagate?: "self" | "subtree" | undefined;
  }> | undefined;
  groupings?: Array<{
    id: string;
    columnId: string;
    level: number;
  }> | undefined;
  sortings?: Array<{
    columnId: string;
    direction: "asc" | "desc";
  }> | undefined;
  filterValues?: Record<string, unknown> | undefined;
  page?: number | undefined;
  pageSize?: number | undefined;
  expandedGroupKeys?: Array<string> | undefined;
}
Output
{
  columns: Array<{
    id: string;
    name: string;
    originalColumnId: string;
    periodStart: string | undefined;
    periodEnd: string | undefined;
    type: string;
    format: FormatType | undefined;
    formatOptions: FormatOptions | undefined;
    align: "left" | "center" | "right" | undefined;
    width: number | undefined;
    totalAggregation: any;
    visible: boolean | undefined;
  }>;
  rows: Array<Record<string, unknown>>;
  groupedRows: Array<Record<string, unknown>> | undefined;
  grandTotals: Record<string, unknown>;
  pagination: {
    page: number;
    pageSize: number;
    totalCount: number;
    totalPages: number;
  };
  groupedColumnIds: Array<string>;
  labelField: string;
  error?: undefined;
  errorCode?: undefined;
} | {
  columns: Array<never>;
  rows: Array<never>;
  grandTotals: {};
  pagination: {
    page: number;
    pageSize: number;
    totalCount: number;
    totalPages: number;
  };
  error: string;
  errorCode: string;
  groupedRows?: undefined;
  groupedColumnIds?: undefined;
  labelField?: undefined;
} | {
  columns: Array<never>;
  rows: Array<never>;
  grandTotals: {};
  pagination: {
    page: number;
    pageSize: number;
    totalCount: number;
    totalPages: number;
  };
  error: string;
  groupedRows?: undefined;
  groupedColumnIds?: undefined;
  labelField?: undefined;
  errorCode?: undefined;
}
queryreports.childTasksInferred output

Get child tasks for hierarchical expansion in reports. Returns child tasks of a given parent with the same column structure. Each row includes a hasChildren flag indicating if it can be expanded further.

Input
{
  columns: Array<{
    id: string;
    type: "property";
    name: string;
    displayOrder: number;
    field: string;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
  } | {
    id: string;
    type: "aggregation";
    name: string;
    source: string;
    displayOrder: number;
    aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    sourceFilters?: Array<{
      field: string;
      operator: string;
      value?: string | number | boolean | null | undefined;
      values?: Array<string | number | boolean | null> | undefined;
    }> | undefined;
  } | {
    id: string;
    type: "formula";
    name: string;
    displayOrder: number;
    expression: string;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
  } | {
    id: string;
    type: "date_series";
    name: string;
    source: string;
    displayOrder: number;
    aggregation: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same";
    dateField: string;
    periodType: "year" | "day" | "week" | "month" | "quarter";
    periods: number;
    periodDirection: "past" | "future";
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    sourceFilters?: Array<{
      field: string;
      operator: string;
      value?: string | number | boolean | null | undefined;
      values?: Array<string | number | boolean | null> | undefined;
    }> | undefined;
    headerFormat?: string | undefined;
    includeTotal?: boolean | undefined;
  } | {
    id: string;
    type: "comparison";
    name: string;
    displayOrder: number;
    currentColumnId: string;
    previousColumnId: string;
    show: "difference" | "percentage_change" | "both";
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    positiveIsGood?: boolean | undefined;
  } | {
    id: string;
    type: "percentage_of_total";
    name: string;
    scope: "grand_total" | "group_total";
    displayOrder: number;
    sourceColumnId: string;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
  } | {
    id: string;
    type: "time_series";
    name: string;
    mode: "value" | "cumulative" | "change";
    displayOrder: number;
    periodType: "year" | "day" | "week" | "month" | "quarter";
    periods: number;
    periodDirection: "past" | "future";
    sourceColumnId: string;
    entityDateFields: Array<{
      dateField: string;
      entity: string;
    }>;
    startDate?: string | undefined;
    visible?: boolean | undefined;
    defaultValue?: number | undefined;
    width?: number | null | undefined;
    align?: "left" | "center" | "right" | undefined;
    format?: "number" | "boolean" | "code" | "status" | "phone" | "email" | "date" | "duration" | "datetime" | "hours" | "percentage" | "link" | "contact_type" | "currency" | "text" | "progress" | "avatar" | "avatar_with_subtitle" | "icon_text" | "email_link" | "date_range" | "currency_with_icon" | "date_with_icon" | "hours_with_icon" | "relation" | "entity_label" | undefined;
    formatOptions?: {
      currencyCode?: string | undefined;
      icon?: string | undefined;
      decimalPlaces?: number | undefined;
      trueLabel?: string | undefined;
      falseLabel?: string | undefined;
      statusMap?: Record<string, {
        variant: "default" | "outline" | "destructive" | "secondary";
        label: string;
      }> | undefined;
      subtitleField?: string | undefined;
      prefix?: string | undefined;
      suffix?: string | undefined;
      progressActualField?: string | undefined;
      progressBudgetField?: string | undefined;
      progressValueFormat?: "number" | "hours" | "currency" | undefined;
      relationType?: string | undefined;
    } | undefined;
    totalAggregation?: "max" | "count" | "min" | "sum" | "count_distinct" | "avg" | "same" | undefined;
    headerFormat?: string | undefined;
    includeTotal?: boolean | undefined;
    changeType?: "percentage" | "absolute" | undefined;
    compareTo?: "previous_period" | "same_period_last_year" | undefined;
    headerStyle?: "numeric" | "auto" | "verbose" | "compact" | undefined;
  }>;
  parentTaskId: string;
  filterValues?: Record<string, unknown> | undefined;
}
Output
{
  rows: Array<Record<string, unknown>>;
  error?: undefined;
} | {
  rows: Array<never>;
  error: string;
}
queryreports.metadata.getFieldsInferred output

Get available fields for a base entity. Used by the report builder to show available columns. Includes custom fields defined for the organization.

Input
{
  baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
}
Output
{
  fields: Array<{
    field: string;
    label: string;
    type: "string" | "number" | "boolean" | "date" | "array" | "datetime" | "uuid" | "relation";
    description: string | undefined;
    isCustomField: boolean;
  } | {
    field: string;
    label: string;
    type: string;
    description?: string | undefined;
    isCustomField: boolean;
    options?: Array<{
      value: string;
      label: string;
      color?: string | undefined;
    }> | undefined;
  }>;
  relatedEntities: Array<{
    entity: BaseEntityType;
    relationPath: string;
    name: string;
  }>;
  entityDateFieldOptions: Array<{
    entity: BaseEntityType;
    entityLabel: string;
    dateFields: Array<{
      field: string;
      label: string;
    }>;
    defaultField: string;
  }>;
  baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
}
queryreports.metadata.getAggregationsInferred output

Get available aggregation functions.

Input
void
Output
Array<{
  id: string;
  label: string;
  applicableTo: Array<string>;
}>
queryreports.metadata.getFormatTypesInferred output

Get available format types.

Input
void
Output
Array<{
  id: string;
  label: string;
}>
queryreports.metadata.getRelatedEntitiesInferred output

Get related entities for aggregations on a base entity.

Input
{
  baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
}
Output
Array<{
  entity: BaseEntityType;
  relationPath: string;
  name: string;
}>
queryreports.metadata.getCategoriesInferred output

Get report categories.

Input
unknown
Output
Array<string>