@adaptware/eagles-db 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/edge.js +123 -10
- package/client/index-browser.js +124 -11
- package/client/index.d.ts +30904 -17811
- package/client/index.js +123 -10
- package/client/package.json +1 -1
- package/client/schema.prisma +199 -27
- package/client/wasm.js +124 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/prisma/.DS_Store +0 -0
- package/prisma/migrations/20260415120000_remove_job_profile_current_phase/migration.sql +2 -0
- package/prisma/migrations/20260422120000_add_integration_provider_zoom/migration.sql +2 -0
- package/prisma/migrations/20260422140000_add_zoom_meeting_tables/migration.sql +57 -0
- package/prisma/migrations/20260422180000_add_zoom_webhook_event/migration.sql +18 -0
- package/prisma/migrations/20260423140000_add_interview_platform/migration.sql +6 -0
- package/prisma/migrations/20260423150000_remove_interview_zoom_topic/migration.sql +2 -0
- package/prisma/migrations/20260423160000_zoom_meeting_uuid/migration.sql +4 -0
- package/prisma/migrations/20260424120000_auth_module_user_provider_unique/migration.sql +5 -0
- package/prisma/migrations/20260424130000_zoom_meeting_zoom_host_user_id/migration.sql +6 -0
- package/prisma/migrations/20260425100000_zoom_participant_user_enum/migration.sql +22 -0
- package/prisma/migrations/20260425110000_zoom_participant_zoom_id_required/migration.sql +13 -0
- package/prisma/migrations/20260425120000_zoom_participant_id_nullable/migration.sql +4 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema/applications.prisma +1 -1
- package/prisma/schema/authModule.prisma +10 -5
- package/prisma/schema/integration.prisma +14 -10
- package/prisma/schema/interview.prisma +7 -0
- package/prisma/schema/user.prisma +1 -0
- package/prisma/schema/zoomMeeting.prisma +79 -0
- package/client/libquery_engine-darwin.dylib.node +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- CreateTable
|
|
2
|
+
CREATE TABLE "ZoomWebhookEvent" (
|
|
3
|
+
"id" TEXT NOT NULL,
|
|
4
|
+
"dedupe_key" TEXT NOT NULL,
|
|
5
|
+
"event" TEXT NOT NULL,
|
|
6
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
7
|
+
|
|
8
|
+
CONSTRAINT "ZoomWebhookEvent_pkey" PRIMARY KEY ("id")
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
-- CreateIndex
|
|
12
|
+
CREATE UNIQUE INDEX "ZoomWebhookEvent_dedupe_key_key" ON "ZoomWebhookEvent"("dedupe_key");
|
|
13
|
+
|
|
14
|
+
-- CreateIndex
|
|
15
|
+
CREATE INDEX "ZoomWebhookEvent_event_idx" ON "ZoomWebhookEvent"("event");
|
|
16
|
+
|
|
17
|
+
-- CreateIndex
|
|
18
|
+
CREATE INDEX "ZoomWebhookEvent_created_at_idx" ON "ZoomWebhookEvent"("created_at");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
-- Zoom meeting instance UUID for RTMS `meeting.rtms_started` correlation (webhook `meeting_uuid`).
|
|
2
|
+
ALTER TABLE "ZoomMeeting" ADD COLUMN IF NOT EXISTS "zoom_meeting_uuid" TEXT;
|
|
3
|
+
|
|
4
|
+
CREATE INDEX IF NOT EXISTS "ZoomMeeting_zoom_meeting_uuid_idx" ON "ZoomMeeting"("zoom_meeting_uuid");
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
-- CreateEnum
|
|
2
|
+
CREATE TYPE "ZoomMeetingParticipantRole" AS ENUM ('CANDIDATE', 'INTERVIEWER');
|
|
3
|
+
|
|
4
|
+
-- Participant rows are re-derived on the next Zoom meeting upsert; old webhook denormalized rows are dropped.
|
|
5
|
+
TRUNCATE TABLE "ZoomMeetingParticipant";
|
|
6
|
+
|
|
7
|
+
-- AlterTable
|
|
8
|
+
ALTER TABLE "ZoomMeetingParticipant" DROP COLUMN "zoom_participant_id",
|
|
9
|
+
DROP COLUMN "user_name",
|
|
10
|
+
DROP COLUMN "user_email",
|
|
11
|
+
DROP COLUMN "join_time",
|
|
12
|
+
DROP COLUMN "leave_time",
|
|
13
|
+
DROP COLUMN "role";
|
|
14
|
+
|
|
15
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "role" "ZoomMeetingParticipantRole" NOT NULL;
|
|
16
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "user_id" TEXT NOT NULL;
|
|
17
|
+
|
|
18
|
+
-- AddForeignKey
|
|
19
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD CONSTRAINT "ZoomMeetingParticipant_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
20
|
+
|
|
21
|
+
-- CreateIndex
|
|
22
|
+
CREATE INDEX "ZoomMeetingParticipant_user_id_idx" ON "ZoomMeetingParticipant"("user_id");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- AlterTable
|
|
2
|
+
ALTER TABLE "ZoomMeetingParticipant" ADD COLUMN "zoom_participant_id" TEXT NOT NULL DEFAULT '';
|
|
3
|
+
|
|
4
|
+
UPDATE "ZoomMeetingParticipant" zmp
|
|
5
|
+
SET "zoom_participant_id" = COALESCE(NULLIF(TRIM(am."provider_account_id"), ''), '')
|
|
6
|
+
FROM "AuthModule" am
|
|
7
|
+
WHERE am."user_id" = zmp."user_id"
|
|
8
|
+
AND am."provider"::text = 'ZOOM'
|
|
9
|
+
AND am."is_active" = true;
|
|
10
|
+
|
|
11
|
+
ALTER TABLE "ZoomMeetingParticipant" ALTER COLUMN "zoom_participant_id" DROP DEFAULT;
|
|
12
|
+
|
|
13
|
+
CREATE INDEX "ZoomMeetingParticipant_zoom_participant_id_idx" ON "ZoomMeetingParticipant"("zoom_participant_id");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
-- Optional: only present when that User has Zoom OAuth linked (typically interviewer; often unknown for candidate).
|
|
2
|
+
UPDATE "ZoomMeetingParticipant" SET "zoom_participant_id" = NULL WHERE "zoom_participant_id" = '';
|
|
3
|
+
|
|
4
|
+
ALTER TABLE "ZoomMeetingParticipant" ALTER COLUMN "zoom_participant_id" DROP NOT NULL;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
enum AuthProvider {
|
|
2
2
|
GOOGLE
|
|
3
3
|
MICROSOFT
|
|
4
|
+
ZOOM
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
model AuthModule {
|
|
7
|
-
id
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
user User @relation("UserAuthModule", fields: [user_id], references: [id], onDelete: Cascade)
|
|
11
|
-
|
|
8
|
+
id String @id @default(uuid())
|
|
9
|
+
user_id String
|
|
10
|
+
/// The provider of the authentication module
|
|
12
11
|
provider AuthProvider
|
|
13
12
|
provider_account_id String? @db.Text
|
|
14
13
|
|
|
@@ -22,9 +21,15 @@ model AuthModule {
|
|
|
22
21
|
scope String?
|
|
23
22
|
is_active Boolean @default(true)
|
|
24
23
|
|
|
24
|
+
/// Provider-specific JSON (e.g. Zoom: email, display); tokens remain in encrypted columns.
|
|
25
|
+
metadata Json @default("{}")
|
|
26
|
+
|
|
25
27
|
created_at DateTime @default(now())
|
|
26
28
|
updated_at DateTime @updatedAt
|
|
27
29
|
|
|
30
|
+
user User @relation("UserAuthModule", fields: [user_id], references: [id], onDelete: Cascade)
|
|
31
|
+
|
|
32
|
+
@@unique([user_id, provider])
|
|
28
33
|
@@unique([provider, provider_account_id])
|
|
29
34
|
@@index([user_id])
|
|
30
35
|
}
|
|
@@ -2,11 +2,15 @@ enum IntegrationProvider {
|
|
|
2
2
|
NAUKRI
|
|
3
3
|
ZOHO_RECRUIT
|
|
4
4
|
LINKEDIN
|
|
5
|
+
GOOGLE
|
|
6
|
+
MICROSOFT
|
|
7
|
+
ZOOM
|
|
5
8
|
}
|
|
6
9
|
|
|
7
10
|
enum IntegrationAuthType {
|
|
8
11
|
OAUTH2
|
|
9
12
|
API_KEY
|
|
13
|
+
SSO
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
enum SyncDirection {
|
|
@@ -29,17 +33,17 @@ enum SyncStatus {
|
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
model IntegrationCredential {
|
|
32
|
-
id
|
|
33
|
-
organisation_id
|
|
34
|
-
provider
|
|
35
|
-
auth_type
|
|
36
|
-
access_token
|
|
37
|
-
refresh_token
|
|
36
|
+
id String @id @default(uuid())
|
|
37
|
+
organisation_id String?
|
|
38
|
+
provider IntegrationProvider
|
|
39
|
+
auth_type IntegrationAuthType
|
|
40
|
+
access_token String?
|
|
41
|
+
refresh_token String?
|
|
38
42
|
token_expires_at DateTime?
|
|
39
|
-
api_key
|
|
40
|
-
api_secret
|
|
41
|
-
metadata
|
|
42
|
-
is_active
|
|
43
|
+
api_key String?
|
|
44
|
+
api_secret String?
|
|
45
|
+
metadata Json @default("{}")
|
|
46
|
+
is_active Boolean @default(true)
|
|
43
47
|
|
|
44
48
|
organisation Organisation? @relation(fields: [organisation_id], references: [id], onDelete: Cascade)
|
|
45
49
|
|
|
@@ -15,6 +15,11 @@ enum InterviewFeedback {
|
|
|
15
15
|
STRONG_NO_HIRE
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
enum InterviewPlatform {
|
|
19
|
+
TREADSPACE
|
|
20
|
+
ZOOM
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
model Interview {
|
|
19
24
|
id String @id @default(uuid())
|
|
20
25
|
/// Foreign keys
|
|
@@ -34,6 +39,7 @@ model Interview {
|
|
|
34
39
|
actual_end_time DateTime?
|
|
35
40
|
recording_url String?
|
|
36
41
|
interview_status InterviewStatus @default(SCHEDULED)
|
|
42
|
+
interview_platform InterviewPlatform @default(TREADSPACE)
|
|
37
43
|
google_event_id String?
|
|
38
44
|
/// Old Feedback fields will be deprecated soon
|
|
39
45
|
ai_interview_feedback InterviewFeedback?
|
|
@@ -68,6 +74,7 @@ model Interview {
|
|
|
68
74
|
feedback Feedback[]
|
|
69
75
|
interviewNotes InterviewNotes[]
|
|
70
76
|
liveAnalysis LiveAnalysis[]
|
|
77
|
+
zoom_meeting ZoomMeeting?
|
|
71
78
|
@@unique([interviewer_id, candidate_id, evaluation_plan_id])
|
|
72
79
|
@@index([candidate_id])
|
|
73
80
|
@@index([interviewer_id])
|
|
@@ -54,6 +54,7 @@ model User {
|
|
|
54
54
|
assigned_job_profiles JobProfile[] @relation("ProfileAssignee")
|
|
55
55
|
user_auth_modules AuthModule[] @relation("UserAuthModule")
|
|
56
56
|
refresh_token_auth RefreshToken[] @relation("TokenRefresh")
|
|
57
|
+
zoom_meeting_participants ZoomMeetingParticipant[]
|
|
57
58
|
notes Notes[]
|
|
58
59
|
|
|
59
60
|
name String?
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/// Expected attendee slot when persisting interview-linked Zoom participants (`CANDIDATE` | `INTERVIEWER`).
|
|
2
|
+
enum ZoomMeetingParticipantRole {
|
|
3
|
+
CANDIDATE
|
|
4
|
+
INTERVIEWER
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/// Zoom meeting linked 1:1 to an interview; Zoom REST host is `zoom_host_user_id`.
|
|
8
|
+
model ZoomMeeting {
|
|
9
|
+
id String @id @default(uuid())
|
|
10
|
+
/// One Zoom row per interview.
|
|
11
|
+
interview_id String @unique
|
|
12
|
+
interview Interview @relation(fields: [interview_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
13
|
+
|
|
14
|
+
/// Treadspace user id whose Zoom User-OAuth token created this meeting; required for PATCH/DELETE on Zoom REST.
|
|
15
|
+
/// Set from the Zoom host `userId` in `ZoomMeetingDAO.upsertZoomParticipants` (same user as `POST /users/me/meetings`).
|
|
16
|
+
zoom_host_user_id String
|
|
17
|
+
|
|
18
|
+
/// Zoom REST/API meeting id (same value used as Meeting SDK `meetingNumber` / JWT `mn`).
|
|
19
|
+
zoom_meeting_id String
|
|
20
|
+
/// Zoom meeting **instance** UUID from REST create (`uuid`) and RTMS/webhooks (`meeting_uuid`).
|
|
21
|
+
zoom_meeting_uuid String?
|
|
22
|
+
join_url String
|
|
23
|
+
start_url String?
|
|
24
|
+
password String?
|
|
25
|
+
topic String?
|
|
26
|
+
|
|
27
|
+
scheduled_start_time DateTime?
|
|
28
|
+
scheduled_end_time DateTime?
|
|
29
|
+
|
|
30
|
+
is_active Boolean @default(true)
|
|
31
|
+
|
|
32
|
+
created_at DateTime @default(now())
|
|
33
|
+
updated_at DateTime @updatedAt
|
|
34
|
+
/// Audit; kept aligned with `zoom_host_user_id` when the meeting is recreated under a new host.
|
|
35
|
+
created_by String
|
|
36
|
+
updated_by String
|
|
37
|
+
|
|
38
|
+
participants ZoomMeetingParticipant[]
|
|
39
|
+
|
|
40
|
+
@@index([interview_id])
|
|
41
|
+
@@index([zoom_meeting_id])
|
|
42
|
+
@@index([zoom_meeting_uuid])
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// Expected participants for a `ZoomMeeting`: links to `User` (candidate / interviewer). Replaced on each meeting upsert.
|
|
46
|
+
model ZoomMeetingParticipant {
|
|
47
|
+
id String @id @default(uuid())
|
|
48
|
+
zoom_meeting_row_id String
|
|
49
|
+
zoom_meeting ZoomMeeting @relation(fields: [zoom_meeting_row_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
50
|
+
user_id String
|
|
51
|
+
user User @relation(fields: [user_id], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
|
52
|
+
/// Zoom account id (`AuthModule.provider_account_id`) when this `user_id` has linked Zoom; usually set for interviewer, often null for candidate.
|
|
53
|
+
zoom_participant_id String?
|
|
54
|
+
role ZoomMeetingParticipantRole
|
|
55
|
+
|
|
56
|
+
is_active Boolean @default(true)
|
|
57
|
+
|
|
58
|
+
created_at DateTime @default(now())
|
|
59
|
+
updated_at DateTime @updatedAt
|
|
60
|
+
created_by String
|
|
61
|
+
updated_by String
|
|
62
|
+
|
|
63
|
+
@@index([zoom_meeting_row_id])
|
|
64
|
+
@@index([user_id])
|
|
65
|
+
@@index([zoom_participant_id])
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// Ledger of processed Zoom webhook deliveries: one row per `dedupe_key` (request id or body hash).
|
|
69
|
+
/// Stops double-handling when Zoom retries the same notification (e.g. RTMS, `meeting.started`).
|
|
70
|
+
model ZoomWebhookEvent {
|
|
71
|
+
id String @id @default(uuid())
|
|
72
|
+
/// Stable key: SHA-256 of raw request body, or `x-zm-trackingid` when present.
|
|
73
|
+
dedupe_key String @unique
|
|
74
|
+
event String
|
|
75
|
+
created_at DateTime @default(now())
|
|
76
|
+
|
|
77
|
+
@@index([event])
|
|
78
|
+
@@index([created_at])
|
|
79
|
+
}
|
|
Binary file
|