Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 173 additions & 6 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ errors:
examples:
- value:
key: value
ForbiddenError:
status-code: 403
type: unknown
docs: Organization does not allow to invite people
BadRequestError:
status-code: 400
type: unknown
docs: ''
docs: Invalid parameters or unsupported KPI type
examples:
- value:
key: value
- value: string
ForbiddenError:
status-code: 403
type: unknown
docs: Organization does not allow to invite people
InternalServerError:
status-code: 500
type: unknown
Expand Down Expand Up @@ -146,6 +146,10 @@ types:
validation:
min: -2147483648
max: 2147483647
user_session:
type: optional<string>
validation:
maxLength: 8
workspace_owner_id:
type: optional<integer>
docs: Owner id of workspace where action performed
Expand Down Expand Up @@ -1429,6 +1433,7 @@ types:
allow_data_credentials: boolean
allow_invite_people: boolean
allow_invite_project_experts: boolean
allow_nda: boolean
allow_organization_webhooks: boolean
allow_sso: boolean
allow_storage_proxy: boolean
Expand All @@ -1441,7 +1446,6 @@ types:
embed_domains: optional<list<map<string, unknown>>>
embed_enabled: boolean
embed_settings: optional<map<string, unknown>>
hide_storage_settings_for_manager: boolean
manual_role_management: boolean
manual_workspace_management: boolean
secure_mode: boolean
Expand Down Expand Up @@ -3047,6 +3051,156 @@ types:
docs: Total cost of the inference (in USD)
source:
openapi: openapi/openapi.yaml
KpiDetailResponse:
docs: |-
Response serializer for KPI detail endpoint.
Structure varies based on segmentation parameters.
properties:
by_user:
type: optional<KpiUserSegment>
docs: User-segmented data (compact format with parallel arrays)
kpi_key:
type: string
docs: KPI identifier
kpi_label:
type: optional<string>
docs: Human-readable KPI label
matrix:
type: optional<KpiMatrixSegment>
docs: 2D matrix (time × user) in compact format
segmentation:
type: SegmentationEnum
docs: |-
Type of segmentation applied

