freestyle-sandboxes 0.0.16 → 0.0.18

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.
@@ -1,5 +1,5 @@
1
1
  import * as ai from 'ai';
2
- import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecureScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-YhJAHBw8.js';
2
+ import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-C03gaIPq.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const executeCodeSchema: z.ZodObject<{
@@ -26,10 +26,10 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
26
26
  script?: string;
27
27
  }, {
28
28
  script?: string;
29
- }>, string | FreestyleExecureScriptResultSuccess> & {
29
+ }>, string | FreestyleExecuteScriptResultSuccess> & {
30
30
  execute: (args: {
31
31
  script?: string;
32
- }, options: ai.ToolExecutionOptions) => PromiseLike<string | FreestyleExecureScriptResultSuccess>;
32
+ }, options: ai.ToolExecutionOptions) => PromiseLike<string | FreestyleExecuteScriptResultSuccess>;
33
33
  };
34
34
  /**
35
35
  * Deploy a Web project
@@ -1,5 +1,5 @@
1
1
  import * as ai from 'ai';
2
- import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecureScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-YhJAHBw8.js';
2
+ import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-C03gaIPq.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const executeCodeSchema: z.ZodObject<{
@@ -26,10 +26,10 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
26
26
  script?: string;
27
27
  }, {
28
28
  script?: string;
29
- }>, string | FreestyleExecureScriptResultSuccess> & {
29
+ }>, string | FreestyleExecuteScriptResultSuccess> & {
30
30
  execute: (args: {
31
31
  script?: string;
32
- }, options: ai.ToolExecutionOptions) => PromiseLike<string | FreestyleExecureScriptResultSuccess>;
32
+ }, options: ai.ToolExecutionOptions) => PromiseLike<string | FreestyleExecuteScriptResultSuccess>;
33
33
  };
34
34
  /**
35
35
  * Deploy a Web project
package/dist/index.cjs CHANGED
@@ -15,6 +15,12 @@ const handleBackupCloudstate = (options) => {
15
15
  url: "/cloudstate/v1/projects/{id}/backup"
16
16
  });
17
17
  };
18
+ const handleVerifyWildcard = (options) => {
19
+ return (options?.client ?? client).post({
20
+ ...options,
21
+ url: "/domains/v1/certs/{domain}/wildcard"
22
+ });
23
+ };
18
24
  const handleListDomains = (options) => {
19
25
  return (options?.client ?? client).get({
20
26
  ...options,
@@ -45,22 +51,40 @@ const handleDeleteDomainVerification = (options) => {
45
51
  url: "/domains/v1/verifications"
46
52
  });
47
53
  };
54
+ const handleListExecuteRuns = (options) => {
55
+ return (options?.client ?? client).get({
56
+ ...options,
57
+ url: "/execute/v1/deployments"
58
+ });
59
+ };
60
+ const handleGetExecuteRun = (options) => {
61
+ return (options?.client ?? client).get({
62
+ ...options,
63
+ url: "/execute/v1/deployments/{deployment}"
64
+ });
65
+ };
48
66
  const handleExecuteScript = (options) => {
49
67
  return (options?.client ?? client).post({
50
68
  ...options,
51
69
  url: "/execute/v1/script"
52
70
  });
53
71
  };
72
+ const handleGetLogs = (options) => {
73
+ return (options?.client ?? client).get({
74
+ ...options,
75
+ url: "/observability/v1/logs"
76
+ });
77
+ };
54
78
  const handleDeployWeb = (options) => {
55
79
  return (options?.client ?? client).post({
56
80
  ...options,
57
81
  url: "/web/v1/deploy"
58
82
  });
59
83
  };
60
- const handleGetLogs = (options) => {
84
+ const handleListWebDeploys = (options) => {
61
85
  return (options?.client ?? client).get({
62
86
  ...options,
63
- url: "/web/v1/projects/{id}/logs"
87
+ url: "/web/v1/deployments"
64
88
  });
65
89
  };
66
90
 
@@ -159,17 +183,20 @@ Message: ${response.error?.message}`
159
183
  }
160
184
  }
161
185
  /**
162
- * Get logs for a sandbox.
186
+ * Get logs for an execute run, or web deployment.
163
187
  * @param id The ID of the sandbox.
164
188
  * @returns The logs for the sandbox.
165
189
  * @throws An error if the logs could not be retrieved.
166
190
  */
