Skip to content

Commit c648c39

Browse files
robot-ci-heartexfern-api[bot]mcanu
authored
fix: UTC-257: Blueprint url is undefined when accessing from projects table mode (#573)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Marcel Canu <marcel@humansignal.com>
1 parent 021c7a0 commit c648c39

13 files changed

Lines changed: 950 additions & 10 deletions

File tree

.mock/definition/__package__.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ types:
253253
ground_truth_number:
254254
type: integer
255255
docs: Honeypot annotation number in project
256-
has_blueprints: string
257256
id: integer
258257
is_draft:
259258
type: optional<boolean>
@@ -7083,6 +7082,47 @@ types:
70837082
* `RE` - Review
70847083
source:
70857084
openapi: openapi/openapi.yaml
7085+
TaskEvent:
7086+
docs: >-
7087+
Serializer for TaskEvent model to handle event creation from frontend.
7088+
7089+
7090+
This serializer validates and processes task events sent from the labeling
7091+
interface,
7092+
7093+
ensuring proper data format and automatically setting required
7094+
relationships.
7095+
properties:
7096+
actor: integer
7097+
annotation:
7098+
type: optional<integer>
7099+
docs: Annotation ID associated with this event
7100+
annotation_draft:
7101+
type: optional<integer>
7102+
docs: Draft annotation ID associated with this event
7103+
created_at: datetime
7104+
event_key:
7105+
type: string
7106+
docs: >-
7107+
Event type identifier (e.g., "annotation_loaded",
7108+
"region_finished_drawing")
7109+
validation:
7110+
maxLength: 255
7111+
event_time:
7112+
type: datetime
7113+
docs: Timestamp when the event occurred (frontend time)
7114+
id: integer
7115+
meta: optional<unknown>
7116+
organization: integer
7117+
project: integer
7118+
review:
7119+
type: optional<integer>
7120+
docs: Review ID associated with this event
7121+
task:
7122+
type: integer
7123+
docs: Task this event is associated with
7124+
source:
7125+
openapi: openapi/openapi.yaml
70867126
TaskSimple:
70877127
properties:
70887128
annotations: list<Annotation>

.mock/definition/projects.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ service:
199199
expert_instruction: expert_instruction
200200
finished_task_number: 1
201201
ground_truth_number: 1
202-
has_blueprints: has_blueprints
203202
id: 1
204203
is_draft: true
205204
is_published: true

.mock/definition/prompts.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ service:
234234
expert_instruction: expert_instruction
235235
finished_task_number: 1
236236
ground_truth_number: 1
237-
has_blueprints: has_blueprints
238237
id: 1
239238
is_draft: true
240239
is_published: true

.mock/definition/tasks.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,124 @@ service:
546546
- key: value
547547
audiences:
548548
- public
549+
create_event:
550+
path: /api/tasks/{id}/events/
551+
method: POST
552+
auth: true
553+
docs: |2-
554+
555+
Create a new task event to track user interactions and system events during annotation.
556+
557+
This endpoint is designed to receive events from the frontend labeling interface to enable
558+
accurate lead time calculation and detailed annotation analytics.
559+
560+
## Event Types
561+
562+
**Core Annotation Events:**
563+
- `annotation_loaded` - When annotation interface is loaded
564+
- `annotation_submitted` - When annotation is submitted
565+
- `annotation_updated` - When annotation is modified
566+
- `annotation_reviewed` - When annotation is reviewed
567+
568+
**User Activity Events:**
569+
- `visibility_change` - When page visibility changes (tab switch, minimize)
570+
- `idle_detected` - When user goes idle
571+
- `idle_resumed` - When user returns from idle
572+
573+
**Interaction Events:**
574+
- `region_finished_drawing` - When annotation region is completed
575+
- `region_deleted` - When annotation regions are removed
576+
- `hotkey_pressed` - When keyboard shortcuts are used
577+
578+
**Media Events:**
579+
- `video_playback_start/end` - Video playback control
580+
- `audio_playback_start/end` - Audio playback control
581+
- `video_scrub` - Video timeline scrubbing
582+
583+
## Usage
584+
585+
Events are automatically associated with the task specified in the URL path.
586+
The current user is automatically set as the actor. Project and organization
587+
are derived from the task context.
588+
589+
## Example Request
590+
591+
```json
592+
{
593+
"event_key": "annotation_loaded",
594+
"event_time": "2024-01-15T10:30:00Z",
595+
"annotation": 123,
596+
"meta": {
597+
"annotation_count": 5,
598+
"estimated_time": 300
599+
}
600+
}
601+
```
602+
603+
source:
604+
openapi: openapi/openapi.yaml
605+
path-parameters:
606+
id:
607+
type: integer
608+
docs: Task ID to associate the event with
609+
display-name: Create task event
610+
request:
611+
name: TaskEventRequest
612+
body:
613+
properties:
614+
annotation:
615+
type: optional<integer>
616+
docs: Annotation ID associated with this event
617+
annotation_draft:
618+
type: optional<integer>
619+
docs: Draft annotation ID associated with this event
620+
event_key:
621+
type: string
622+
docs: >-
623+
Event type identifier (e.g., "annotation_loaded",
624+
"region_finished_drawing")
625+
validation:
626+
minLength: 1
627+
maxLength: 255
628+
event_time:
629+
type: datetime
630+
docs: Timestamp when the event occurred (frontend time)
631+
meta: optional<unknown>
632+
review:
633+
type: optional<integer>
634+
docs: Review ID associated with this event
635+
content-type: application/json
636+
response:
637+
docs: ''
638+
type: root.TaskEvent
639+
errors:
640+
- root.BadRequestError
641+
- root.UnauthorizedError
642+
- root.ForbiddenError
643+
- root.NotFoundError
644+
examples:
645+
- path-parameters:
646+
id: 1
647+
request:
648+
event_key: event_key
649+
event_time: '2024-01-15T09:30:00Z'
650+
response:
651+
body:
652+
actor: 1
653+
annotation: 1
654+
annotation_draft: 1
655+
created_at: '2024-01-15T09:30:00Z'
656+
event_key: event_key
657+
event_time: '2024-01-15T09:30:00Z'
658+
id: 1
659+
meta:
660+
key: value
661+
organization: 1
662+
project: 1
663+
review: 1
664+
task: 1
665+
audiences:
666+
- public
549667
source:
550668
openapi: openapi/openapi.yaml
551669
types:

.mock/openapi/openapi.yaml

Lines changed: 142 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14760,6 +14760,53 @@ paths:
1476014760
- public
1476114761
x-fern-sdk-group-name: annotations
1476214762
x-fern-sdk-method-name: create
14763+
/api/tasks/{id}/events/:
14764+
post:
14765+
description: "\n Create a new task event to track user interactions and system events during annotation.\n \n This endpoint is designed to receive events from the frontend labeling interface to enable\n accurate lead time calculation and detailed annotation analytics.\n \n ## Event Types\n \n **Core Annotation Events:**\n - `annotation_loaded` - When annotation interface is loaded\n - `annotation_submitted` - When annotation is submitted\n - `annotation_updated` - When annotation is modified\n - `annotation_reviewed` - When annotation is reviewed\n \n **User Activity Events:**\n - `visibility_change` - When page visibility changes (tab switch, minimize)\n - `idle_detected` - When user goes idle\n - `idle_resumed` - When user returns from idle\n \n **Interaction Events:**\n - `region_finished_drawing` - When annotation region is completed\n - `region_deleted` - When annotation regions are removed\n - `hotkey_pressed` - When keyboard shortcuts are used\n \n **Media Events:**\n - `video_playback_start/end` - Video playback control\n - `audio_playback_start/end` - Audio playback control\n - `video_scrub` - Video timeline scrubbing\n \n ## Usage\n \n Events are automatically associated with the task specified in the URL path.\n The current user is automatically set as the actor. Project and organization\n are derived from the task context.\n \n ## Example Request\n \n ```json\n {\n \"event_key\": \"annotation_loaded\",\n \"event_time\": \"2024-01-15T10:30:00Z\",\n \"annotation\": 123,\n \"meta\": {\n \"annotation_count\": 5,\n \"estimated_time\": 300\n }\n }\n ```\n "
14766+
operationId: api_tasks_events_create
14767+
parameters:
14768+
- description: Task ID to associate the event with
14769+
in: path
14770+
name: id
14771+
required: true
14772+
schema:
14773+
type: integer
14774+
requestBody:
14775+
content:
14776+
application/json:
14777+
schema:
14778+
$ref: '#/components/schemas/TaskEventRequest'
14779+
application/x-www-form-urlencoded:
14780+
schema:
14781+
$ref: '#/components/schemas/TaskEventRequest'
14782+
multipart/form-data:
14783+
schema:
14784+
$ref: '#/components/schemas/TaskEventRequest'
14785+
required: true
14786+
responses:
14787+
'201':
14788+
content:
14789+
application/json:
14790+
schema:
14791+
$ref: '#/components/schemas/TaskEvent'
14792+
description: ''
14793+
'400':
14794+
description: Bad request - validation errors
14795+
'401':
14796+
description: Unauthorized - authentication required
14797+
'403':
14798+
description: Forbidden - insufficient permissions
14799+
'404':
14800+
description: Not found - task does not exist
14801+
security:
14802+
- Token: []
14803+
summary: Create task event
14804+
tags:
14805+
- Task Events
14806+
x-fern-audiences:
14807+
- public
14808+
x-fern-sdk-group-name: tasks
14809+
x-fern-sdk-method-name: create_event
1476314810
/api/token/:
1476414811
get:
1476514812
description: List all API tokens for the current user.
@@ -16299,9 +16346,6 @@ components:
1629916346
description: Honeypot annotation number in project
1630016347
readOnly: true
1630116348
type: integer
16302-
has_blueprints:
16303-
readOnly: true
16304-
type: string
1630516349
id:
1630616350
readOnly: true
1630716351
type: integer
@@ -16467,7 +16511,6 @@ components:
1646716511
- description_short
1646816512
- finished_task_number
1646916513
- ground_truth_number
16470-
- has_blueprints
1647116514
- id
1647216515
- members
1647316516
- members_count
@@ -27627,6 +27670,101 @@ components:
2762727670
- id
2762827671
- task
2762927672
type: object
27673+
TaskEvent:
27674+
description: |-
27675+
Serializer for TaskEvent model to handle event creation from frontend.
27676+
27677+
This serializer validates and processes task events sent from the labeling interface,
27678+
ensuring proper data format and automatically setting required relationships.
27679+
properties:
27680+
actor:
27681+
readOnly: true
27682+
type: integer
27683+
annotation:
27684+
description: Annotation ID associated with this event
27685+
nullable: true
27686+
type: integer
27687+
annotation_draft:
27688+
description: Draft annotation ID associated with this event
27689+
nullable: true
27690+
type: integer
27691+
created_at:
27692+
format: date-time
27693+
readOnly: true
27694+
type: string
27695+
event_key:
27696+
description: Event type identifier (e.g., "annotation_loaded", "region_finished_drawing")
27697+
maxLength: 255
27698+
type: string
27699+
event_time:
27700+
description: Timestamp when the event occurred (frontend time)
27701+
format: date-time
27702+
type: string
27703+
id:
27704+
readOnly: true
27705+
type: integer
27706+
meta:
27707+
description: Additional event metadata (region data, hotkey info, etc.)
27708+
nullable: true
27709+
organization:
27710+
readOnly: true
27711+
type: integer
27712+
project:
27713+
readOnly: true
27714+
type: integer
27715+
review:
27716+
description: Review ID associated with this event
27717+
nullable: true
27718+
type: integer
27719+
task:
27720+
description: Task this event is associated with
27721+
readOnly: true
27722+
type: integer
27723+
required:
27724+
- actor
27725+
- created_at
27726+
- event_key
27727+
- event_time
27728+
- id
27729+
- organization
27730+
- project
27731+
- task
27732+
type: object
27733+
TaskEventRequest:
27734+
description: |-
27735+
Serializer for TaskEvent model to handle event creation from frontend.
27736+
27737+
This serializer validates and processes task events sent from the labeling interface,
27738+
ensuring proper data format and automatically setting required relationships.
27739+
properties:
27740+
annotation:
27741+
description: Annotation ID associated with this event
27742+
nullable: true
27743+
type: integer
27744+
annotation_draft:
27745+
description: Draft annotation ID associated with this event
27746+
nullable: true
27747+
type: integer
27748+
event_key:
27749+
description: Event type identifier (e.g., "annotation_loaded", "region_finished_drawing")
27750+
maxLength: 255
27751+
minLength: 1
27752+
type: string
27753+
event_time:
27754+
description: Timestamp when the event occurred (frontend time)
27755+
format: date-time
27756+
type: string
27757+
meta:
27758+
description: Additional event metadata (region data, hotkey info, etc.)
27759+
nullable: true
27760+
review:
27761+
description: Review ID associated with this event
27762+
nullable: true
27763+
type: integer
27764+
required:
27765+
- event_key
27766+
- event_time
27767+
type: object
2763027768
TaskSimple:
2763127769
properties:
2763227770
annotations:

0 commit comments

Comments
 (0)