* `none` - none
* `time` - time
* `user` - user
* `matrix` - matrix
time_series:
type: optional<KpiTimeSegment>
docs: Time-segmented data (compact format with parallel arrays)
total:
type: optional<KpiValue>
docs: Total value (no segmentation)
unit:
type: string
docs: 'Unit of measurement: seconds, minutes, hours, count, or ratio'
source:
openapi: openapi/openapi.yaml
KpiMatrixSegment:
docs: |-
Serializer for 2D matrix segmentation (time × user) in compact format.
Returns a 2D array where values[user_index][time_index] corresponds to
users[user_index] at interval_start[time_index].
properties:
interval_start:
docs: Array of time period start timestamps
type: list<datetime>
users:
docs: Array of user information
type: list<KpiUserInfo>
values:
docs: '2D array of values: values[user_index][time_index]'
type: list<list<optional<double>>>
source:
openapi: openapi/openapi.yaml
KpiMetadata:
docs: |-
Serializer for KPI metadata information.
Provides information about available KPIs including their keys, labels,
dependencies, and configuration.
properties:
base_class:
type: string
docs: Base class name that the KPI inherits from
calculation_formula:
type: optional<map<string, unknown>>
docs: >-
Formula for calculated KPIs defining how to derive the value from
component KPIs. Structure: {"type": "ratio|sum|difference|product",
"numerator": "kpi_key", "denominator": "kpi_key"}
date_column:
type: optional<string>
docs: Database column used for date filtering and aggregation
depends_on_kpis:
docs: List of other KPI keys that this KPI depends on
type: list<string>
is_calculated:
type: boolean
docs: Whether this KPI is calculated from other KPIs (has dependencies)
is_label_type:
type: boolean
docs: >-
Whether this KPI is a label/filter type that does not show a value per
se
key:
type: string
docs: Unique identifier for the KPI
label:
type: optional<string>
docs: Human-readable label for the KPI
percentage:
type: boolean
docs: 'Whether the KPI value is a percentage (DEPRECATED: use unit)'
unit:
type: string
docs: 'Unit of measurement: seconds, minutes, hours, count, or ratio'
source:
openapi: openapi/openapi.yaml
KpiTimeSegment:
docs: |-
Serializer for time-segmented KPI data (compact format).
Returns parallel arrays: interval_start and values.
properties:
interval_start:
docs: Array of time period start timestamps
type: list<datetime>
values:
docs: Array of KPI values, one per time period (parallel to interval_start)
type: list<optional<double>>
source:
openapi: openapi/openapi.yaml
KpiUserInfo:
docs: Serializer for user information (compact format).
properties:
user_email:
type: string
docs: User email
validation:
format: email
user_id:
type: integer
docs: User ID
username:
type: string
docs: Username
source:
openapi: openapi/openapi.yaml
KpiUserSegment:
docs: |-
Serializer for user-segmented KPI data (compact format).
Returns parallel arrays: users and values.
properties:
users:
docs: Array of user information
type: list<KpiUserInfo>
values:
docs: Array of KPI values, one per user (parallel to users array)
type: list<optional<double>>
source:
openapi: openapi/openapi.yaml
KpiValue:
docs: Serializer for a single KPI value (no segmentation).
properties:
unit:
type: string
docs: 'Unit of measurement: seconds, minutes, hours, count, or ratio'
value:
type: optional<double>
docs: The KPI value in its native unit
source:
openapi: openapi/openapi.yaml
LseapiTokenCreate:
properties:
created_at: string
Expand Down Expand Up @@ -7650,6 +7804,19 @@ types:
* `Model` - Model
source:
openapi: openapi/openapi.yaml
SegmentationEnum:
enum:
- none
- time
- user
- matrix
docs: |-
* `none` - none
* `time` - time
* `user` - user
* `matrix` - matrix
source:
openapi: openapi/openapi.yaml
SelectedItemsRequest:
properties:
all: boolean
Expand Down
11 changes: 10 additions & 1 deletion .mock/definition/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ types:
source:
openapi: openapi/openapi.yaml
inline: true
ActionsListResponseItemPermission:
discriminated: false
union:
- string
- docs: List of permissions (user needs any all of them)
type: list<string>
source:
openapi: openapi/openapi.yaml
inline: true
ActionsListResponseItem:
properties:
dialog:
Expand All @@ -23,7 +32,7 @@ types:
order:
type: optional<integer>
permission:
type: optional<string>
type: optional<ActionsListResponseItemPermission>
title:
type: optional<string>
source:
Expand Down
128 changes: 128 additions & 0 deletions .mock/definition/analytics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
imports:
root: __package__.yml
service:
auth: false
base-path: ''
endpoints:
api_analytics_kpis_retrieve:
path: /api/analytics/kpis/
method: GET
auth: true
docs: >-
Returns metadata for all available KPI (Key Performance Indicator)
classes. Each KPI includes its key, label, base class, dependencies, and
configuration. This endpoint is useful for discovering available metrics
and understanding their relationships and requirements.
source:
openapi: openapi/openapi.yaml
display-name: List all available KPIs
response:
docs: List of available KPIs with metadata
type: list<root.KpiMetadata>
examples:
- response:
body:
- base_class: base_class
calculation_formula:
key: value
date_column: date_column
depends_on_kpis:
- depends_on_kpis
is_calculated: true
is_label_type: true
key: key
label: label
percentage: true
unit: unit
api_analytics_kpis_retrieve_2:
path: /api/analytics/kpis/{kpi_key}
method: GET
auth: true
docs: >-
Retrieve data for a specific KPI with support for filtering and
segmentation. Can segment by time (hourly, daily, weekly, monthly,
yearly), by user, or both (2D matrix). If no segmentation is specified,
returns a single total value. Supports filtering by projects, members,
and date range. Date filters are interpreted in the specified timezone
(required parameter).
source:
openapi: openapi/openapi.yaml
path-parameters:
kpi_key:
type: string
docs: KPI identifier (key)
display-name: Get KPI data with optional segmentation
request:
name: ApiAnalyticsKpisRetrieve2Request
query-parameters:
end:
type: optional<datetime>
docs: End date for filtering (ISO format)
members:
type: optional<string>
docs: >-
Comma-separated user IDs. If empty, includes all organization
members.
projects:
type: optional<string>
docs: >-
Comma-separated project IDs. If empty, includes all organization
projects.
segment_by_time:
type: optional<string>
docs: 'Time granularity: hourly, daily, weekly, monthly, yearly'
segment_by_user:
type: optional<boolean>
docs: Whether to segment results by user
start:
type: optional<datetime>
docs: Start date for filtering (ISO format)
tz:
type: string
docs: >-
Timezone for date filtering (IANA timezone name, e.g.,
"America/New_York", "UTC"). The start and end dates will be
interpreted in this timezone.
response:
docs: KPI data with requested segmentation
type: root.KpiDetailResponse
errors:
- root.BadRequestError
- root.NotFoundError
examples:
- path-parameters:
kpi_key: kpi_key
query-parameters:
tz: tz
response:
body:
by_user:
users:
- user_email: user_email
user_id: 1
username: username
values:
- 1.1
kpi_key: kpi_key
kpi_label: kpi_label
matrix:
interval_start:
- '2024-01-15T09:30:00Z'
users:
- user_email: user_email
user_id: 1
username: username
values:
- []
segmentation: none
time_series:
interval_start:
- '2024-01-15T09:30:00Z'
values:
- 1.1
total:
unit: unit
value: 1.1
unit: unit
source:
openapi: openapi/openapi.yaml
Loading
Loading