@sentry/junior-vercel 0.160.0 → 0.162.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 CHANGED
@@ -43,13 +43,13 @@ https://<junior-host>/api/webhooks/vercel
43
43
 
44
44
  The endpoint must be publicly reachable. Subscribe it to `deployment.succeeded`, `deployment.error`, and `deployment.canceled`, select the projects Junior should monitor, and save the one-time secret as a sensitive `VERCEL_WEBHOOK_SECRET` value in Junior's Production environment. Redeploy Junior after adding it.
45
45
 
46
- Deployment watches use Vercel's canonical `prj_...` ID. Junior resolves that ID from the project name or ID and optional team slug or ID through Vercel's authenticated project API.
46
+ Deployment watches use Vercel's project ID. Junior resolves that ID from the project name or ID and optional team slug or ID through Vercel's authenticated project API.
47
47
 
48
48
  Supported scopes (`deployment` resource type):
49
49
 
50
- - `prj_...` for every deployment in the project
51
- - `prj_...:production` for every production deployment
52
- - `prj_...:production:<sha>` for one commit-scoped deployment
50
+ - `<project-id>` for every deployment in the project
51
+ - `<project-id>:production` for every production deployment
52
+ - `<project-id>:production:<sha>` for one commit-scoped deployment
53
53
 
54
54
  Create the conversation watch or event task 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
 
@@ -51,12 +51,17 @@ import {
51
51
  pluginToolOutputSchema,
52
52
  subscribableResourceSchema
53
53
  } from "@sentry/junior-plugin-api";
54
+ import { z as z2 } from "zod";
55
+
56
+ // src/project.ts
54
57
  import { z } from "zod";
