@sentry/mcp-server 0.4.0 → 0.5.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/api-client/client.cjs +2 -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 +2 -2
- package/dist/api-client/client.test.cjs +2 -2
- package/dist/api-client/client.test.js +2 -2
- package/dist/api-client/index.cjs +6 -3
- package/dist/api-client/index.d.cts +4 -4
- package/dist/api-client/index.d.ts +4 -4
- package/dist/api-client/index.js +3 -3
- package/dist/api-client/schema.cjs +5 -2
- package/dist/api-client/schema.d.cts +2 -2
- package/dist/api-client/schema.d.ts +2 -2
- package/dist/api-client/schema.js +2 -2
- package/dist/api-client/types.d.cts +2 -2
- package/dist/api-client/types.d.ts +2 -2
- package/dist/{client-BKLE5Lkt.js → client-CpiyA8FR.js} +39 -36
- package/dist/client-CpiyA8FR.js.map +1 -0
- package/dist/{client-C_XfRSu3.cjs → client-GWxnTlSP.cjs} +39 -36
- package/dist/client-GWxnTlSP.cjs.map +1 -0
- package/dist/{client.d-BizHDVuq.d.cts → client.d-ar2BvC_o.d.cts} +23 -21
- package/dist/client.d-ar2BvC_o.d.cts.map +1 -0
- package/dist/{client.d-CrWOcVIU.d.ts → client.d-eUhyVsN_.d.ts} +27 -25
- package/dist/client.d-eUhyVsN_.d.ts.map +1 -0
- package/dist/index.cjs +10 -10
- package/dist/index.js +10 -10
- package/dist/internal/formatting.d.cts +3 -3
- package/dist/internal/formatting.d.ts +3 -3
- package/dist/internal/issue-helpers.cjs +4 -2
- package/dist/internal/issue-helpers.d.cts +30 -1
- package/dist/internal/issue-helpers.d.cts.map +1 -1
- package/dist/internal/issue-helpers.d.ts +30 -1
- package/dist/internal/issue-helpers.d.ts.map +1 -1
- package/dist/internal/issue-helpers.js +2 -2
- package/dist/internal/issue-helpers.test.cjs +41 -1
- package/dist/internal/issue-helpers.test.cjs.map +1 -1
- package/dist/internal/issue-helpers.test.js +41 -1
- package/dist/internal/issue-helpers.test.js.map +1 -1
- package/dist/issue-helpers-CdWMhVWJ.cjs +87 -0
- package/dist/issue-helpers-CdWMhVWJ.cjs.map +1 -0
- package/dist/{issue-helpers-C0kEdXOE.cjs → issue-helpers-Cx6bFCUv.js} +38 -9
- package/dist/issue-helpers-Cx6bFCUv.js.map +1 -0
- package/dist/{promptDefinitions-CaRMCDPI.js → promptDefinitions-C9aGYWZ6.js} +2 -2
- package/dist/{promptDefinitions-CaRMCDPI.js.map → promptDefinitions-C9aGYWZ6.js.map} +1 -1
- package/dist/{promptDefinitions-CVB4IyVf.cjs → promptDefinitions-OnJHLqrZ.cjs} +2 -2
- package/dist/{promptDefinitions-CVB4IyVf.cjs.map → promptDefinitions-OnJHLqrZ.cjs.map} +1 -1
- package/dist/promptDefinitions.cjs +2 -2
- package/dist/promptDefinitions.js +2 -2
- package/dist/{schema-Bc6_gUDA.cjs → schema-BnXdl41H.cjs} +71 -13
- package/dist/schema-BnXdl41H.cjs.map +1 -0
- package/dist/{schema-D1B8p0Ib.js → schema-BzPfPMq7.js} +54 -14
- package/dist/schema-BzPfPMq7.js.map +1 -0
- package/dist/{schema-BvloqMHW.cjs → schema-_xqdSRLo.cjs} +8 -1
- package/dist/{schema-BvloqMHW.cjs.map → schema-_xqdSRLo.cjs.map} +1 -1
- package/dist/{schema-k04PdSCK.js → schema-pZrPEvtp.js} +3 -2
- package/dist/{schema-k04PdSCK.js.map → schema-pZrPEvtp.js.map} +1 -1
- package/dist/schema.cjs +2 -1
- package/dist/{schema.d-cvHc3M20.d.cts → schema.d-DJThZSuo.d.cts} +2924 -158
- package/dist/schema.d-DJThZSuo.d.cts.map +1 -0
- package/dist/{schema.d-DQ5YUr0Y.d.ts → schema.d-DwpHAZsi.d.ts} +2950 -184
- package/dist/schema.d-DwpHAZsi.d.ts.map +1 -0
- package/dist/schema.d.cts +2 -1
- package/dist/schema.d.cts.map +1 -1
- package/dist/schema.d.ts +2 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/{server-DQ_dBWQy.cjs → server-D-JY6wPp.cjs} +5 -5
- package/dist/{server-DQ_dBWQy.cjs.map → server-D-JY6wPp.cjs.map} +1 -1
- package/dist/{server-DHbbEoa2.js → server-oefnmsHZ.js} +5 -5
- package/dist/{server-DHbbEoa2.js.map → server-oefnmsHZ.js.map} +1 -1
- package/dist/server.cjs +8 -8
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +8 -8
- package/dist/{stdio-BHg5CaoN.js → stdio-B31CD06F.js} +2 -2
- package/dist/{stdio-BHg5CaoN.js.map → stdio-B31CD06F.js.map} +1 -1
- package/dist/{stdio-CRqulLZQ.cjs → stdio-BsGPoQfx.cjs} +2 -2
- package/dist/{stdio-CRqulLZQ.cjs.map → stdio-BsGPoQfx.cjs.map} +1 -1
- package/dist/test-setup.cjs +42 -5
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +42 -5
- package/dist/test-setup.js.map +1 -1
- package/dist/{toolDefinitions-BJ0cyDce.cjs → toolDefinitions-C0t6Y5Su.cjs} +26 -5
- package/dist/toolDefinitions-C0t6Y5Su.cjs.map +1 -0
- package/dist/{toolDefinitions-L20Lv3AW.js → toolDefinitions-DB4pPvgy.js} +26 -5
- package/dist/toolDefinitions-DB4pPvgy.js.map +1 -0
- package/dist/toolDefinitions.cjs +2 -2
- package/dist/{toolDefinitions.d-C0zMvL9m.d.ts → toolDefinitions.d-C5JUBInb.d.ts} +16 -1
- package/dist/toolDefinitions.d-C5JUBInb.d.ts.map +1 -0
- package/dist/{toolDefinitions.d-Dx4q--0l.d.cts → toolDefinitions.d-CsT15_MF.d.cts} +16 -1
- package/dist/toolDefinitions.d-CsT15_MF.d.cts.map +1 -0
- package/dist/toolDefinitions.d.cts +1 -1
- package/dist/toolDefinitions.d.ts +1 -1
- package/dist/toolDefinitions.js +2 -2
- package/dist/toolDefinitions.test.cjs +2 -2
- package/dist/toolDefinitions.test.js +2 -2
- package/dist/{tools-B22b8Jjm.cjs → tools-Ck2CHZeM.cjs} +118 -101
- package/dist/tools-Ck2CHZeM.cjs.map +1 -0
- package/dist/{tools-CXgh-6Vh.js → tools-_Y9eV4LR.js} +118 -101
- package/dist/tools-_Y9eV4LR.js.map +1 -0
- package/dist/tools.cjs +4 -4
- package/dist/tools.d.cts +32 -75
- package/dist/tools.d.cts.map +1 -1
- package/dist/tools.d.ts +35 -78
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +4 -4
- package/dist/tools.test.cjs +53 -7
- package/dist/tools.test.cjs.map +1 -1
- package/dist/tools.test.js +53 -7
- package/dist/tools.test.js.map +1 -1
- package/dist/transports/stdio.cjs +9 -9
- package/dist/transports/stdio.d.cts +2 -2
- package/dist/transports/stdio.d.ts +2 -2
- package/dist/transports/stdio.js +9 -9
- package/dist/{types.d-DsrCjT7G.d.ts → types.d-B-acZthg.d.ts} +2 -2
- package/dist/{types.d-DsrCjT7G.d.ts.map → types.d-B-acZthg.d.ts.map} +1 -1
- package/dist/{types.d-DHI7S0mb.d.ts → types.d-BeKsSRmy.d.ts} +2 -2
- package/dist/{types.d-DHI7S0mb.d.ts.map → types.d-BeKsSRmy.d.ts.map} +1 -1
- package/dist/{types.d-DQGXrBBW.d.cts → types.d-BfhMPrt_.d.cts} +2 -2
- package/dist/{types.d-DQGXrBBW.d.cts.map → types.d-BfhMPrt_.d.cts.map} +1 -1
- package/dist/{types.d-r20cCyVI.d.cts → types.d-Z5OEf3rw.d.cts} +2 -2
- package/dist/{types.d-r20cCyVI.d.cts.map → types.d-Z5OEf3rw.d.cts.map} +1 -1
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/dist/version-B5Fav38l.js +6 -0
- package/dist/version-B5Fav38l.js.map +1 -0
- package/dist/{version-D93Bj2gg.cjs → version-BFCcfCIj.cjs} +2 -2
- package/dist/version-BFCcfCIj.cjs.map +1 -0
- package/dist/version.cjs +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.cts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -4
- package/dist/client-BKLE5Lkt.js.map +0 -1
- package/dist/client-C_XfRSu3.cjs.map +0 -1
- package/dist/client.d-BizHDVuq.d.cts.map +0 -1
- package/dist/client.d-CrWOcVIU.d.ts.map +0 -1
- package/dist/issue-helpers-C0kEdXOE.cjs.map +0 -1
- package/dist/issue-helpers-DFde36Zu.js +0 -32
- package/dist/issue-helpers-DFde36Zu.js.map +0 -1
- package/dist/schema-Bc6_gUDA.cjs.map +0 -1
- package/dist/schema-D1B8p0Ib.js.map +0 -1
- package/dist/schema.d-DQ5YUr0Y.d.ts.map +0 -1
- package/dist/schema.d-cvHc3M20.d.cts.map +0 -1
- package/dist/toolDefinitions-BJ0cyDce.cjs.map +0 -1
- package/dist/toolDefinitions-L20Lv3AW.js.map +0 -1
- package/dist/toolDefinitions.d-C0zMvL9m.d.ts.map +0 -1
- package/dist/toolDefinitions.d-Dx4q--0l.d.cts.map +0 -1
- package/dist/tools-B22b8Jjm.cjs.map +0 -1
- package/dist/tools-CXgh-6Vh.js.map +0 -1
- package/dist/version-D93Bj2gg.cjs.map +0 -1
- package/dist/version-DkmlRpxa.js +0 -6
- package/dist/version-DkmlRpxa.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FrameInterface$1 as FrameInterface } from "../schema.d-
|
|
2
|
-
import { Event } from "../types.d-
|
|
3
|
-
import "../client.d-
|
|
1
|
+
import { FrameInterface$1 as FrameInterface } from "../schema.d-DwpHAZsi.js";
|
|
2
|
+
import { Event } from "../types.d-B-acZthg.js";
|
|
3
|
+
import "../client.d-eUhyVsN_.js";
|
|
4
4
|
import "../index.d-kYckfDWv.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
const require_issue_helpers = require('../issue-helpers-
|
|
1
|
+
const require_issue_helpers = require('../issue-helpers-CdWMhVWJ.cjs');
|
|
2
2
|
|
|
3
|
-
exports.extractIssueId = require_issue_helpers.extractIssueId
|
|
3
|
+
exports.extractIssueId = require_issue_helpers.extractIssueId
|
|
4
|
+
exports.parseIssueId = require_issue_helpers.parseIssueId
|
|
5
|
+
exports.parseIssueParams = require_issue_helpers.parseIssueParams
|
|
@@ -9,7 +9,36 @@
|
|
|
9
9
|
declare function extractIssueId(url: string): {
|
|
10
10
|
issueId: string;
|
|
11
11
|
organizationSlug: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Sometimes the LLM will pass in a funky issue shortId. For example it might pass
|
|
15
|
+
* in "CLOUDFLARE-MCP-41." instead of "CLOUDFLARE-MCP-41". This function attempts to
|
|
16
|
+
* fix common issues.
|
|
17
|
+
*
|
|
18
|
+
* @param issueId - The issue ID to parse
|
|
19
|
+
* @returns The parsed issue ID
|
|
20
|
+
*/
|
|
21
|
+
declare function parseIssueId(issueId: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Parses issue parameters from a variety of formats.
|
|
24
|
+
*
|
|
25
|
+
* @param params - Object containing issue URL, issue ID, and organization slug
|
|
26
|
+
* @returns Object containing the parsed organization slug and issue ID
|
|
27
|
+
* @throws Error if the input is invalid
|
|
28
|
+
*/
|
|
29
|
+
declare function parseIssueParams({
|
|
30
|
+
issueUrl,
|
|
31
|
+
issueId,
|
|
32
|
+
organizationSlug
|
|
33
|
+
}: {
|
|
34
|
+
issueUrl?: string | null;
|
|
35
|
+
issueId?: string | null;
|
|
36
|
+
organizationSlug?: string | null;
|
|
37
|
+
}): {
|
|
38
|
+
organizationSlug: string;
|
|
39
|
+
issueId: string;
|
|
12
40
|
}; //#endregion
|
|
41
|
+
|
|
13
42
|
//# sourceMappingURL=issue-helpers.d.ts.map
|
|
14
|
-
export { extractIssueId };
|
|
43
|
+
export { extractIssueId, parseIssueId, parseIssueParams };
|
|
15
44
|
//# sourceMappingURL=issue-helpers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.d.cts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":null,"mappings":";;;;;;;;iBAOgB,cAAA;EAAA,OAAA,EAAA,MAAA"}
|
|
1
|
+
{"version":3,"file":"issue-helpers.d.cts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":null,"mappings":";;;;;;;;iBAOgB,cAAA;EAAA,OAAA,EAAA,MAAA;;;;;;;;;AAwDhB;;iBAAgB,YAAA;;;;;;AAehB;;AACE,iBADc,gBAAA,CACd;EAAA,QAAA;EAAA,OAAA;EAAA;CAAA,EAAA;EAAQ,QACR,CAAA,EAAA,MAAA,GAAA,IAAA;EAAO,OACP,CAAA,EAAA,MAAA,GAAA,IAAA;EAAgB,gBAAA,CAAA,EAAA,MAAA,GAAA,IAAA"}
|
|
@@ -9,7 +9,36 @@
|
|
|
9
9
|
declare function extractIssueId(url: string): {
|
|
10
10
|
issueId: string;
|
|
11
11
|
organizationSlug: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Sometimes the LLM will pass in a funky issue shortId. For example it might pass
|
|
15
|
+
* in "CLOUDFLARE-MCP-41." instead of "CLOUDFLARE-MCP-41". This function attempts to
|
|
16
|
+
* fix common issues.
|
|
17
|
+
*
|
|
18
|
+
* @param issueId - The issue ID to parse
|
|
19
|
+
* @returns The parsed issue ID
|
|
20
|
+
*/
|
|
21
|
+
declare function parseIssueId(issueId: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Parses issue parameters from a variety of formats.
|
|
24
|
+
*
|
|
25
|
+
* @param params - Object containing issue URL, issue ID, and organization slug
|
|
26
|
+
* @returns Object containing the parsed organization slug and issue ID
|
|
27
|
+
* @throws Error if the input is invalid
|
|
28
|
+
*/
|
|
29
|
+
declare function parseIssueParams({
|
|
30
|
+
issueUrl,
|
|
31
|
+
issueId,
|
|
32
|
+
organizationSlug
|
|
33
|
+
}: {
|
|
34
|
+
issueUrl?: string | null;
|
|
35
|
+
issueId?: string | null;
|
|
36
|
+
organizationSlug?: string | null;
|
|
37
|
+
}): {
|
|
38
|
+
organizationSlug: string;
|
|
39
|
+
issueId: string;
|
|
12
40
|
}; //#endregion
|
|
41
|
+
|
|
13
42
|
//# sourceMappingURL=issue-helpers.d.ts.map
|
|
14
|
-
export { extractIssueId };
|
|
43
|
+
export { extractIssueId, parseIssueId, parseIssueParams };
|
|
15
44
|
//# sourceMappingURL=issue-helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.d.ts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":null,"mappings":";;;;;;;;iBAOgB,cAAA;EAAA,OAAA,EAAA,MAAA"}
|
|
1
|
+
{"version":3,"file":"issue-helpers.d.ts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":null,"mappings":";;;;;;;;iBAOgB,cAAA;EAAA,OAAA,EAAA,MAAA;;;;;;;;;AAwDhB;;iBAAgB,YAAA;;;;;;AAehB;;AACE,iBADc,gBAAA,CACd;EAAA,QAAA;EAAA,OAAA;EAAA;CAAA,EAAA;EAAQ,QACR,CAAA,EAAA,MAAA,GAAA,IAAA;EAAO,OACP,CAAA,EAAA,MAAA,GAAA,IAAA;EAAgB,gBAAA,CAAA,EAAA,MAAA,GAAA,IAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { extractIssueId } from "../issue-helpers-
|
|
1
|
+
import { extractIssueId, parseIssueId, parseIssueParams } from "../issue-helpers-Cx6bFCUv.js";
|
|
2
2
|
|
|
3
|
-
export { extractIssueId };
|
|
3
|
+
export { extractIssueId, parseIssueId, parseIssueParams };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const require_issue_helpers = require('../issue-helpers-
|
|
2
|
+
const require_issue_helpers = require('../issue-helpers-CdWMhVWJ.cjs');
|
|
3
3
|
const require_dist = require('../dist-3oa5SxPp.cjs');
|
|
4
4
|
const require_vi_ClIskdbk = require('../vi.ClIskdbk-Bn6W0wTE.cjs');
|
|
5
5
|
|
|
@@ -69,6 +69,46 @@ require_dist.describe("extractIssueId", () => {
|
|
|
69
69
|
require_vi_ClIskdbk.globalExpect(() => require_issue_helpers.extractIssueId("abc")).toThrowErrorMatchingInlineSnapshot(`[Error: Invalid Sentry issue URL. Must start with http:// or https://]`);
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
|
+
require_dist.describe("parseIssueId", () => {
|
|
73
|
+
require_dist.it("should remove trailing punctuation from issue ID", () => {
|
|
74
|
+
require_vi_ClIskdbk.globalExpect(
|
|
75
|
+
// trailing period and exclamation
|
|
76
|
+
require_issue_helpers.parseIssueId("CLOUDFLARE-MCP-41.!")
|
|
77
|
+
).toBe("CLOUDFLARE-MCP-41");
|
|
78
|
+
});
|
|
79
|
+
require_dist.it("should not modify a clean issue ID", () => {
|
|
80
|
+
require_vi_ClIskdbk.globalExpect(require_issue_helpers.parseIssueId("CLOUDFLARE-MCP-41")).toBe("CLOUDFLARE-MCP-41");
|
|
81
|
+
});
|
|
82
|
+
require_dist.it("should remove special characters except dash and underscore", () => {
|
|
83
|
+
require_vi_ClIskdbk.globalExpect(require_issue_helpers.parseIssueId("ID_123-456!@#")).toBe("ID_123-456");
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
require_dist.describe("parseIssueParams", () => {
|
|
87
|
+
require_dist.it("should parse from issueUrl", () => {
|
|
88
|
+
require_vi_ClIskdbk.globalExpect(require_issue_helpers.parseIssueParams({ issueUrl: "https://sentry.io/sentry/issues/123" })).toEqual({
|
|
89
|
+
organizationSlug: "sentry",
|
|
90
|
+
issueId: "123"
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
require_dist.it("should parse from issueId and organizationSlug", () => {
|
|
94
|
+
require_vi_ClIskdbk.globalExpect(require_issue_helpers.parseIssueParams({
|
|
95
|
+
issueId: "CLOUDFLARE-MCP-41.!",
|
|
96
|
+
organizationSlug: "cloudflare"
|
|
97
|
+
})).toEqual({
|
|
98
|
+
organizationSlug: "cloudflare",
|
|
99
|
+
issueId: "CLOUDFLARE-MCP-41"
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
require_dist.it("should throw if neither issueId nor issueUrl is provided", () => {
|
|
103
|
+
require_vi_ClIskdbk.globalExpect(() => require_issue_helpers.parseIssueParams({ organizationSlug: "foo" })).toThrowErrorMatchingInlineSnapshot(`[Error: Either issueId or issueUrl must be provided]`);
|
|
104
|
+
});
|
|
105
|
+
require_dist.it("should throw if organizationSlug is missing and no issueUrl", () => {
|
|
106
|
+
require_vi_ClIskdbk.globalExpect(() => require_issue_helpers.parseIssueParams({ issueId: "123" })).toThrowErrorMatchingInlineSnapshot(`[Error: Organization slug is required]`);
|
|
107
|
+
});
|
|
108
|
+
require_dist.it("should throw if issueUrl is invalid", () => {
|
|
109
|
+
require_vi_ClIskdbk.globalExpect(() => require_issue_helpers.parseIssueParams({ issueUrl: "not-a-url" })).toThrowErrorMatchingInlineSnapshot(`[Error: Invalid Sentry issue URL. Must start with http:// or https://]`);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
72
112
|
|
|
73
113
|
//#endregion
|
|
74
114
|
//# sourceMappingURL=issue-helpers.test.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.test.cjs","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {
|
|
1
|
+
{"version":3,"file":"issue-helpers.test.cjs","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {\n extractIssueId,\n parseIssueId,\n parseIssueParams,\n} from \"./issue-helpers\";\n\ndescribe(\"extractIssueId\", () => {\n it(\"should extract issue ID from a full Sentry URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/1234\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"1234\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID from a Sentry URL with organization in path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/sentry/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from URL with organizations path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/organizations/my-org/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-org\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from subdomain URL\", () => {\n expect(extractIssueId(\"https://my-team.sentry.io/issues/123\")).toEqual({\n issueId: \"123\",\n organizationSlug: \"my-team\",\n });\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with subdomain\", () => {\n expect(\n extractIssueId(\"https://sentry.mycompany.com/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with organization path\", () => {\n expect(\n extractIssueId(\"https://mycompany.com/my-team/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-team\",\n }\n `);\n });\n\n it(\"should throw error for empty input\", () => {\n expect(() => extractIssueId(\"\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n\n it(\"should throw error for invalid URL path\", () => {\n expect(() =>\n extractIssueId(\"https://sentry.sentry.io/projects/123\"),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Path must contain '/issues/{issue_id}']`,\n );\n });\n\n it(\"should throw error for non-numeric issue ID in URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/abc\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"abc\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should throw error for non-numeric standalone ID\", () => {\n expect(() => extractIssueId(\"abc\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n\ndescribe(\"parseIssueId\", () => {\n it(\"should remove trailing punctuation from issue ID\", () => {\n expect(\n // trailing period and exclamation\n parseIssueId(\"CLOUDFLARE-MCP-41.!\"),\n ).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should not modify a clean issue ID\", () => {\n expect(parseIssueId(\"CLOUDFLARE-MCP-41\")).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should remove special characters except dash and underscore\", () => {\n expect(parseIssueId(\"ID_123-456!@#\")).toBe(\"ID_123-456\");\n });\n});\n\ndescribe(\"parseIssueParams\", () => {\n it(\"should parse from issueUrl\", () => {\n expect(\n parseIssueParams({\n issueUrl: \"https://sentry.io/sentry/issues/123\",\n }),\n ).toEqual({ organizationSlug: \"sentry\", issueId: \"123\" });\n });\n\n it(\"should parse from issueId and organizationSlug\", () => {\n expect(\n parseIssueParams({\n issueId: \"CLOUDFLARE-MCP-41.!\",\n organizationSlug: \"cloudflare\",\n }),\n ).toEqual({ organizationSlug: \"cloudflare\", issueId: \"CLOUDFLARE-MCP-41\" });\n });\n\n it(\"should throw if neither issueId nor issueUrl is provided\", () => {\n expect(() =>\n parseIssueParams({ organizationSlug: \"foo\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Either issueId or issueUrl must be provided]`,\n );\n });\n\n it(\"should throw if organizationSlug is missing and no issueUrl\", () => {\n expect(() =>\n parseIssueParams({ issueId: \"123\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Organization slug is required]`,\n );\n });\n\n it(\"should throw if issueUrl is invalid\", () => {\n expect(() =>\n parseIssueParams({ issueUrl: \"not-a-url\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n"],"mappings":";;;;;;AAOA,sBAAS,kBAAkB,MAAM;AAC/B,iBAAG,kDAAkD,MAAM;AACzD,mCACE,qCAAe,uCAAuC,CACvD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,uEAAuE,MAAM;AAC9E,mCACE,qCAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,yEAAyE,MAAM;AAChF,mCACE,qCAAe,oDAAoD,CACpE,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,2DAA2D,MAAM;AAClE,mCAAO,qCAAe,uCAAuC,CAAC,CAAC,QAAQ;GACrE,SAAS;GACT,kBAAkB;EACnB,EAAC;CACH,EAAC;AAEF,iBAAG,+EAA+E,MAAM;AACtF,mCACE,qCAAe,0CAA0C,CAC1D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,uFAAuF,MAAM;AAC9F,mCACE,qCAAe,2CAA2C,CAC3D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,sCAAsC,MAAM;AAC7C,mCAAO,MAAM,qCAAe,GAAG,CAAC,CAAC,oCAC9B,wEACF;CACF,EAAC;AAEF,iBAAG,2CAA2C,MAAM;AAClD,mCAAO,MACL,qCAAe,wCAAwC,CACxD,CAAC,oCACC,2EACF;CACF,EAAC;AAEF,iBAAG,sDAAsD,MAAM;AAC7D,mCACE,qCAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,oDAAoD,MAAM;AAC3D,mCAAO,MAAM,qCAAe,MAAM,CAAC,CAAC,oCACjC,wEACF;CACF,EAAC;AACH,EAAC;AAEF,sBAAS,gBAAgB,MAAM;AAC7B,iBAAG,oDAAoD,MAAM;AAC3D;;GAEE,mCAAa,sBAAsB;CACpC,CAAC,KAAK,oBAAoB;CAC5B,EAAC;AAEF,iBAAG,sCAAsC,MAAM;AAC7C,mCAAO,mCAAa,oBAAoB,CAAC,CAAC,KAAK,oBAAoB;CACpE,EAAC;AAEF,iBAAG,+DAA+D,MAAM;AACtE,mCAAO,mCAAa,gBAAgB,CAAC,CAAC,KAAK,aAAa;CACzD,EAAC;AACH,EAAC;AAEF,sBAAS,oBAAoB,MAAM;AACjC,iBAAG,8BAA8B,MAAM;AACrC,mCACE,uCAAiB,EACf,UAAU,sCACX,EAAC,CACH,CAAC,QAAQ;GAAE,kBAAkB;GAAU,SAAS;EAAO,EAAC;CAC1D,EAAC;AAEF,iBAAG,kDAAkD,MAAM;AACzD,mCACE,uCAAiB;GACf,SAAS;GACT,kBAAkB;EACnB,EAAC,CACH,CAAC,QAAQ;GAAE,kBAAkB;GAAc,SAAS;EAAqB,EAAC;CAC5E,EAAC;AAEF,iBAAG,4DAA4D,MAAM;AACnE,mCAAO,MACL,uCAAiB,EAAE,kBAAkB,MAAO,EAAC,CAC9C,CAAC,oCACC,sDACF;CACF,EAAC;AAEF,iBAAG,+DAA+D,MAAM;AACtE,mCAAO,MACL,uCAAiB,EAAE,SAAS,MAAO,EAAC,CACrC,CAAC,oCACC,wCACF;CACF,EAAC;AAEF,iBAAG,uCAAuC,MAAM;AAC9C,mCAAO,MACL,uCAAiB,EAAE,UAAU,YAAa,EAAC,CAC5C,CAAC,oCACC,wEACF;CACF,EAAC;AACH,EAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractIssueId } from "../issue-helpers-
|
|
1
|
+
import { extractIssueId, parseIssueId, parseIssueParams } from "../issue-helpers-Cx6bFCUv.js";
|
|
2
2
|
import { describe, it } from "../dist-Bewd5-7a.js";
|
|
3
3
|
import { globalExpect } from "../vi.ClIskdbk-Dd6dTM3O.js";
|
|
4
4
|
|
|
@@ -68,6 +68,46 @@ describe("extractIssueId", () => {
|
|
|
68
68
|
globalExpect(() => extractIssueId("abc")).toThrowErrorMatchingInlineSnapshot(`[Error: Invalid Sentry issue URL. Must start with http:// or https://]`);
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
|
+
describe("parseIssueId", () => {
|
|
72
|
+
it("should remove trailing punctuation from issue ID", () => {
|
|
73
|
+
globalExpect(
|
|
74
|
+
// trailing period and exclamation
|
|
75
|
+
parseIssueId("CLOUDFLARE-MCP-41.!")
|
|
76
|
+
).toBe("CLOUDFLARE-MCP-41");
|
|
77
|
+
});
|
|
78
|
+
it("should not modify a clean issue ID", () => {
|
|
79
|
+
globalExpect(parseIssueId("CLOUDFLARE-MCP-41")).toBe("CLOUDFLARE-MCP-41");
|
|
80
|
+
});
|
|
81
|
+
it("should remove special characters except dash and underscore", () => {
|
|
82
|
+
globalExpect(parseIssueId("ID_123-456!@#")).toBe("ID_123-456");
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
describe("parseIssueParams", () => {
|
|
86
|
+
it("should parse from issueUrl", () => {
|
|
87
|
+
globalExpect(parseIssueParams({ issueUrl: "https://sentry.io/sentry/issues/123" })).toEqual({
|
|
88
|
+
organizationSlug: "sentry",
|
|
89
|
+
issueId: "123"
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
it("should parse from issueId and organizationSlug", () => {
|
|
93
|
+
globalExpect(parseIssueParams({
|
|
94
|
+
issueId: "CLOUDFLARE-MCP-41.!",
|
|
95
|
+
organizationSlug: "cloudflare"
|
|
96
|
+
})).toEqual({
|
|
97
|
+
organizationSlug: "cloudflare",
|
|
98
|
+
issueId: "CLOUDFLARE-MCP-41"
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
it("should throw if neither issueId nor issueUrl is provided", () => {
|
|
102
|
+
globalExpect(() => parseIssueParams({ organizationSlug: "foo" })).toThrowErrorMatchingInlineSnapshot(`[Error: Either issueId or issueUrl must be provided]`);
|
|
103
|
+
});
|
|
104
|
+
it("should throw if organizationSlug is missing and no issueUrl", () => {
|
|
105
|
+
globalExpect(() => parseIssueParams({ issueId: "123" })).toThrowErrorMatchingInlineSnapshot(`[Error: Organization slug is required]`);
|
|
106
|
+
});
|
|
107
|
+
it("should throw if issueUrl is invalid", () => {
|
|
108
|
+
globalExpect(() => parseIssueParams({ issueUrl: "not-a-url" })).toThrowErrorMatchingInlineSnapshot(`[Error: Invalid Sentry issue URL. Must start with http:// or https://]`);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
71
111
|
|
|
72
112
|
//#endregion
|
|
73
113
|
//# sourceMappingURL=issue-helpers.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.test.js","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {
|
|
1
|
+
{"version":3,"file":"issue-helpers.test.js","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {\n extractIssueId,\n parseIssueId,\n parseIssueParams,\n} from \"./issue-helpers\";\n\ndescribe(\"extractIssueId\", () => {\n it(\"should extract issue ID from a full Sentry URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/1234\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"1234\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID from a Sentry URL with organization in path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/sentry/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from URL with organizations path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/organizations/my-org/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-org\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from subdomain URL\", () => {\n expect(extractIssueId(\"https://my-team.sentry.io/issues/123\")).toEqual({\n issueId: \"123\",\n organizationSlug: \"my-team\",\n });\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with subdomain\", () => {\n expect(\n extractIssueId(\"https://sentry.mycompany.com/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with organization path\", () => {\n expect(\n extractIssueId(\"https://mycompany.com/my-team/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-team\",\n }\n `);\n });\n\n it(\"should throw error for empty input\", () => {\n expect(() => extractIssueId(\"\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n\n it(\"should throw error for invalid URL path\", () => {\n expect(() =>\n extractIssueId(\"https://sentry.sentry.io/projects/123\"),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Path must contain '/issues/{issue_id}']`,\n );\n });\n\n it(\"should throw error for non-numeric issue ID in URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/abc\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"abc\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should throw error for non-numeric standalone ID\", () => {\n expect(() => extractIssueId(\"abc\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n\ndescribe(\"parseIssueId\", () => {\n it(\"should remove trailing punctuation from issue ID\", () => {\n expect(\n // trailing period and exclamation\n parseIssueId(\"CLOUDFLARE-MCP-41.!\"),\n ).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should not modify a clean issue ID\", () => {\n expect(parseIssueId(\"CLOUDFLARE-MCP-41\")).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should remove special characters except dash and underscore\", () => {\n expect(parseIssueId(\"ID_123-456!@#\")).toBe(\"ID_123-456\");\n });\n});\n\ndescribe(\"parseIssueParams\", () => {\n it(\"should parse from issueUrl\", () => {\n expect(\n parseIssueParams({\n issueUrl: \"https://sentry.io/sentry/issues/123\",\n }),\n ).toEqual({ organizationSlug: \"sentry\", issueId: \"123\" });\n });\n\n it(\"should parse from issueId and organizationSlug\", () => {\n expect(\n parseIssueParams({\n issueId: \"CLOUDFLARE-MCP-41.!\",\n organizationSlug: \"cloudflare\",\n }),\n ).toEqual({ organizationSlug: \"cloudflare\", issueId: \"CLOUDFLARE-MCP-41\" });\n });\n\n it(\"should throw if neither issueId nor issueUrl is provided\", () => {\n expect(() =>\n parseIssueParams({ organizationSlug: \"foo\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Either issueId or issueUrl must be provided]`,\n );\n });\n\n it(\"should throw if organizationSlug is missing and no issueUrl\", () => {\n expect(() =>\n parseIssueParams({ issueId: \"123\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Organization slug is required]`,\n );\n });\n\n it(\"should throw if issueUrl is invalid\", () => {\n expect(() =>\n parseIssueParams({ issueUrl: \"not-a-url\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n"],"mappings":";;;;;AAOA,SAAS,kBAAkB,MAAM;AAC/B,IAAG,kDAAkD,MAAM;AACzD,eACE,eAAe,uCAAuC,CACvD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,uEAAuE,MAAM;AAC9E,eACE,eAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,yEAAyE,MAAM;AAChF,eACE,eAAe,oDAAoD,CACpE,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,2DAA2D,MAAM;AAClE,eAAO,eAAe,uCAAuC,CAAC,CAAC,QAAQ;GACrE,SAAS;GACT,kBAAkB;EACnB,EAAC;CACH,EAAC;AAEF,IAAG,+EAA+E,MAAM;AACtF,eACE,eAAe,0CAA0C,CAC1D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,uFAAuF,MAAM;AAC9F,eACE,eAAe,2CAA2C,CAC3D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,sCAAsC,MAAM;AAC7C,eAAO,MAAM,eAAe,GAAG,CAAC,CAAC,oCAC9B,wEACF;CACF,EAAC;AAEF,IAAG,2CAA2C,MAAM;AAClD,eAAO,MACL,eAAe,wCAAwC,CACxD,CAAC,oCACC,2EACF;CACF,EAAC;AAEF,IAAG,sDAAsD,MAAM;AAC7D,eACE,eAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,oDAAoD,MAAM;AAC3D,eAAO,MAAM,eAAe,MAAM,CAAC,CAAC,oCACjC,wEACF;CACF,EAAC;AACH,EAAC;AAEF,SAAS,gBAAgB,MAAM;AAC7B,IAAG,oDAAoD,MAAM;AAC3D;;GAEE,aAAa,sBAAsB;CACpC,CAAC,KAAK,oBAAoB;CAC5B,EAAC;AAEF,IAAG,sCAAsC,MAAM;AAC7C,eAAO,aAAa,oBAAoB,CAAC,CAAC,KAAK,oBAAoB;CACpE,EAAC;AAEF,IAAG,+DAA+D,MAAM;AACtE,eAAO,aAAa,gBAAgB,CAAC,CAAC,KAAK,aAAa;CACzD,EAAC;AACH,EAAC;AAEF,SAAS,oBAAoB,MAAM;AACjC,IAAG,8BAA8B,MAAM;AACrC,eACE,iBAAiB,EACf,UAAU,sCACX,EAAC,CACH,CAAC,QAAQ;GAAE,kBAAkB;GAAU,SAAS;EAAO,EAAC;CAC1D,EAAC;AAEF,IAAG,kDAAkD,MAAM;AACzD,eACE,iBAAiB;GACf,SAAS;GACT,kBAAkB;EACnB,EAAC,CACH,CAAC,QAAQ;GAAE,kBAAkB;GAAc,SAAS;EAAqB,EAAC;CAC5E,EAAC;AAEF,IAAG,4DAA4D,MAAM;AACnE,eAAO,MACL,iBAAiB,EAAE,kBAAkB,MAAO,EAAC,CAC9C,CAAC,oCACC,sDACF;CACF,EAAC;AAEF,IAAG,+DAA+D,MAAM;AACtE,eAAO,MACL,iBAAiB,EAAE,SAAS,MAAO,EAAC,CACrC,CAAC,oCACC,wCACF;CACF,EAAC;AAEF,IAAG,uCAAuC,MAAM;AAC9C,eAAO,MACL,iBAAiB,EAAE,UAAU,YAAa,EAAC,CAC5C,CAAC,oCACC,wEACF;CACF,EAAC;AACH,EAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
//#region src/internal/issue-helpers.ts
|
|
4
|
+
/**
|
|
5
|
+
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
6
|
+
*
|
|
7
|
+
* @param url - A full Sentry issue URL
|
|
8
|
+
* @returns Object containing the numeric issue ID and organization slug (if found)
|
|
9
|
+
* @throws Error if the input is invalid
|
|
10
|
+
*/
|
|
11
|
+
function extractIssueId(url) {
|
|
12
|
+
if (!url.startsWith("http://") && !url.startsWith("https://")) throw new Error("Invalid Sentry issue URL. Must start with http:// or https://");
|
|
13
|
+
const parsedUrl = new URL(url);
|
|
14
|
+
const pathParts = parsedUrl.pathname.split("/").filter(Boolean);
|
|
15
|
+
if (pathParts.length < 2 || !pathParts.includes("issues")) throw new Error("Invalid Sentry issue URL. Path must contain '/issues/{issue_id}'");
|
|
16
|
+
const issueId = pathParts[pathParts.indexOf("issues") + 1];
|
|
17
|
+
if (!issueId) throw new Error("Unable to determine issue ID from URL.");
|
|
18
|
+
let organizationSlug;
|
|
19
|
+
if (pathParts.includes("organizations")) organizationSlug = pathParts[pathParts.indexOf("organizations") + 1];
|
|
20
|
+
else if (pathParts.length > 1 && pathParts[0] !== "issues") organizationSlug = pathParts[0];
|
|
21
|
+
else {
|
|
22
|
+
const hostParts = parsedUrl.hostname.split(".");
|
|
23
|
+
if (hostParts.length > 2 && hostParts[0] !== "www") organizationSlug = hostParts[0];
|
|
24
|
+
}
|
|
25
|
+
if (!organizationSlug) throw new Error("Invalid Sentry issue URL. Could not determine organization.");
|
|
26
|
+
return {
|
|
27
|
+
issueId,
|
|
28
|
+
organizationSlug
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sometimes the LLM will pass in a funky issue shortId. For example it might pass
|
|
33
|
+
* in "CLOUDFLARE-MCP-41." instead of "CLOUDFLARE-MCP-41". This function attempts to
|
|
34
|
+
* fix common issues.
|
|
35
|
+
*
|
|
36
|
+
* @param issueId - The issue ID to parse
|
|
37
|
+
* @returns The parsed issue ID
|
|
38
|
+
*/
|
|
39
|
+
function parseIssueId(issueId) {
|
|
40
|
+
let finalIssueId = issueId;
|
|
41
|
+
finalIssueId = finalIssueId.replace(/[^\w-]/g, "");
|
|
42
|
+
return finalIssueId;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parses issue parameters from a variety of formats.
|
|
46
|
+
*
|
|
47
|
+
* @param params - Object containing issue URL, issue ID, and organization slug
|
|
48
|
+
* @returns Object containing the parsed organization slug and issue ID
|
|
49
|
+
* @throws Error if the input is invalid
|
|
50
|
+
*/
|
|
51
|
+
function parseIssueParams({ issueUrl, issueId, organizationSlug }) {
|
|
52
|
+
if (issueUrl) {
|
|
53
|
+
const resolved = extractIssueId(issueUrl);
|
|
54
|
+
if (!resolved) throw new Error("Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'");
|
|
55
|
+
return {
|
|
56
|
+
...resolved,
|
|
57
|
+
issueId: parseIssueId(resolved.issueId)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (!organizationSlug) throw new Error("Organization slug is required");
|
|
61
|
+
if (issueId) return {
|
|
62
|
+
organizationSlug,
|
|
63
|
+
issueId: parseIssueId(issueId)
|
|
64
|
+
};
|
|
65
|
+
throw new Error("Either issueId or issueUrl must be provided");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
Object.defineProperty(exports, 'extractIssueId', {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () {
|
|
72
|
+
return extractIssueId;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(exports, 'parseIssueId', {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return parseIssueId;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, 'parseIssueParams', {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () {
|
|
84
|
+
return parseIssueParams;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=issue-helpers-CdWMhVWJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-helpers-CdWMhVWJ.cjs","names":["url: string","organizationSlug: string | undefined","issueId: string"],"sources":["../src/internal/issue-helpers.ts"],"sourcesContent":["/**\n * Extracts the Sentry issue ID and organization slug from a full URL\n *\n * @param url - A full Sentry issue URL\n * @returns Object containing the numeric issue ID and organization slug (if found)\n * @throws Error if the input is invalid\n */\nexport function extractIssueId(url: string): {\n issueId: string;\n organizationSlug: string;\n} {\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Must start with http:// or https://\",\n );\n }\n\n const parsedUrl = new URL(url);\n\n const pathParts = parsedUrl.pathname.split(\"/\").filter(Boolean);\n if (pathParts.length < 2 || !pathParts.includes(\"issues\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Path must contain '/issues/{issue_id}'\",\n );\n }\n\n const issueId = pathParts[pathParts.indexOf(\"issues\") + 1];\n if (!issueId) {\n throw new Error(\"Unable to determine issue ID from URL.\");\n }\n\n // Extract organization slug from either the path or subdomain\n let organizationSlug: string | undefined;\n if (pathParts.includes(\"organizations\")) {\n organizationSlug = pathParts[pathParts.indexOf(\"organizations\") + 1];\n } else if (pathParts.length > 1 && pathParts[0] !== \"issues\") {\n // If URL is like sentry.io/sentry/issues/123\n organizationSlug = pathParts[0];\n } else {\n // Check for subdomain\n const hostParts = parsedUrl.hostname.split(\".\");\n if (hostParts.length > 2 && hostParts[0] !== \"www\") {\n organizationSlug = hostParts[0];\n }\n }\n\n if (!organizationSlug) {\n throw new Error(\n \"Invalid Sentry issue URL. Could not determine organization.\",\n );\n }\n\n return { issueId, organizationSlug };\n}\n\n/**\n * Sometimes the LLM will pass in a funky issue shortId. For example it might pass\n * in \"CLOUDFLARE-MCP-41.\" instead of \"CLOUDFLARE-MCP-41\". This function attempts to\n * fix common issues.\n *\n * @param issueId - The issue ID to parse\n * @returns The parsed issue ID\n */\nexport function parseIssueId(issueId: string) {\n let finalIssueId = issueId;\n // remove trailing punctuation\n finalIssueId = finalIssueId.replace(/[^\\w-]/g, \"\");\n\n return finalIssueId;\n}\n\n/**\n * Parses issue parameters from a variety of formats.\n *\n * @param params - Object containing issue URL, issue ID, and organization slug\n * @returns Object containing the parsed organization slug and issue ID\n * @throws Error if the input is invalid\n */\nexport function parseIssueParams({\n issueUrl,\n issueId,\n organizationSlug,\n}: {\n issueUrl?: string | null;\n issueId?: string | null;\n organizationSlug?: string | null;\n}): {\n organizationSlug: string;\n issueId: string;\n} {\n if (issueUrl) {\n const resolved = extractIssueId(issueUrl);\n if (!resolved) {\n throw new Error(\n \"Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'\",\n );\n }\n return {\n ...resolved,\n issueId: parseIssueId(resolved.issueId),\n };\n }\n\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n\n if (issueId) {\n return {\n organizationSlug,\n issueId: parseIssueId(issueId),\n };\n }\n\n throw new Error(\"Either issueId or issueUrl must be provided\");\n}\n"],"mappings":";;;;;;;;;;AAOA,SAAgB,eAAeA,KAG7B;AACA,MAAK,IAAI,WAAW,UAAU,KAAK,IAAI,WAAW,WAAW,CAC3D,OAAM,IAAI,MACR;CAIJ,MAAM,YAAY,IAAI,IAAI;CAE1B,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AAC/D,KAAI,UAAU,SAAS,MAAM,UAAU,SAAS,SAAS,CACvD,OAAM,IAAI,MACR;CAIJ,MAAM,UAAU,UAAU,UAAU,QAAQ,SAAS,GAAG;AACxD,MAAK,QACH,OAAM,IAAI,MAAM;CAIlB,IAAIC;AACJ,KAAI,UAAU,SAAS,gBAAgB,CACrC,oBAAmB,UAAU,UAAU,QAAQ,gBAAgB,GAAG;UACzD,UAAU,SAAS,KAAK,UAAU,OAAO,SAElD,oBAAmB,UAAU;MACxB;EAEL,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI;AAC/C,MAAI,UAAU,SAAS,KAAK,UAAU,OAAO,MAC3C,oBAAmB,UAAU;CAEhC;AAED,MAAK,iBACH,OAAM,IAAI,MACR;AAIJ,QAAO;EAAE;EAAS;CAAkB;AACrC;;;;;;;;;AAUD,SAAgB,aAAaC,SAAiB;CAC5C,IAAI,eAAe;AAEnB,gBAAe,aAAa,QAAQ,WAAW,GAAG;AAElD,QAAO;AACR;;;;;;;;AASD,SAAgB,iBAAiB,EAC/B,UACA,SACA,kBAKD,EAGC;AACA,KAAI,UAAU;EACZ,MAAM,WAAW,eAAe,SAAS;AACzC,OAAK,SACH,OAAM,IAAI,MACR;AAGJ,SAAO;GACL,GAAG;GACH,SAAS,aAAa,SAAS,QAAQ;EACxC;CACF;AAED,MAAK,iBACH,OAAM,IAAI,MAAM;AAGlB,KAAI,QACF,QAAO;EACL;EACA,SAAS,aAAa,QAAQ;CAC/B;AAGH,OAAM,IAAI,MAAM;AACjB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
//#region src/internal/issue-helpers.ts
|
|
4
2
|
/**
|
|
5
3
|
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
@@ -28,12 +26,43 @@ function extractIssueId(url) {
|
|
|
28
26
|
organizationSlug
|
|
29
27
|
};
|
|
30
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Sometimes the LLM will pass in a funky issue shortId. For example it might pass
|
|
31
|
+
* in "CLOUDFLARE-MCP-41." instead of "CLOUDFLARE-MCP-41". This function attempts to
|
|
32
|
+
* fix common issues.
|
|
33
|
+
*
|
|
34
|
+
* @param issueId - The issue ID to parse
|
|
35
|
+
* @returns The parsed issue ID
|
|
36
|
+
*/
|
|
37
|
+
function parseIssueId(issueId) {
|
|
38
|
+
let finalIssueId = issueId;
|
|
39
|
+
finalIssueId = finalIssueId.replace(/[^\w-]/g, "");
|
|
40
|
+
return finalIssueId;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parses issue parameters from a variety of formats.
|
|
44
|
+
*
|
|
45
|
+
* @param params - Object containing issue URL, issue ID, and organization slug
|
|
46
|
+
* @returns Object containing the parsed organization slug and issue ID
|
|
47
|
+
* @throws Error if the input is invalid
|
|
48
|
+
*/
|
|
49
|
+
function parseIssueParams({ issueUrl, issueId, organizationSlug }) {
|
|
50
|
+
if (issueUrl) {
|
|
51
|
+
const resolved = extractIssueId(issueUrl);
|
|
52
|
+
if (!resolved) throw new Error("Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'");
|
|
53
|
+
return {
|
|
54
|
+
...resolved,
|
|
55
|
+
issueId: parseIssueId(resolved.issueId)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (!organizationSlug) throw new Error("Organization slug is required");
|
|
59
|
+
if (issueId) return {
|
|
60
|
+
organizationSlug,
|
|
61
|
+
issueId: parseIssueId(issueId)
|
|
62
|
+
};
|
|
63
|
+
throw new Error("Either issueId or issueUrl must be provided");
|
|
64
|
+
}
|
|
31
65
|
|
|
32
66
|
//#endregion
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
get: function () {
|
|
36
|
-
return extractIssueId;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=issue-helpers-C0kEdXOE.cjs.map
|
|
67
|
+
export { extractIssueId, parseIssueId, parseIssueParams };
|
|
68
|
+
//# sourceMappingURL=issue-helpers-Cx6bFCUv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-helpers-Cx6bFCUv.js","names":["url: string","organizationSlug: string | undefined","issueId: string"],"sources":["../src/internal/issue-helpers.ts"],"sourcesContent":["/**\n * Extracts the Sentry issue ID and organization slug from a full URL\n *\n * @param url - A full Sentry issue URL\n * @returns Object containing the numeric issue ID and organization slug (if found)\n * @throws Error if the input is invalid\n */\nexport function extractIssueId(url: string): {\n issueId: string;\n organizationSlug: string;\n} {\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Must start with http:// or https://\",\n );\n }\n\n const parsedUrl = new URL(url);\n\n const pathParts = parsedUrl.pathname.split(\"/\").filter(Boolean);\n if (pathParts.length < 2 || !pathParts.includes(\"issues\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Path must contain '/issues/{issue_id}'\",\n );\n }\n\n const issueId = pathParts[pathParts.indexOf(\"issues\") + 1];\n if (!issueId) {\n throw new Error(\"Unable to determine issue ID from URL.\");\n }\n\n // Extract organization slug from either the path or subdomain\n let organizationSlug: string | undefined;\n if (pathParts.includes(\"organizations\")) {\n organizationSlug = pathParts[pathParts.indexOf(\"organizations\") + 1];\n } else if (pathParts.length > 1 && pathParts[0] !== \"issues\") {\n // If URL is like sentry.io/sentry/issues/123\n organizationSlug = pathParts[0];\n } else {\n // Check for subdomain\n const hostParts = parsedUrl.hostname.split(\".\");\n if (hostParts.length > 2 && hostParts[0] !== \"www\") {\n organizationSlug = hostParts[0];\n }\n }\n\n if (!organizationSlug) {\n throw new Error(\n \"Invalid Sentry issue URL. Could not determine organization.\",\n );\n }\n\n return { issueId, organizationSlug };\n}\n\n/**\n * Sometimes the LLM will pass in a funky issue shortId. For example it might pass\n * in \"CLOUDFLARE-MCP-41.\" instead of \"CLOUDFLARE-MCP-41\". This function attempts to\n * fix common issues.\n *\n * @param issueId - The issue ID to parse\n * @returns The parsed issue ID\n */\nexport function parseIssueId(issueId: string) {\n let finalIssueId = issueId;\n // remove trailing punctuation\n finalIssueId = finalIssueId.replace(/[^\\w-]/g, \"\");\n\n return finalIssueId;\n}\n\n/**\n * Parses issue parameters from a variety of formats.\n *\n * @param params - Object containing issue URL, issue ID, and organization slug\n * @returns Object containing the parsed organization slug and issue ID\n * @throws Error if the input is invalid\n */\nexport function parseIssueParams({\n issueUrl,\n issueId,\n organizationSlug,\n}: {\n issueUrl?: string | null;\n issueId?: string | null;\n organizationSlug?: string | null;\n}): {\n organizationSlug: string;\n issueId: string;\n} {\n if (issueUrl) {\n const resolved = extractIssueId(issueUrl);\n if (!resolved) {\n throw new Error(\n \"Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'\",\n );\n }\n return {\n ...resolved,\n issueId: parseIssueId(resolved.issueId),\n };\n }\n\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n\n if (issueId) {\n return {\n organizationSlug,\n issueId: parseIssueId(issueId),\n };\n }\n\n throw new Error(\"Either issueId or issueUrl must be provided\");\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,eAAeA,KAG7B;AACA,MAAK,IAAI,WAAW,UAAU,KAAK,IAAI,WAAW,WAAW,CAC3D,OAAM,IAAI,MACR;CAIJ,MAAM,YAAY,IAAI,IAAI;CAE1B,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AAC/D,KAAI,UAAU,SAAS,MAAM,UAAU,SAAS,SAAS,CACvD,OAAM,IAAI,MACR;CAIJ,MAAM,UAAU,UAAU,UAAU,QAAQ,SAAS,GAAG;AACxD,MAAK,QACH,OAAM,IAAI,MAAM;CAIlB,IAAIC;AACJ,KAAI,UAAU,SAAS,gBAAgB,CACrC,oBAAmB,UAAU,UAAU,QAAQ,gBAAgB,GAAG;UACzD,UAAU,SAAS,KAAK,UAAU,OAAO,SAElD,oBAAmB,UAAU;MACxB;EAEL,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI;AAC/C,MAAI,UAAU,SAAS,KAAK,UAAU,OAAO,MAC3C,oBAAmB,UAAU;CAEhC;AAED,MAAK,iBACH,OAAM,IAAI,MACR;AAIJ,QAAO;EAAE;EAAS;CAAkB;AACrC;;;;;;;;;AAUD,SAAgB,aAAaC,SAAiB;CAC5C,IAAI,eAAe;AAEnB,gBAAe,aAAa,QAAQ,WAAW,GAAG;AAElD,QAAO;AACR;;;;;;;;AASD,SAAgB,iBAAiB,EAC/B,UACA,SACA,kBAKD,EAGC;AACA,KAAI,UAAU;EACZ,MAAM,WAAW,eAAe,SAAS;AACzC,OAAK,SACH,OAAM,IAAI,MACR;AAGJ,SAAO;GACL,GAAG;GACH,SAAS,aAAa,SAAS,QAAQ;EACxC;CACF;AAED,MAAK,iBACH,OAAM,IAAI,MAAM;AAGlB,KAAI,QACF,QAAO;EACL;EACA,SAAS,aAAa,QAAQ;CAC/B;AAGH,OAAM,IAAI,MAAM;AACjB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParamOrganizationSlug } from "./schema-
|
|
1
|
+
import { ParamOrganizationSlug } from "./schema-pZrPEvtp.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/promptDefinitions.ts
|
|
@@ -13,4 +13,4 @@ const PROMPT_DEFINITIONS = [{
|
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
export { PROMPT_DEFINITIONS };
|
|
16
|
-
//# sourceMappingURL=promptDefinitions-
|
|
16
|
+
//# sourceMappingURL=promptDefinitions-C9aGYWZ6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptDefinitions-
|
|
1
|
+
{"version":3,"file":"promptDefinitions-C9aGYWZ6.js","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ParamOrganizationSlug } from \"./schema\";\n\nexport const PROMPT_DEFINITIONS = [\n {\n name: \"find_errors_in_file\" as const,\n description: [\n \"Use this prompt when you need to find errors in Sentry for a given file.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug,\n filename: z.string(),\n },\n },\n];\n"],"mappings":";;;;AAGA,MAAa,qBAAqB,CAChC;CACE,MAAM;CACN,aAAa,CACX,0EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkB;EAClB,UAAU,EAAE,QAAQ;CACrB;AACF,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-BtT13l48.cjs');
|
|
3
|
-
const require_schema = require('./schema-
|
|
3
|
+
const require_schema = require('./schema-_xqdSRLo.cjs');
|
|
4
4
|
const zod = require_chunk.__toESM(require("zod"));
|
|
5
5
|
|
|
6
6
|
//#region src/promptDefinitions.ts
|
|
@@ -20,4 +20,4 @@ Object.defineProperty(exports, 'PROMPT_DEFINITIONS', {
|
|
|
20
20
|
return PROMPT_DEFINITIONS;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
//# sourceMappingURL=promptDefinitions-
|
|
23
|
+
//# sourceMappingURL=promptDefinitions-OnJHLqrZ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promptDefinitions-
|
|
1
|
+
{"version":3,"file":"promptDefinitions-OnJHLqrZ.cjs","names":["ParamOrganizationSlug"],"sources":["../src/promptDefinitions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ParamOrganizationSlug } from \"./schema\";\n\nexport const PROMPT_DEFINITIONS = [\n {\n name: \"find_errors_in_file\" as const,\n description: [\n \"Use this prompt when you need to find errors in Sentry for a given file.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug,\n filename: z.string(),\n },\n },\n];\n"],"mappings":";;;;;;AAGA,MAAa,qBAAqB,CAChC;CACE,MAAM;CACN,aAAa,CACX,0EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkBA;EAClB,UAAU,MAAE,QAAQ;CACrB;AACF,CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require('./schema-
|
|
2
|
-
const require_promptDefinitions = require('./promptDefinitions-
|
|
1
|
+
require('./schema-_xqdSRLo.cjs');
|
|
2
|
+
const require_promptDefinitions = require('./promptDefinitions-OnJHLqrZ.cjs');
|
|
3
3
|
|
|
4
4
|
exports.PROMPT_DEFINITIONS = require_promptDefinitions.PROMPT_DEFINITIONS
|
|
@@ -7,7 +7,11 @@ const ApiErrorSchema = zod.z.object({ detail: zod.z.string() }).passthrough();
|
|
|
7
7
|
const OrganizationSchema = zod.z.object({
|
|
8
8
|
id: zod.z.union([zod.z.string(), zod.z.number()]),
|
|
9
9
|
slug: zod.z.string(),
|
|
10
|
-
name: zod.z.string()
|
|
10
|
+
name: zod.z.string(),
|
|
11
|
+
links: zod.z.object({
|
|
12
|
+
regionUrl: zod.z.string().url(),
|
|
13
|
+
organizationUrl: zod.z.string().url()
|
|
14
|
+
})
|
|
11
15
|
});
|
|
12
16
|
const OrganizationListSchema = zod.z.array(OrganizationSchema);
|
|
13
17
|
const TeamSchema = zod.z.object({
|
|
@@ -76,7 +80,11 @@ const IssueSchema = zod.z.object({
|
|
|
76
80
|
platform: zod.z.string(),
|
|
77
81
|
status: zod.z.string(),
|
|
78
82
|
culprit: zod.z.string(),
|
|
79
|
-
type: zod.z.union([
|
|
83
|
+
type: zod.z.union([
|
|
84
|
+
zod.z.literal("error"),
|
|
85
|
+
zod.z.literal("transaction"),
|
|
86
|
+
zod.z.unknown()
|
|
87
|
+
])
|
|
80
88
|
});
|
|
81
89
|
const IssueListSchema = zod.z.array(IssueSchema);
|
|
82
90
|
const FrameInterface = zod.z.object({
|
|
@@ -101,21 +109,53 @@ const ErrorEntrySchema = zod.z.object({
|
|
|
101
109
|
values: zod.z.array(ExceptionInterface.optional()),
|
|
102
110
|
value: ExceptionInterface.nullable().optional()
|
|
103
111
|
});
|
|
104
|
-
const
|
|
112
|
+
const BaseEventSchema = zod.z.object({
|
|
105
113
|
id: zod.z.string(),
|
|
106
114
|
title: zod.z.string(),
|
|
107
115
|
message: zod.z.string().nullable(),
|
|
108
|
-
dateCreated: zod.z.string().datetime(),
|
|
109
|
-
culprit: zod.z.string().nullable(),
|
|
110
116
|
platform: zod.z.string().nullable(),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
type: zod.z.unknown(),
|
|
118
|
+
entries: zod.z.array(zod.z.union([
|
|
119
|
+
zod.z.object({
|
|
120
|
+
type: zod.z.literal("exception"),
|
|
121
|
+
data: ErrorEntrySchema
|
|
122
|
+
}),
|
|
123
|
+
zod.z.object({
|
|
124
|
+
type: zod.z.literal("spans"),
|
|
125
|
+
data: zod.z.unknown()
|
|
126
|
+
}),
|
|
127
|
+
zod.z.object({
|
|
128
|
+
type: zod.z.literal("request"),
|
|
129
|
+
data: zod.z.unknown()
|
|
130
|
+
}),
|
|
131
|
+
zod.z.object({
|
|
132
|
+
type: zod.z.literal("breadcrumbs"),
|
|
133
|
+
data: zod.z.unknown()
|
|
134
|
+
}),
|
|
135
|
+
zod.z.object({
|
|
136
|
+
type: zod.z.string(),
|
|
137
|
+
data: zod.z.unknown()
|
|
138
|
+
})
|
|
139
|
+
]))
|
|
118
140
|
});
|
|
141
|
+
const ErrorEventSchema = BaseEventSchema.omit({ type: true }).extend({
|
|
142
|
+
type: zod.z.literal("error"),
|
|
143
|
+
culprit: zod.z.string().nullable(),
|
|
144
|
+
dateCreated: zod.z.string().datetime()
|
|
145
|
+
});
|
|
146
|
+
const TransactionEventSchema = BaseEventSchema.omit({ type: true }).extend({
|
|
147
|
+
type: zod.z.literal("transaction"),
|
|
148
|
+
occurrence: zod.z.object({
|
|
149
|
+
issueTitle: zod.z.string(),
|
|
150
|
+
culprit: zod.z.string().nullable()
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
const UnknownEventSchema = BaseEventSchema.omit({ type: true }).extend({ type: zod.z.unknown() });
|
|
154
|
+
const EventSchema = zod.z.union([
|
|
155
|
+
ErrorEventSchema,
|
|
156
|
+
TransactionEventSchema,
|
|
157
|
+
UnknownEventSchema
|
|
158
|
+
]);
|
|
119
159
|
const EventsResponseSchema = zod.z.object({
|
|
120
160
|
data: zod.z.array(zod.z.unknown()),
|
|
121
161
|
meta: zod.z.object({ fields: zod.z.record(zod.z.string(), zod.z.string()) }).passthrough()
|
|
@@ -278,6 +318,12 @@ Object.defineProperty(exports, 'ErrorEntrySchema', {
|
|
|
278
318
|
return ErrorEntrySchema;
|
|
279
319
|
}
|
|
280
320
|
});
|
|
321
|
+
Object.defineProperty(exports, 'ErrorEventSchema', {
|
|
322
|
+
enumerable: true,
|
|
323
|
+
get: function () {
|
|
324
|
+
return ErrorEventSchema;
|
|
325
|
+
}
|
|
326
|
+
});
|
|
281
327
|
Object.defineProperty(exports, 'ErrorsSearchResponseSchema', {
|
|
282
328
|
enumerable: true,
|
|
283
329
|
get: function () {
|
|
@@ -386,4 +432,16 @@ Object.defineProperty(exports, 'TeamSchema', {
|
|
|
386
432
|
return TeamSchema;
|
|
387
433
|
}
|
|
388
434
|
});
|
|
389
|
-
|
|
435
|
+
Object.defineProperty(exports, 'TransactionEventSchema', {
|
|
436
|
+
enumerable: true,
|
|
437
|
+
get: function () {
|
|
438
|
+
return TransactionEventSchema;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
Object.defineProperty(exports, 'UnknownEventSchema', {
|
|
442
|
+
enumerable: true,
|
|
443
|
+
get: function () {
|
|
444
|
+
return UnknownEventSchema;
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
//# sourceMappingURL=schema-BnXdl41H.cjs.map
|