167
- async getWebLogs(id) {
191
+ async getLogs(id) {
168
192
  const response = await handleGetLogs({
169
193
  client: this.client,
170
- path: {
171
- id
194
+ query: {
195
+ deploymentId: id
172
196
  }
197
+ // path: {
198
+ // id: id,
199
+ // },
173
200
  });
174
201
  if (response.data) {
175
202
  return response.data;
@@ -257,6 +284,59 @@ Message: ${response.error?.message}`
257
284
  );
258
285
  }
259
286
  }
287
+ async listWebDeployments() {
288
+ const response = await handleListWebDeploys({
289
+ client: this.client
290
+ });
291
+ if (response.data) {
292
+ return response.data;
293
+ } else {
294
+ throw new Error(
295
+ "Failed to list web deployments\n" + response.error.message
296
+ );
297
+ }
298
+ }
299
+ async listExecuteRuns() {
300
+ const response = await handleListExecuteRuns({
301
+ client: this.client
302
+ });
303
+ if (response.data) {
304
+ return response.data;
305
+ } else {
306
+ throw new Error("Failed to list execute runs\n" + response.error.message);
307
+ }
308
+ }
309
+ async getExecuteRun(id) {
310
+ const response = await handleGetExecuteRun({
311
+ client: this.client,
312
+ path: {
313
+ deployment: id
314
+ }
315
+ });
316
+ if (response.data) {
317
+ return response.data;
318
+ } else {
319
+ throw new Error(
320
+ `Failed to get execute run with ID ${id}: ${response.error.message}`
321
+ );
322
+ }
323
+ }
324
+ /** Provision a wildcard certificate for domain. */
325
+ async provisionWildcard(domain) {
326
+ const response = await handleVerifyWildcard({
327
+ client: this.client,
328
+ path: {
329
+ domain
330
+ }
331
+ });
332
+ if (response.data) {
333
+ return response.data;
334
+ } else {
335
+ throw new Error(
336
+ `Failed to provision wildcard for domain ${domain}: ${response.error.message}`
337
+ );
338
+ }
339
+ }
260
340
  }
261
341
 
262
342
  exports.FreestyleSandboxes = FreestyleSandboxes;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecureScriptResultSuccess, b as FreestyleDeployWebConfiguration, c as FreestyleDeployWebSuccessResponse, d as FreestyleCloudstateDeployRequest, e as FreestyleCloudstateDeploySuccessResponse, H as HandleBackupCloudstateResponse, f as HandleGetLogsResponse, g as HandleCreateDomainVerificationResponse, h as HandleVerifyDomainResponse, i as HandleVerifyDomainError, j as HandleListDomainsResponse, k as HandleListDomainVerificationRequestsResponse, l as HandleDeleteDomainVerificationResponse } from './types.gen-YhJAHBw8.js';
2
- export { m as FreestyleCloudstateDeployConfiguration, n as FreestyleCloudstateDeployErrorResponse, o as FreestyleDeleteDomainVerificationRequest, p as FreestyleDeployWebErrorResponse, q as FreestyleDeployWebPayload, r as FreestyleDomainVerificationRequest, s as FreestyleExecureScriptResultError, t as FreestyleExecuteScriptParams, u as FreestyleFile, v as FreestyleLogResponseObject, w as FreestyleVerifyDomainRequest, A as HandleBackupCloudstateData, B as HandleBackupCloudstateError, G as HandleCreateDomainVerificationData, I as HandleCreateDomainVerificationError, K as HandleDeleteDomainVerificationData, L as HandleDeleteDomainVerificationError, x as HandleDeployCloudstateData, z as HandleDeployCloudstateError, y as HandleDeployCloudstateResponse, P as HandleDeployWebData, R as HandleDeployWebError, Q as HandleDeployWebResponse, M as HandleExecuteScriptData, O as HandleExecuteScriptError, N as HandleExecuteScriptResponse, S as HandleGetLogsData, T as HandleGetLogsError, D as HandleListDomainVerificationRequestsError, C as HandleListDomainsError, E as HandleVerifyDomainData, J as JavaScriptLog } from './types.gen-YhJAHBw8.js';
1
+ import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, b as FreestyleDeployWebConfiguration, c as FreestyleDeployWebSuccessResponse, d as FreestyleCloudstateDeployRequest, e as FreestyleCloudstateDeploySuccessResponse, H as HandleBackupCloudstateResponse, f as HandleGetLogsResponse, g as HandleCreateDomainVerificationResponse, h as HandleVerifyDomainResponse, i as HandleVerifyDomainError, j as HandleListDomainsResponse, k as HandleListDomainVerificationRequestsResponse, l as HandleDeleteDomainVerificationResponse, m as HandleListWebDeploysResponse, n as HandleListExecuteRunsResponse, o as HandleGetExecuteRunResponse, p as HandleVerifyWildcardResponse } from './types.gen-C03gaIPq.js';
2
+ export { D as DeploymentLogEntry, q as DeploymentState, E as ExecuteLogEntry, r as ExecuteRunState, s as FreestyleCloudstateDeployConfiguration, t as FreestyleCloudstateDeployErrorResponse, u as FreestyleDeleteDomainVerificationRequest, v as FreestyleDeployWebErrorResponse, w as FreestyleDeployWebPayload, x as FreestyleDomainVerificationRequest, y as FreestyleExecuteScriptParams, z as FreestyleFile, A as FreestyleJavaScriptLog, B as FreestyleLogResponseObject, C as FreestyleVerifyDomainRequest, K as HandleBackupCloudstateData, L as HandleBackupCloudstateError, Q as HandleCreateDomainVerificationData, R as HandleCreateDomainVerificationError, S as HandleDeleteDomainVerificationData, T as HandleDeleteDomainVerificationError, G as HandleDeployCloudstateData, J as HandleDeployCloudstateError, I as HandleDeployCloudstateResponse, a1 as HandleDeployWebData, a3 as HandleDeployWebError, a2 as HandleDeployWebResponse, Y as HandleExecuteScriptData, _ as HandleExecuteScriptError, Z as HandleExecuteScriptResponse, W as HandleGetExecuteRunData, X as HandleGetExecuteRunError, $ as HandleGetLogsData, a0 as HandleGetLogsError, O as HandleListDomainVerificationRequestsError, N as HandleListDomainsError, U as HandleListExecuteRunsData, V as HandleListExecuteRunsError, a4 as HandleListWebDeploysError, P as HandleVerifyDomainData, M as HandleVerifyWildcardError } from './types.gen-C03gaIPq.js';
3
3
 
4
4
  declare class FreestyleSandboxes {
5
5
  private client;
@@ -20,7 +20,7 @@ declare class FreestyleSandboxes {
20
20
  /**
21
21
  * Execute a script in a sandbox.
22
22
  */
23
- executeScript(script: string, config?: FreestyleExecuteScriptParamsConfiguration): Promise<FreestyleExecureScriptResultSuccess>;
23
+ executeScript(script: string, config?: FreestyleExecuteScriptParamsConfiguration): Promise<FreestyleExecuteScriptResultSuccess>;
24
24
  /**
25
25
  * Deploy a Web project to a sandbox.
26
26
  */
@@ -40,12 +40,12 @@ declare class FreestyleSandboxes {
40
40
  */
41
41
  backupCloudstate(id: string): Promise<HandleBackupCloudstateResponse>;
42
42
  /**
43
- * Get logs for a sandbox.
43
+ * Get logs for an execute run, or web deployment.
44
44
  * @param id The ID of the sandbox.
45
45
  * @returns The logs for the sandbox.
46
46
  * @throws An error if the logs could not be retrieved.
47
47
  */
48
- getWebLogs(id: string): Promise<HandleGetLogsResponse>;
48
+ getLogs(id: string): Promise<HandleGetLogsResponse>;
49
49
  /**
50
50
  * Create a a domain verification request.
51
51
  * @param domain The domain to verify.
@@ -61,6 +61,11 @@ declare class FreestyleSandboxes {
61
61
  listDomains(): Promise<HandleListDomainsResponse>;
62
62
  listDomainVerificationRequests(): Promise<HandleListDomainVerificationRequestsResponse>;
63
63
  deleteDomainVerificationRequest(domain: string, verificationCode: string): Promise<HandleDeleteDomainVerificationResponse>;
64
+ listWebDeployments(): Promise<HandleListWebDeploysResponse>;
65
+ listExecuteRuns(): Promise<HandleListExecuteRunsResponse>;
66
+ getExecuteRun(id: string): Promise<HandleGetExecuteRunResponse>;
67
+ /** Provision a wildcard certificate for domain. */
68
+ provisionWildcard(domain: string): Promise<HandleVerifyWildcardResponse>;
64
69
  }
65
70
 
66
- export { FreestyleCloudstateDeployRequest, FreestyleCloudstateDeploySuccessResponse, FreestyleDeployWebConfiguration, FreestyleDeployWebSuccessResponse, FreestyleExecureScriptResultSuccess, FreestyleExecuteScriptParamsConfiguration, FreestyleSandboxes, HandleBackupCloudstateResponse, HandleCreateDomainVerificationResponse, HandleDeleteDomainVerificationResponse, HandleGetLogsResponse, HandleListDomainVerificationRequestsResponse, HandleListDomainsResponse, HandleVerifyDomainError, HandleVerifyDomainResponse };
71
+ export { FreestyleCloudstateDeployRequest, FreestyleCloudstateDeploySuccessResponse, FreestyleDeployWebConfiguration, FreestyleDeployWebSuccessResponse, FreestyleExecuteScriptParamsConfiguration, FreestyleExecuteScriptResultSuccess, FreestyleSandboxes, HandleBackupCloudstateResponse, HandleCreateDomainVerificationResponse, HandleDeleteDomainVerificationResponse, HandleGetExecuteRunResponse, HandleGetLogsResponse, HandleListDomainVerificationRequestsResponse, HandleListDomainsResponse, HandleListExecuteRunsResponse, HandleListWebDeploysResponse, HandleVerifyDomainError, HandleVerifyDomainResponse, HandleVerifyWildcardResponse };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecureScriptResultSuccess, b as FreestyleDeployWebConfiguration, c as FreestyleDeployWebSuccessResponse, d as FreestyleCloudstateDeployRequest, e as FreestyleCloudstateDeploySuccessResponse, H as HandleBackupCloudstateResponse, f as HandleGetLogsResponse, g as HandleCreateDomainVerificationResponse, h as HandleVerifyDomainResponse, i as HandleVerifyDomainError, j as HandleListDomainsResponse, k as HandleListDomainVerificationRequestsResponse, l as HandleDeleteDomainVerificationResponse } from './types.gen-YhJAHBw8.js';
2
- export { m as FreestyleCloudstateDeployConfiguration, n as FreestyleCloudstateDeployErrorResponse, o as FreestyleDeleteDomainVerificationRequest, p as FreestyleDeployWebErrorResponse, q as FreestyleDeployWebPayload, r as FreestyleDomainVerificationRequest, s as FreestyleExecureScriptResultError, t as FreestyleExecuteScriptParams, u as FreestyleFile, v as FreestyleLogResponseObject, w as FreestyleVerifyDomainRequest, A as HandleBackupCloudstateData, B as HandleBackupCloudstateError, G as HandleCreateDomainVerificationData, I as HandleCreateDomainVerificationError, K as HandleDeleteDomainVerificationData, L as HandleDeleteDomainVerificationError, x as HandleDeployCloudstateData, z as HandleDeployCloudstateError, y as HandleDeployCloudstateResponse, P as HandleDeployWebData, R as HandleDeployWebError, Q as HandleDeployWebResponse, M as HandleExecuteScriptData, O as HandleExecuteScriptError, N as HandleExecuteScriptResponse, S as HandleGetLogsData, T as HandleGetLogsError, D as HandleListDomainVerificationRequestsError, C as HandleListDomainsError, E as HandleVerifyDomainData, J as JavaScriptLog } from './types.gen-YhJAHBw8.js';
1
+ import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, b as FreestyleDeployWebConfiguration, c as FreestyleDeployWebSuccessResponse, d as FreestyleCloudstateDeployRequest, e as FreestyleCloudstateDeploySuccessResponse, H as HandleBackupCloudstateResponse, f as HandleGetLogsResponse, g as HandleCreateDomainVerificationResponse, h as HandleVerifyDomainResponse, i as HandleVerifyDomainError, j as HandleListDomainsResponse, k as HandleListDomainVerificationRequestsResponse, l as HandleDeleteDomainVerificationResponse, m as HandleListWebDeploysResponse, n as HandleListExecuteRunsResponse, o as HandleGetExecuteRunResponse, p as HandleVerifyWildcardResponse } from './types.gen-C03gaIPq.js';
2
+ export { D as DeploymentLogEntry, q as DeploymentState, E as ExecuteLogEntry, r as ExecuteRunState, s as FreestyleCloudstateDeployConfiguration, t as FreestyleCloudstateDeployErrorResponse, u as FreestyleDeleteDomainVerificationRequest, v as FreestyleDeployWebErrorResponse, w as FreestyleDeployWebPayload, x as FreestyleDomainVerificationRequest, y as FreestyleExecuteScriptParams, z as FreestyleFile, A as FreestyleJavaScriptLog, B as FreestyleLogResponseObject, C as FreestyleVerifyDomainRequest, K as HandleBackupCloudstateData, L as HandleBackupCloudstateError, Q as HandleCreateDomainVerificationData, R as HandleCreateDomainVerificationError, S as HandleDeleteDomainVerificationData, T as HandleDeleteDomainVerificationError, G as HandleDeployCloudstateData, J as HandleDeployCloudstateError, I as HandleDeployCloudstateResponse, a1 as HandleDeployWebData, a3 as HandleDeployWebError, a2 as HandleDeployWebResponse, Y as HandleExecuteScriptData, _ as HandleExecuteScriptError, Z as HandleExecuteScriptResponse, W as HandleGetExecuteRunData, X as HandleGetExecuteRunError, $ as HandleGetLogsData, a0 as HandleGetLogsError, O as HandleListDomainVerificationRequestsError, N as HandleListDomainsError, U as HandleListExecuteRunsData, V as HandleListExecuteRunsError, a4 as HandleListWebDeploysError, P as HandleVerifyDomainData, M as HandleVerifyWildcardError } from './types.gen-C03gaIPq.js';
3
3
 
4
4
  declare class FreestyleSandboxes {
5
5
  private client;
@@ -20,7 +20,7 @@ declare class FreestyleSandboxes {
20
20
  /**
21
21
  * Execute a script in a sandbox.
22
22
  */
23
- executeScript(script: string, config?: FreestyleExecuteScriptParamsConfiguration): Promise<FreestyleExecureScriptResultSuccess>;
23
+ executeScript(script: string, config?: FreestyleExecuteScriptParamsConfiguration): Promise<FreestyleExecuteScriptResultSuccess>;
24
24
  /**
25
25
  * Deploy a Web project to a sandbox.
26
26
  */
@@ -40,12 +40,12 @@ declare class FreestyleSandboxes {
40
40
  */
41
41
  backupCloudstate(id: string): Promise<HandleBackupCloudstateResponse>;
42
42
  /**
43
- * Get logs for a sandbox.
43
+ * Get logs for an execute run, or web deployment.
44
44
  * @param id The ID of the sandbox.
45
45
  * @returns The logs for the sandbox.
46
46
  * @throws An error if the logs could not be retrieved.
47
47
  */
48
- getWebLogs(id: string): Promise<HandleGetLogsResponse>;
48
+ getLogs(id: string): Promise<HandleGetLogsResponse>;
49
49
  /**
50
50
  * Create a a domain verification request.
51
51
  * @param domain The domain to verify.
@@ -61,6 +61,11 @@ declare class FreestyleSandboxes {
61
61
  listDomains(): Promise<HandleListDomainsResponse>;
62
62
  listDomainVerificationRequests(): Promise<HandleListDomainVerificationRequestsResponse>;
63
63
  deleteDomainVerificationRequest(domain: string, verificationCode: string): Promise<HandleDeleteDomainVerificationResponse>;
64
+ listWebDeployments(): Promise<HandleListWebDeploysResponse>;
65
+ listExecuteRuns(): Promise<HandleListExecuteRunsResponse>;
66
+ getExecuteRun(id: string): Promise<HandleGetExecuteRunResponse>;
67
+ /** Provision a wildcard certificate for domain. */
68
+ provisionWildcard(domain: string): Promise<HandleVerifyWildcardResponse>;
64
69
  }
65
70
 
66
- export { FreestyleCloudstateDeployRequest, FreestyleCloudstateDeploySuccessResponse, FreestyleDeployWebConfiguration, FreestyleDeployWebSuccessResponse, FreestyleExecureScriptResultSuccess, FreestyleExecuteScriptParamsConfiguration, FreestyleSandboxes, HandleBackupCloudstateResponse, HandleCreateDomainVerificationResponse, HandleDeleteDomainVerificationResponse, HandleGetLogsResponse, HandleListDomainVerificationRequestsResponse, HandleListDomainsResponse, HandleVerifyDomainError, HandleVerifyDomainResponse };
71
+ export { FreestyleCloudstateDeployRequest, FreestyleCloudstateDeploySuccessResponse, FreestyleDeployWebConfiguration, FreestyleDeployWebSuccessResponse, FreestyleExecuteScriptParamsConfiguration, FreestyleExecuteScriptResultSuccess, FreestyleSandboxes, HandleBackupCloudstateResponse, HandleCreateDomainVerificationResponse, HandleDeleteDomainVerificationResponse, HandleGetExecuteRunResponse, HandleGetLogsResponse, HandleListDomainVerificationRequestsResponse, HandleListDomainsResponse, HandleListExecuteRunsResponse, HandleListWebDeploysResponse, HandleVerifyDomainError, HandleVerifyDomainResponse, HandleVerifyWildcardResponse };
package/dist/index.mjs CHANGED
@@ -13,6 +13,12 @@ const handleBackupCloudstate = (options) => {
13
13
  url: "/cloudstate/v1/projects/{id}/backup"
14
14
  });
15
15
  };
16
+ const handleVerifyWildcard = (options) => {
17
+ return (options?.client ?? client).post({
18
+ ...options,
19
+ url: "/domains/v1/certs/{domain}/wildcard"
20
+ });
21
+ };
16
22
  const handleListDomains = (options) => {
17
23
  return (options?.client ?? client).get({
18
24
  ...options,
@@ -43,22 +49,40 @@ const handleDeleteDomainVerification = (options) => {
43
49
  url: "/domains/v1/verifications"
44
50
  });
45
51
  };
52
+ const handleListExecuteRuns = (options) => {
53
+ return (options?.client ?? client).get({
54
+ ...options,
55
+ url: "/execute/v1/deployments"
56
+ });
57
+ };
58
+ const handleGetExecuteRun = (options) => {
59
+ return (options?.client ?? client).get({
60
+ ...options,
61
+ url: "/execute/v1/deployments/{deployment}"
62
+ });
63
+ };
46
64
  const handleExecuteScript = (options) => {
47
65
  return (options?.client ?? client).post({
48
66
  ...options,
49
67
  url: "/execute/v1/script"
50
68
  });
51
69
  };
70
+ const handleGetLogs = (options) => {
71
+ return (options?.client ?? client).get({
72
+ ...options,
73
+ url: "/observability/v1/logs"
74
+ });
75
+ };
52
76
  const handleDeployWeb = (options) => {
53
77
  return (options?.client ?? client).post({
54
78
  ...options,
55
79
  url: "/web/v1/deploy"
56
80
  });
57
81
  };
58
- const handleGetLogs = (options) => {
82
+ const handleListWebDeploys = (options) => {
59
83
  return (options?.client ?? client).get({
60
84
  ...options,
61
- url: "/web/v1/projects/{id}/logs"
85
+ url: "/web/v1/deployments"
62
86
  });
63
87
  };
64
88
 
@@ -157,17 +181,20 @@ Message: ${response.error?.message}`
157
181
  }
158
182
  }
159
183
  /**
160
- * Get logs for a sandbox.
184
+ * Get logs for an execute run, or web deployment.
161
185
  * @param id The ID of the sandbox.
162
186
  * @returns The logs for the sandbox.
163
187
  * @throws An error if the logs could not be retrieved.
164
188
  */
165
- async getWebLogs(id) {
189
+ async getLogs(id) {
166
190
  const response = await handleGetLogs({
167
191
  client: this.client,
168
- path: {
169
- id
192
+ query: {
193
+ deploymentId: id
170
194
  }
195
+ // path: {
196
+ // id: id,
197
+ // },
171
198
  });
172
199
  if (response.data) {
173
200
  return response.data;
@@ -255,6 +282,59 @@ Message: ${response.error?.message}`
255
282
  );
256
283
  }
257
284
  }
285
+ async listWebDeployments() {
286
+ const response = await handleListWebDeploys({
287
+ client: this.client
288
+ });
289
+ if (response.data) {
290
+ return response.data;
291
+ } else {
292
+ throw new Error(
293
+ "Failed to list web deployments\n" + response.error.message
294
+ );
295
+ }
296
+ }
297
+ async listExecuteRuns() {
298
+ const response = await handleListExecuteRuns({
299
+ client: this.client
300
+ });
301
+ if (response.data) {
302
+ return response.data;
303
+ } else {
304
+ throw new Error("Failed to list execute runs\n" + response.error.message);
305
+ }
306
+ }
307
+ async getExecuteRun(id) {
308
+ const response = await handleGetExecuteRun({
309
+ client: this.client,
310
+ path: {
311
+ deployment: id
312
+ }
313
+ });
314
+ if (response.data) {
315
+ return response.data;
316
+ } else {
317
+ throw new Error(
318
+ `Failed to get execute run with ID ${id}: ${response.error.message}`
319
+ );
320
+ }
321
+ }
322
+ /** Provision a wildcard certificate for domain. */
323
+ async provisionWildcard(domain) {
324
+ const response = await handleVerifyWildcard({
325
+ client: this.client,
326
+ path: {
327
+ domain
328
+ }
329
+ });
330
+ if (response.data) {
331
+ return response.data;
332
+ } else {
333
+ throw new Error(
334
+ `Failed to provision wildcard for domain ${domain}: ${response.error.message}`
335
+ );
336
+ }
337
+ }
258
338
  }
259
339
 
260
340
  export { FreestyleSandboxes };
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var index = require('../index.cjs');
4
+ var tools = require('@langchain/core/tools');
5
+ var index$1 = require('../ai/index.cjs');
6
+ require('@hey-api/client-fetch');
7
+ require('ai');
8
+ require('zod');
9
+
10
+ const executeTool = (config) => {
11
+ const client = new index.FreestyleSandboxes({
12
+ apiKey: config.apiKey
13
+ });
14
+ return new tools.DynamicStructuredTool({
15
+ name: "executeTool",
16
+ description: index$1.executeCodeDescription(
17
+ Object.keys(config.envVars ?? {}).join(", "),
18
+ Object.keys(config.nodeModules ?? {}).join(", ")
19
+ ),
20
+ schema: index$1.executeCodeSchema,
21
+ func: async ({ script }) => {
22
+ return await client.executeScript(script, config);
23
+ }
24
+ });
25
+ };
26
+
27
+ exports.executeTool = executeTool;
@@ -0,0 +1,8 @@
1
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-C03gaIPq.js';
2
+ import { DynamicStructuredTool } from '@langchain/core/tools';
3
+
4
+ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
5
+ apiKey: string;
6
+ }) => DynamicStructuredTool;
7
+
8
+ export { executeTool };
@@ -0,0 +1,8 @@
1
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-C03gaIPq.js';
2
+ import { DynamicStructuredTool } from '@langchain/core/tools';
3
+
4
+ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
5
+ apiKey: string;
6
+ }) => DynamicStructuredTool;
7
+
8
+ export { executeTool };
@@ -0,0 +1,25 @@
1
+ import { FreestyleSandboxes } from '../index.mjs';
2
+ import { DynamicStructuredTool } from '@langchain/core/tools';
3
+ import { executeCodeDescription, executeCodeSchema } from '../ai/index.mjs';
4
+ import '@hey-api/client-fetch';
5
+ import 'ai';
6
+ import 'zod';
7
+
8
+ const executeTool = (config) => {
9
+ const client = new FreestyleSandboxes({
10
+ apiKey: config.apiKey
11
+ });
12
+ return new DynamicStructuredTool({
13
+ name: "executeTool",
14
+ description: executeCodeDescription(
15
+ Object.keys(config.envVars ?? {}).join(", "),
16
+ Object.keys(config.nodeModules ?? {}).join(", ")
17
+ ),
18
+ schema: executeCodeSchema,
19
+ func: async ({ script }) => {
20
+ return await client.executeScript(script, config);
21
+ }
22
+ });
23
+ };
24
+
25
+ export { executeTool };
@@ -1,6 +1,6 @@
1
1
  import * as _mastra_core from '@mastra/core';
2
2
  import { z } from 'zod';
3
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-YhJAHBw8.js';
3
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-C03gaIPq.js';
4
4
 
5
5
  declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
6
6
  apiKey: string;
@@ -1,6 +1,6 @@
1
1
  import * as _mastra_core from '@mastra/core';
2
2
  import { z } from 'zod';
3
- import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-YhJAHBw8.js';
3
+ import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-C03gaIPq.js';
4
4
 
5
5
  declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
6
6
  apiKey: string;