Skip to content

Commit

Permalink
update schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelmsmith committed Oct 24, 2024
1 parent 9f2d6eb commit dc01b8b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
47 changes: 17 additions & 30 deletions frontend/src/queries/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10148,6 +10148,21 @@
"required": ["k", "t"],
"type": "object"
},
"RecordingOrder": {
"enum": [
"duration",
"recording_duration",
"inactive_seconds",
"active_seconds",
"start_time",
"console_error_count",
"click_count",
"keypress_count",
"mouse_activity_count",
"activity_score"
],
"type": "string"
},
"RecordingPropertyFilter": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -10237,35 +10252,7 @@
"$ref": "#/definitions/FilterLogicalOperator"
},
"order": {
"anyOf": [
{
"$ref": "#/definitions/DurationType"
},
{
"const": "start_time",
"type": "string"
},
{
"const": "console_error_count",
"type": "string"
},
{
"const": "click_count",
"type": "string"
},
{
"const": "keypress_count",
"type": "string"
},
{
"const": "mouse_activity_count",
"type": "string"
},
{
"const": "activity_score",
"type": "string"
}
]
"$ref": "#/definitions/RecordingOrder"
},
"person_uuid": {
"type": "string"
Expand All @@ -10289,7 +10276,7 @@
"type": "object"
}
},
"required": ["kind", "order"],
"required": ["kind"],
"type": "object"
},
"RecordingsQueryResponse": {
Expand Down
15 changes: 14 additions & 1 deletion posthog/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,19 @@ class QueryTiming(BaseModel):
t: float = Field(..., description="Time in seconds. Shortened to 't' to save on data.")


class RecordingOrder(StrEnum):
DURATION = "duration"
RECORDING_DURATION = "recording_duration"
INACTIVE_SECONDS = "inactive_seconds"
ACTIVE_SECONDS = "active_seconds"
START_TIME = "start_time"
CONSOLE_ERROR_COUNT = "console_error_count"
CLICK_COUNT = "click_count"
KEYPRESS_COUNT = "keypress_count"
MOUSE_ACTIVITY_COUNT = "mouse_activity_count"
ACTIVITY_SCORE = "activity_score"


class RecordingPropertyFilter(BaseModel):
model_config = ConfigDict(
extra="forbid",
Expand Down Expand Up @@ -5255,7 +5268,7 @@ class RecordingsQuery(BaseModel):
)
offset: Optional[int] = None
operand: Optional[FilterLogicalOperator] = None
order: Union[DurationType, str]
order: Optional[RecordingOrder] = None
person_uuid: Optional[str] = None
properties: Optional[
list[
Expand Down

0 comments on commit dc01b8b

Please sign in to comment.