@sentry/mcp-server 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/agent-COgY789I.js +225 -0
- package/dist/agent-COgY789I.js.map +1 -0
- package/dist/agent-Cody_f0d.cjs +59 -0
- package/dist/agent-Cody_f0d.cjs.map +1 -0
- package/dist/agent-DZRRChrO.js +53 -0
- package/dist/agent-DZRRChrO.js.map +1 -0
- package/dist/agent-DpCCnhh5.cjs +231 -0
- package/dist/agent-DpCCnhh5.cjs.map +1 -0
- package/dist/agent-tools/discover-dataset-fields.cjs +6 -0
- package/dist/agent-tools/discover-dataset-fields.d.cts +59 -0
- package/dist/agent-tools/discover-dataset-fields.d.cts.map +1 -0
- package/dist/agent-tools/discover-dataset-fields.d.ts +59 -0
- package/dist/agent-tools/discover-dataset-fields.d.ts.map +1 -0
- package/dist/agent-tools/discover-dataset-fields.js +3 -0
- package/dist/agent-tools/lookup-otel-semantics.cjs +5 -0
- package/dist/agent-tools/lookup-otel-semantics.d.cts +38 -0
- package/dist/agent-tools/lookup-otel-semantics.d.cts.map +1 -0
- package/dist/agent-tools/lookup-otel-semantics.d.ts +38 -0
- package/dist/agent-tools/lookup-otel-semantics.d.ts.map +1 -0
- package/dist/agent-tools/lookup-otel-semantics.js +4 -0
- package/dist/agent-tools/whoami.cjs +4 -0
- package/dist/agent-tools/whoami.d.cts +28 -0
- package/dist/agent-tools/whoami.d.cts.map +1 -0
- package/dist/agent-tools/whoami.d.ts +28 -0
- package/dist/agent-tools/whoami.d.ts.map +1 -0
- package/dist/agent-tools/whoami.js +3 -0
- package/dist/{analyze-issue-with-seer-B8ZWokLV.cjs → analyze-issue-with-seer-ByoDTsq-.cjs} +7 -7
- package/dist/{analyze-issue-with-seer-B8ZWokLV.cjs.map → analyze-issue-with-seer-ByoDTsq-.cjs.map} +1 -1
- package/dist/{analyze-issue-with-seer-szIqv1_I.js → analyze-issue-with-seer-CpwtN4UA.js} +7 -7
- package/dist/{analyze-issue-with-seer-szIqv1_I.js.map → analyze-issue-with-seer-CpwtN4UA.js.map} +1 -1
- package/dist/api-client/client.cjs +3 -2
- package/dist/api-client/client.d.cts +3 -3
- package/dist/api-client/client.d.ts +3 -3
- package/dist/api-client/client.js +3 -2
- package/dist/api-client/index.cjs +5 -4
- package/dist/api-client/index.d.cts +3 -3
- package/dist/api-client/index.d.ts +4 -4
- package/dist/api-client/index.js +5 -4
- package/dist/api-client/schema.cjs +1 -1
- package/dist/api-client/schema.d.cts +1 -1
- package/dist/api-client/schema.d.ts +1 -1
- package/dist/api-client/schema.js +1 -1
- package/dist/api-client/types.cjs +1 -1
- package/dist/api-client/types.d.cts +2 -2
- package/dist/api-client/types.d.ts +2 -2
- package/dist/api-client/types.js +1 -1
- package/dist/{api-utils-CHRiLf2Y.js → api-utils-BlUSO8xh.js} +12 -13
- package/dist/api-utils-BlUSO8xh.js.map +1 -0
- package/dist/{api-utils-B-9vnzoA.cjs → api-utils-DFWUfQ83.cjs} +12 -13
- package/dist/api-utils-DFWUfQ83.cjs.map +1 -0
- package/dist/{client-C_lwH0jz.cjs → client-CPrEfAwa.cjs} +307 -13
- package/dist/client-CPrEfAwa.cjs.map +1 -0
- package/dist/{client-D8vrUp2k.d.cts → client-DLkUGS7r.d.ts} +163 -8
- package/dist/client-DLkUGS7r.d.ts.map +1 -0
- package/dist/{client-h32L1Hx5.d.ts → client-DV68BdcS.d.cts} +167 -12
- package/dist/client-DV68BdcS.d.cts.map +1 -0
- package/dist/{client-pyNUFaLN.js → client-MaVV1gVC.js} +307 -13
- package/dist/client-MaVV1gVC.js.map +1 -0
- package/dist/config-BUmDxVLS.js +52 -0
- package/dist/config-BUmDxVLS.js.map +1 -0
- package/dist/config-BvtWiL3I.js +449 -0
- package/dist/config-BvtWiL3I.js.map +1 -0
- package/dist/config-CD-5FpOO.cjs +479 -0
- package/dist/config-CD-5FpOO.cjs.map +1 -0
- package/dist/config-FWsgDbm7.cjs +58 -0
- package/dist/config-FWsgDbm7.cjs.map +1 -0
- package/dist/{constants-S7AU45oQ.js → constants-Fe-4NTUo.js} +6 -2
- package/dist/constants-Fe-4NTUo.js.map +1 -0
- package/dist/{constants-ClkMK29-.cjs → constants-wrEbre3j.cjs} +11 -1
- package/dist/constants-wrEbre3j.cjs.map +1 -0
- package/dist/constants.cjs +2 -1
- package/dist/constants.d.cts +5 -1
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.ts +5 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -2
- package/dist/{create-dsn-CEEytIa4.js → create-dsn-BT3t-MDA.js} +12 -10
- package/dist/create-dsn-BT3t-MDA.js.map +1 -0
- package/dist/{create-dsn-CI7MSiQu.cjs → create-dsn-Bgwi-Ygi.cjs} +12 -10
- package/dist/create-dsn-Bgwi-Ygi.cjs.map +1 -0
- package/dist/{create-project-DnLKRG1p.cjs → create-project-4R4aZMoc.cjs} +14 -11
- package/dist/create-project-4R4aZMoc.cjs.map +1 -0
- package/dist/{create-project-CoV1e-vp.js → create-project-Ca1Sy1_F.js} +14 -11
- package/dist/create-project-Ca1Sy1_F.js.map +1 -0
- package/dist/{create-team-DKpKxVIY.cjs → create-team-CSBXDcoD.cjs} +14 -5
- package/dist/{create-team-DKpKxVIY.cjs.map → create-team-CSBXDcoD.cjs.map} +1 -1
- package/dist/{create-team-HWN88CJQ.js → create-team-D0dUl7Zo.js} +14 -5
- package/dist/{create-team-HWN88CJQ.js.map → create-team-D0dUl7Zo.js.map} +1 -1
- package/dist/discover-dataset-fields-BEnyqPSq.js +156 -0
- package/dist/discover-dataset-fields-BEnyqPSq.js.map +1 -0
- package/dist/discover-dataset-fields-Cl7HpVkm.cjs +180 -0
- package/dist/discover-dataset-fields-Cl7HpVkm.cjs.map +1 -0
- package/dist/{fetch-utils-gHZdOZV2.js → fetch-utils-C_Xj921x.js} +1 -1
- package/dist/{fetch-utils-gHZdOZV2.js.map → fetch-utils-C_Xj921x.js.map} +1 -1
- package/dist/{fetch-utils-SuGtrQRz.cjs → fetch-utils-DkcYwqBo.cjs} +1 -1
- package/dist/{fetch-utils-SuGtrQRz.cjs.map → fetch-utils-DkcYwqBo.cjs.map} +1 -1
- package/dist/{fetch-utils-B0CB5xLM.d.ts → fetch-utils-JDZw4XaU.d.ts} +1 -1
- package/dist/{fetch-utils-B0CB5xLM.d.ts.map → fetch-utils-JDZw4XaU.d.ts.map} +1 -1
- package/dist/{find-dsns-vriZSwr7.cjs → find-dsns-CkvahHwJ.cjs} +3 -3
- package/dist/{find-dsns-vriZSwr7.cjs.map → find-dsns-CkvahHwJ.cjs.map} +1 -1
- package/dist/{find-dsns-BB9dQP0b.js → find-dsns-DrNAfU_Q.js} +3 -3
- package/dist/{find-dsns-BB9dQP0b.js.map → find-dsns-DrNAfU_Q.js.map} +1 -1
- package/dist/{find-organizations-Cx5vCj4j.cjs → find-organizations-BDtHkcFV.cjs} +2 -2
- package/dist/{find-organizations-Cx5vCj4j.cjs.map → find-organizations-BDtHkcFV.cjs.map} +1 -1
- package/dist/{find-organizations-BILg1hUb.js → find-organizations-Cs1GvZtJ.js} +2 -2
- package/dist/{find-organizations-BILg1hUb.js.map → find-organizations-Cs1GvZtJ.js.map} +1 -1
- package/dist/{find-projects-CgCj2_eq.js → find-projects-CZCMck_0.js} +3 -3
- package/dist/{find-projects-CgCj2_eq.js.map → find-projects-CZCMck_0.js.map} +1 -1
- package/dist/{find-projects-CN99WBex.cjs → find-projects-Dh-1AK-m.cjs} +3 -3
- package/dist/{find-projects-CN99WBex.cjs.map → find-projects-Dh-1AK-m.cjs.map} +1 -1
- package/dist/{find-releases-Cm11xU5S.cjs → find-releases-BsAkl--F.cjs} +3 -3
- package/dist/{find-releases-Cm11xU5S.cjs.map → find-releases-BsAkl--F.cjs.map} +1 -1
- package/dist/{find-releases-BsQF3wc5.js → find-releases-Do_CywRr.js} +3 -3
- package/dist/{find-releases-BsQF3wc5.js.map → find-releases-Do_CywRr.js.map} +1 -1
- package/dist/{find-teams-XgUg8Nj5.js → find-teams-BylQQ4FO.js} +3 -3
- package/dist/{find-teams-XgUg8Nj5.js.map → find-teams-BylQQ4FO.js.map} +1 -1
- package/dist/{find-teams-CS443jRa.cjs → find-teams-DXyzyQOy.cjs} +3 -3
- package/dist/{find-teams-CS443jRa.cjs.map → find-teams-DXyzyQOy.cjs.map} +1 -1
- package/dist/formatters-B3ONbRhI.js +79 -0
- package/dist/formatters-B3ONbRhI.js.map +1 -0
- package/dist/formatters-CfeBjhXZ.cjs +235 -0
- package/dist/formatters-CfeBjhXZ.cjs.map +1 -0
- package/dist/formatters-DSYXBiQx.js +217 -0
- package/dist/formatters-DSYXBiQx.js.map +1 -0
- package/dist/formatters-DbqofIoy.cjs +85 -0
- package/dist/formatters-DbqofIoy.cjs.map +1 -0
- package/dist/{formatting-AXU4XsjJ.cjs → formatting-C180PVwd.cjs} +3 -3
- package/dist/formatting-C180PVwd.cjs.map +1 -0
- package/dist/{formatting-DnSI0DHf.d.ts → formatting-C3qu84cm.d.ts} +4 -4
- package/dist/formatting-C3qu84cm.d.ts.map +1 -0
- package/dist/{formatting-aGQ7M_2w.d.cts → formatting-CmBYkI_e.d.cts} +4 -4
- package/dist/formatting-CmBYkI_e.d.cts.map +1 -0
- package/dist/{formatting-WGc5qrhv.js → formatting-DIvCVunN.js} +3 -3
- package/dist/formatting-DIvCVunN.js.map +1 -0
- package/dist/{formatting-utils-DgOyTl-m.js → formatting-utils-C3sej5ER.js} +1 -1
- package/dist/{formatting-utils-DgOyTl-m.js.map → formatting-utils-C3sej5ER.js.map} +1 -1
- package/dist/{formatting-utils-m9R5bsRU.cjs → formatting-utils-DDz14xeB.cjs} +1 -1
- package/dist/{formatting-utils-m9R5bsRU.cjs.map → formatting-utils-DDz14xeB.cjs.map} +1 -1
- package/dist/{get-doc-ByXR3EWc.cjs → get-doc-BfMg0GIa.cjs} +3 -3
- package/dist/{get-doc-ByXR3EWc.cjs.map → get-doc-BfMg0GIa.cjs.map} +1 -1
- package/dist/{get-doc-C1IEG2pH.js → get-doc-DyqJe6TP.js} +3 -3
- package/dist/{get-doc-C1IEG2pH.js.map → get-doc-DyqJe6TP.js.map} +1 -1
- package/dist/{get-event-attachment-CuGUfVAD.cjs → get-event-attachment-BzhDeM6z.cjs} +3 -3
- package/dist/{get-event-attachment-CuGUfVAD.cjs.map → get-event-attachment-BzhDeM6z.cjs.map} +1 -1
- package/dist/{get-event-attachment-N11gSV23.js → get-event-attachment-CVoMrETq.js} +3 -3
- package/dist/{get-event-attachment-N11gSV23.js.map → get-event-attachment-CVoMrETq.js.map} +1 -1
- package/dist/{get-issue-details-EklkHsWi.cjs → get-issue-details-C96fhps3.cjs} +22 -18
- package/dist/get-issue-details-C96fhps3.cjs.map +1 -0
- package/dist/{get-issue-details-BrEGybe0.js → get-issue-details-_uS_AZ_v.js} +22 -18
- package/dist/get-issue-details-_uS_AZ_v.js.map +1 -0
- package/dist/handler-7T1iMsQU.cjs +152 -0
- package/dist/handler-7T1iMsQU.cjs.map +1 -0
- package/dist/handler-B0bLvFFX.js +146 -0
- package/dist/handler-B0bLvFFX.js.map +1 -0
- package/dist/handler-BGhr9FJM.d.cts +15 -0
- package/dist/handler-BGhr9FJM.d.cts.map +1 -0
- package/dist/handler-BPPTAi7I.d.ts +15 -0
- package/dist/handler-BPPTAi7I.d.ts.map +1 -0
- package/dist/handler-BZ3hKPb8.d.cts +15 -0
- package/dist/handler-BZ3hKPb8.d.cts.map +1 -0
- package/dist/handler-DEjS3yks.cjs +114 -0
- package/dist/handler-DEjS3yks.cjs.map +1 -0
- package/dist/handler-DTN2HYXt.js +108 -0
- package/dist/handler-DTN2HYXt.js.map +1 -0
- package/dist/handler-cUB6XcUV.d.ts +15 -0
- package/dist/handler-cUB6XcUV.d.ts.map +1 -0
- package/dist/index.cjs +63 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +63 -46
- package/dist/index.js.map +1 -1
- package/dist/internal/fetch-utils.cjs +1 -1
- package/dist/internal/fetch-utils.d.ts +1 -1
- package/dist/internal/fetch-utils.js +1 -1
- package/dist/internal/formatting.cjs +2 -2
- package/dist/internal/formatting.d.cts +4 -4
- package/dist/internal/formatting.d.ts +5 -5
- package/dist/internal/formatting.js +2 -2
- package/dist/internal/issue-helpers.cjs +1 -1
- package/dist/internal/issue-helpers.d.ts +1 -1
- package/dist/internal/issue-helpers.js +1 -1
- package/dist/internal/test-fixtures.d.cts +68 -68
- package/dist/internal/test-fixtures.d.cts.map +1 -1
- package/dist/internal/test-fixtures.d.ts +56 -56
- package/dist/internal/test-fixtures.d.ts.map +1 -1
- package/dist/{issue-helpers-D2p1Gkgm.js → issue-helpers-CRx45FYG.js} +1 -1
- package/dist/{issue-helpers-D2p1Gkgm.js.map → issue-helpers-CRx45FYG.js.map} +1 -1
- package/dist/{issue-helpers-BJffpNoO.d.ts → issue-helpers-D1_Uqr-F.d.ts} +1 -1
- package/dist/{issue-helpers-BJffpNoO.d.ts.map → issue-helpers-D1_Uqr-F.d.ts.map} +1 -1
- package/dist/{issue-helpers-DvsTfq9u.cjs → issue-helpers-s5fKLwJZ.cjs} +1 -1
- package/dist/{issue-helpers-DvsTfq9u.cjs.map → issue-helpers-s5fKLwJZ.cjs.map} +1 -1
- package/dist/{logging-CX2buXiG.cjs → logging-BpL53bY6.cjs} +1 -1
- package/dist/{logging-CX2buXiG.cjs.map → logging-BpL53bY6.cjs.map} +1 -1
- package/dist/{logging-DzxYBMrn.js → logging-tGU_SYcA.js} +1 -1
- package/dist/{logging-DzxYBMrn.js.map → logging-tGU_SYcA.js.map} +1 -1
- package/dist/logging.cjs +1 -1
- package/dist/logging.js +1 -1
- package/dist/lookup-otel-semantics-BbriXZAx.cjs +5088 -0
- package/dist/lookup-otel-semantics-BbriXZAx.cjs.map +1 -0
- package/dist/lookup-otel-semantics-Dt667kdR.js +5076 -0
- package/dist/lookup-otel-semantics-Dt667kdR.js.map +1 -0
- package/dist/{promptDefinitions-C29BWGYg.cjs → promptDefinitions-CWV8hsUX.cjs} +2 -2
- package/dist/{promptDefinitions-C29BWGYg.cjs.map → promptDefinitions-CWV8hsUX.cjs.map} +1 -1
- package/dist/{promptDefinitions-CSKE8T0a.js → promptDefinitions-DF8nuJVq.js} +2 -2
- package/dist/{promptDefinitions-CSKE8T0a.js.map → promptDefinitions-DF8nuJVq.js.map} +1 -1
- package/dist/{promptDefinitions-D3GTBGLr.d.ts → promptDefinitions-DehpwJfn.d.ts} +1 -1
- package/dist/promptDefinitions-DehpwJfn.d.ts.map +1 -0
- package/dist/promptDefinitions.cjs +3 -3
- package/dist/promptDefinitions.d.ts +1 -1
- package/dist/promptDefinitions.js +3 -3
- package/dist/{prompts-uWAbMvLe.cjs → prompts-BTtNbKQR.cjs} +6 -4
- package/dist/prompts-BTtNbKQR.cjs.map +1 -0
- package/dist/{prompts-Cuwmybyc.js → prompts-CYcvIxWR.js} +6 -4
- package/dist/prompts-CYcvIxWR.js.map +1 -0
- package/dist/prompts.cjs +1 -1
- package/dist/prompts.d.cts +1 -1
- package/dist/prompts.d.cts.map +1 -1
- package/dist/prompts.d.ts +2 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +1 -1
- package/dist/resources-Dadvq5Fm.cjs +72 -0
- package/dist/resources-Dadvq5Fm.cjs.map +1 -0
- package/dist/resources-jcFoc4JU.js +60 -0
- package/dist/resources-jcFoc4JU.js.map +1 -0
- package/dist/resources.cjs +2 -2
- package/dist/resources.d.cts.map +1 -1
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +2 -2
- package/dist/{schema-BpJVmev8.cjs → schema-BL3kwfOA.cjs} +3 -3
- package/dist/{schema-BpJVmev8.cjs.map → schema-BL3kwfOA.cjs.map} +1 -1
- package/dist/{schema-B_cMyyJJ.cjs → schema-C0LznFvu.cjs} +4 -4
- package/dist/schema-C0LznFvu.cjs.map +1 -0
- package/dist/{schema-WDk5Yqww.js → schema-CcFmBoEf.js} +4 -4
- package/dist/schema-CcFmBoEf.js.map +1 -0
- package/dist/{schema-DtsnsxMl.js → schema-DMfkTR1l.js} +3 -3
- package/dist/{schema-DtsnsxMl.js.map → schema-DMfkTR1l.js.map} +1 -1
- package/dist/{schema-BW_fxx99.d.cts → schema-DWmx8lgm.d.ts} +247 -247
- package/dist/schema-DWmx8lgm.d.ts.map +1 -0
- package/dist/{schema-DkWOa2-c.d.ts → schema-xbTf44Hn.d.cts} +298 -298
- package/dist/schema-xbTf44Hn.d.cts.map +1 -0
- package/dist/schema.cjs +2 -2
- package/dist/schema.d.cts.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/{search-docs-BKUeMSyn.js → search-docs-DIm3ykOg.js} +4 -4
- package/dist/{search-docs-BKUeMSyn.js.map → search-docs-DIm3ykOg.js.map} +1 -1
- package/dist/{search-docs-Cr-gyE5m.cjs → search-docs-EbjJuL9Q.cjs} +4 -4
- package/dist/{search-docs-Cr-gyE5m.cjs.map → search-docs-EbjJuL9Q.cjs.map} +1 -1
- package/dist/search-issues-BFgCvRYe.js +0 -0
- package/dist/search-issues-Biu64RkQ.cjs +0 -0
- package/dist/{seer-utils-BvdVTH85.cjs → seer-utils-C7Kv0gr8.cjs} +1 -1
- package/dist/{seer-utils-BvdVTH85.cjs.map → seer-utils-C7Kv0gr8.cjs.map} +1 -1
- package/dist/{seer-utils-BdE7DddW.js → seer-utils-NPHv8KYY.js} +1 -1
- package/dist/{seer-utils-BdE7DddW.js.map → seer-utils-NPHv8KYY.js.map} +1 -1
- package/dist/{server-BhNrW6bw.js → server-CnJvaT0s.js} +57 -18
- package/dist/server-CnJvaT0s.js.map +1 -0
- package/dist/{server-9IEGGN8V.cjs → server-Dv9HxoRk.cjs} +57 -18
- package/dist/server-Dv9HxoRk.cjs.map +1 -0
- package/dist/server.cjs +52 -40
- package/dist/server.d.cts +4 -2
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +5 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +52 -40
- package/dist/{stdio-mw-fEjO4.cjs → stdio-C6MAgHmA.cjs} +3 -3
- package/dist/{stdio-mw-fEjO4.cjs.map → stdio-C6MAgHmA.cjs.map} +1 -1
- package/dist/{stdio-CQmibRBR.js → stdio-DnAY4MSF.js} +3 -3
- package/dist/{stdio-CQmibRBR.js.map → stdio-DnAY4MSF.js.map} +1 -1
- package/dist/test-setup.cjs +371 -0
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +371 -0
- package/dist/test-setup.js.map +1 -1
- package/dist/toolDefinitions.cjs +184 -0
- package/dist/toolDefinitions.cjs.map +1 -0
- package/dist/toolDefinitions.d.cts +13 -0
- package/dist/toolDefinitions.d.cts.map +1 -0
- package/dist/toolDefinitions.d.ts +8 -20
- package/dist/toolDefinitions.d.ts.map +1 -0
- package/dist/toolDefinitions.js +183 -1059
- package/dist/toolDefinitions.js.map +1 -0
- package/dist/tools/analyze-issue-with-seer.cjs +14 -13
- package/dist/tools/analyze-issue-with-seer.d.cts +2 -2
- package/dist/tools/analyze-issue-with-seer.d.ts +3 -3
- package/dist/tools/analyze-issue-with-seer.js +14 -13
- package/dist/tools/create-dsn.cjs +9 -8
- package/dist/tools/create-dsn.d.cts +2 -2
- package/dist/tools/create-dsn.d.ts +3 -3
- package/dist/tools/create-dsn.js +9 -8
- package/dist/tools/create-project.cjs +10 -9
- package/dist/tools/create-project.d.cts +2 -2
- package/dist/tools/create-project.d.ts +3 -3
- package/dist/tools/create-project.js +10 -9
- package/dist/tools/create-team.cjs +9 -8
- package/dist/tools/create-team.d.cts +2 -2
- package/dist/tools/create-team.d.ts +3 -3
- package/dist/tools/create-team.js +9 -8
- package/dist/tools/find-dsns.cjs +9 -8
- package/dist/tools/find-dsns.d.cts +2 -2
- package/dist/tools/find-dsns.d.ts +3 -3
- package/dist/tools/find-dsns.js +9 -8
- package/dist/tools/find-organizations.cjs +7 -6
- package/dist/tools/find-organizations.d.cts +2 -2
- package/dist/tools/find-organizations.d.ts +3 -3
- package/dist/tools/find-organizations.js +7 -6
- package/dist/tools/find-projects.cjs +9 -8
- package/dist/tools/find-projects.d.cts +2 -2
- package/dist/tools/find-projects.d.ts +3 -3
- package/dist/tools/find-projects.js +9 -8
- package/dist/tools/find-releases.cjs +9 -8
- package/dist/tools/find-releases.d.cts +2 -2
- package/dist/tools/find-releases.d.ts +3 -3
- package/dist/tools/find-releases.js +9 -8
- package/dist/tools/find-teams.cjs +9 -8
- package/dist/tools/find-teams.d.cts +2 -2
- package/dist/tools/find-teams.d.ts +3 -3
- package/dist/tools/find-teams.js +9 -8
- package/dist/tools/get-doc.cjs +8 -7
- package/dist/tools/get-doc.d.cts +2 -2
- package/dist/tools/get-doc.d.ts +3 -3
- package/dist/tools/get-doc.js +8 -7
- package/dist/tools/get-event-attachment.cjs +9 -8
- package/dist/tools/get-event-attachment.d.cts +2 -2
- package/dist/tools/get-event-attachment.d.ts +3 -3
- package/dist/tools/get-event-attachment.js +9 -8
- package/dist/tools/get-issue-details.cjs +13 -12
- package/dist/tools/get-issue-details.d.cts +2 -2
- package/dist/tools/get-issue-details.d.ts +3 -3
- package/dist/tools/get-issue-details.js +13 -12
- package/dist/tools/index.cjs +47 -36
- package/dist/tools/index.d.cts +74 -86
- package/dist/tools/index.d.cts.map +1 -1
- package/dist/tools/index.d.ts +75 -87
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +47 -36
- package/dist/tools/search-docs.cjs +10 -9
- package/dist/tools/search-docs.d.cts +2 -2
- package/dist/tools/search-docs.d.ts +3 -3
- package/dist/tools/search-docs.js +10 -9
- package/dist/tools/search-events/agent.cjs +8 -0
- package/dist/tools/search-events/agent.d.cts +43 -0
- package/dist/tools/search-events/agent.d.cts.map +1 -0
- package/dist/tools/search-events/agent.d.ts +43 -0
- package/dist/tools/search-events/agent.d.ts.map +1 -0
- package/dist/tools/search-events/agent.js +8 -0
- package/dist/tools/search-events/config.cjs +7 -0
- package/dist/tools/search-events/config.d.cts +131 -0
- package/dist/tools/search-events/config.d.cts.map +1 -0
- package/dist/tools/search-events/config.d.ts +131 -0
- package/dist/tools/search-events/config.d.ts.map +1 -0
- package/dist/tools/search-events/config.js +3 -0
- package/dist/tools/search-events/formatters.cjs +8 -0
- package/dist/tools/search-events/formatters.d.cts +32 -0
- package/dist/tools/search-events/formatters.d.cts.map +1 -0
- package/dist/tools/search-events/formatters.d.ts +32 -0
- package/dist/tools/search-events/formatters.d.ts.map +1 -0
- package/dist/tools/search-events/formatters.js +6 -0
- package/dist/tools/search-events/handler.cjs +20 -0
- package/dist/tools/search-events/handler.d.cts +5 -0
- package/dist/tools/search-events/handler.d.ts +5 -0
- package/dist/tools/search-events/handler.js +20 -0
- package/dist/tools/search-events/index.cjs +21 -0
- package/dist/tools/search-events/index.d.cts +5 -0
- package/dist/tools/search-events/index.d.ts +5 -0
- package/dist/tools/search-events/index.js +21 -0
- package/dist/tools/search-events/utils.cjs +9 -0
- package/dist/tools/search-events/utils.d.cts +6 -0
- package/dist/tools/search-events/utils.d.ts +6 -0
- package/dist/tools/search-events/utils.js +5 -0
- package/dist/tools/search-issues/agent.cjs +7 -0
- package/dist/tools/search-issues/agent.d.cts +33 -0
- package/dist/tools/search-issues/agent.d.cts.map +1 -0
- package/dist/tools/search-issues/agent.d.ts +33 -0
- package/dist/tools/search-issues/agent.d.ts.map +1 -0
- package/dist/tools/search-issues/agent.js +7 -0
- package/dist/tools/search-issues/config.cjs +3 -0
- package/dist/tools/search-issues/config.d.cts +9 -0
- package/dist/tools/search-issues/config.d.cts.map +1 -0
- package/dist/tools/search-issues/config.d.ts +9 -0
- package/dist/tools/search-issues/config.d.ts.map +1 -0
- package/dist/tools/search-issues/config.js +3 -0
- package/dist/tools/search-issues/formatters.cjs +4 -0
- package/dist/tools/search-issues/formatters.d.cts +15 -0
- package/dist/tools/search-issues/formatters.d.cts.map +1 -0
- package/dist/tools/search-issues/formatters.d.ts +15 -0
- package/dist/tools/search-issues/formatters.d.ts.map +1 -0
- package/dist/tools/search-issues/formatters.js +4 -0
- package/dist/tools/search-issues/handler.cjs +18 -0
- package/dist/tools/search-issues/handler.d.cts +5 -0
- package/dist/tools/search-issues/handler.d.ts +5 -0
- package/dist/tools/search-issues/handler.js +18 -0
- package/dist/tools/search-issues/index.cjs +19 -0
- package/dist/tools/search-issues/index.d.cts +5 -0
- package/dist/tools/search-issues/index.d.ts +5 -0
- package/dist/tools/search-issues/index.js +19 -0
- package/dist/tools/types.d.cts +2 -2
- package/dist/tools/types.d.ts +3 -3
- package/dist/tools/update-issue.cjs +14 -13
- package/dist/tools/update-issue.d.cts +2 -2
- package/dist/tools/update-issue.d.ts +3 -3
- package/dist/tools/update-issue.js +14 -13
- package/dist/tools/update-project.cjs +10 -9
- package/dist/tools/update-project.d.cts +2 -2
- package/dist/tools/update-project.d.ts +3 -3
- package/dist/tools/update-project.js +10 -9
- package/dist/tools/utils/api-utils.cjs +6 -5
- package/dist/tools/utils/api-utils.d.cts +5 -5
- package/dist/tools/utils/api-utils.d.cts.map +1 -1
- package/dist/tools/utils/api-utils.d.ts +7 -7
- package/dist/tools/utils/api-utils.d.ts.map +1 -1
- package/dist/tools/utils/api-utils.js +6 -5
- package/dist/tools/utils/defineTool.d.cts +2 -2
- package/dist/tools/utils/defineTool.d.ts +3 -3
- package/dist/tools/utils/fetch-utils.cjs +2 -2
- package/dist/tools/utils/fetch-utils.d.ts +1 -1
- 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 +4 -4
- package/dist/tools/utils/formatting-utils.js +1 -1
- package/dist/tools/utils/issue-utils.cjs +4 -4
- package/dist/tools/utils/issue-utils.d.cts +4 -4
- package/dist/tools/utils/issue-utils.d.ts +6 -6
- package/dist/tools/utils/issue-utils.js +4 -4
- package/dist/tools/utils/seer-utils.cjs +1 -1
- package/dist/tools/utils/seer-utils.d.cts +3 -3
- package/dist/tools/utils/seer-utils.d.ts +4 -4
- package/dist/tools/utils/seer-utils.js +1 -1
- package/dist/tools/whoami.cjs +7 -6
- package/dist/tools/whoami.d.cts +2 -2
- package/dist/tools/whoami.d.ts +3 -3
- package/dist/tools/whoami.js +7 -6
- package/dist/tools-B0wbxDty.js +44 -0
- package/dist/tools-B0wbxDty.js.map +1 -0
- package/dist/tools-qfk-QAo0.cjs +49 -0
- package/dist/tools-qfk-QAo0.cjs.map +1 -0
- package/dist/transports/stdio.cjs +53 -42
- package/dist/transports/stdio.d.cts +1 -1
- package/dist/transports/stdio.d.ts +2 -2
- package/dist/transports/stdio.js +53 -42
- package/dist/types-6zHoEWAx.js +0 -0
- package/dist/{types-qB8a4WQT.d.ts → types-BOcoP3Na.d.ts} +2 -2
- package/dist/{types-qB8a4WQT.d.ts.map → types-BOcoP3Na.d.ts.map} +1 -1
- package/dist/{types-CUN-2OSS.d.cts → types-BV-G5sBp.d.cts} +4 -2
- package/dist/{types-CUN-2OSS.d.cts.map → types-BV-G5sBp.d.cts.map} +1 -1
- package/dist/{types-DkJtNDXU.d.ts → types-C1Fih0eQ.d.ts} +5 -3
- package/dist/{types-DkJtNDXU.d.ts.map → types-C1Fih0eQ.d.ts.map} +1 -1
- package/dist/{types-BAbu4Vzx.d.cts → types-DE-njuHe.d.cts} +2 -2
- package/dist/{types-BAbu4Vzx.d.cts.map → types-DE-njuHe.d.cts.map} +1 -1
- package/dist/{types-CoY5KVni.d.ts → types-DRywojVB.d.ts} +2 -2
- package/dist/{types-CoY5KVni.d.ts.map → types-DRywojVB.d.ts.map} +1 -1
- package/dist/types-DdloOYgD.cjs +0 -0
- package/dist/{types-D_mx318Q.d.cts → types-aOEJ0KgQ.d.cts} +2 -2
- package/dist/{types-D_mx318Q.d.cts.map → types-aOEJ0KgQ.d.cts.map} +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/{update-issue-ClbiTLyL.js → update-issue-DoQYEQjf.js} +11 -10
- package/dist/update-issue-DoQYEQjf.js.map +1 -0
- package/dist/{update-issue-_4vzwHfZ.cjs → update-issue-DqUsAuTd.cjs} +11 -10
- package/dist/update-issue-DqUsAuTd.cjs.map +1 -0
- package/dist/{update-project-CExfO7tG.js → update-project-C9CLxNfF.js} +4 -4
- package/dist/{update-project-CExfO7tG.js.map → update-project-C9CLxNfF.js.map} +1 -1
- package/dist/{update-project-2EEnezbZ.cjs → update-project-DQu5PnE3.cjs} +4 -4
- package/dist/{update-project-2EEnezbZ.cjs.map → update-project-DQu5PnE3.cjs.map} +1 -1
- package/dist/url-utils-IqgSmI-B.js +152 -0
- package/dist/url-utils-IqgSmI-B.js.map +1 -0
- package/dist/url-utils-vJo2ER5v.cjs +206 -0
- package/dist/url-utils-vJo2ER5v.cjs.map +1 -0
- package/dist/utils/url-utils.cjs +6 -1
- package/dist/utils/url-utils.d.cts +43 -1
- package/dist/utils/url-utils.d.cts.map +1 -1
- package/dist/utils/url-utils.d.ts +43 -1
- package/dist/utils/url-utils.d.ts.map +1 -1
- package/dist/utils/url-utils.js +2 -2
- package/dist/utils-CqbeJfE1.cjs +138 -0
- package/dist/utils-CqbeJfE1.cjs.map +1 -0
- package/dist/utils-CzV_Tz2C.d.ts +35 -0
- package/dist/utils-CzV_Tz2C.d.ts.map +1 -0
- package/dist/utils-Fm-dODdb.d.cts +35 -0
- package/dist/utils-Fm-dODdb.d.cts.map +1 -0
- package/dist/utils-OgYE-imr.js +108 -0
- package/dist/utils-OgYE-imr.js.map +1 -0
- package/dist/{version-Cp9p-38J.cjs → version-Bu9nGzm5.cjs} +2 -2
- package/dist/{version-Cp9p-38J.cjs.map → version-Bu9nGzm5.cjs.map} +1 -1
- package/dist/version-DvjTvYJs.js +6 -0
- package/dist/{version-3e1twbPm.js.map → version-DvjTvYJs.js.map} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/{whoami-m0N5F6BN.cjs → whoami-BOJHfdih.cjs} +2 -2
- package/dist/{whoami-m0N5F6BN.cjs.map → whoami-BOJHfdih.cjs.map} +1 -1
- package/dist/{whoami-DhoaHHY5.js → whoami-Bswhb72a.js} +2 -2
- package/dist/{whoami-DhoaHHY5.js.map → whoami-Bswhb72a.js.map} +1 -1
- package/dist/whoami-CoZJKpys.cjs +44 -0
- package/dist/whoami-CoZJKpys.cjs.map +1 -0
- package/dist/whoami-xBAWvzG4.js +32 -0
- package/dist/whoami-xBAWvzG4.js.map +1 -0
- package/package.json +14 -7
- package/dist/api-utils-B-9vnzoA.cjs.map +0 -1
- package/dist/api-utils-CHRiLf2Y.js.map +0 -1
- package/dist/client-C_lwH0jz.cjs.map +0 -1
- package/dist/client-D8vrUp2k.d.cts.map +0 -1
- package/dist/client-h32L1Hx5.d.ts.map +0 -1
- package/dist/client-pyNUFaLN.js.map +0 -1
- package/dist/constants-ClkMK29-.cjs.map +0 -1
- package/dist/constants-S7AU45oQ.js.map +0 -1
- package/dist/create-dsn-CEEytIa4.js.map +0 -1
- package/dist/create-dsn-CI7MSiQu.cjs.map +0 -1
- package/dist/create-project-CoV1e-vp.js.map +0 -1
- package/dist/create-project-DnLKRG1p.cjs.map +0 -1
- package/dist/find-errors-BQFHuBHi.cjs +0 -100
- package/dist/find-errors-BQFHuBHi.cjs.map +0 -1
- package/dist/find-errors-CSPsT-Jp.js +0 -94
- package/dist/find-errors-CSPsT-Jp.js.map +0 -1
- package/dist/find-issues-BG80wLZw.cjs +0 -101
- package/dist/find-issues-BG80wLZw.cjs.map +0 -1
- package/dist/find-issues-DoUD8vP0.js +0 -95
- package/dist/find-issues-DoUD8vP0.js.map +0 -1
- package/dist/find-tags-BRaa2i-r.js +0 -39
- package/dist/find-tags-BRaa2i-r.js.map +0 -1
- package/dist/find-tags-BjibTJBm.cjs +0 -45
- package/dist/find-tags-BjibTJBm.cjs.map +0 -1
- package/dist/find-transactions-B0s_rr0H.cjs +0 -89
- package/dist/find-transactions-B0s_rr0H.cjs.map +0 -1
- package/dist/find-transactions-Cob_B_3u.js +0 -83
- package/dist/find-transactions-Cob_B_3u.js.map +0 -1
- package/dist/formatting-AXU4XsjJ.cjs.map +0 -1
- package/dist/formatting-DnSI0DHf.d.ts.map +0 -1
- package/dist/formatting-WGc5qrhv.js.map +0 -1
- package/dist/formatting-aGQ7M_2w.d.cts.map +0 -1
- package/dist/get-issue-details-BrEGybe0.js.map +0 -1
- package/dist/get-issue-details-EklkHsWi.cjs.map +0 -1
- package/dist/promptDefinitions-D3GTBGLr.d.ts.map +0 -1
- package/dist/prompts-Cuwmybyc.js.map +0 -1
- package/dist/prompts-uWAbMvLe.cjs.map +0 -1
- package/dist/resources-BlgeiG6C.cjs +0 -104
- package/dist/resources-BlgeiG6C.cjs.map +0 -1
- package/dist/resources-CwWOjB8_.js +0 -92
- package/dist/resources-CwWOjB8_.js.map +0 -1
- package/dist/schema-BW_fxx99.d.cts.map +0 -1
- package/dist/schema-B_cMyyJJ.cjs.map +0 -1
- package/dist/schema-DkWOa2-c.d.ts.map +0 -1
- package/dist/schema-WDk5Yqww.js.map +0 -1
- package/dist/server-9IEGGN8V.cjs.map +0 -1
- package/dist/server-BhNrW6bw.js.map +0 -1
- package/dist/tools/find-errors.cjs +0 -12
- package/dist/tools/find-errors.d.cts +0 -18
- package/dist/tools/find-errors.d.cts.map +0 -1
- package/dist/tools/find-errors.d.ts +0 -18
- package/dist/tools/find-errors.d.ts.map +0 -1
- package/dist/tools/find-errors.js +0 -12
- package/dist/tools/find-issues.cjs +0 -12
- package/dist/tools/find-issues.d.cts +0 -16
- package/dist/tools/find-issues.d.cts.map +0 -1
- package/dist/tools/find-issues.d.ts +0 -16
- package/dist/tools/find-issues.d.ts.map +0 -1
- package/dist/tools/find-issues.js +0 -12
- package/dist/tools/find-tags.cjs +0 -12
- package/dist/tools/find-tags.d.cts +0 -13
- package/dist/tools/find-tags.d.cts.map +0 -1
- package/dist/tools/find-tags.d.ts +0 -13
- package/dist/tools/find-tags.d.ts.map +0 -1
- package/dist/tools/find-tags.js +0 -12
- package/dist/tools/find-transactions.cjs +0 -12
- package/dist/tools/find-transactions.d.cts +0 -17
- package/dist/tools/find-transactions.d.cts.map +0 -1
- package/dist/tools/find-transactions.d.ts +0 -17
- package/dist/tools/find-transactions.d.ts.map +0 -1
- package/dist/tools/find-transactions.js +0 -12
- package/dist/tools-AYbI0sEf.js +0 -48
- package/dist/tools-AYbI0sEf.js.map +0 -1
- package/dist/tools-CwQFlJzn.cjs +0 -53
- package/dist/tools-CwQFlJzn.cjs.map +0 -1
- package/dist/update-issue-ClbiTLyL.js.map +0 -1
- package/dist/update-issue-_4vzwHfZ.cjs.map +0 -1
- package/dist/url-utils-C9hykWmk.cjs +0 -106
- package/dist/url-utils-C9hykWmk.cjs.map +0 -1
- package/dist/url-utils-DvZYfzPM.js +0 -82
- package/dist/url-utils-DvZYfzPM.js.map +0 -1
- package/dist/version-3e1twbPm.js +0 -6
- /package/dist/{api-client-CL1WDkw9.cjs → api-client-BWt6M7ij.cjs} +0 -0
- /package/dist/{api-client-ChL_0F2u.js → api-client-CNv_hbPO.js} +0 -0
- /package/dist/{fetch-utils-C0F4eH6S.cjs → fetch-utils-BqMx2KQr.js} +0 -0
- /package/dist/{fetch-utils-DlPjrSk2.js → fetch-utils-DeZcERfe.cjs} +0 -0
- /package/dist/{index-DVGDAddE.d.ts → index-DE1muTvw.d.ts} +0 -0
- /package/dist/{issue-utils-BbCfbiY8.js → issue-utils-BVAB6I-Z.js} +0 -0
- /package/dist/{issue-utils-DMKiif6C.cjs → issue-utils-pdbo-5LW.cjs} +0 -0
- /package/dist/{types-CCHsZshF.js → search-events-BBFPuvRq.cjs} +0 -0
- /package/dist/{types-MYBaygjr.cjs → search-events-bV3-kK78.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UserInputError } from "./errors-D_R568zP.js";
|
|
2
2
|
import { defineTool } from "./defineTool-77H4nSna.js";
|
|
3
|
-
import { apiServiceFromContext } from "./api-utils-
|
|
4
|
-
import { ParamOrganizationSlug, ParamPlatform, ParamProjectSlug, ParamRegionUrl, ParamTeamSlug } from "./schema-
|
|
5
|
-
import { logError } from "./logging-
|
|
3
|
+
import { apiServiceFromContext } from "./api-utils-BlUSO8xh.js";
|
|
4
|
+
import { ParamOrganizationSlug, ParamPlatform, ParamProjectSlug, ParamRegionUrl, ParamTeamSlug } from "./schema-DMfkTR1l.js";
|
|
5
|
+
import { logError } from "./logging-tGU_SYcA.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { setTag } from "@sentry/core";
|
|
8
8
|
|
|
@@ -117,4 +117,4 @@ var update_project_default = defineTool({
|
|
|
117
117
|
|
|
118
118
|
//#endregion
|
|
119
119
|
export { update_project_default };
|
|
120
|
-
//# sourceMappingURL=update-project-
|
|
120
|
+
//# sourceMappingURL=update-project-C9CLxNfF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-project-
|
|
1
|
+
{"version":3,"file":"update-project-C9CLxNfF.js","names":["context: ServerContext","project: Project | undefined","updates: string[]"],"sources":["../src/tools/update-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport type { Project } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n ParamPlatform,\n ParamTeamSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_project\",\n description: [\n \"Update project settings in Sentry, such as name, slug, platform, and team assignment.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Update a project's name or slug to fix onboarding mistakes\",\n \"- Change the platform assigned to a project\",\n \"- Update team assignment for a project\",\n \"\",\n \"<examples>\",\n \"### Update a project's name and slug\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='old-project', name='New Project Name', slug='new-project-slug')\",\n \"```\",\n \"\",\n \"### Assign a project to a different team\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', teamSlug='backend-team')\",\n \"```\",\n \"\",\n \"### Update platform\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', platform='python')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- Team assignment is handled separately from other project settings\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"- When updating the slug, the project will be accessible at the new slug after the update\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z.string().trim().describe(\"The new name for the project\").optional(),\n slug: z\n .string()\n .toLowerCase()\n .trim()\n .describe(\"The new slug for the project (must be unique)\")\n .optional(),\n platform: ParamPlatform.optional(),\n teamSlug: ParamTeamSlug.optional().describe(\n \"The team to assign this project to. Note: this will replace the current team assignment.\",\n ),\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 // Handle team assignment separately if provided\n if (params.teamSlug) {\n setTag(\"team.slug\", params.teamSlug);\n try {\n await apiService.addTeamToProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n teamSlug: params.teamSlug,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to assign team ${params.teamSlug} to project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n }\n\n // Update project settings if any are provided\n const hasProjectUpdates = params.name || params.slug || params.platform;\n\n let project: Project | undefined;\n if (hasProjectUpdates) {\n try {\n project = await apiService.updateProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n slug: params.slug,\n platform: params.platform,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to update project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n } else {\n // If only team assignment, fetch current project data for display\n const projects = await apiService.listProjects(organizationSlug);\n project = projects.find((p) => p.slug === params.projectSlug);\n if (!project) {\n throw new UserInputError(`Project ${params.projectSlug} not found`);\n }\n }\n\n let output = `# Updated Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (project.platform) {\n output += `**Platform**: ${project.platform}\\n`;\n }\n\n // Display what was updated\n const updates: string[] = [];\n if (params.name) updates.push(`name to \"${params.name}\"`);\n if (params.slug) updates.push(`slug to \"${params.slug}\"`);\n if (params.platform) updates.push(`platform to \"${params.platform}\"`);\n if (params.teamSlug)\n updates.push(`team assignment to \"${params.teamSlug}\"`);\n\n if (updates.length > 0) {\n output += `\\n## Updates Applied\\n`;\n output += updates.map((update) => `- Updated ${update}`).join(\"\\n\");\n output += `\\n`;\n }\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The project is now accessible at slug: \\`${project.slug}\\`\\n`;\n if (params.teamSlug) {\n output += `- The project is now assigned to the \\`${params.teamSlug}\\` team\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;;AAgBA,6BAAe,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;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,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,+BAA+B,CAAC,UAAU;EAC3E,MAAM,EACH,QAAQ,CACR,aAAa,CACb,MAAM,CACN,SAAS,gDAAgD,CACzD,UAAU;EACb,UAAU,cAAc,UAAU;EAClC,UAAU,cAAc,UAAU,CAAC,SACjC,2FACD;CACF;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;AAG1C,MAAI,OAAO,UAAU;AACnB,UAAO,aAAa,OAAO,SAAS;AACpC,OAAI;AACF,UAAM,WAAW,iBAAiB;KAChC;KACA,aAAa,OAAO;KACpB,UAAU,OAAO;IAClB,EAAC;GACH,SAAQ,KAAK;AACZ,aAAS,IAAI;AACb,UAAM,IAAI,OACP,wBAAwB,OAAO,SAAS,cAAc,OAAO,YAAY,IAAI,eAAe,QAAQ,IAAI,UAAU;GAEtH;EACF;EAGD,MAAM,oBAAoB,OAAO,QAAQ,OAAO,QAAQ,OAAO;EAE/D,IAAIC;AACJ,MAAI,kBACF,KAAI;AACF,aAAU,MAAM,WAAW,cAAc;IACvC;IACA,aAAa,OAAO;IACpB,MAAM,OAAO;IACb,MAAM,OAAO;IACb,UAAU,OAAO;GAClB,EAAC;EACH,SAAQ,KAAK;AACZ,YAAS,IAAI;AACb,SAAM,IAAI,OACP,2BAA2B,OAAO,YAAY,IAAI,eAAe,QAAQ,IAAI,UAAU;EAE3F;OACI;GAEL,MAAM,WAAW,MAAM,WAAW,aAAa,iBAAiB;AAChE,aAAU,SAAS,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO,YAAY;AAC7D,QAAK,QACH,OAAM,IAAI,gBAAgB,UAAU,OAAO,YAAY;EAE1D;EAED,IAAI,UAAU,yBAAyB,iBAAiB;AACxD,aAAW,UAAU,QAAQ,GAAG;AAChC,aAAW,YAAY,QAAQ,KAAK;AACpC,aAAW,YAAY,QAAQ,KAAK;AACpC,MAAI,QAAQ,SACV,YAAW,gBAAgB,QAAQ,SAAS;EAI9C,MAAMC,UAAoB,CAAE;AAC5B,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,SAAU,SAAQ,MAAM,eAAe,OAAO,SAAS,GAAG;AACrE,MAAI,OAAO,SACT,SAAQ,MAAM,sBAAsB,OAAO,SAAS,GAAG;AAEzD,MAAI,QAAQ,SAAS,GAAG;AACtB,cAAW;AACX,aAAU,QAAQ,IAAI,CAAC,YAAY,YAAY,SAAS,CAAC,KAAK,KAAK;AACnE,cAAW;EACZ;AAED,YAAU;AACV,aAAW,6CAA6C,QAAQ,KAAK;AACrE,MAAI,OAAO,SACT,YAAW,yCAAyC,OAAO,SAAS;AAEtE,SAAO;CACR;AACF,EAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
2
|
const require_errors = require('./errors-BtJEw2Z-.cjs');
|
|
3
3
|
const require_defineTool = require('./defineTool-lWNTzWl_.cjs');
|
|
4
|
-
const require_api_utils = require('./api-utils-
|
|
5
|
-
const require_schema = require('./schema-
|
|
6
|
-
const require_logging = require('./logging-
|
|
4
|
+
const require_api_utils = require('./api-utils-DFWUfQ83.cjs');
|
|
5
|
+
const require_schema = require('./schema-BL3kwfOA.cjs');
|
|
6
|
+
const require_logging = require('./logging-BpL53bY6.cjs');
|
|
7
7
|
const zod = require_chunk.__toESM(require("zod"));
|
|
8
8
|
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
9
9
|
|
|
@@ -123,4 +123,4 @@ Object.defineProperty(exports, 'update_project_default', {
|
|
|
123
123
|
return update_project_default;
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
-
//# sourceMappingURL=update-project-
|
|
126
|
+
//# sourceMappingURL=update-project-DQu5PnE3.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-project-
|
|
1
|
+
{"version":3,"file":"update-project-DQu5PnE3.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext","project: Project | undefined","UserInputError","updates: string[]"],"sources":["../src/tools/update-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport type { Project } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n ParamPlatform,\n ParamTeamSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"update_project\",\n description: [\n \"Update project settings in Sentry, such as name, slug, platform, and team assignment.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Update a project's name or slug to fix onboarding mistakes\",\n \"- Change the platform assigned to a project\",\n \"- Update team assignment for a project\",\n \"\",\n \"<examples>\",\n \"### Update a project's name and slug\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='old-project', name='New Project Name', slug='new-project-slug')\",\n \"```\",\n \"\",\n \"### Assign a project to a different team\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', teamSlug='backend-team')\",\n \"```\",\n \"\",\n \"### Update platform\",\n \"\",\n \"```\",\n \"update_project(organizationSlug='my-organization', projectSlug='my-project', platform='python')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, it's likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- Team assignment is handled separately from other project settings\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"- When updating the slug, the project will be accessible at the new slug after the update\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n name: z.string().trim().describe(\"The new name for the project\").optional(),\n slug: z\n .string()\n .toLowerCase()\n .trim()\n .describe(\"The new slug for the project (must be unique)\")\n .optional(),\n platform: ParamPlatform.optional(),\n teamSlug: ParamTeamSlug.optional().describe(\n \"The team to assign this project to. Note: this will replace the current team assignment.\",\n ),\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 // Handle team assignment separately if provided\n if (params.teamSlug) {\n setTag(\"team.slug\", params.teamSlug);\n try {\n await apiService.addTeamToProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n teamSlug: params.teamSlug,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to assign team ${params.teamSlug} to project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n }\n\n // Update project settings if any are provided\n const hasProjectUpdates = params.name || params.slug || params.platform;\n\n let project: Project | undefined;\n if (hasProjectUpdates) {\n try {\n project = await apiService.updateProject({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n slug: params.slug,\n platform: params.platform,\n });\n } catch (err) {\n logError(err);\n throw new Error(\n `Failed to update project ${params.projectSlug}: ${err instanceof Error ? err.message : \"Unknown error\"}`,\n );\n }\n } else {\n // If only team assignment, fetch current project data for display\n const projects = await apiService.listProjects(organizationSlug);\n project = projects.find((p) => p.slug === params.projectSlug);\n if (!project) {\n throw new UserInputError(`Project ${params.projectSlug} not found`);\n }\n }\n\n let output = `# Updated Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (project.platform) {\n output += `**Platform**: ${project.platform}\\n`;\n }\n\n // Display what was updated\n const updates: string[] = [];\n if (params.name) updates.push(`name to \"${params.name}\"`);\n if (params.slug) updates.push(`slug to \"${params.slug}\"`);\n if (params.platform) updates.push(`platform to \"${params.platform}\"`);\n if (params.teamSlug)\n updates.push(`team assignment to \"${params.teamSlug}\"`);\n\n if (updates.length > 0) {\n output += `\\n## Updates Applied\\n`;\n output += updates.map((update) => `- Updated ${update}`).join(\"\\n\");\n output += `\\n`;\n }\n\n output += \"\\n# Using this information\\n\\n\";\n output += `- The project is now accessible at slug: \\`${project.slug}\\`\\n`;\n if (params.teamSlug) {\n output += `- The project is now assigned to the \\`${params.teamSlug}\\` team\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;;;AAgBA,6BAAe,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;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,MAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,+BAA+B,CAAC,UAAU;EAC3E,MAAM,MACH,QAAQ,CACR,aAAa,CACb,MAAM,CACN,SAAS,gDAAgD,CACzD,UAAU;EACb,UAAU,6BAAc,UAAU;EAClC,UAAU,6BAAc,UAAU,CAAC,SACjC,2FACD;CACF;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;AAG1C,MAAI,OAAO,UAAU;AACnB,6BAAO,aAAa,OAAO,SAAS;AACpC,OAAI;AACF,UAAM,WAAW,iBAAiB;KAChC;KACA,aAAa,OAAO;KACpB,UAAU,OAAO;IAClB,EAAC;GACH,SAAQ,KAAK;AACZ,6BAAS,IAAI;AACb,UAAM,IAAI,OACP,wBAAwB,OAAO,SAAS,cAAc,OAAO,YAAY,IAAI,eAAe,QAAQ,IAAI,UAAU;GAEtH;EACF;EAGD,MAAM,oBAAoB,OAAO,QAAQ,OAAO,QAAQ,OAAO;EAE/D,IAAIC;AACJ,MAAI,kBACF,KAAI;AACF,aAAU,MAAM,WAAW,cAAc;IACvC;IACA,aAAa,OAAO;IACpB,MAAM,OAAO;IACb,MAAM,OAAO;IACb,UAAU,OAAO;GAClB,EAAC;EACH,SAAQ,KAAK;AACZ,4BAAS,IAAI;AACb,SAAM,IAAI,OACP,2BAA2B,OAAO,YAAY,IAAI,eAAe,QAAQ,IAAI,UAAU;EAE3F;OACI;GAEL,MAAM,WAAW,MAAM,WAAW,aAAa,iBAAiB;AAChE,aAAU,SAAS,KAAK,CAAC,MAAM,EAAE,SAAS,OAAO,YAAY;AAC7D,QAAK,QACH,OAAM,IAAIC,+BAAgB,UAAU,OAAO,YAAY;EAE1D;EAED,IAAI,UAAU,yBAAyB,iBAAiB;AACxD,aAAW,UAAU,QAAQ,GAAG;AAChC,aAAW,YAAY,QAAQ,KAAK;AACpC,aAAW,YAAY,QAAQ,KAAK;AACpC,MAAI,QAAQ,SACV,YAAW,gBAAgB,QAAQ,SAAS;EAI9C,MAAMC,UAAoB,CAAE;AAC5B,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,KAAM,SAAQ,MAAM,WAAW,OAAO,KAAK,GAAG;AACzD,MAAI,OAAO,SAAU,SAAQ,MAAM,eAAe,OAAO,SAAS,GAAG;AACrE,MAAI,OAAO,SACT,SAAQ,MAAM,sBAAsB,OAAO,SAAS,GAAG;AAEzD,MAAI,QAAQ,SAAS,GAAG;AACtB,cAAW;AACX,aAAU,QAAQ,IAAI,CAAC,YAAY,YAAY,SAAS,CAAC,KAAK,KAAK;AACnE,cAAW;EACZ;AAED,YAAU;AACV,aAAW,6CAA6C,QAAQ,KAAK;AACrE,MAAI,OAAO,SACT,YAAW,yCAAyC,OAAO,SAAS;AAEtE,SAAO;CACR;AACF,EAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//#region src/utils/url-utils.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if a Sentry instance is SaaS or self-hosted based on the host.
|
|
4
|
+
* @param host The Sentry host (e.g., "sentry.io" or "sentry.company.com")
|
|
5
|
+
* @returns true if SaaS instance, false if self-hosted
|
|
6
|
+
*/
|
|
7
|
+
function isSentryHost(host) {
|
|
8
|
+
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generates a Sentry issue URL.
|
|
12
|
+
* @param host The Sentry host
|
|
13
|
+
* @param organizationSlug Organization identifier
|
|
14
|
+
* @param issueId Issue identifier (e.g., "PROJECT-123")
|
|
15
|
+
* @returns The complete issue URL
|
|
16
|
+
*/
|
|
17
|
+
function getIssueUrl(host, organizationSlug, issueId) {
|
|
18
|
+
const isSaas = isSentryHost(host);
|
|
19
|
+
return isSaas ? `https://${organizationSlug}.${host}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Generates a Sentry issues search URL.
|
|
23
|
+
* @param host The Sentry host
|
|
24
|
+
* @param organizationSlug Organization identifier
|
|
25
|
+
* @param query Optional search query
|
|
26
|
+
* @param projectSlugOrId Optional project slug or ID
|
|
27
|
+
* @returns The complete issues search URL
|
|
28
|
+
*/
|
|
29
|
+
function getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {
|
|
30
|
+
const isSaas = isSentryHost(host);
|
|
31
|
+
let url = isSaas ? `https://${organizationSlug}.${host}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;
|
|
32
|
+
const params = new URLSearchParams();
|
|
33
|
+
if (projectSlugOrId) params.append("project", projectSlugOrId);
|
|
34
|
+
if (query) params.append("query", query);
|
|
35
|
+
const queryString = params.toString();
|
|
36
|
+
if (queryString) url += `?${queryString}`;
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Generates a Sentry trace URL for performance investigation.
|
|
41
|
+
* @param host The Sentry host
|
|
42
|
+
* @param organizationSlug Organization identifier
|
|
43
|
+
* @param traceId Trace identifier
|
|
44
|
+
* @returns The complete trace URL
|
|
45
|
+
*/
|
|
46
|
+
function getTraceUrl(host, organizationSlug, traceId) {
|
|
47
|
+
const isSaas = isSentryHost(host);
|
|
48
|
+
return isSaas ? `https://${organizationSlug}.${host}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Generates a Sentry events explorer URL.
|
|
52
|
+
* @param host The Sentry host
|
|
53
|
+
* @param organizationSlug Organization identifier
|
|
54
|
+
* @param query Search query
|
|
55
|
+
* @param dataset Dataset type
|
|
56
|
+
* @param projectSlug Optional project slug
|
|
57
|
+
* @param fields Optional fields to display
|
|
58
|
+
* @returns The complete events explorer URL
|
|
59
|
+
*/
|
|
60
|
+
function getEventsExplorerUrl(host, organizationSlug, query, dataset = "spans", projectSlug, fields) {
|
|
61
|
+
const isSaas = isSentryHost(host);
|
|
62
|
+
let url = isSaas ? `https://${organizationSlug}.${host}/explore/` : `https://${host}/organizations/${organizationSlug}/explore/`;
|
|
63
|
+
const params = new URLSearchParams();
|
|
64
|
+
params.append("query", query);
|
|
65
|
+
params.append("dataset", dataset);
|
|
66
|
+
params.append("layout", "table");
|
|
67
|
+
if (projectSlug) params.append("project", projectSlug);
|
|
68
|
+
if (fields && fields.length > 0) for (const field of fields) params.append("field", field);
|
|
69
|
+
url += `?${params.toString()}`;
|
|
70
|
+
return url;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).
|
|
74
|
+
* Throws an error if validation fails instead of exiting the process.
|
|
75
|
+
*
|
|
76
|
+
* @param host The hostname to validate
|
|
77
|
+
* @throws {Error} If the host contains a protocol
|
|
78
|
+
*/
|
|
79
|
+
function _validateSentryHostInternal(host) {
|
|
80
|
+
if (host.startsWith("http://") || host.startsWith("https://")) throw new Error("SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.");
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
84
|
+
* Throws an error if validation fails instead of exiting the process.
|
|
85
|
+
*
|
|
86
|
+
* @param url The HTTPS URL to validate and parse
|
|
87
|
+
* @returns The extracted hostname from the URL
|
|
88
|
+
* @throws {Error} If the URL is invalid or not HTTPS
|
|
89
|
+
*/
|
|
90
|
+
function _validateAndParseSentryUrlInternal(url) {
|
|
91
|
+
if (!url.startsWith("https://")) throw new Error("SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).");
|
|
92
|
+
try {
|
|
93
|
+
const parsedUrl = new URL(url);
|
|
94
|
+
return parsedUrl.host;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
throw new Error("SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).");
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
101
|
+
* Exits the process with error code 1 if validation fails (CLI behavior).
|
|
102
|
+
*
|
|
103
|
+
* @param host The hostname to validate
|
|
104
|
+
*/
|
|
105
|
+
function validateSentryHost(host) {
|
|
106
|
+
try {
|
|
107
|
+
_validateSentryHostInternal(host);
|
|
108
|
+
} catch (error) {
|
|
109
|
+
console.error(`Error: ${error.message}`);
|
|
110
|
+
process.exit(1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
115
|
+
* Exits the process with error code 1 if validation fails (CLI behavior).
|
|
116
|
+
*
|
|
117
|
+
* @param url The HTTPS URL to validate and parse
|
|
118
|
+
* @returns The extracted hostname from the URL
|
|
119
|
+
*/
|
|
120
|
+
function validateAndParseSentryUrl(url) {
|
|
121
|
+
try {
|
|
122
|
+
return _validateAndParseSentryUrlInternal(url);
|
|
123
|
+
} catch (error) {
|
|
124
|
+
console.error(`Error: ${error.message}`);
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
130
|
+
* Throws an error instead of exiting the process (for testing).
|
|
131
|
+
*
|
|
132
|
+
* @param host The hostname to validate
|
|
133
|
+
* @throws {Error} If the host contains a protocol
|
|
134
|
+
*/
|
|
135
|
+
function validateSentryHostThrows(host) {
|
|
136
|
+
_validateSentryHostInternal(host);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
140
|
+
* Throws an error instead of exiting the process (for testing).
|
|
141
|
+
*
|
|
142
|
+
* @param url The HTTPS URL to validate and parse
|
|
143
|
+
* @returns The extracted hostname from the URL
|
|
144
|
+
* @throws {Error} If the URL is invalid or not HTTPS
|
|
145
|
+
*/
|
|
146
|
+
function validateAndParseSentryUrlThrows(url) {
|
|
147
|
+
return _validateAndParseSentryUrlInternal(url);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
export { getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateSentryHost, validateSentryHostThrows };
|
|
152
|
+
//# sourceMappingURL=url-utils-IqgSmI-B.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-utils-IqgSmI-B.js","names":["host: string","organizationSlug: string","issueId: string","query?: string","projectSlugOrId?: string","traceId: string","query: string","dataset: \"spans\" | \"errors\" | \"logs\"","projectSlug?: string","fields?: string[]","url: string"],"sources":["../src/utils/url-utils.ts"],"sourcesContent":["/**\n * Determines if a Sentry instance is SaaS or self-hosted based on the host.\n * @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n * @returns true if SaaS instance, false if self-hosted\n */\nexport function isSentryHost(host: string): boolean {\n return host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\n\n/**\n * Generates a Sentry issue URL.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param issueId Issue identifier (e.g., \"PROJECT-123\")\n * @returns The complete issue URL\n */\nexport function getIssueUrl(\n host: string,\n organizationSlug: string,\n issueId: string,\n): string {\n const isSaas = isSentryHost(host);\n return isSaas\n ? `https://${organizationSlug}.${host}/issues/${issueId}`\n : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;\n}\n\n/**\n * Generates a Sentry issues search URL.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param query Optional search query\n * @param projectSlugOrId Optional project slug or ID\n * @returns The complete issues search URL\n */\nexport function getIssuesSearchUrl(\n host: string,\n organizationSlug: string,\n query?: string,\n projectSlugOrId?: string,\n): string {\n const isSaas = isSentryHost(host);\n let url = isSaas\n ? `https://${organizationSlug}.${host}/issues/`\n : `https://${host}/organizations/${organizationSlug}/issues/`;\n\n const params = new URLSearchParams();\n if (projectSlugOrId) {\n params.append(\"project\", projectSlugOrId);\n }\n if (query) {\n params.append(\"query\", query);\n }\n\n const queryString = params.toString();\n if (queryString) {\n url += `?${queryString}`;\n }\n\n return url;\n}\n\n/**\n * Generates a Sentry trace URL for performance investigation.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param traceId Trace identifier\n * @returns The complete trace URL\n */\nexport function getTraceUrl(\n host: string,\n organizationSlug: string,\n traceId: string,\n): string {\n const isSaas = isSentryHost(host);\n return isSaas\n ? `https://${organizationSlug}.${host}/explore/traces/trace/${traceId}`\n : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n}\n\n/**\n * Generates a Sentry events explorer URL.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param query Search query\n * @param dataset Dataset type\n * @param projectSlug Optional project slug\n * @param fields Optional fields to display\n * @returns The complete events explorer URL\n */\nexport function getEventsExplorerUrl(\n host: string,\n organizationSlug: string,\n query: string,\n dataset: \"spans\" | \"errors\" | \"logs\" = \"spans\",\n projectSlug?: string,\n fields?: string[],\n): string {\n const isSaas = isSentryHost(host);\n let url = isSaas\n ? `https://${organizationSlug}.${host}/explore/`\n : `https://${host}/organizations/${organizationSlug}/explore/`;\n\n const params = new URLSearchParams();\n params.append(\"query\", query);\n params.append(\"dataset\", dataset);\n params.append(\"layout\", \"table\");\n\n if (projectSlug) {\n params.append(\"project\", projectSlug);\n }\n\n if (fields && fields.length > 0) {\n for (const field of fields) {\n params.append(\"field\", field);\n }\n }\n\n url += `?${params.toString()}`;\n return url;\n}\n\n/**\n * Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n * Throws an error if validation fails instead of exiting the process.\n *\n * @param host The hostname to validate\n * @throws {Error} If the host contains a protocol\n */\nfunction _validateSentryHostInternal(host: string): void {\n if (host.startsWith(\"http://\") || host.startsWith(\"https://\")) {\n throw new Error(\n \"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\",\n );\n }\n}\n\n/**\n * Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n * Throws an error if validation fails instead of exiting the process.\n *\n * @param url The HTTPS URL to validate and parse\n * @returns The extracted hostname from the URL\n * @throws {Error} If the URL is invalid or not HTTPS\n */\nfunction _validateAndParseSentryUrlInternal(url: string): string {\n if (!url.startsWith(\"https://\")) {\n throw new Error(\n \"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\",\n );\n }\n\n try {\n const parsedUrl = new URL(url);\n return parsedUrl.host;\n } catch (error) {\n throw new Error(\n \"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\",\n );\n }\n}\n\n/**\n * Validates that a SENTRY_HOST value contains only hostname (no protocol).\n * Exits the process with error code 1 if validation fails (CLI behavior).\n *\n * @param host The hostname to validate\n */\nexport function validateSentryHost(host: string): void {\n try {\n _validateSentryHostInternal(host);\n } catch (error) {\n console.error(`Error: ${(error as Error).message}`);\n process.exit(1);\n }\n}\n\n/**\n * Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n * Exits the process with error code 1 if validation fails (CLI behavior).\n *\n * @param url The HTTPS URL to validate and parse\n * @returns The extracted hostname from the URL\n */\nexport function validateAndParseSentryUrl(url: string): string {\n try {\n return _validateAndParseSentryUrlInternal(url);\n } catch (error) {\n console.error(`Error: ${(error as Error).message}`);\n process.exit(1);\n }\n}\n\n/**\n * Validates that a SENTRY_HOST value contains only hostname (no protocol).\n * Throws an error instead of exiting the process (for testing).\n *\n * @param host The hostname to validate\n * @throws {Error} If the host contains a protocol\n */\nexport function validateSentryHostThrows(host: string): void {\n _validateSentryHostInternal(host);\n}\n\n/**\n * Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n * Throws an error instead of exiting the process (for testing).\n *\n * @param url The HTTPS URL to validate and parse\n * @returns The extracted hostname from the URL\n * @throws {Error} If the URL is invalid or not HTTPS\n */\nexport function validateAndParseSentryUrlThrows(url: string): string {\n return _validateAndParseSentryUrlInternal(url);\n}\n"],"mappings":";;;;;;AAKA,SAAgB,aAAaA,MAAuB;AAClD,QAAO,SAAS,eAAe,KAAK,SAAS,aAAa;AAC3D;;;;;;;;AASD,SAAgB,YACdA,MACAC,kBACAC,SACQ;CACR,MAAM,SAAS,aAAa,KAAK;AACjC,QAAO,UACF,UAAU,iBAAiB,GAAG,KAAK,UAAU,aAC7C,UAAU,KAAK,iBAAiB,iBAAiB,UAAU;AACjE;;;;;;;;;AAUD,SAAgB,mBACdF,MACAC,kBACAE,OACAC,iBACQ;CACR,MAAM,SAAS,aAAa,KAAK;CACjC,IAAI,MAAM,UACL,UAAU,iBAAiB,GAAG,KAAK,aACnC,UAAU,KAAK,iBAAiB,iBAAiB;CAEtD,MAAM,SAAS,IAAI;AACnB,KAAI,gBACF,QAAO,OAAO,WAAW,gBAAgB;AAE3C,KAAI,MACF,QAAO,OAAO,SAAS,MAAM;CAG/B,MAAM,cAAc,OAAO,UAAU;AACrC,KAAI,YACF,SAAQ,GAAG;AAGb,QAAO;AACR;;;;;;;;AASD,SAAgB,YACdJ,MACAC,kBACAI,SACQ;CACR,MAAM,SAAS,aAAa,KAAK;AACjC,QAAO,UACF,UAAU,iBAAiB,GAAG,KAAK,wBAAwB,aAC3D,UAAU,KAAK,iBAAiB,iBAAiB,wBAAwB;AAC/E;;;;;;;;;;;AAYD,SAAgB,qBACdL,MACAC,kBACAK,OACAC,UAAuC,SACvCC,aACAC,QACQ;CACR,MAAM,SAAS,aAAa,KAAK;CACjC,IAAI,MAAM,UACL,UAAU,iBAAiB,GAAG,KAAK,cACnC,UAAU,KAAK,iBAAiB,iBAAiB;CAEtD,MAAM,SAAS,IAAI;AACnB,QAAO,OAAO,SAAS,MAAM;AAC7B,QAAO,OAAO,WAAW,QAAQ;AACjC,QAAO,OAAO,UAAU,QAAQ;AAEhC,KAAI,YACF,QAAO,OAAO,WAAW,YAAY;AAGvC,KAAI,UAAU,OAAO,SAAS,EAC5B,MAAK,MAAM,SAAS,OAClB,QAAO,OAAO,SAAS,MAAM;AAIjC,SAAQ,GAAG,OAAO,UAAU;AAC5B,QAAO;AACR;;;;;;;;AASD,SAAS,4BAA4BT,MAAoB;AACvD,KAAI,KAAK,WAAW,UAAU,IAAI,KAAK,WAAW,WAAW,CAC3D,OAAM,IAAI,MACR;AAGL;;;;;;;;;AAUD,SAAS,mCAAmCU,KAAqB;AAC/D,MAAK,IAAI,WAAW,WAAW,CAC7B,OAAM,IAAI,MACR;AAIJ,KAAI;EACF,MAAM,YAAY,IAAI,IAAI;AAC1B,SAAO,UAAU;CAClB,SAAQ,OAAO;AACd,QAAM,IAAI,MACR;CAEH;AACF;;;;;;;AAQD,SAAgB,mBAAmBV,MAAoB;AACrD,KAAI;AACF,8BAA4B,KAAK;CAClC,SAAQ,OAAO;AACd,UAAQ,OAAO,SAAU,MAAgB,UAAU;AACnD,UAAQ,KAAK,EAAE;CAChB;AACF;;;;;;;;AASD,SAAgB,0BAA0BU,KAAqB;AAC7D,KAAI;AACF,SAAO,mCAAmC,IAAI;CAC/C,SAAQ,OAAO;AACd,UAAQ,OAAO,SAAU,MAAgB,UAAU;AACnD,UAAQ,KAAK,EAAE;CAChB;AACF;;;;;;;;AASD,SAAgB,yBAAyBV,MAAoB;AAC3D,6BAA4B,KAAK;AAClC;;;;;;;;;AAUD,SAAgB,gCAAgCU,KAAqB;AACnE,QAAO,mCAAmC,IAAI;AAC/C"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils/url-utils.ts
|
|
3
|
+
/**
|
|
4
|
+
* Determines if a Sentry instance is SaaS or self-hosted based on the host.
|
|
5
|
+
* @param host The Sentry host (e.g., "sentry.io" or "sentry.company.com")
|
|
6
|
+
* @returns true if SaaS instance, false if self-hosted
|
|
7
|
+
*/
|
|
8
|
+
function isSentryHost(host) {
|
|
9
|
+
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Generates a Sentry issue URL.
|
|
13
|
+
* @param host The Sentry host
|
|
14
|
+
* @param organizationSlug Organization identifier
|
|
15
|
+
* @param issueId Issue identifier (e.g., "PROJECT-123")
|
|
16
|
+
* @returns The complete issue URL
|
|
17
|
+
*/
|
|
18
|
+
function getIssueUrl(host, organizationSlug, issueId) {
|
|
19
|
+
const isSaas = isSentryHost(host);
|
|
20
|
+
return isSaas ? `https://${organizationSlug}.${host}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generates a Sentry issues search URL.
|
|
24
|
+
* @param host The Sentry host
|
|
25
|
+
* @param organizationSlug Organization identifier
|
|
26
|
+
* @param query Optional search query
|
|
27
|
+
* @param projectSlugOrId Optional project slug or ID
|
|
28
|
+
* @returns The complete issues search URL
|
|
29
|
+
*/
|
|
30
|
+
function getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {
|
|
31
|
+
const isSaas = isSentryHost(host);
|
|
32
|
+
let url = isSaas ? `https://${organizationSlug}.${host}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;
|
|
33
|
+
const params = new URLSearchParams();
|
|
34
|
+
if (projectSlugOrId) params.append("project", projectSlugOrId);
|
|
35
|
+
if (query) params.append("query", query);
|
|
36
|
+
const queryString = params.toString();
|
|
37
|
+
if (queryString) url += `?${queryString}`;
|
|
38
|
+
return url;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Generates a Sentry trace URL for performance investigation.
|
|
42
|
+
* @param host The Sentry host
|
|
43
|
+
* @param organizationSlug Organization identifier
|
|
44
|
+
* @param traceId Trace identifier
|
|
45
|
+
* @returns The complete trace URL
|
|
46
|
+
*/
|
|
47
|
+
function getTraceUrl(host, organizationSlug, traceId) {
|
|
48
|
+
const isSaas = isSentryHost(host);
|
|
49
|
+
return isSaas ? `https://${organizationSlug}.${host}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Generates a Sentry events explorer URL.
|
|
53
|
+
* @param host The Sentry host
|
|
54
|
+
* @param organizationSlug Organization identifier
|
|
55
|
+
* @param query Search query
|
|
56
|
+
* @param dataset Dataset type
|
|
57
|
+
* @param projectSlug Optional project slug
|
|
58
|
+
* @param fields Optional fields to display
|
|
59
|
+
* @returns The complete events explorer URL
|
|
60
|
+
*/
|
|
61
|
+
function getEventsExplorerUrl(host, organizationSlug, query, dataset = "spans", projectSlug, fields) {
|
|
62
|
+
const isSaas = isSentryHost(host);
|
|
63
|
+
let url = isSaas ? `https://${organizationSlug}.${host}/explore/` : `https://${host}/organizations/${organizationSlug}/explore/`;
|
|
64
|
+
const params = new URLSearchParams();
|
|
65
|
+
params.append("query", query);
|
|
66
|
+
params.append("dataset", dataset);
|
|
67
|
+
params.append("layout", "table");
|
|
68
|
+
if (projectSlug) params.append("project", projectSlug);
|
|
69
|
+
if (fields && fields.length > 0) for (const field of fields) params.append("field", field);
|
|
70
|
+
url += `?${params.toString()}`;
|
|
71
|
+
return url;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).
|
|
75
|
+
* Throws an error if validation fails instead of exiting the process.
|
|
76
|
+
*
|
|
77
|
+
* @param host The hostname to validate
|
|
78
|
+
* @throws {Error} If the host contains a protocol
|
|
79
|
+
*/
|
|
80
|
+
function _validateSentryHostInternal(host) {
|
|
81
|
+
if (host.startsWith("http://") || host.startsWith("https://")) throw new Error("SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.");
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
85
|
+
* Throws an error if validation fails instead of exiting the process.
|
|
86
|
+
*
|
|
87
|
+
* @param url The HTTPS URL to validate and parse
|
|
88
|
+
* @returns The extracted hostname from the URL
|
|
89
|
+
* @throws {Error} If the URL is invalid or not HTTPS
|
|
90
|
+
*/
|
|
91
|
+
function _validateAndParseSentryUrlInternal(url) {
|
|
92
|
+
if (!url.startsWith("https://")) throw new Error("SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).");
|
|
93
|
+
try {
|
|
94
|
+
const parsedUrl = new URL(url);
|
|
95
|
+
return parsedUrl.host;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
throw new Error("SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
102
|
+
* Exits the process with error code 1 if validation fails (CLI behavior).
|
|
103
|
+
*
|
|
104
|
+
* @param host The hostname to validate
|
|
105
|
+
*/
|
|
106
|
+
function validateSentryHost(host) {
|
|
107
|
+
try {
|
|
108
|
+
_validateSentryHostInternal(host);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error(`Error: ${error.message}`);
|
|
111
|
+
process.exit(1);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
116
|
+
* Exits the process with error code 1 if validation fails (CLI behavior).
|
|
117
|
+
*
|
|
118
|
+
* @param url The HTTPS URL to validate and parse
|
|
119
|
+
* @returns The extracted hostname from the URL
|
|
120
|
+
*/
|
|
121
|
+
function validateAndParseSentryUrl(url) {
|
|
122
|
+
try {
|
|
123
|
+
return _validateAndParseSentryUrlInternal(url);
|
|
124
|
+
} catch (error) {
|
|
125
|
+
console.error(`Error: ${error.message}`);
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
131
|
+
* Throws an error instead of exiting the process (for testing).
|
|
132
|
+
*
|
|
133
|
+
* @param host The hostname to validate
|
|
134
|
+
* @throws {Error} If the host contains a protocol
|
|
135
|
+
*/
|
|
136
|
+
function validateSentryHostThrows(host) {
|
|
137
|
+
_validateSentryHostInternal(host);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
141
|
+
* Throws an error instead of exiting the process (for testing).
|
|
142
|
+
*
|
|
143
|
+
* @param url The HTTPS URL to validate and parse
|
|
144
|
+
* @returns The extracted hostname from the URL
|
|
145
|
+
* @throws {Error} If the URL is invalid or not HTTPS
|
|
146
|
+
*/
|
|
147
|
+
function validateAndParseSentryUrlThrows(url) {
|
|
148
|
+
return _validateAndParseSentryUrlInternal(url);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
Object.defineProperty(exports, 'getEventsExplorerUrl', {
|
|
153
|
+
enumerable: true,
|
|
154
|
+
get: function () {
|
|
155
|
+
return getEventsExplorerUrl;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, 'getIssueUrl', {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function () {
|
|
161
|
+
return getIssueUrl;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(exports, 'getIssuesSearchUrl', {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () {
|
|
167
|
+
return getIssuesSearchUrl;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(exports, 'getTraceUrl', {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: function () {
|
|
173
|
+
return getTraceUrl;
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
Object.defineProperty(exports, 'isSentryHost', {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
get: function () {
|
|
179
|
+
return isSentryHost;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(exports, 'validateAndParseSentryUrl', {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function () {
|
|
185
|
+
return validateAndParseSentryUrl;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
Object.defineProperty(exports, 'validateAndParseSentryUrlThrows', {
|
|
189
|
+
enumerable: true,
|
|
190
|
+
get: function () {
|
|
191
|
+
return validateAndParseSentryUrlThrows;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(exports, 'validateSentryHost', {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function () {
|
|
197
|
+
return validateSentryHost;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
Object.defineProperty(exports, 'validateSentryHostThrows', {
|
|
201
|
+
enumerable: true,
|
|
202
|
+
get: function () {
|
|
203
|
+
return validateSentryHostThrows;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
//# sourceMappingURL=url-utils-vJo2ER5v.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-utils-vJo2ER5v.cjs","names":["host: string","organizationSlug: string","issueId: string","query?: string","projectSlugOrId?: string","traceId: string","query: string","dataset: \"spans\" | \"errors\" | \"logs\"","projectSlug?: string","fields?: string[]","url: string"],"sources":["../src/utils/url-utils.ts"],"sourcesContent":["/**\n * Determines if a Sentry instance is SaaS or self-hosted based on the host.\n * @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n * @returns true if SaaS instance, false if self-hosted\n */\nexport function isSentryHost(host: string): boolean {\n return host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\n\n/**\n * Generates a Sentry issue URL.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param issueId Issue identifier (e.g., \"PROJECT-123\")\n * @returns The complete issue URL\n */\nexport function getIssueUrl(\n host: string,\n organizationSlug: string,\n issueId: string,\n): string {\n const isSaas = isSentryHost(host);\n return isSaas\n ? `https://${organizationSlug}.${host}/issues/${issueId}`\n : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;\n}\n\n/**\n * Generates a Sentry issues search URL.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param query Optional search query\n * @param projectSlugOrId Optional project slug or ID\n * @returns The complete issues search URL\n */\nexport function getIssuesSearchUrl(\n host: string,\n organizationSlug: string,\n query?: string,\n projectSlugOrId?: string,\n): string {\n const isSaas = isSentryHost(host);\n let url = isSaas\n ? `https://${organizationSlug}.${host}/issues/`\n : `https://${host}/organizations/${organizationSlug}/issues/`;\n\n const params = new URLSearchParams();\n if (projectSlugOrId) {\n params.append(\"project\", projectSlugOrId);\n }\n if (query) {\n params.append(\"query\", query);\n }\n\n const queryString = params.toString();\n if (queryString) {\n url += `?${queryString}`;\n }\n\n return url;\n}\n\n/**\n * Generates a Sentry trace URL for performance investigation.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param traceId Trace identifier\n * @returns The complete trace URL\n */\nexport function getTraceUrl(\n host: string,\n organizationSlug: string,\n traceId: string,\n): string {\n const isSaas = isSentryHost(host);\n return isSaas\n ? `https://${organizationSlug}.${host}/explore/traces/trace/${traceId}`\n : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n}\n\n/**\n * Generates a Sentry events explorer URL.\n * @param host The Sentry host\n * @param organizationSlug Organization identifier\n * @param query Search query\n * @param dataset Dataset type\n * @param projectSlug Optional project slug\n * @param fields Optional fields to display\n * @returns The complete events explorer URL\n */\nexport function getEventsExplorerUrl(\n host: string,\n organizationSlug: string,\n query: string,\n dataset: \"spans\" | \"errors\" | \"logs\" = \"spans\",\n projectSlug?: string,\n fields?: string[],\n): string {\n const isSaas = isSentryHost(host);\n let url = isSaas\n ? `https://${organizationSlug}.${host}/explore/`\n : `https://${host}/organizations/${organizationSlug}/explore/`;\n\n const params = new URLSearchParams();\n params.append(\"query\", query);\n params.append(\"dataset\", dataset);\n params.append(\"layout\", \"table\");\n\n if (projectSlug) {\n params.append(\"project\", projectSlug);\n }\n\n if (fields && fields.length > 0) {\n for (const field of fields) {\n params.append(\"field\", field);\n }\n }\n\n url += `?${params.toString()}`;\n return url;\n}\n\n/**\n * Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n * Throws an error if validation fails instead of exiting the process.\n *\n * @param host The hostname to validate\n * @throws {Error} If the host contains a protocol\n */\nfunction _validateSentryHostInternal(host: string): void {\n if (host.startsWith(\"http://\") || host.startsWith(\"https://\")) {\n throw new Error(\n \"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\",\n );\n }\n}\n\n/**\n * Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n * Throws an error if validation fails instead of exiting the process.\n *\n * @param url The HTTPS URL to validate and parse\n * @returns The extracted hostname from the URL\n * @throws {Error} If the URL is invalid or not HTTPS\n */\nfunction _validateAndParseSentryUrlInternal(url: string): string {\n if (!url.startsWith(\"https://\")) {\n throw new Error(\n \"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\",\n );\n }\n\n try {\n const parsedUrl = new URL(url);\n return parsedUrl.host;\n } catch (error) {\n throw new Error(\n \"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\",\n );\n }\n}\n\n/**\n * Validates that a SENTRY_HOST value contains only hostname (no protocol).\n * Exits the process with error code 1 if validation fails (CLI behavior).\n *\n * @param host The hostname to validate\n */\nexport function validateSentryHost(host: string): void {\n try {\n _validateSentryHostInternal(host);\n } catch (error) {\n console.error(`Error: ${(error as Error).message}`);\n process.exit(1);\n }\n}\n\n/**\n * Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n * Exits the process with error code 1 if validation fails (CLI behavior).\n *\n * @param url The HTTPS URL to validate and parse\n * @returns The extracted hostname from the URL\n */\nexport function validateAndParseSentryUrl(url: string): string {\n try {\n return _validateAndParseSentryUrlInternal(url);\n } catch (error) {\n console.error(`Error: ${(error as Error).message}`);\n process.exit(1);\n }\n}\n\n/**\n * Validates that a SENTRY_HOST value contains only hostname (no protocol).\n * Throws an error instead of exiting the process (for testing).\n *\n * @param host The hostname to validate\n * @throws {Error} If the host contains a protocol\n */\nexport function validateSentryHostThrows(host: string): void {\n _validateSentryHostInternal(host);\n}\n\n/**\n * Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n * Throws an error instead of exiting the process (for testing).\n *\n * @param url The HTTPS URL to validate and parse\n * @returns The extracted hostname from the URL\n * @throws {Error} If the URL is invalid or not HTTPS\n */\nexport function validateAndParseSentryUrlThrows(url: string): string {\n return _validateAndParseSentryUrlInternal(url);\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,aAAaA,MAAuB;AAClD,QAAO,SAAS,eAAe,KAAK,SAAS,aAAa;AAC3D;;;;;;;;AASD,SAAgB,YACdA,MACAC,kBACAC,SACQ;CACR,MAAM,SAAS,aAAa,KAAK;AACjC,QAAO,UACF,UAAU,iBAAiB,GAAG,KAAK,UAAU,aAC7C,UAAU,KAAK,iBAAiB,iBAAiB,UAAU;AACjE;;;;;;;;;AAUD,SAAgB,mBACdF,MACAC,kBACAE,OACAC,iBACQ;CACR,MAAM,SAAS,aAAa,KAAK;CACjC,IAAI,MAAM,UACL,UAAU,iBAAiB,GAAG,KAAK,aACnC,UAAU,KAAK,iBAAiB,iBAAiB;CAEtD,MAAM,SAAS,IAAI;AACnB,KAAI,gBACF,QAAO,OAAO,WAAW,gBAAgB;AAE3C,KAAI,MACF,QAAO,OAAO,SAAS,MAAM;CAG/B,MAAM,cAAc,OAAO,UAAU;AACrC,KAAI,YACF,SAAQ,GAAG;AAGb,QAAO;AACR;;;;;;;;AASD,SAAgB,YACdJ,MACAC,kBACAI,SACQ;CACR,MAAM,SAAS,aAAa,KAAK;AACjC,QAAO,UACF,UAAU,iBAAiB,GAAG,KAAK,wBAAwB,aAC3D,UAAU,KAAK,iBAAiB,iBAAiB,wBAAwB;AAC/E;;;;;;;;;;;AAYD,SAAgB,qBACdL,MACAC,kBACAK,OACAC,UAAuC,SACvCC,aACAC,QACQ;CACR,MAAM,SAAS,aAAa,KAAK;CACjC,IAAI,MAAM,UACL,UAAU,iBAAiB,GAAG,KAAK,cACnC,UAAU,KAAK,iBAAiB,iBAAiB;CAEtD,MAAM,SAAS,IAAI;AACnB,QAAO,OAAO,SAAS,MAAM;AAC7B,QAAO,OAAO,WAAW,QAAQ;AACjC,QAAO,OAAO,UAAU,QAAQ;AAEhC,KAAI,YACF,QAAO,OAAO,WAAW,YAAY;AAGvC,KAAI,UAAU,OAAO,SAAS,EAC5B,MAAK,MAAM,SAAS,OAClB,QAAO,OAAO,SAAS,MAAM;AAIjC,SAAQ,GAAG,OAAO,UAAU;AAC5B,QAAO;AACR;;;;;;;;AASD,SAAS,4BAA4BT,MAAoB;AACvD,KAAI,KAAK,WAAW,UAAU,IAAI,KAAK,WAAW,WAAW,CAC3D,OAAM,IAAI,MACR;AAGL;;;;;;;;;AAUD,SAAS,mCAAmCU,KAAqB;AAC/D,MAAK,IAAI,WAAW,WAAW,CAC7B,OAAM,IAAI,MACR;AAIJ,KAAI;EACF,MAAM,YAAY,IAAI,IAAI;AAC1B,SAAO,UAAU;CAClB,SAAQ,OAAO;AACd,QAAM,IAAI,MACR;CAEH;AACF;;;;;;;AAQD,SAAgB,mBAAmBV,MAAoB;AACrD,KAAI;AACF,8BAA4B,KAAK;CAClC,SAAQ,OAAO;AACd,UAAQ,OAAO,SAAU,MAAgB,UAAU;AACnD,UAAQ,KAAK,EAAE;CAChB;AACF;;;;;;;;AASD,SAAgB,0BAA0BU,KAAqB;AAC7D,KAAI;AACF,SAAO,mCAAmC,IAAI;CAC/C,SAAQ,OAAO;AACd,UAAQ,OAAO,SAAU,MAAgB,UAAU;AACnD,UAAQ,KAAK,EAAE;CAChB;AACF;;;;;;;;AASD,SAAgB,yBAAyBV,MAAoB;AAC3D,6BAA4B,KAAK;AAClC;;;;;;;;;AAUD,SAAgB,gCAAgCU,KAAqB;AACnE,QAAO,mCAAmC,IAAI;AAC/C"}
|
package/dist/utils/url-utils.cjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
const require_url_utils = require('../url-utils-
|
|
1
|
+
const require_url_utils = require('../url-utils-vJo2ER5v.cjs');
|
|
2
2
|
|
|
3
|
+
exports.getEventsExplorerUrl = require_url_utils.getEventsExplorerUrl;
|
|
4
|
+
exports.getIssueUrl = require_url_utils.getIssueUrl;
|
|
5
|
+
exports.getIssuesSearchUrl = require_url_utils.getIssuesSearchUrl;
|
|
6
|
+
exports.getTraceUrl = require_url_utils.getTraceUrl;
|
|
7
|
+
exports.isSentryHost = require_url_utils.isSentryHost;
|
|
3
8
|
exports.validateAndParseSentryUrl = require_url_utils.validateAndParseSentryUrl;
|
|
4
9
|
exports.validateAndParseSentryUrlThrows = require_url_utils.validateAndParseSentryUrlThrows;
|
|
5
10
|
exports.validateSentryHost = require_url_utils.validateSentryHost;
|
|
@@ -1,4 +1,46 @@
|
|
|
1
1
|
//#region src/utils/url-utils.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines if a Sentry instance is SaaS or self-hosted based on the host.
|
|
4
|
+
* @param host The Sentry host (e.g., "sentry.io" or "sentry.company.com")
|
|
5
|
+
* @returns true if SaaS instance, false if self-hosted
|
|
6
|
+
*/
|
|
7
|
+
declare function isSentryHost(host: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Generates a Sentry issue URL.
|
|
10
|
+
* @param host The Sentry host
|
|
11
|
+
* @param organizationSlug Organization identifier
|
|
12
|
+
* @param issueId Issue identifier (e.g., "PROJECT-123")
|
|
13
|
+
* @returns The complete issue URL
|
|
14
|
+
*/
|
|
15
|
+
declare function getIssueUrl(host: string, organizationSlug: string, issueId: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Generates a Sentry issues search URL.
|
|
18
|
+
* @param host The Sentry host
|
|
19
|
+
* @param organizationSlug Organization identifier
|
|
20
|
+
* @param query Optional search query
|
|
21
|
+
* @param projectSlugOrId Optional project slug or ID
|
|
22
|
+
* @returns The complete issues search URL
|
|
23
|
+
*/
|
|
24
|
+
declare function getIssuesSearchUrl(host: string, organizationSlug: string, query?: string, projectSlugOrId?: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Generates a Sentry trace URL for performance investigation.
|
|
27
|
+
* @param host The Sentry host
|
|
28
|
+
* @param organizationSlug Organization identifier
|
|
29
|
+
* @param traceId Trace identifier
|
|
30
|
+
* @returns The complete trace URL
|
|
31
|
+
*/
|
|
32
|
+
declare function getTraceUrl(host: string, organizationSlug: string, traceId: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Generates a Sentry events explorer URL.
|
|
35
|
+
* @param host The Sentry host
|
|
36
|
+
* @param organizationSlug Organization identifier
|
|
37
|
+
* @param query Search query
|
|
38
|
+
* @param dataset Dataset type
|
|
39
|
+
* @param projectSlug Optional project slug
|
|
40
|
+
* @param fields Optional fields to display
|
|
41
|
+
* @returns The complete events explorer URL
|
|
42
|
+
*/
|
|
43
|
+
declare function getEventsExplorerUrl(host: string, organizationSlug: string, query: string, dataset?: "spans" | "errors" | "logs", projectSlug?: string, fields?: string[]): string;
|
|
2
44
|
/**
|
|
3
45
|
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
4
46
|
* Exits the process with error code 1 if validation fails (CLI behavior).
|
|
@@ -33,5 +75,5 @@ declare function validateSentryHostThrows(host: string): void;
|
|
|
33
75
|
declare function validateAndParseSentryUrlThrows(url: string): string;
|
|
34
76
|
//# sourceMappingURL=url-utils.d.ts.map
|
|
35
77
|
//#endregion
|
|
36
|
-
export { validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateSentryHost, validateSentryHostThrows };
|
|
78
|
+
export { getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateSentryHost, validateSentryHostThrows };
|
|
37
79
|
//# sourceMappingURL=url-utils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-utils.d.cts","names":[],"sources":["../../src/utils/url-utils.ts"],"sourcesContent":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"url-utils.d.cts","names":[],"sources":["../../src/utils/url-utils.ts"],"sourcesContent":[],"mappings":";;AAKA;AAWA;AAmBA;AAkCA;AAqBgB,iBArFA,YAAA,CAqFoB,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA;AA8EpC;AAgBA;AAgBA;AAYA;;;;iBApMgB,WAAA;;;;;;;;;iBAmBA,kBAAA;;;;;;;;iBAkCA,WAAA;;;;;;;;;;;iBAqBA,oBAAA;;;;;;;iBA8EA,kBAAA;;;;;;;;iBAgBA,yBAAA;;;;;;;;iBAgBA,wBAAA;;;;;;;;;iBAYA,+BAAA"}
|