Reports
Report definitions, saved views, grouped data, and export workflows.
reports.definitions.listInferred outputList report definitions for the organization.
{
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{
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;
}reports.definitions.getByIdInferred outputGet a single report definition by ID.
{
id: string;
}{
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;
} | nullreports.definitions.createInferred outputCreate a new report definition.
{
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;
}{
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;
}reports.definitions.updateInferred outputUpdate a report definition.
{
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;
}{
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;
}reports.definitions.deleteInferred outputSoft delete a report definition.
{
id: string;
}{
success: boolean;
error: string;
} | {
success: boolean;
error?: undefined;
}reports.definitions.duplicateInferred outputDuplicate a report definition.
{
id: string;
name: string;
}{
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;
} | nullreports.defaults.getInferred outputGet 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.
{
baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
}{
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;
}reports.defaults.setInferred outputSet the organization default report for a base entity.
{
baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
reportId: string | null;
}{
success: boolean;
error: string;
reportId: null;
} | {
success: boolean;
reportId: string | null;
error?: undefined;
}reports.executeInferred outputExecute 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)
{
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;
}{
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;
}reports.childTasksInferred outputGet 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.
{
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;
}{
rows: Array<Record<string, unknown>>;
error?: undefined;
} | {
rows: Array<never>;
error: string;
}reports.metadata.getFieldsInferred outputGet available fields for a base entity. Used by the report builder to show available columns. Includes custom fields defined for the organization.
{
baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
}{
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";
}reports.metadata.getAggregationsInferred outputGet available aggregation functions.
voidArray<{
id: string;
label: string;
applicableTo: Array<string>;
}>reports.metadata.getFormatTypesInferred outputGet available format types.
voidArray<{
id: string;
label: string;
}>reports.metadata.getRelatedEntitiesInferred outputGet related entities for aggregations on a base entity.
{
baseEntity: "projects" | "resource_allocations" | "resource_pools" | "contacts" | "time_entries" | "expenses" | "milestones" | "resources" | "purchase_orders" | "quotes" | "invoices" | "invoice_lines" | "tasks" | "rates";
}Array<{
entity: BaseEntityType;
relationPath: string;
name: string;
}>reports.metadata.getCategoriesInferred outputGet report categories.
unknownArray<string>