@sentry/junior-vercel 0.126.1 → 0.127.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.
@@ -1,16 +1,3 @@
1
- // src/webhooks/secret.ts
2
- function vercelWebhookSecret() {
3
- return process.env.VERCEL_WEBHOOK_SECRET?.trim() || void 0;
4
- }
5
-
6
- // src/tools/deployment-source.ts
7
- import {
8
- definePluginTool,
9
- pluginToolResultSchema,
10
- subscribableResourceSchema
11
- } from "@sentry/junior-plugin-api";
12
- import { z } from "zod";
13
-
14
1
  // src/resource-events/deployment-source.ts
15
2
  var VERCEL_DEPLOYMENT_EVENTS = [
16
3
  "deployment.succeeded",
@@ -21,8 +8,8 @@ function vercelDeploymentSourceResource(input) {
21
8
  const commitSha2 = input.commitSha.toLowerCase();
22
9
  return {
23
10
  label: `Vercel ${input.target} deployment for ${input.projectId} at ${commitSha2.slice(0, 12)}`,
24
- provider: "vercel",
25
- resourceRef: `vercel:deployment-source:${input.projectId}:${input.target}:${commitSha2}`
11
+ namespace: "vercel",
12
+ identifier: `deployment-source:${input.projectId}:${input.target}:${commitSha2}`
26
13
  };
27
14
  }
28
15
  function vercelDeploymentSourceSubscribable(input) {
@@ -35,7 +22,18 @@ function vercelDeploymentSourceSubscribable(input) {
35
22
  };
36
23
  }
37
24
 
25
+ // src/webhooks/secret.ts
26
+ function vercelWebhookSecret() {
27
+ return process.env.VERCEL_WEBHOOK_SECRET?.trim() || void 0;
28
+ }
29
+
38
30
  // src/tools/deployment-source.ts
31
+ import {
32
+ definePluginTool,
33
+ pluginToolResultSchema,
34
+ subscribableResourceSchema
35
+ } from "@sentry/junior-plugin-api";
36
+ import { z } from "zod";
39
37
  var projectIdSchema = z.string().regex(/^prj_[A-Za-z0-9]+$/);
40
38
  var commitShaSchema = z.string().regex(/^[0-9a-f]{40}$/i);
41
39
  var targetSchema = z.enum(["preview", "production", "staging"]);
@@ -204,8 +202,7 @@ function normalizeVercelResourceEvents(args) {
204
202
  eventKey: `vercel:${envelope.data.id}:${eventType}`,
205
203
  eventType,
206
204
  occurredAtMs: envelope.data.createdAt,
207
- provider: "vercel",
208
- resourceRef: resource.resourceRef,
205
+ identifier: resource.identifier,
209
206
  terminal: true,
210
207
  trustedSummary: `${resource.label} (${deploymentId}) ${outcome}.`
211
208
  }
@@ -255,6 +252,7 @@ function createVercelWebhookRoute(args) {
255
252
  }
256
253
 
257
254
  export {
255
+ VERCEL_DEPLOYMENT_EVENTS,
258
256
  vercelWebhookSecret,
259
257
  createVercelDeploymentSourceTool,
260
258
  normalizeVercelResourceEvents,
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import {
2
+ VERCEL_DEPLOYMENT_EVENTS,
2
3
  createVercelDeploymentSourceTool,
3
4
  createVercelWebhookRoute,
4
5
  vercelWebhookSecret
5
- } from "./chunk-6UEKM742.js";
6
+ } from "./chunk-LA2BZ6FC.js";
6
7
 
7
8
  // src/index.ts
8
9
  import {
@@ -11,6 +12,16 @@ import {
11
12
  function vercelPlugin() {
12
13
  return defineJuniorPlugin({
13
14
  packageName: "@sentry/junior-vercel",
15
+ resourceEvents: {
16
+ resourceTypes: [
17
+ {
18
+ type: "deployment_source",
19
+ supportedEvents: [...VERCEL_DEPLOYMENT_EVENTS],
20
+ suggestedEvents: [...VERCEL_DEPLOYMENT_EVENTS]
21
+ }
22
+ ],
23
+ isEnabled: () => Boolean(vercelWebhookSecret())
24
+ },
14
25
  manifest: {
15
26
  apiHeaders: {
16
27
  Authorization: "Bearer ${JUNIOR_VERCEL_TOKEN}"
@@ -6,7 +6,7 @@ export declare function vercelDeploymentSourceResource(input: {
6
6
  commitSha: string;
7
7
  projectId: string;
8
8
  target: VercelDeploymentTarget;
9
- }): Pick<SubscribableResource, "label" | "provider" | "resourceRef">;
9
+ }): Pick<SubscribableResource, "label" | "namespace" | "identifier">;
10
10
  /** Describe a deployment source when signed Vercel webhooks are enabled. */
11
11
  export declare function vercelDeploymentSourceSubscribable(input: {
12
12
  commitSha: string;
package/dist/testing.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  createVercelDeploymentSourceTool,
3
3
  createVercelWebhookRoute,
4
4
  normalizeVercelResourceEvents
5
- } from "./chunk-6UEKM742.js";
5
+ } from "./chunk-LA2BZ6FC.js";
6
6
  export {
7
7
  createVercelDeploymentSourceTool,
8
8
  createVercelWebhookRoute,
@@ -15,9 +15,9 @@ export declare function createVercelDeploymentSourceTool(ctx: ToolRegistrationHo
15
15
  deploymentTarget: "preview" | "production" | "staging";
16
16
  projectId: string;
17
17
  subscribable?: {
18
+ identifier: string;
18
19
  label: string;
19
- provider: string;
20
- resourceRef: string;
20
+ namespace: string;
21
21
  supportedEvents: string[];
22
22
  type: string;
23
23
  suggestedEvents?: string[] | undefined;
@@ -37,9 +37,9 @@ export declare function createVercelDeploymentSourceTool(ctx: ToolRegistrationHo
37
37
  retryable?: boolean | undefined;
38
38
  } | undefined;
39
39
  subscribable?: {
40
+ identifier: string;
40
41
  label: string;
41
- provider: string;
42
- resourceRef: string;
42
+ namespace: string;
43
43
  supportedEvents: string[];
44
44
  type: string;
45
45
  suggestedEvents?: string[] | undefined;
@@ -54,9 +54,9 @@ export declare function createVercelDeploymentSourceTool(ctx: ToolRegistrationHo
54
54
  deploymentTarget: "preview" | "production" | "staging";
55
55
  projectId: string;
56
56
  subscribable?: {
57
+ identifier: string;
57
58
  label: string;
58
- provider: string;
59
- resourceRef: string;
59
+ namespace: string;
60
60
  supportedEvents: string[];
61
61
  type: string;
62
62
  suggestedEvents?: string[] | undefined;
@@ -76,9 +76,9 @@ export declare function createVercelDeploymentSourceTool(ctx: ToolRegistrationHo
76
76
  retryable?: boolean | undefined;
77
77
  } | undefined;
78
78
  subscribable?: {
79
+ identifier: string;
79
80
  label: string;
80
- provider: string;
81
- resourceRef: string;
81
+ namespace: string;
82
82
  supportedEvents: string[];
83
83
  type: string;
84
84
  suggestedEvents?: string[] | undefined;
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Owns Vercel's deployment webhook wire-format boundary.
3
3
  *
4
- * It validates provider payloads, ignores unsupported or incomplete deliveries,
4
+ * It validates webhook payloads, ignores unsupported or incomplete deliveries,
5
5
  * and emits only canonical terminal resource events.
6
6
  */
7
- import type { ResourceEvent } from "@sentry/junior-plugin-api";
7
+ import type { ResourceEventInput } from "@sentry/junior-plugin-api";
8
8
  /** Normalize one verified Vercel delivery into a terminal deployment event. */
9
9
  export declare function normalizeVercelResourceEvents(args: {
10
10
  body: unknown;
11
- }): ResourceEvent[];
11
+ }): ResourceEventInput[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-vercel",
3
- "version": "0.126.1",
3
+ "version": "0.127.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.4.3",
30
- "@sentry/junior-plugin-api": "0.126.1"
30
+ "@sentry/junior-plugin-api": "0.127.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^25.9.1",