@sentry/mcp-server 0.14.0 → 0.16.0
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/{analyze-issue-with-seer-DbAWpyTC.cjs → analyze-issue-with-seer-B8ZWokLV.cjs} +57 -24
- package/dist/analyze-issue-with-seer-B8ZWokLV.cjs.map +1 -0
- package/dist/{analyze-issue-with-seer-BsNarzJN.js → analyze-issue-with-seer-szIqv1_I.js} +57 -24
- package/dist/analyze-issue-with-seer-szIqv1_I.js.map +1 -0
- package/dist/api-client/client.cjs +2 -1
- package/dist/api-client/client.d.cts +3 -3
- package/dist/api-client/client.d.ts +3 -3
- package/dist/api-client/client.js +2 -1
- package/dist/api-client/index.cjs +2 -1
- package/dist/api-client/index.d.cts +3 -3
- package/dist/api-client/index.d.ts +3 -3
- package/dist/api-client/index.js +2 -1
- package/dist/api-client/schema.d.cts +1 -1
- package/dist/api-client/schema.d.ts +1 -1
- package/dist/api-client/types.d.cts +2 -2
- package/dist/api-client/types.d.ts +2 -2
- package/dist/api-utils-B-9vnzoA.cjs +86 -0
- package/dist/api-utils-B-9vnzoA.cjs.map +1 -0
- package/dist/api-utils-CHRiLf2Y.js +69 -0
- package/dist/api-utils-CHRiLf2Y.js.map +1 -0
- package/dist/{client-Dkw5iYu3.cjs → client-C_lwH0jz.cjs} +102 -51
- package/dist/client-C_lwH0jz.cjs.map +1 -0
- package/dist/{client-CILwfx6G.d.cts → client-D8vrUp2k.d.cts} +39 -7
- package/dist/client-D8vrUp2k.d.cts.map +1 -0
- package/dist/{client-BCN17Wbp.d.ts → client-h32L1Hx5.d.ts} +39 -7
- package/dist/client-h32L1Hx5.d.ts.map +1 -0
- package/dist/{client-DOYWNvVM.js → client-pyNUFaLN.js} +102 -51
- package/dist/client-pyNUFaLN.js.map +1 -0
- package/dist/{create-dsn-CDcL2DLD.js → create-dsn-CEEytIa4.js} +2 -2
- package/dist/{create-dsn-CDcL2DLD.js.map → create-dsn-CEEytIa4.js.map} +1 -1
- package/dist/{create-dsn-fESUtX3R.cjs → create-dsn-CI7MSiQu.cjs} +2 -2
- package/dist/{create-dsn-fESUtX3R.cjs.map → create-dsn-CI7MSiQu.cjs.map} +1 -1
- package/dist/{create-project-DY5mFznV.js → create-project-CoV1e-vp.js} +3 -3
- package/dist/{create-project-DY5mFznV.js.map → create-project-CoV1e-vp.js.map} +1 -1
- package/dist/{create-project-Bg5uDkc4.cjs → create-project-DnLKRG1p.cjs} +3 -3
- package/dist/{create-project-Bg5uDkc4.cjs.map → create-project-DnLKRG1p.cjs.map} +1 -1
- package/dist/{create-team-5purh64V.cjs → create-team-DKpKxVIY.cjs} +2 -2
- package/dist/{create-team-5purh64V.cjs.map → create-team-DKpKxVIY.cjs.map} +1 -1
- package/dist/{create-team-C2R7EUC3.js → create-team-HWN88CJQ.js} +2 -2
- package/dist/{create-team-C2R7EUC3.js.map → create-team-HWN88CJQ.js.map} +1 -1
- package/dist/errors-BtJEw2Z-.cjs +38 -0
- package/dist/errors-BtJEw2Z-.cjs.map +1 -0
- package/dist/errors-D_R568zP.js +26 -0
- package/dist/errors-D_R568zP.js.map +1 -0
- package/dist/errors.cjs +2 -1
- package/dist/errors.d.cts +10 -2
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts +10 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -2
- package/dist/fetch-utils-B0CB5xLM.d.ts +33 -0
- package/dist/fetch-utils-B0CB5xLM.d.ts.map +1 -0
- package/dist/fetch-utils-CTLoW1R8.d.cts +33 -0
- package/dist/fetch-utils-CTLoW1R8.d.cts.map +1 -0
- package/dist/fetch-utils-SuGtrQRz.cjs +64 -0
- package/dist/fetch-utils-SuGtrQRz.cjs.map +1 -0
- package/dist/fetch-utils-gHZdOZV2.js +52 -0
- package/dist/fetch-utils-gHZdOZV2.js.map +1 -0
- package/dist/{find-dsns-CvfcLB9Z.js → find-dsns-BB9dQP0b.js} +2 -2
- package/dist/{find-dsns-CvfcLB9Z.js.map → find-dsns-BB9dQP0b.js.map} +1 -1
- package/dist/{find-dsns-ZZ-thiNk.cjs → find-dsns-vriZSwr7.cjs} +2 -2
- package/dist/{find-dsns-ZZ-thiNk.cjs.map → find-dsns-vriZSwr7.cjs.map} +1 -1
- package/dist/{find-errors-Drzv7hzM.cjs → find-errors-BQFHuBHi.cjs} +6 -3
- package/dist/find-errors-BQFHuBHi.cjs.map +1 -0
- package/dist/{find-errors-CuRm4PzL.js → find-errors-CSPsT-Jp.js} +6 -3
- package/dist/find-errors-CSPsT-Jp.js.map +1 -0
- package/dist/{find-issues-C3uk59rn.cjs → find-issues-BG80wLZw.cjs} +7 -4
- package/dist/find-issues-BG80wLZw.cjs.map +1 -0
- package/dist/{find-issues-CAtNGBly.js → find-issues-DoUD8vP0.js} +7 -4
- package/dist/find-issues-DoUD8vP0.js.map +1 -0
- package/dist/{find-organizations-ojXwWWzk.js → find-organizations-BILg1hUb.js} +3 -3
- package/dist/find-organizations-BILg1hUb.js.map +1 -0
- package/dist/{find-organizations-BrdMfZRO.cjs → find-organizations-Cx5vCj4j.cjs} +3 -3
- package/dist/find-organizations-Cx5vCj4j.cjs.map +1 -0
- package/dist/{find-projects-BZWhlYJh.cjs → find-projects-CN99WBex.cjs} +3 -3
- package/dist/{find-projects-BZWhlYJh.cjs.map → find-projects-CN99WBex.cjs.map} +1 -1
- package/dist/{find-projects-fcLG4KpT.js → find-projects-CgCj2_eq.js} +3 -3
- package/dist/{find-projects-fcLG4KpT.js.map → find-projects-CgCj2_eq.js.map} +1 -1
- package/dist/{find-releases-BUozr0Z-.js → find-releases-BsQF3wc5.js} +2 -2
- package/dist/{find-releases-BUozr0Z-.js.map → find-releases-BsQF3wc5.js.map} +1 -1
- package/dist/{find-releases-CZCVEOHZ.cjs → find-releases-Cm11xU5S.cjs} +2 -2
- package/dist/{find-releases-CZCVEOHZ.cjs.map → find-releases-Cm11xU5S.cjs.map} +1 -1
- package/dist/{find-tags-d-wF1Se8.js → find-tags-BRaa2i-r.js} +2 -2
- package/dist/{find-tags-d-wF1Se8.js.map → find-tags-BRaa2i-r.js.map} +1 -1
- package/dist/{find-tags-Byk4d3oZ.cjs → find-tags-BjibTJBm.cjs} +2 -2
- package/dist/{find-tags-Byk4d3oZ.cjs.map → find-tags-BjibTJBm.cjs.map} +1 -1
- package/dist/{find-teams-CnU5x9rQ.cjs → find-teams-CS443jRa.cjs} +3 -3
- package/dist/{find-teams-CnU5x9rQ.cjs.map → find-teams-CS443jRa.cjs.map} +1 -1
- package/dist/{find-teams-BZ118EIK.js → find-teams-XgUg8Nj5.js} +3 -3
- package/dist/{find-teams-BZ118EIK.js.map → find-teams-XgUg8Nj5.js.map} +1 -1
- package/dist/{find-transactions-DIJ80wkd.cjs → find-transactions-B0s_rr0H.cjs} +2 -2
- package/dist/{find-transactions-DIJ80wkd.cjs.map → find-transactions-B0s_rr0H.cjs.map} +1 -1
- package/dist/{find-transactions-DZCj81jP.js → find-transactions-Cob_B_3u.js} +2 -2
- package/dist/{find-transactions-DZCj81jP.js.map → find-transactions-Cob_B_3u.js.map} +1 -1
- package/dist/{formatting-BlMiQa9i.cjs → formatting-AXU4XsjJ.cjs} +33 -2
- package/dist/formatting-AXU4XsjJ.cjs.map +1 -0
- package/dist/{formatting-CHh9Q_OW.d.cts → formatting-DnSI0DHf.d.ts} +7 -5
- package/dist/formatting-DnSI0DHf.d.ts.map +1 -0
- package/dist/{formatting-pUm38KOj.js → formatting-WGc5qrhv.js} +34 -2
- package/dist/formatting-WGc5qrhv.js.map +1 -0
- package/dist/{formatting-kdIeURER.d.ts → formatting-aGQ7M_2w.d.cts} +7 -5
- package/dist/formatting-aGQ7M_2w.d.cts.map +1 -0
- package/dist/{formatting-utils-C3sej5ER.js → formatting-utils-DgOyTl-m.js} +1 -1
- package/dist/{formatting-utils-C3sej5ER.js.map → formatting-utils-DgOyTl-m.js.map} +1 -1
- package/dist/{formatting-utils-DDz14xeB.cjs → formatting-utils-m9R5bsRU.cjs} +1 -1
- package/dist/{formatting-utils-DDz14xeB.cjs.map → formatting-utils-m9R5bsRU.cjs.map} +1 -1
- package/dist/{get-doc-DaTCenOE.cjs → get-doc-ByXR3EWc.cjs} +4 -4
- package/dist/{get-doc-DaTCenOE.cjs.map → get-doc-ByXR3EWc.cjs.map} +1 -1
- package/dist/{get-doc-YTiQznr1.js → get-doc-C1IEG2pH.js} +4 -4
- package/dist/{get-doc-YTiQznr1.js.map → get-doc-C1IEG2pH.js.map} +1 -1
- package/dist/{get-event-attachment-ChRw3jlQ.cjs → get-event-attachment-CuGUfVAD.cjs} +2 -2
- package/dist/{get-event-attachment-ChRw3jlQ.cjs.map → get-event-attachment-CuGUfVAD.cjs.map} +1 -1
- package/dist/{get-event-attachment-CuU-_5T6.js → get-event-attachment-N11gSV23.js} +2 -2
- package/dist/{get-event-attachment-CuU-_5T6.js.map → get-event-attachment-N11gSV23.js.map} +1 -1
- package/dist/{get-issue-details-CxChU4U9.js → get-issue-details-BrEGybe0.js} +30 -14
- package/dist/get-issue-details-BrEGybe0.js.map +1 -0
- package/dist/{get-issue-details-DFwZRbmU.cjs → get-issue-details-EklkHsWi.cjs} +30 -14
- package/dist/get-issue-details-EklkHsWi.cjs.map +1 -0
- package/dist/index.cjs +37 -37
- package/dist/index.js +37 -37
- package/dist/internal/fetch-utils.cjs +3 -2
- package/dist/internal/fetch-utils.d.cts +2 -2
- package/dist/internal/fetch-utils.d.ts +2 -2
- package/dist/internal/fetch-utils.js +2 -2
- package/dist/internal/formatting.cjs +2 -1
- package/dist/internal/formatting.d.cts +4 -4
- package/dist/internal/formatting.d.ts +4 -4
- package/dist/internal/formatting.js +2 -1
- package/dist/internal/issue-helpers.cjs +2 -1
- package/dist/internal/issue-helpers.js +2 -1
- package/dist/internal/test-fixtures.d.cts +38 -38
- package/dist/internal/test-fixtures.d.cts.map +1 -1
- package/dist/internal/test-fixtures.d.ts +170 -170
- package/dist/internal/test-fixtures.d.ts.map +1 -1
- package/dist/issue-helpers-BJffpNoO.d.ts.map +1 -1
- package/dist/issue-helpers-Cz01Ipvl.d.cts.map +1 -1
- package/dist/{issue-helpers-CqqYnwYE.js → issue-helpers-D2p1Gkgm.js} +15 -19
- package/dist/issue-helpers-D2p1Gkgm.js.map +1 -0
- package/dist/{issue-helpers-DyAIO0w6.cjs → issue-helpers-DvsTfq9u.cjs} +14 -19
- package/dist/issue-helpers-DvsTfq9u.cjs.map +1 -0
- package/dist/{logging-oIouXrcb.cjs → logging-CX2buXiG.cjs} +1 -1
- package/dist/{logging-oIouXrcb.cjs.map → logging-CX2buXiG.cjs.map} +1 -1
- package/dist/{logging-LnQMFw-_.js → logging-DzxYBMrn.js} +1 -1
- package/dist/{logging-LnQMFw-_.js.map → logging-DzxYBMrn.js.map} +1 -1
- package/dist/logging.cjs +1 -1
- package/dist/logging.js +1 -1
- package/dist/{prompts-C8Y9w5c4.js → prompts-Cuwmybyc.js} +2 -2
- package/dist/{prompts-C8Y9w5c4.js.map → prompts-Cuwmybyc.js.map} +1 -1
- package/dist/{prompts-Df3i1XSB.cjs → prompts-uWAbMvLe.cjs} +2 -2
- package/dist/{prompts-Df3i1XSB.cjs.map → prompts-uWAbMvLe.cjs.map} +1 -1
- package/dist/prompts.cjs +2 -2
- package/dist/prompts.js +2 -2
- package/dist/{resources-BM_YQGcb.cjs → resources-BlgeiG6C.cjs} +2 -2
- package/dist/{resources-BM_YQGcb.cjs.map → resources-BlgeiG6C.cjs.map} +1 -1
- package/dist/{resources-BHF8a1ZB.js → resources-CwWOjB8_.js} +2 -2
- package/dist/{resources-BHF8a1ZB.js.map → resources-CwWOjB8_.js.map} +1 -1
- package/dist/resources.cjs +2 -2
- package/dist/resources.js +2 -2
- package/dist/{schema--5m4KI84.d.ts → schema-BW_fxx99.d.cts} +559 -559
- package/dist/{schema-ya35hkEL.d.cts.map → schema-BW_fxx99.d.cts.map} +1 -1
- package/dist/{schema-ya35hkEL.d.cts → schema-DkWOa2-c.d.ts} +428 -428
- package/dist/{schema--5m4KI84.d.ts.map → schema-DkWOa2-c.d.ts.map} +1 -1
- package/dist/{search-docs-BLbB_GV2.js → search-docs-BKUeMSyn.js} +3 -3
- package/dist/{search-docs-BLbB_GV2.js.map → search-docs-BKUeMSyn.js.map} +1 -1
- package/dist/{search-docs-D5Foht_0.cjs → search-docs-Cr-gyE5m.cjs} +3 -3
- package/dist/{search-docs-D5Foht_0.cjs.map → search-docs-Cr-gyE5m.cjs.map} +1 -1
- package/dist/{seer-utils-Ckr8nYlz.js → seer-utils-BdE7DddW.js} +5 -3
- package/dist/seer-utils-BdE7DddW.js.map +1 -0
- package/dist/{seer-utils-CzYEEZb2.cjs → seer-utils-BvdVTH85.cjs} +16 -2
- package/dist/seer-utils-BvdVTH85.cjs.map +1 -0
- package/dist/{server-BpEIZVaZ.cjs → server-9IEGGN8V.cjs} +41 -25
- package/dist/{server-DOy-M9Ko.js.map → server-9IEGGN8V.cjs.map} +1 -1
- package/dist/{server-DOy-M9Ko.js → server-BhNrW6bw.js} +41 -25
- package/dist/server-BhNrW6bw.js.map +1 -0
- package/dist/server.cjs +34 -34
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +34 -34
- package/dist/{stdio-B2NDq7Ax.js → stdio-CQmibRBR.js} +3 -3
- package/dist/{stdio-B2NDq7Ax.js.map → stdio-CQmibRBR.js.map} +1 -1
- package/dist/{stdio-DMEgJ_fG.cjs → stdio-mw-fEjO4.cjs} +3 -3
- package/dist/{stdio-DMEgJ_fG.cjs.map → stdio-mw-fEjO4.cjs.map} +1 -1
- package/dist/test-setup.cjs +1 -16
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +1 -16
- package/dist/test-setup.js.map +1 -1
- package/dist/toolDefinitions.js +2 -2
- package/dist/tools/analyze-issue-with-seer.cjs +9 -8
- package/dist/tools/analyze-issue-with-seer.js +9 -8
- package/dist/tools/create-dsn.cjs +4 -4
- package/dist/tools/create-dsn.js +4 -4
- package/dist/tools/create-project.cjs +5 -5
- package/dist/tools/create-project.js +5 -5
- package/dist/tools/create-team.cjs +4 -4
- package/dist/tools/create-team.js +4 -4
- package/dist/tools/find-dsns.cjs +4 -4
- package/dist/tools/find-dsns.js +4 -4
- package/dist/tools/find-errors.cjs +4 -4
- package/dist/tools/find-errors.js +4 -4
- package/dist/tools/find-issues.cjs +4 -4
- package/dist/tools/find-issues.js +4 -4
- package/dist/tools/find-organizations.cjs +4 -4
- package/dist/tools/find-organizations.js +4 -4
- package/dist/tools/find-projects.cjs +4 -4
- package/dist/tools/find-projects.js +4 -4
- package/dist/tools/find-releases.cjs +4 -4
- package/dist/tools/find-releases.js +4 -4
- package/dist/tools/find-tags.cjs +4 -4
- package/dist/tools/find-tags.js +4 -4
- package/dist/tools/find-teams.cjs +4 -4
- package/dist/tools/find-teams.js +4 -4
- package/dist/tools/find-transactions.cjs +4 -4
- package/dist/tools/find-transactions.js +4 -4
- package/dist/tools/get-doc.cjs +4 -4
- package/dist/tools/get-doc.js +4 -4
- package/dist/tools/get-event-attachment.cjs +4 -4
- package/dist/tools/get-event-attachment.js +4 -4
- package/dist/tools/get-issue-details.cjs +8 -7
- package/dist/tools/get-issue-details.js +8 -7
- package/dist/tools/index.cjs +31 -31
- package/dist/tools/index.d.cts +76 -76
- package/dist/tools/index.d.ts +76 -76
- package/dist/tools/index.js +31 -31
- package/dist/tools/search-docs.cjs +4 -3
- package/dist/tools/search-docs.js +4 -3
- package/dist/tools/update-issue.cjs +9 -8
- package/dist/tools/update-issue.js +9 -8
- package/dist/tools/update-project.cjs +5 -5
- package/dist/tools/update-project.js +5 -5
- package/dist/tools/utils/api-utils.cjs +6 -4
- package/dist/tools/utils/api-utils.d.cts +22 -5
- package/dist/tools/utils/api-utils.d.cts.map +1 -1
- package/dist/tools/utils/api-utils.d.ts +22 -5
- package/dist/tools/utils/api-utils.d.ts.map +1 -1
- package/dist/tools/utils/api-utils.js +4 -4
- package/dist/tools/utils/fetch-utils.cjs +3 -2
- package/dist/tools/utils/fetch-utils.d.cts +2 -2
- package/dist/tools/utils/fetch-utils.d.ts +2 -2
- package/dist/tools/utils/fetch-utils.js +2 -2
- package/dist/tools/utils/formatting-utils.cjs +1 -1
- package/dist/tools/utils/formatting-utils.d.cts +3 -3
- package/dist/tools/utils/formatting-utils.d.ts +3 -3
- package/dist/tools/utils/formatting-utils.js +1 -1
- package/dist/tools/utils/issue-utils.cjs +5 -3
- package/dist/tools/utils/issue-utils.d.cts +4 -4
- package/dist/tools/utils/issue-utils.d.ts +4 -4
- package/dist/tools/utils/issue-utils.js +5 -3
- package/dist/tools/utils/seer-utils.cjs +3 -1
- package/dist/tools/utils/seer-utils.d.cts +6 -4
- package/dist/tools/utils/seer-utils.d.cts.map +1 -1
- package/dist/tools/utils/seer-utils.d.ts +6 -4
- package/dist/tools/utils/seer-utils.d.ts.map +1 -1
- package/dist/tools/utils/seer-utils.js +2 -2
- package/dist/tools/whoami.cjs +4 -4
- package/dist/tools/whoami.js +4 -4
- package/dist/tools-AYbI0sEf.js +48 -0
- package/dist/{tools-mThAUo_3.js.map → tools-AYbI0sEf.js.map} +1 -1
- package/dist/{tools-19Ms1kck.cjs → tools-CwQFlJzn.cjs} +21 -21
- package/dist/{tools-19Ms1kck.cjs.map → tools-CwQFlJzn.cjs.map} +1 -1
- package/dist/transports/stdio.cjs +36 -36
- package/dist/transports/stdio.js +36 -36
- package/dist/{types-Bg17IGWJ.d.cts → types-BAbu4Vzx.d.cts} +2 -2
- package/dist/{types-Bg17IGWJ.d.cts.map → types-BAbu4Vzx.d.cts.map} +1 -1
- package/dist/{types-CtTBwGbw.d.ts → types-CoY5KVni.d.ts} +2 -2
- package/dist/{types-CtTBwGbw.d.ts.map → types-CoY5KVni.d.ts.map} +1 -1
- package/dist/{update-issue-DmLElHPS.js → update-issue-ClbiTLyL.js} +13 -7
- package/dist/update-issue-ClbiTLyL.js.map +1 -0
- package/dist/{update-issue-B6eZhAPJ.cjs → update-issue-_4vzwHfZ.cjs} +13 -7
- package/dist/update-issue-_4vzwHfZ.cjs.map +1 -0
- package/dist/{update-project-CijYCtG1.cjs → update-project-2EEnezbZ.cjs} +4 -4
- package/dist/{update-project-CijYCtG1.cjs.map → update-project-2EEnezbZ.cjs.map} +1 -1
- package/dist/{update-project-BNPev7W8.js → update-project-CExfO7tG.js} +4 -4
- package/dist/{update-project-BNPev7W8.js.map → update-project-CExfO7tG.js.map} +1 -1
- package/dist/version-3e1twbPm.js +6 -0
- package/dist/{version-C4uvMmw0.js.map → version-3e1twbPm.js.map} +1 -1
- package/dist/{version-Ddz4xg_q.cjs → version-Cp9p-38J.cjs} +2 -2
- package/dist/{version-Ddz4xg_q.cjs.map → version-Cp9p-38J.cjs.map} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/{whoami-DesNZnaQ.js → whoami-DhoaHHY5.js} +2 -2
- package/dist/{whoami-DesNZnaQ.js.map → whoami-DhoaHHY5.js.map} +1 -1
- package/dist/{whoami-CEgbTUqt.cjs → whoami-m0N5F6BN.cjs} +2 -2
- package/dist/{whoami-CEgbTUqt.cjs.map → whoami-m0N5F6BN.cjs.map} +1 -1
- package/package.json +3 -3
- package/dist/analyze-issue-with-seer-BsNarzJN.js.map +0 -1
- package/dist/analyze-issue-with-seer-DbAWpyTC.cjs.map +0 -1
- package/dist/api-utils-C6QJAzFL.js +0 -31
- package/dist/api-utils-C6QJAzFL.js.map +0 -1
- package/dist/api-utils-d36iteNO.cjs +0 -36
- package/dist/api-utils-d36iteNO.cjs.map +0 -1
- package/dist/client-BCN17Wbp.d.ts.map +0 -1
- package/dist/client-CILwfx6G.d.cts.map +0 -1
- package/dist/client-DOYWNvVM.js.map +0 -1
- package/dist/client-Dkw5iYu3.cjs.map +0 -1
- package/dist/errors-CIoxzIug.js +0 -15
- package/dist/errors-CIoxzIug.js.map +0 -1
- package/dist/errors-YmiXLOyx.cjs +0 -21
- package/dist/errors-YmiXLOyx.cjs.map +0 -1
- package/dist/fetch-utils-BMKjO-cc.js +0 -29
- package/dist/fetch-utils-BMKjO-cc.js.map +0 -1
- package/dist/fetch-utils-Bv9WjUp0.d.ts +0 -14
- package/dist/fetch-utils-Bv9WjUp0.d.ts.map +0 -1
- package/dist/fetch-utils-DzdRW4Yd.d.cts +0 -14
- package/dist/fetch-utils-DzdRW4Yd.d.cts.map +0 -1
- package/dist/fetch-utils-oab6uNp3.cjs +0 -35
- package/dist/fetch-utils-oab6uNp3.cjs.map +0 -1
- package/dist/find-errors-CuRm4PzL.js.map +0 -1
- package/dist/find-errors-Drzv7hzM.cjs.map +0 -1
- package/dist/find-issues-C3uk59rn.cjs.map +0 -1
- package/dist/find-issues-CAtNGBly.js.map +0 -1
- package/dist/find-organizations-BrdMfZRO.cjs.map +0 -1
- package/dist/find-organizations-ojXwWWzk.js.map +0 -1
- package/dist/formatting-BlMiQa9i.cjs.map +0 -1
- package/dist/formatting-CHh9Q_OW.d.cts.map +0 -1
- package/dist/formatting-kdIeURER.d.ts.map +0 -1
- package/dist/formatting-pUm38KOj.js.map +0 -1
- package/dist/get-issue-details-CxChU4U9.js.map +0 -1
- package/dist/get-issue-details-DFwZRbmU.cjs.map +0 -1
- package/dist/issue-helpers-CqqYnwYE.js.map +0 -1
- package/dist/issue-helpers-DyAIO0w6.cjs.map +0 -1
- package/dist/seer-utils-Ckr8nYlz.js.map +0 -1
- package/dist/seer-utils-CzYEEZb2.cjs.map +0 -1
- package/dist/server-BpEIZVaZ.cjs.map +0 -1
- package/dist/tools-mThAUo_3.js +0 -48
- package/dist/update-issue-B6eZhAPJ.cjs.map +0 -1
- package/dist/update-issue-DmLElHPS.js.map +0 -1
- package/dist/version-C4uvMmw0.js +0 -6
- /package/dist/{issue-utils-BVAB6I-Z.js → issue-utils-BbCfbiY8.js} +0 -0
- /package/dist/{issue-utils-pdbo-5LW.cjs → issue-utils-DMKiif6C.cjs} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, OrganizationList, Project, ProjectList, ReleaseList, TagList, Team, TeamList, User } from "./types-
|
|
1
|
+
import { AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, OrganizationList, Project, ProjectList, ReleaseList, TagList, Team, TeamList, User } from "./types-CoY5KVni.js";
|
|
2
2
|
|
|
3
3
|
//#region src/api-client/client.d.ts
|
|
4
4
|
|
|
@@ -99,6 +99,15 @@ declare class SentryApiService {
|
|
|
99
99
|
* @param host New hostname to use for API requests
|
|
100
100
|
*/
|
|
101
101
|
setHost(host: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* Checks if the current host is Sentry SaaS (sentry.io).
|
|
104
|
+
*
|
|
105
|
+
* Used to determine API endpoint availability and URL formats.
|
|
106
|
+
* Self-hosted instances may not have all endpoints available.
|
|
107
|
+
*
|
|
108
|
+
* @returns True if using Sentry SaaS, false for self-hosted instances
|
|
109
|
+
*/
|
|
110
|
+
private isSaas;
|
|
102
111
|
/**
|
|
103
112
|
* Internal method for making authenticated requests to Sentry API.
|
|
104
113
|
*
|
|
@@ -116,6 +125,29 @@ declare class SentryApiService {
|
|
|
116
125
|
* @throws {Error} Network or parsing errors
|
|
117
126
|
*/
|
|
118
127
|
private request;
|
|
128
|
+
/**
|
|
129
|
+
* Safely parses a JSON response, checking Content-Type header first.
|
|
130
|
+
*
|
|
131
|
+
* @param response The Response object from fetch
|
|
132
|
+
* @returns Promise resolving to the parsed JSON object
|
|
133
|
+
* @throws {Error} If response is not JSON or parsing fails
|
|
134
|
+
*/
|
|
135
|
+
private parseJsonResponse;
|
|
136
|
+
/**
|
|
137
|
+
* Makes a request to the Sentry API and parses the JSON response.
|
|
138
|
+
*
|
|
139
|
+
* This is the primary method for API calls that expect JSON responses.
|
|
140
|
+
* It automatically validates Content-Type and provides helpful error messages
|
|
141
|
+
* for common issues like authentication failures or server errors.
|
|
142
|
+
*
|
|
143
|
+
* @param path API endpoint path (without /api/0 prefix)
|
|
144
|
+
* @param options Fetch options
|
|
145
|
+
* @param requestOptions Additional request configuration
|
|
146
|
+
* @returns Promise resolving to the parsed JSON response
|
|
147
|
+
* @throws {ApiError} Enhanced API errors with user-friendly messages
|
|
148
|
+
* @throws {Error} Network, parsing, or validation errors
|
|
149
|
+
*/
|
|
150
|
+
private requestJSON;
|
|
119
151
|
/**
|
|
120
152
|
* Generates a Sentry issue URL for browser navigation.
|
|
121
153
|
*
|
|
@@ -501,10 +533,10 @@ declare class SentryApiService {
|
|
|
501
533
|
query?: string;
|
|
502
534
|
sortBy?: "last_seen" | "count";
|
|
503
535
|
}, opts?: RequestOptions): Promise<{
|
|
536
|
+
title: string;
|
|
537
|
+
project: string;
|
|
504
538
|
issue: string;
|
|
505
539
|
"issue.id": string | number;
|
|
506
|
-
project: string;
|
|
507
|
-
title: string;
|
|
508
540
|
"count()": number;
|
|
509
541
|
"last_seen()": string;
|
|
510
542
|
}[]>;
|
|
@@ -521,14 +553,14 @@ declare class SentryApiService {
|
|
|
521
553
|
query?: string;
|
|
522
554
|
sortBy?: "timestamp" | "duration";
|
|
523
555
|
}, opts?: RequestOptions): Promise<{
|
|
524
|
-
|
|
556
|
+
transaction: string;
|
|
557
|
+
timestamp: string;
|
|
525
558
|
id: string;
|
|
526
559
|
trace: string;
|
|
560
|
+
project: string;
|
|
527
561
|
"span.op": string;
|
|
528
562
|
"span.description": string;
|
|
529
563
|
"span.duration": number;
|
|
530
|
-
transaction: string;
|
|
531
|
-
timestamp: string;
|
|
532
564
|
}[]>;
|
|
533
565
|
startAutofix({
|
|
534
566
|
organizationSlug,
|
|
@@ -551,4 +583,4 @@ declare class SentryApiService {
|
|
|
551
583
|
}
|
|
552
584
|
//#endregion
|
|
553
585
|
export { ApiError, SentryApiService };
|
|
554
|
-
//# sourceMappingURL=client-
|
|
586
|
+
//# sourceMappingURL=client-h32L1Hx5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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A2CM,iBACN,QAAQ;;;;;;;;;;;;;;;;YA+BF,iBACN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2CF,iBACN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8CF,iBACN,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8DF,iBACN,QAAQ;;;;;;;YA+BF,iBACN,QAAQ;;;;;;;;;YAmBF,iBACN,QAAQ;;;;;;;YAiBF,iBACN,QAAQ;;;;;;;;;YAqBF,iBACN,QAAQ;;;;;;;;;;;YAqBF,iBACN;gBACW;;;UAGN;;;;;;;;;;;;YAmDC,iBACN,QAAQ;;;;;;;;;;;;;;;YAgDF,iBAAc;;;;;;;;;;;;;;;;;;;;YAuDd,iBAAc;;;;;;;;;;;;;;;;;;;;YAqDd,iBACN,QAAQ;;;;;;;YAwBF,iBACN,QAAQ"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfigurationError } from "./errors-D_R568zP.js";
|
|
1
2
|
import { ApiErrorSchema, AutofixRunSchema, AutofixRunStateSchema, ClientKeyListSchema, ClientKeySchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventSchema, IssueListSchema, IssueSchema, OrganizationListSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, SpansSearchResponseSchema, TagListSchema, TeamListSchema, TeamSchema, UserRegionsSchema, UserSchema } from "./schema-WDk5Yqww.js";
|
|
2
3
|
|
|
3
4
|
//#region src/api-client/client.ts
|
|
@@ -112,6 +113,17 @@ var SentryApiService = class {
|
|
|
112
113
|
this.apiPrefix = `https://${this.host}/api/0`;
|
|
113
114
|
}
|
|
114
115
|
/**
|
|
116
|
+
* Checks if the current host is Sentry SaaS (sentry.io).
|
|
117
|
+
*
|
|
118
|
+
* Used to determine API endpoint availability and URL formats.
|
|
119
|
+
* Self-hosted instances may not have all endpoints available.
|
|
120
|
+
*
|
|
121
|
+
* @returns True if using Sentry SaaS, false for self-hosted instances
|
|
122
|
+
*/
|
|
123
|
+
isSaas() {
|
|
124
|
+
return this.host === "sentry.io";
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
115
127
|
* Internal method for making authenticated requests to Sentry API.
|
|
116
128
|
*
|
|
117
129
|
* Handles:
|
|
@@ -149,6 +161,7 @@ var SentryApiService = class {
|
|
|
149
161
|
const errorCode = Object.keys(NETWORK_ERROR_MESSAGES).find((code) => errorMessage.includes(code));
|
|
150
162
|
if (errorCode) friendlyMessage += ` - ${NETWORK_ERROR_MESSAGES[errorCode]}`;
|
|
151
163
|
else friendlyMessage += ` - ${errorMessage}`;
|
|
164
|
+
if (errorCode === "ENOTFOUND" || errorCode === "EAI_AGAIN" || errorCode === "ECONNREFUSED" || errorCode === "ETIMEDOUT" || errorMessage.includes("Connect Timeout Error")) throw new ConfigurationError(friendlyMessage, { cause: error });
|
|
152
165
|
throw new Error(friendlyMessage, { cause: error });
|
|
153
166
|
}
|
|
154
167
|
if (!response.ok) {
|
|
@@ -157,6 +170,10 @@ var SentryApiService = class {
|
|
|
157
170
|
try {
|
|
158
171
|
parsed = JSON.parse(errorText);
|
|
159
172
|
} catch (error) {
|
|
173
|
+
if (errorText.includes("<!DOCTYPE") || errorText.includes("<html")) {
|
|
174
|
+
console.error(`[sentryApi] Received HTML error page instead of JSON (status ${response.status})`, error);
|
|
175
|
+
throw new Error(`Server error: Received HTML instead of JSON (${response.status} ${response.statusText}). This may indicate an invalid URL or server issue.`);
|
|
176
|
+
}
|
|
160
177
|
console.error(`[sentryApi] Failed to parse error response: ${errorText}`, error);
|
|
161
178
|
}
|
|
162
179
|
if (parsed) {
|
|
@@ -169,6 +186,45 @@ var SentryApiService = class {
|
|
|
169
186
|
return response;
|
|
170
187
|
}
|
|
171
188
|
/**
|
|
189
|
+
* Safely parses a JSON response, checking Content-Type header first.
|
|
190
|
+
*
|
|
191
|
+
* @param response The Response object from fetch
|
|
192
|
+
* @returns Promise resolving to the parsed JSON object
|
|
193
|
+
* @throws {Error} If response is not JSON or parsing fails
|
|
194
|
+
*/
|
|
195
|
+
async parseJsonResponse(response) {
|
|
196
|
+
if (!response.headers?.get) return response.json();
|
|
197
|
+
const contentType = response.headers.get("content-type");
|
|
198
|
+
if (!contentType || !contentType.includes("application/json")) {
|
|
199
|
+
const responseText = await response.text();
|
|
200
|
+
if (contentType?.includes("text/html") || responseText.includes("<!DOCTYPE") || responseText.includes("<html")) throw new Error(`Expected JSON response but received HTML (${response.status} ${response.statusText}). This may indicate you're not authenticated, the URL is incorrect, or there's a server issue.`);
|
|
201
|
+
throw new Error(`Expected JSON response but received ${contentType || "unknown content type"} (${response.status} ${response.statusText})`);
|
|
202
|
+
}
|
|
203
|
+
try {
|
|
204
|
+
return await response.json();
|
|
205
|
+
} catch (error) {
|
|
206
|
+
throw new Error(`Failed to parse JSON response: ${error instanceof Error ? error.message : String(error)}`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Makes a request to the Sentry API and parses the JSON response.
|
|
211
|
+
*
|
|
212
|
+
* This is the primary method for API calls that expect JSON responses.
|
|
213
|
+
* It automatically validates Content-Type and provides helpful error messages
|
|
214
|
+
* for common issues like authentication failures or server errors.
|
|
215
|
+
*
|
|
216
|
+
* @param path API endpoint path (without /api/0 prefix)
|
|
217
|
+
* @param options Fetch options
|
|
218
|
+
* @param requestOptions Additional request configuration
|
|
219
|
+
* @returns Promise resolving to the parsed JSON response
|
|
220
|
+
* @throws {ApiError} Enhanced API errors with user-friendly messages
|
|
221
|
+
* @throws {Error} Network, parsing, or validation errors
|
|
222
|
+
*/
|
|
223
|
+
async requestJSON(path, options = {}, requestOptions) {
|
|
224
|
+
const response = await this.request(path, options, requestOptions);
|
|
225
|
+
return this.parseJsonResponse(response);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
172
228
|
* Generates a Sentry issue URL for browser navigation.
|
|
173
229
|
*
|
|
174
230
|
* Handles both SaaS (subdomain-based) and self-hosted URL formats.
|
|
@@ -188,8 +244,7 @@ var SentryApiService = class {
|
|
|
188
244
|
* ```
|
|
189
245
|
*/
|
|
190
246
|
getIssueUrl(organizationSlug, issueId) {
|
|
191
|
-
|
|
192
|
-
return isSaas ? `https://${organizationSlug}.${this.host}/issues/${issueId}` : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
247
|
+
return this.isSaas() ? `https://${organizationSlug}.${this.host}/issues/${issueId}` : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
193
248
|
}
|
|
194
249
|
/**
|
|
195
250
|
* Generates a Sentry trace URL for performance investigation.
|
|
@@ -207,8 +262,7 @@ var SentryApiService = class {
|
|
|
207
262
|
* ```
|
|
208
263
|
*/
|
|
209
264
|
getTraceUrl(organizationSlug, traceId) {
|
|
210
|
-
|
|
211
|
-
return isSaas ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}` : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
265
|
+
return this.isSaas() ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}` : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
212
266
|
}
|
|
213
267
|
/**
|
|
214
268
|
* Retrieves the authenticated user's profile information.
|
|
@@ -218,8 +272,7 @@ var SentryApiService = class {
|
|
|
218
272
|
* @throws {ApiError} If authentication fails or user not found
|
|
219
273
|
*/
|
|
220
274
|
async getAuthenticatedUser(opts) {
|
|
221
|
-
const
|
|
222
|
-
const body = await response.json();
|
|
275
|
+
const body = await this.requestJSON("/auth/", void 0, opts);
|
|
223
276
|
return UserSchema.parse(body);
|
|
224
277
|
}
|
|
225
278
|
/**
|
|
@@ -241,12 +294,23 @@ var SentryApiService = class {
|
|
|
241
294
|
* ```
|
|
242
295
|
*/
|
|
243
296
|
async listOrganizations(opts) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
297
|
+
if (!this.isSaas()) {
|
|
298
|
+
const body = await this.requestJSON("/organizations/", void 0, opts);
|
|
299
|
+
return OrganizationListSchema.parse(body);
|
|
300
|
+
}
|
|
301
|
+
try {
|
|
302
|
+
const regionData = UserRegionsSchema.parse(await this.requestJSON("/users/me/regions/", void 0, opts));
|
|
303
|
+
return (await Promise.all(regionData.regions.map(async (region) => this.requestJSON(`/organizations/`, void 0, {
|
|
304
|
+
...opts,
|
|
305
|
+
host: new URL(region.url).host
|
|
306
|
+
})))).map((data) => OrganizationListSchema.parse(data)).reduce((acc, curr) => acc.concat(curr), []);
|
|
307
|
+
} catch (error) {
|
|
308
|
+
if (error instanceof ApiError && error.status === 404) {
|
|
309
|
+
const body = await this.requestJSON("/organizations/", void 0, opts);
|
|
310
|
+
return OrganizationListSchema.parse(body);
|
|
311
|
+
}
|
|
312
|
+
throw error;
|
|
313
|
+
}
|
|
250
314
|
}
|
|
251
315
|
/**
|
|
252
316
|
* Lists teams within an organization.
|
|
@@ -256,8 +320,7 @@ var SentryApiService = class {
|
|
|
256
320
|
* @returns Array of teams in the organization
|
|
257
321
|
*/
|
|
258
322
|
async listTeams(organizationSlug, opts) {
|
|
259
|
-
const
|
|
260
|
-
const body = await response.json();
|
|
323
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/teams/`, void 0, opts);
|
|
261
324
|
return TeamListSchema.parse(body);
|
|
262
325
|
}
|
|
263
326
|
/**
|
|
@@ -271,11 +334,11 @@ var SentryApiService = class {
|
|
|
271
334
|
* @throws {ApiError} If team creation fails (e.g., name conflicts)
|
|
272
335
|
*/
|
|
273
336
|
async createTeam({ organizationSlug, name }, opts) {
|
|
274
|
-
const
|
|
337
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/teams/`, {
|
|
275
338
|
method: "POST",
|
|
276
339
|
body: JSON.stringify({ name })
|
|
277
340
|
}, opts);
|
|
278
|
-
return TeamSchema.parse(
|
|
341
|
+
return TeamSchema.parse(body);
|
|
279
342
|
}
|
|
280
343
|
/**
|
|
281
344
|
* Lists projects within an organization.
|
|
@@ -285,8 +348,7 @@ var SentryApiService = class {
|
|
|
285
348
|
* @returns Array of projects in the organization
|
|
286
349
|
*/
|
|
287
350
|
async listProjects(organizationSlug, opts) {
|
|
288
|
-
const
|
|
289
|
-
const body = await response.json();
|
|
351
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/projects/`, void 0, opts);
|
|
290
352
|
return ProjectListSchema.parse(body);
|
|
291
353
|
}
|
|
292
354
|
/**
|
|
@@ -301,14 +363,14 @@ var SentryApiService = class {
|
|
|
301
363
|
* @returns Created project data
|
|
302
364
|
*/
|
|
303
365
|
async createProject({ organizationSlug, teamSlug, name, platform }, opts) {
|
|
304
|
-
const
|
|
366
|
+
const body = await this.requestJSON(`/teams/${organizationSlug}/${teamSlug}/projects/`, {
|
|
305
367
|
method: "POST",
|
|
306
368
|
body: JSON.stringify({
|
|
307
369
|
name,
|
|
308
370
|
platform
|
|
309
371
|
})
|
|
310
372
|
}, opts);
|
|
311
|
-
return ProjectSchema.parse(
|
|
373
|
+
return ProjectSchema.parse(body);
|
|
312
374
|
}
|
|
313
375
|
/**
|
|
314
376
|
* Updates an existing project's configuration.
|
|
@@ -327,11 +389,11 @@ var SentryApiService = class {
|
|
|
327
389
|
if (name !== void 0) updateData.name = name;
|
|
328
390
|
if (slug !== void 0) updateData.slug = slug;
|
|
329
391
|
if (platform !== void 0) updateData.platform = platform;
|
|
330
|
-
const
|
|
392
|
+
const body = await this.requestJSON(`/projects/${organizationSlug}/${projectSlug}/`, {
|
|
331
393
|
method: "PUT",
|
|
332
394
|
body: JSON.stringify(updateData)
|
|
333
395
|
}, opts);
|
|
334
|
-
return ProjectSchema.parse(
|
|
396
|
+
return ProjectSchema.parse(body);
|
|
335
397
|
}
|
|
336
398
|
/**
|
|
337
399
|
* Assigns a team to a project.
|
|
@@ -371,11 +433,11 @@ var SentryApiService = class {
|
|
|
371
433
|
* ```
|
|
372
434
|
*/
|
|
373
435
|
async createClientKey({ organizationSlug, projectSlug, name }, opts) {
|
|
374
|
-
const
|
|
436
|
+
const body = await this.requestJSON(`/projects/${organizationSlug}/${projectSlug}/keys/`, {
|
|
375
437
|
method: "POST",
|
|
376
438
|
body: JSON.stringify({ name })
|
|
377
439
|
}, opts);
|
|
378
|
-
return ClientKeySchema.parse(
|
|
440
|
+
return ClientKeySchema.parse(body);
|
|
379
441
|
}
|
|
380
442
|
/**
|
|
381
443
|
* Lists all client keys (DSNs) for a project.
|
|
@@ -387,8 +449,8 @@ var SentryApiService = class {
|
|
|
387
449
|
* @returns Array of client keys with DSN information
|
|
388
450
|
*/
|
|
389
451
|
async listClientKeys({ organizationSlug, projectSlug }, opts) {
|
|
390
|
-
const
|
|
391
|
-
return ClientKeyListSchema.parse(
|
|
452
|
+
const body = await this.requestJSON(`/projects/${organizationSlug}/${projectSlug}/keys/`, void 0, opts);
|
|
453
|
+
return ClientKeyListSchema.parse(body);
|
|
392
454
|
}
|
|
393
455
|
/**
|
|
394
456
|
* Lists releases for an organization or specific project.
|
|
@@ -418,8 +480,7 @@ var SentryApiService = class {
|
|
|
418
480
|
const searchQuery = new URLSearchParams();
|
|
419
481
|
if (query) searchQuery.set("query", query);
|
|
420
482
|
const path = projectSlug ? `/projects/${organizationSlug}/${projectSlug}/releases/` : `/organizations/${organizationSlug}/releases/`;
|
|
421
|
-
const
|
|
422
|
-
const body = await response.json();
|
|
483
|
+
const body = await this.requestJSON(searchQuery.toString() ? `${path}?${searchQuery.toString()}` : path, void 0, opts);
|
|
423
484
|
return ReleaseListSchema.parse(body);
|
|
424
485
|
}
|
|
425
486
|
/**
|
|
@@ -445,8 +506,7 @@ var SentryApiService = class {
|
|
|
445
506
|
async listTags({ organizationSlug, dataset }, opts) {
|
|
446
507
|
const searchQuery = new URLSearchParams();
|
|
447
508
|
if (dataset) searchQuery.set("dataset", dataset);
|
|
448
|
-
const
|
|
449
|
-
const body = await response.json();
|
|
509
|
+
const body = await this.requestJSON(searchQuery.toString() ? `/organizations/${organizationSlug}/tags/?${searchQuery.toString()}` : `/organizations/${organizationSlug}/tags/`, void 0, opts);
|
|
450
510
|
return TagListSchema.parse(body);
|
|
451
511
|
}
|
|
452
512
|
/**
|
|
@@ -492,18 +552,15 @@ var SentryApiService = class {
|
|
|
492
552
|
queryParams.set("query", sentryQuery.join(" "));
|
|
493
553
|
queryParams.append("collapse", "unhandled");
|
|
494
554
|
const apiUrl = projectSlug ? `/projects/${organizationSlug}/${projectSlug}/issues/?${queryParams.toString()}` : `/organizations/${organizationSlug}/issues/?${queryParams.toString()}`;
|
|
495
|
-
const
|
|
496
|
-
const body = await response.json();
|
|
555
|
+
const body = await this.requestJSON(apiUrl, void 0, opts);
|
|
497
556
|
return IssueListSchema.parse(body);
|
|
498
557
|
}
|
|
499
558
|
async getIssue({ organizationSlug, issueId }, opts) {
|
|
500
|
-
const
|
|
501
|
-
const body = await response.json();
|
|
559
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/issues/${issueId}/`, void 0, opts);
|
|
502
560
|
return IssueSchema.parse(body);
|
|
503
561
|
}
|
|
504
562
|
async getEventForIssue({ organizationSlug, issueId, eventId }, opts) {
|
|
505
|
-
const
|
|
506
|
-
const body = await response.json();
|
|
563
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/issues/${issueId}/events/${eventId}/`, void 0, opts);
|
|
507
564
|
return EventSchema.parse(body);
|
|
508
565
|
}
|
|
509
566
|
async getLatestEventForIssue({ organizationSlug, issueId }, opts) {
|
|
@@ -514,13 +571,12 @@ var SentryApiService = class {
|
|
|
514
571
|
}, opts);
|
|
515
572
|
}
|
|
516
573
|
async listEventAttachments({ organizationSlug, projectSlug, eventId }, opts) {
|
|
517
|
-
const
|
|
518
|
-
const body = await response.json();
|
|
574
|
+
const body = await this.requestJSON(`/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`, void 0, opts);
|
|
519
575
|
return EventAttachmentListSchema.parse(body);
|
|
520
576
|
}
|
|
521
577
|
async getEventAttachment({ organizationSlug, projectSlug, eventId, attachmentId }, opts) {
|
|
522
|
-
const
|
|
523
|
-
const attachments = EventAttachmentListSchema.parse(
|
|
578
|
+
const attachmentsData = await this.requestJSON(`/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`, void 0, opts);
|
|
579
|
+
const attachments = EventAttachmentListSchema.parse(attachmentsData);
|
|
524
580
|
const attachment = attachments.find((att) => att.id === attachmentId);
|
|
525
581
|
if (!attachment) throw new Error(`Attachment with ID ${attachmentId} not found for event ${eventId}`);
|
|
526
582
|
const downloadUrl = `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/${attachmentId}/?download=1`;
|
|
@@ -539,11 +595,10 @@ var SentryApiService = class {
|
|
|
539
595
|
const updateData = {};
|
|
540
596
|
if (status !== void 0) updateData.status = status;
|
|
541
597
|
if (assignedTo !== void 0) updateData.assignedTo = assignedTo;
|
|
542
|
-
const
|
|
598
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/issues/${issueId}/`, {
|
|
543
599
|
method: "PUT",
|
|
544
600
|
body: JSON.stringify(updateData)
|
|
545
601
|
}, opts);
|
|
546
|
-
const body = await response.json();
|
|
547
602
|
return IssueSchema.parse(body);
|
|
548
603
|
}
|
|
549
604
|
async searchErrors({ organizationSlug, projectSlug, filename, transaction, query, sortBy = "last_seen" }, opts) {
|
|
@@ -565,8 +620,7 @@ var SentryApiService = class {
|
|
|
565
620
|
queryParams.append("field", "count()");
|
|
566
621
|
queryParams.set("query", sentryQuery.join(" "));
|
|
567
622
|
const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;
|
|
568
|
-
const
|
|
569
|
-
const body = await response.json();
|
|
623
|
+
const body = await this.requestJSON(apiUrl, void 0, opts);
|
|
570
624
|
return ErrorsSearchResponseSchema.parse(body).data;
|
|
571
625
|
}
|
|
572
626
|
async searchSpans({ organizationSlug, projectSlug, transaction, query, sortBy = "timestamp" }, opts) {
|
|
@@ -591,28 +645,25 @@ var SentryApiService = class {
|
|
|
591
645
|
queryParams.append("field", "timestamp");
|
|
592
646
|
queryParams.set("query", sentryQuery.join(" "));
|
|
593
647
|
const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;
|
|
594
|
-
const
|
|
595
|
-
const body = await response.json();
|
|
648
|
+
const body = await this.requestJSON(apiUrl, void 0, opts);
|
|
596
649
|
return SpansSearchResponseSchema.parse(body).data;
|
|
597
650
|
}
|
|
598
651
|
async startAutofix({ organizationSlug, issueId, eventId, instruction = "" }, opts) {
|
|
599
|
-
const
|
|
652
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/issues/${issueId}/autofix/`, {
|
|
600
653
|
method: "POST",
|
|
601
654
|
body: JSON.stringify({
|
|
602
655
|
event_id: eventId,
|
|
603
656
|
instruction
|
|
604
657
|
})
|
|
605
658
|
}, opts);
|
|
606
|
-
const body = await response.json();
|
|
607
659
|
return AutofixRunSchema.parse(body);
|
|
608
660
|
}
|
|
609
661
|
async getAutofixState({ organizationSlug, issueId }, opts) {
|
|
610
|
-
const
|
|
611
|
-
const body = await response.json();
|
|
662
|
+
const body = await this.requestJSON(`/organizations/${organizationSlug}/issues/${issueId}/autofix/`, void 0, opts);
|
|
612
663
|
return AutofixRunStateSchema.parse(body);
|
|
613
664
|
}
|
|
614
665
|
};
|
|
615
666
|
|
|
616
667
|
//#endregion
|
|
617
668
|
export { ApiError, SentryApiService };
|
|
618
|
-
//# sourceMappingURL=client-
|
|
669
|
+
//# sourceMappingURL=client-pyNUFaLN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-pyNUFaLN.js","names":["NETWORK_ERROR_MESSAGES: Record<string, string>","message: string","status: number","host: string","path: string","options: RequestInit","headers: Record<string, string>","response: Response","parsed: unknown | undefined","requestOptions?: { host?: string }","organizationSlug: string","issueId: string","traceId: string","opts?: RequestOptions","updateData: Record<string, any>","sentryQuery: string[]"],"sources":["../src/api-client/client.ts"],"sourcesContent":["import {\n OrganizationListSchema,\n ClientKeySchema,\n TeamListSchema,\n TeamSchema,\n ProjectListSchema,\n ProjectSchema,\n ReleaseListSchema,\n IssueListSchema,\n IssueSchema,\n EventSchema,\n EventAttachmentListSchema,\n ErrorsSearchResponseSchema,\n SpansSearchResponseSchema,\n TagListSchema,\n ApiErrorSchema,\n ClientKeyListSchema,\n AutofixRunSchema,\n AutofixRunStateSchema,\n UserSchema,\n UserRegionsSchema,\n} from \"./schema\";\nimport { UserInputError, ConfigurationError } from \"../errors\";\nimport type {\n AutofixRun,\n AutofixRunState,\n ClientKey,\n ClientKeyList,\n Event,\n EventAttachment,\n EventAttachmentList,\n Issue,\n IssueList,\n OrganizationList,\n Project,\n ProjectList,\n ReleaseList,\n TagList,\n Team,\n TeamList,\n User,\n} from \"./types\";\n// TODO: this is shared - so ideally, for safety, it uses @sentry/core, but currently\n// logger isnt exposed (or rather, it is, but its not the right logger)\n// import { logger } from \"@sentry/node\";\n\n/**\n * Mapping of common network error codes to user-friendly messages.\n * These help users understand and resolve connection issues.\n */\nconst NETWORK_ERROR_MESSAGES: Record<string, string> = {\n EAI_AGAIN: \"DNS temporarily unavailable. Check your internet connection.\",\n ENOTFOUND: \"Hostname not found. Verify the URL is correct.\",\n ECONNREFUSED: \"Connection refused. Ensure the service is accessible.\",\n ETIMEDOUT: \"Connection timed out. Check network connectivity.\",\n ECONNRESET: \"Connection reset. Try again in a moment.\",\n};\n\n/**\n * Custom error class for Sentry API responses.\n *\n * Provides enhanced error messages for LLM consumption and handles\n * common API error scenarios with user-friendly messaging.\n *\n * @example\n * ```typescript\n * try {\n * await apiService.listIssues({ organizationSlug: \"invalid\" });\n * } catch (error) {\n * if (error instanceof ApiError) {\n * console.log(`API Error ${error.status}: ${error.message}`);\n * }\n * }\n * ```\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public status: number,\n ) {\n // HACK: improving this error message for the LLMs\n let finalMessage = message;\n if (\n message.includes(\n \"You do not have the multi project stream feature enabled\",\n ) ||\n message.includes(\"You cannot view events from multiple projects\")\n ) {\n finalMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n }\n super(finalMessage);\n }\n}\n\ntype RequestOptions = {\n host?: string;\n};\n\n/**\n * Sentry API client service for interacting with Sentry's REST API.\n *\n * This service provides a comprehensive interface to Sentry's API endpoints,\n * handling authentication, error processing, multi-region support, and\n * response validation through Zod schemas.\n *\n * Key Features:\n * - Multi-region support for Sentry SaaS and self-hosted instances\n * - Automatic schema validation with Zod\n * - Enhanced error handling with LLM-friendly messages\n * - URL generation for Sentry resources (issues, traces)\n * - Bearer token authentication\n * - Always uses HTTPS for secure connections\n *\n * @example Basic Usage\n * ```typescript\n * const apiService = new SentryApiService({\n * accessToken: \"your-token\",\n * host: \"sentry.io\"\n * });\n *\n * const orgs = await apiService.listOrganizations();\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\"\n * });\n * ```\n *\n * @example Multi-Region Support\n * ```typescript\n * // Self-hosted instance with hostname\n * const selfHosted = new SentryApiService({\n * accessToken: \"token\",\n * host: \"sentry.company.com\"\n * });\n *\n * // Regional endpoint override\n * const issues = await apiService.listIssues(\n * { organizationSlug: \"org\" },\n * { host: \"eu.sentry.io\" }\n * );\n * ```\n */\nexport class SentryApiService {\n private accessToken: string | null;\n protected host: string;\n protected apiPrefix: string;\n\n /**\n * Creates a new Sentry API service instance.\n *\n * Always uses HTTPS for secure connections.\n *\n * @param config Configuration object\n * @param config.accessToken OAuth access token for authentication (optional for some endpoints)\n * @param config.host Sentry hostname (e.g. \"sentry.io\", \"sentry.example.com\")\n */\n constructor({\n accessToken = null,\n host = \"sentry.io\",\n }: {\n accessToken?: string | null;\n host?: string;\n }) {\n this.accessToken = accessToken;\n this.host = host;\n this.apiPrefix = `https://${host}/api/0`;\n }\n\n /**\n * Updates the host for API requests.\n *\n * Used for multi-region support or switching between Sentry instances.\n * Always uses HTTPS protocol.\n *\n * @param host New hostname to use for API requests\n */\n setHost(host: string) {\n this.host = host;\n this.apiPrefix = `https://${this.host}/api/0`;\n }\n\n /**\n * Checks if the current host is Sentry SaaS (sentry.io).\n *\n * Used to determine API endpoint availability and URL formats.\n * Self-hosted instances may not have all endpoints available.\n *\n * @returns True if using Sentry SaaS, false for self-hosted instances\n */\n private isSaas(): boolean {\n return this.host === \"sentry.io\";\n }\n\n /**\n * Internal method for making authenticated requests to Sentry API.\n *\n * Handles:\n * - Bearer token authentication\n * - Error response parsing and enhancement\n * - Multi-region host overrides\n * - Fetch availability validation\n *\n * @param path API endpoint path (without /api/0 prefix)\n * @param options Fetch options\n * @param requestOptions Additional request configuration\n * @returns Promise resolving to Response object\n * @throws {ApiError} Enhanced API errors with user-friendly messages\n * @throws {Error} Network or parsing errors\n */\n private async request(\n path: string,\n options: RequestInit = {},\n { host }: { host?: string } = {},\n ): Promise<Response> {\n const url = host\n ? `https://${host}/api/0${path}`\n : `${this.apiPrefix}${path}`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"Sentry MCP Server\",\n };\n if (this.accessToken) {\n headers.Authorization = `Bearer ${this.accessToken}`;\n }\n\n // Check if fetch is available, otherwise provide a helpful error message\n if (typeof globalThis.fetch === \"undefined\") {\n throw new Error(\n \"fetch is not available. Please use Node.js >= 18 or ensure fetch is available in your environment.\",\n );\n }\n\n // logger.info(logger.fmt`[sentryApi] ${options.method || \"GET\"} ${url}`);\n let response: Response;\n try {\n response = await fetch(url, {\n ...options,\n headers,\n });\n } catch (error) {\n // Extract the root cause from the error chain\n let rootCause = error;\n while (rootCause instanceof Error && rootCause.cause) {\n rootCause = rootCause.cause;\n }\n\n const errorMessage =\n rootCause instanceof Error ? rootCause.message : String(rootCause);\n\n let friendlyMessage = `Unable to connect to ${url}`;\n\n // Check if we have a specific message for this error\n const errorCode = Object.keys(NETWORK_ERROR_MESSAGES).find((code) =>\n errorMessage.includes(code),\n );\n\n if (errorCode) {\n friendlyMessage += ` - ${NETWORK_ERROR_MESSAGES[errorCode]}`;\n } else {\n friendlyMessage += ` - ${errorMessage}`;\n }\n\n // DNS resolution failures and connection timeouts to custom hosts are configuration issues\n if (\n errorCode === \"ENOTFOUND\" ||\n errorCode === \"EAI_AGAIN\" ||\n errorCode === \"ECONNREFUSED\" ||\n errorCode === \"ETIMEDOUT\" ||\n errorMessage.includes(\"Connect Timeout Error\")\n ) {\n throw new ConfigurationError(friendlyMessage, { cause: error });\n }\n\n throw new Error(friendlyMessage, { cause: error });\n }\n\n // Handle error responses generically\n if (!response.ok) {\n const errorText = await response.text();\n let parsed: unknown | undefined;\n try {\n parsed = JSON.parse(errorText);\n } catch (error) {\n // If we can't parse JSON, check if it's HTML (server error)\n if (errorText.includes(\"<!DOCTYPE\") || errorText.includes(\"<html\")) {\n console.error(\n `[sentryApi] Received HTML error page instead of JSON (status ${response.status})`,\n error,\n );\n throw new Error(\n `Server error: Received HTML instead of JSON (${response.status} ${response.statusText}). This may indicate an invalid URL or server issue.`,\n );\n }\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n if (parsed) {\n const { data, success, error } = ApiErrorSchema.safeParse(parsed);\n\n if (success) {\n throw new ApiError(data.detail, response.status);\n }\n\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n throw new Error(\n `API request failed: ${response.status} ${response.statusText}\\n${errorText}`,\n );\n }\n\n return response;\n }\n\n /**\n * Safely parses a JSON response, checking Content-Type header first.\n *\n * @param response The Response object from fetch\n * @returns Promise resolving to the parsed JSON object\n * @throws {Error} If response is not JSON or parsing fails\n */\n private async parseJsonResponse(response: Response): Promise<unknown> {\n // Handle case where response might not have all properties (e.g., in tests or promise chains)\n if (!response.headers?.get) {\n return response.json();\n }\n\n const contentType = response.headers.get(\"content-type\");\n\n // Check if the response is JSON\n if (!contentType || !contentType.includes(\"application/json\")) {\n const responseText = await response.text();\n\n // Check if it's HTML\n if (\n contentType?.includes(\"text/html\") ||\n responseText.includes(\"<!DOCTYPE\") ||\n responseText.includes(\"<html\")\n ) {\n throw new Error(\n `Expected JSON response but received HTML (${response.status} ${response.statusText}). This may indicate you're not authenticated, the URL is incorrect, or there's a server issue.`,\n );\n }\n\n // Generic non-JSON error\n throw new Error(\n `Expected JSON response but received ${contentType || \"unknown content type\"} ` +\n `(${response.status} ${response.statusText})`,\n );\n }\n\n try {\n return await response.json();\n } catch (error) {\n throw new Error(\n `Failed to parse JSON response: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n /**\n * Makes a request to the Sentry API and parses the JSON response.\n *\n * This is the primary method for API calls that expect JSON responses.\n * It automatically validates Content-Type and provides helpful error messages\n * for common issues like authentication failures or server errors.\n *\n * @param path API endpoint path (without /api/0 prefix)\n * @param options Fetch options\n * @param requestOptions Additional request configuration\n * @returns Promise resolving to the parsed JSON response\n * @throws {ApiError} Enhanced API errors with user-friendly messages\n * @throws {Error} Network, parsing, or validation errors\n */\n private async requestJSON(\n path: string,\n options: RequestInit = {},\n requestOptions?: { host?: string },\n ): Promise<unknown> {\n const response = await this.request(path, options, requestOptions);\n return this.parseJsonResponse(response);\n }\n\n /**\n * Generates a Sentry issue URL for browser navigation.\n *\n * Handles both SaaS (subdomain-based) and self-hosted URL formats.\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param issueId Issue identifier (short ID or numeric ID)\n * @returns Full URL to the issue in Sentry UI\n *\n * @example\n * ```typescript\n * // SaaS: https://my-org.sentry.io/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n *\n * // Self-hosted: https://sentry.company.com/organizations/my-org/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n * ```\n */\n getIssueUrl(organizationSlug: string, issueId: string): string {\n return this.isSaas()\n ? `https://${organizationSlug}.${this.host}/issues/${issueId}`\n : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;\n }\n\n /**\n * Generates a Sentry trace URL for performance investigation.\n *\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param traceId Trace identifier (hex string)\n * @returns Full HTTPS URL to the trace in Sentry UI\n *\n * @example\n * ```typescript\n * const traceUrl = apiService.getTraceUrl(\"my-org\", \"6a477f5b0f31ef7b6b9b5e1dea66c91d\");\n * // https://my-org.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d\n * ```\n */\n getTraceUrl(organizationSlug: string, traceId: string): string {\n return this.isSaas()\n ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}`\n : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n }\n\n /**\n * Retrieves the authenticated user's profile information.\n *\n * @param opts Request options including host override\n * @returns User profile data\n * @throws {ApiError} If authentication fails or user not found\n */\n async getAuthenticatedUser(opts?: RequestOptions): Promise<User> {\n const body = await this.requestJSON(\"/auth/\", undefined, opts);\n return UserSchema.parse(body);\n }\n\n /**\n * Lists all organizations accessible to the authenticated user.\n *\n * Automatically handles multi-region queries by fetching from all\n * available regions and combining results.\n *\n * @param opts Request options\n * @returns Array of organizations across all accessible regions\n *\n * @example\n * ```typescript\n * const orgs = await apiService.listOrganizations();\n * orgs.forEach(org => {\n * // regionUrl present for Cloud Service, empty for self-hosted\n * console.log(`${org.name} (${org.slug}) - ${org.links?.regionUrl || 'No region URL'}`);\n * });\n * ```\n */\n async listOrganizations(opts?: RequestOptions): Promise<OrganizationList> {\n // For self-hosted instances, the regions endpoint doesn't exist\n if (!this.isSaas()) {\n const body = await this.requestJSON(\"/organizations/\", undefined, opts);\n return OrganizationListSchema.parse(body);\n }\n\n // For SaaS, try to use regions endpoint first\n try {\n // TODO: Sentry is currently not returning all orgs without hitting region endpoints\n const regionData = UserRegionsSchema.parse(\n await this.requestJSON(\"/users/me/regions/\", undefined, opts),\n );\n\n return (\n await Promise.all(\n regionData.regions.map(async (region) =>\n this.requestJSON(`/organizations/`, undefined, {\n ...opts,\n host: new URL(region.url).host,\n }),\n ),\n )\n )\n .map((data) => OrganizationListSchema.parse(data))\n .reduce((acc, curr) => acc.concat(curr), []);\n } catch (error) {\n // If regions endpoint fails (e.g., older self-hosted versions identifying as sentry.io),\n // fall back to direct organizations endpoint\n if (error instanceof ApiError && error.status === 404) {\n // logger.info(\"Regions endpoint not found, falling back to direct organizations endpoint\");\n const body = await this.requestJSON(\"/organizations/\", undefined, opts);\n return OrganizationListSchema.parse(body);\n }\n\n // Re-throw other errors\n throw error;\n }\n }\n\n /**\n * Lists teams within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options including host override\n * @returns Array of teams in the organization\n */\n async listTeams(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<TeamList> {\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/teams/`,\n undefined,\n opts,\n );\n return TeamListSchema.parse(body);\n }\n\n /**\n * Creates a new team within an organization.\n *\n * @param params Team creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.name Team name\n * @param opts Request options\n * @returns Created team data\n * @throws {ApiError} If team creation fails (e.g., name conflicts)\n */\n async createTeam(\n {\n organizationSlug,\n name,\n }: {\n organizationSlug: string;\n name: string;\n },\n opts?: RequestOptions,\n ): Promise<Team> {\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/teams/`,\n {\n method: \"POST\",\n body: JSON.stringify({ name }),\n },\n opts,\n );\n return TeamSchema.parse(body);\n }\n\n /**\n * Lists projects within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options\n * @returns Array of projects in the organization\n */\n async listProjects(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<ProjectList> {\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/projects/`,\n undefined,\n opts,\n );\n return ProjectListSchema.parse(body);\n }\n\n /**\n * Creates a new project within a team.\n *\n * @param params Project creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.teamSlug Team identifier\n * @param params.name Project name\n * @param params.platform Platform identifier (e.g., \"javascript\", \"python\")\n * @param opts Request options\n * @returns Created project data\n */\n async createProject(\n {\n organizationSlug,\n teamSlug,\n name,\n platform,\n }: {\n organizationSlug: string;\n teamSlug: string;\n name: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const body = await this.requestJSON(\n `/teams/${organizationSlug}/${teamSlug}/projects/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n platform,\n }),\n },\n opts,\n );\n return ProjectSchema.parse(body);\n }\n\n /**\n * Updates an existing project's configuration.\n *\n * @param params Project update parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Current project identifier\n * @param params.name New project name (optional)\n * @param params.slug New project slug (optional)\n * @param params.platform New platform identifier (optional)\n * @param opts Request options\n * @returns Updated project data\n */\n async updateProject(\n {\n organizationSlug,\n projectSlug,\n name,\n slug,\n platform,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n slug?: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const updateData: Record<string, any> = {};\n if (name !== undefined) updateData.name = name;\n if (slug !== undefined) updateData.slug = slug;\n if (platform !== undefined) updateData.platform = platform;\n\n const body = await this.requestJSON(\n `/projects/${organizationSlug}/${projectSlug}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n return ProjectSchema.parse(body);\n }\n\n /**\n * Assigns a team to a project.\n *\n * @param params Assignment parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.teamSlug Team identifier to assign\n * @param opts Request options\n */\n async addTeamToProject(\n {\n organizationSlug,\n projectSlug,\n teamSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n teamSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<void> {\n await this.request(\n `/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`,\n {\n method: \"POST\",\n body: JSON.stringify({}),\n },\n opts,\n );\n }\n\n /**\n * Creates a new client key (DSN) for a project.\n *\n * Client keys are used to identify and authenticate SDK requests to Sentry.\n *\n * @param params Key creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.name Human-readable name for the key (optional)\n * @param opts Request options\n * @returns Created client key with DSN information\n *\n * @example\n * ```typescript\n * const key = await apiService.createClientKey({\n * organizationSlug: \"my-org\",\n * projectSlug: \"my-project\",\n * name: \"Production\"\n * });\n * console.log(`DSN: ${key.dsn.public}`);\n * ```\n */\n async createClientKey(\n {\n organizationSlug,\n projectSlug,\n name,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKey> {\n const body = await this.requestJSON(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n }),\n },\n opts,\n );\n return ClientKeySchema.parse(body);\n }\n\n /**\n * Lists all client keys (DSNs) for a project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param opts Request options\n * @returns Array of client keys with DSN information\n */\n async listClientKeys(\n {\n organizationSlug,\n projectSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKeyList> {\n const body = await this.requestJSON(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n undefined,\n opts,\n );\n return ClientKeyListSchema.parse(body);\n }\n\n /**\n * Lists releases for an organization or specific project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Search query for filtering releases\n * @param opts Request options\n * @returns Array of releases with deployment and commit information\n *\n * @example\n * ```typescript\n * // All releases for organization\n * const releases = await apiService.listReleases({\n * organizationSlug: \"my-org\"\n * });\n *\n * // Search for specific version\n * const filtered = await apiService.listReleases({\n * organizationSlug: \"my-org\",\n * query: \"v1.2.3\"\n * });\n * ```\n */\n async listReleases(\n {\n organizationSlug,\n projectSlug,\n query,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n },\n opts?: RequestOptions,\n ): Promise<ReleaseList> {\n const searchQuery = new URLSearchParams();\n if (query) {\n searchQuery.set(\"query\", query);\n }\n\n const path = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/releases/`\n : `/organizations/${organizationSlug}/releases/`;\n\n const body = await this.requestJSON(\n searchQuery.toString() ? `${path}?${searchQuery.toString()}` : path,\n undefined,\n opts,\n );\n return ReleaseListSchema.parse(body);\n }\n\n /**\n * Lists available tags for search queries.\n *\n * Tags represent indexed fields that can be used in Sentry search queries.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.dataset Dataset to query tags for (\"errors\" or \"search_issues\")\n * @param opts Request options\n * @returns Array of available tags with metadata\n *\n * @example\n * ```typescript\n * const tags = await apiService.listTags({\n * organizationSlug: \"my-org\",\n * dataset: \"errors\"\n * });\n * tags.forEach(tag => console.log(`${tag.key}: ${tag.name}`));\n * ```\n */\n async listTags(\n {\n organizationSlug,\n dataset,\n }: {\n organizationSlug: string;\n dataset?: \"errors\" | \"search_issues\";\n },\n opts?: RequestOptions,\n ): Promise<TagList> {\n // TODO: this supports project in the query, but needs fixed\n // to accept slugs\n const searchQuery = new URLSearchParams();\n if (dataset) {\n searchQuery.set(\"dataset\", dataset);\n }\n\n const body = await this.requestJSON(\n searchQuery.toString()\n ? `/organizations/${organizationSlug}/tags/?${searchQuery.toString()}`\n : `/organizations/${organizationSlug}/tags/`,\n undefined,\n opts,\n );\n return TagListSchema.parse(body);\n }\n\n /**\n * Lists issues within an organization or project.\n *\n * Issues represent groups of similar errors or problems in your application.\n * Supports Sentry's powerful query syntax for filtering and sorting.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Sentry search query (e.g., \"is:unresolved browser:chrome\")\n * @param params.sortBy Sort order (\"user\", \"freq\", \"date\", \"new\")\n * @param opts Request options\n * @returns Array of issues with metadata and statistics\n *\n * @example\n * ```typescript\n * // Recent unresolved issues\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\",\n * sortBy: \"date\"\n * });\n *\n * // High-frequency errors in specific project\n * const critical = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * projectSlug: \"backend\",\n * query: \"level:error\",\n * sortBy: \"freq\"\n * });\n * ```\n */\n async listIssues(\n {\n organizationSlug,\n projectSlug,\n query,\n sortBy,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n sortBy?: \"user\" | \"freq\" | \"date\" | \"new\";\n },\n opts?: RequestOptions,\n ): Promise<IssueList> {\n const sentryQuery: string[] = [];\n if (query) {\n sentryQuery.push(query);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n if (sortBy) queryParams.set(\"sort\", sortBy);\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n\n queryParams.append(\"collapse\", \"unhandled\");\n\n const apiUrl = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/issues/?${queryParams.toString()}`\n : `/organizations/${organizationSlug}/issues/?${queryParams.toString()}`;\n\n const body = await this.requestJSON(apiUrl, undefined, opts);\n return IssueListSchema.parse(body);\n }\n\n async getIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n undefined,\n opts,\n );\n return IssueSchema.parse(body);\n }\n\n async getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId,\n }: {\n organizationSlug: string;\n issueId: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/issues/${issueId}/events/${eventId}/`,\n undefined,\n opts,\n );\n return EventSchema.parse(body);\n }\n\n async getLatestEventForIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n return this.getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId: \"latest\",\n },\n opts,\n );\n }\n\n async listEventAttachments(\n {\n organizationSlug,\n projectSlug,\n eventId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<EventAttachmentList> {\n const body = await this.requestJSON(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n return EventAttachmentListSchema.parse(body);\n }\n\n async getEventAttachment(\n {\n organizationSlug,\n projectSlug,\n eventId,\n attachmentId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n attachmentId: string;\n },\n opts?: RequestOptions,\n ): Promise<{\n attachment: EventAttachment;\n downloadUrl: string;\n filename: string;\n blob: Blob;\n }> {\n // Get the attachment metadata first\n const attachmentsData = await this.requestJSON(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const attachments = EventAttachmentListSchema.parse(attachmentsData);\n const attachment = attachments.find((att) => att.id === attachmentId);\n\n if (!attachment) {\n throw new Error(\n `Attachment with ID ${attachmentId} not found for event ${eventId}`,\n );\n }\n\n // Download the actual file content\n const downloadUrl = `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/${attachmentId}/?download=1`;\n const downloadResponse = await this.request(\n downloadUrl,\n {\n method: \"GET\",\n headers: {\n Accept: \"application/octet-stream\",\n },\n },\n opts,\n );\n\n return {\n attachment,\n downloadUrl: downloadResponse.url,\n filename: attachment.name,\n blob: await downloadResponse.blob(),\n };\n }\n\n async updateIssue(\n {\n organizationSlug,\n issueId,\n status,\n assignedTo,\n }: {\n organizationSlug: string;\n issueId: string;\n status?: string;\n assignedTo?: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const updateData: Record<string, any> = {};\n if (status !== undefined) updateData.status = status;\n if (assignedTo !== undefined) updateData.assignedTo = assignedTo;\n\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n return IssueSchema.parse(body);\n }\n\n // TODO: Sentry is not yet exposing a reasonable API to fetch trace data\n // async getTrace({\n // organizationSlug,\n // traceId,\n // }: {\n // organizationSlug: string;\n // traceId: string;\n // }): Promise<z.infer<typeof SentryIssueSchema>> {\n // const response = await this.request(\n // `/organizations/${organizationSlug}/issues/${traceId}/`,\n // );\n\n // const body = await response.json();\n // return SentryIssueSchema.parse(body);\n // }\n\n async searchErrors(\n {\n organizationSlug,\n projectSlug,\n filename,\n transaction,\n query,\n sortBy = \"last_seen\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n filename?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"last_seen\" | \"count\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [];\n if (filename) {\n sentryQuery.push(`stack.filename:\"*${filename.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"errors\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"last_seen\" ? \"last_seen\" : \"count\"}`,\n );\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.append(\"field\", \"issue\");\n queryParams.append(\"field\", \"title\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"last_seen()\");\n queryParams.append(\"field\", \"count()\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const body = await this.requestJSON(apiUrl, undefined, opts);\n // TODO(dcramer): If you're using an older version of Sentry this API had a breaking change\n // meaning this endpoint will error.\n return ErrorsSearchResponseSchema.parse(body).data;\n }\n\n async searchSpans(\n {\n organizationSlug,\n projectSlug,\n transaction,\n query,\n sortBy = \"timestamp\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"timestamp\" | \"duration\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [\"is_transaction:true\"];\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"spans\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"timestamp\" ? \"timestamp\" : \"span.duration\"}`,\n );\n queryParams.set(\"allowAggregateConditions\", \"0\");\n queryParams.set(\"useRpc\", \"1\");\n queryParams.append(\"field\", \"id\");\n queryParams.append(\"field\", \"trace\");\n queryParams.append(\"field\", \"span.op\");\n queryParams.append(\"field\", \"span.description\");\n queryParams.append(\"field\", \"span.duration\");\n queryParams.append(\"field\", \"transaction\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"timestamp\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const body = await this.requestJSON(apiUrl, undefined, opts);\n return SpansSearchResponseSchema.parse(body).data;\n }\n\n // POST https://us.sentry.io/api/0/issues/5485083130/autofix/\n async startAutofix(\n {\n organizationSlug,\n issueId,\n eventId,\n instruction = \"\",\n }: {\n organizationSlug: string;\n issueId: string;\n eventId?: string;\n instruction?: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRun> {\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n event_id: eventId,\n instruction,\n }),\n },\n opts,\n );\n return AutofixRunSchema.parse(body);\n }\n\n // GET https://us.sentry.io/api/0/issues/5485083130/autofix/\n async getAutofixState(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRunState> {\n const body = await this.requestJSON(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n undefined,\n opts,\n );\n return AutofixRunStateSchema.parse(body);\n }\n}\n"],"mappings":";;;;;;;;AAkDA,MAAMA,yBAAiD;CACrD,WAAW;CACX,WAAW;CACX,cAAc;CACd,WAAW;CACX,YAAY;AACb;;;;;;;;;;;;;;;;;;AAmBD,IAAa,WAAb,cAA8B,MAAM;CAClC,YACEC,SACOC,QACP;EAEA,IAAI,eAAe;AACnB,MACE,QAAQ,SACN,2DACD,IACD,QAAQ,SAAS,gDAAgD,CAEjE,gBACE;AAEJ,QAAM,aAAa;EAbZ;CAcR;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDD,IAAa,mBAAb,MAA8B;CAC5B,AAAQ;CACR,AAAU;CACV,AAAU;;;;;;;;;;CAWV,YAAY,EACV,cAAc,MACd,OAAO,aAIR,EAAE;AACD,OAAK,cAAc;AACnB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK;CAClC;;;;;;;;;CAUD,QAAQC,MAAc;AACpB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK,KAAK;CACvC;;;;;;;;;CAUD,AAAQ,SAAkB;AACxB,SAAO,KAAK,SAAS;CACtB;;;;;;;;;;;;;;;;;CAkBD,MAAc,QACZC,MACAC,UAAuB,CAAE,GACzB,EAAE,MAAyB,GA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K,UAAU;IACnB,UAAU;IACV;GACD,EAAC;EACH,GACD,KACD;AACD,SAAO,iBAAiB,MAAM,KAAK;CACpC;CAGD,MAAM,gBACJ,EACE,kBACA,SAID,EACDA,MAC0B;EAC1B,MAAM,OAAO,MAAM,KAAK,aACrB,iBAAiB,iBAAiB,UAAU,QAAQ,oBAErD,KACD;AACD,SAAO,sBAAsB,MAAM,KAAK;CACzC;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineTool } from "./defineTool-77H4nSna.js";
|
|
2
|
-
import { apiServiceFromContext } from "./api-utils-
|
|
2
|
+
import { apiServiceFromContext } from "./api-utils-CHRiLf2Y.js";
|
|
3
3
|
import { ParamOrganizationSlug, ParamProjectSlug, ParamRegionUrl } from "./schema-DtsnsxMl.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { setTag } from "@sentry/core";
|
|
@@ -56,4 +56,4 @@ var create_dsn_default = defineTool({
|
|
|
56
56
|
|
|
57
57
|
//#endregion
|
|
58
58
|
export { create_dsn_default };
|
|
59
|
-
//# sourceMappingURL=create-dsn-
|
|
59
|
+
//# sourceMappingURL=create-dsn-CEEytIa4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-dsn-
|
|
1
|
+
{"version":3,"file":"create-dsn-CEEytIa4.js","names":["context: ServerContext"],"sources":["../src/tools/create-dsn.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_dsn\",\n description: [\n \"Create a new Sentry DSN for a specific project.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new DSN for a specific project\",\n \"\",\n \"<examples>\",\n \"### Create a new DSN for the 'my-project' project\",\n \"\",\n \"```\",\n \"create_dsn(organizationSlug='my-organization', projectSlug='my-project', name='Production')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z\n .string()\n .trim()\n .describe(\"The name of the DSN to create, for example 'Production'.\"),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n const clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n });\n let output = `# New DSN in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n`;\n output += `**Name**: ${clientKey.name}\\n\\n`;\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;AAWA,yBAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa;EACb,MAAM,EACH,QAAQ,CACR,MAAM,CACN,SAAS,2DAA2D;CACxE;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,SAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,YAAY,MAAM,WAAW,gBAAgB;GACjD;GACA,aAAa,OAAO;GACpB,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,iBAAiB,iBAAiB,GAAG,OAAO,YAAY;AACtE,aAAW,WAAW,UAAU,IAAI,OAAO;AAC3C,aAAW,YAAY,UAAU,KAAK;AACtC,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
2
|
const require_defineTool = require('./defineTool-lWNTzWl_.cjs');
|
|
3
|
-
const require_api_utils = require('./api-utils-
|
|
3
|
+
const require_api_utils = require('./api-utils-B-9vnzoA.cjs');
|
|
4
4
|
const require_schema = require('./schema-BpJVmev8.cjs');
|
|
5
5
|
const zod = require_chunk.__toESM(require("zod"));
|
|
6
6
|
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
@@ -62,4 +62,4 @@ Object.defineProperty(exports, 'create_dsn_default', {
|
|
|
62
62
|
return create_dsn_default;
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
//# sourceMappingURL=create-dsn-
|
|
65
|
+
//# sourceMappingURL=create-dsn-CI7MSiQu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-dsn-
|
|
1
|
+
{"version":3,"file":"create-dsn-CI7MSiQu.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext"],"sources":["../src/tools/create-dsn.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_dsn\",\n description: [\n \"Create a new Sentry DSN for a specific project.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new DSN for a specific project\",\n \"\",\n \"<examples>\",\n \"### Create a new DSN for the 'my-project' project\",\n \"\",\n \"```\",\n \"create_dsn(organizationSlug='my-organization', projectSlug='my-project', name='Production')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z\n .string()\n .trim()\n .describe(\"The name of the DSN to create, for example 'Production'.\"),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n const clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n });\n let output = `# New DSN in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n`;\n output += `**Name**: ${clientKey.name}\\n\\n`;\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAWA,yBAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAaC;EACb,MAAM,MACH,QAAQ,CACR,MAAM,CACN,SAAS,2DAA2D;CACxE;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,4BAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,YAAY,MAAM,WAAW,gBAAgB;GACjD;GACA,aAAa,OAAO;GACpB,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,iBAAiB,iBAAiB,GAAG,OAAO,YAAY;AACtE,aAAW,WAAW,UAAU,IAAI,OAAO;AAC3C,aAAW,YAAY,UAAU,KAAK;AACtC,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
|