@sentry/junior-vercel 0.263.0 → 0.265.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
|
@@ -51,6 +51,14 @@ 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
|
+
Each event has the name of the Vercel webhook that it comes from:
|
|
55
|
+
|
|
56
|
+
- `deployment.succeeded`: the deployment is ready.
|
|
57
|
+
- `deployment.error`: the deployment failed. This is the same as GitHub `deployment.failed`, not GitHub `deployment.error`.
|
|
58
|
+
- `deployment.canceled`: the deployment was canceled.
|
|
59
|
+
|
|
60
|
+
All three events end a commit-scoped watch. Project and target watches stay active.
|
|
61
|
+
|
|
54
62
|
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
63
|
|
|
56
64
|
## Auth model
|
|
@@ -30,7 +30,7 @@ function vercelDeploymentResource(input) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function vercelDeploymentSubscribable(input) {
|
|
33
|
-
if (!input.
|
|
33
|
+
if (!input.canSubscribe) return void 0;
|
|
34
34
|
if (input.commitSha && !input.target) return void 0;
|
|
35
35
|
return {
|
|
36
36
|
...vercelDeploymentResource(input),
|
|
@@ -40,11 +40,6 @@ function vercelDeploymentSubscribable(input) {
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// src/webhooks/secret.ts
|
|
44
|
-
function vercelWebhookSecret() {
|
|
45
|
-
return process.env.VERCEL_WEBHOOK_SECRET?.trim() || void 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
43
|
// src/tools/deployment.ts
|
|
49
44
|
import {
|
|
50
45
|
definePluginTool,
|
|
@@ -129,12 +124,12 @@ function createVercelDeploymentTool(ctx) {
|
|
|
129
124
|
const projectId = z2.object({ id: vercelProjectIdSchema }).parse(parsed).id;
|
|
130
125
|
const commitSha2 = input.commitSha?.toLowerCase();
|
|
131
126
|
const deploymentTarget2 = input.target ?? (commitSha2 ? "production" : void 0);
|
|
132
|
-
const subscribable =
|
|
127
|
+
const subscribable = vercelDeploymentSubscribable({
|
|
128
|
+
canSubscribe: ctx.events.canSubscribe,
|
|
133
129
|
commitSha: commitSha2,
|
|
134
130
|
projectId,
|
|
135
|
-
target: deploymentTarget2
|
|
136
|
-
|
|
137
|
-
}) : void 0;
|
|
131
|
+
target: deploymentTarget2
|
|
132
|
+
});
|
|
138
133
|
const data = {
|
|
139
134
|
commitSha: commitSha2 ?? null,
|
|
140
135
|
deploymentTarget: deploymentTarget2 ?? null,
|
|
@@ -300,7 +295,6 @@ function createVercelWebhookRoute(args) {
|
|
|
300
295
|
export {
|
|
301
296
|
VERCEL_DEPLOYMENT_EVENTS,
|
|
302
297
|
VERCEL_DEPLOYMENT_SUGGESTED_EVENTS,
|
|
303
|
-
vercelWebhookSecret,
|
|
304
298
|
createVercelDeploymentTool,
|
|
305
299
|
normalizeVercelEvents,
|
|
306
300
|
createVercelWebhookRoute
|
|
@@ -8,10 +8,14 @@ export declare function vercelDeploymentResource(input: {
|
|
|
8
8
|
projectId: string;
|
|
9
9
|
target?: VercelDeploymentTarget;
|
|
10
10
|
}): Pick<SubscribableResource, "label" | "namespace" | "identifier">;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Describe a deployment resource that a conversation can watch.
|
|
13
|
+
* Return undefined when the host cannot create Watches.
|
|
14
|
+
*/
|
|
12
15
|
export declare function vercelDeploymentSubscribable(input: {
|
|
16
|
+
/** `ctx.events.canSubscribe` from the tool context. */
|
|
17
|
+
canSubscribe: boolean;
|
|
13
18
|
commitSha?: string;
|
|
14
19
|
projectId: string;
|
|
15
20
|
target?: VercelDeploymentTarget;
|
|
16
|
-
webhookSecret?: string;
|
|
17
21
|
}): SubscribableResource | undefined;
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,8 @@ import {
|
|
|
2
2
|
VERCEL_DEPLOYMENT_EVENTS,
|
|
3
3
|
VERCEL_DEPLOYMENT_SUGGESTED_EVENTS,
|
|
4
4
|
createVercelDeploymentTool,
|
|
5
|
-
createVercelWebhookRoute
|
|
6
|
-
|
|
7
|
-
} from "./chunk-VXKYUJID.js";
|
|
5
|
+
createVercelWebhookRoute
|
|
6
|
+
} from "./chunk-XALO46RT.js";
|
|
8
7
|
|
|
9
8
|
// src/index.ts
|
|
10
9
|
import {
|
|
@@ -289,6 +288,11 @@ function createVercelActionTools(ctx) {
|
|
|
289
288
|
};
|
|
290
289
|
}
|
|
291
290
|
|
|
291
|
+
// src/webhooks/secret.ts
|
|
292
|
+
function vercelWebhookSecret() {
|
|
293
|
+
return process.env.VERCEL_WEBHOOK_SECRET?.trim() || void 0;
|
|
294
|
+
}
|
|
295
|
+
|
|
292
296
|
// src/index.ts
|
|
293
297
|
function vercelPlugin() {
|
|
294
298
|
return defineJuniorPlugin({
|
package/dist/testing.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Read the normalized secret shared by
|
|
1
|
+
/** Read the normalized secret shared by plugin enablement and webhook ingress. */
|
|
2
2
|
export declare function vercelWebhookSecret(): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-vercel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.265.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.265.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@oxlint/plugins": "1.79.0",
|