@vercel/sdk 1.6.1 → 1.6.2

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.
Files changed (57) hide show
  1. package/README.md +4 -0
  2. package/bin/mcp-server.js +514 -246
  3. package/bin/mcp-server.js.map +12 -6
  4. package/docs/sdks/projects/README.md +162 -0
  5. package/esm/__tests__/projects.test.js +41 -13
  6. package/esm/__tests__/projects.test.js.map +1 -1
  7. package/esm/__tests__/security.test.js +14 -1
  8. package/esm/__tests__/security.test.js.map +1 -1
  9. package/esm/funcs/projectsPauseProject.d.ts +18 -0
  10. package/esm/funcs/projectsPauseProject.d.ts.map +1 -0
  11. package/esm/funcs/projectsPauseProject.js +92 -0
  12. package/esm/funcs/projectsPauseProject.js.map +1 -0
  13. package/esm/funcs/projectsUnpauseProject.d.ts +18 -0
  14. package/esm/funcs/projectsUnpauseProject.d.ts.map +1 -0
  15. package/esm/funcs/projectsUnpauseProject.js +92 -0
  16. package/esm/funcs/projectsUnpauseProject.js.map +1 -0
  17. package/esm/lib/config.d.ts +3 -3
  18. package/esm/lib/config.js +3 -3
  19. package/esm/mcp-server/mcp-server.js +1 -1
  20. package/esm/mcp-server/server.d.ts.map +1 -1
  21. package/esm/mcp-server/server.js +5 -1
  22. package/esm/mcp-server/server.js.map +1 -1
  23. package/esm/mcp-server/tools/projectsPauseProject.d.ts +7 -0
  24. package/esm/mcp-server/tools/projectsPauseProject.d.ts.map +1 -0
  25. package/esm/mcp-server/tools/projectsPauseProject.js +27 -0
  26. package/esm/mcp-server/tools/projectsPauseProject.js.map +1 -0
  27. package/esm/mcp-server/tools/projectsUnpauseProject.d.ts +7 -0
  28. package/esm/mcp-server/tools/projectsUnpauseProject.d.ts.map +1 -0
  29. package/esm/mcp-server/tools/projectsUnpauseProject.js +27 -0
  30. package/esm/mcp-server/tools/projectsUnpauseProject.js.map +1 -0
  31. package/esm/models/pauseprojectop.d.ts +42 -0
  32. package/esm/models/pauseprojectop.d.ts.map +1 -0
  33. package/esm/models/pauseprojectop.js +35 -0
  34. package/esm/models/pauseprojectop.js.map +1 -0
  35. package/esm/models/unpauseprojectop.d.ts +42 -0
  36. package/esm/models/unpauseprojectop.d.ts.map +1 -0
  37. package/esm/models/unpauseprojectop.js +35 -0
  38. package/esm/models/unpauseprojectop.js.map +1 -0
  39. package/esm/sdk/projects.d.ts +16 -0
  40. package/esm/sdk/projects.d.ts.map +1 -1
  41. package/esm/sdk/projects.js +20 -0
  42. package/esm/sdk/projects.js.map +1 -1
  43. package/jsr.json +1 -1
  44. package/package.json +1 -1
  45. package/src/__tests__/projects.test.ts +47 -13
  46. package/src/__tests__/security.test.ts +14 -1
  47. package/src/funcs/projectsPauseProject.ts +190 -0
  48. package/src/funcs/projectsUnpauseProject.ts +190 -0
  49. package/src/lib/config.ts +3 -3
  50. package/src/mcp-server/mcp-server.ts +1 -1
  51. package/src/mcp-server/server.ts +5 -1
  52. package/src/mcp-server/tools/projectsPauseProject.ts +35 -0
  53. package/src/mcp-server/tools/projectsUnpauseProject.ts +35 -0
  54. package/src/models/pauseprojectop.ts +83 -0
  55. package/src/models/unpauseprojectop.ts +83 -0
  56. package/src/sdk/projects.ts +38 -0
  57. package/vercel-spec.json +155 -0
