@dolusoft/hirebase-mcp 1.1.8
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/README.md +261 -0
- package/dist/application/dto/candidate-summary.d.ts +10 -0
- package/dist/application/dto/candidate-summary.js +2 -0
- package/dist/application/dto/candidate-summary.js.map +1 -0
- package/dist/application/dto/extracted-cv.d.ts +46 -0
- package/dist/application/dto/extracted-cv.js +2 -0
- package/dist/application/dto/extracted-cv.js.map +1 -0
- package/dist/application/dto/filter-input.d.ts +7 -0
- package/dist/application/dto/filter-input.js +2 -0
- package/dist/application/dto/filter-input.js.map +1 -0
- package/dist/application/dto/index.d.ts +5 -0
- package/dist/application/dto/index.js +2 -0
- package/dist/application/dto/index.js.map +1 -0
- package/dist/application/dto/search-results.d.ts +13 -0
- package/dist/application/dto/search-results.js +2 -0
- package/dist/application/dto/search-results.js.map +1 -0
- package/dist/application/dto/stats.d.ts +10 -0
- package/dist/application/dto/stats.js +2 -0
- package/dist/application/dto/stats.js.map +1 -0
- package/dist/application/ports/document-parser.d.ts +8 -0
- package/dist/application/ports/document-parser.js +2 -0
- package/dist/application/ports/document-parser.js.map +1 -0
- package/dist/application/ports/embedding-service.d.ts +4 -0
- package/dist/application/ports/embedding-service.js +2 -0
- package/dist/application/ports/embedding-service.js.map +1 -0
- package/dist/application/ports/export-service.d.ts +5 -0
- package/dist/application/ports/export-service.js +2 -0
- package/dist/application/ports/export-service.js.map +1 -0
- package/dist/application/ports/index.d.ts +4 -0
- package/dist/application/ports/index.js +2 -0
- package/dist/application/ports/index.js.map +1 -0
- package/dist/application/ports/structured-extractor.d.ts +4 -0
- package/dist/application/ports/structured-extractor.js +2 -0
- package/dist/application/ports/structured-extractor.js.map +1 -0
- package/dist/application/use-cases/add-cv.d.ts +16 -0
- package/dist/application/use-cases/add-cv.js +113 -0
- package/dist/application/use-cases/add-cv.js.map +1 -0
- package/dist/application/use-cases/add-job-posting.d.ts +17 -0
- package/dist/application/use-cases/add-job-posting.js +27 -0
- package/dist/application/use-cases/add-job-posting.js.map +1 -0
- package/dist/application/use-cases/add-pipeline-note.d.ts +15 -0
- package/dist/application/use-cases/add-pipeline-note.js +34 -0
- package/dist/application/use-cases/add-pipeline-note.js.map +1 -0
- package/dist/application/use-cases/add-to-pipeline.d.ts +18 -0
- package/dist/application/use-cases/add-to-pipeline.js +54 -0
- package/dist/application/use-cases/add-to-pipeline.js.map +1 -0
- package/dist/application/use-cases/bulk-add-cvs.d.ts +14 -0
- package/dist/application/use-cases/bulk-add-cvs.js +32 -0
- package/dist/application/use-cases/bulk-add-cvs.js.map +1 -0
- package/dist/application/use-cases/delete-cv.d.ts +10 -0
- package/dist/application/use-cases/delete-cv.js +21 -0
- package/dist/application/use-cases/delete-cv.js.map +1 -0
- package/dist/application/use-cases/export-results.d.ts +9 -0
- package/dist/application/use-cases/export-results.js +21 -0
- package/dist/application/use-cases/export-results.js.map +1 -0
- package/dist/application/use-cases/filter-candidates.d.ts +9 -0
- package/dist/application/use-cases/filter-candidates.js +51 -0
- package/dist/application/use-cases/filter-candidates.js.map +1 -0
- package/dist/application/use-cases/get-candidate-history.d.ts +25 -0
- package/dist/application/use-cases/get-candidate-history.js +36 -0
- package/dist/application/use-cases/get-candidate-history.js.map +1 -0
- package/dist/application/use-cases/get-cv-chunks.d.ts +15 -0
- package/dist/application/use-cases/get-cv-chunks.js +18 -0
- package/dist/application/use-cases/get-cv-chunks.js.map +1 -0
- package/dist/application/use-cases/get-cv-detail.d.ts +7 -0
- package/dist/application/use-cases/get-cv-detail.js +15 -0
- package/dist/application/use-cases/get-cv-detail.js.map +1 -0
- package/dist/application/use-cases/get-cv-versions.d.ts +9 -0
- package/dist/application/use-cases/get-cv-versions.js +18 -0
- package/dist/application/use-cases/get-cv-versions.js.map +1 -0
- package/dist/application/use-cases/get-pending-actions.d.ts +23 -0
- package/dist/application/use-cases/get-pending-actions.js +50 -0
- package/dist/application/use-cases/get-pending-actions.js.map +1 -0
- package/dist/application/use-cases/get-pipeline.d.ts +27 -0
- package/dist/application/use-cases/get-pipeline.js +40 -0
- package/dist/application/use-cases/get-pipeline.js.map +1 -0
- package/dist/application/use-cases/get-stats.d.ts +13 -0
- package/dist/application/use-cases/get-stats.js +50 -0
- package/dist/application/use-cases/get-stats.js.map +1 -0
- package/dist/application/use-cases/index.d.ts +23 -0
- package/dist/application/use-cases/index.js +24 -0
- package/dist/application/use-cases/index.js.map +1 -0
- package/dist/application/use-cases/list-cvs.d.ts +8 -0
- package/dist/application/use-cases/list-cvs.js +20 -0
- package/dist/application/use-cases/list-cvs.js.map +1 -0
- package/dist/application/use-cases/list-job-postings.d.ts +7 -0
- package/dist/application/use-cases/list-job-postings.js +10 -0
- package/dist/application/use-cases/list-job-postings.js.map +1 -0
- package/dist/application/use-cases/manage-tags.d.ts +7 -0
- package/dist/application/use-cases/manage-tags.js +36 -0
- package/dist/application/use-cases/manage-tags.js.map +1 -0
- package/dist/application/use-cases/match-candidates.d.ts +27 -0
- package/dist/application/use-cases/match-candidates.js +92 -0
- package/dist/application/use-cases/match-candidates.js.map +1 -0
- package/dist/application/use-cases/semantic-search.d.ts +11 -0
- package/dist/application/use-cases/semantic-search.js +40 -0
- package/dist/application/use-cases/semantic-search.js.map +1 -0
- package/dist/application/use-cases/set-pending-action.d.ts +13 -0
- package/dist/application/use-cases/set-pending-action.js +24 -0
- package/dist/application/use-cases/set-pending-action.js.map +1 -0
- package/dist/application/use-cases/update-cv.d.ts +17 -0
- package/dist/application/use-cases/update-cv.js +103 -0
- package/dist/application/use-cases/update-cv.js.map +1 -0
- package/dist/application/use-cases/update-job-posting.d.ts +19 -0
- package/dist/application/use-cases/update-job-posting.js +28 -0
- package/dist/application/use-cases/update-job-posting.js.map +1 -0
- package/dist/application/use-cases/update-pipeline-status.d.ts +14 -0
- package/dist/application/use-cases/update-pipeline-status.js +38 -0
- package/dist/application/use-cases/update-pipeline-status.js.map +1 -0
- package/dist/domain/entities/application-event.d.ts +11 -0
- package/dist/domain/entities/application-event.js +2 -0
- package/dist/domain/entities/application-event.js.map +1 -0
- package/dist/domain/entities/application.d.ts +13 -0
- package/dist/domain/entities/application.js +2 -0
- package/dist/domain/entities/application.js.map +1 -0
- package/dist/domain/entities/candidate.d.ts +26 -0
- package/dist/domain/entities/candidate.js +2 -0
- package/dist/domain/entities/candidate.js.map +1 -0
- package/dist/domain/entities/cv-chunk.d.ts +10 -0
- package/dist/domain/entities/cv-chunk.js +2 -0
- package/dist/domain/entities/cv-chunk.js.map +1 -0
- package/dist/domain/entities/cv-version.d.ts +7 -0
- package/dist/domain/entities/cv-version.js +2 -0
- package/dist/domain/entities/cv-version.js.map +1 -0
- package/dist/domain/entities/index.d.ts +6 -0
- package/dist/domain/entities/index.js +2 -0
- package/dist/domain/entities/index.js.map +1 -0
- package/dist/domain/entities/job-posting.d.ts +14 -0
- package/dist/domain/entities/job-posting.js +2 -0
- package/dist/domain/entities/job-posting.js.map +1 -0
- package/dist/domain/repositories/application-event-repository.d.ts +7 -0
- package/dist/domain/repositories/application-event-repository.js +2 -0
- package/dist/domain/repositories/application-event-repository.js.map +1 -0
- package/dist/domain/repositories/application-repository.d.ts +12 -0
- package/dist/domain/repositories/application-repository.js +2 -0
- package/dist/domain/repositories/application-repository.js.map +1 -0
- package/dist/domain/repositories/candidate-repository.d.ts +12 -0
- package/dist/domain/repositories/candidate-repository.js +2 -0
- package/dist/domain/repositories/candidate-repository.js.map +1 -0
- package/dist/domain/repositories/chunk-repository.d.ts +13 -0
- package/dist/domain/repositories/chunk-repository.js +2 -0
- package/dist/domain/repositories/chunk-repository.js.map +1 -0
- package/dist/domain/repositories/index.d.ts +6 -0
- package/dist/domain/repositories/index.js +2 -0
- package/dist/domain/repositories/index.js.map +1 -0
- package/dist/domain/repositories/job-posting-repository.d.ts +9 -0
- package/dist/domain/repositories/job-posting-repository.js +2 -0
- package/dist/domain/repositories/job-posting-repository.js.map +1 -0
- package/dist/domain/repositories/version-repository.d.ts +6 -0
- package/dist/domain/repositories/version-repository.js +2 -0
- package/dist/domain/repositories/version-repository.js.map +1 -0
- package/dist/domain/value-objects/certification.d.ts +5 -0
- package/dist/domain/value-objects/certification.js +2 -0
- package/dist/domain/value-objects/certification.js.map +1 -0
- package/dist/domain/value-objects/contact-info.d.ts +5 -0
- package/dist/domain/value-objects/contact-info.js +2 -0
- package/dist/domain/value-objects/contact-info.js.map +1 -0
- package/dist/domain/value-objects/education.d.ts +7 -0
- package/dist/domain/value-objects/education.js +2 -0
- package/dist/domain/value-objects/education.js.map +1 -0
- package/dist/domain/value-objects/experience.d.ts +7 -0
- package/dist/domain/value-objects/experience.js +2 -0
- package/dist/domain/value-objects/experience.js.map +1 -0
- package/dist/domain/value-objects/index.d.ts +7 -0
- package/dist/domain/value-objects/index.js +2 -0
- package/dist/domain/value-objects/index.js.map +1 -0
- package/dist/domain/value-objects/language.d.ts +4 -0
- package/dist/domain/value-objects/language.js +2 -0
- package/dist/domain/value-objects/language.js.map +1 -0
- package/dist/domain/value-objects/links.d.ts +6 -0
- package/dist/domain/value-objects/links.js +2 -0
- package/dist/domain/value-objects/links.js.map +1 -0
- package/dist/domain/value-objects/project.d.ts +5 -0
- package/dist/domain/value-objects/project.js +2 -0
- package/dist/domain/value-objects/project.js.map +1 -0
- package/dist/infrastructure/ai/index.d.ts +2 -0
- package/dist/infrastructure/ai/index.js +3 -0
- package/dist/infrastructure/ai/index.js.map +1 -0
- package/dist/infrastructure/ai/openai-embedding-service.d.ts +8 -0
- package/dist/infrastructure/ai/openai-embedding-service.js +39 -0
- package/dist/infrastructure/ai/openai-embedding-service.js.map +1 -0
- package/dist/infrastructure/ai/openai-structured-extractor.d.ts +9 -0
- package/dist/infrastructure/ai/openai-structured-extractor.js +163 -0
- package/dist/infrastructure/ai/openai-structured-extractor.js.map +1 -0
- package/dist/infrastructure/config/app-config.d.ts +9 -0
- package/dist/infrastructure/config/app-config.js +15 -0
- package/dist/infrastructure/config/app-config.js.map +1 -0
- package/dist/infrastructure/export/csv-export-service.d.ts +6 -0
- package/dist/infrastructure/export/csv-export-service.js +24 -0
- package/dist/infrastructure/export/csv-export-service.js.map +1 -0
- package/dist/infrastructure/parsers/docx-parser.d.ts +5 -0
- package/dist/infrastructure/parsers/docx-parser.js +17 -0
- package/dist/infrastructure/parsers/docx-parser.js.map +1 -0
- package/dist/infrastructure/parsers/index.d.ts +3 -0
- package/dist/infrastructure/parsers/index.js +4 -0
- package/dist/infrastructure/parsers/index.js.map +1 -0
- package/dist/infrastructure/parsers/ocr-service.d.ts +8 -0
- package/dist/infrastructure/parsers/ocr-service.js +65 -0
- package/dist/infrastructure/parsers/ocr-service.js.map +1 -0
- package/dist/infrastructure/parsers/pdf-parser.d.ts +5 -0
- package/dist/infrastructure/parsers/pdf-parser.js +44 -0
- package/dist/infrastructure/parsers/pdf-parser.js.map +1 -0
- package/dist/infrastructure/persistence/database.d.ts +20 -0
- package/dist/infrastructure/persistence/database.js +156 -0
- package/dist/infrastructure/persistence/database.js.map +1 -0
- package/dist/infrastructure/persistence/index.d.ts +6 -0
- package/dist/infrastructure/persistence/index.js +7 -0
- package/dist/infrastructure/persistence/index.js.map +1 -0
- package/dist/infrastructure/persistence/lancedb-application-event-repository.d.ts +16 -0
- package/dist/infrastructure/persistence/lancedb-application-event-repository.js +85 -0
- package/dist/infrastructure/persistence/lancedb-application-event-repository.js.map +1 -0
- package/dist/infrastructure/persistence/lancedb-application-repository.d.ts +21 -0
- package/dist/infrastructure/persistence/lancedb-application-repository.js +151 -0
- package/dist/infrastructure/persistence/lancedb-application-repository.js.map +1 -0
- package/dist/infrastructure/persistence/lancedb-candidate-repository.d.ts +21 -0
- package/dist/infrastructure/persistence/lancedb-candidate-repository.js +169 -0
- package/dist/infrastructure/persistence/lancedb-candidate-repository.js.map +1 -0
- package/dist/infrastructure/persistence/lancedb-chunk-repository.d.ts +18 -0
- package/dist/infrastructure/persistence/lancedb-chunk-repository.js +105 -0
- package/dist/infrastructure/persistence/lancedb-chunk-repository.js.map +1 -0
- package/dist/infrastructure/persistence/lancedb-job-posting-repository.d.ts +21 -0
- package/dist/infrastructure/persistence/lancedb-job-posting-repository.js +128 -0
- package/dist/infrastructure/persistence/lancedb-job-posting-repository.js.map +1 -0
- package/dist/infrastructure/persistence/lancedb-version-repository.d.ts +13 -0
- package/dist/infrastructure/persistence/lancedb-version-repository.js +62 -0
- package/dist/infrastructure/persistence/lancedb-version-repository.js.map +1 -0
- package/dist/interface/cli/index.d.ts +2 -0
- package/dist/interface/cli/index.js +17 -0
- package/dist/interface/cli/index.js.map +1 -0
- package/dist/interface/dashboard/call-context.d.ts +4 -0
- package/dist/interface/dashboard/call-context.js +26 -0
- package/dist/interface/dashboard/call-context.js.map +1 -0
- package/dist/interface/dashboard/event-bus.d.ts +7 -0
- package/dist/interface/dashboard/event-bus.js +16 -0
- package/dist/interface/dashboard/event-bus.js.map +1 -0
- package/dist/interface/dashboard/events.d.ts +30 -0
- package/dist/interface/dashboard/events.js +2 -0
- package/dist/interface/dashboard/events.js.map +1 -0
- package/dist/interface/dashboard/html.d.ts +1 -0
- package/dist/interface/dashboard/html.js +1007 -0
- package/dist/interface/dashboard/html.js.map +1 -0
- package/dist/interface/dashboard/public/200.html +1 -0
- package/dist/interface/dashboard/public/404.html +1 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-8KeALpAu2nWJknvJhMk31fqE06iajfSeiM57lsZAo5g.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-CAyrLGU3kauAbzcFnj2Cv_iAPV8wT2NEvNmrA_77Up0.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-Cbq5YGF_nsoQo6qYm9EhA3p-oINRUqlXhACZ2Wh4BBE.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-G1pKsfAhfeIECsLbuPUckyz92yuHFKi9rmiwlRl8Tb0.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-OnaIl8fChu9Cb4bpYiOA4dK_W7eeMCjXQOWR8tUhXJ0.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-kzEiBeXQ06q7fC06p1Y4RaOpLlRWCnHcCcSaqFMJ6fc.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-rmd8_oLeTXCNUhiFyy1UYsogNo6QYBr9dQHrhl_hLbs.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-wjJHhPsTzX4mZm37l7bbvLDtOEIT1R38DKPlwV_Z34A.woff +0 -0
- package/dist/interface/dashboard/public/_fonts/57NSSoFy1VLVs2gqly8Ls9awBnZMFyXGrefpmqvdqmc-zJfbBtpgM4cDmcXBsqZNW79_kFnlpPd62b48glgdydA.woff2 +0 -0
- package/dist/interface/dashboard/public/_fonts/8VR2wSMN-3U4NbWAVYXlkRV6hA0jFBXP-0RtL3X7fko-x2gYI4qfmkRdxyQQUPaBZdZdgl1TeVrquF_TxHeM4lM.woff2 +0 -0
- package/dist/interface/dashboard/public/_fonts/GsKUclqeNLJ96g5AU593ug6yanivOiwjW_7zESNPChw-jHA4tBeM1bjF7LATGUpfBuSTyomIFrWBTzjF7txVYfg.woff2 +0 -0
- package/dist/interface/dashboard/public/_fonts/Ld1FnTo3yTIwDyGfTQ5-Fws9AWsCbKfMvgxduXr7JcY-W25bL8NF1fjpLRSOgJb7RoZPHqGQNwMTM7S9tHVoxx8.woff2 +0 -0
- package/dist/interface/dashboard/public/_fonts/NdzqRASp2bovDUhQT1IRE_EMqKJ2KYQdTCfFcBvL8yw-KhwZiS86o3fErOe5GGMExHUemmI_dBfaEFxjISZrBd0.woff2 +0 -0
- package/dist/interface/dashboard/public/_fonts/iTkrULNFJJkTvihIg1Vqi5IODRH_9btXCioVF5l98I8-AndUyau2HR2felA_ra8V2mutQgschhasE5FD1dXGJX8.woff2 +0 -0
- package/dist/interface/dashboard/public/_nuxt/BtFgTcXQ.js +30 -0
- package/dist/interface/dashboard/public/_nuxt/CdJZeyak.js +30 -0
- package/dist/interface/dashboard/public/_nuxt/D9vxbU2B.js +1 -0
- package/dist/interface/dashboard/public/_nuxt/DHg6ig_T.js +1 -0
- package/dist/interface/dashboard/public/_nuxt/DhFk2_Al.js +1 -0
- package/dist/interface/dashboard/public/_nuxt/DlAUqK2U.js +1 -0
- package/dist/interface/dashboard/public/_nuxt/DtX-aPBA.js +1 -0
- package/dist/interface/dashboard/public/_nuxt/DvCMYK3d.js +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/latest.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/027020ec-4e7d-4fc7-8447-19800f7d0bac.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/18e19101-a96b-41dc-b602-f9a8f013a036.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/2fd3d0d3-6004-4659-9055-d27aa6656fd3.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/54792d4b-ca55-4b5d-b0dd-1d7dc34de344.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/5959a14b-2494-4e0d-be28-fef9adfd889d.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/60cda583-d704-4d4e-b37e-7ab337e3b6cc.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/64d05a43-99ec-4c22-934e-071b310b968f.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/6c1632a5-f0af-41e3-9d88-12294e03a0b9.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/6c80982c-5e2c-446c-aaf6-7000a976e493.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/79161adb-748c-4d36-a031-a71899a56ecd.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/84e5a87d-4ae5-48dd-8d5e-5b1fe89f7243.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/86082677-a11d-4acf-ab04-c3c067a71622.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/8892e611-c2b4-425b-a6a5-988314d8da4d.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/9bfe6b22-73f8-4584-b13d-ed1df5600e12.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/a39bf957-ddae-41a6-a183-08292363098b.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/b0bf7fc4-02c1-46fd-acca-f4458feed978.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/b2847d83-b695-45d4-9dca-d7498158a501.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/c8382eda-1354-4f92-b6d0-5b5b9f43354a.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/e707aa44-7202-413d-bcd5-1538b5b56570.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/ea661002-05ab-4bfb-b02f-c91bb721c5e9.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/f2f23a12-a792-480e-922a-ee8b73dc0310.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/f6503b83-d731-40f8-9110-c1599663b3ba.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/builds/meta/feac6d04-6bc5-4fa4-a241-79e897d7f8c1.json +1 -0
- package/dist/interface/dashboard/public/_nuxt/entry.BSUaoqsu.css +1 -0
- package/dist/interface/dashboard/public/_nuxt/entry.Bl31cpjT.css +1 -0
- package/dist/interface/dashboard/public/_nuxt/error-404.B6WzzNMA.css +1 -0
- package/dist/interface/dashboard/public/_nuxt/error-500.CVIcHofV.css +1 -0
- package/dist/interface/dashboard/public/_nuxt/index.BH5Gbe6q.css +1 -0
- package/dist/interface/dashboard/public/_nuxt/index.TQmbXYdV.css +1 -0
- package/dist/interface/dashboard/public/_nuxt/qq1iUjth.js +1 -0
- package/dist/interface/dashboard/public/favicon.ico +0 -0
- package/dist/interface/dashboard/public/index.html +1 -0
- package/dist/interface/dashboard/server.d.ts +11 -0
- package/dist/interface/dashboard/server.js +145 -0
- package/dist/interface/dashboard/server.js.map +1 -0
- package/dist/interface/dashboard/tool-wrapper.d.ts +4 -0
- package/dist/interface/dashboard/tool-wrapper.js +96 -0
- package/dist/interface/dashboard/tool-wrapper.js.map +1 -0
- package/dist/interface/mcp/server.d.ts +2 -0
- package/dist/interface/mcp/server.js +109 -0
- package/dist/interface/mcp/server.js.map +1 -0
- package/dist/interface/mcp/tools/add-cv.d.ts +3 -0
- package/dist/interface/mcp/tools/add-cv.js +21 -0
- package/dist/interface/mcp/tools/add-cv.js.map +1 -0
- package/dist/interface/mcp/tools/add-job-posting.d.ts +3 -0
- package/dist/interface/mcp/tools/add-job-posting.js +38 -0
- package/dist/interface/mcp/tools/add-job-posting.js.map +1 -0
- package/dist/interface/mcp/tools/add-pipeline-note.d.ts +3 -0
- package/dist/interface/mcp/tools/add-pipeline-note.js +32 -0
- package/dist/interface/mcp/tools/add-pipeline-note.js.map +1 -0
- package/dist/interface/mcp/tools/add-to-pipeline.d.ts +3 -0
- package/dist/interface/mcp/tools/add-to-pipeline.js +28 -0
- package/dist/interface/mcp/tools/add-to-pipeline.js.map +1 -0
- package/dist/interface/mcp/tools/bulk-add-cvs.d.ts +3 -0
- package/dist/interface/mcp/tools/bulk-add-cvs.js +28 -0
- package/dist/interface/mcp/tools/bulk-add-cvs.js.map +1 -0
- package/dist/interface/mcp/tools/delete-cv.d.ts +3 -0
- package/dist/interface/mcp/tools/delete-cv.js +20 -0
- package/dist/interface/mcp/tools/delete-cv.js.map +1 -0
- package/dist/interface/mcp/tools/delete-job-posting.d.ts +3 -0
- package/dist/interface/mcp/tools/delete-job-posting.js +27 -0
- package/dist/interface/mcp/tools/delete-job-posting.js.map +1 -0
- package/dist/interface/mcp/tools/export-results.d.ts +3 -0
- package/dist/interface/mcp/tools/export-results.js +23 -0
- package/dist/interface/mcp/tools/export-results.js.map +1 -0
- package/dist/interface/mcp/tools/filter-candidates.d.ts +3 -0
- package/dist/interface/mcp/tools/filter-candidates.js +32 -0
- package/dist/interface/mcp/tools/filter-candidates.js.map +1 -0
- package/dist/interface/mcp/tools/get-candidate-history.d.ts +3 -0
- package/dist/interface/mcp/tools/get-candidate-history.js +22 -0
- package/dist/interface/mcp/tools/get-candidate-history.js.map +1 -0
- package/dist/interface/mcp/tools/get-cv-chunks.d.ts +3 -0
- package/dist/interface/mcp/tools/get-cv-chunks.js +26 -0
- package/dist/interface/mcp/tools/get-cv-chunks.js.map +1 -0
- package/dist/interface/mcp/tools/get-cv-detail.d.ts +3 -0
- package/dist/interface/mcp/tools/get-cv-detail.js +23 -0
- package/dist/interface/mcp/tools/get-cv-detail.js.map +1 -0
- package/dist/interface/mcp/tools/get-cv-versions.d.ts +3 -0
- package/dist/interface/mcp/tools/get-cv-versions.js +20 -0
- package/dist/interface/mcp/tools/get-cv-versions.js.map +1 -0
- package/dist/interface/mcp/tools/get-job-posting.d.ts +3 -0
- package/dist/interface/mcp/tools/get-job-posting.js +26 -0
- package/dist/interface/mcp/tools/get-job-posting.js.map +1 -0
- package/dist/interface/mcp/tools/get-pending-actions.d.ts +3 -0
- package/dist/interface/mcp/tools/get-pending-actions.js +19 -0
- package/dist/interface/mcp/tools/get-pending-actions.js.map +1 -0
- package/dist/interface/mcp/tools/get-pipeline.d.ts +3 -0
- package/dist/interface/mcp/tools/get-pipeline.js +22 -0
- package/dist/interface/mcp/tools/get-pipeline.js.map +1 -0
- package/dist/interface/mcp/tools/get-server-status.d.ts +3 -0
- package/dist/interface/mcp/tools/get-server-status.js +38 -0
- package/dist/interface/mcp/tools/get-server-status.js.map +1 -0
- package/dist/interface/mcp/tools/get-stats.d.ts +3 -0
- package/dist/interface/mcp/tools/get-stats.js +19 -0
- package/dist/interface/mcp/tools/get-stats.js.map +1 -0
- package/dist/interface/mcp/tools/list-cvs.d.ts +3 -0
- package/dist/interface/mcp/tools/list-cvs.js +32 -0
- package/dist/interface/mcp/tools/list-cvs.js.map +1 -0
- package/dist/interface/mcp/tools/list-job-postings.d.ts +3 -0
- package/dist/interface/mcp/tools/list-job-postings.js +19 -0
- package/dist/interface/mcp/tools/list-job-postings.js.map +1 -0
- package/dist/interface/mcp/tools/manage-tags.d.ts +3 -0
- package/dist/interface/mcp/tools/manage-tags.js +24 -0
- package/dist/interface/mcp/tools/manage-tags.js.map +1 -0
- package/dist/interface/mcp/tools/match-candidates.d.ts +3 -0
- package/dist/interface/mcp/tools/match-candidates.js +23 -0
- package/dist/interface/mcp/tools/match-candidates.js.map +1 -0
- package/dist/interface/mcp/tools/reset-database.d.ts +3 -0
- package/dist/interface/mcp/tools/reset-database.js +35 -0
- package/dist/interface/mcp/tools/reset-database.js.map +1 -0
- package/dist/interface/mcp/tools/semantic-search.d.ts +3 -0
- package/dist/interface/mcp/tools/semantic-search.js +27 -0
- package/dist/interface/mcp/tools/semantic-search.js.map +1 -0
- package/dist/interface/mcp/tools/set-pending-action.d.ts +3 -0
- package/dist/interface/mcp/tools/set-pending-action.js +36 -0
- package/dist/interface/mcp/tools/set-pending-action.js.map +1 -0
- package/dist/interface/mcp/tools/update-cv.d.ts +3 -0
- package/dist/interface/mcp/tools/update-cv.js +23 -0
- package/dist/interface/mcp/tools/update-cv.js.map +1 -0
- package/dist/interface/mcp/tools/update-job-posting.d.ts +3 -0
- package/dist/interface/mcp/tools/update-job-posting.js +42 -0
- package/dist/interface/mcp/tools/update-job-posting.js.map +1 -0
- package/dist/interface/mcp/tools/update-pipeline-status.d.ts +3 -0
- package/dist/interface/mcp/tools/update-pipeline-status.js +41 -0
- package/dist/interface/mcp/tools/update-pipeline-status.js.map +1 -0
- package/dist/interface/mcp/types.d.ts +26 -0
- package/dist/interface/mcp/types.js +2 -0
- package/dist/interface/mcp/types.js.map +1 -0
- package/dist/shared/errors/index.d.ts +32 -0
- package/dist/shared/errors/index.js +56 -0
- package/dist/shared/errors/index.js.map +1 -0
- package/dist/shared/types/index.d.ts +19 -0
- package/dist/shared/types/index.js +2 -0
- package/dist/shared/types/index.js.map +1 -0
- package/dist/shared/utils/chunking.d.ts +3 -0
- package/dist/shared/utils/chunking.js +89 -0
- package/dist/shared/utils/chunking.js.map +1 -0
- package/dist/shared/utils/file-storage.d.ts +8 -0
- package/dist/shared/utils/file-storage.js +49 -0
- package/dist/shared/utils/file-storage.js.map +1 -0
- package/dist/shared/utils/index.d.ts +3 -0
- package/dist/shared/utils/index.js +4 -0
- package/dist/shared/utils/index.js.map +1 -0
- package/dist/shared/utils/text.d.ts +5 -0
- package/dist/shared/utils/text.js +21 -0
- package/dist/shared/utils/text.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import * as lancedb from '@lancedb/lancedb';
|
|
2
|
+
const MODEL_DIMENSIONS = {
|
|
3
|
+
'text-embedding-3-small': 1536,
|
|
4
|
+
'text-embedding-3-large': 3072,
|
|
5
|
+
'text-embedding-ada-002': 1536,
|
|
6
|
+
};
|
|
7
|
+
let vectorDimension = 1536;
|
|
8
|
+
export function configureVectorDimension(embeddingModel) {
|
|
9
|
+
vectorDimension = MODEL_DIMENSIONS[embeddingModel] ?? 1536;
|
|
10
|
+
}
|
|
11
|
+
let dbInstance = null;
|
|
12
|
+
export async function getDatabase(dbPath) {
|
|
13
|
+
if (!dbInstance) {
|
|
14
|
+
dbInstance = await lancedb.connect(dbPath);
|
|
15
|
+
}
|
|
16
|
+
return dbInstance;
|
|
17
|
+
}
|
|
18
|
+
export async function getOrCreateTable(db, tableName, seedData) {
|
|
19
|
+
const tableNames = await db.tableNames();
|
|
20
|
+
if (tableNames.includes(tableName)) {
|
|
21
|
+
return db.openTable(tableName);
|
|
22
|
+
}
|
|
23
|
+
if (seedData && seedData.length > 0) {
|
|
24
|
+
return db.createTable(tableName, seedData);
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`Table "${tableName}" does not exist and no seed data provided`);
|
|
27
|
+
}
|
|
28
|
+
export function getCandidateSeedRow() {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
id: '__seed__',
|
|
32
|
+
name: '',
|
|
33
|
+
email: '',
|
|
34
|
+
phone: '',
|
|
35
|
+
location: '',
|
|
36
|
+
summary: '',
|
|
37
|
+
skills: '[]',
|
|
38
|
+
languages: '[]',
|
|
39
|
+
experience_years: 0,
|
|
40
|
+
avg_tenure_months: 0,
|
|
41
|
+
short_stint_count: 0,
|
|
42
|
+
loyalty_score: '',
|
|
43
|
+
original_file_path: '',
|
|
44
|
+
experience: '[]',
|
|
45
|
+
education: '[]',
|
|
46
|
+
certifications: '[]',
|
|
47
|
+
projects: '[]',
|
|
48
|
+
links: '{}',
|
|
49
|
+
tags: '[]',
|
|
50
|
+
source_file: '',
|
|
51
|
+
file_type: '',
|
|
52
|
+
raw_text: '',
|
|
53
|
+
created_at: '',
|
|
54
|
+
updated_at: '',
|
|
55
|
+
version: 0,
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
export function getChunkSeedRow() {
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
id: '__seed__',
|
|
63
|
+
candidate_id: '',
|
|
64
|
+
section_type: '',
|
|
65
|
+
content: '',
|
|
66
|
+
vector: new Array(vectorDimension).fill(0),
|
|
67
|
+
metadata: '{}',
|
|
68
|
+
created_at: '',
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
export function getVersionSeedRow() {
|
|
73
|
+
return [
|
|
74
|
+
{
|
|
75
|
+
id: '__seed__',
|
|
76
|
+
candidate_id: '',
|
|
77
|
+
version: 0,
|
|
78
|
+
data: '{}',
|
|
79
|
+
created_at: '',
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
export function getJobPostingSeedRow() {
|
|
84
|
+
return [
|
|
85
|
+
{
|
|
86
|
+
id: '__seed__',
|
|
87
|
+
title: '',
|
|
88
|
+
description: '',
|
|
89
|
+
raw_text: '',
|
|
90
|
+
requirements: '',
|
|
91
|
+
required_skills: '[]',
|
|
92
|
+
preferred_skills: '[]',
|
|
93
|
+
location: '',
|
|
94
|
+
salary_range: '',
|
|
95
|
+
status: '',
|
|
96
|
+
created_at: '',
|
|
97
|
+
updated_at: '',
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
export function getApplicationSeedRow() {
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
id: '__seed__',
|
|
105
|
+
job_posting_id: '',
|
|
106
|
+
candidate_id: '',
|
|
107
|
+
status: '',
|
|
108
|
+
notes: '',
|
|
109
|
+
pending_action: '',
|
|
110
|
+
pending_action_due: '',
|
|
111
|
+
pending_action_owner: '',
|
|
112
|
+
created_at: '',
|
|
113
|
+
updated_at: '',
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
export function getApplicationEventSeedRow() {
|
|
118
|
+
return [
|
|
119
|
+
{
|
|
120
|
+
id: '__seed__',
|
|
121
|
+
application_id: '',
|
|
122
|
+
event_type: '',
|
|
123
|
+
from_status: '',
|
|
124
|
+
to_status: '',
|
|
125
|
+
note: '',
|
|
126
|
+
scheduled_at: '',
|
|
127
|
+
created_at: '',
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
export const TABLE_NAMES = {
|
|
132
|
+
candidates: 'candidates',
|
|
133
|
+
chunks: 'cv_chunks',
|
|
134
|
+
versions: 'cv_versions',
|
|
135
|
+
jobPostings: 'job_postings',
|
|
136
|
+
applications: 'applications',
|
|
137
|
+
applicationEvents: 'application_events',
|
|
138
|
+
};
|
|
139
|
+
export function getVectorDimension() {
|
|
140
|
+
return vectorDimension;
|
|
141
|
+
}
|
|
142
|
+
export async function resetAllTables(db) {
|
|
143
|
+
const tableNames = await db.tableNames();
|
|
144
|
+
for (const name of Object.values(TABLE_NAMES)) {
|
|
145
|
+
if (tableNames.includes(name)) {
|
|
146
|
+
await db.dropTable(name);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
await db.createTable(TABLE_NAMES.candidates, getCandidateSeedRow());
|
|
150
|
+
await db.createTable(TABLE_NAMES.chunks, getChunkSeedRow());
|
|
151
|
+
await db.createTable(TABLE_NAMES.versions, getVersionSeedRow());
|
|
152
|
+
await db.createTable(TABLE_NAMES.jobPostings, getJobPostingSeedRow());
|
|
153
|
+
await db.createTable(TABLE_NAMES.applications, getApplicationSeedRow());
|
|
154
|
+
await db.createTable(TABLE_NAMES.applicationEvents, getApplicationEventSeedRow());
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/infrastructure/persistence/database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,MAAM,gBAAgB,GAA2B;IAC/C,wBAAwB,EAAE,IAAI;IAC9B,wBAAwB,EAAE,IAAI;IAC9B,wBAAwB,EAAE,IAAI;CAC/B,CAAC;AAEF,IAAI,eAAe,GAAG,IAAI,CAAC;AAE3B,MAAM,UAAU,wBAAwB,CAAC,cAAsB;IAC7D,eAAe,GAAG,gBAAgB,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC;AAC7D,CAAC;AAED,IAAI,UAAU,GAAsB,IAAI,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc;IAC9C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,UAAU,GAAG,MAAM,OAAO,CAAC,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C,iBAAiB,EAAE,0BAA0B,EAAE,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getDatabase, getOrCreateTable, TABLE_NAMES, getVectorDimension, configureVectorDimension } from './database.js';
|
|
2
|
+
export { LanceDbCandidateRepository } from './lancedb-candidate-repository.js';
|
|
3
|
+
export { LanceDbChunkRepository } from './lancedb-chunk-repository.js';
|
|
4
|
+
export { LanceDbVersionRepository } from './lancedb-version-repository.js';
|
|
5
|
+
export { LanceDbApplicationRepository } from './lancedb-application-repository.js';
|
|
6
|
+
export { LanceDbApplicationEventRepository } from './lancedb-application-event-repository.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { getDatabase, getOrCreateTable, TABLE_NAMES, getVectorDimension, configureVectorDimension } from './database.js';
|
|
2
|
+
export { LanceDbCandidateRepository } from './lancedb-candidate-repository.js';
|
|
3
|
+
export { LanceDbChunkRepository } from './lancedb-chunk-repository.js';
|
|
4
|
+
export { LanceDbVersionRepository } from './lancedb-version-repository.js';
|
|
5
|
+
export { LanceDbApplicationRepository } from './lancedb-application-repository.js';
|
|
6
|
+
export { LanceDbApplicationEventRepository } from './lancedb-application-event-repository.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/persistence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzH,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
+
import type { IApplicationEventRepository } from '../../domain/repositories/application-event-repository.js';
|
|
3
|
+
import type { ApplicationEvent } from '../../domain/entities/application-event.js';
|
|
4
|
+
export declare class LanceDbApplicationEventRepository implements IApplicationEventRepository {
|
|
5
|
+
private db;
|
|
6
|
+
private tablePromise;
|
|
7
|
+
constructor(db: Connection);
|
|
8
|
+
private getTable;
|
|
9
|
+
refreshTable(): void;
|
|
10
|
+
private toRow;
|
|
11
|
+
private toEntity;
|
|
12
|
+
save(event: ApplicationEvent): Promise<void>;
|
|
13
|
+
findByApplicationId(applicationId: string): Promise<ApplicationEvent[]>;
|
|
14
|
+
deleteByApplicationId(applicationId: string): Promise<void>;
|
|
15
|
+
count(): Promise<number>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { getOrCreateTable, getApplicationEventSeedRow, TABLE_NAMES } from './database.js';
|
|
2
|
+
import { DatabaseError } from '../../shared/errors/index.js';
|
|
3
|
+
import { escapeFilterValue } from '../../shared/utils/text.js';
|
|
4
|
+
export class LanceDbApplicationEventRepository {
|
|
5
|
+
db;
|
|
6
|
+
tablePromise;
|
|
7
|
+
constructor(db) {
|
|
8
|
+
this.db = db;
|
|
9
|
+
this.tablePromise = getOrCreateTable(db, TABLE_NAMES.applicationEvents, getApplicationEventSeedRow());
|
|
10
|
+
}
|
|
11
|
+
async getTable() {
|
|
12
|
+
return this.tablePromise;
|
|
13
|
+
}
|
|
14
|
+
refreshTable() {
|
|
15
|
+
this.tablePromise = getOrCreateTable(this.db, TABLE_NAMES.applicationEvents, getApplicationEventSeedRow());
|
|
16
|
+
}
|
|
17
|
+
toRow(event) {
|
|
18
|
+
return {
|
|
19
|
+
id: event.id,
|
|
20
|
+
application_id: event.applicationId,
|
|
21
|
+
event_type: event.eventType,
|
|
22
|
+
from_status: event.fromStatus ?? '',
|
|
23
|
+
to_status: event.toStatus ?? '',
|
|
24
|
+
note: event.note,
|
|
25
|
+
scheduled_at: event.scheduledAt ?? '',
|
|
26
|
+
created_at: event.createdAt,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
toEntity(row) {
|
|
30
|
+
return {
|
|
31
|
+
id: row.id,
|
|
32
|
+
applicationId: row.application_id,
|
|
33
|
+
eventType: row.event_type,
|
|
34
|
+
fromStatus: row.from_status || undefined,
|
|
35
|
+
toStatus: row.to_status || undefined,
|
|
36
|
+
note: row.note,
|
|
37
|
+
scheduledAt: row.scheduled_at || undefined,
|
|
38
|
+
createdAt: row.created_at,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async save(event) {
|
|
42
|
+
try {
|
|
43
|
+
const table = await this.getTable();
|
|
44
|
+
await table.add([this.toRow(event)]);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
throw new DatabaseError('Failed to save application event', error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async findByApplicationId(applicationId) {
|
|
51
|
+
try {
|
|
52
|
+
const table = await this.getTable();
|
|
53
|
+
const results = await table
|
|
54
|
+
.query()
|
|
55
|
+
.where(`application_id = '${escapeFilterValue(applicationId)}' AND id != '__seed__'`)
|
|
56
|
+
.toArray();
|
|
57
|
+
return results
|
|
58
|
+
.map((r) => this.toEntity(r))
|
|
59
|
+
.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
throw new DatabaseError('Failed to find events by application', error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async deleteByApplicationId(applicationId) {
|
|
66
|
+
try {
|
|
67
|
+
const table = await this.getTable();
|
|
68
|
+
await table.delete(`application_id = '${escapeFilterValue(applicationId)}'`);
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw new DatabaseError('Failed to delete events by application', error);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async count() {
|
|
75
|
+
try {
|
|
76
|
+
const table = await this.getTable();
|
|
77
|
+
const results = await table.query().where("id != '__seed__'").toArray();
|
|
78
|
+
return results.length;
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
throw new DatabaseError('Failed to count application events', error);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=lancedb-application-event-repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lancedb-application-event-repository.js","sourceRoot":"","sources":["../../../src/infrastructure/persistence/lancedb-application-event-repository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAc/D,MAAM,OAAO,iCAAiC;IAGxB;IAFZ,YAAY,CAAiB;IAErC,YAAoB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAChC,IAAI,CAAC,YAAY,GAAG,gBAAgB,CAAC,EAAE,EAAE,WAAW,CAAC,iBAAiB,EAAE,0BAA0B,EAAE,CAAC,CAAC;IACxG,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,YAAY;QACV,IAAI,CAAC,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,iBAAiB,EAAE,0BAA0B,EAAE,CAAC,CAAC;IAC7G,CAAC;IAEO,KAAK,CAAC,KAAuB;QACnC,OAAO;YACL,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,cAAc,EAAE,KAAK,CAAC,aAAa;YACnC,UAAU,EAAE,KAAK,CAAC,SAAS;YAC3B,WAAW,EAAE,KAAK,CA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ACjD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;iBAC5B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,aAAa,CAAC,sCAAsC,EAAE,KAAK,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,aAAqB;QAC/C,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC,MAAM,CAAC,qBAAqB,iBAAiB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,aAAa,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC;YACxE,OAAO,OAAO,CAAC,MAAM,CAAC;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,aAAa,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
+
import type { IApplicationRepository } from '../../domain/repositories/application-repository.js';
|
|
3
|
+
import type { Application } from '../../domain/entities/application.js';
|
|
4
|
+
export declare class LanceDbApplicationRepository implements IApplicationRepository {
|
|
5
|
+
private db;
|
|
6
|
+
private tablePromise;
|
|
7
|
+
constructor(db: Connection);
|
|
8
|
+
private getTable;
|
|
9
|
+
refreshTable(): void;
|
|
10
|
+
private toRow;
|
|
11
|
+
private toEntity;
|
|
12
|
+
save(application: Application): Promise<void>;
|
|
13
|
+
findById(id: string): Promise<Application | null>;
|
|
14
|
+
findByJobPostingId(jobPostingId: string): Promise<Application[]>;
|
|
15
|
+
findByCandidateId(candidateId: string): Promise<Application[]>;
|
|
16
|
+
findByJobAndCandidate(jobPostingId: string, candidateId: string): Promise<Application | null>;
|
|
17
|
+
findPendingActions(): Promise<Application[]>;
|
|
18
|
+
update(application: Application): Promise<void>;
|
|
19
|
+
delete(id: string): Promise<void>;
|
|
20
|
+
count(): Promise<number>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { getOrCreateTable, getApplicationSeedRow, TABLE_NAMES } from './database.js';
|
|
2
|
+
import { DatabaseError } from '../../shared/errors/index.js';
|
|
3
|
+
import { escapeFilterValue } from '../../shared/utils/text.js';
|
|
4
|
+
export class LanceDbApplicationRepository {
|
|
5
|
+
db;
|
|
6
|
+
tablePromise;
|
|
7
|
+
constructor(db) {
|
|
8
|
+
this.db = db;
|
|
9
|
+
this.tablePromise = getOrCreateTable(db, TABLE_NAMES.applications, getApplicationSeedRow());
|
|
10
|
+
}
|
|
11
|
+
async getTable() {
|
|
12
|
+
return this.tablePromise;
|
|
13
|
+
}
|
|
14
|
+
refreshTable() {
|
|
15
|
+
this.tablePromise = getOrCreateTable(this.db, TABLE_NAMES.applications, getApplicationSeedRow());
|
|
16
|
+
}
|
|
17
|
+
toRow(app) {
|
|
18
|
+
return {
|
|
19
|
+
id: app.id,
|
|
20
|
+
job_posting_id: app.jobPostingId,
|
|
21
|
+
candidate_id: app.candidateId,
|
|
22
|
+
status: app.status,
|
|
23
|
+
notes: app.notes,
|
|
24
|
+
pending_action: app.pendingAction ?? '',
|
|
25
|
+
pending_action_due: app.pendingActionDue ?? '',
|
|
26
|
+
pending_action_owner: app.pendingActionOwner ?? '',
|
|
27
|
+
created_at: app.createdAt,
|
|
28
|
+
updated_at: app.updatedAt,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
toEntity(row) {
|
|
32
|
+
return {
|
|
33
|
+
id: row.id,
|
|
34
|
+
jobPostingId: row.job_posting_id,
|
|
35
|
+
candidateId: row.candidate_id,
|
|
36
|
+
status: row.status,
|
|
37
|
+
notes: row.notes,
|
|
38
|
+
pendingAction: row.pending_action || undefined,
|
|
39
|
+
pendingActionDue: row.pending_action_due || undefined,
|
|
40
|
+
pendingActionOwner: (row.pending_action_owner || undefined),
|
|
41
|
+
createdAt: row.created_at,
|
|
42
|
+
updatedAt: row.updated_at,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
async save(application) {
|
|
46
|
+
try {
|
|
47
|
+
const table = await this.getTable();
|
|
48
|
+
await table.add([this.toRow(application)]);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw new DatabaseError('Failed to save application', error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async findById(id) {
|
|
55
|
+
try {
|
|
56
|
+
const table = await this.getTable();
|
|
57
|
+
const results = await table.query().where(`id = '${escapeFilterValue(id)}'`).limit(1).toArray();
|
|
58
|
+
if (results.length === 0)
|
|
59
|
+
return null;
|
|
60
|
+
return this.toEntity(results[0]);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
throw new DatabaseError('Failed to find application by id', error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async findByJobPostingId(jobPostingId) {
|
|
67
|
+
try {
|
|
68
|
+
const table = await this.getTable();
|
|
69
|
+
const results = await table
|
|
70
|
+
.query()
|
|
71
|
+
.where(`job_posting_id = '${escapeFilterValue(jobPostingId)}' AND id != '__seed__'`)
|
|
72
|
+
.toArray();
|
|
73
|
+
return results.map((r) => this.toEntity(r));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
throw new DatabaseError('Failed to find applications by job posting', error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async findByCandidateId(candidateId) {
|
|
80
|
+
try {
|
|
81
|
+
const table = await this.getTable();
|
|
82
|
+
const results = await table
|
|
83
|
+
.query()
|
|
84
|
+
.where(`candidate_id = '${escapeFilterValue(candidateId)}' AND id != '__seed__'`)
|
|
85
|
+
.toArray();
|
|
86
|
+
return results.map((r) => this.toEntity(r));
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
throw new DatabaseError('Failed to find applications by candidate', error);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async findByJobAndCandidate(jobPostingId, candidateId) {
|
|
93
|
+
try {
|
|
94
|
+
const table = await this.getTable();
|
|
95
|
+
const results = await table
|
|
96
|
+
.query()
|
|
97
|
+
.where(`job_posting_id = '${escapeFilterValue(jobPostingId)}' AND candidate_id = '${escapeFilterValue(candidateId)}'`)
|
|
98
|
+
.limit(1)
|
|
99
|
+
.toArray();
|
|
100
|
+
if (results.length === 0)
|
|
101
|
+
return null;
|
|
102
|
+
return this.toEntity(results[0]);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
throw new DatabaseError('Failed to find application by job and candidate', error);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async findPendingActions() {
|
|
109
|
+
try {
|
|
110
|
+
const table = await this.getTable();
|
|
111
|
+
const results = await table
|
|
112
|
+
.query()
|
|
113
|
+
.where("pending_action != '' AND id != '__seed__'")
|
|
114
|
+
.toArray();
|
|
115
|
+
return results.map((r) => this.toEntity(r));
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
throw new DatabaseError('Failed to find pending actions', error);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async update(application) {
|
|
122
|
+
try {
|
|
123
|
+
const table = await this.getTable();
|
|
124
|
+
await table.delete(`id = '${escapeFilterValue(application.id)}'`);
|
|
125
|
+
await table.add([this.toRow(application)]);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
throw new DatabaseError('Failed to update application', error);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async delete(id) {
|
|
132
|
+
try {
|
|
133
|
+
const table = await this.getTable();
|
|
134
|
+
await table.delete(`id = '${escapeFilterValue(id)}'`);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw new DatabaseError('Failed to delete application', error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async count() {
|
|
141
|
+
try {
|
|
142
|
+
const table = await this.getTable();
|
|
143
|
+
const results = await table.query().where("id != '__seed__'").toArray();
|
|
144
|
+
return results.length;
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
throw new DatabaseError('Failed to count applications', error);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=lancedb-application-repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lancedb-application-repository.js","sourceRoot":"","sources":["../../../src/infrastructure/persistence/lancedb-application-repository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAgB/D,MAAM,OAAO,4BAA4B;IAGnB;IAFZ,YAAY,CAAiB;IAErC,YAAoB,EAAc;QAAd,OAAE,GAAF,EAAE,CAAY;QAChC,IAAI,CAAC,YAAY,GAAG,gBAAgB,CAAC,EAAE,EAAE,WAAW,CAAC,YAAY,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC9F,CAAC;IAEO,KAAK,CAAC,QAAQ;QACpB,O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,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,OAAO,EAAE,CAAC;YACxE,OAAO,OAAO,CAAC,MAAM,CAAC;QACxB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,aAAa,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Connection } from '@lancedb/lancedb';
|
|
2
|
+
import type { ICandidateRepository } from '../../domain/repositories/candidate-repository.js';
|
|
3
|
+
import type { Candidate } from '../../domain/entities/candidate.js';
|
|
4
|
+
import type { PaginationOptions, SortOptions } from '../../shared/types/index.js';
|
|
5
|
+
export declare class LanceDbCandidateRepository implements ICandidateRepository {
|
|
6
|
+
private db;
|
|
7
|
+
private tablePromise;
|
|
8
|
+
constructor(db: Connection);
|
|
9
|
+
private getTable;
|
|
10
|
+
refreshTable(): void;
|
|
11
|
+
private toRow;
|
|
12
|
+
private toEntity;
|
|
13
|
+
save(candidate: Candidate): Promise<void>;
|
|
14
|
+
findById(id: string): Promise<Candidate | null>;
|
|
15
|
+
findByEmail(email: string): Promise<Candidate | null>;
|
|
16
|
+
findAll(pagination?: PaginationOptions, _sort?: SortOptions): Promise<Candidate[]>;
|
|
17
|
+
update(candidate: Candidate): Promise<void>;
|
|
18
|
+
delete(id: string): Promise<void>;
|
|
19
|
+
count(): Promise<number>;
|
|
20
|
+
filter(whereClause: string): Promise<Candidate[]>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { getOrCreateTable, getCandidateSeedRow, TABLE_NAMES } from './database.js';
|
|
2
|
+
import { DatabaseError } from '../../shared/errors/index.js';
|
|
3
|
+
export class LanceDbCandidateRepository {
|
|
4
|
+
db;
|
|
5
|
+
tablePromise;
|
|
6
|
+
constructor(db) {
|
|
7
|
+
this.db = db;
|
|
8
|
+
this.tablePromise = getOrCreateTable(db, TABLE_NAMES.candidates, getCandidateSeedRow());
|
|
9
|
+
}
|
|
10
|
+
async getTable() {
|
|
11
|
+
return this.tablePromise;
|
|
12
|
+
}
|
|
13
|
+
refreshTable() {
|
|
14
|
+
this.tablePromise = getOrCreateTable(this.db, TABLE_NAMES.candidates, getCandidateSeedRow());
|
|
15
|
+
}
|
|
16
|
+
toRow(c) {
|
|
17
|
+
return {
|
|
18
|
+
id: c.id,
|
|
19
|
+
name: c.name,
|
|
20
|
+
email: c.contact.email ?? '',
|
|
21
|
+
phone: c.contact.phone ?? '',
|
|
22
|
+
location: c.contact.location ?? '',
|
|
23
|
+
summary: c.summary ?? '',
|
|
24
|
+
skills: JSON.stringify(c.skills),
|
|
25
|
+
languages: JSON.stringify(c.languages),
|
|
26
|
+
experience_years: c.experienceYears ?? 0,
|
|
27
|
+
avg_tenure_months: c.avgTenureMonths ?? 0,
|
|
28
|
+
short_stint_count: c.shortStintCount ?? 0,
|
|
29
|
+
loyalty_score: c.loyaltyScore ?? '',
|
|
30
|
+
original_file_path: c.originalFilePath ?? '',
|
|
31
|
+
experience: JSON.stringify(c.experience),
|
|
32
|
+
education: JSON.stringify(c.education),
|
|
33
|
+
certifications: JSON.stringify(c.certifications),
|
|
34
|
+
projects: JSON.stringify(c.projects),
|
|
35
|
+
links: JSON.stringify(c.links ?? {}),
|
|
36
|
+
tags: JSON.stringify(c.tags),
|
|
37
|
+
source_file: c.sourceFile,
|
|
38
|
+
file_type: c.fileType,
|
|
39
|
+
raw_text: c.rawText,
|
|
40
|
+
created_at: c.createdAt,
|
|
41
|
+
updated_at: c.updatedAt,
|
|
42
|
+
version: c.version,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
toEntity(row) {
|
|
46
|
+
return {
|
|
47
|
+
id: row.id,
|
|
48
|
+
name: row.name,
|
|
49
|
+
contact: {
|
|
50
|
+
email: row.email || undefined,
|
|
51
|
+
phone: row.phone || undefined,
|
|
52
|
+
location: row.location || undefined,
|
|
53
|
+
},
|
|
54
|
+
summary: row.summary || undefined,
|
|
55
|
+
skills: JSON.parse(row.skills || '[]'),
|
|
56
|
+
languages: JSON.parse(row.languages || '[]'),
|
|
57
|
+
experienceYears: row.experience_years || undefined,
|
|
58
|
+
avgTenureMonths: row.avg_tenure_months || undefined,
|
|
59
|
+
shortStintCount: row.short_stint_count || undefined,
|
|
60
|
+
loyaltyScore: row.loyalty_score || undefined,
|
|
61
|
+
originalFilePath: row.original_file_path || undefined,
|
|
62
|
+
experience: JSON.parse(row.experience || '[]'),
|
|
63
|
+
education: JSON.parse(row.education || '[]'),
|
|
64
|
+
certifications: JSON.parse(row.certifications || '[]'),
|
|
65
|
+
projects: JSON.parse(row.projects || '[]'),
|
|
66
|
+
links: JSON.parse(row.links || '{}'),
|
|
67
|
+
tags: JSON.parse(row.tags || '[]'),
|
|
68
|
+
sourceFile: row.source_file,
|
|
69
|
+
fileType: row.file_type,
|
|
70
|
+
rawText: row.raw_text,
|
|
71
|
+
createdAt: row.created_at,
|
|
72
|
+
updatedAt: row.updated_at,
|
|
73
|
+
version: row.version,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async save(candidate) {
|
|
77
|
+
try {
|
|
78
|
+
const table = await this.getTable();
|
|
79
|
+
await table.add([this.toRow(candidate)]);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
throw new DatabaseError('Failed to save candidate', error);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async findById(id) {
|
|
86
|
+
try {
|
|
87
|
+
const table = await this.getTable();
|
|
88
|
+
const results = await table.query().where(`id = '${id}'`).limit(1).toArray();
|
|
89
|
+
if (results.length === 0)
|
|
90
|
+
return null;
|
|
91
|
+
return this.toEntity(results[0]);
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
throw new DatabaseError('Failed to find candidate by id', error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async findByEmail(email) {
|
|
98
|
+
try {
|
|
99
|
+
const table = await this.getTable();
|
|
100
|
+
const results = await table.query().where(`email = '${email}'`).limit(1).toArray();
|
|
101
|
+
if (results.length === 0)
|
|
102
|
+
return null;
|
|
103
|
+
return this.toEntity(results[0]);
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
throw new DatabaseError('Failed to find candidate by email', error);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async findAll(pagination, _sort) {
|
|
110
|
+
try {
|
|
111
|
+
const table = await this.getTable();
|
|
112
|
+
let query = table.query().where("id != '__seed__'");
|
|
113
|
+
if (pagination) {
|
|
114
|
+
const total = pagination.offset + pagination.limit;
|
|
115
|
+
query = query.limit(total);
|
|
116
|
+
}
|
|
117
|
+
const results = await query.toArray();
|
|
118
|
+
let rows = results;
|
|
119
|
+
if (pagination && pagination.offset > 0) {
|
|
120
|
+
rows = rows.slice(pagination.offset);
|
|
121
|
+
}
|
|
122
|
+
return rows.map((r) => this.toEntity(r));
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
throw new DatabaseError('Failed to list candidates', error);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async update(candidate) {
|
|
129
|
+
try {
|
|
130
|
+
const table = await this.getTable();
|
|
131
|
+
await table.delete(`id = '${candidate.id}'`);
|
|
132
|
+
await table.add([this.toRow(candidate)]);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
throw new DatabaseError('Failed to update candidate', error);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async delete(id) {
|
|
139
|
+
try {
|
|
140
|
+
const table = await this.getTable();
|
|
141
|
+
await table.delete(`id = '${id}'`);
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
throw new DatabaseError('Failed to delete candidate', error);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async count() {
|
|
148
|
+
try {
|
|
149
|
+
const table = await this.getTable();
|
|
150
|
+
const results = await table.query().where("id != '__seed__'").toArray();
|
|
151
|
+
return results.length;
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
throw new DatabaseError('Failed to count candidates', error);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async filter(whereClause) {
|
|
158
|
+
try {
|
|
159
|
+
const table = await this.getTable();
|
|
160
|
+
const fullWhere = `id != '__seed__' AND (${whereClause})`;
|
|
161
|
+
const results = await table.query().where(fullWhere).toArray();
|
|
162
|
+
return results.map((r) => this.toEntity(r));
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
throw new DatabaseError('Failed to filter candidates', error);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=lancedb-candidate-repository.js.map
|