@sentry/junior-vercel 0.275.0 → 0.277.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/dist/{chunk-APG6SIOV.js → chunk-AGYUD7NE.js} +14 -14
- package/dist/index.js +21 -21
- package/dist/testing.js +1 -1
- package/dist/tools/actions.d.ts +25 -25
- package/dist/tools/deployment.d.ts +11 -11
- package/package.json +2 -2
|
@@ -67,12 +67,12 @@ function vercelDeploymentSubscribable(input) {
|
|
|
67
67
|
return {
|
|
68
68
|
...vercelDeploymentResource(input),
|
|
69
69
|
match: {
|
|
70
|
-
|
|
70
|
+
project_id: input.projectId,
|
|
71
71
|
...input.target ? { target: input.target } : void 0,
|
|
72
|
-
...input.commitSha ? {
|
|
72
|
+
...input.commitSha ? { commit_sha: input.commitSha.toLowerCase() } : void 0
|
|
73
73
|
},
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
suggested_events: VERCEL_DEPLOYMENT_SUGGESTED_EVENTS,
|
|
75
|
+
supported_events: [...VERCEL_DEPLOYMENT_EVENTS],
|
|
76
76
|
type: "deployment"
|
|
77
77
|
};
|
|
78
78
|
}
|
|
@@ -95,19 +95,19 @@ var commitShaSchema = z2.string().regex(/^[0-9a-f]{40}$/i);
|
|
|
95
95
|
var targetSchema = z2.enum(["preview", "production", "staging"]);
|
|
96
96
|
var nonEmptyStringSchema = z2.string().trim().min(1);
|
|
97
97
|
var inputSchema = z2.object({
|
|
98
|
-
|
|
98
|
+
commit_sha: commitShaSchema.describe(
|
|
99
99
|
"Optional full 40-character Git commit SHA. Provide it to watch one deployment; omit it to watch every matching deployment for the project."
|
|
100
100
|
).optional(),
|
|
101
101
|
project: nonEmptyStringSchema.describe("Vercel project name or prj_ ID."),
|
|
102
102
|
target: targetSchema.describe(
|
|
103
|
-
'Optional deployment target such as "production". Omit to watch every target for the project. Defaults to "production" when
|
|
103
|
+
'Optional deployment target such as "production". Omit to watch every target for the project. Defaults to "production" when commit_sha is set.'
|
|
104
104
|
).optional(),
|
|
105
105
|
team: nonEmptyStringSchema.describe("Optional Vercel team slug or team_ ID that owns the project.").optional()
|
|
106
106
|
}).strict();
|
|
107
107
|
var deploymentSchema = z2.object({
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
commit_sha: commitShaSchema.nullable(),
|
|
109
|
+
deployment_target: targetSchema.nullable(),
|
|
110
|
+
project_id: vercelProjectIdSchema,
|
|
111
111
|
subscribable: subscribableResourceSchema.optional()
|
|
112
112
|
});
|
|
113
113
|
var outputSchema = pluginToolOutputSchema.merge(
|
|
@@ -141,7 +141,7 @@ function createVercelDeploymentTool(ctx) {
|
|
|
141
141
|
openWorldHint: true,
|
|
142
142
|
readOnlyHint: true
|
|
143
143
|
},
|
|
144
|
-
description: "Resolve a Vercel project name or ID and describe a subscribable deployment resource. Omit
|
|
144
|
+
description: "Resolve a Vercel project name or ID and describe a subscribable deployment resource. Omit commit_sha to watch every deployment for the project, optionally limited to one target (production, preview, or staging). Provide commit_sha to watch one deployment; target defaults to production when omitted with commit_sha. Use the user's explicit project and team, otherwise the vercel.project and vercel.team conversation defaults.",
|
|
145
145
|
inputSchema,
|
|
146
146
|
outputSchema,
|
|
147
147
|
async execute(input) {
|
|
@@ -159,7 +159,7 @@ function createVercelDeploymentTool(ctx) {
|
|
|
159
159
|
throw new Error(message);
|
|
160
160
|
}
|
|
161
161
|
const projectId = z2.object({ id: vercelProjectIdSchema }).parse(parsed).id;
|
|
162
|
-
const commitSha = input.
|
|
162
|
+
const commitSha = input.commit_sha?.toLowerCase();
|
|
163
163
|
const deploymentTarget = input.target ?? (commitSha ? "production" : void 0);
|
|
164
164
|
const subscribable = vercelDeploymentSubscribable({
|
|
165
165
|
canSubscribe: ctx.events.canSubscribe,
|
|
@@ -168,9 +168,9 @@ function createVercelDeploymentTool(ctx) {
|
|
|
168
168
|
target: deploymentTarget
|
|
169
169
|
});
|
|
170
170
|
const data = {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
projectId,
|
|
171
|
+
commit_sha: commitSha ?? null,
|
|
172
|
+
deployment_target: deploymentTarget ?? null,
|
|
173
|
+
project_id: projectId,
|
|
174
174
|
...subscribable ? { subscribable } : void 0
|
|
175
175
|
};
|
|
176
176
|
return {
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
VERCEL_DEPLOYMENT_SUGGESTED_EVENTS,
|
|
5
5
|
createVercelDeploymentTool,
|
|
6
6
|
createVercelWebhookRoute
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AGYUD7NE.js";
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
10
|
import {
|
|
@@ -22,7 +22,7 @@ var text = z.string().trim().min(1);
|
|
|
22
22
|
var team = text.describe(
|
|
23
23
|
"Vercel team slug or team_ ID. Omit for the token's default account."
|
|
24
24
|
).optional();
|
|
25
|
-
var
|
|
25
|
+
var deploymentIdSchema = z.string().regex(/^dpl_[a-zA-Z0-9]+$/).describe("Exact Vercel deployment ID, not an alias.");
|
|
26
26
|
var aliasName = z.string().regex(/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?\.[a-z]{2,}$/).describe("Alias hostname without a scheme or path.");
|
|
27
27
|
var deploymentSchema = z.object({
|
|
28
28
|
id: text,
|
|
@@ -34,12 +34,12 @@ var deploymentSchema = z.object({
|
|
|
34
34
|
});
|
|
35
35
|
var deploymentOutput = pluginToolOutputSchema.extend({
|
|
36
36
|
target: z.literal("deployment"),
|
|
37
|
-
|
|
37
|
+
deployment_id: text,
|
|
38
38
|
url: text,
|
|
39
39
|
state: text,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
deployment_target: z.string().nullable(),
|
|
41
|
+
project_id: text.nullable(),
|
|
42
|
+
commit_sha: text.nullable(),
|
|
43
43
|
ref: text.nullable()
|
|
44
44
|
});
|
|
45
45
|
var aliasSchema = z.object({
|
|
@@ -50,19 +50,19 @@ var aliasSchema = z.object({
|
|
|
50
50
|
var aliasOutput = pluginToolOutputSchema.extend({
|
|
51
51
|
target: z.literal("alias"),
|
|
52
52
|
alias: text,
|
|
53
|
-
|
|
53
|
+
deployment_id: text.nullable(),
|
|
54
54
|
redirect: text.nullable()
|
|
55
55
|
});
|
|
56
56
|
function deploymentResult(data) {
|
|
57
57
|
const value = deploymentSchema.parse(data);
|
|
58
58
|
return {
|
|
59
59
|
target: "deployment",
|
|
60
|
-
|
|
60
|
+
deployment_id: value.id,
|
|
61
61
|
url: `https://${value.url}`,
|
|
62
62
|
state: value.readyState,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
deployment_target: value.target ?? null,
|
|
64
|
+
project_id: value.projectId ?? null,
|
|
65
|
+
commit_sha: value.gitSource?.sha ?? null,
|
|
66
66
|
ref: value.gitSource?.ref ?? null,
|
|
67
67
|
objectAnnotations: [
|
|
68
68
|
{
|
|
@@ -127,7 +127,7 @@ function createVercelActionTools(ctx) {
|
|
|
127
127
|
return {
|
|
128
128
|
target: "alias",
|
|
129
129
|
alias: result.alias,
|
|
130
|
-
|
|
130
|
+
deployment_id: result.deploymentId,
|
|
131
131
|
redirect: result.redirect ?? null
|
|
132
132
|
};
|
|
133
133
|
}
|
|
@@ -146,7 +146,7 @@ function createVercelActionTools(ctx) {
|
|
|
146
146
|
ref: text.describe(
|
|
147
147
|
"Git branch, tag, or full commit SHA in the project's linked repository."
|
|
148
148
|
),
|
|
149
|
-
|
|
149
|
+
commit_sha: z.string().regex(/^[a-f0-9]{40}$/i).describe(
|
|
150
150
|
"Full commit SHA to pin the source while retaining branch context in ref."
|
|
151
151
|
).optional(),
|
|
152
152
|
target: z.enum(["preview", "production"]).describe("Deployment environment; defaults to preview.").optional()
|
|
@@ -175,7 +175,7 @@ function createVercelActionTools(ctx) {
|
|
|
175
175
|
type: "github",
|
|
176
176
|
repoId: project.link.repoId,
|
|
177
177
|
ref: input.ref,
|
|
178
|
-
sha: input.
|
|
178
|
+
sha: input.commit_sha?.toLowerCase()
|
|
179
179
|
};
|
|
180
180
|
return deploymentResult(
|
|
181
181
|
await request(
|
|
@@ -227,12 +227,12 @@ function createVercelActionTools(ctx) {
|
|
|
227
227
|
readOnlyHint: false
|
|
228
228
|
},
|
|
229
229
|
description: "Assign an alias hostname to a deployment ID. This can replace live traffic. Reads the alias back and returns matches=false if its target changed or it redirects.",
|
|
230
|
-
inputSchema: z.object({
|
|
230
|
+
inputSchema: z.object({ deployment_id: deploymentIdSchema, alias: aliasName, team }).strict(),
|
|
231
231
|
outputSchema: aliasOutput.extend({ matches: z.boolean() }),
|
|
232
232
|
async execute(input) {
|
|
233
233
|
await request(
|
|
234
234
|
"vercel.alias.assign",
|
|
235
|
-
`/v2/deployments/${encodeURIComponent(input.
|
|
235
|
+
`/v2/deployments/${encodeURIComponent(input.deployment_id)}/aliases`,
|
|
236
236
|
input.team,
|
|
237
237
|
"POST",
|
|
238
238
|
{ alias: input.alias }
|
|
@@ -240,7 +240,7 @@ function createVercelActionTools(ctx) {
|
|
|
240
240
|
const result = await inspectAlias(input.alias, input.team);
|
|
241
241
|
return {
|
|
242
242
|
...result,
|
|
243
|
-
matches: result.
|
|
243
|
+
matches: result.deployment_id === input.deployment_id && !result.redirect
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
246
|
}),
|
|
@@ -266,22 +266,22 @@ function createVercelActionTools(ctx) {
|
|
|
266
266
|
readOnlyHint: false
|
|
267
267
|
},
|
|
268
268
|
description: "Delete a Vercel deployment by ID. This can remove a live deployment. Does not delete its database or other external state.",
|
|
269
|
-
inputSchema: z.object({
|
|
269
|
+
inputSchema: z.object({ deployment_id: deploymentIdSchema, team }).strict(),
|
|
270
270
|
outputSchema: pluginToolOutputSchema.extend({
|
|
271
271
|
target: z.literal("deployment"),
|
|
272
|
-
|
|
272
|
+
deployment_id: text,
|
|
273
273
|
deleted: z.literal(true)
|
|
274
274
|
}),
|
|
275
275
|
async execute(input) {
|
|
276
276
|
await request(
|
|
277
277
|
"vercel.deployment.delete",
|
|
278
|
-
`/v13/deployments/${encodeURIComponent(input.
|
|
278
|
+
`/v13/deployments/${encodeURIComponent(input.deployment_id)}`,
|
|
279
279
|
input.team,
|
|
280
280
|
"DELETE"
|
|
281
281
|
);
|
|
282
282
|
return {
|
|
283
283
|
target: "deployment",
|
|
284
|
-
|
|
284
|
+
deployment_id: input.deployment_id,
|
|
285
285
|
deleted: true
|
|
286
286
|
};
|
|
287
287
|
}
|
package/dist/testing.js
CHANGED
package/dist/tools/actions.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
5
5
|
project: string;
|
|
6
6
|
team?: string | undefined;
|
|
7
7
|
ref: string;
|
|
8
|
-
|
|
8
|
+
commit_sha?: string | undefined;
|
|
9
9
|
target?: "preview" | "production" | undefined;
|
|
10
10
|
}, {
|
|
11
11
|
[x: string]: unknown;
|
|
@@ -64,12 +64,12 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
64
64
|
reason?: string | undefined;
|
|
65
65
|
} | undefined;
|
|
66
66
|
target: "deployment";
|
|
67
|
-
|
|
67
|
+
deployment_id: string;
|
|
68
68
|
url: string;
|
|
69
69
|
state: string;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
deployment_target: string | null;
|
|
71
|
+
project_id: string | null;
|
|
72
|
+
commit_sha: string | null;
|
|
73
73
|
ref: string | null;
|
|
74
74
|
}, {
|
|
75
75
|
[x: string]: unknown;
|
|
@@ -128,12 +128,12 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
128
128
|
reason?: string | undefined;
|
|
129
129
|
} | undefined;
|
|
130
130
|
target: "deployment";
|
|
131
|
-
|
|
131
|
+
deployment_id: string;
|
|
132
132
|
url: string;
|
|
133
133
|
state: string;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
deployment_target: string | null;
|
|
135
|
+
project_id: string | null;
|
|
136
|
+
commit_sha: string | null;
|
|
137
137
|
ref: string | null;
|
|
138
138
|
}>;
|
|
139
139
|
deploymentInspect: import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
@@ -196,12 +196,12 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
196
196
|
reason?: string | undefined;
|
|
197
197
|
} | undefined;
|
|
198
198
|
target: "deployment";
|
|
199
|
-
|
|
199
|
+
deployment_id: string;
|
|
200
200
|
url: string;
|
|
201
201
|
state: string;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
deployment_target: string | null;
|
|
203
|
+
project_id: string | null;
|
|
204
|
+
commit_sha: string | null;
|
|
205
205
|
ref: string | null;
|
|
206
206
|
}, {
|
|
207
207
|
[x: string]: unknown;
|
|
@@ -260,16 +260,16 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
260
260
|
reason?: string | undefined;
|
|
261
261
|
} | undefined;
|
|
262
262
|
target: "deployment";
|
|
263
|
-
|
|
263
|
+
deployment_id: string;
|
|
264
264
|
url: string;
|
|
265
265
|
state: string;
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
deployment_target: string | null;
|
|
267
|
+
project_id: string | null;
|
|
268
|
+
commit_sha: string | null;
|
|
269
269
|
ref: string | null;
|
|
270
270
|
}>;
|
|
271
271
|
aliasAssign: import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
272
|
-
|
|
272
|
+
deployment_id: string;
|
|
273
273
|
alias: string;
|
|
274
274
|
team?: string | undefined;
|
|
275
275
|
}, {
|
|
@@ -330,7 +330,7 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
330
330
|
} | undefined;
|
|
331
331
|
target: "alias";
|
|
332
332
|
alias: string;
|
|
333
|
-
|
|
333
|
+
deployment_id: string | null;
|
|
334
334
|
redirect: string | null;
|
|
335
335
|
matches: boolean;
|
|
336
336
|
}, {
|
|
@@ -391,7 +391,7 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
391
391
|
} | undefined;
|
|
392
392
|
target: "alias";
|
|
393
393
|
alias: string;
|
|
394
|
-
|
|
394
|
+
deployment_id: string | null;
|
|
395
395
|
redirect: string | null;
|
|
396
396
|
matches: boolean;
|
|
397
397
|
}>;
|
|
@@ -456,7 +456,7 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
456
456
|
} | undefined;
|
|
457
457
|
target: "alias";
|
|
458
458
|
alias: string;
|
|
459
|
-
|
|
459
|
+
deployment_id: string | null;
|
|
460
460
|
redirect: string | null;
|
|
461
461
|
}, {
|
|
462
462
|
[x: string]: unknown;
|
|
@@ -516,11 +516,11 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
516
516
|
} | undefined;
|
|
517
517
|
target: "alias";
|
|
518
518
|
alias: string;
|
|
519
|
-
|
|
519
|
+
deployment_id: string | null;
|
|
520
520
|
redirect: string | null;
|
|
521
521
|
}>;
|
|
522
522
|
deploymentDelete: import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
523
|
-
|
|
523
|
+
deployment_id: string;
|
|
524
524
|
team?: string | undefined;
|
|
525
525
|
}, {
|
|
526
526
|
[x: string]: unknown;
|
|
@@ -579,7 +579,7 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
579
579
|
reason?: string | undefined;
|
|
580
580
|
} | undefined;
|
|
581
581
|
target: "deployment";
|
|
582
|
-
|
|
582
|
+
deployment_id: string;
|
|
583
583
|
deleted: true;
|
|
584
584
|
}, {
|
|
585
585
|
[x: string]: unknown;
|
|
@@ -638,7 +638,7 @@ export declare function createVercelActionTools(ctx: ToolRegistrationHookContext
|
|
|
638
638
|
reason?: string | undefined;
|
|
639
639
|
} | undefined;
|
|
640
640
|
target: "deployment";
|
|
641
|
-
|
|
641
|
+
deployment_id: string;
|
|
642
642
|
deleted: true;
|
|
643
643
|
}>;
|
|
644
644
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ToolRegistrationHookContext } from "@sentry/junior-plugin-api";
|
|
2
2
|
/** Resolve and return the resource identity for one Vercel deployment. */
|
|
3
3
|
export declare function createVercelDeploymentTool(ctx: ToolRegistrationHookContext): import("@sentry/junior-plugin-api").PluginToolDefinition<{
|
|
4
|
-
|
|
4
|
+
commit_sha?: string | undefined;
|
|
5
5
|
project: string;
|
|
6
6
|
target?: "preview" | "production" | "staging" | undefined;
|
|
7
7
|
team?: string | undefined;
|
|
@@ -60,16 +60,16 @@ export declare function createVercelDeploymentTool(ctx: ToolRegistrationHookCont
|
|
|
60
60
|
arguments: Record<string, unknown>;
|
|
61
61
|
reason?: string | undefined;
|
|
62
62
|
} | undefined;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
commit_sha: string | null;
|
|
64
|
+
deployment_target: "preview" | "production" | "staging" | null;
|
|
65
|
+
project_id: string;
|
|
66
66
|
subscribable?: {
|
|
67
67
|
identifier: string;
|
|
68
68
|
label: string;
|
|
69
69
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
70
70
|
namespace: string;
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
suggested_events?: string[] | undefined;
|
|
72
|
+
supported_events: string[];
|
|
73
73
|
type: string;
|
|
74
74
|
} | undefined;
|
|
75
75
|
target: "deployment";
|
|
@@ -128,16 +128,16 @@ export declare function createVercelDeploymentTool(ctx: ToolRegistrationHookCont
|
|
|
128
128
|
arguments: Record<string, unknown>;
|
|
129
129
|
reason?: string | undefined;
|
|
130
130
|
} | undefined;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
commit_sha: string | null;
|
|
132
|
+
deployment_target: "preview" | "production" | "staging" | null;
|
|
133
|
+
project_id: string;
|
|
134
134
|
subscribable?: {
|
|
135
135
|
identifier: string;
|
|
136
136
|
label: string;
|
|
137
137
|
match?: Record<string, string | number | boolean | (string | number)[]> | undefined;
|
|
138
138
|
namespace: string;
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
suggested_events?: string[] | undefined;
|
|
140
|
+
supported_events: string[];
|
|
141
141
|
type: string;
|
|
142
142
|
} | undefined;
|
|
143
143
|
target: "deployment";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-vercel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.277.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.277.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@oxlint/plugins": "1.79.0",
|