@@ -578,19 +578,21 @@ test("Projects Create Project Env", async () => {
578
578
  upsert: "true",
579
579
  teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
580
580
  slug: "my-team-url-slug",
581
- requestBody: {
582
- key: "API_URL",
583
- value: "https://api.vercel.com",
584
- type: "plain",
585
- target: [
586
- "preview",
587
- ],
588
- gitBranch: "feature-1",
589
- comment: "database connection string for production",
590
- customEnvironmentIds: [
591
- "env_1234567890",
592
- ],
593
- },
581
+ requestBody: [
582
+ {
583
+ key: "API_URL",
584
+ value: "https://api.vercel.com",
585
+ type: "plain",
586
+ target: [
587
+ "preview",
588
+ ],
589
+ gitBranch: "feature-1",
590
+ comment: "database connection string for production",
591
+ customEnvironmentIds: [
592
+ "env_1234567890",
593
+ ],
594
+ },
595
+ ],
594
596
  });
595
597
  expect(result).toBeDefined();
596
598
  expect(result).toEqual({
@@ -775,3 +777,35 @@ test("Projects Filter Project Envs", async () => {
775
777
  },
776
778
  });
777
779
  });
780
+
781
+ test("Projects Pause Project", async () => {
782
+ const testHttpClient = createTestHTTPClient("pauseProject");
783
+
784
+ const vercel = new Vercel({
785
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
786
+ httpClient: testHttpClient,
787
+ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
788
+ });
789
+
790
+ await vercel.projects.pauseProject({
791
+ projectId: "<id>",
792
+ teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
793
+ slug: "my-team-url-slug",
794
+ });
795
+ });
796
+
797
+ test("Projects Unpause Project", async () => {
798
+ const testHttpClient = createTestHTTPClient("unpauseProject");
799
+
800
+ const vercel = new Vercel({
801
+ serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
802
+ httpClient: testHttpClient,
803
+ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
804
+ });
805
+
806
+ await vercel.projects.unpauseProject({
807
+ projectId: "<id>",
808
+ teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
809
+ slug: "my-team-url-slug",
810
+ });
811
+ });
@@ -189,7 +189,20 @@ test("Security Get Bypass Ip", async () => {
189
189
  slug: "my-team-url-slug",
190
190
  });
191
191
  expect(result).toBeDefined();
192
- expect(result).toEqual({});
192
+ expect(result).toEqual({
193
+ result: [
194
+ {
195
+ ownerId: "<id>",
196
+ id: "<id>",
197
+ domain: "unfinished-lender.info",
198
+ ip: "cae5:14bd:ddd0:3cea:5afd:1bfe:276c:9c15",
199
+ createdAt: "1718184278808",
200
+ updatedAt: "1744577466408",
201
+ updatedAtHour: "<value>",
202
+ },
203
+ ],
204
+ pagination: "<value>",
205
+ });
193
206
  });
194
207
 
