@sentry/junior-vercel 0.159.0 → 0.161.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 +4 -4
- package/dist/{chunk-JPFMGGYE.js → chunk-5K3GVRRE.js} +38 -34
- package/dist/index.js +1 -1
- package/dist/project.d.ts +3 -0
- package/dist/testing.js +1 -1
- package/package.json +2 -2
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
|
|
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
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
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
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var
|
|
59
|
-
var
|
|
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 =
|
|
74
|
+
var deploymentSchema = z2.object({
|
|
70
75
|
commitSha: commitShaSchema.nullable(),
|
|
71
76
|
deploymentTarget: targetSchema.nullable(),
|
|
72
|
-
projectId:
|
|
77
|
+
projectId: vercelProjectIdSchema,
|
|
73
78
|
subscribable: subscribableResourceSchema.optional()
|
|
74
79
|
});
|
|
75
80
|
var outputSchema = pluginToolOutputSchema.extend({
|
|
76
|
-
target:
|
|
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 =
|
|
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
|
|
145
|
-
var
|
|
146
|
-
var
|
|
147
|
-
var
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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 =
|
|
156
|
-
alias:
|
|
157
|
-
deployment:
|
|
159
|
+
var deploymentPayloadSchema = z3.object({
|
|
160
|
+
alias: z3.unknown().optional(),
|
|
161
|
+
deployment: z3.object({
|
|
158
162
|
id: deploymentIdSchema,
|
|
159
|
-
meta:
|
|
160
|
-
name:
|
|
161
|
-
url:
|
|
163
|
+
meta: z3.record(z3.string(), z3.unknown()),
|
|
164
|
+
name: z3.unknown().optional(),
|
|
165
|
+
url: z3.unknown().optional()
|
|
162
166
|
}).strict(),
|
|
163
|
-
links:
|
|
164
|
-
plan:
|
|
165
|
-
project:
|
|
166
|
-
id:
|
|
167
|
-
name:
|
|
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:
|
|
170
|
-
target:
|
|
171
|
-
team:
|
|
172
|
-
user:
|
|
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
package/dist/testing.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-vercel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.161.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.
|
|
30
|
+
"@sentry/junior-plugin-api": "0.161.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^25.9.1",
|