@sentry/junior-vercel 0.206.0 → 0.207.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-KZ3UAYBP.js → chunk-OSURIHYH.js} +9 -9
- package/dist/index.js +3 -3
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +3 -3
- package/dist/webhooks/events.d.ts +11 -0
- package/dist/webhooks/handler.d.ts +2 -2
- package/package.json +2 -2
- package/skills/vercel/SKILL.md +1 -1
- package/dist/webhooks/resource-events.d.ts +0 -11
- /package/dist/{resource-events → events}/deployment.d.ts +0 -0
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ Supported scopes (`deployment` resource type):
|
|
|
51
51
|
- `<project-id>:production` for every production deployment
|
|
52
52
|
- `<project-id>:production:<sha>` for one commit-scoped deployment
|
|
53
53
|
|
|
54
|
-
Create the conversation watch or event
|
|
54
|
+
Create the conversation watch or event automation before the terminal deployment event. A valid webhook delivery does not create a watch by itself, and unmatched deliveries are not replayed later.
|
|
55
55
|
|
|
56
56
|
## Auth model
|
|
57
57
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/events/deployment.ts
|
|
2
2
|
var VERCEL_DEPLOYMENT_EVENTS = [
|
|
3
3
|
"deployment.succeeded",
|
|
4
4
|
"deployment.error",
|
|
@@ -129,7 +129,7 @@ function createVercelDeploymentTool(ctx) {
|
|
|
129
129
|
const projectId = z2.object({ id: vercelProjectIdSchema }).parse(parsed).id;
|
|
130
130
|
const commitSha2 = input.commitSha?.toLowerCase();
|
|
131
131
|
const deploymentTarget2 = input.target ?? (commitSha2 ? "production" : void 0);
|
|
132
|
-
const subscribable = ctx.
|
|
132
|
+
const subscribable = ctx.events.canSubscribe ? vercelDeploymentSubscribable({
|
|
133
133
|
commitSha: commitSha2,
|
|
134
134
|
projectId,
|
|
135
135
|
target: deploymentTarget2,
|
|
@@ -149,7 +149,7 @@ function createVercelDeploymentTool(ctx) {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
// src/webhooks/
|
|
152
|
+
// src/webhooks/events.ts
|
|
153
153
|
import { z as z3 } from "zod";
|
|
154
154
|
var deploymentIdSchema = z3.string().regex(/^dpl_[A-Za-z0-9]+$/);
|
|
155
155
|
var commitShaSchema2 = z3.string().regex(/^[0-9a-f]{40}$/i);
|
|
@@ -234,7 +234,7 @@ function deploymentTargets(input) {
|
|
|
234
234
|
}
|
|
235
235
|
return targets;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function normalizeVercelEvents(args) {
|
|
238
238
|
const envelope = webhookEnvelopeSchema.safeParse(args.body);
|
|
239
239
|
if (!envelope.success || !isDeploymentEvent(envelope.data.type)) return [];
|
|
240
240
|
const payload = deploymentPayloadSchema.safeParse(envelope.data.payload);
|
|
@@ -296,11 +296,11 @@ function createVercelWebhookRoute(args) {
|
|
|
296
296
|
if (body === void 0) {
|
|
297
297
|
return new Response("Malformed Vercel webhook", { status: 400 });
|
|
298
298
|
}
|
|
299
|
-
const
|
|
300
|
-
for (const event of
|
|
301
|
-
await args.
|
|
299
|
+
const events = normalizeVercelEvents({ body });
|
|
300
|
+
for (const event of events) {
|
|
301
|
+
await args.events.publish(event);
|
|
302
302
|
}
|
|
303
|
-
return new Response(
|
|
303
|
+
return new Response(events.length ? "Accepted" : "Ignored", {
|
|
304
304
|
status: 202
|
|
305
305
|
});
|
|
306
306
|
}
|
|
@@ -312,6 +312,6 @@ export {
|
|
|
312
312
|
VERCEL_DEPLOYMENT_SUGGESTED_EVENTS,
|
|
313
313
|
vercelWebhookSecret,
|
|
314
314
|
createVercelDeploymentTool,
|
|
315
|
-
|
|
315
|
+
normalizeVercelEvents,
|
|
316
316
|
createVercelWebhookRoute
|
|
317
317
|
};
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
createVercelDeploymentTool,
|
|
5
5
|
createVercelWebhookRoute,
|
|
6
6
|
vercelWebhookSecret
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OSURIHYH.js";
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
10
|
import {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
function vercelPlugin() {
|
|
14
14
|
return defineJuniorPlugin({
|
|
15
15
|
packageName: "@sentry/junior-vercel",
|
|
16
|
-
|
|
16
|
+
events: {
|
|
17
17
|
resourceTypes: [
|
|
18
18
|
{
|
|
19
19
|
type: "deployment",
|
|
@@ -51,7 +51,7 @@ function vercelPlugin() {
|
|
|
51
51
|
routes(ctx) {
|
|
52
52
|
return [
|
|
53
53
|
createVercelWebhookRoute({
|
|
54
|
-
|
|
54
|
+
events: ctx.events,
|
|
55
55
|
webhookSecret: vercelWebhookSecret
|
|
56
56
|
})
|
|
57
57
|
];
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { createVercelDeploymentTool } from "./tools/deployment.js";
|
|
2
2
|
export { createVercelWebhookRoute } from "./webhooks/handler.js";
|
|
3
|
-
export {
|
|
3
|
+
export { normalizeVercelEvents } from "./webhooks/events.js";
|
package/dist/testing.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createVercelDeploymentTool,
|
|
3
3
|
createVercelWebhookRoute,
|
|
4
|
-
|
|
5
|
-
} from "./chunk-
|
|
4
|
+
normalizeVercelEvents
|
|
5
|
+
} from "./chunk-OSURIHYH.js";
|
|
6
6
|
export {
|
|
7
7
|
createVercelDeploymentTool,
|
|
8
8
|
createVercelWebhookRoute,
|
|
9
|
-
|
|
9
|
+
normalizeVercelEvents
|
|
10
10
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owns Vercel's deployment webhook wire-format boundary.
|
|
3
|
+
*
|
|
4
|
+
* It validates webhook payloads, ignores unsupported or incomplete deliveries,
|
|
5
|
+
* and emits canonical events for project, target, and commit watches.
|
|
6
|
+
*/
|
|
7
|
+
import type { EventInput } from "@sentry/junior-plugin-api";
|
|
8
|
+
/** Normalize one verified Vercel delivery into deployment events. */
|
|
9
|
+
export declare function normalizeVercelEvents(args: {
|
|
10
|
+
body: unknown;
|
|
11
|
+
}): EventInput[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PluginRoute,
|
|
1
|
+
import type { PluginRoute, EventPublisher } from "@sentry/junior-plugin-api";
|
|
2
2
|
/** Create the public, signed Vercel deployment webhook route. */
|
|
3
3
|
export declare function createVercelWebhookRoute(args: {
|
|
4
|
-
|
|
4
|
+
events: EventPublisher;
|
|
5
5
|
webhookSecret(): string | undefined;
|
|
6
6
|
}): PluginRoute;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-vercel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.207.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.207.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@oxlint/plugins": "1.79.0",
|
package/skills/vercel/SKILL.md
CHANGED
|
@@ -37,7 +37,7 @@ Do not run `deploy`, `rollback`, `promote`, `remove`, `env`, `alias`, `dns`, `pr
|
|
|
37
37
|
- For runtime logs, prefer `vercel logs --project <project> --since <window> --limit 20 --json` plus user-provided filters such as `--environment`, `--level`, `--status-code`, `--source`, `--query`, or `--deployment`.
|
|
38
38
|
- Use `vercel inspect <deployment-id-or-url> --logs` for build logs. Add `--wait` only when the user explicitly wants to wait for an active build; also bound it with `--timeout`.
|
|
39
39
|
- Use `vercel list <project>` or `vercel ls <project>` to find deployments. Prefer filters such as `--status`, `--environment`, `--prod`, or `--meta githubCommitSha=<sha>` when available.
|
|
40
|
-
- For a deployment watch or event
|
|
40
|
+
- For a deployment watch or event automation, call the `vercel_deployment` plugin tool with the project name and optional team slug or ID. Omit `commitSha` to watch every deployment for the project; add `target` (`production`, `preview`, or `staging`) to limit the watch to one environment; add a full 40-character `commitSha` to watch one deployment (`target` defaults to `production` when omitted with a commit). The tool resolves the canonical project ID through Vercel before Junior creates the conversation subscription or event automation.
|
|
41
41
|
- Use `--follow` only when the user asks for live logs, and stop once enough evidence is captured. Do not leave a streaming command running indefinitely.
|
|
42
42
|
|
|
43
43
|
3. Bound and minimize output:
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Owns Vercel's deployment webhook wire-format boundary.
|
|
3
|
-
*
|
|
4
|
-
* It validates webhook payloads, ignores unsupported or incomplete deliveries,
|
|
5
|
-
* and emits canonical resource events for project, target, and commit watches.
|
|
6
|
-
*/
|
|
7
|
-
import type { ResourceEventInput } from "@sentry/junior-plugin-api";
|
|
8
|
-
/** Normalize one verified Vercel delivery into deployment resource events. */
|
|
9
|
-
export declare function normalizeVercelResourceEvents(args: {
|
|
10
|
-
body: unknown;
|
|
11
|
-
}): ResourceEventInput[];
|
|
File without changes
|