import { RpcMethod } from './commonTypes'; import { TimeInterval as pushwoosh_statistics_types_TimeInterval } from './pushwoosh_statistics_types'; export type DashboardsService_GetLinearChartMetrics = RpcMethod; export type DashboardsService_GetTotalsChartMetrics = RpcMethod; export type DashboardsService_GetFunnel = RpcMethod; export interface DashboardsService { /** GetLinearChartMetrics returns metrics for linear charts based on provided parameters */ GetLinearChartMetrics: DashboardsService_GetLinearChartMetrics; /** GetTotalsChartMetrics returns total metrics for charts based on provided parameters */ GetTotalsChartMetrics: DashboardsService_GetTotalsChartMetrics; /** GetFunnel returns funnel data based on provided parameters */ GetFunnel: DashboardsService_GetFunnel; } export type Breakdown = 'BREAKDOWN_UNKNOWN' | 'PLATFORMS' | 'EVENT_ATTRIBUTE' | 'TAG_VALUES' | 'CAMPAIGNS' | 'MESSAGES' | 'JOURNEYS' | 'SEGMENTS'; export type MathOperator = 'MATH_OPERATOR_UNSPECIFIED' | 'EQ' | 'NOT_EQ' | 'GTE' | 'LTE' | 'BETWEEN' | 'IN' | 'NOT_IN' | 'ANY' | 'NOT_SET'; export type EventCalcType = 'EVENT_CALC_TYPE_ALL' | 'EVENT_CALC_TYPE_UNIQUE'; export type Value_kind_string = { type: 'string'; data: string; }; export type Value_kind_integer = { type: 'integer'; data: number; }; export type Value_kind_decimal = { type: 'decimal'; data: number; }; export type Value_kind_boolean = { type: 'boolean'; data: boolean; }; export type Value_kind_list = { type: 'list'; data: List; }; export type Value_kind_date = { type: 'date'; data: Date; }; export type Value_kind = Value_kind_string | Value_kind_integer | Value_kind_decimal | Value_kind_boolean | Value_kind_list | Value_kind_date; export type Value = { kind: Value_kind; }; export type List = { values: string[]; }; export type AttributeCondition = { name: string; operator: MathOperator; values: Value[]; }; export type Metric = { id: number; eventName: string; attributeConditions: AttributeCondition[]; tag: string; eventCalcType: EventCalcType; }; /** TypeFilter defines the type of filter to apply */ export type ChartParams_TypeFilter = 'Platform' | 'Segment' | 'Push' | 'Email' | 'Campaign' | 'Journey'; export type ChartParams_TimeRange = { from: Date; to: Date; interval: pushwoosh_statistics_types_TimeInterval; }; export type ChartParams_Filters = { /** platforms - list of platform IDs to filter by */ platforms: number[]; messagesIds: number[]; campaignsCodes: string[]; attributeConditions: AttributeCondition[]; segment: string; }; export type ChartParams_Filter = { type: ChartParams_TypeFilter; platforms: number[]; segment: string; pushId: number; emailId: number; campaign: string; journey: string; jPoints: string[]; disabled: boolean; }; export type ChartParams_BreakdownParams = { type: Breakdown; eventAttribute: string; /** should be one of the metrics from the metrics array */ metric: Metric; }; /** ChartParams defines the parameters for chart metrics requests */ export type ChartParams = { timeRange: ChartParams_TimeRange; metrics: Metric[]; filters: ChartParams_Filters; fltrs: ChartParams_Filter[]; breakdown: ChartParams_BreakdownParams; application: string; timezone: string; }; export type GetLinearChartMetricsRequest = { params: ChartParams; }; export type GetLinearChartMetricsResponse_Breakdown = { breakdown: string; values: number[]; total: number; }; export type GetLinearChartMetricsResponse_Metric = { metric: string; breakdowns: GetLinearChartMetricsResponse_Breakdown[]; }; export type GetLinearChartMetricsResponse = { timestamps: Date[]; metrics: GetLinearChartMetricsResponse_Metric[]; /** * codes of the requested segments whose snapshot is not prepared: their * filtering was NOT applied to the returned metrics */ notPreparedSegments: string[]; }; export type GetTotalsChartMetricsRequest = { params: ChartParams; }; export type GetTotalsChartMetricsResponse_Breakdown = { breakdown: string; value: number; total: number; }; export type GetTotalsChartMetricsResponse_Metric = { metric: string; breakdowns: GetTotalsChartMetricsResponse_Breakdown[]; }; export type GetTotalsChartMetricsResponse = { metrics: GetTotalsChartMetricsResponse_Metric[]; /** * codes of the requested segments whose snapshot is not prepared: their * filtering was NOT applied to the returned metrics */ notPreparedSegments: string[]; }; export type GetFunnelRequest = { params: ChartParams; }; export type GetFunnelResponse_Step = { breakdown: string; count: number; percent: number; }; export type GetFunnelResponse = { steps: GetFunnelResponse_Step[]; };