195
208
  test("Security Add Bypass Ip", async () => {
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { VercelCore } from "../core.js";
7
+ import { encodeFormQuery, encodeSimple } 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
+ PauseProjectRequest,
23
+ PauseProjectRequest$outboundSchema,
24
+ } from "../models/pauseprojectop.js";
25
+ import { SDKError } from "../models/sdkerror.js";
26
+ import { SDKValidationError } from "../models/sdkvalidationerror.js";
27
+ import {
28
+ VercelBadRequestError,
29
+ VercelBadRequestError$inboundSchema,
30
+ } from "../models/vercelbadrequesterror.js";
31
+ import {
32
+ VercelForbiddenError,
33
+ VercelForbiddenError$inboundSchema,
34
+ } from "../models/vercelforbiddenerror.js";
35
+ import { APICall, APIPromise } from "../types/async.js";
36
+ import { Result } from "../types/fp.js";
37
+
38
+ /**
39
+ * Pause a project
40
+ *
41
+ * @remarks
42
+ * Pause a project by passing its project `id` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project disables auto assigning custom production domains and blocks the active Production Deployment then the request will return with 200 status code.
43
+ */
44
+ export function projectsPauseProject(
45
+ client: VercelCore,
46
+ request: PauseProjectRequest,
47
+ options?: RequestOptions,
48
+ ): APIPromise<
49
+ Result<
50
+ void,
51
+ | VercelBadRequestError
52
+ | VercelForbiddenError
53
+ | SDKError
54
+ | SDKValidationError
55
+ | UnexpectedClientError
56
+ | InvalidRequestError
57
+ | RequestAbortedError
58
+ | RequestTimeoutError
59
+ | ConnectionError
60
+ >
61
+ > {
62
+ return new APIPromise($do(
63
+ client,
64
+ request,
65
+ options,
66
+ ));
67
+ }
68
+
69
+ async function $do(
70
+ client: VercelCore,
71
+ request: PauseProjectRequest,
72
+ options?: RequestOptions,
73
+ ): Promise<
74
+ [
75
+ Result<
76
+ void,
77
+ | VercelBadRequestError
78
+ | VercelForbiddenError
79
+ | SDKError
80
+ | SDKValidationError
81
+ | UnexpectedClientError
82
+ | InvalidRequestError
83
+ | RequestAbortedError
84
+ | RequestTimeoutError
85
+ | ConnectionError
86
+ >,
87
+ APICall,
88
+ ]
89
+ > {
90
+ const parsed = safeParse(
91
+ request,
92
+ (value) => PauseProjectRequest$outboundSchema.parse(value),
93
+ "Input validation failed",
94
+ );
95
+ if (!parsed.ok) {
96
+ return [parsed, { status: "invalid" }];
97
+ }
98
+ const payload = parsed.value;
99
+ const body = null;
100
+
101
+ const pathParams = {
102
+ projectId: encodeSimple("projectId", payload.projectId, {
103
+ explode: false,
104
+ charEncoding: "percent",
105
+ }),
106
+ };
107
+
108
+ const path = pathToFunc("/v1/projects/{projectId}/pause")(pathParams);
109
+
110
+ const query = encodeFormQuery({
111
+ "slug": payload.slug,
112
+ "teamId": payload.teamId,
113
+ });
114
+
115
+ const headers = new Headers(compactMap({
116
+ Accept: "application/json",
117
+ }));
118
+
119
+ const secConfig = await extractSecurity(client._options.bearerToken);
120
+ const securityInput = secConfig == null ? {} : { bearerToken: secConfig };
121
+ const requestSecurity = resolveGlobalSecurity(securityInput);
122
+
123
+ const context = {
124
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
125
+ operationID: "pauseProject",
126
+ oAuth2Scopes: [],
127
+
128
+ resolvedSecurity: requestSecurity,
129
+
130
+ securitySource: client._options.bearerToken,
131
+ retryConfig: options?.retries
132
+ || client._options.retryConfig
133
+ || { strategy: "none" },
134
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
135
+ };
136
+
137
+ const requestRes = client._createRequest(context, {
138
+ security: requestSecurity,
139
+ method: "POST",
140
+ baseURL: options?.serverURL,
141
+ path: path,
142
+ headers: headers,
143
+ query: query,
144
+ body: body,
145
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
146
+ }, options);
147
+ if (!requestRes.ok) {
148
+ return [requestRes, { status: "invalid" }];
149
+ }
150
+ const req = requestRes.value;
151
+
152
+ const doResult = await client._do(req, {
153
+ context,
154
+ errorCodes: ["400", "401", "402", "403", "4XX", "500", "5XX"],
155
+ retryConfig: context.retryConfig,
156
+ retryCodes: context.retryCodes,
157
+ });
158
+ if (!doResult.ok) {
159
+ return [doResult, { status: "request-error", request: req }];
160
+ }
161
+ const response = doResult.value;
162
+
163
+ const responseFields = {
164
+ HttpMeta: { Response: response, Request: req },
165
+ };
166
+
167
+ const [result] = await M.match<
168
+ void,
169
+ | VercelBadRequestError
170
+ | VercelForbiddenError
171
+ | SDKError
172
+ | SDKValidationError
173
+ | UnexpectedClientError
174
+ | InvalidRequestError
175
+ | RequestAbortedError
176
+ | RequestTimeoutError
177
+ | ConnectionError
178
+ >(
179
+ M.nil(200, z.void()),
180
+ M.jsonErr(400, VercelBadRequestError$inboundSchema),
181
+ M.jsonErr(401, VercelForbiddenError$inboundSchema),
182
+ M.fail([402, 403, "4XX"]),
183
+ M.fail([500, "5XX"]),
184
+ )(response, { extraFields: responseFields });
185
+ if (!result.ok) {
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
188
+
189
+ return [result, { status: "complete", request: req, response }];
190
+ }
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { VercelCore } from "../core.js";
7
+ import { encodeFormQuery, encodeSimple } 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 { SDKError } from "../models/sdkerror.js";
22
+ import { SDKValidationError } from "../models/sdkvalidationerror.js";
23
+ import {
24
+ UnpauseProjectRequest,
25
+ UnpauseProjectRequest$outboundSchema,
26
+ } from "../models/unpauseprojectop.js";
27
+ import {
28
+ VercelBadRequestError,
29
+ VercelBadRequestError$inboundSchema,
30
+ } from "../models/vercelbadrequesterror.js";
31
+ import {
32
+ VercelForbiddenError,
33
+ VercelForbiddenError$inboundSchema,
34
+ } from "../models/vercelforbiddenerror.js";
35
+ import { APICall, APIPromise } from "../types/async.js";
36
+ import { Result } from "../types/fp.js";
37
+
38
+ /**
39
+ * Unpause a project
40
+ *
41
+ * @remarks
42
+ * Unpause a project by passing its project `id` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project enables auto assigning custom production domains and unblocks the active Production Deployment then the request will return with 200 status code.
43
+ */
44
+ export function projectsUnpauseProject(
45
+ client: VercelCore,
46
+ request: UnpauseProjectRequest,
47
+ options?: RequestOptions,
48
+ ): APIPromise<
49
+ Result<
50
+ void,
51
+ | VercelBadRequestError
52
+ | VercelForbiddenError
53
+ | SDKError
54
+ | SDKValidationError
55
+ | UnexpectedClientError
56
+ | InvalidRequestError
57
+ | RequestAbortedError
58
+ | RequestTimeoutError
59
+ | ConnectionError
60
+ >
61
+ > {
62
+ return new APIPromise($do(
63
+ client,
64
+ request,
65
+ options,
66
+ ));
67
+ }
68
+
69
+ async function $do(
70
+ client: VercelCore,
71
+ request: UnpauseProjectRequest,
72
+ options?: RequestOptions,
73
+ ): Promise<
74
+ [
75
+ Result<
76
+ void,
77
+ | VercelBadRequestError
78
+ | VercelForbiddenError
79
+ | SDKError
80
+ | SDKValidationError
81
+ | UnexpectedClientError
82
+ | InvalidRequestError
83
+ | RequestAbortedError
84
+ | RequestTimeoutError
85
+ | ConnectionError
86
+ >,
87
+ APICall,
88
+ ]
89
+ > {
90
+ const parsed = safeParse(
91
+ request,
92
+ (value) => UnpauseProjectRequest$outboundSchema.parse(value),
93
+ "Input validation failed",
94
+ );
95
+ if (!parsed.ok) {
96
+ return [parsed, { status: "invalid" }];
97
+ }
98
+ const payload = parsed.value;
99
+ const body = null;
100
+
101
+ const pathParams = {
102
+ projectId: encodeSimple("projectId", payload.projectId, {
103
+ explode: false,
104
+ charEncoding: "percent",
105
+ }),
106
+ };
107
+
108
+ const path = pathToFunc("/v1/projects/{projectId}/unpause")(pathParams);
109
+
110
+ const query = encodeFormQuery({
111
+ "slug": payload.slug,
112
+ "teamId": payload.teamId,
113
+ });
114
+
115
+ const headers = new Headers(compactMap({
116
+ Accept: "application/json",
117
+ }));
118
+
119
+ const secConfig = await extractSecurity(client._options.bearerToken);
120
+ const securityInput = secConfig == null ? {} : { bearerToken: secConfig };
121
+ const requestSecurity = resolveGlobalSecurity(securityInput);
122
+
123
+ const context = {
124
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
125
+ operationID: "unpauseProject",
126
+ oAuth2Scopes: [],
127
+
128
+ resolvedSecurity: requestSecurity,
129
+
130
+ securitySource: client._options.bearerToken,
131
+ retryConfig: options?.retries
132
+ || client._options.retryConfig
133
+ || { strategy: "none" },
134
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
135
+ };
136
+
137
+ const requestRes = client._createRequest(context, {
138
+ security: requestSecurity,
139
+ method: "POST",
140
+ baseURL: options?.serverURL,
141
+ path: path,
142
+ headers: headers,
143
+ query: query,
144
+ body: body,
145
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
146
+ }, options);
147
+ if (!requestRes.ok) {
148
+ return [requestRes, { status: "invalid" }];
149
+ }
150
+ const req = requestRes.value;
151
+
152
+ const doResult = await client._do(req, {
153
+ context,
154
+ errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
155
+ retryConfig: context.retryConfig,
156
+ retryCodes: context.retryCodes,
157
+ });
158
+ if (!doResult.ok) {
159
+ return [doResult, { status: "request-error", request: req }];
160
+ }
161
+ const response = doResult.value;
162
+
163
+ const responseFields = {
164
+ HttpMeta: { Response: response, Request: req },
165
+ };
166
+
167
+ const [result] = await M.match<
168
+ void,
169
+ | VercelBadRequestError
170
+ | VercelForbiddenError
171
+ | SDKError
172
+ | SDKValidationError
173
+ | UnexpectedClientError
174
+ | InvalidRequestError
175
+ | RequestAbortedError
176
+ | RequestTimeoutError
177
+ | ConnectionError
178
+ >(
179
+ M.nil(200, z.void()),
180
+ M.jsonErr(400, VercelBadRequestError$inboundSchema),
181
+ M.jsonErr(401, VercelForbiddenError$inboundSchema),
182
+ M.fail([403, "4XX"]),
183
+ M.fail([500, "5XX"]),
184
+ )(response, { extraFields: responseFields });
185
+ if (!result.ok) {
186
+ return [result, { status: "complete", request: req, response }];
187
+ }
188
+
189
+ return [result, { status: "complete", request: req, response }];
190
+ }
package/src/lib/config.ts CHANGED
@@ -57,7 +57,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
57
57
  export const SDK_METADATA = {
58
58
  language: "typescript",
59
59
  openapiDocVersion: "0.0.1",
60
- sdkVersion: "1.6.1",
61
- genVersion: "2.570.3",
62
- userAgent: "speakeasy-sdk/typescript 1.6.1 2.570.3 0.0.1 @vercel/sdk",
60
+ sdkVersion: "1.6.2",
61
+ genVersion: "2.570.4",
62
+ userAgent: "speakeasy-sdk/typescript 1.6.2 2.570.4 0.0.1 @vercel/sdk",
63
63
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "1.6.1",
22
+ currentVersion: "1.6.2",
23
23
  },
24
24
  });