55
- var projectIdSchema = z.string().regex(/^prj_[A-Za-z0-9]+$/);
56
- var commitShaSchema = z.string().regex(/^[0-9a-f]{40}$/i);
57
- var targetSchema = z.enum(["preview", "production", "staging"]);
58
- var nonEmptyStringSchema = z.string().trim().min(1);
59
- var inputSchema = z.object({
58
+ var vercelProjectIdSchema = z.string().trim().min(1);
59
+
60
+ // src/tools/deployment.ts
61
+ var commitShaSchema = z2.string().regex(/^[0-9a-f]{40}$/i);
62
+ var targetSchema = z2.enum(["preview", "production", "staging"]);
63
+ var nonEmptyStringSchema = z2.string().trim().min(1);
64
+ var inputSchema = z2.object({
60
65
  commitSha: commitShaSchema.describe(
61
66
  "Optional full 40-character Git commit SHA. Provide it to watch one deployment; omit it to watch every matching deployment for the project."
62
67
  ).optional(),
@@ -66,14 +71,14 @@ var inputSchema = z.object({
66
71
  ).optional(),
67
72
  team: nonEmptyStringSchema.describe("Optional Vercel team slug or team_ ID that owns the project.").optional()
68
73
  }).strict();
69
- var deploymentSchema = z.object({
74
+ var deploymentSchema = z2.object({
70
75
  commitSha: commitShaSchema.nullable(),
71
76
  deploymentTarget: targetSchema.nullable(),
72
- projectId: projectIdSchema,
77
+ projectId: vercelProjectIdSchema,
73
78
  subscribable: subscribableResourceSchema.optional()
74
79
  });
75
80
  var outputSchema = pluginToolOutputSchema.extend({
76
- target: z.literal("deployment"),
81
+ target: z2.literal("deployment"),
77
82
  ...deploymentSchema.shape
78
83
  });
79
84
  async function readJson(response) {
@@ -117,7 +122,7 @@ function createVercelDeploymentTool(ctx) {
117
122
  `Vercel project lookup failed with HTTP ${response.status}`
118
123
  );
119
124
  }
120
- const projectId = z.object({ id: projectIdSchema }).parse(parsed).id;
125
+ const projectId = z2.object({ id: vercelProjectIdSchema }).parse(parsed).id;
121
126
  const commitSha2 = input.commitSha?.toLowerCase();
122
127
  const deploymentTarget2 = input.target ?? (commitSha2 ? "production" : void 0);
123
128
  const subscribable = ctx.resourceEvents.canSubscribe ? vercelDeploymentSubscribable({
@@ -141,35 +146,34 @@ function createVercelDeploymentTool(ctx) {
141
146
  }
142
147
 
143
148
  // src/webhooks/resource-events.ts
144
- import { z as z2 } from "zod";
145
- var projectIdSchema2 = z2.string().regex(/^prj_[A-Za-z0-9]+$/);
146
- var deploymentIdSchema = z2.string().regex(/^dpl_[A-Za-z0-9]+$/);
147
- var commitShaSchema2 = z2.string().regex(/^[0-9a-f]{40}$/i);
148
- var webhookEnvelopeSchema = z2.object({
149
- createdAt: z2.number().finite(),
150
- id: z2.string().min(1),
151
- payload: z2.unknown(),
152
- region: z2.unknown().optional(),
153
- type: z2.string().min(1)
149
+ import { z as z3 } from "zod";
150
+ var deploymentIdSchema = z3.string().regex(/^dpl_[A-Za-z0-9]+$/);
151
+ var commitShaSchema2 = z3.string().regex(/^[0-9a-f]{40}$/i);
152
+ var webhookEnvelopeSchema = z3.object({
153
+ createdAt: z3.number().finite(),
154
+ id: z3.string().min(1),
155
+ payload: z3.unknown(),
156
+ region: z3.unknown().optional(),
157
+ type: z3.string().min(1)
154
158
  }).strict();
155
- var deploymentPayloadSchema = z2.object({
156
- alias: z2.unknown().optional(),
157
- deployment: z2.object({
159
+ var deploymentPayloadSchema = z3.object({
160
+ alias: z3.unknown().optional(),
161
+ deployment: z3.object({
158
162
  id: deploymentIdSchema,
159
- meta: z2.record(z2.string(), z2.unknown()),
160
- name: z2.unknown().optional(),
161
- url: z2.unknown().optional()
163
+ meta: z3.record(z3.string(), z3.unknown()),
164
+ name: z3.unknown().optional(),
165
+ url: z3.unknown().optional()
162
166
  }).strict(),
163
- links: z2.unknown().optional(),
164
- plan: z2.unknown().optional(),
165
- project: z2.object({
166
- id: projectIdSchema2,
167
- name: z2.unknown().optional()
167
+ links: z3.unknown().optional(),
168
+ plan: z3.unknown().optional(),
169
+ project: z3.object({
170
+ id: vercelProjectIdSchema,
171
+ name: z3.unknown().optional()
168
172
  }).strict(),
169
- regions: z2.unknown().optional(),
170
- target: z2.string().nullable(),
171
- team: z2.unknown().optional(),
172
- user: z2.unknown().optional()
173
+ regions: z3.unknown().optional(),
174
+ target: z3.string().nullable(),
175
+ team: z3.unknown().optional(),
176
+ user: z3.unknown().optional()
173
177
  }).strict().transform((payload) => ({
174
178
  commitSha: commitSha(payload.deployment.meta),
175
179
  deploymentId: payload.deployment.id,
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  createVercelDeploymentTool,
5
5
  createVercelWebhookRoute,
6
6
  vercelWebhookSecret
7
- } from "./chunk-JPFMGGYE.js";
7
+ } from "./chunk-5K3GVRRE.js";
8
8
 
9
9
  // src/index.ts
10
10
  import {
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ /** Accept the opaque project identifier returned by Vercel. */
3
+ export declare const vercelProjectIdSchema: z.ZodString;
package/dist/testing.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  createVercelDeploymentTool,
3
3
  createVercelWebhookRoute,
4
4
  normalizeVercelResourceEvents
5
- } from "./chunk-JPFMGGYE.js";
5
+ } from "./chunk-5K3GVRRE.js";
6
6
  export {
7
7
  createVercelDeploymentTool,
8
8
  createVercelWebhookRoute,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-vercel",
3
- "version": "0.160.0",
3
+ "version": "0.162.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.160.0"
30
+ "@sentry/junior-plugin-api": "0.162.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^25.9.1",