freestyle-sandboxes 0.0.77 → 0.0.78
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/inde.d.cts +1 -0
- package/dist/inde.d.mts +1 -0
- package/dist/{index-CGc0kRd_.cjs → index-BBXyg0JQ.cjs} +5 -9
- package/dist/index-BQHqnjZK.mjs +3231 -0
- package/dist/index-CEEa9WHp.cjs +3238 -0
- package/dist/{index-jh-93svX.mjs → index-DCF70Xbq.mjs} +5 -9
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +14 -0
- package/dist/types.gen-1sd31qLV.d.ts +172 -0
- package/dist/types.gen-627pxroW.d.ts +830 -0
- package/dist/types.gen-BCdfx7yt.d.ts +760 -0
- package/dist/{types.gen-0bQ5Wn0o.d.ts → types.gen-BVXmFV7d.d.ts} +17 -18
- package/dist/types.gen-BaMKzqxQ.d.ts +233 -0
- package/dist/types.gen-BbekD8Sd.d.ts +1119 -0
- package/dist/types.gen-BqN1t03N.d.ts +842 -0
- package/dist/types.gen-BtK6PMQy.d.ts +195 -0
- package/dist/types.gen-C03gaIPq.d.ts +297 -0
- package/dist/{types.gen-BJArgpto.d.ts → types.gen-CIf3ciN7.d.ts} +5 -2
- package/dist/types.gen-CMuCas4r.d.ts +183 -0
- package/dist/{types.gen-DxZanGNF.d.ts → types.gen-CZUnqmzP.d.ts} +6 -9
- package/dist/types.gen-CnEkmbco.d.ts +314 -0
- package/dist/types.gen-DDYpuDzZ.d.ts +764 -0
- package/dist/types.gen-DHmdEOOa.d.ts +172 -0
- package/dist/{types.gen-CfrGF-JI.d.ts → types.gen-DLYohMJT.d.ts} +1 -1
- package/dist/types.gen-DbTb_SrD.d.ts +156 -0
- package/dist/types.gen-DkQ-Dbs1.d.ts +764 -0
- package/dist/types.gen-DyY7Deri.d.ts +138 -0
- package/dist/types.gen-MBZCvIhE.d.ts +311 -0
- package/dist/types.gen-YhJAHBw8.d.ts +233 -0
- package/dist/types.gen-cCnnhnB6.d.ts +182 -0
- package/dist/types.gen-mg_JNXrq.d.ts +830 -0
- package/dist/types.gen-uDTr6v-7.d.ts +731 -0
- package/package.json +1 -1
- package/src/index.ts +57 -39
- package/src/temp.ts +0 -10
|
@@ -3167,12 +3167,11 @@ const executeTool = (config) => {
|
|
|
3167
3167
|
return tool({
|
|
3168
3168
|
description: executeCodeDescription(envVars, nodeModules),
|
|
3169
3169
|
parameters: executeCodeSchema,
|
|
3170
|
-
execute: async ({ script, ...otherParams }
|
|
3170
|
+
execute: async ({ script, ...otherParams }) => {
|
|
3171
3171
|
try {
|
|
3172
3172
|
const res = await api.executeScript(script, config);
|
|
3173
3173
|
if (config.onResult) {
|
|
3174
3174
|
await config.onResult({
|
|
3175
|
-
toolCallId,
|
|
3176
3175
|
result: res,
|
|
3177
3176
|
input: {
|
|
3178
3177
|
script,
|
|
@@ -3215,13 +3214,10 @@ ${nodeModules.length > 0 ? `You can use the following node modules: ${nodeModule
|
|
|
3215
3214
|
`)
|
|
3216
3215
|
}),
|
|
3217
3216
|
execute: async ({ files }) => {
|
|
3218
|
-
const new_files = Object.keys(files).reduce(
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
},
|
|
3223
|
-
{}
|
|
3224
|
-
);
|
|
3217
|
+
const new_files = Object.keys(files).reduce((acc, key) => {
|
|
3218
|
+
acc[key] = { content: files[key] };
|
|
3219
|
+
return acc;
|
|
3220
|
+
}, {});
|
|
3225
3221
|
try {
|
|
3226
3222
|
const res = await api.deployWeb(
|
|
3227
3223
|
{
|
package/dist/index.cjs
CHANGED
|
@@ -377,6 +377,20 @@ Message: ${response.error?.message}`
|
|
|
377
377
|
}
|
|
378
378
|
throw new Error(response.error.message);
|
|
379
379
|
}
|
|
380
|
+
async verifyDomainVerificationRequest(id) {
|
|
381
|
+
const response = await handleVerifyDomain({
|
|
382
|
+
client: this.client,
|
|
383
|
+
body: {
|
|
384
|
+
id
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
if (response.data) {
|
|
388
|
+
return response.data;
|
|
389
|
+
}
|
|
390
|
+
throw new Error(
|
|
391
|
+
`Failed to verify domain verification request with ID ${id}: ${response.error.message}`
|
|
392
|
+
);
|
|
393
|
+
}
|
|
380
394
|
/**
|
|
381
395
|
* Verify a domain. Note, this requires the domain verification token to be already set up.
|
|
382
396
|
* @param domain The domain to verify.
|
package/dist/index.d.cts
CHANGED
|
@@ -155,6 +155,7 @@ declare class FreestyleSandboxes {
|
|
|
155
155
|
* @returns The domain verification token.
|
|
156
156
|
*/
|
|
157
157
|
createDomainVerificationRequest(domain: string): Promise<HandleCreateDomainVerificationResponse>;
|
|
158
|
+
verifyDomainVerificationRequest(id: string): Promise<HandleVerifyDomainResponse>;
|
|
158
159
|
/**
|
|
159
160
|
* Verify a domain. Note, this requires the domain verification token to be already set up.
|
|
160
161
|
* @param domain The domain to verify.
|
package/dist/index.d.mts
CHANGED
|
@@ -155,6 +155,7 @@ declare class FreestyleSandboxes {
|
|
|
155
155
|
* @returns The domain verification token.
|
|
156
156
|
*/
|
|
157
157
|
createDomainVerificationRequest(domain: string): Promise<HandleCreateDomainVerificationResponse>;
|
|
158
|
+
verifyDomainVerificationRequest(id: string): Promise<HandleVerifyDomainResponse>;
|
|
158
159
|
/**
|
|
159
160
|
* Verify a domain. Note, this requires the domain verification token to be already set up.
|
|
160
161
|
* @param domain The domain to verify.
|
package/dist/index.mjs
CHANGED
|
@@ -375,6 +375,20 @@ Message: ${response.error?.message}`
|
|
|
375
375
|
}
|
|
376
376
|
throw new Error(response.error.message);
|
|
377
377
|
}
|
|
378
|
+
async verifyDomainVerificationRequest(id) {
|
|
379
|
+
const response = await handleVerifyDomain({
|
|
380
|
+
client: this.client,
|
|
381
|
+
body: {
|
|
382
|
+
id
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
if (response.data) {
|
|
386
|
+
return response.data;
|
|
387
|
+
}
|
|
388
|
+
throw new Error(
|
|
389
|
+
`Failed to verify domain verification request with ID ${id}: ${response.error.message}`
|
|
390
|
+
);
|
|
391
|
+
}
|
|
378
392
|
/**
|
|
379
393
|
* Verify a domain. Note, this requires the domain verification token to be already set up.
|
|
380
394
|
* @param domain The domain to verify.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
type FreestyleCloudstateDeployConfiguration = {
|
|
2
|
+
/**
|
|
3
|
+
* ID of the project to deploy, if not provided will create a new project
|
|
4
|
+
*/
|
|
5
|
+
projectId?: (string) | null;
|
|
6
|
+
/**
|
|
7
|
+
* The environment variables that the cloudstate deploy can access
|
|
8
|
+
*/
|
|
9
|
+
envVars?: {
|
|
10
|
+
[key: string]: (string);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type FreestyleCloudstateDeployErrorResponse = {
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
type FreestyleCloudstateDeployRequest = {
|
|
17
|
+
classes: string;
|
|
18
|
+
config?: FreestyleCloudstateDeployConfiguration;
|
|
19
|
+
};
|
|
20
|
+
type FreestyleCloudstateDeploySuccessResponse = {
|
|
21
|
+
/**
|
|
22
|
+
* The id of the project deployed to
|
|
23
|
+
*/
|
|
24
|
+
projectId: string;
|
|
25
|
+
};
|
|
26
|
+
type FreestyleDeployWebConfiguration = {
|
|
27
|
+
/**
|
|
28
|
+
* The entrypoint file for the website
|
|
29
|
+
*/
|
|
30
|
+
entrypoint?: (string) | null;
|
|
31
|
+
/**
|
|
32
|
+
* The custom domains for the website, eg. [\"subdomain.yourwebsite.com\"]. You may not include *.style.dev domains here, those are reserved for projectIds
|
|
33
|
+
*/
|
|
34
|
+
domains?: Array<(string)> | null;
|
|
35
|
+
/**
|
|
36
|
+
* The project id to deploy to, if not provided will create a new project, may be used to provision a new project with a specific id if that id is available
|
|
37
|
+
*/
|
|
38
|
+
projectId?: (string) | null;
|
|
39
|
+
/**
|
|
40
|
+
* Node Modules to install for the website, a map of package names to versions, e.g. { \"express\": \"4.17.1\" }. If this and a package-lock.json are provided, the package-lock.json, bun.lockb, pnpm-lock.yaml, or yarn.lock is also provided, the versions here will override the versions in those lock files.
|
|
41
|
+
*/
|
|
42
|
+
nodeModules?: {
|
|
43
|
+
[key: string]: (string);
|
|
44
|
+
} | null;
|
|
45
|
+
/**
|
|
46
|
+
* The environment variables that the website can access
|
|
47
|
+
* e.g. { \"RESEND_API_KEY\": \"re_123456789\" }
|
|
48
|
+
*/
|
|
49
|
+
envVars?: {
|
|
50
|
+
[key: string]: (string);
|
|
51
|
+
} | null;
|
|
52
|
+
};
|
|
53
|
+
type FreestyleDeployWebErrorResponse = {
|
|
54
|
+
message: string;
|
|
55
|
+
};
|
|
56
|
+
type FreestyleDeployWebPayload = {
|
|
57
|
+
/**
|
|
58
|
+
* The files to deploy, a map of file paths to file contents, e.g. { \"index.js\": {\"content\": \"your main\", \"encoding\": \"utf-8\"}, \"file2.js\": {\"content\": \"your helper\" } }
|
|
59
|
+
*
|
|
60
|
+
* **Do not include node modules in this bundle, they will not work**. Instead, includes a package-lock.json, bun.lockb, pnpm-lock.yaml, or yarn.lock, the node modules for the project will be installed from that lock file, or use the node_modules field in the configuration to specify the node modules to install.
|
|
61
|
+
*/
|
|
62
|
+
files: {
|
|
63
|
+
[key: string]: FreestyleFile;
|
|
64
|
+
};
|
|
65
|
+
config?: FreestyleDeployWebConfiguration;
|
|
66
|
+
};
|
|
67
|
+
type FreestyleDeployWebSuccessResponse = {
|
|
68
|
+
projectId: string;
|
|
69
|
+
};
|
|
70
|
+
type FreestyleDomainVerificationRequest = {
|
|
71
|
+
/**
|
|
72
|
+
* The domain to create a verification code for
|
|
73
|
+
*/
|
|
74
|
+
domain: string;
|
|
75
|
+
};
|
|
76
|
+
type FreestyleExecureScriptResultError = {
|
|
77
|
+
error: string;
|
|
78
|
+
};
|
|
79
|
+
type FreestyleExecureScriptResultSuccess = {
|
|
80
|
+
result: unknown;
|
|
81
|
+
};
|
|
82
|
+
type FreestyleExecuteScriptParams = {
|
|
83
|
+
/**
|
|
84
|
+
* The JavaScript or TypeScript script to execute
|
|
85
|
+
*/
|
|
86
|
+
script: string;
|
|
87
|
+
config?: FreestyleExecuteScriptParamsConfiguration;
|
|
88
|
+
};
|
|
89
|
+
type FreestyleExecuteScriptParamsConfiguration = {
|
|
90
|
+
/**
|
|
91
|
+
* The environment variables to set for the script
|
|
92
|
+
*/
|
|
93
|
+
envVars?: {
|
|
94
|
+
[key: string]: (string);
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* The node modules to install for the script
|
|
98
|
+
*/
|
|
99
|
+
nodeModules?: {
|
|
100
|
+
[key: string]: (string);
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Tags for you to organize your scripts, useful for tracking what you're running
|
|
104
|
+
*/
|
|
105
|
+
tags?: Array<(string)>;
|
|
106
|
+
/**
|
|
107
|
+
* The script timeout
|
|
108
|
+
*/
|
|
109
|
+
timeout?: (string) | null;
|
|
110
|
+
};
|
|
111
|
+
type FreestyleFile = {
|
|
112
|
+
/**
|
|
113
|
+
* The content of the file
|
|
114
|
+
*/
|
|
115
|
+
content: string;
|
|
116
|
+
/**
|
|
117
|
+
* The encoding of the file. Either **utf-8** or **base64**
|
|
118
|
+
*/
|
|
119
|
+
encoding?: string;
|
|
120
|
+
};
|
|
121
|
+
type FreestyleLogResponseObject = {
|
|
122
|
+
message: string;
|
|
123
|
+
};
|
|
124
|
+
type FreestyleVerifyDomainRequest = {
|
|
125
|
+
domain: string;
|
|
126
|
+
};
|
|
127
|
+
type HandleDeployCloudstateData = {
|
|
128
|
+
body: FreestyleCloudstateDeployRequest;
|
|
129
|
+
};
|
|
130
|
+
type HandleDeployCloudstateResponse = (FreestyleCloudstateDeploySuccessResponse);
|
|
131
|
+
type HandleDeployCloudstateError = (FreestyleCloudstateDeployErrorResponse);
|
|
132
|
+
type HandleBackupCloudstateResponse = (Array<(number)>);
|
|
133
|
+
type HandleBackupCloudstateError = (unknown);
|
|
134
|
+
type HandleListDomainsResponse = ({
|
|
135
|
+
domains: Array<(string)>;
|
|
136
|
+
});
|
|
137
|
+
type HandleListDomainsError = ({
|
|
138
|
+
message: string;
|
|
139
|
+
});
|
|
140
|
+
type HandleVerifyDomainData = {
|
|
141
|
+
body: FreestyleVerifyDomainRequest;
|
|
142
|
+
};
|
|
143
|
+
type HandleVerifyDomainResponse = ({
|
|
144
|
+
domain: string;
|
|
145
|
+
});
|
|
146
|
+
type HandleVerifyDomainError = ({
|
|
147
|
+
message: string;
|
|
148
|
+
});
|
|
149
|
+
type HandleCreateDomainVerificationData = {
|
|
150
|
+
body: FreestyleDomainVerificationRequest;
|
|
151
|
+
};
|
|
152
|
+
type HandleCreateDomainVerificationResponse = ({
|
|
153
|
+
verification_code: string;
|
|
154
|
+
domain: string;
|
|
155
|
+
});
|
|
156
|
+
type HandleCreateDomainVerificationError = ({
|
|
157
|
+
message: string;
|
|
158
|
+
});
|
|
159
|
+
type HandleExecuteScriptData = {
|
|
160
|
+
body: FreestyleExecuteScriptParams;
|
|
161
|
+
};
|
|
162
|
+
type HandleExecuteScriptResponse = (FreestyleExecureScriptResultSuccess);
|
|
163
|
+
type HandleExecuteScriptError = (FreestyleExecureScriptResultError);
|
|
164
|
+
type HandleDeployWebData = {
|
|
165
|
+
body: FreestyleDeployWebPayload;
|
|
166
|
+
};
|
|
167
|
+
type HandleDeployWebResponse = (FreestyleDeployWebSuccessResponse);
|
|
168
|
+
type HandleDeployWebError = (FreestyleDeployWebErrorResponse);
|
|
169
|
+
type HandleGetLogsResponse = (Array<FreestyleLogResponseObject>);
|
|
170
|
+
type HandleGetLogsError = unknown;
|
|
171
|
+
|
|
172
|
+
export type { HandleCreateDomainVerificationData as A, HandleCreateDomainVerificationError as B, HandleExecuteScriptData as C, HandleExecuteScriptResponse as D, HandleExecuteScriptError as E, FreestyleExecuteScriptParamsConfiguration as F, HandleDeployWebData as G, HandleBackupCloudstateResponse as H, HandleDeployWebResponse as I, HandleDeployWebError as J, HandleGetLogsError as K, FreestyleExecureScriptResultSuccess as a, FreestyleDeployWebConfiguration as b, FreestyleDeployWebSuccessResponse as c, FreestyleCloudstateDeployRequest as d, FreestyleCloudstateDeploySuccessResponse as e, HandleGetLogsResponse as f, HandleCreateDomainVerificationResponse as g, HandleVerifyDomainResponse as h, HandleListDomainsResponse as i, FreestyleCloudstateDeployConfiguration as j, FreestyleCloudstateDeployErrorResponse as k, FreestyleDeployWebErrorResponse as l, FreestyleDeployWebPayload as m, FreestyleDomainVerificationRequest as n, FreestyleExecureScriptResultError as o, FreestyleExecuteScriptParams as p, FreestyleFile as q, FreestyleLogResponseObject as r, FreestyleVerifyDomainRequest as s, HandleDeployCloudstateData as t, HandleDeployCloudstateResponse as u, HandleDeployCloudstateError as v, HandleBackupCloudstateError as w, HandleListDomainsError as x, HandleVerifyDomainData as y, HandleVerifyDomainError as z };
|