25
25
 
@@ -140,9 +140,11 @@ import { tool$projectsGetProjectDomains } from "./tools/projectsGetProjectDomain
140
140
  import { tool$projectsGetProjectEnv } from "./tools/projectsGetProjectEnv.js";
141
141
  import { tool$projectsGetProjects } from "./tools/projectsGetProjects.js";
142
142
  import { tool$projectsListPromoteAliases } from "./tools/projectsListPromoteAliases.js";
143
+ import { tool$projectsPauseProject } from "./tools/projectsPauseProject.js";
143
144
  import { tool$projectsRemoveProjectDomain } from "./tools/projectsRemoveProjectDomain.js";
144
145
  import { tool$projectsRemoveProjectEnv } from "./tools/projectsRemoveProjectEnv.js";
145
146
  import { tool$projectsRequestPromote } from "./tools/projectsRequestPromote.js";
147
+ import { tool$projectsUnpauseProject } from "./tools/projectsUnpauseProject.js";
146
148
  import { tool$projectsUpdateProject } from "./tools/projectsUpdateProject.js";
147
149
  import { tool$projectsUpdateProjectDataCache } from "./tools/projectsUpdateProjectDataCache.js";
148
150
  import { tool$projectsUpdateProjectDomain } from "./tools/projectsUpdateProjectDomain.js";
