@vercel/sdk 1.17.3 → 1.17.5
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 +28 -24
- package/bin/mcp-server.js +1496 -1252
- package/bin/mcp-server.js.map +18 -12
- package/esm/__tests__/accessgroups.test.js +1 -3
- package/esm/__tests__/accessgroups.test.js.map +1 -1
- package/esm/__tests__/checks.test.js +1 -1
- package/esm/__tests__/checks.test.js.map +1 -1
- package/esm/__tests__/domains.test.js +4 -10
- package/esm/__tests__/domains.test.js.map +1 -1
- package/esm/__tests__/edgeconfig.test.js +6 -6
- package/esm/__tests__/edgeconfig.test.js.map +1 -1
- package/esm/__tests__/integrations.test.js +1 -1
- package/esm/__tests__/logdrains.test.js +1 -3
- package/esm/__tests__/logdrains.test.js.map +1 -1
- package/esm/__tests__/rollingrelease.test.js +2 -6
- package/esm/__tests__/rollingrelease.test.js.map +1 -1
- package/esm/__tests__/security.test.js +4 -4
- package/esm/__tests__/security.test.js.map +1 -1
- package/esm/funcs/edgeCacheDangerouslyDeleteBySrcImages.d.ts +17 -0
- package/esm/funcs/edgeCacheDangerouslyDeleteBySrcImages.d.ts.map +1 -0
- package/esm/funcs/edgeCacheDangerouslyDeleteBySrcImages.js +85 -0
- package/esm/funcs/edgeCacheDangerouslyDeleteBySrcImages.js.map +1 -0
- package/esm/funcs/edgeCacheInvalidateBySrcImages.d.ts +17 -0
- package/esm/funcs/edgeCacheInvalidateBySrcImages.d.ts.map +1 -0
- package/esm/funcs/edgeCacheInvalidateBySrcImages.js +85 -0
- package/esm/funcs/edgeCacheInvalidateBySrcImages.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.d.ts.map +1 -1
- package/esm/mcp-server/server.js +5 -1
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/edgeCacheDangerouslyDeleteBySrcImages.d.ts +7 -0
- package/esm/mcp-server/tools/edgeCacheDangerouslyDeleteBySrcImages.d.ts.map +1 -0
- package/esm/mcp-server/tools/edgeCacheDangerouslyDeleteBySrcImages.js +27 -0
- package/esm/mcp-server/tools/edgeCacheDangerouslyDeleteBySrcImages.js.map +1 -0
- package/esm/mcp-server/tools/edgeCacheInvalidateBySrcImages.d.ts +7 -0
- package/esm/mcp-server/tools/edgeCacheInvalidateBySrcImages.d.ts.map +1 -0
- package/esm/mcp-server/tools/edgeCacheInvalidateBySrcImages.js +27 -0
- package/esm/mcp-server/tools/edgeCacheInvalidateBySrcImages.js.map +1 -0
- package/esm/models/canceldeploymentop.d.ts +0 -37
- package/esm/models/canceldeploymentop.d.ts.map +1 -1
- package/esm/models/canceldeploymentop.js +0 -23
- package/esm/models/canceldeploymentop.js.map +1 -1
- package/esm/models/createdeploymentop.d.ts +0 -37
- package/esm/models/createdeploymentop.d.ts.map +1 -1
- package/esm/models/createdeploymentop.js +0 -22
- package/esm/models/createdeploymentop.js.map +1 -1
- package/esm/models/createintegrationstoredirectop.d.ts +152 -152
- package/esm/models/createintegrationstoredirectop.js +218 -218
- package/esm/models/dangerouslydeletebysrcimagesop.d.ts +44 -0
- package/esm/models/dangerouslydeletebysrcimagesop.d.ts.map +1 -0
- package/esm/models/dangerouslydeletebysrcimagesop.js +51 -0
- package/esm/models/dangerouslydeletebysrcimagesop.js.map +1 -0
- package/esm/models/getconfigurationproductsop.d.ts +200 -200
- package/esm/models/getconfigurationproductsop.js +290 -290
- package/esm/models/getdeploymentop.d.ts +0 -37
- package/esm/models/getdeploymentop.d.ts.map +1 -1
- package/esm/models/getdeploymentop.js +0 -22
- package/esm/models/getdeploymentop.js.map +1 -1
- package/esm/models/getmemberop.d.ts +4 -0
- package/esm/models/getmemberop.d.ts.map +1 -1
- package/esm/models/getmemberop.js +4 -0
- package/esm/models/getmemberop.js.map +1 -1
- package/esm/models/invalidatebysrcimagesop.d.ts +42 -0
- package/esm/models/invalidatebysrcimagesop.d.ts.map +1 -0
- package/esm/models/invalidatebysrcimagesop.js +51 -0
- package/esm/models/invalidatebysrcimagesop.js.map +1 -0
- package/esm/sdk/edgecache.d.ts +16 -0
- package/esm/sdk/edgecache.d.ts.map +1 -1
- package/esm/sdk/edgecache.js +20 -0
- package/esm/sdk/edgecache.js.map +1 -1
- package/esm/types/enums.d.ts +1 -8
- package/esm/types/enums.d.ts.map +1 -1
- package/esm/types/enums.js +1 -18
- package/esm/types/enums.js.map +1 -1
- package/esm/types/unrecognized.d.ts +10 -0
- package/esm/types/unrecognized.d.ts.map +1 -0
- package/esm/types/unrecognized.js +23 -0
- package/esm/types/unrecognized.js.map +1 -0
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/accessgroups.test.ts +1 -3
- package/src/__tests__/checks.test.ts +1 -1
- package/src/__tests__/domains.test.ts +4 -10
- package/src/__tests__/edgeconfig.test.ts +6 -6
- package/src/__tests__/integrations.test.ts +1 -1
- package/src/__tests__/logdrains.test.ts +1 -3
- package/src/__tests__/rollingrelease.test.ts +2 -6
- package/src/__tests__/security.test.ts +4 -4
- package/src/funcs/edgeCacheDangerouslyDeleteBySrcImages.ts +171 -0
- package/src/funcs/edgeCacheInvalidateBySrcImages.ts +171 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/edgeCacheDangerouslyDeleteBySrcImages.ts +37 -0
- package/src/mcp-server/tools/edgeCacheInvalidateBySrcImages.ts +36 -0
- package/src/models/canceldeploymentop.ts +0 -76
- package/src/models/createdeploymentop.ts +0 -87
- package/src/models/createintegrationstoredirectop.ts +471 -471
- package/src/models/dangerouslydeletebysrcimagesop.ts +141 -0
- package/src/models/getconfigurationproductsop.ts +627 -627
- package/src/models/getdeploymentop.ts +0 -88
- package/src/models/getmemberop.ts +8 -0
- package/src/models/invalidatebysrcimagesop.ts +127 -0
- package/src/sdk/edgecache.ts +38 -0
- package/src/types/enums.ts +1 -21
- package/src/types/unrecognized.ts +27 -0
- package/vercel-spec.json +274 -169
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { VercelCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
DangerouslyDeleteBySrcImagesRequest,
|
|
16
|
+
DangerouslyDeleteBySrcImagesRequest$outboundSchema,
|
|
17
|
+
} from "../models/dangerouslydeletebysrcimagesop.js";
|
|
18
|
+
import {
|
|
19
|
+
ConnectionError,
|
|
20
|
+
InvalidRequestError,
|
|
21
|
+
RequestAbortedError,
|
|
22
|
+
RequestTimeoutError,
|
|
23
|
+
UnexpectedClientError,
|
|
24
|
+
} from "../models/httpclienterrors.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/responsevalidationerror.js";
|
|
26
|
+
import { SDKValidationError } from "../models/sdkvalidationerror.js";
|
|
27
|
+
import { VercelError } from "../models/vercelerror.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Dangerously delete by source image
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Marks a source image as deleted, causing cache entries associated with that source image to be revalidated in the foreground on the next request. Use this method with caution because one source image can be associated with many paths and deleting the cache can cause many concurrent requests to the origin leading to cache stampede problem. A good use case for deleting the cache is when the origin has also been deleted, for example it returns a 404 or 410 status code.
|
|
36
|
+
*/
|
|
37
|
+
export function edgeCacheDangerouslyDeleteBySrcImages(
|
|
38
|
+
client: VercelCore,
|
|
39
|
+
request: DangerouslyDeleteBySrcImagesRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
void,
|
|
44
|
+
| VercelError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: VercelCore,
|
|
63
|
+
request: DangerouslyDeleteBySrcImagesRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
void,
|
|
69
|
+
| VercelError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) => DangerouslyDeleteBySrcImagesRequest$outboundSchema.parse(value),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/v1/edge-cache/dangerously-delete-by-src-images")();
|
|
93
|
+
|
|
94
|
+
const query = encodeFormQuery({
|
|
95
|
+
"projectIdOrName": payload.projectIdOrName,
|
|
96
|
+
"slug": payload.slug,
|
|
97
|
+
"teamId": payload.teamId,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "*/*",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.bearerToken);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { bearerToken: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "dangerouslyDeleteBySrcImages",
|
|
113
|
+
oAuth2Scopes: null,
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.bearerToken,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "POST",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
query: query,
|
|
131
|
+
body: body,
|
|
132
|
+
userAgent: client._options.userAgent,
|
|
133
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
134
|
+
}, options);
|
|
135
|
+
if (!requestRes.ok) {
|
|
136
|
+
return [requestRes, { status: "invalid" }];
|
|
137
|
+
}
|
|
138
|
+
const req = requestRes.value;
|
|
139
|
+
|
|
140
|
+
const doResult = await client._do(req, {
|
|
141
|
+
context,
|
|
142
|
+
errorCodes: ["400", "401", "402", "403", "404", "4XX", "5XX"],
|
|
143
|
+
retryConfig: context.retryConfig,
|
|
144
|
+
retryCodes: context.retryCodes,
|
|
145
|
+
});
|
|
146
|
+
if (!doResult.ok) {
|
|
147
|
+
return [doResult, { status: "request-error", request: req }];
|
|
148
|
+
}
|
|
149
|
+
const response = doResult.value;
|
|
150
|
+
|
|
151
|
+
const [result] = await M.match<
|
|
152
|
+
void,
|
|
153
|
+
| VercelError
|
|
154
|
+
| ResponseValidationError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| UnexpectedClientError
|
|
160
|
+
| SDKValidationError
|
|
161
|
+
>(
|
|
162
|
+
M.nil(200, z.void()),
|
|
163
|
+
M.fail([400, 401, 402, 403, 404, "4XX"]),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response, req);
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { VercelCore } from "../core.js";
|
|
7
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/httpclienterrors.js";
|
|
21
|
+
import {
|
|
22
|
+
InvalidateBySrcImagesRequest,
|
|
23
|
+
InvalidateBySrcImagesRequest$outboundSchema,
|
|
24
|
+
} from "../models/invalidatebysrcimagesop.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/responsevalidationerror.js";
|
|
26
|
+
import { SDKValidationError } from "../models/sdkvalidationerror.js";
|
|
27
|
+
import { VercelError } from "../models/vercelerror.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Invalidate by source image
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Marks a source image as stale, causing its corresponding transformed images to be revalidated in the background on the next request.
|
|
36
|
+
*/
|
|
37
|
+
export function edgeCacheInvalidateBySrcImages(
|
|
38
|
+
client: VercelCore,
|
|
39
|
+
request: InvalidateBySrcImagesRequest,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
void,
|
|
44
|
+
| VercelError
|
|
45
|
+
| ResponseValidationError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
| RequestAbortedError
|
|
48
|
+
| RequestTimeoutError
|
|
49
|
+
| InvalidRequestError
|
|
50
|
+
| UnexpectedClientError
|
|
51
|
+
| SDKValidationError
|
|
52
|
+
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
request,
|
|
57
|
+
options,
|
|
58
|
+
));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function $do(
|
|
62
|
+
client: VercelCore,
|
|
63
|
+
request: InvalidateBySrcImagesRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<
|
|
66
|
+
[
|
|
67
|
+
Result<
|
|
68
|
+
void,
|
|
69
|
+
| VercelError
|
|
70
|
+
| ResponseValidationError
|
|
71
|
+
| ConnectionError
|
|
72
|
+
| RequestAbortedError
|
|
73
|
+
| RequestTimeoutError
|
|
74
|
+
| InvalidRequestError
|
|
75
|
+
| UnexpectedClientError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
>,
|
|
78
|
+
APICall,
|
|
79
|
+
]
|
|
80
|
+
> {
|
|
81
|
+
const parsed = safeParse(
|
|
82
|
+
request,
|
|
83
|
+
(value) => InvalidateBySrcImagesRequest$outboundSchema.parse(value),
|
|
84
|
+
"Input validation failed",
|
|
85
|
+
);
|
|
86
|
+
if (!parsed.ok) {
|
|
87
|
+
return [parsed, { status: "invalid" }];
|
|
88
|
+
}
|
|
89
|
+
const payload = parsed.value;
|
|
90
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
91
|
+
|
|
92
|
+
const path = pathToFunc("/v1/edge-cache/invalidate-by-src-images")();
|
|
93
|
+
|
|
94
|
+
const query = encodeFormQuery({
|
|
95
|
+
"projectIdOrName": payload.projectIdOrName,
|
|
96
|
+
"slug": payload.slug,
|
|
97
|
+
"teamId": payload.teamId,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "*/*",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.bearerToken);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { bearerToken: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "invalidateBySrcImages",
|
|
113
|
+
oAuth2Scopes: null,
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.bearerToken,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "POST",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
query: query,
|
|
131
|
+
body: body,
|
|
132
|
+
userAgent: client._options.userAgent,
|
|
133
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
134
|
+
}, options);
|
|
135
|
+
if (!requestRes.ok) {
|
|
136
|
+
return [requestRes, { status: "invalid" }];
|
|
137
|
+
}
|
|
138
|
+
const req = requestRes.value;
|
|
139
|
+
|
|
140
|
+
const doResult = await client._do(req, {
|
|
141
|
+
context,
|
|
142
|
+
errorCodes: ["400", "401", "402", "403", "404", "4XX", "5XX"],
|
|
143
|
+
retryConfig: context.retryConfig,
|
|
144
|
+
retryCodes: context.retryCodes,
|
|
145
|
+
});
|
|
146
|
+
if (!doResult.ok) {
|
|
147
|
+
return [doResult, { status: "request-error", request: req }];
|
|
148
|
+
}
|
|
149
|
+
const response = doResult.value;
|
|
150
|
+
|
|
151
|
+
const [result] = await M.match<
|
|
152
|
+
void,
|
|
153
|
+
| VercelError
|
|
154
|
+
| ResponseValidationError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| UnexpectedClientError
|
|
160
|
+
| SDKValidationError
|
|
161
|
+
>(
|
|
162
|
+
M.nil(200, z.void()),
|
|
163
|
+
M.fail([400, 401, 402, 403, 404, "4XX"]),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response, req);
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
61
|
export const SDK_METADATA = {
|
|
62
62
|
language: "typescript",
|
|
63
63
|
openapiDocVersion: "0.0.1",
|
|
64
|
-
sdkVersion: "1.17.
|
|
65
|
-
genVersion: "2.
|
|
66
|
-
userAgent: "speakeasy-sdk/typescript 1.17.
|
|
64
|
+
sdkVersion: "1.17.5",
|
|
65
|
+
genVersion: "2.760.2",
|
|
66
|
+
userAgent: "speakeasy-sdk/typescript 1.17.5 2.760.2 0.0.1 @vercel/sdk",
|
|
67
67
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -95,7 +95,9 @@ import { tool$drainsGetDrain } from "./tools/drainsGetDrain.js";
|
|
|
95
95
|
import { tool$drainsGetDrains } from "./tools/drainsGetDrains.js";
|
|
96
96
|
import { tool$drainsTestDrain } from "./tools/drainsTestDrain.js";
|
|
97
97
|
import { tool$drainsUpdateDrain } from "./tools/drainsUpdateDrain.js";
|
|
98
|
+
import { tool$edgeCacheDangerouslyDeleteBySrcImages } from "./tools/edgeCacheDangerouslyDeleteBySrcImages.js";
|
|
98
99
|
import { tool$edgeCacheDangerouslyDeleteByTags } from "./tools/edgeCacheDangerouslyDeleteByTags.js";
|
|
100
|
+
import { tool$edgeCacheInvalidateBySrcImages } from "./tools/edgeCacheInvalidateBySrcImages.js";
|
|
99
101
|
import { tool$edgeCacheInvalidateByTags } from "./tools/edgeCacheInvalidateByTags.js";
|
|
100
102
|
import { tool$edgeConfigCreateEdgeConfig } from "./tools/edgeConfigCreateEdgeConfig.js";
|
|
101
103
|
import { tool$edgeConfigCreateEdgeConfigToken } from "./tools/edgeConfigCreateEdgeConfigToken.js";
|
|
@@ -240,7 +242,7 @@ export function createMCPServer(deps: {
|
|
|
240
242
|
}) {
|
|
241
243
|
const server = new McpServer({
|
|
242
244
|
name: "Vercel",
|
|
243
|
-
version: "1.17.
|
|
245
|
+
version: "1.17.5",
|
|
244
246
|
});
|
|
245
247
|
|
|
246
248
|
const client = new VercelCore({
|
|
@@ -381,6 +383,8 @@ export function createMCPServer(deps: {
|
|
|
381
383
|
tool(tool$drainsTestDrain);
|
|
382
384
|
tool(tool$edgeCacheInvalidateByTags);
|
|
383
385
|
tool(tool$edgeCacheDangerouslyDeleteByTags);
|
|
386
|
+
tool(tool$edgeCacheInvalidateBySrcImages);
|
|
387
|
+
tool(tool$edgeCacheDangerouslyDeleteBySrcImages);
|
|
384
388
|
tool(tool$edgeConfigGetEdgeConfigs);
|
|
385
389
|
tool(tool$edgeConfigCreateEdgeConfig);
|
|
386
390
|
tool(tool$edgeConfigGetEdgeConfig);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { edgeCacheDangerouslyDeleteBySrcImages } from "../../funcs/edgeCacheDangerouslyDeleteBySrcImages.js";
|
|
6
|
+
import { DangerouslyDeleteBySrcImagesRequest$inboundSchema } from "../../models/dangerouslydeletebysrcimagesop.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: DangerouslyDeleteBySrcImagesRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$edgeCacheDangerouslyDeleteBySrcImages: ToolDefinition<
|
|
14
|
+
typeof args
|
|
15
|
+
> = {
|
|
16
|
+
name: "edge-cache-dangerously-delete-by-src-images",
|
|
17
|
+
description: `Dangerously delete by source image
|
|
18
|
+
|
|
19
|
+
Marks a source image as deleted, causing cache entries associated with that source image to be revalidated in the foreground on the next request. Use this method with caution because one source image can be associated with many paths and deleting the cache can cause many concurrent requests to the origin leading to cache stampede problem. A good use case for deleting the cache is when the origin has also been deleted, for example it returns a 404 or 410 status code.`,
|
|
20
|
+
args,
|
|
21
|
+
tool: async (client, args, ctx) => {
|
|
22
|
+
const [result, apiCall] = await edgeCacheDangerouslyDeleteBySrcImages(
|
|
23
|
+
client,
|
|
24
|
+
args.request,
|
|
25
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
26
|
+
).$inspect();
|
|
27
|
+
|
|
28
|
+
if (!result.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: result.error.message }],
|
|
31
|
+
isError: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return formatResult(void 0, apiCall);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { edgeCacheInvalidateBySrcImages } from "../../funcs/edgeCacheInvalidateBySrcImages.js";
|
|
6
|
+
import { InvalidateBySrcImagesRequest$inboundSchema } from "../../models/invalidatebysrcimagesop.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: InvalidateBySrcImagesRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$edgeCacheInvalidateBySrcImages: ToolDefinition<typeof args> =
|
|
14
|
+
{
|
|
15
|
+
name: "edge-cache-invalidate-by-src-images",
|
|
16
|
+
description: `Invalidate by source image
|
|
17
|
+
|
|
18
|
+
Marks a source image as stale, causing its corresponding transformed images to be revalidated in the background on the next request.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await edgeCacheInvalidateBySrcImages(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return formatResult(void 0, apiCall);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -1328,22 +1328,6 @@ export type CancelDeploymentFlags =
|
|
|
1328
1328
|
| CancelDeploymentFlags1
|
|
1329
1329
|
| Array<CancelDeploymentFlags2>;
|
|
1330
1330
|
|
|
1331
|
-
/**
|
|
1332
|
-
* A map of the other applications that are part of this group. Only defined on the default application. The field is set after deployments have been created, so can be undefined, but should be there for a successful deployment. Note: this field will be removed when MFE alias routing is fully rolled out.
|
|
1333
|
-
*/
|
|
1334
|
-
export type MicrofrontendsApplications = {
|
|
1335
|
-
isDefaultApp?: boolean | undefined;
|
|
1336
|
-
/**
|
|
1337
|
-
* This is the production alias, it will always show the most up to date of each application.
|
|
1338
|
-
*/
|
|
1339
|
-
productionHost: string;
|
|
1340
|
-
/**
|
|
1341
|
-
* Use the fixed deploymentAlias and deploymentHost so that the microfrontend preview stays in sync with the deployment. These are only present for mono-repos when a single commit creates multiple deployments. If they are not present, productionHost will be used.
|
|
1342
|
-
*/
|
|
1343
|
-
deploymentAlias?: string | undefined;
|
|
1344
|
-
deploymentHost?: string | undefined;
|
|
1345
|
-
};
|
|
1346
|
-
|
|
1347
1331
|
/**
|
|
1348
1332
|
* The result of the microfrontends config upload during deployment creation / build. Only set for default app deployments. The config upload is attempted during deployment create, and then again during the build. If the config is not in the root directory, or the deployment is prebuilt, the config cannot be uploaded during deployment create. The upload during deployment build finds the config even if it's not in the root directory, as it has access to all files. Uploading the config during create is ideal, as then all child deployments are guaranteed to have access to the default app deployment config even if the default app has not yet started building. If the config is not uploaded, the child app will show as building until the config has been uploaded during the default app build. - `success` - The config was uploaded successfully, either when the deployment was created or during the build. - `waiting_on_build` - The config could not be uploaded during deployment create, will be attempted again during the build. - `no_config` - No config was found. Only set once the build has not found the config in any of the deployment's files. - `undefined` - Legacy deployments, or there was an error uploading the config during deployment create.
|
|
1349
1333
|
*/
|
|
@@ -1361,10 +1345,6 @@ export type MicrofrontendsMfeConfigUploadState = ClosedEnum<
|
|
|
1361
1345
|
|
|
1362
1346
|
export type CancelDeploymentMicrofrontends2 = {
|
|
1363
1347
|
isDefaultApp: boolean;
|
|
1364
|
-
/**
|
|
1365
|
-
* A map of the other applications that are part of this group. Only defined on the default application. The field is set after deployments have been created, so can be undefined, but should be there for a successful deployment. Note: this field will be removed when MFE alias routing is fully rolled out.
|
|
1366
|
-
*/
|
|
1367
|
-
applications?: { [k: string]: MicrofrontendsApplications } | undefined;
|
|
1368
1348
|
/**
|
|
1369
1349
|
* The result of the microfrontends config upload during deployment creation / build. Only set for default app deployments. The config upload is attempted during deployment create, and then again during the build. If the config is not in the root directory, or the deployment is prebuilt, the config cannot be uploaded during deployment create. The upload during deployment build finds the config even if it's not in the root directory, as it has access to all files. Uploading the config during create is ideal, as then all child deployments are guaranteed to have access to the default app deployment config even if the default app has not yet started building. If the config is not uploaded, the child app will show as building until the config has been uploaded during the default app build. - `success` - The config was uploaded successfully, either when the deployment was created or during the build. - `waiting_on_build` - The config could not be uploaded during deployment create, will be attempted again during the build. - `no_config` - No config was found. Only set once the build has not found the config in any of the deployment's files. - `undefined` - Legacy deployments, or there was an error uploading the config during deployment create.
|
|
1370
1350
|
*/
|
|
@@ -6628,54 +6608,6 @@ export function cancelDeploymentFlagsFromJSON(
|
|
|
6628
6608
|
);
|
|
6629
6609
|
}
|
|
6630
6610
|
|
|
6631
|
-
/** @internal */
|
|
6632
|
-
export const MicrofrontendsApplications$inboundSchema: z.ZodType<
|
|
6633
|
-
MicrofrontendsApplications,
|
|
6634
|
-
z.ZodTypeDef,
|
|
6635
|
-
unknown
|
|
6636
|
-
> = z.object({
|
|
6637
|
-
isDefaultApp: z.boolean().optional(),
|
|
6638
|
-
productionHost: z.string(),
|
|
6639
|
-
deploymentAlias: z.string().optional(),
|
|
6640
|
-
deploymentHost: z.string().optional(),
|
|
6641
|
-
});
|
|
6642
|
-
/** @internal */
|
|
6643
|
-
export type MicrofrontendsApplications$Outbound = {
|
|
6644
|
-
isDefaultApp?: boolean | undefined;
|
|
6645
|
-
productionHost: string;
|
|
6646
|
-
deploymentAlias?: string | undefined;
|
|
6647
|
-
deploymentHost?: string | undefined;
|
|
6648
|
-
};
|
|
6649
|
-
|
|
6650
|
-
/** @internal */
|
|
6651
|
-
export const MicrofrontendsApplications$outboundSchema: z.ZodType<
|
|
6652
|
-
MicrofrontendsApplications$Outbound,
|
|
6653
|
-
z.ZodTypeDef,
|
|
6654
|
-
MicrofrontendsApplications
|
|
6655
|
-
> = z.object({
|
|
6656
|
-
isDefaultApp: z.boolean().optional(),
|
|
6657
|
-
productionHost: z.string(),
|
|
6658
|
-
deploymentAlias: z.string().optional(),
|
|
6659
|
-
deploymentHost: z.string().optional(),
|
|
6660
|
-
});
|
|
6661
|
-
|
|
6662
|
-
export function microfrontendsApplicationsToJSON(
|
|
6663
|
-
microfrontendsApplications: MicrofrontendsApplications,
|
|
6664
|
-
): string {
|
|
6665
|
-
return JSON.stringify(
|
|
6666
|
-
MicrofrontendsApplications$outboundSchema.parse(microfrontendsApplications),
|
|
6667
|
-
);
|
|
6668
|
-
}
|
|
6669
|
-
export function microfrontendsApplicationsFromJSON(
|
|
6670
|
-
jsonString: string,
|
|
6671
|
-
): SafeParseResult<MicrofrontendsApplications, SDKValidationError> {
|
|
6672
|
-
return safeParse(
|
|
6673
|
-
jsonString,
|
|
6674
|
-
(x) => MicrofrontendsApplications$inboundSchema.parse(JSON.parse(x)),
|
|
6675
|
-
`Failed to parse 'MicrofrontendsApplications' from JSON`,
|
|
6676
|
-
);
|
|
6677
|
-
}
|
|
6678
|
-
|
|
6679
6611
|
/** @internal */
|
|
6680
6612
|
export const MicrofrontendsMfeConfigUploadState$inboundSchema: z.ZodNativeEnum<
|
|
6681
6613
|
typeof MicrofrontendsMfeConfigUploadState
|
|
@@ -6692,8 +6624,6 @@ export const CancelDeploymentMicrofrontends2$inboundSchema: z.ZodType<
|
|
|
6692
6624
|
unknown
|
|
6693
6625
|
> = z.object({
|
|
6694
6626
|
isDefaultApp: z.boolean(),
|
|
6695
|
-
applications: z.record(z.lazy(() => MicrofrontendsApplications$inboundSchema))
|
|
6696
|
-
.optional(),
|
|
6697
6627
|
mfeConfigUploadState: MicrofrontendsMfeConfigUploadState$inboundSchema
|
|
6698
6628
|
.optional(),
|
|
6699
6629
|
defaultAppProjectName: z.string(),
|
|
@@ -6703,9 +6633,6 @@ export const CancelDeploymentMicrofrontends2$inboundSchema: z.ZodType<
|
|
|
6703
6633
|
/** @internal */
|
|
6704
6634
|
export type CancelDeploymentMicrofrontends2$Outbound = {
|
|
6705
6635
|
isDefaultApp: boolean;
|
|
6706
|
-
applications?:
|
|
6707
|
-
| { [k: string]: MicrofrontendsApplications$Outbound }
|
|
6708
|
-
| undefined;
|
|
6709
6636
|
mfeConfigUploadState?: string | undefined;
|
|
6710
6637
|
defaultAppProjectName: string;
|
|
6711
6638
|
defaultRoute?: string | undefined;
|
|
@@ -6719,9 +6646,6 @@ export const CancelDeploymentMicrofrontends2$outboundSchema: z.ZodType<
|
|
|
6719
6646
|
CancelDeploymentMicrofrontends2
|
|
6720
6647
|
> = z.object({
|
|
6721
6648
|
isDefaultApp: z.boolean(),
|
|
6722
|
-
applications: z.record(
|
|
6723
|
-
z.lazy(() => MicrofrontendsApplications$outboundSchema),
|
|
6724
|
-
).optional(),
|
|
6725
6649
|
mfeConfigUploadState: MicrofrontendsMfeConfigUploadState$outboundSchema
|
|
6726
6650
|
.optional(),
|
|
6727
6651
|
defaultAppProjectName: z.string(),
|