@worktango/ai-assistant 0.0.133 → 1.0.135
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/dist/{Absenteeism-BB0vSGG6.mjs → Absenteeism-FslOeWyh.mjs} +1 -1
- package/dist/{ActivityFeed-BLYkRDEQ.mjs → ActivityFeed-DtiY2oH4.mjs} +1 -1
- package/dist/{AddUser-CIDBX5Dc.mjs → AddUser-CTeT8Mj0.mjs} +1 -1
- package/dist/{Admin-B9Si37hd.mjs → Admin-B2wY0T08.mjs} +1 -1
- package/dist/{Admin-DzzyoyGR.mjs → Admin-D2FYThvi.mjs} +1 -1
- package/dist/{AiGeneral-KAFQ8rs1.mjs → AiGeneral-D1lJPvX7.mjs} +1 -1
- package/dist/{AiScoring-jsIBvcYZ.mjs → AiScoring-CcRQ9ibi.mjs} +1 -1
- package/dist/{AiText-BDfgezFq.mjs → AiText-BK0AYcsX.mjs} +1 -1
- package/dist/{Anniversary-DijPzGvt.mjs → Anniversary-46vSEUcH.mjs} +1 -1
- package/dist/{Appreciation-Civ8AH_K.mjs → Appreciation-BZyfXatd.mjs} +1 -1
- package/dist/{ArrowDown-CNX2VcYR.mjs → ArrowDown-DV-U_oS8.mjs} +1 -1
- package/dist/{ArrowLeft-CvB8kbCi.mjs → ArrowLeft-BcyBJV0J.mjs} +1 -1
- package/dist/{ArrowRight-C5205uKr.mjs → ArrowRight-eCW7lDIt.mjs} +1 -1
- package/dist/{ArrowUp-D-Enms4g.mjs → ArrowUp-pkMr1xIg.mjs} +1 -1
- package/dist/{Attachment-2gW9KFDu.mjs → Attachment-rGM6O89C.mjs} +1 -1
- package/dist/{BeQuickDontHurry-CX1xPHM5.mjs → BeQuickDontHurry-KgpDt-cj.mjs} +1 -1
- package/dist/{Birthday-Da5KiZzO.mjs → Birthday-D48PUXJO.mjs} +1 -1
- package/dist/{BrandPromise-jU9IJWgw.mjs → BrandPromise-BRPjqcQt.mjs} +1 -1
- package/dist/{BrandVision-CI-lMTGG.mjs → BrandVision-CzEZa-Md.mjs} +1 -1
- package/dist/{BubbleGraph-BjlKc4fH.mjs → BubbleGraph-CefxuneI.mjs} +1 -1
- package/dist/{Calendar-BiRBpnSX.mjs → Calendar-unp4CZkL.mjs} +1 -1
- package/dist/{CaretDn-CmjKXpG0.mjs → CaretDn-D-R4crZU.mjs} +1 -1
- package/dist/{CaretDown-9KKZ_F3M.mjs → CaretDown-Dfrsy8c3.mjs} +1 -1
- package/dist/{CaretLeft-DzVbQpJc.mjs → CaretLeft-KieUzuhv.mjs} +1 -1
- package/dist/{CaretRight-DOxFIFp6.mjs → CaretRight-Scgypi50.mjs} +1 -1
- package/dist/{CaretUp-CjRFlwF-.mjs → CaretUp-BVbfFxs4.mjs} +1 -1
- package/dist/{ChallengeAccepted-DZElpUDb.mjs → ChallengeAccepted-CiTJnANv.mjs} +1 -1
- package/dist/{CheckIn-nzZXMiOF.mjs → CheckIn-DMRssJrE.mjs} +1 -1
- package/dist/{CheckIns-4B4ZI2Ky.mjs → CheckIns-DSgQDZjv.mjs} +1 -1
- package/dist/{CheckSeal-kG0_z9Ev.mjs → CheckSeal-Cx-7gltS.mjs} +1 -1
- package/dist/{Checkmark-DtJmv4-H.mjs → Checkmark-oreejLTo.mjs} +1 -1
- package/dist/{Clock-CzvsW2Rv.mjs → Clock-CLqF0J5V.mjs} +1 -1
- package/dist/{Close-DPnzrkGy.mjs → Close-BdHi75Qp.mjs} +1 -1
- package/dist/{CloudDownload-CiKm9LvH.mjs → CloudDownload-SdHSUAkt.mjs} +1 -1
- package/dist/{Comment-C2JP-Tgp.mjs → Comment-DxbuQvmT.mjs} +1 -1
- package/dist/{Comments-CI2eCndc.mjs → Comments-AiDEy5_W.mjs} +1 -1
- package/dist/{Connections-DJ_5S5Gt.mjs → Connections-BQtD7IcD.mjs} +1 -1
- package/dist/{Copy-D0Ap9Uo3.mjs → Copy-C4fX-e8y.mjs} +1 -1
- package/dist/{CustomQuestion-eV7Y5s43.mjs → CustomQuestion-Day3fVQQ.mjs} +1 -1
- package/dist/{CustomerSuccess-CBwcq-CE.mjs → CustomerSuccess-lKdhj-Dl.mjs} +1 -1
- package/dist/{DatePicker-184Ffhcj.mjs → DatePicker-Bff92ihu.mjs} +1 -1
- package/dist/{Dot-Bkt56vsn.mjs → Dot-DK4OveHb.mjs} +1 -1
- package/dist/{Download-KuZNfH6J.mjs → Download-C7ZNlQWk.mjs} +1 -1
- package/dist/{Drag-B3GINcKH.mjs → Drag-DJgj2bFn.mjs} +1 -1
- package/dist/{DragIndicator-CJtCm0hy.mjs → DragIndicator-BeU5wXHg.mjs} +1 -1
- package/dist/{Earn-CDQ5KzXU.mjs → Earn-C-mTFA-R.mjs} +1 -1
- package/dist/{Email-DxxHbLw3.mjs → Email-5a3fjfhm.mjs} +1 -1
- package/dist/{EmojiDisplay-0Z1fUKxH.mjs → EmojiDisplay-Ddk-D2WT.mjs} +2 -2
- package/dist/{EmojiPicker-B0929UbB.mjs → EmojiPicker-C1S1erzs.mjs} +2 -2
- package/dist/{EnpsSurvey-DGXLQLaN.mjs → EnpsSurvey-BTcGBYAh.mjs} +1 -1
- package/dist/{Expired-BT4Y2Maj.mjs → Expired-D8qiD8Fc.mjs} +1 -1
- package/dist/{Eye-lsxTvtsY.mjs → Eye-B6KrxUFR.mjs} +1 -1
- package/dist/{Feedback-Clukqvnv.mjs → Feedback-C7pjCDl2.mjs} +1 -1
- package/dist/{Feedback-CAbiIboe.mjs → Feedback-DHXu6hvi.mjs} +1 -1
- package/dist/{Filter-Br1uqxJf.mjs → Filter-Cd1rNJcO.mjs} +1 -1
- package/dist/{Flag-BOrqfdB9.mjs → Flag-C4Gs85KR.mjs} +1 -1
- package/dist/{Giphy-DFUqbsPd.mjs → Giphy-CuTQ_Cgq.mjs} +1 -1
- package/dist/{GoalCount-lYisy2xR.mjs → GoalCount-BKBTy1OB.mjs} +1 -1
- package/dist/{GoalPercent-BGSU5Pp6.mjs → GoalPercent-gr6pbwKU.mjs} +1 -1
- package/dist/{GoalTask-CF4PCgwk.mjs → GoalTask-CfhFxtVu.mjs} +1 -1
- package/dist/{GoalTask-hoUXni6f.mjs → GoalTask-mr9rmwkP.mjs} +1 -1
- package/dist/{Goals-DsDotABT.mjs → Goals-BNoO5JAU.mjs} +1 -1
- package/dist/{Goals-DOxdK1gc.mjs → Goals-By0_1iq2.mjs} +1 -1
- package/dist/{Growth-DiSuU78G.mjs → Growth-Dn9eh_iv.mjs} +1 -1
- package/dist/{Hamburger-DR-IVlwO.mjs → Hamburger-DRG8fEXa.mjs} +1 -1
- package/dist/{HandExpanded-CovmfVPV.mjs → HandExpanded-D4BURMdx.mjs} +1 -1
- package/dist/{Help-D_rVtakN.mjs → Help-DkYArkDa.mjs} +1 -1
- package/dist/{HighFive-Cg_nGHDi.mjs → HighFive-D-kHym4Q.mjs} +1 -1
- package/dist/{HighFive-CP_KxaW0.mjs → HighFive-DmxRyD4p.mjs} +1 -1
- package/dist/{Home-CQxm-uY0.mjs → Home-AyHzuYuZ.mjs} +1 -1
- package/dist/{Home-Cp5sP1r-.mjs → Home-DdN5IkJ3.mjs} +1 -1
- package/dist/{HorizontalLine-Cug_bvwu.mjs → HorizontalLine-DxVp-3qp.mjs} +1 -1
- package/dist/{Hourglass-DUowigM4.mjs → Hourglass-CHNdLzhp.mjs} +1 -1
- package/dist/{Image-wqNBjDM9.mjs → Image-Ca8zvVyg.mjs} +1 -1
- package/dist/{ImageFile-C-CryJMI.mjs → ImageFile-uKDu1uSy.mjs} +1 -1
- package/dist/{InGoodCompany-6OzwIT2u.mjs → InGoodCompany-ktZ3qGC7.mjs} +1 -1
- package/dist/{Incentives-n_QGqtLe.mjs → Incentives--wxIzq07.mjs} +1 -1
- package/dist/{Infinite-CMJ_hCpT.mjs → Infinite-C4Na6Xes.mjs} +1 -1
- package/dist/{Info-CGrSG-Ye.mjs → Info-BeJ1dg3M.mjs} +1 -1
- package/dist/{Insights-CPlbrVEN.mjs → Insights-BldOyh7P.mjs} +1 -1
- package/dist/{Insights-BwC8S6zS.mjs → Insights-ZHkEmdAq.mjs} +1 -1
- package/dist/{Integrations-CaDM0Joe.mjs → Integrations-nSA4D5qh.mjs} +1 -1
- package/dist/{KazooLogo-ChWeSQPi.mjs → KazooLogo-Dk5xj-m5.mjs} +1 -1
- package/dist/{KnowYourAudience-cUmR02LD.mjs → KnowYourAudience-DaUZU5ae.mjs} +1 -1
- package/dist/{Launch-DvcHjGgC.mjs → Launch-B70JE3JJ.mjs} +1 -1
- package/dist/{Link-E_8KRqae.mjs → Link-D6CPb_EM.mjs} +1 -1
- package/dist/{LinkArrow-DwzfjTiJ.mjs → LinkArrow-BhnnCNFq.mjs} +1 -1
- package/dist/{Loading-NsQ7rDZC.mjs → Loading-DZErGR5Q.mjs} +1 -1
- package/dist/{Lock-kSp3bZpz.mjs → Lock-QS19UZLk.mjs} +1 -1
- package/dist/{Management-CVWMMdhX.mjs → Management-BSUAg1of.mjs} +1 -1
- package/dist/{MeatballMenu-R4jfh51R.mjs → MeatballMenu-BBLsL4Ci.mjs} +1 -1
- package/dist/{MediaError-DLmWZ_mI.mjs → MediaError-Bir_QY8V.mjs} +1 -1
- package/dist/{Messages-DoOuPv3K.mjs → Messages-ogUiu3_J.mjs} +1 -1
- package/dist/{Microphone-B9UOXLqY.mjs → Microphone-BtQq4_Jo.mjs} +1 -1
- package/dist/{Mobile-BGOp0y1N.mjs → Mobile-DnVMZ4yz.mjs} +1 -1
- package/dist/{Moon-CMvprURh.mjs → Moon-CHpnHeGV.mjs} +1 -1
- package/dist/{Nomination-CHx3r6TA.mjs → Nomination-BBnpVnMY.mjs} +1 -1
- package/dist/{NominationsAndAwards-mvsYeeb4.mjs → NominationsAndAwards-BtxaRTWw.mjs} +1 -1
- package/dist/{Notification-BOi0IuJz.mjs → Notification-D_lKyiWx.mjs} +1 -1
- package/dist/{Okrs-DnCALJJt.mjs → Okrs-CfoFgBvv.mjs} +1 -1
- package/dist/{Pause-fjaRo7bE.mjs → Pause-BfSFlnqu.mjs} +1 -1
- package/dist/{PeerToPeer-CEF5OMc5.mjs → PeerToPeer-F1tOdlog.mjs} +1 -1
- package/dist/{Pencil-VZRJM1MN.mjs → Pencil-Bjxrw2rF.mjs} +1 -1
- package/dist/{People-CRsrQ3k1.mjs → People-6RccYNox.mjs} +1 -1
- package/dist/{PerformanceManagement-DruEJ4jR.mjs → PerformanceManagement-D_4UvDAK.mjs} +1 -1
- package/dist/{Pin-DxdZkF15.mjs → Pin-CL3ooKJS.mjs} +1 -1
- package/dist/{PinnedIconAward-Dlx_WNdl.mjs → PinnedIconAward-BhJzE_2h.mjs} +1 -1
- package/dist/{PinnedIconBrightIdea-DG7BXNNh.mjs → PinnedIconBrightIdea-uBlwTwIJ.mjs} +1 -1
- package/dist/{PinnedIconBullseye-BBCXD3-0.mjs → PinnedIconBullseye-o-X17qWG.mjs} +1 -1
- package/dist/{PinnedIconChampagne-I8rOBYW2.mjs → PinnedIconChampagne-ENae4pCN.mjs} +1 -1
- package/dist/{PinnedIconCheer-uNLhT-Xs.mjs → PinnedIconCheer-ozdHGHHT.mjs} +1 -1
- package/dist/{PinnedIconCrown-CZgaDQZ7.mjs → PinnedIconCrown-D-W8qntq.mjs} +1 -1
- package/dist/{PinnedIconDiamond-C0lY4and.mjs → PinnedIconDiamond-CJj3ZPiZ.mjs} +1 -1
- package/dist/{PinnedIconHoleInOne-DdmIcQGU.mjs → PinnedIconHoleInOne-Cz05qW8l.mjs} +1 -1
- package/dist/{PinnedIconMedal-CsRl1lXD.mjs → PinnedIconMedal-OKfET5uX.mjs} +1 -1
- package/dist/{PinnedIconMetrics-Cg8oCMq2.mjs → PinnedIconMetrics-B2y-74Uw.mjs} +1 -1
- package/dist/{PinnedIconPin-DyVYJ9J5.mjs → PinnedIconPin-CvQ-S3jy.mjs} +1 -1
- package/dist/{PinnedIconRockAndRoll-8qNwz2Tb.mjs → PinnedIconRockAndRoll-Bcczcvkf.mjs} +1 -1
- package/dist/{PinnedIconRocket-C9W9hctP.mjs → PinnedIconRocket-Bo3DW6yF.mjs} +1 -1
- package/dist/{PinnedIconStrength-DAFeHAE-.mjs → PinnedIconStrength-ZdG1XAVs.mjs} +1 -1
- package/dist/{PinnedIconTeddyBear-C2GulMF3.mjs → PinnedIconTeddyBear-lrJuPshi.mjs} +1 -1
- package/dist/{PlatformLogo-uJBfWT0W.mjs → PlatformLogo-48qas6-P.mjs} +1 -1
- package/dist/{Plus-CxCUxOVr.mjs → Plus-CVt00ruZ.mjs} +1 -1
- package/dist/{Popper-Bf-85JAo.mjs → Popper-DA6vw3NP.mjs} +1 -1
- package/dist/{PrivateEye-DsOQhEi7.mjs → PrivateEye-BPBOvevp.mjs} +1 -1
- package/dist/{PrivatePushPin-CJOenhmt.mjs → PrivatePushPin-DjPcVsYL.mjs} +1 -1
- package/dist/{Processing-vi1fJk92.mjs → Processing-CMgCpXoc.mjs} +1 -1
- package/dist/{Productivity-BoNLPKT7.mjs → Productivity-BkLvbmTh.mjs} +1 -1
- package/dist/{ProgressCircle-B-I4erm_.mjs → ProgressCircle-Dey4HYEF.mjs} +1 -1
- package/dist/{PulseSurvey-BvrZTZN9.mjs → PulseSurvey-CRw3kGZ9.mjs} +1 -1
- package/dist/{PushPin-Bt5mwbYW.mjs → PushPin-BhCskyhI.mjs} +1 -1
- package/dist/{QuotesLeft-wR0ecRf8.mjs → QuotesLeft-BQTnQ8Ge.mjs} +1 -1
- package/dist/{QuotesRight-PaCwDfRI.mjs → QuotesRight-Du9M926m.mjs} +1 -1
- package/dist/{Recognition-5ebuowYn.mjs → Recognition-B0NNm29w.mjs} +1 -1
- package/dist/{Recognition-crtkwFHX.mjs → Recognition-BpN6tYYo.mjs} +1 -1
- package/dist/{Retention-3n59Jmzt.mjs → Retention-DjXsTREw.mjs} +1 -1
- package/dist/{Rewards-DpPkOhdY.mjs → Rewards-DEMXl88-.mjs} +1 -1
- package/dist/{Rewards-blVF1_GN.mjs → Rewards-Urg4RuEs.mjs} +1 -1
- package/dist/{RewardsCatalog-DdsDgVE4.mjs → RewardsCatalog-gLs4w6bH.mjs} +1 -1
- package/dist/{Roadmap-BWb0i545.mjs → Roadmap-gsyQ6Y1S.mjs} +1 -1
- package/dist/{Search-oLvHOH9j.mjs → Search-6syrb2Qc.mjs} +1 -1
- package/dist/{Security-CYgFVk0P.mjs → Security-C-DASXs_.mjs} +1 -1
- package/dist/{SendRecognition-DtQRNRwe.mjs → SendRecognition-eKR54w_d.mjs} +1 -1
- package/dist/{ShareLink-CYpL5A14.mjs → ShareLink-BWUHnYmv.mjs} +1 -1
- package/dist/{SidebarCollapse-CzctJS8j.mjs → SidebarCollapse-Ds3nuwTB.mjs} +1 -1
- package/dist/{Skill-CfPY1u4P.mjs → Skill-C--1Kexo.mjs} +1 -1
- package/dist/{Skills-C0UoAQdj.mjs → Skills-BFUMsXay.mjs} +1 -1
- package/dist/{Smiley-DOyZqKec.mjs → Smiley-BZSBlRmJ.mjs} +1 -1
- package/dist/{Stop-_FYDM_26.mjs → Stop-C0_sI9aU.mjs} +1 -1
- package/dist/{Sun-CLuvaxDw.mjs → Sun-HeyYg16J.mjs} +1 -1
- package/dist/{Survey-D5CF3SuA.mjs → Survey-D7D2eFCq.mjs} +1 -1
- package/dist/{Surveys-DI5MPMmq.mjs → Surveys-CQDLjb3A.mjs} +1 -1
- package/dist/{SyncUps-BfANPa-s.mjs → SyncUps-raPggh_t.mjs} +1 -1
- package/dist/{Syncs-Bv5WkkbN.mjs → Syncs-BEXQnoaF.mjs} +1 -1
- package/dist/{TalentReview-B2mWOeN2.mjs → TalentReview-BlTnFetC.mjs} +1 -1
- package/dist/{TalentReview-Cdnq2C3b.mjs → TalentReview-DBDxWYos.mjs} +1 -1
- package/dist/{TalentReviewInsights-DPr9Fs2u.mjs → TalentReviewInsights-Cg7B5-is.mjs} +1 -1
- package/dist/{TaskCompleted-BdEY6Uqb.mjs → TaskCompleted-DlQrD-M2.mjs} +1 -1
- package/dist/{Team-CkKcJrY0.mjs → Team-1Y19pf-q.mjs} +1 -1
- package/dist/{Teams-D24i6w6O.mjs → Teams-BFgR4XUP.mjs} +1 -1
- package/dist/{TextBold-4qFsQoMV.mjs → TextBold-VO0cUiZJ.mjs} +1 -1
- package/dist/{TextBulletList-Dm779cXG.mjs → TextBulletList-Ck2OlVlj.mjs} +1 -1
- package/dist/{TextInput-Bt0JYXuN.mjs → TextInput-CisgNbvK.mjs} +1 -1
- package/dist/{TextItalic-DbAdQkph.mjs → TextItalic-D1W-sogj.mjs} +1 -1
- package/dist/{TextNumberList-B80By3uI.mjs → TextNumberList-C_R06JnF.mjs} +1 -1
- package/dist/{TextUnderline-CB0822Ht.mjs → TextUnderline-Qh7dqfhW.mjs} +1 -1
- package/dist/{ThumbsDown-oiXYJ2Oz.mjs → ThumbsDown-BZLOcK2O.mjs} +1 -1
- package/dist/{ThumbsUp-VhVChbuc.mjs → ThumbsUp-DSGKhIEA.mjs} +1 -1
- package/dist/{Toggle-ByInmLVM.mjs → Toggle-C9qaybQQ.mjs} +1 -1
- package/dist/{Translate-DUO5G1iQ.mjs → Translate-aHudZU52.mjs} +1 -1
- package/dist/{Trash-3SpqdcYk.mjs → Trash-BVgdAghA.mjs} +1 -1
- package/dist/{TrendDown-Brw70rr8.mjs → TrendDown-DfKnz-7d.mjs} +1 -1
- package/dist/{TrendUp-CQu5Ydtm.mjs → TrendUp-TVae7kAJ.mjs} +1 -1
- package/dist/{Trophy-Bok-YXDk.mjs → Trophy-DOzm9rdO.mjs} +1 -1
- package/dist/{Undo-CC-m5vIl.mjs → Undo-BluTB5sK.mjs} +1 -1
- package/dist/{Unplugged-3fOqBmty.mjs → Unplugged-DwQLDtW-.mjs} +1 -1
- package/dist/{UpDownCaret-ArfJ627k.mjs → UpDownCaret-BnbU5Voj.mjs} +1 -1
- package/dist/{VerifiedCheckmark-DE2rRNGq.mjs → VerifiedCheckmark-BhVp7Ios.mjs} +1 -1
- package/dist/{VerticalLine-MH8aS4Hc.mjs → VerticalLine-ZepC8RcQ.mjs} +1 -1
- package/dist/{Warning-BAmK50ci.mjs → Warning-DqgO_ok8.mjs} +1 -1
- package/dist/{WarningNoOutline-BMjc63vE.mjs → WarningNoOutline-CxCoO-xp.mjs} +1 -1
- package/dist/{YesAnd-wmrfcwq0.mjs → YesAnd-1h7k0olS.mjs} +1 -1
- package/dist/{emoji-7B3fLWsS.mjs → emoji-B43qwmQA.mjs} +1 -1
- package/dist/express.js +1309 -414
- package/dist/{react-apexcharts.min-BycfFjbp.mjs → react-apexcharts.min-Dgk0MYSk.mjs} +1 -1
- package/dist/react.es.js +1 -1
- package/dist/react.umd.js +152 -152
- package/dist/{reactComponent-D3nRHRjE.mjs → reactComponent-9IsyGFlo.mjs} +13993 -14078
- package/package.json +1 -1
- package/build/constants.js +0 -80
- package/build/dist/express.d.ts +0 -2
- package/build/dist/express.js +0 -10457
- package/build/express.d.ts +0 -2
- package/build/express.js +0 -21
- package/build/react.d.ts +0 -4
- package/build/react.js +0 -44
- package/build/src/backend/express.d.ts +0 -63
- package/build/src/backend/express.js +0 -366
package/build/express.d.ts
DELETED
package/build/express.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.setupAiAssistantRoutes = void 0;
|
|
18
|
-
var express_1 = require("./src/backend/express");
|
|
19
|
-
Object.defineProperty(exports, "setupAiAssistantRoutes", { enumerable: true, get: function () { return express_1.setupAiAssistantRoutes; } });
|
|
20
|
-
__exportStar(require("./backendTypes"), exports);
|
|
21
|
-
//# sourceMappingURL=express.js.map
|
package/build/react.d.ts
DELETED
package/build/react.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.tools = exports.config = void 0;
|
|
40
|
-
__exportStar(require("./src/frontend/reactComponent"), exports);
|
|
41
|
-
exports.config = __importStar(require("./src/frontend/config"));
|
|
42
|
-
exports.tools = __importStar(require("./src/frontend/tools/llm-tools"));
|
|
43
|
-
__exportStar(require("./sharedTypes"), exports);
|
|
44
|
-
//# sourceMappingURL=react.js.map
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { Express, RequestHandler } from "express";
|
|
2
|
-
import type { RestEndpointCallbacks, GraphQLOperationCallbacks } from "./types";
|
|
3
|
-
/**
|
|
4
|
-
* Note: the inline TypeScript documentation for the below is in `../../express.d.ts`.
|
|
5
|
-
* This is optimized for external use, so we don't want to duplicate the docs here.
|
|
6
|
-
*/
|
|
7
|
-
export declare function setupAiAssistantRoutes(args: {
|
|
8
|
-
app: Express;
|
|
9
|
-
getBearerToken: (headers: Record<string, undefined | string | string[]>) => Promise<string>;
|
|
10
|
-
targetHost: string;
|
|
11
|
-
targetPort?: number;
|
|
12
|
-
targetProtocol?: string;
|
|
13
|
-
route?: string;
|
|
14
|
-
logger?: Pick<typeof console, "log" | "error" | "debug">;
|
|
15
|
-
preflightMiddlewares?: RequestHandler[];
|
|
16
|
-
getTargetPath: (path: string) => string;
|
|
17
|
-
followRedirects?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Optional callbacks to invoke after successful REST endpoint responses (status 200 only).
|
|
20
|
-
* Provides access to both request and response data with full type safety.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* onRestEndpointSuccess: {
|
|
25
|
-
* '/api/api-ai-assistant/v1/chat': async ({ request, response }) => {
|
|
26
|
-
* console.log('Chat completed successfully');
|
|
27
|
-
* // response is typed as ChatResponse
|
|
28
|
-
* console.log('Model response:', response.role, response.parts);
|
|
29
|
-
* },
|
|
30
|
-
* '/api/api-ai-assistant/v1/tts': async ({ request, response }) => {
|
|
31
|
-
* // response is typed as TTSResponse
|
|
32
|
-
* console.log('Speech synthesis:', response.synthesis);
|
|
33
|
-
* },
|
|
34
|
-
* }
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
onRestEndpointSuccess?: RestEndpointCallbacks;
|
|
38
|
-
/**
|
|
39
|
-
* Optional callbacks to invoke after successful GraphQL operation responses (status 200 only).
|
|
40
|
-
* Keys must match the GraphQL operation names (PascalCase), not field names.
|
|
41
|
-
* Provides access to both request and response data with full type safety.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* onGraphQLOperationSuccess: {
|
|
46
|
-
* AppendMessageToConversation: async ({ request, response }) => {
|
|
47
|
-
* // Extract the conversation ID from the typed response
|
|
48
|
-
* const conversationId = response.data?.appendMessage?.conversation?.id;
|
|
49
|
-
* if (conversationId) {
|
|
50
|
-
* // Store in localStorage, update UI state, trigger analytics, etc.
|
|
51
|
-
* localStorage.setItem('lastConversationId', conversationId);
|
|
52
|
-
* console.log('New conversation created:', conversationId);
|
|
53
|
-
* }
|
|
54
|
-
* },
|
|
55
|
-
* GetAllConversations: async ({ request, response }) => {
|
|
56
|
-
* const conversations = response.data?.getConversations;
|
|
57
|
-
* console.log(`Loaded ${conversations?.length ?? 0} conversations`);
|
|
58
|
-
* },
|
|
59
|
-
* }
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
onGraphQLOperationSuccess?: GraphQLOperationCallbacks;
|
|
63
|
-
}): void;
|
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupAiAssistantRoutes = setupAiAssistantRoutes;
|
|
4
|
-
const http_proxy_middleware_1 = require("http-proxy-middleware");
|
|
5
|
-
const helpers_1 = require("@kazoohr/helpers");
|
|
6
|
-
/**
|
|
7
|
-
* Note: the inline TypeScript documentation for the below is in `../../express.d.ts`.
|
|
8
|
-
* This is optimized for external use, so we don't want to duplicate the docs here.
|
|
9
|
-
*/
|
|
10
|
-
function setupAiAssistantRoutes(args) {
|
|
11
|
-
const logger = (0, helpers_1.coalesce)(args.logger, console);
|
|
12
|
-
const routePath = args.route ?? "/ai-assistant";
|
|
13
|
-
const port = args.targetPort ?? 80;
|
|
14
|
-
const protocol = args.targetProtocol ?? "http";
|
|
15
|
-
// This initial middleware mutates the request headers for the proxy request
|
|
16
|
-
// so that we can add the bearer token to the request. We need this separate
|
|
17
|
-
// because the proxy middleware callbacks cannot be async.
|
|
18
|
-
const bearerTokenMiddleware = (req, res, next) => {
|
|
19
|
-
args
|
|
20
|
-
.getBearerToken(req.headers)
|
|
21
|
-
.then((bearerToken) => {
|
|
22
|
-
getRequestWithNewAuthHeader(req).newAuthHeader = `Bearer ${bearerToken}`;
|
|
23
|
-
next();
|
|
24
|
-
})
|
|
25
|
-
.catch((error) => {
|
|
26
|
-
logger.error("Error getting bearer token:", error);
|
|
27
|
-
next(error);
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
const proxyOptions = {
|
|
31
|
-
target: `${protocol}://${args.targetHost}:${port}`,
|
|
32
|
-
changeOrigin: true,
|
|
33
|
-
followRedirects: args.followRedirects ?? true,
|
|
34
|
-
secure: protocol === "https",
|
|
35
|
-
pathRewrite: (path, req) => {
|
|
36
|
-
// Since we use express, we know that req.originalUrl is available
|
|
37
|
-
const expressRequest = req; // eslint-disable-line @typescript-eslint/consistent-type-assertions
|
|
38
|
-
return args.getTargetPath(expressRequest.originalUrl || path);
|
|
39
|
-
},
|
|
40
|
-
on: {
|
|
41
|
-
proxyReq: (proxyReq, req) => {
|
|
42
|
-
const newAuthHeader = getRequestWithNewAuthHeader(req).newAuthHeader;
|
|
43
|
-
if (newAuthHeader) {
|
|
44
|
-
proxyReq.setHeader("Authorization", newAuthHeader);
|
|
45
|
-
}
|
|
46
|
-
(0, http_proxy_middleware_1.fixRequestBody)(proxyReq, req);
|
|
47
|
-
},
|
|
48
|
-
proxyRes: (proxyRes, req, res) => {
|
|
49
|
-
if (proxyRes.statusCode !== 200) {
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
51
|
-
const originalUrl = req
|
|
52
|
-
.originalUrl;
|
|
53
|
-
logger.error(`[setupAiAssistantRoutes] Proxy error ${proxyRes.statusCode}: ${originalUrl}`);
|
|
54
|
-
}
|
|
55
|
-
// istanbul ignore else - noop, normal request
|
|
56
|
-
if (req.headers.accept === "text/event-stream") {
|
|
57
|
-
res.writeHead(res.statusCode, {
|
|
58
|
-
"Content-Type": "text/event-stream",
|
|
59
|
-
"Cache-Control": "no-transform",
|
|
60
|
-
Connection: "keep-alive",
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
// Handle callbacks for successful responses
|
|
64
|
-
if (proxyRes.statusCode === 200 &&
|
|
65
|
-
(args.onRestEndpointSuccess || args.onGraphQLOperationSuccess)) {
|
|
66
|
-
handleSuccessCallback({
|
|
67
|
-
proxyRes,
|
|
68
|
-
req,
|
|
69
|
-
logger,
|
|
70
|
-
onRestEndpointSuccess: args.onRestEndpointSuccess,
|
|
71
|
-
onGraphQLOperationSuccess: args.onGraphQLOperationSuccess,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
error: (err, req, res) => {
|
|
76
|
-
logger.error("[setupAiAssistantRoutes] Proxy error:", err);
|
|
77
|
-
if ("headersSent" in res && !res.headersSent) {
|
|
78
|
-
res.statusCode = 502;
|
|
79
|
-
res.write("Bad Gateway");
|
|
80
|
-
res.end();
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
logger.debug("[setupAiAssistantRoutes] Setting up AI Assistant proxy:", proxyOptions);
|
|
86
|
-
const proxy = (0, http_proxy_middleware_1.createProxyMiddleware)(proxyOptions);
|
|
87
|
-
args.app.use(routePath, ...(0, helpers_1.coalesce)(args.preflightMiddlewares, []), bearerTokenMiddleware, proxy);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* This function gets around needing to add new global types that are only
|
|
91
|
-
* needed for this one function.
|
|
92
|
-
*/
|
|
93
|
-
function getRequestWithNewAuthHeader(req) {
|
|
94
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
95
|
-
return req;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Handles success callbacks by buffering the response and invoking the
|
|
99
|
-
* appropriate callback based on the request type
|
|
100
|
-
*/
|
|
101
|
-
function handleSuccessCallback(args) {
|
|
102
|
-
const { proxyRes, req, logger, onRestEndpointSuccess, onGraphQLOperationSuccess, } = args;
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
104
|
-
const expressRequest = req;
|
|
105
|
-
const targetPath = expressRequest.path || expressRequest.url || "";
|
|
106
|
-
const requestBody = expressRequest.body;
|
|
107
|
-
// Buffer the response data
|
|
108
|
-
const chunks = [];
|
|
109
|
-
proxyRes.on("data", (chunk) => {
|
|
110
|
-
chunks.push(chunk);
|
|
111
|
-
});
|
|
112
|
-
proxyRes.on("end", () => {
|
|
113
|
-
processBufferedResponse({
|
|
114
|
-
chunks,
|
|
115
|
-
requestBody,
|
|
116
|
-
targetPath,
|
|
117
|
-
expressRequest,
|
|
118
|
-
logger,
|
|
119
|
-
onRestEndpointSuccess,
|
|
120
|
-
onGraphQLOperationSuccess,
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Processes the buffered response and routes to appropriate callbacks
|
|
126
|
-
*/
|
|
127
|
-
function processBufferedResponse(args) {
|
|
128
|
-
const { chunks, requestBody, targetPath, expressRequest, logger, onRestEndpointSuccess, onGraphQLOperationSuccess, } = args;
|
|
129
|
-
try {
|
|
130
|
-
const responseBody = Buffer.concat(chunks).toString("utf8");
|
|
131
|
-
// Skip callback if response is empty
|
|
132
|
-
if (!responseBody) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const parsedResponse = tryParseJSON(responseBody, logger);
|
|
136
|
-
if (!parsedResponse) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
routeCallback({
|
|
140
|
-
requestBody,
|
|
141
|
-
parsedResponse,
|
|
142
|
-
targetPath,
|
|
143
|
-
expressRequest,
|
|
144
|
-
logger,
|
|
145
|
-
onRestEndpointSuccess,
|
|
146
|
-
onGraphQLOperationSuccess,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
catch (error) {
|
|
150
|
-
// Don't let callback errors break the proxy
|
|
151
|
-
logger.error("[setupAiAssistantRoutes] Error in success callback:", error);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Routes the parsed response to the appropriate callback handler
|
|
156
|
-
*/
|
|
157
|
-
function routeCallback(args) {
|
|
158
|
-
const { requestBody, parsedResponse, targetPath, expressRequest, logger, onRestEndpointSuccess, onGraphQLOperationSuccess, } = args;
|
|
159
|
-
const isGraphQLRequest = isGraphQLRequestBody(requestBody);
|
|
160
|
-
if (isGraphQLRequest && onGraphQLOperationSuccess) {
|
|
161
|
-
handleGraphQLCallback({
|
|
162
|
-
requestBody,
|
|
163
|
-
parsedResponse,
|
|
164
|
-
expressRequest,
|
|
165
|
-
onGraphQLOperationSuccess,
|
|
166
|
-
logger,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
else if (!isGraphQLRequest && onRestEndpointSuccess) {
|
|
170
|
-
handleRestCallback({
|
|
171
|
-
targetPath,
|
|
172
|
-
requestBody,
|
|
173
|
-
parsedResponse,
|
|
174
|
-
expressRequest,
|
|
175
|
-
onRestEndpointSuccess,
|
|
176
|
-
logger,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Attempts to parse JSON response body
|
|
182
|
-
*/
|
|
183
|
-
function tryParseJSON(responseBody, logger) {
|
|
184
|
-
try {
|
|
185
|
-
return JSON.parse(responseBody);
|
|
186
|
-
}
|
|
187
|
-
catch (error) {
|
|
188
|
-
// If it's not JSON (e.g., streaming response), skip callback
|
|
189
|
-
logger.debug("[setupAiAssistantRoutes] Response is not JSON, skipping callback");
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Checks if an object has GraphQL operation fields
|
|
195
|
-
*/
|
|
196
|
-
function hasGraphQLFields(item) {
|
|
197
|
-
return (typeof item === "object" &&
|
|
198
|
-
item !== null &&
|
|
199
|
-
("operationName" in item || "query" in item));
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Checks if request body indicates a GraphQL request
|
|
203
|
-
*/
|
|
204
|
-
function isGraphQLRequestBody(requestBody) {
|
|
205
|
-
// Handle single GraphQL operation
|
|
206
|
-
if (!Array.isArray(requestBody)) {
|
|
207
|
-
return hasGraphQLFields(requestBody);
|
|
208
|
-
}
|
|
209
|
-
// Handle batched GraphQL operations
|
|
210
|
-
if (requestBody.length > 0) {
|
|
211
|
-
return hasGraphQLFields(requestBody[0]);
|
|
212
|
-
}
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Handles GraphQL operation callbacks
|
|
217
|
-
*/
|
|
218
|
-
function handleGraphQLCallback(args) {
|
|
219
|
-
const { requestBody, parsedResponse, expressRequest, onGraphQLOperationSuccess, logger, } = args;
|
|
220
|
-
// Handle batched GraphQL requests
|
|
221
|
-
if (Array.isArray(requestBody)) {
|
|
222
|
-
handleBatchedGraphQLCallbacks({
|
|
223
|
-
requestBodies: requestBody,
|
|
224
|
-
parsedResponse,
|
|
225
|
-
expressRequest,
|
|
226
|
-
onGraphQLOperationSuccess,
|
|
227
|
-
logger,
|
|
228
|
-
});
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
// Handle single GraphQL request
|
|
232
|
-
const operationName = extractGraphQLOperationName(requestBody, logger);
|
|
233
|
-
if (!operationName) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
const callback = onGraphQLOperationSuccess[operationName];
|
|
237
|
-
if (callback) {
|
|
238
|
-
invokeGraphQLCallback({
|
|
239
|
-
callback,
|
|
240
|
-
requestBody,
|
|
241
|
-
parsedResponse,
|
|
242
|
-
expressRequest,
|
|
243
|
-
operationName,
|
|
244
|
-
logger,
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Handles batched GraphQL operation callbacks
|
|
250
|
-
*/
|
|
251
|
-
function handleBatchedGraphQLCallbacks(args) {
|
|
252
|
-
const { requestBodies, parsedResponse, expressRequest, onGraphQLOperationSuccess, logger, } = args;
|
|
253
|
-
// Response should also be an array for batched requests
|
|
254
|
-
const responses = Array.isArray(parsedResponse)
|
|
255
|
-
? parsedResponse
|
|
256
|
-
: [parsedResponse];
|
|
257
|
-
// Process each operation in the batch
|
|
258
|
-
requestBodies.forEach((requestBody, index) => {
|
|
259
|
-
const operationName = extractGraphQLOperationName(requestBody, logger);
|
|
260
|
-
if (!operationName) {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
const callback = onGraphQLOperationSuccess[operationName];
|
|
264
|
-
if (!callback) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
// Match the request with its corresponding response
|
|
268
|
-
const response = responses[index] || parsedResponse;
|
|
269
|
-
invokeGraphQLCallback({
|
|
270
|
-
callback,
|
|
271
|
-
requestBody,
|
|
272
|
-
parsedResponse: response,
|
|
273
|
-
expressRequest,
|
|
274
|
-
operationName,
|
|
275
|
-
logger,
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Extracts the GraphQL operation name from request body
|
|
281
|
-
*/
|
|
282
|
-
function extractGraphQLOperationName(requestBody, logger) {
|
|
283
|
-
if (typeof requestBody !== "object" || requestBody === null) {
|
|
284
|
-
return undefined;
|
|
285
|
-
}
|
|
286
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
287
|
-
const body = requestBody;
|
|
288
|
-
// First, check if operationName is explicitly provided
|
|
289
|
-
if (body.operationName) {
|
|
290
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
291
|
-
return body.operationName;
|
|
292
|
-
}
|
|
293
|
-
// Try to extract from query string
|
|
294
|
-
if (body.query) {
|
|
295
|
-
const match = body.query.match(/(?:query|mutation)\s+(\w+)/);
|
|
296
|
-
if (match) {
|
|
297
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
298
|
-
return match[1];
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
logger.debug("[setupAiAssistantRoutes] Could not determine GraphQL operation name");
|
|
302
|
-
return undefined;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Invokes a GraphQL callback with the provided context
|
|
306
|
-
* Type assertion is necessary because callbacks have specific request/response types
|
|
307
|
-
* but we're working with unknown at runtime
|
|
308
|
-
*/
|
|
309
|
-
function invokeGraphQLCallback(args) {
|
|
310
|
-
const { callback, requestBody, parsedResponse, expressRequest, operationName, logger, } = args;
|
|
311
|
-
const context = {
|
|
312
|
-
request: {
|
|
313
|
-
path: expressRequest.path || expressRequest.url || "",
|
|
314
|
-
method: expressRequest.method || "POST",
|
|
315
|
-
body: requestBody,
|
|
316
|
-
},
|
|
317
|
-
response: parsedResponse,
|
|
318
|
-
};
|
|
319
|
-
// Type assertion needed: callback expects specific CallbackContext types,
|
|
320
|
-
// but we can only provide CallbackContext<unknown, unknown> at runtime
|
|
321
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
322
|
-
const typedCallback = callback;
|
|
323
|
-
Promise.resolve(typedCallback(context)).catch((error) => {
|
|
324
|
-
logger.error(`[setupAiAssistantRoutes] Error in GraphQL callback for ${operationName}:`, error);
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Handles REST endpoint callbacks
|
|
329
|
-
*/
|
|
330
|
-
function handleRestCallback(args) {
|
|
331
|
-
const { targetPath, requestBody, parsedResponse, expressRequest, onRestEndpointSuccess, logger, } = args;
|
|
332
|
-
const matchingPath = findMatchingRestEndpoint(targetPath, onRestEndpointSuccess);
|
|
333
|
-
if (!matchingPath) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
const callback = onRestEndpointSuccess[matchingPath];
|
|
337
|
-
if (callback) {
|
|
338
|
-
// Empty string fallback for path is unreachable since targetPath and expressRequest.path come from same source
|
|
339
|
-
/* istanbul ignore next */
|
|
340
|
-
const requestPath = expressRequest.path || expressRequest.url || "";
|
|
341
|
-
const context = {
|
|
342
|
-
request: {
|
|
343
|
-
path: requestPath,
|
|
344
|
-
method: expressRequest.method || "POST",
|
|
345
|
-
body: requestBody,
|
|
346
|
-
},
|
|
347
|
-
response: parsedResponse,
|
|
348
|
-
};
|
|
349
|
-
// Type assertion needed: callback expects specific CallbackContext types,
|
|
350
|
-
// but we can only provide CallbackContext<unknown, unknown> at runtime
|
|
351
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
352
|
-
const typedCallback = callback;
|
|
353
|
-
Promise.resolve(typedCallback(context)).catch((error) => {
|
|
354
|
-
logger.error(`[setupAiAssistantRoutes] Error in REST callback for ${matchingPath}:`, error);
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Finds a matching REST endpoint path from the callbacks
|
|
360
|
-
*/
|
|
361
|
-
function findMatchingRestEndpoint(targetPath, callbacks) {
|
|
362
|
-
const match = Object.keys(callbacks).find((path) => targetPath.includes(path));
|
|
363
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
364
|
-
return match;
|
|
365
|
-
}
|
|
366
|
-
//# sourceMappingURL=express.js.map
|