@@ -186,7 +188,7 @@ export function createMCPServer(deps: {
186
188
  }) {
187
189
  const server = new McpServer({
188
190
  name: "Vercel",
189
- version: "1.6.1",
191
+ version: "1.6.2",
190
192
  });
191
193
 
192
194
  const client = new VercelCore({
@@ -259,6 +261,8 @@ export function createMCPServer(deps: {
259
261
  tool(tool$projectsUpdateProjectProtectionBypass);
260
262
  tool(tool$projectsRequestPromote);
261
263
  tool(tool$projectsListPromoteAliases);
264
+ tool(tool$projectsPauseProject);
265
+ tool(tool$projectsUnpauseProject);
262
266
  tool(tool$deploymentsGetDeploymentEvents);
263
267
  tool(tool$deploymentsUpdateIntegrationDeploymentAction);
264
268
  tool(tool$deploymentsGetDeployment);
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { projectsPauseProject } from "../../funcs/projectsPauseProject.js";
6
+ import { PauseProjectRequest$inboundSchema } from "../../models/pauseprojectop.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: PauseProjectRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$projectsPauseProject: ToolDefinition<typeof args> = {
14
+ name: "projects-pause-project",
15
+ description: `Pause a project
16
+
17
+ Pause a project by passing its project \`id\` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project disables auto assigning custom production domains and blocks the active Production Deployment then the request will return with 200 status code.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await projectsPauseProject(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ return formatResult(void 0, apiCall);
34
+ },
35
+ };
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { projectsUnpauseProject } from "../../funcs/projectsUnpauseProject.js";
6
+ import { UnpauseProjectRequest$inboundSchema } from "../../models/unpauseprojectop.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: UnpauseProjectRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$projectsUnpauseProject: ToolDefinition<typeof args> = {
14
+ name: "projects-unpause-project",
15
+ description: `Unpause a project
16
+
17
+ Unpause a project by passing its project \`id\` in the URL. If the project does not exist given the id then the request will fail with 400 status code. If the project enables auto assigning custom production domains and unblocks the active Production Deployment then the request will return with 200 status code.`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await projectsUnpauseProject(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ return formatResult(void 0, apiCall);
34
+ },
35
+ };
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../types/fp.js";
8
+ import { SDKValidationError } from "./sdkvalidationerror.js";
9
+
10
+ export type PauseProjectRequest = {
11
+ /**
12
+ * The unique project identifier
13
+ */
14
+ projectId: string;
15
+ /**
16
+ * The Team identifier to perform the request on behalf of.
17
+ */
18
+ teamId?: string | undefined;
19
+ /**
20
+ * The Team slug to perform the request on behalf of.
21
+ */
22
+ slug?: string | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const PauseProjectRequest$inboundSchema: z.ZodType<
27
+ PauseProjectRequest,
28
+ z.ZodTypeDef,
29
+ unknown
30
+ > = z.object({
31
+ projectId: z.string(),
32
+ teamId: z.string().optional(),
33
+ slug: z.string().optional(),
34
+ });
35
+
36
+ /** @internal */
37
+ export type PauseProjectRequest$Outbound = {
38
+ projectId: string;
39
+ teamId?: string | undefined;
40
+ slug?: string | undefined;
41
+ };
42
+
43
+ /** @internal */
44
+ export const PauseProjectRequest$outboundSchema: z.ZodType<
45
+ PauseProjectRequest$Outbound,
46
+ z.ZodTypeDef,
47
+ PauseProjectRequest
48
+ > = z.object({
49
+ projectId: z.string(),
50
+ teamId: z.string().optional(),
51
+ slug: z.string().optional(),
52
+ });
53
+
54
+ /**
55
+ * @internal
56
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
57
+ */
58
+ export namespace PauseProjectRequest$ {
59
+ /** @deprecated use `PauseProjectRequest$inboundSchema` instead. */
60
+ export const inboundSchema = PauseProjectRequest$inboundSchema;
61
+ /** @deprecated use `PauseProjectRequest$outboundSchema` instead. */
62
+ export const outboundSchema = PauseProjectRequest$outboundSchema;
63
+ /** @deprecated use `PauseProjectRequest$Outbound` instead. */
64
+ export type Outbound = PauseProjectRequest$Outbound;
65
+ }
66
+
67
+ export function pauseProjectRequestToJSON(
68
+ pauseProjectRequest: PauseProjectRequest,
69
+ ): string {
70
+ return JSON.stringify(
71
+ PauseProjectRequest$outboundSchema.parse(pauseProjectRequest),
72
+ );
73
+ }
74
+
75
+ export function pauseProjectRequestFromJSON(
76
+ jsonString: string,
77
+ ): SafeParseResult<PauseProjectRequest, SDKValidationError> {
78
+ return safeParse(
79
+ jsonString,
80
+ (x) => PauseProjectRequest$inboundSchema.parse(JSON.parse(x)),
81
+ `Failed to parse 'PauseProjectRequest' from JSON`,
82
+ );
83
+ }