@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.
Files changed (33) hide show
  1. package/client/edge.js +123 -10
  2. package/client/index-browser.js +124 -11
  3. package/client/index.d.ts +30904 -17811
  4. package/client/index.js +123 -10
  5. package/client/package.json +1 -1
  6. package/client/schema.prisma +199 -27
  7. package/client/wasm.js +124 -11
  8. package/dist/index.d.ts +2 -2
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +2 -2
  11. package/dist/index.js.map +1 -1
  12. package/package.json +1 -1
  13. package/prisma/.DS_Store +0 -0
  14. package/prisma/migrations/20260415120000_remove_job_profile_current_phase/migration.sql +2 -0
  15. package/prisma/migrations/20260422120000_add_integration_provider_zoom/migration.sql +2 -0
  16. package/prisma/migrations/20260422140000_add_zoom_meeting_tables/migration.sql +57 -0
  17. package/prisma/migrations/20260422180000_add_zoom_webhook_event/migration.sql +18 -0
  18. package/prisma/migrations/20260423140000_add_interview_platform/migration.sql +6 -0
  19. package/prisma/migrations/20260423150000_remove_interview_zoom_topic/migration.sql +2 -0
  20. package/prisma/migrations/20260423160000_zoom_meeting_uuid/migration.sql +4 -0
  21. package/prisma/migrations/20260424120000_auth_module_user_provider_unique/migration.sql +5 -0
  22. package/prisma/migrations/20260424130000_zoom_meeting_zoom_host_user_id/migration.sql +6 -0
  23. package/prisma/migrations/20260425100000_zoom_participant_user_enum/migration.sql +22 -0
  24. package/prisma/migrations/20260425110000_zoom_participant_zoom_id_required/migration.sql +13 -0
  25. package/prisma/migrations/20260425120000_zoom_participant_id_nullable/migration.sql +4 -0
  26. package/prisma/migrations/migration_lock.toml +3 -0
  27. package/prisma/schema/applications.prisma +1 -1
  28. package/prisma/schema/authModule.prisma +10 -5
  29. package/prisma/schema/integration.prisma +14 -10
  30. package/prisma/schema/interview.prisma +7 -0
  31. package/prisma/schema/user.prisma +1 -0
  32. package/prisma/schema/zoomMeeting.prisma +79 -0
  33. 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,6 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "InterviewPlatform" AS ENUM ('TREADSPACE', 'ZOOM');
3
+
4
+ -- AlterTable
5
+ ALTER TABLE "Interview" ADD COLUMN "interview_platform" "InterviewPlatform" NOT NULL DEFAULT 'TREADSPACE';
6
+ ALTER TABLE "Interview" ADD COLUMN "zoom_topic" TEXT;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Interview" DROP COLUMN IF EXISTS "zoom_topic";
@@ -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,5 @@
1
+ -- AlterTable
2
+ ALTER TABLE "AuthModule" ADD COLUMN "metadata" JSONB NOT NULL DEFAULT '{}';
3
+
4
+ -- CreateIndex
5
+ CREATE UNIQUE INDEX "AuthModule_user_id_provider_key" ON "AuthModule"("user_id", "provider");
@@ -0,0 +1,6 @@
1
+ -- AlterTable
2
+ ALTER TABLE "ZoomMeeting" ADD COLUMN "zoom_host_user_id" TEXT;
3
+
4
+ UPDATE "ZoomMeeting" SET "zoom_host_user_id" = "created_by";
5
+
6
+ ALTER TABLE "ZoomMeeting" ALTER COLUMN "zoom_host_user_id" SET NOT NULL;
@@ -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;
@@ -0,0 +1,3 @@
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (e.g. Git)
3
+ provider = "postgresql"
@@ -22,7 +22,7 @@ model Application {
22
22
  expected_joining_date DateTime?
23
23
  current_ctc String?
24
24
  expected_ctc String?
25
- notice_period String?
25
+ notice_period Int?
26
26
  preferred_location String?
27
27
  // Relations
28
28
  fit_check_status FitCheckStatus?
@@ -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 String @id @default(uuid())
8
-
9
- user_id String
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 String @id @default(uuid())
33
- organisation_id String?
34
- provider IntegrationProvider
35
- auth_type IntegrationAuthType
36
- access_token String?
37
- refresh_token String?
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 String?
40
- api_secret String?
41
- metadata Json @default("{}")
42
- is_active Boolean @default(true)
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
+ }