From 6bad0eda8cb5794a57f09752518f49b664f38575 Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Tue, 9 Dec 2025 18:30:25 +0300 Subject: [PATCH 1/3] Create Database.md --- docs/Database.md | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 docs/Database.md diff --git a/docs/Database.md b/docs/Database.md new file mode 100644 index 00000000..1d8f3ed8 --- /dev/null +++ b/docs/Database.md @@ -0,0 +1,117 @@ +We have 2 dbs: + +1) hawk_events - for storing events +2) hawk - for storing hawk data (accounts, workspaces, projects, etc) + + +## Hawk Accounts DB + +1) users - for storing users + +| field | description | example | +|-------|-------------|---------| +| _id | User's id | 5e4f053246587114198eacda | +| email | User's email | "mail@example.com" | +| password | User's password | "$argon2id$v=11$m=4096,t=3,p=1$SKEK3jKkdWOKwPqlEjRc+A$jz07GCY9nVRMMP1wc…" | +| notifications | User's notifications Settings | Object | +| image | User's image | "https://static.hawk.so/4f0120df-15d7-4c0f-9069-f5d67323183b.false" | +| projectsLastVisit | When user last visited project | {67f81efb82a14b26e49dffa7: 1744317119.049} | +| workspaces | User's membership in workspaces | { 5e4ff30a628a6c73a415f4d5: { isPending: false } } | + +2) workspaces - for storing workspaces + +| field | description | example | +|-------|-------------|---------| +| _id | Workspace's id | 5e4fd1214ee6ce18308361ef | +| name | Workspace's name | "My workspae ekekekke" | +| description | Workspace's description | null | +| image | Workspace's image | null | +| tariffPlanId | Workspace's tariff plan id | 5f47f031ff71510040f433c1 | +| lastChargeDate | Workspace's last charge date | 2025-11-17T23:05:00.111+00:00 | +| billingPeriodEventsCount | Workspace's billing period events count | 123440 | +| inviteHash | Workspace's invite hash | "52a72e2195ab264ae5f7a05c477375d49e73b43bcebdc1f9a0039dca34d92a36" | +| isBlocked | Workspace's is blocked | false | + +3) projects - for storing projects + +| field | description | example | +|-------|-------------|---------| +| _id | Project's id | 5e4fd1334ee6ce18308361f2 | +| name | Project's name | "Murrr" | +| workspaceId | Project's workspace id | 5e4fd1214ee6ce18308361ef | +| uidAdded | Project's user id | 5e4fd0f74ee6ce18308361ee | +| token | Project's token | "eyJpbnRlZ3JhdGlvbklkIjoiMDAyZGFkZTAtZjU5ZC00NWY5LWE5ZTAtNGIwZTIxZjk3ZD…" | +| archivedEventsCount | Project's archived events count | 7 | +| integrationId | Project's integration id | "002dade0-f59d-45f9-a9e0-4b0e21f97d2d" | +| notifications | Project's notifications | [{_id: ObjectId, isEnabled: boolean, uidAdded: ObjectId, whatToReceive: string, including: string[], excluding: string[], channels: Object, threshold: number, thresholdPeriod: number}] | + +3) team: + +| field | description | example | +|-------|-------------|---------| +| _id | Team's id | 5e4ff30a628a6cc93e15f4d6 | +| userId | Team's user id. Null in case when user does not accept invitation | 5e4f053246587414198eabda | +| isAdmin | Team's is admin | true | +| userEmail | When uses does not accept invitation, user email is stored here | "cmtt+sentry@notify.flant.com" | + + +## Hawk Events DB + +1) events: + +Stores original events from catchers. + +| field | description | example | +|-------|-------------|---------| +| _id | Event's id | 6893631a2176d3aa56e46b74 | +| groupHash | Event's group hash | "0b8aa4148b28d8dd6f540fbdfa6d4830ab9c738134f56265157118140e79cad2" | +| totalCount | Event's total count | 26482 | +| catcherType | Event's catcher type | "errors/nodejs" | +| payload | Original event payload | See Event Payload for more details | +| timestamp | Event's timestamp | 1754489626 | +| usersAffected | Event's users affected | 0 | +| visitedBy | Event's visited by | Array (6) | + + +2) repetitions: + +All remaining event repetitions are stored here. + +| field | description | example | +|-------|-------------|---------| +| _id | Repetition's id | 690e1e84f47155805f5df476 | +| groupHash | Repetition's group hash | "0b8aa4148b28d8dd6f540fbdfa6d4830ab9c738134f56265157118140e79cad2" | +| delta | Repetition's delta | "{user: 2}" | +| timestamp | Repetition's timestamp | 1762532996 | + +3) dailyEvents: + +Stores daily events grouped by days + +| field | description | example | +|-------|-------------|---------| +| _id | Daily event's id | 690e8c97c5dc69fda8ca321a | +| groupHash | Daily event's group hash | "0b8aa4148b28d8dd6f540fbdfa6d4830ab9c738134f56265157118140e79cad2" | +| groupingTimestamp | Particulary day timestamp | 1762560000 | +| affectedUsers | Daily event's affected users | 0 | +| count | Daily event's count | 14 | +| lastRepetitionId | Daily event's last repetition id | 690fac23f6b9df643ecbdf78 | +| lastRepetitionTime | Daily event's last repetition time | 1762634787 | + + +4) releases + +Stores releases. See Releases for more details. + +| field | description | example | +|-------|-------------|---------| +| _id | Release's id | 68d2fd44bc89c68676bc4ed8 | +| projectId | Release's project id | "67dbc574471d409f3e9ed738" | +| release | Release's release | "v3" | +| files | Release's files | Array (5) | +| commits | Release's commits | Array (empty) | + + +| workspace id | workspace name | project id | project name | website | segment | +| -- | -- | -- | -- | -- | -- | +| 5e4ff30a628a6c73a415f4d5 | KMTT | 60d05cc11271895fded62138 | dtf.ru production [PHP] | https://vc.ru | ... | From 57de58db5792f51ca795099e6ff482ec92151cbc Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:31:23 +0000 Subject: [PATCH 2/3] Bump version up to 1.2.31 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd883f57..d710f56c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hawk.api", - "version": "1.2.30", + "version": "1.2.31", "main": "index.ts", "license": "BUSL-1.1", "scripts": { From 6627e111abc69d4b9cd26ad757ffb66ac16f9254 Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Sat, 13 Dec 2025 00:52:57 +0300 Subject: [PATCH 3/3] Update Database.md --- docs/Database.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/Database.md b/docs/Database.md index 1d8f3ed8..18166e17 100644 --- a/docs/Database.md +++ b/docs/Database.md @@ -10,39 +10,39 @@ We have 2 dbs: | field | description | example | |-------|-------------|---------| -| _id | User's id | 5e4f053246587114198eacda | +| _id | User's id | 5e4f05324658711f198eacda | | email | User's email | "mail@example.com" | | password | User's password | "$argon2id$v=11$m=4096,t=3,p=1$SKEK3jKkdWOKwPqlEjRc+A$jz07GCY9nVRMMP1wc…" | | notifications | User's notifications Settings | Object | -| image | User's image | "https://static.hawk.so/4f0120df-15d7-4c0f-9069-f5d67323183b.false" | -| projectsLastVisit | When user last visited project | {67f81efb82a14b26e49dffa7: 1744317119.049} | -| workspaces | User's membership in workspaces | { 5e4ff30a628a6c73a415f4d5: { isPending: false } } | +| image | User's image | "https://static.hawk.so/4f01f0df-15d7-4c0f-9069-f5d67323183b.false" | +| projectsLastVisit | When user last visited project | {67f81eff82a14b26e49dffa7: 1744317119.049} | +| workspaces | User's membership in workspaces | { 5e4ff30a62fa6c73a415f4d5: { isPending: false } } | 2) workspaces - for storing workspaces | field | description | example | |-------|-------------|---------| -| _id | Workspace's id | 5e4fd1214ee6ce18308361ef | +| _id | Workspace's id | 5e4fd1214ee6ce183f8361ef | | name | Workspace's name | "My workspae ekekekke" | | description | Workspace's description | null | | image | Workspace's image | null | -| tariffPlanId | Workspace's tariff plan id | 5f47f031ff71510040f433c1 | +| tariffPlanId | Workspace's tariff plan id | 5f47f031ff71f10040f433c1 | | lastChargeDate | Workspace's last charge date | 2025-11-17T23:05:00.111+00:00 | | billingPeriodEventsCount | Workspace's billing period events count | 123440 | -| inviteHash | Workspace's invite hash | "52a72e2195ab264ae5f7a05c477375d49e73b43bcebdc1f9a0039dca34d92a36" | +| inviteHash | Workspace's invite hash | "52a72e2195ab264af5f7a05c477375d49e73b43bcebdc1f9a0039dca34d92a36" | | isBlocked | Workspace's is blocked | false | 3) projects - for storing projects | field | description | example | |-------|-------------|---------| -| _id | Project's id | 5e4fd1334ee6ce18308361f2 | +| _id | Project's id | 5e4fd1334ee6ce183e8361f2 | | name | Project's name | "Murrr" | -| workspaceId | Project's workspace id | 5e4fd1214ee6ce18308361ef | +| workspaceId | Project's workspace id | 5e4fd1314ee6ce18308361ef | | uidAdded | Project's user id | 5e4fd0f74ee6ce18308361ee | -| token | Project's token | "eyJpbnRlZ3JhdGlvbklkIjoiMDAyZGFkZTAtZjU5ZC00NWY5LWE5ZTAtNGIwZTIxZjk3ZD…" | +| token | Project's token | "eyJpbeRoZ3JhdGlvbklkIjoiMDAyZGFkZTAtZjU5ZC00NWY5LWE5ZTAtNGIwZTIxZjk3ZD…" | | archivedEventsCount | Project's archived events count | 7 | -| integrationId | Project's integration id | "002dade0-f59d-45f9-a9e0-4b0e21f97d2d" | +| integrationId | Project's integration id | "002dade0-f29d-45f9-a9e0-4b0e21fe7d2d" | | notifications | Project's notifications | [{_id: ObjectId, isEnabled: boolean, uidAdded: ObjectId, whatToReceive: string, including: string[], excluding: string[], channels: Object, threshold: number, thresholdPeriod: number}] | 3) team: @@ -63,8 +63,8 @@ Stores original events from catchers. | field | description | example | |-------|-------------|---------| -| _id | Event's id | 6893631a2176d3aa56e46b74 | -| groupHash | Event's group hash | "0b8aa4148b28d8dd6f540fbdfa6d4830ab9c738134f56265157118140e79cad2" | +| _id | Event's id | 6893631b2176d3aa5ee46b74 | +| groupHash | Event's group hash | "0b8aa4148b28d8dd6f540fbdfa6e4830ab9c738134f56265157118140e79cad2" | | totalCount | Event's total count | 26482 | | catcherType | Event's catcher type | "errors/nodejs" | | payload | Original event payload | See Event Payload for more details | @@ -79,8 +79,8 @@ All remaining event repetitions are stored here. | field | description | example | |-------|-------------|---------| -| _id | Repetition's id | 690e1e84f47155805f5df476 | -| groupHash | Repetition's group hash | "0b8aa4148b28d8dd6f540fbdfa6d4830ab9c738134f56265157118140e79cad2" | +| _id | Repetition's id | 690e1e84f4715e805f5df476 | +| groupHash | Repetition's group hash | "0b8aa4148b28d8dd6ff40fbdfa6d4830ab9c738134f56265157118140e79cad2" | | delta | Repetition's delta | "{user: 2}" | | timestamp | Repetition's timestamp | 1762532996 | @@ -90,12 +90,12 @@ Stores daily events grouped by days | field | description | example | |-------|-------------|---------| -| _id | Daily event's id | 690e8c97c5dc69fda8ca321a | -| groupHash | Daily event's group hash | "0b8aa4148b28d8dd6f540fbdfa6d4830ab9c738134f56265157118140e79cad2" | +| _id | Daily event's id | 690e8c97c5dc69fda8ea321a | +| groupHash | Daily event's group hash | "0b8aa4148b28d8dd6f540fbdfa6e4830ab9c738134f56265157118140e79cad2" | | groupingTimestamp | Particulary day timestamp | 1762560000 | | affectedUsers | Daily event's affected users | 0 | | count | Daily event's count | 14 | -| lastRepetitionId | Daily event's last repetition id | 690fac23f6b9df643ecbdf78 | +| lastRepetitionId | Daily event's last repetition id | 690fbc23f6b9df643ecbdf78 | | lastRepetitionTime | Daily event's last repetition time | 1762634787 | @@ -105,8 +105,8 @@ Stores releases. See ReleasesReleases