@sentry/junior-sentry 0.206.0 → 0.208.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/README.md +1 -1
- package/dist/{chunk-H66FI5RQ.js → chunk-UITYE7V6.js} +6 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +3 -3
- package/dist/webhooks/{resource-events.d.ts → events.d.ts} +3 -3
- package/dist/webhooks/handler.d.ts +3 -3
- package/package.json +2 -2
- /package/dist/{resource-events → events}/issue.d.ts +0 -0
package/README.md
CHANGED
|
@@ -40,6 +40,6 @@ Use a **Sentry internal integration** (not a public app install flow):
|
|
|
40
40
|
2. Point it at `https://<junior-host>/api/webhooks/sentry`.
|
|
41
41
|
3. Set the org slug as `SENTRY_WEBHOOK_ORG` and the integration client secret as `SENTRY_WEBHOOK_SECRET`, then redeploy.
|
|
42
42
|
|
|
43
|
-
Junior verifies `Sentry-Hook-Signature`, rejects payloads outside `SENTRY_WEBHOOK_ORG`, and publishes `issue.created` for `org/project#issueId` and `org/project`. Create watches/event
|
|
43
|
+
Junior verifies `Sentry-Hook-Signature`, rejects payloads outside `SENTRY_WEBHOOK_ORG`, and publishes `issue.created` for `org/project#issueId` and `org/project`. Create watches/event automations before the issue arrives; unmatched deliveries are not replayed.
|
|
44
44
|
|
|
45
45
|
Full guide: https://junior.sentry.dev/extend/sentry-plugin/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/events/issue.ts
|
|
2
2
|
var SENTRY_ISSUE_EVENTS = ["issue.created"];
|
|
3
3
|
function sentryIssueResource(input) {
|
|
4
4
|
return {
|
|
@@ -15,7 +15,7 @@ function sentryProjectResource(input) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// src/webhooks/
|
|
18
|
+
// src/webhooks/events.ts
|
|
19
19
|
import { z } from "zod";
|
|
20
20
|
var issueWebhookSchema = z.object({
|
|
21
21
|
action: z.string(),
|
|
@@ -70,7 +70,7 @@ function issueText(issue) {
|
|
|
70
70
|
].filter((part) => part !== void 0);
|
|
71
71
|
return parts.length > 0 ? parts.join("\n") : void 0;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function normalizeSentryEvents(input) {
|
|
74
74
|
if (input.hookResource !== "issue") return [];
|
|
75
75
|
const parsed = issueWebhookSchema.safeParse(input.body);
|
|
76
76
|
if (!parsed.success || parsed.data.action !== "created") return [];
|
|
@@ -148,14 +148,14 @@ function createSentryWebhookRoute(args) {
|
|
|
148
148
|
status: 503
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
const events =
|
|
151
|
+
const events = normalizeSentryEvents({
|
|
152
152
|
body,
|
|
153
153
|
hookResource,
|
|
154
154
|
hookTimestamp: request.headers.get("sentry-hook-timestamp")?.trim() || void 0,
|
|
155
155
|
webhookOrg
|
|
156
156
|
});
|
|
157
157
|
for (const event of events) {
|
|
158
|
-
await args.
|
|
158
|
+
await args.events.publish(event);
|
|
159
159
|
}
|
|
160
160
|
return new Response(events.length ? "Accepted" : "Ignored", {
|
|
161
161
|
status: 202
|
|
@@ -176,7 +176,7 @@ export {
|
|
|
176
176
|
SENTRY_ISSUE_EVENTS,
|
|
177
177
|
sentryIssueResource,
|
|
178
178
|
sentryProjectResource,
|
|
179
|
-
|
|
179
|
+
normalizeSentryEvents,
|
|
180
180
|
createSentryWebhookRoute,
|
|
181
181
|
sentryWebhookSecret,
|
|
182
182
|
sentryWebhookOrg
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This package owns per-user Sentry OAuth, CLI setup, internal-integration
|
|
5
5
|
* issue webhook normalization, and Sentry resource identities. Junior core owns
|
|
6
|
-
* watches and event
|
|
6
|
+
* watches and event automations.
|
|
7
7
|
*/
|
|
8
8
|
import { type PluginRegistration } from "@sentry/junior-plugin-api";
|
|
9
|
-
/** Register Sentry runtime metadata and signed
|
|
9
|
+
/** Register Sentry runtime metadata and signed event ingress. */
|
|
10
10
|
export declare function sentryPlugin(): PluginRegistration;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
createSentryWebhookRoute,
|
|
4
4
|
sentryWebhookOrg,
|
|
5
5
|
sentryWebhookSecret
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UITYE7V6.js";
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
function sentryPlugin() {
|
|
13
13
|
return defineJuniorPlugin({
|
|
14
14
|
packageName: "@sentry/junior-sentry",
|
|
15
|
-
|
|
15
|
+
events: {
|
|
16
16
|
resourceTypes: [
|
|
17
17
|
{
|
|
18
18
|
type: "issue",
|
|
@@ -67,7 +67,7 @@ function sentryPlugin() {
|
|
|
67
67
|
routes(ctx) {
|
|
68
68
|
return [
|
|
69
69
|
createSentryWebhookRoute({
|
|
70
|
-
|
|
70
|
+
events: ctx.events,
|
|
71
71
|
webhookOrg: sentryWebhookOrg,
|
|
72
72
|
webhookSecret: sentryWebhookSecret
|
|
73
73
|
})
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { sentryIssueResource, sentryProjectResource
|
|
1
|
+
export { sentryIssueResource, sentryProjectResource } from "./events/issue.js";
|
|
2
2
|
export { createSentryWebhookRoute } from "./webhooks/handler.js";
|
|
3
|
-
export {
|
|
3
|
+
export { normalizeSentryEvents } from "./webhooks/events.js";
|
|
4
4
|
export { sentryWebhookOrg, sentryWebhookSecret } from "./webhooks/secret.js";
|
package/dist/testing.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSentryWebhookRoute,
|
|
3
|
-
|
|
3
|
+
normalizeSentryEvents,
|
|
4
4
|
sentryIssueResource,
|
|
5
5
|
sentryProjectResource,
|
|
6
6
|
sentryWebhookOrg,
|
|
7
7
|
sentryWebhookSecret
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UITYE7V6.js";
|
|
9
9
|
export {
|
|
10
10
|
createSentryWebhookRoute,
|
|
11
|
-
|
|
11
|
+
normalizeSentryEvents,
|
|
12
12
|
sentryIssueResource,
|
|
13
13
|
sentryProjectResource,
|
|
14
14
|
sentryWebhookOrg,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EventInput } from "@sentry/junior-plugin-api";
|
|
2
2
|
/** Normalize one verified Sentry webhook into issue- and project-scoped events. */
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function normalizeSentryEvents(input: {
|
|
4
4
|
body: unknown;
|
|
5
5
|
hookResource: string;
|
|
6
6
|
hookTimestamp?: string;
|
|
7
7
|
webhookOrg: string;
|
|
8
|
-
}):
|
|
8
|
+
}): EventInput[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PluginRoute,
|
|
2
|
-
/** Create the public, signed Sentry
|
|
1
|
+
import type { PluginRoute, EventPublisher } from "@sentry/junior-plugin-api";
|
|
2
|
+
/** Create the public, signed Sentry event webhook route. */
|
|
3
3
|
export declare function createSentryWebhookRoute(args: {
|
|
4
|
-
|
|
4
|
+
events: EventPublisher;
|
|
5
5
|
webhookOrg(): string | undefined;
|
|
6
6
|
webhookSecret(): string | undefined;
|
|
7
7
|
}): PluginRoute;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-sentry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.208.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"zod": "^4.5.4",
|
|
30
|
-
"@sentry/junior-plugin-api": "0.
|
|
30
|
+
"@sentry/junior-plugin-api": "0.208.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@oxlint/plugins": "1.79.0",
|
|
File without changes
|