freestyle-sandboxes 0.0.18 → 0.0.20
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/ai/index.d.cts +1 -1
- package/dist/ai/index.d.mts +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/langgraph/index.d.cts +1 -1
- package/dist/langgraph/index.d.mts +1 -1
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.mts +1 -1
- package/dist/types.gen-CnEkmbco.d.ts +314 -0
- package/dist/types.gen-MBZCvIhE.d.ts +311 -0
- package/openapi/sdk.gen.ts +12 -1
- package/openapi/types.gen.ts +27 -7
- package/openapi.json +1 -1
- package/package.json +1 -1
package/dist/ai/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-
|
|
2
|
+
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-CnEkmbco.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const executeCodeSchema: z.ZodObject<{
|
package/dist/ai/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-
|
|
2
|
+
import { F as FreestyleExecuteScriptParamsConfiguration, a as FreestyleExecuteScriptResultSuccess, c as FreestyleDeployWebSuccessResponse } from '../types.gen-CnEkmbco.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
declare const executeCodeSchema: z.ZodObject<{
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
export { D as DeploymentLogEntry, q as DeploymentState, E as ExecuteLogEntry, r as
|
|
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-CnEkmbco.js';
|
|
2
|
+
export { D as DeploymentLogEntry, q as DeploymentState, E as ExecuteLogEntry, r as ExecuteRunInfo, s as ExecuteRunState, t as FreestyleCloudstateDeployConfiguration, u as FreestyleCloudstateDeployErrorResponse, v as FreestyleDeleteDomainVerificationRequest, w as FreestyleDeployWebErrorResponse, x as FreestyleDeployWebPayload, y as FreestyleDomainVerificationRequest, z as FreestyleExecuteScriptParams, A as FreestyleFile, B as FreestyleGetLogsResponse, C as FreestyleJavaScriptLog, G as FreestyleLogResponseObject, I as FreestyleVerifyDomainRequest, M as HandleBackupCloudstateData, N as HandleBackupCloudstateError, S as HandleCreateDomainVerificationData, T as HandleCreateDomainVerificationError, U as HandleDeleteDomainVerificationData, V as HandleDeleteDomainVerificationError, J as HandleDeployCloudstateData, L as HandleDeployCloudstateError, K as HandleDeployCloudstateResponse, a3 as HandleDeployWebData, a5 as HandleDeployWebError, a4 as HandleDeployWebResponse, _ as HandleExecuteScriptData, a0 as HandleExecuteScriptError, $ as HandleExecuteScriptResponse, Y as HandleGetExecuteRunData, Z as HandleGetExecuteRunError, a1 as HandleGetLogsData, a2 as HandleGetLogsError, a7 as HandleGetWebDeployDetailsData, Q as HandleListDomainVerificationRequestsError, P as HandleListDomainsError, W as HandleListExecuteRunsData, X as HandleListExecuteRunsError, a6 as HandleListWebDeploysError, R as HandleVerifyDomainData, O as HandleVerifyWildcardError } from './types.gen-CnEkmbco.js';
|
|
3
3
|
|
|
4
4
|
declare class FreestyleSandboxes {
|
|
5
5
|
private client;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
2
|
-
export { D as DeploymentLogEntry, q as DeploymentState, E as ExecuteLogEntry, r as
|
|
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-CnEkmbco.js';
|
|
2
|
+
export { D as DeploymentLogEntry, q as DeploymentState, E as ExecuteLogEntry, r as ExecuteRunInfo, s as ExecuteRunState, t as FreestyleCloudstateDeployConfiguration, u as FreestyleCloudstateDeployErrorResponse, v as FreestyleDeleteDomainVerificationRequest, w as FreestyleDeployWebErrorResponse, x as FreestyleDeployWebPayload, y as FreestyleDomainVerificationRequest, z as FreestyleExecuteScriptParams, A as FreestyleFile, B as FreestyleGetLogsResponse, C as FreestyleJavaScriptLog, G as FreestyleLogResponseObject, I as FreestyleVerifyDomainRequest, M as HandleBackupCloudstateData, N as HandleBackupCloudstateError, S as HandleCreateDomainVerificationData, T as HandleCreateDomainVerificationError, U as HandleDeleteDomainVerificationData, V as HandleDeleteDomainVerificationError, J as HandleDeployCloudstateData, L as HandleDeployCloudstateError, K as HandleDeployCloudstateResponse, a3 as HandleDeployWebData, a5 as HandleDeployWebError, a4 as HandleDeployWebResponse, _ as HandleExecuteScriptData, a0 as HandleExecuteScriptError, $ as HandleExecuteScriptResponse, Y as HandleGetExecuteRunData, Z as HandleGetExecuteRunError, a1 as HandleGetLogsData, a2 as HandleGetLogsError, a7 as HandleGetWebDeployDetailsData, Q as HandleListDomainVerificationRequestsError, P as HandleListDomainsError, W as HandleListExecuteRunsData, X as HandleListExecuteRunsError, a6 as HandleListWebDeploysError, R as HandleVerifyDomainData, O as HandleVerifyWildcardError } from './types.gen-CnEkmbco.js';
|
|
3
3
|
|
|
4
4
|
declare class FreestyleSandboxes {
|
|
5
5
|
private client;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-
|
|
1
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-CnEkmbco.js';
|
|
2
2
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
3
3
|
|
|
4
4
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-
|
|
1
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-CnEkmbco.js';
|
|
2
2
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
3
3
|
|
|
4
4
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
package/dist/mastra/index.d.cts
CHANGED
|
@@ -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-
|
|
3
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-CnEkmbco.js';
|
|
4
4
|
|
|
5
5
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
6
6
|
apiKey: string;
|
package/dist/mastra/index.d.mts
CHANGED
|
@@ -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-
|
|
3
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-CnEkmbco.js';
|
|
4
4
|
|
|
5
5
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
6
6
|
apiKey: string;
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
type DeploymentLogEntry = {
|
|
2
|
+
deploymentId: string;
|
|
3
|
+
accountId: string;
|
|
4
|
+
provisionedAt: string;
|
|
5
|
+
timeout: string;
|
|
6
|
+
state: DeploymentState;
|
|
7
|
+
deployedAt?: (string) | null;
|
|
8
|
+
domains: Array<(string)>;
|
|
9
|
+
envVars: {
|
|
10
|
+
[key: string]: (string);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type DeploymentState = 'provisioning' | 'deployed' | 'failed';
|
|
14
|
+
type ExecuteLogEntry = {
|
|
15
|
+
deployment: string;
|
|
16
|
+
accountId: string;
|
|
17
|
+
provisionedAt: string;
|
|
18
|
+
startedAt?: (string) | null;
|
|
19
|
+
duration?: (string) | null;
|
|
20
|
+
state: ExecuteRunState;
|
|
21
|
+
envVars: {
|
|
22
|
+
[key: string]: (string);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type ExecuteRunInfo = {
|
|
26
|
+
code: string;
|
|
27
|
+
nodeModules: {
|
|
28
|
+
[key: string]: (string);
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type ExecuteRunState = 'starting' | 'running' | 'complete';
|
|
32
|
+
type FreestyleCloudstateDeployConfiguration = {
|
|
33
|
+
/**
|
|
34
|
+
* ID of the project to deploy, if not provided will create a new project
|
|
35
|
+
*/
|
|
36
|
+
domains?: Array<(string)> | null;
|
|
37
|
+
/**
|
|
38
|
+
* The environment variables that the cloudstate deploy can access
|
|
39
|
+
*/
|
|
40
|
+
envVars?: {
|
|
41
|
+
[key: string]: (string);
|
|
42
|
+
};
|
|
43
|
+
cloudstateDatabaseId?: (string) | null;
|
|
44
|
+
};
|
|
45
|
+
type FreestyleCloudstateDeployErrorResponse = {
|
|
46
|
+
message: string;
|
|
47
|
+
};
|
|
48
|
+
type FreestyleCloudstateDeployRequest = {
|
|
49
|
+
classes: string;
|
|
50
|
+
config?: FreestyleCloudstateDeployConfiguration;
|
|
51
|
+
};
|
|
52
|
+
type FreestyleCloudstateDeploySuccessResponse = {
|
|
53
|
+
deploymentId: string;
|
|
54
|
+
cloudstateDatabaseId: string;
|
|
55
|
+
};
|
|
56
|
+
type FreestyleDeleteDomainVerificationRequest = {
|
|
57
|
+
/**
|
|
58
|
+
* The domain to create a verification code for
|
|
59
|
+
*/
|
|
60
|
+
domain: string;
|
|
61
|
+
/**
|
|
62
|
+
* The verification code
|
|
63
|
+
*/
|
|
64
|
+
verificationCode: string;
|
|
65
|
+
};
|
|
66
|
+
type FreestyleDeployWebConfiguration = {
|
|
67
|
+
/**
|
|
68
|
+
* The entrypoint file for the website
|
|
69
|
+
*/
|
|
70
|
+
entrypoint?: (string) | null;
|
|
71
|
+
/**
|
|
72
|
+
* The custom domains for the website, eg. [\"subdomain.yourwebsite.com\"]. You may include a single *.style.dev domain here.
|
|
73
|
+
*/
|
|
74
|
+
domains?: Array<(string)> | null;
|
|
75
|
+
/**
|
|
76
|
+
* Project ID was our original way of tracking deployments together, it is now deprecated and will be removed in the future. Please use the domains field to specify the domains for your project.
|
|
77
|
+
* @deprecated
|
|
78
|
+
*/
|
|
79
|
+
projectId?: (string) | null;
|
|
80
|
+
/**
|
|
81
|
+
* 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.
|
|
82
|
+
*/
|
|
83
|
+
nodeModules?: {
|
|
84
|
+
[key: string]: (string);
|
|
85
|
+
} | null;
|
|
86
|
+
/**
|
|
87
|
+
* The environment variables that the website can access
|
|
88
|
+
* e.g. { \"RESEND_API_KEY\": \"re_123456789\" }
|
|
89
|
+
*/
|
|
90
|
+
envVars?: {
|
|
91
|
+
[key: string]: (string);
|
|
92
|
+
} | null;
|
|
93
|
+
serverStartCheck?: boolean;
|
|
94
|
+
};
|
|
95
|
+
type FreestyleDeployWebErrorResponse = {
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
type FreestyleDeployWebPayload = {
|
|
99
|
+
/**
|
|
100
|
+
* 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\" } }
|
|
101
|
+
*
|
|
102
|
+
* **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.
|
|
103
|
+
*/
|
|
104
|
+
files: {
|
|
105
|
+
[key: string]: FreestyleFile;
|
|
106
|
+
};
|
|
107
|
+
config?: FreestyleDeployWebConfiguration;
|
|
108
|
+
};
|
|
109
|
+
type FreestyleDeployWebSuccessResponse = {
|
|
110
|
+
deploymentId: string;
|
|
111
|
+
domains?: Array<(string)> | null;
|
|
112
|
+
/**
|
|
113
|
+
* @deprecated
|
|
114
|
+
*/
|
|
115
|
+
projectId?: (string) | null;
|
|
116
|
+
};
|
|
117
|
+
type FreestyleDomainVerificationRequest = {
|
|
118
|
+
/**
|
|
119
|
+
* The domain to create a verification code for
|
|
120
|
+
*/
|
|
121
|
+
domain: string;
|
|
122
|
+
};
|
|
123
|
+
type FreestyleExecuteScriptParams = {
|
|
124
|
+
/**
|
|
125
|
+
* The JavaScript or TypeScript script to execute
|
|
126
|
+
*/
|
|
127
|
+
script: string;
|
|
128
|
+
config?: FreestyleExecuteScriptParamsConfiguration;
|
|
129
|
+
};
|
|
130
|
+
type FreestyleExecuteScriptParamsConfiguration = {
|
|
131
|
+
/**
|
|
132
|
+
* The environment variables to set for the script
|
|
133
|
+
*/
|
|
134
|
+
envVars?: {
|
|
135
|
+
[key: string]: (string);
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* The node modules to install for the script
|
|
139
|
+
*/
|
|
140
|
+
nodeModules?: {
|
|
141
|
+
[key: string]: (string);
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Tags for you to organize your scripts, useful for tracking what you're running
|
|
145
|
+
*/
|
|
146
|
+
tags?: Array<(string)>;
|
|
147
|
+
/**
|
|
148
|
+
* The script timeout
|
|
149
|
+
*/
|
|
150
|
+
timeout?: (string) | null;
|
|
151
|
+
/**
|
|
152
|
+
* If false, we'll not resolve peer dependencies for the packages given, this can speed up execute performance, but will break packages with peers unless the peers are manually specified.
|
|
153
|
+
*/
|
|
154
|
+
peerDependencyResolution?: boolean;
|
|
155
|
+
};
|
|
156
|
+
type FreestyleExecuteScriptResultSuccess = {
|
|
157
|
+
result: unknown;
|
|
158
|
+
logs: Array<FreestyleJavaScriptLog>;
|
|
159
|
+
};
|
|
160
|
+
type FreestyleFile = {
|
|
161
|
+
/**
|
|
162
|
+
* The content of the file
|
|
163
|
+
*/
|
|
164
|
+
content: string;
|
|
165
|
+
/**
|
|
166
|
+
* The encoding of the file. Either **utf-8** or **base64**
|
|
167
|
+
*/
|
|
168
|
+
encoding?: string;
|
|
169
|
+
};
|
|
170
|
+
type FreestyleGetLogsResponse = {
|
|
171
|
+
logs: Array<FreestyleLogResponseObject>;
|
|
172
|
+
};
|
|
173
|
+
type FreestyleJavaScriptLog = {
|
|
174
|
+
/**
|
|
175
|
+
* The log message
|
|
176
|
+
*/
|
|
177
|
+
message: string;
|
|
178
|
+
/**
|
|
179
|
+
* The log level
|
|
180
|
+
*/
|
|
181
|
+
type: string;
|
|
182
|
+
};
|
|
183
|
+
type FreestyleLogResponseObject = {
|
|
184
|
+
message: string;
|
|
185
|
+
timestamp: string;
|
|
186
|
+
};
|
|
187
|
+
type FreestyleVerifyDomainRequest = {
|
|
188
|
+
domain: string;
|
|
189
|
+
};
|
|
190
|
+
type HandleDeployCloudstateData = {
|
|
191
|
+
body: FreestyleCloudstateDeployRequest;
|
|
192
|
+
};
|
|
193
|
+
type HandleDeployCloudstateResponse = (FreestyleCloudstateDeploySuccessResponse);
|
|
194
|
+
type HandleDeployCloudstateError = (FreestyleCloudstateDeployErrorResponse);
|
|
195
|
+
type HandleBackupCloudstateData = {
|
|
196
|
+
path: {
|
|
197
|
+
id: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
type HandleBackupCloudstateResponse = (Array<(number)>);
|
|
201
|
+
type HandleBackupCloudstateError = (unknown);
|
|
202
|
+
type HandleVerifyWildcardResponse = ({
|
|
203
|
+
domain: string;
|
|
204
|
+
});
|
|
205
|
+
type HandleVerifyWildcardError = ({
|
|
206
|
+
message: string;
|
|
207
|
+
});
|
|
208
|
+
type HandleListDomainsResponse = (Array<{
|
|
209
|
+
domain: string;
|
|
210
|
+
createdAt: number;
|
|
211
|
+
}>);
|
|
212
|
+
type HandleListDomainsError = ({
|
|
213
|
+
message: string;
|
|
214
|
+
});
|
|
215
|
+
type HandleListDomainVerificationRequestsResponse = (Array<{
|
|
216
|
+
verificationCode: string;
|
|
217
|
+
domain: string;
|
|
218
|
+
createdAt: number;
|
|
219
|
+
}>);
|
|
220
|
+
type HandleListDomainVerificationRequestsError = ({
|
|
221
|
+
message: string;
|
|
222
|
+
});
|
|
223
|
+
type HandleVerifyDomainData = {
|
|
224
|
+
body: FreestyleVerifyDomainRequest;
|
|
225
|
+
};
|
|
226
|
+
type HandleVerifyDomainResponse = ({
|
|
227
|
+
domain: string;
|
|
228
|
+
});
|
|
229
|
+
type HandleVerifyDomainError = ({
|
|
230
|
+
message: string;
|
|
231
|
+
});
|
|
232
|
+
type HandleCreateDomainVerificationData = {
|
|
233
|
+
body: FreestyleDomainVerificationRequest;
|
|
234
|
+
};
|
|
235
|
+
type HandleCreateDomainVerificationResponse = ({
|
|
236
|
+
verificationCode: string;
|
|
237
|
+
domain: string;
|
|
238
|
+
});
|
|
239
|
+
type HandleCreateDomainVerificationError = ({
|
|
240
|
+
message: string;
|
|
241
|
+
});
|
|
242
|
+
type HandleDeleteDomainVerificationData = {
|
|
243
|
+
body: FreestyleDeleteDomainVerificationRequest;
|
|
244
|
+
};
|
|
245
|
+
type HandleDeleteDomainVerificationResponse = ({
|
|
246
|
+
verificationCode: string;
|
|
247
|
+
domain: string;
|
|
248
|
+
});
|
|
249
|
+
type HandleDeleteDomainVerificationError = ({
|
|
250
|
+
message: string;
|
|
251
|
+
});
|
|
252
|
+
type HandleListExecuteRunsData = {
|
|
253
|
+
query?: {
|
|
254
|
+
limit?: (number) | null;
|
|
255
|
+
offset?: (number) | null;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
type HandleListExecuteRunsResponse = ({
|
|
259
|
+
entries: Array<ExecuteLogEntry>;
|
|
260
|
+
total: number;
|
|
261
|
+
offset: number;
|
|
262
|
+
});
|
|
263
|
+
type HandleListExecuteRunsError = ({
|
|
264
|
+
message: string;
|
|
265
|
+
});
|
|
266
|
+
type HandleGetExecuteRunData = {
|
|
267
|
+
path: {
|
|
268
|
+
deployment: string;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
type HandleGetExecuteRunResponse = ({
|
|
272
|
+
metadata: ExecuteLogEntry;
|
|
273
|
+
code: ExecuteRunInfo;
|
|
274
|
+
});
|
|
275
|
+
type HandleGetExecuteRunError = ({
|
|
276
|
+
message: string;
|
|
277
|
+
});
|
|
278
|
+
type HandleExecuteScriptData = {
|
|
279
|
+
body: FreestyleExecuteScriptParams;
|
|
280
|
+
};
|
|
281
|
+
type HandleExecuteScriptResponse = ({
|
|
282
|
+
result: unknown;
|
|
283
|
+
logs: Array<FreestyleJavaScriptLog>;
|
|
284
|
+
});
|
|
285
|
+
type HandleExecuteScriptError = ({
|
|
286
|
+
error: string;
|
|
287
|
+
});
|
|
288
|
+
type HandleGetLogsData = {
|
|
289
|
+
query: {
|
|
290
|
+
deploymentId: string;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
type HandleGetLogsResponse = (FreestyleGetLogsResponse);
|
|
294
|
+
type HandleGetLogsError = unknown;
|
|
295
|
+
type HandleDeployWebData = {
|
|
296
|
+
body: FreestyleDeployWebPayload;
|
|
297
|
+
};
|
|
298
|
+
type HandleDeployWebResponse = (FreestyleDeployWebSuccessResponse);
|
|
299
|
+
type HandleDeployWebError = (FreestyleDeployWebErrorResponse);
|
|
300
|
+
type HandleListWebDeploysResponse = ({
|
|
301
|
+
entries: Array<DeploymentLogEntry>;
|
|
302
|
+
total: number;
|
|
303
|
+
offset: number;
|
|
304
|
+
});
|
|
305
|
+
type HandleListWebDeploysError = ({
|
|
306
|
+
message: string;
|
|
307
|
+
});
|
|
308
|
+
type HandleGetWebDeployDetailsData = {
|
|
309
|
+
path: {
|
|
310
|
+
deployment_id: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export type { HandleExecuteScriptResponse as $, FreestyleFile as A, FreestyleGetLogsResponse as B, FreestyleJavaScriptLog as C, DeploymentLogEntry as D, ExecuteLogEntry as E, FreestyleExecuteScriptParamsConfiguration as F, FreestyleLogResponseObject as G, HandleBackupCloudstateResponse as H, FreestyleVerifyDomainRequest as I, HandleDeployCloudstateData as J, HandleDeployCloudstateResponse as K, HandleDeployCloudstateError as L, HandleBackupCloudstateData as M, HandleBackupCloudstateError as N, HandleVerifyWildcardError as O, HandleListDomainsError as P, HandleListDomainVerificationRequestsError as Q, HandleVerifyDomainData as R, HandleCreateDomainVerificationData as S, HandleCreateDomainVerificationError as T, HandleDeleteDomainVerificationData as U, HandleDeleteDomainVerificationError as V, HandleListExecuteRunsData as W, HandleListExecuteRunsError as X, HandleGetExecuteRunData as Y, HandleGetExecuteRunError as Z, HandleExecuteScriptData as _, FreestyleExecuteScriptResultSuccess as a, HandleExecuteScriptError as a0, HandleGetLogsData as a1, HandleGetLogsError as a2, HandleDeployWebData as a3, HandleDeployWebResponse as a4, HandleDeployWebError as a5, HandleListWebDeploysError as a6, HandleGetWebDeployDetailsData as a7, FreestyleDeployWebConfiguration as b, FreestyleDeployWebSuccessResponse as c, FreestyleCloudstateDeployRequest as d, FreestyleCloudstateDeploySuccessResponse as e, HandleGetLogsResponse as f, HandleCreateDomainVerificationResponse as g, HandleVerifyDomainResponse as h, HandleVerifyDomainError as i, HandleListDomainsResponse as j, HandleListDomainVerificationRequestsResponse as k, HandleDeleteDomainVerificationResponse as l, HandleListWebDeploysResponse as m, HandleListExecuteRunsResponse as n, HandleGetExecuteRunResponse as o, HandleVerifyWildcardResponse as p, DeploymentState as q, ExecuteRunInfo as r, ExecuteRunState as s, FreestyleCloudstateDeployConfiguration as t, FreestyleCloudstateDeployErrorResponse as u, FreestyleDeleteDomainVerificationRequest as v, FreestyleDeployWebErrorResponse as w, FreestyleDeployWebPayload as x, FreestyleDomainVerificationRequest as y, FreestyleExecuteScriptParams as z };
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
type DeploymentLogEntry = {
|
|
2
|
+
deploymentId: string;
|
|
3
|
+
accountId: string;
|
|
4
|
+
provisionedAt: string;
|
|
5
|
+
timeout: string;
|
|
6
|
+
state: DeploymentState;
|
|
7
|
+
deployedAt?: (string) | null;
|
|
8
|
+
domains: Array<(string)>;
|
|
9
|
+
envVars: {
|
|
10
|
+
[key: string]: (string);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type DeploymentState = 'provisioning' | 'deployed' | 'failed';
|
|
14
|
+
type ExecuteLogEntry = {
|
|
15
|
+
deployment: string;
|
|
16
|
+
accountId: string;
|
|
17
|
+
provisionedAt: string;
|
|
18
|
+
startedAt?: (string) | null;
|
|
19
|
+
duration?: (string) | null;
|
|
20
|
+
state: ExecuteRunState;
|
|
21
|
+
envVars: {
|
|
22
|
+
[key: string]: (string);
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type ExecuteRunInfo = {
|
|
26
|
+
code: string;
|
|
27
|
+
nodeModules: {
|
|
28
|
+
[key: string]: (string);
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type ExecuteRunState = 'starting' | 'running' | 'complete';
|
|
32
|
+
type FreestyleCloudstateDeployConfiguration = {
|
|
33
|
+
/**
|
|
34
|
+
* ID of the project to deploy, if not provided will create a new project
|
|
35
|
+
*/
|
|
36
|
+
domains?: Array<(string)> | null;
|
|
37
|
+
/**
|
|
38
|
+
* The environment variables that the cloudstate deploy can access
|
|
39
|
+
*/
|
|
40
|
+
envVars?: {
|
|
41
|
+
[key: string]: (string);
|
|
42
|
+
};
|
|
43
|
+
cloudstateDatabaseId?: (string) | null;
|
|
44
|
+
};
|
|
45
|
+
type FreestyleCloudstateDeployErrorResponse = {
|
|
46
|
+
message: string;
|
|
47
|
+
};
|
|
48
|
+
type FreestyleCloudstateDeployRequest = {
|
|
49
|
+
classes: string;
|
|
50
|
+
config?: FreestyleCloudstateDeployConfiguration;
|
|
51
|
+
};
|
|
52
|
+
type FreestyleCloudstateDeploySuccessResponse = {
|
|
53
|
+
deploymentId: string;
|
|
54
|
+
cloudstateDatabaseId: string;
|
|
55
|
+
};
|
|
56
|
+
type FreestyleDeleteDomainVerificationRequest = {
|
|
57
|
+
/**
|
|
58
|
+
* The domain to create a verification code for
|
|
59
|
+
*/
|
|
60
|
+
domain: string;
|
|
61
|
+
/**
|
|
62
|
+
* The verification code
|
|
63
|
+
*/
|
|
64
|
+
verificationCode: string;
|
|
65
|
+
};
|
|
66
|
+
type FreestyleDeployWebConfiguration = {
|
|
67
|
+
/**
|
|
68
|
+
* The entrypoint file for the website
|
|
69
|
+
*/
|
|
70
|
+
entrypoint?: (string) | null;
|
|
71
|
+
/**
|
|
72
|
+
* The custom domains for the website, eg. [\"subdomain.yourwebsite.com\"]. You may include a single *.style.dev domain here.
|
|
73
|
+
*/
|
|
74
|
+
domains?: Array<(string)> | null;
|
|
75
|
+
/**
|
|
76
|
+
* Project ID was our original way of tracking deployments together, it is now deprecated and will be removed in the future. Please use the domains field to specify the domains for your project.
|
|
77
|
+
* @deprecated
|
|
78
|
+
*/
|
|
79
|
+
projectId?: (string) | null;
|
|
80
|
+
/**
|
|
81
|
+
* 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.
|
|
82
|
+
*/
|
|
83
|
+
nodeModules?: {
|
|
84
|
+
[key: string]: (string);
|
|
85
|
+
} | null;
|
|
86
|
+
/**
|
|
87
|
+
* The environment variables that the website can access
|
|
88
|
+
* e.g. { \"RESEND_API_KEY\": \"re_123456789\" }
|
|
89
|
+
*/
|
|
90
|
+
envVars?: {
|
|
91
|
+
[key: string]: (string);
|
|
92
|
+
} | null;
|
|
93
|
+
serverStartCheck?: boolean;
|
|
94
|
+
};
|
|
95
|
+
type FreestyleDeployWebErrorResponse = {
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
type FreestyleDeployWebPayload = {
|
|
99
|
+
/**
|
|
100
|
+
* 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\" } }
|
|
101
|
+
*
|
|
102
|
+
* **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.
|
|
103
|
+
*/
|
|
104
|
+
files: {
|
|
105
|
+
[key: string]: FreestyleFile;
|
|
106
|
+
};
|
|
107
|
+
config?: FreestyleDeployWebConfiguration;
|
|
108
|
+
};
|
|
109
|
+
type FreestyleDeployWebSuccessResponse = {
|
|
110
|
+
deploymentId: string;
|
|
111
|
+
domains?: Array<(string)> | null;
|
|
112
|
+
/**
|
|
113
|
+
* @deprecated
|
|
114
|
+
*/
|
|
115
|
+
projectId?: (string) | null;
|
|
116
|
+
};
|
|
117
|
+
type FreestyleDomainVerificationRequest = {
|
|
118
|
+
/**
|
|
119
|
+
* The domain to create a verification code for
|
|
120
|
+
*/
|
|
121
|
+
domain: string;
|
|
122
|
+
};
|
|
123
|
+
type FreestyleExecuteScriptParams = {
|
|
124
|
+
/**
|
|
125
|
+
* The JavaScript or TypeScript script to execute
|
|
126
|
+
*/
|
|
127
|
+
script: string;
|
|
128
|
+
config?: FreestyleExecuteScriptParamsConfiguration;
|
|
129
|
+
};
|
|
130
|
+
type FreestyleExecuteScriptParamsConfiguration = {
|
|
131
|
+
/**
|
|
132
|
+
* The environment variables to set for the script
|
|
133
|
+
*/
|
|
134
|
+
envVars?: {
|
|
135
|
+
[key: string]: (string);
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* The node modules to install for the script
|
|
139
|
+
*/
|
|
140
|
+
nodeModules?: {
|
|
141
|
+
[key: string]: (string);
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Tags for you to organize your scripts, useful for tracking what you're running
|
|
145
|
+
*/
|
|
146
|
+
tags?: Array<(string)>;
|
|
147
|
+
/**
|
|
148
|
+
* The script timeout
|
|
149
|
+
*/
|
|
150
|
+
timeout?: (string) | null;
|
|
151
|
+
/**
|
|
152
|
+
* If false, we'll not resolve peer dependencies for the packages given, this can speed up execute performance, but will break packages with peers unless the peers are manually specified.
|
|
153
|
+
*/
|
|
154
|
+
peerDependencyResolution?: boolean;
|
|
155
|
+
};
|
|
156
|
+
type FreestyleExecuteScriptResultSuccess = {
|
|
157
|
+
result: unknown;
|
|
158
|
+
logs: Array<FreestyleJavaScriptLog>;
|
|
159
|
+
};
|
|
160
|
+
type FreestyleFile = {
|
|
161
|
+
/**
|
|
162
|
+
* The content of the file
|
|
163
|
+
*/
|
|
164
|
+
content: string;
|
|
165
|
+
/**
|
|
166
|
+
* The encoding of the file. Either **utf-8** or **base64**
|
|
167
|
+
*/
|
|
168
|
+
encoding?: string;
|
|
169
|
+
};
|
|
170
|
+
type FreestyleJavaScriptLog = {
|
|
171
|
+
/**
|
|
172
|
+
* The log message
|
|
173
|
+
*/
|
|
174
|
+
message: string;
|
|
175
|
+
/**
|
|
176
|
+
* The log level
|
|
177
|
+
*/
|
|
178
|
+
type: string;
|
|
179
|
+
};
|
|
180
|
+
type FreestyleLogResponseObject = {
|
|
181
|
+
message: string;
|
|
182
|
+
timestamp: string;
|
|
183
|
+
};
|
|
184
|
+
type FreestyleVerifyDomainRequest = {
|
|
185
|
+
domain: string;
|
|
186
|
+
};
|
|
187
|
+
type HandleDeployCloudstateData = {
|
|
188
|
+
body: FreestyleCloudstateDeployRequest;
|
|
189
|
+
};
|
|
190
|
+
type HandleDeployCloudstateResponse = (FreestyleCloudstateDeploySuccessResponse);
|
|
191
|
+
type HandleDeployCloudstateError = (FreestyleCloudstateDeployErrorResponse);
|
|
192
|
+
type HandleBackupCloudstateData = {
|
|
193
|
+
path: {
|
|
194
|
+
id: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
type HandleBackupCloudstateResponse = (Array<(number)>);
|
|
198
|
+
type HandleBackupCloudstateError = (unknown);
|
|
199
|
+
type HandleVerifyWildcardResponse = ({
|
|
200
|
+
domain: string;
|
|
201
|
+
});
|
|
202
|
+
type HandleVerifyWildcardError = ({
|
|
203
|
+
message: string;
|
|
204
|
+
});
|
|
205
|
+
type HandleListDomainsResponse = (Array<{
|
|
206
|
+
domain: string;
|
|
207
|
+
createdAt: number;
|
|
208
|
+
}>);
|
|
209
|
+
type HandleListDomainsError = ({
|
|
210
|
+
message: string;
|
|
211
|
+
});
|
|
212
|
+
type HandleListDomainVerificationRequestsResponse = (Array<{
|
|
213
|
+
verificationCode: string;
|
|
214
|
+
domain: string;
|
|
215
|
+
createdAt: number;
|
|
216
|
+
}>);
|
|
217
|
+
type HandleListDomainVerificationRequestsError = ({
|
|
218
|
+
message: string;
|
|
219
|
+
});
|
|
220
|
+
type HandleVerifyDomainData = {
|
|
221
|
+
body: FreestyleVerifyDomainRequest;
|
|
222
|
+
};
|
|
223
|
+
type HandleVerifyDomainResponse = ({
|
|
224
|
+
domain: string;
|
|
225
|
+
});
|
|
226
|
+
type HandleVerifyDomainError = ({
|
|
227
|
+
message: string;
|
|
228
|
+
});
|
|
229
|
+
type HandleCreateDomainVerificationData = {
|
|
230
|
+
body: FreestyleDomainVerificationRequest;
|
|
231
|
+
};
|
|
232
|
+
type HandleCreateDomainVerificationResponse = ({
|
|
233
|
+
verificationCode: string;
|
|
234
|
+
domain: string;
|
|
235
|
+
});
|
|
236
|
+
type HandleCreateDomainVerificationError = ({
|
|
237
|
+
message: string;
|
|
238
|
+
});
|
|
239
|
+
type HandleDeleteDomainVerificationData = {
|
|
240
|
+
body: FreestyleDeleteDomainVerificationRequest;
|
|
241
|
+
};
|
|
242
|
+
type HandleDeleteDomainVerificationResponse = ({
|
|
243
|
+
verificationCode: string;
|
|
244
|
+
domain: string;
|
|
245
|
+
});
|
|
246
|
+
type HandleDeleteDomainVerificationError = ({
|
|
247
|
+
message: string;
|
|
248
|
+
});
|
|
249
|
+
type HandleListExecuteRunsData = {
|
|
250
|
+
query?: {
|
|
251
|
+
limit?: (number) | null;
|
|
252
|
+
offset?: (number) | null;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
type HandleListExecuteRunsResponse = ({
|
|
256
|
+
entries: Array<ExecuteLogEntry>;
|
|
257
|
+
total: number;
|
|
258
|
+
offset: number;
|
|
259
|
+
});
|
|
260
|
+
type HandleListExecuteRunsError = ({
|
|
261
|
+
message: string;
|
|
262
|
+
});
|
|
263
|
+
type HandleGetExecuteRunData = {
|
|
264
|
+
path: {
|
|
265
|
+
deployment: string;
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
type HandleGetExecuteRunResponse = ({
|
|
269
|
+
metadata: ExecuteLogEntry;
|
|
270
|
+
code: ExecuteRunInfo;
|
|
271
|
+
});
|
|
272
|
+
type HandleGetExecuteRunError = ({
|
|
273
|
+
message: string;
|
|
274
|
+
});
|
|
275
|
+
type HandleExecuteScriptData = {
|
|
276
|
+
body: FreestyleExecuteScriptParams;
|
|
277
|
+
};
|
|
278
|
+
type HandleExecuteScriptResponse = ({
|
|
279
|
+
result: unknown;
|
|
280
|
+
logs: Array<FreestyleJavaScriptLog>;
|
|
281
|
+
});
|
|
282
|
+
type HandleExecuteScriptError = ({
|
|
283
|
+
error: string;
|
|
284
|
+
});
|
|
285
|
+
type HandleGetLogsData = {
|
|
286
|
+
query: {
|
|
287
|
+
deploymentId: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
type HandleGetLogsResponse = (Array<FreestyleLogResponseObject>);
|
|
291
|
+
type HandleGetLogsError = unknown;
|
|
292
|
+
type HandleDeployWebData = {
|
|
293
|
+
body: FreestyleDeployWebPayload;
|
|
294
|
+
};
|
|
295
|
+
type HandleDeployWebResponse = (FreestyleDeployWebSuccessResponse);
|
|
296
|
+
type HandleDeployWebError = (FreestyleDeployWebErrorResponse);
|
|
297
|
+
type HandleListWebDeploysResponse = ({
|
|
298
|
+
entries: Array<DeploymentLogEntry>;
|
|
299
|
+
total: number;
|
|
300
|
+
offset: number;
|
|
301
|
+
});
|
|
302
|
+
type HandleListWebDeploysError = ({
|
|
303
|
+
message: string;
|
|
304
|
+
});
|
|
305
|
+
type HandleGetWebDeployDetailsData = {
|
|
306
|
+
path: {
|
|
307
|
+
deployment_id: string;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export type { HandleExecuteScriptError as $, FreestyleFile as A, FreestyleJavaScriptLog as B, FreestyleLogResponseObject as C, DeploymentLogEntry as D, ExecuteLogEntry as E, FreestyleExecuteScriptParamsConfiguration as F, FreestyleVerifyDomainRequest as G, HandleBackupCloudstateResponse as H, HandleDeployCloudstateData as I, HandleDeployCloudstateResponse as J, HandleDeployCloudstateError as K, HandleBackupCloudstateData as L, HandleBackupCloudstateError as M, HandleVerifyWildcardError as N, HandleListDomainsError as O, HandleListDomainVerificationRequestsError as P, HandleVerifyDomainData as Q, HandleCreateDomainVerificationData as R, HandleCreateDomainVerificationError as S, HandleDeleteDomainVerificationData as T, HandleDeleteDomainVerificationError as U, HandleListExecuteRunsData as V, HandleListExecuteRunsError as W, HandleGetExecuteRunData as X, HandleGetExecuteRunError as Y, HandleExecuteScriptData as Z, HandleExecuteScriptResponse as _, FreestyleExecuteScriptResultSuccess as a, HandleGetLogsData as a0, HandleGetLogsError as a1, HandleDeployWebData as a2, HandleDeployWebResponse as a3, HandleDeployWebError as a4, HandleListWebDeploysError as a5, HandleGetWebDeployDetailsData as a6, FreestyleDeployWebConfiguration as b, FreestyleDeployWebSuccessResponse as c, FreestyleCloudstateDeployRequest as d, FreestyleCloudstateDeploySuccessResponse as e, HandleGetLogsResponse as f, HandleCreateDomainVerificationResponse as g, HandleVerifyDomainResponse as h, HandleVerifyDomainError as i, HandleListDomainsResponse as j, HandleListDomainVerificationRequestsResponse as k, HandleDeleteDomainVerificationResponse as l, HandleListWebDeploysResponse as m, HandleListExecuteRunsResponse as n, HandleGetExecuteRunResponse as o, HandleVerifyWildcardResponse as p, DeploymentState as q, ExecuteRunInfo as r, ExecuteRunState as s, FreestyleCloudstateDeployConfiguration as t, FreestyleCloudstateDeployErrorResponse as u, FreestyleDeleteDomainVerificationRequest as v, FreestyleDeployWebErrorResponse as w, FreestyleDeployWebPayload as x, FreestyleDomainVerificationRequest as y, FreestyleExecuteScriptParams as z };
|
package/openapi/sdk.gen.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
3
|
import { createClient, createConfig, type OptionsLegacyParser } from '@hey-api/client-fetch';
|
|
4
|
-
import type { HandleDeployCloudstateData, HandleDeployCloudstateError, HandleDeployCloudstateResponse, HandleBackupCloudstateData, HandleBackupCloudstateError, HandleBackupCloudstateResponse, HandleVerifyWildcardError, HandleVerifyWildcardResponse, HandleListDomainsError, HandleListDomainsResponse, HandleListDomainVerificationRequestsError, HandleListDomainVerificationRequestsResponse, HandleVerifyDomainData, HandleVerifyDomainError, HandleVerifyDomainResponse, HandleCreateDomainVerificationData, HandleCreateDomainVerificationError, HandleCreateDomainVerificationResponse, HandleDeleteDomainVerificationData, HandleDeleteDomainVerificationError, HandleDeleteDomainVerificationResponse, HandleListExecuteRunsData, HandleListExecuteRunsError, HandleListExecuteRunsResponse, HandleGetExecuteRunData, HandleGetExecuteRunError, HandleGetExecuteRunResponse, HandleExecuteScriptData, HandleExecuteScriptError, HandleExecuteScriptResponse, HandleGetLogsData, HandleGetLogsError, HandleGetLogsResponse, HandleDeployWebData, HandleDeployWebError, HandleDeployWebResponse, HandleListWebDeploysError, HandleListWebDeploysResponse } from './types.gen';
|
|
4
|
+
import type { HandleDeployCloudstateData, HandleDeployCloudstateError, HandleDeployCloudstateResponse, HandleBackupCloudstateData, HandleBackupCloudstateError, HandleBackupCloudstateResponse, HandleVerifyWildcardError, HandleVerifyWildcardResponse, HandleListDomainsError, HandleListDomainsResponse, HandleListDomainVerificationRequestsError, HandleListDomainVerificationRequestsResponse, HandleVerifyDomainData, HandleVerifyDomainError, HandleVerifyDomainResponse, HandleCreateDomainVerificationData, HandleCreateDomainVerificationError, HandleCreateDomainVerificationResponse, HandleDeleteDomainVerificationData, HandleDeleteDomainVerificationError, HandleDeleteDomainVerificationResponse, HandleListExecuteRunsData, HandleListExecuteRunsError, HandleListExecuteRunsResponse, HandleGetExecuteRunData, HandleGetExecuteRunError, HandleGetExecuteRunResponse, HandleExecuteScriptData, HandleExecuteScriptError, HandleExecuteScriptResponse, HandleGetLogsData, HandleGetLogsError, HandleGetLogsResponse, HandleDeployWebData, HandleDeployWebError, HandleDeployWebResponse, HandleListWebDeploysError, HandleListWebDeploysResponse, HandleGetWebDeployDetailsData } from './types.gen';
|
|
5
5
|
|
|
6
6
|
export const client = createClient(createConfig());
|
|
7
7
|
|
|
@@ -163,4 +163,15 @@ export const handleListWebDeploys = <ThrowOnError extends boolean = false>(optio
|
|
|
163
163
|
...options,
|
|
164
164
|
url: '/web/v1/deployments'
|
|
165
165
|
});
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Get information on web deploy
|
|
170
|
+
* Get information about a web deploy by its ID.
|
|
171
|
+
*/
|
|
172
|
+
export const handleGetWebDeployDetails = <ThrowOnError extends boolean = false>(options: OptionsLegacyParser<HandleGetWebDeployDetailsData, ThrowOnError>) => {
|
|
173
|
+
return (options?.client ?? client).get<void, unknown, ThrowOnError>({
|
|
174
|
+
...options,
|
|
175
|
+
url: '/web/v1/deployments/deployment/{deployment_id}'
|
|
176
|
+
});
|
|
166
177
|
};
|
package/openapi/types.gen.ts
CHANGED
|
@@ -17,12 +17,19 @@ export type DeploymentState = 'provisioning' | 'deployed' | 'failed';
|
|
|
17
17
|
|
|
18
18
|
export type ExecuteLogEntry = {
|
|
19
19
|
deployment: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
accountId: string;
|
|
21
|
+
provisionedAt: string;
|
|
22
|
+
startedAt?: (string) | null;
|
|
23
23
|
duration?: (string) | null;
|
|
24
24
|
state: ExecuteRunState;
|
|
25
|
-
|
|
25
|
+
envVars: {
|
|
26
|
+
[key: string]: (string);
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ExecuteRunInfo = {
|
|
31
|
+
code: string;
|
|
32
|
+
nodeModules: {
|
|
26
33
|
[key: string]: (string);
|
|
27
34
|
};
|
|
28
35
|
};
|
|
@@ -181,6 +188,10 @@ export type FreestyleFile = {
|
|
|
181
188
|
encoding?: string;
|
|
182
189
|
};
|
|
183
190
|
|
|
191
|
+
export type FreestyleGetLogsResponse = {
|
|
192
|
+
logs: Array<FreestyleLogResponseObject>;
|
|
193
|
+
};
|
|
194
|
+
|
|
184
195
|
export type FreestyleJavaScriptLog = {
|
|
185
196
|
/**
|
|
186
197
|
* The log message
|
|
@@ -307,7 +318,10 @@ export type HandleGetExecuteRunData = {
|
|
|
307
318
|
};
|
|
308
319
|
};
|
|
309
320
|
|
|
310
|
-
export type HandleGetExecuteRunResponse = (
|
|
321
|
+
export type HandleGetExecuteRunResponse = ({
|
|
322
|
+
metadata: ExecuteLogEntry;
|
|
323
|
+
code: ExecuteRunInfo;
|
|
324
|
+
});
|
|
311
325
|
|
|
312
326
|
export type HandleGetExecuteRunError = ({
|
|
313
327
|
message: string;
|
|
@@ -332,7 +346,7 @@ export type HandleGetLogsData = {
|
|
|
332
346
|
};
|
|
333
347
|
};
|
|
334
348
|
|
|
335
|
-
export type HandleGetLogsResponse = (
|
|
349
|
+
export type HandleGetLogsResponse = (FreestyleGetLogsResponse);
|
|
336
350
|
|
|
337
351
|
export type HandleGetLogsError = unknown;
|
|
338
352
|
|
|
@@ -352,4 +366,10 @@ export type HandleListWebDeploysResponse = ({
|
|
|
352
366
|
|
|
353
367
|
export type HandleListWebDeploysError = ({
|
|
354
368
|
message: string;
|
|
355
|
-
});
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
export type HandleGetWebDeployDetailsData = {
|
|
372
|
+
path: {
|
|
373
|
+
deployment_id: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
package/openapi.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openapi":"3.1.0","info":{"title":"Freestyle Sandboxes","description":"\nFreestyle Sandboxes lets you deploy your users or AIs code. **Get your API Key at [admin.freestyle.sh](https://admin.freestyle.sh)**\n\nThey are broken up into 4 categories: [Web](#tag/web), [Execute](#tag/execute), [Cloudstate](#tag/cloudstate), and [Domains](#tag/domains).\n\n[Web](#tag/web): Send us the code for the website, we'll provision the certificates and get it hosted\n\n[Execute](#tag/execute): Send us a function, we'll run it and send you the output\n\n[Cloudstate](#tag/cloudstate): Our Opensource JavaScript Runtime used for cloud functions with persistent state\n\n[Domains](#tag/domains): Manage your domains, including verification and listing\n","contact":{"name":"Ben","email":"ben@freestyle.sh"},"license":{"name":""},"version":"0.1.0"},"servers":[{"url":"https://api.freestyle.sh","description":"Production"}],"paths":{"/cloudstate/v1/deploy":{"post":{"tags":["Cloudstate"],"summary":"Deploy Cloudstate Project","description":"Deploy a cloudstate project","operationId":"handle_deploy_cloudstate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeployRequest"}}},"required":true},"responses":{"200":{"description":"successfully deployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeploySuccessResponse"}}}},"500":{"description":"failed to deploy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeployErrorResponse"}}}}}}},"/cloudstate/v1/projects/{id}/backup":{"get":{"tags":["Cloudstate"],"summary":"Get Backup of Cloudstate Project","description":"Get a backup of a cloudstate project","operationId":"handle_backup_cloudstate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successfully backed up","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}},"500":{"description":"failed to backup"}}}},"/domains/v1/certs/{domain}/wildcard":{"post":{"tags":["Certs","Domains"],"summary":"Provision a wildcard certificate","description":"Provisions a wildcard certificate for a verified domain\n\n\nThis speeds up deploys on all subdomains of the domain. In order to use it, you must add the following record to your DNS config:\n\n`_acme-challenge.yourdomain.com` NS `dns.freestyle.sh`\n","operationId":"handle_verify_wildcard","responses":{"200":{"description":"Domain verified","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to preverify domain","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/domains/v1/domains":{"get":{"tags":["Domains"],"summary":"List domains for an account","description":"This lists the domains that an account has verified ownership of. This includes the *.style.dev domains the account has claimed.","operationId":"handle_list_domains","responses":{"200":{"description":"List of domains","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["domain","createdAt"],"properties":{"domain":{"type":"string","example":"example.yourdomain.com"},"createdAt":{"type":"integer","format":"int64"}}}}}}},"400":{"description":"Failed to get domains","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listDomains().then((response) => {\n console.log(response);\n});"}]}},"/domains/v1/verifications":{"get":{"tags":["Domains"],"summary":"List domain verification requests for an account","description":"Lists domain verification requests for the current account.","operationId":"handle_list_domain_verification_requests","responses":{"200":{"description":"List of verification codes","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["verificationCode","domain","createdAt"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string"},"createdAt":{"type":"integer","format":"int64"}}}}}}},"400":{"description":"Failed to get verification codes","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}},"put":{"tags":["Domains"],"summary":"Verify a domain","description":"This checks a pre-existing verification request for a domain. To create a verification request, call the [create domain verification](/#tag/domains/POST/domains/v1/verifications) endpoint. This endpoint will check if the domain has a TXT record with the verification code. If it does, the domain will be verified.","operationId":"handle_verify_domain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleVerifyDomainRequest"}}},"required":true},"responses":{"200":{"description":"Domain verified","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to verify domain","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi\n .verifyDomain('example.com')\n .then((result) => {\n console.log('Successfully Verified Domain!');\n })\n .catch((error) => {\n console.error('Failed to verify domain: ', error);\n });"}]},"post":{"tags":["Domains"],"summary":"Create a domain verification request","description":"This creates a Freestyle Domain Verification Request. It returns a `verificationCode` for your domain. You need to place this code in a TXT record at `_freestyle_custom_hostname.thedomain.com`, then call the [verify domain](/#tag/domains/PUT/domains/v1/verifications) endpoint with the domain to verify it.","operationId":"handle_create_domain_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDomainVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Verification code created","content":{"application/json":{"schema":{"type":"object","required":["verificationCode","domain"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to create verification code","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi.createDomainVerificationRequest('example.com').then((result) => {\n const verificationCode = result.verificationCode;\n // put this at a TXT record at _freestyle_custom_hostname.example.com\n});"}]},"delete":{"tags":["Domains"],"summary":"Delete a domain verification request","description":"This deletes a Freestyle Domain Verification Request. This does not remove the domain from the account if it has already been verified, however the verification code will no longer be valid.","operationId":"handle_delete_domain_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeleteDomainVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Verification code created","content":{"application/json":{"schema":{"type":"object","required":["verificationCode","domain"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to create verification code","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/execute/v1/deployments":{"get":{"tags":["Execute"],"summary":"List execute runs","description":"List execute runs.","operationId":"handle_list_execute_runs","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":0}},{"name":"offset","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":0}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["entries","total","offset"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/ExecuteLogEntry"}},"total":{"type":"integer","format":"int64","minimum":0},"offset":{"type":"integer","format":"int64","minimum":0}}}}}},"500":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/execute/v1/deployments/{deployment}":{"get":{"tags":["Execute"],"summary":"Get information on execute run","description":"Get information on execute run","operationId":"handle_get_execute_run","parameters":[{"name":"deployment","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteLogEntry"}}}},"401":{"description":"Unauthorized access","content":{"application/json":{"schema":{"type":"object","description":"Unauthorized access","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","description":"Not found","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/execute/v1/script":{"post":{"tags":["Execute"],"summary":"Execute Code","description":"Send a TypeScript or JavaScript module, get the result","operationId":"handle_execute_script","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleExecuteScriptParams"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["result","logs"],"properties":{"result":{},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.executeScript(\n `export default () => {\n let set1 = [1, 2, 3, 4, 5];\n let set2 = [4, 5, 6, 7, 8];\n\n // find the sum of every value of each set multiplied by every value of the other set\n\n let sum = 0;\n for (let i = 0; i < set1.length; i++) {\n for (let j = 0; j < set2.length; j++) {\n sum += set1[i] * set2[j];\n }\n }\n\n return sum;\n};`\n);"},{"label":"Vercel AI SDK","lang":"JavaScript","source":"import { executeTool } from 'freestyle-sandboxes/ai';\nimport { generateText } from 'ai';\n\nconst codeExecutor = executeTool({\n apiKey: 'your-api-key',\n});\n\nconst { text, steps } = await generateText({\n model: yourModel,\n tools: {\n codeExecutor,\n },\n maxSteps: 2,\n prompt:\n 'What is the sum of every number between 1 and 12 multiplied by itself?',\n});"},{"label":"Mastra AI SDK","lang":"JavaScript","source":"import { executeTool } from 'freestyle-sandboxes/mastra';\n\nconst mastra = new Mastra();\n\nconst modelConfig: ModelConfig = {\n provider: 'OPEN_AI',\n name: 'gpt-4',\n};\n\nconst llm = mastra.LLM(modelConfig);\n\nconst response = await llm.generate(\n 'Calculate the sum of every number between 13 and 19 divided by the sum of every number between 8 and 13',\n {\n tools: {\n executor: executeTool({\n apiKey: process.env.FREESTYLE_API_KEY!,\n }),\n },\n }\n);\n\nconsole.log('Response Steps:', response.steps);\nconsole.log('Response:', response.text);"}]}},"/observability/v1/logs":{"get":{"tags":["Observability"],"summary":"Deployment Logs","description":"Get the logs for a deployment","operationId":"handle_get_logs","parameters":[{"name":"deploymentId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleLogResponseObject"}}}}}}}},"/web/v1/deploy":{"post":{"tags":["Web"],"summary":"Deploy a Website","description":"Deploy a website. Files is a map of file paths to file contents. Configuration is optional and contains additional information about the deployment.","operationId":"handle_deploy_web","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebPayload"}}},"required":true},"responses":{"200":{"description":"successfully deployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebSuccessResponse"}}}},"400":{"description":"failed to deploy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebErrorResponse"}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\nimport 'dotenv/config';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi\n .deployWeb({\n 'index.js': {\n content:`\n import http from 'node:http';\n console.log('starting server');\n\n const server = http.createServer(async(req, res) => {\n // wait 5 seconds before responding\n // await new Promise((resolve) => setTimeout(resolve, 5000));\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end('Welcome to New York its been waiting for you');\n });\n\n server.listen(3000, () => {\n console.log('Server is running at http://localhost:3000');\n });`,\n })\n .then((result) => {\n console.log('Deployed website @ ', result.deploymentId);\n });\n"},{"label":"Vercel AI SDK","lang":"JavaScript","source":"import { deployWebTool } from 'freestyle-sandboxes/ai';\nimport { generateText } from 'ai';\n\nconst deployer = deployWebTool({\n apiKey: 'your-api-key',\n});\n\nconst { text, steps } = await generateText({\n model: yourModel,\n tools: {\n deployer,\n },\n maxSteps: 2,\n prompt:\n 'Deploy a website to subdomain.yourdomain.com that has all the lyrics to Sandstorm by Darude on the homepage',\n});"}]}},"/web/v1/deployments":{"get":{"tags":["Web"],"summary":"List web deploys","description":"List web deploys.","operationId":"handle_list_web_deploys","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["entries","total","offset"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentLogEntry"}},"total":{"type":"integer","format":"int64","minimum":0},"offset":{"type":"integer","format":"int64","minimum":0}}}}}},"500":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}}},"components":{"schemas":{"DeploymentLogEntry":{"type":"object","required":["deploymentId","accountId","provisionedAt","timeout","state","domains","envVars"],"properties":{"deploymentId":{"type":"string","format":"uuid"},"accountId":{"type":"string"},"provisionedAt":{"type":"string","format":"date-time"},"timeout":{"type":"string"},"state":{"$ref":"#/components/schemas/DeploymentState"},"deployedAt":{"type":["string","null"],"format":"date-time"},"domains":{"type":"array","items":{"type":"string"}},"envVars":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"DeploymentState":{"type":"string","enum":["provisioning","deployed","failed"]},"ExecuteLogEntry":{"type":"object","required":["deployment","account_id","provisioned_at","state","env_vars"],"properties":{"deployment":{"type":"string","format":"uuid"},"account_id":{"type":"string"},"provisioned_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"duration":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/ExecuteRunState"},"env_vars":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"ExecuteRunState":{"type":"string","enum":["starting","running","complete"]},"FreestyleCloudstateDeployConfiguration":{"type":"object","properties":{"domains":{"type":["array","null"],"items":{"type":"string"},"description":"ID of the project to deploy, if not provided will create a new project","default":null},"envVars":{"type":"object","description":"The environment variables that the cloudstate deploy can access","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"cloudstateDatabaseId":{"type":["string","null"],"default":null}}},"FreestyleCloudstateDeployErrorResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"FreestyleCloudstateDeployRequest":{"type":"object","required":["classes"],"properties":{"classes":{"type":"string"},"config":{"$ref":"#/components/schemas/FreestyleCloudstateDeployConfiguration"}}},"FreestyleCloudstateDeploySuccessResponse":{"type":"object","required":["deploymentId","cloudstateDatabaseId"],"properties":{"deploymentId":{"type":"string"},"cloudstateDatabaseId":{"type":"string"}}},"FreestyleDeleteDomainVerificationRequest":{"type":"object","required":["domain","verificationCode"],"properties":{"domain":{"type":"string","description":"The domain to create a verification code for","example":"example.com"},"verificationCode":{"type":"string","description":"The verification code"}}},"FreestyleDeployWebConfiguration":{"type":"object","properties":{"entrypoint":{"type":["string","null"],"description":"The entrypoint file for the website","default":"index.js"},"domains":{"type":["array","null"],"items":{"type":"string"},"description":"The custom domains for the website, eg. [\\\"subdomain.yourwebsite.com\\\"]. You may include a single *.style.dev domain here.","example":["subdomain.yourdomain.com"],"default":null},"projectId":{"type":["string","null"],"description":"Project ID was our original way of tracking deployments together, it is now deprecated and will be removed in the future. Please use the domains field to specify the domains for your project.","default":null,"deprecated":true},"nodeModules":{"type":["object","null"],"description":"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.","default":null,"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"resend":"4.0.1"}},"envVars":{"type":["object","null"],"description":"The environment variables that the website can access\ne.g. { \\\"RESEND_API_KEY\\\": \\\"re_123456789\\\" }","default":null,"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"RESEND_API_KEY":"re_123456789"}},"serverStartCheck":{"type":"boolean","default":false}}},"FreestyleDeployWebErrorResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"FreestyleDeployWebPayload":{"type":"object","required":["files"],"properties":{"files":{"type":"object","description":"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\\\" } }\n\n**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.","additionalProperties":{"$ref":"#/components/schemas/FreestyleFile"},"propertyNames":{"type":"string"},"example":{"index.js":{"content":"import http from 'node:http';\\n// import { resolver } from './file2.js';\\n\\nconsole.log('starting server');\\n\\nconst server = http.createServer(async(req, res) => {\\n // wait 5 seconds before responding\\n // await new Promise((resolve) => setTimeout(resolve, 5000));\\n res.writeHead(200, { 'Content-Type': 'text/plain' });\\n res.end('Welcome to New York its been waiting for you');\\n});\\n\\nserver.listen(3000, () => {\\n console.log('Server is running at http://localhost:3000');\\n});"}}},"config":{"$ref":"#/components/schemas/FreestyleDeployWebConfiguration"}}},"FreestyleDeployWebSuccessResponse":{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"type":"string"},"domains":{"type":["array","null"],"items":{"type":"string"}},"projectId":{"type":["string","null"],"deprecated":true}}},"FreestyleDomainVerificationRequest":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","description":"The domain to create a verification code for","example":"example.com"}}},"FreestyleExecuteScriptParams":{"type":"object","required":["script"],"properties":{"script":{"type":"string","description":"The JavaScript or TypeScript script to execute","example":"export default () => {\n // get the value of the factorials of the numbers from 1 to 10 combined\n const a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\n function factorial(n) {\n if (n === 0) {\n return 1;\n }\n return n * factorial(n - 1);\n }\n\n const b = a.map(factorial);\n\n return b.reduce((a, b) => a + b);\n};\n"},"config":{"$ref":"#/components/schemas/FreestyleExecuteScriptParamsConfiguration"}}},"FreestyleExecuteScriptParamsConfiguration":{"type":"object","properties":{"envVars":{"type":"object","description":"The environment variables to set for the script","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"RESEND_API_KEY":"re_123456789"}},"nodeModules":{"type":"object","description":"The node modules to install for the script","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"resend":"4.0.1"}},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for you to organize your scripts, useful for tracking what you're running","example":["email"],"default":[]},"timeout":{"type":["string","null"],"description":"The script timeout","default":null},"peerDependencyResolution":{"type":"boolean","description":"If false, we'll not resolve peer dependencies for the packages given, this can speed up execute performance, but will break packages with peers unless the peers are manually specified.","default":true}}},"FreestyleExecuteScriptResultSuccess":{"type":"object","required":["result","logs"],"properties":{"result":{},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}},"FreestyleFile":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"The content of the file"},"encoding":{"type":"string","description":"The encoding of the file. Either **utf-8** or **base64**"}}},"FreestyleJavaScriptLog":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","description":"The log message"},"type":{"type":"string","description":"The log level"}}},"FreestyleLogResponseObject":{"type":"object","required":["message","timestamp"],"properties":{"message":{"type":"string"},"timestamp":{"type":"string"}}},"FreestyleVerifyDomainRequest":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Web","description":"APIs for deploying websites. We handle node modules caching, scaling, certificates and the whole end to end process. Send the code using the [deploy](#tag/web/POST/web/v1/deploy) endpoint, and you'll get a full hosted website back. Works with any TypeScript or JavaScript codebase."},{"name":"Execute","description":"APIs for running code. Send the code using the [execute](#tag/execute/POST/execute/v1/execute) endpoint, and you'll get the output back. Works with any TypeScript or JavaScript code + handles any node modules and environment variables you want."},{"name":"Cloudstate","description":"APIs for running cloud functions with persistent state. [Cloudstate](https://github.com/freestyle-sh/cloudstate/) is an opensource, durable JavaScript runtime maintained by the Freestyle Team."},{"name":"Domains","description":"APIs for managing domains. This is only relevant when you want to start to deploy to custom domains."}]}
|
|
1
|
+
{"openapi":"3.1.0","info":{"title":"Freestyle Sandboxes","description":"\nFreestyle Sandboxes lets you deploy your users or AIs code. **Get your API Key at [admin.freestyle.sh](https://admin.freestyle.sh)**\n\nThey are broken up into 4 categories: [Web](#tag/web), [Execute](#tag/execute), [Cloudstate](#tag/cloudstate), and [Domains](#tag/domains).\n\n[Web](#tag/web): Send us the code for the website, we'll provision the certificates and get it hosted\n\n[Execute](#tag/execute): Send us a function, we'll run it and send you the output\n\n[Cloudstate](#tag/cloudstate): Our Opensource JavaScript Runtime used for cloud functions with persistent state\n\n[Domains](#tag/domains): Manage your domains, including verification and listing\n","contact":{"name":"Ben","email":"ben@freestyle.sh"},"license":{"name":""},"version":"0.1.0"},"servers":[{"url":"https://api.freestyle.sh","description":"Production"}],"paths":{"/cloudstate/v1/deploy":{"post":{"tags":["Cloudstate"],"summary":"Deploy Cloudstate Project","description":"Deploy a cloudstate project","operationId":"handle_deploy_cloudstate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeployRequest"}}},"required":true},"responses":{"200":{"description":"successfully deployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeploySuccessResponse"}}}},"500":{"description":"failed to deploy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleCloudstateDeployErrorResponse"}}}}}}},"/cloudstate/v1/projects/{id}/backup":{"get":{"tags":["Cloudstate"],"summary":"Get Backup of Cloudstate Project","description":"Get a backup of a cloudstate project","operationId":"handle_backup_cloudstate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"successfully backed up","content":{"application/octet-stream":{"schema":{"type":"array","items":{"type":"integer","format":"int32","minimum":0}}}}},"500":{"description":"failed to backup"}}}},"/domains/v1/certs/{domain}/wildcard":{"post":{"tags":["Certs","Domains"],"summary":"Provision a wildcard certificate","description":"Provisions a wildcard certificate for a verified domain\n\n\nThis speeds up deploys on all subdomains of the domain. In order to use it, you must add the following record to your DNS config:\n\n`_acme-challenge.yourdomain.com` NS `dns.freestyle.sh`\n","operationId":"handle_verify_wildcard","responses":{"200":{"description":"Domain verified","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to preverify domain","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.provisionWildcard('example.com').then((cert) => {\n console.log(cert);\n});"}]}},"/domains/v1/domains":{"get":{"tags":["Domains"],"summary":"List domains for an account","description":"This lists the domains that an account has verified ownership of. This includes the *.style.dev domains the account has claimed.","operationId":"handle_list_domains","responses":{"200":{"description":"List of domains","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["domain","createdAt"],"properties":{"domain":{"type":"string","example":"example.yourdomain.com"},"createdAt":{"type":"integer","format":"int64"}}}}}}},"400":{"description":"Failed to get domains","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listDomains().then((response) => {\n console.log(response);\n});"}]}},"/domains/v1/verifications":{"get":{"tags":["Domains"],"summary":"List domain verification requests for an account","description":"Lists domain verification requests for the current account.","operationId":"handle_list_domain_verification_requests","responses":{"200":{"description":"List of verification codes","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["verificationCode","domain","createdAt"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string"},"createdAt":{"type":"integer","format":"int64"}}}}}}},"400":{"description":"Failed to get verification codes","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listDomainVerificationRequests().then((response) => {\n console.log(response);\n});"}]},"put":{"tags":["Domains"],"summary":"Verify a domain","description":"This checks a pre-existing verification request for a domain. To create a verification request, call the [create domain verification](/#tag/domains/POST/domains/v1/verifications) endpoint. This endpoint will check if the domain has a TXT record with the verification code. If it does, the domain will be verified.","operationId":"handle_verify_domain","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleVerifyDomainRequest"}}},"required":true},"responses":{"200":{"description":"Domain verified","content":{"application/json":{"schema":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to verify domain","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi\n .verifyDomain('example.com')\n .then((result) => {\n console.log('Successfully Verified Domain!');\n })\n .catch((error) => {\n console.error('Failed to verify domain: ', error);\n });"}]},"post":{"tags":["Domains"],"summary":"Create a domain verification request","description":"This creates a Freestyle Domain Verification Request. It returns a `verificationCode` for your domain. You need to place this code in a TXT record at `_freestyle_custom_hostname.thedomain.com`, then call the [verify domain](/#tag/domains/PUT/domains/v1/verifications) endpoint with the domain to verify it.","operationId":"handle_create_domain_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDomainVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Verification code created","content":{"application/json":{"schema":{"type":"object","required":["verificationCode","domain"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to create verification code","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi.createDomainVerificationRequest('example.com').then((result) => {\n const verificationCode = result.verificationCode;\n // put this at a TXT record at _freestyle_custom_hostname.example.com\n});"}]},"delete":{"tags":["Domains"],"summary":"Delete a domain verification request","description":"This deletes a Freestyle Domain Verification Request. This does not remove the domain from the account if it has already been verified, however the verification code will no longer be valid.","operationId":"handle_delete_domain_verification","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeleteDomainVerificationRequest"}}},"required":true},"responses":{"200":{"description":"Verification code created","content":{"application/json":{"schema":{"type":"object","required":["verificationCode","domain"],"properties":{"verificationCode":{"type":"string"},"domain":{"type":"string","example":"example.com"}}}}}},"400":{"description":"Failed to create verification code","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}}}},"/execute/v1/deployments":{"get":{"tags":["Execute"],"summary":"List execute runs","description":"List execute runs.","operationId":"handle_list_execute_runs","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":0}},{"name":"offset","in":"query","required":false,"schema":{"type":["integer","null"],"minimum":0}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["entries","total","offset"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/ExecuteLogEntry"}},"total":{"type":"integer","format":"int64","minimum":0},"offset":{"type":"integer","format":"int64","minimum":0}}}}}},"500":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listExecuteRuns().then((runs) => {\n console.log(runs);\n});"}]}},"/execute/v1/deployments/{deployment}":{"get":{"tags":["Execute"],"summary":"Get information on execute run","description":"Get information on execute run","operationId":"handle_get_execute_run","parameters":[{"name":"deployment","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["metadata","code"],"properties":{"metadata":{"$ref":"#/components/schemas/ExecuteLogEntry"},"code":{"$ref":"#/components/schemas/ExecuteRunInfo"}}}}}},"401":{"description":"Unauthorized access","content":{"application/json":{"schema":{"type":"object","description":"Unauthorized access","required":["message"],"properties":{"message":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","description":"Not found","required":["message"],"properties":{"message":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","description":"Internal server error","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.getExecuteRun('123e4567-e89b-12d3-a456-426614174000').then((runs) => {\n console.log(runs);\n});"}]}},"/execute/v1/script":{"post":{"tags":["Execute"],"summary":"Execute Code","description":"Send a TypeScript or JavaScript module, get the result","operationId":"handle_execute_script","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleExecuteScriptParams"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["result","logs"],"properties":{"result":{},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.executeScript(\n `export default () => {\n let set1 = [1, 2, 3, 4, 5];\n let set2 = [4, 5, 6, 7, 8];\n\n // find the sum of every value of each set multiplied by every value of the other set\n\n let sum = 0;\n for (let i = 0; i < set1.length; i++) {\n for (let j = 0; j < set2.length; j++) {\n sum += set1[i] * set2[j];\n }\n }\n\n return sum;\n};`\n);"},{"label":"Vercel AI SDK","lang":"JavaScript","source":"import { executeTool } from 'freestyle-sandboxes/ai';\nimport { generateText } from 'ai';\n\nconst codeExecutor = executeTool({\n apiKey: 'your-api-key',\n});\n\nconst { text, steps } = await generateText({\n model: yourModel,\n tools: {\n codeExecutor,\n },\n maxSteps: 2,\n prompt:\n 'What is the sum of every number between 1 and 12 multiplied by itself?',\n});"},{"label":"Mastra AI SDK","lang":"JavaScript","source":"import { executeTool } from 'freestyle-sandboxes/mastra';\n\nconst mastra = new Mastra();\n\nconst modelConfig: ModelConfig = {\n provider: 'OPEN_AI',\n name: 'gpt-4',\n};\n\nconst llm = mastra.LLM(modelConfig);\n\nconst response = await llm.generate(\n 'Calculate the sum of every number between 13 and 19 divided by the sum of every number between 8 and 13',\n {\n tools: {\n executor: executeTool({\n apiKey: process.env.FREESTYLE_API_KEY!,\n }),\n },\n }\n);\n\nconsole.log('Response Steps:', response.steps);\nconsole.log('Response:', response.text);"},{"label":"LangGraph AI SDK","lang":"JavaScript","source":"import { createReactAgent } from '@langchain/langgraph/prebuilt';\nimport { ChatOpenAI } from '@langchain/openai';\nimport { executeTool } from 'freestyle-sandboxes/langgraph';\n\nconst model = new ChatOpenAI({ model: 'gpt-4o' });\n\nconst agent = createReactAgent({\n llm: model,\n tools: [\n executeTool({\n apiKey: process.env.FREESTYLE_API_KEY,\n nodeModules: {\n resend: '4.0.1',\n },\n envVars: {\n RESEND_API_KEY: process.env.RESEND_API_KEY,\n },\n }),\n ],\n});\n\nconst result = await agent.invoke(\n {\n messages: [\n { role: 'user', content: 'What is the factorial of 13 divided by 55^2' },\n ],\n },\n { configurable: { thread_id: 42 } }\n);\nconsole.log(result.messages.at(-1)?.content);"}]}},"/observability/v1/logs":{"get":{"tags":["Observability"],"summary":"Deployment Logs","description":"Get the logs for a deployment","operationId":"handle_get_logs","parameters":[{"name":"deploymentId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleGetLogsResponse"}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.getLogs({\n deploymentId: 'deployment-id',\n}).then((response) => {\n console.log(response);\n});"}]}},"/web/v1/deploy":{"post":{"tags":["Web"],"summary":"Deploy a Website","description":"Deploy a website. Files is a map of file paths to file contents. Configuration is optional and contains additional information about the deployment.","operationId":"handle_deploy_web","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebPayload"}}},"required":true},"responses":{"200":{"description":"successfully deployed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebSuccessResponse"}}}},"400":{"description":"failed to deploy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreestyleDeployWebErrorResponse"}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\nimport 'dotenv/config';\n\nconst api = new FreestyleSandboxes({\n apiKey: process.env.FREESTYLE_API_KEY!,\n});\n\napi\n .deployWeb({\n 'index.js': {\n content:`\n import http from 'node:http';\n console.log('starting server');\n\n const server = http.createServer(async(req, res) => {\n // wait 5 seconds before responding\n // await new Promise((resolve) => setTimeout(resolve, 5000));\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end('Welcome to New York its been waiting for you');\n });\n\n server.listen(3000, () => {\n console.log('Server is running at http://localhost:3000');\n });`,\n }})\n .then((result) => {\n console.log('Deployed website @ ', result.deploymentId);\n });\n"},{"label":"Vercel AI SDK","lang":"JavaScript","source":"import { deployWebTool } from 'freestyle-sandboxes/ai';\nimport { generateText } from 'ai';\n\nconst deployer = deployWebTool({\n apiKey: 'your-api-key',\n});\n\nconst { text, steps } = await generateText({\n model: yourModel,\n tools: {\n deployer,\n },\n maxSteps: 2,\n prompt:\n 'Deploy a website to subdomain.yourdomain.com that has all the lyrics to Sandstorm by Darude on the homepage',\n});"}]}},"/web/v1/deployments":{"get":{"tags":["Web"],"summary":"List web deploys","description":"List web deploys.","operationId":"handle_list_web_deploys","responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["entries","total","offset"],"properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentLogEntry"}},"total":{"type":"integer","format":"int64","minimum":0},"offset":{"type":"integer","format":"int64","minimum":0}}}}}},"500":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}}},"x-codeSamples":[{"label":"Human SDK","lang":"JavaScript","source":"import { FreestyleSandboxes } from 'freestyle-sandboxes';\n\nconst sandboxes = new FreestyleSandboxes({\n apiKey: 'your-api-key',\n});\n\nsandboxes.listWebDeploys().then((response) => {\n console.log(response);\n});"}]}},"/web/v1/deployments/deployment/{deployment_id}":{"get":{"tags":["Web"],"summary":"Get information on web deploy","description":"Get information about a web deploy by its ID.","operationId":"handle_get_web_deploy_details","parameters":[{"name":"deployment_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{}}}},"components":{"schemas":{"DeploymentLogEntry":{"type":"object","required":["deploymentId","accountId","provisionedAt","timeout","state","domains","envVars"],"properties":{"deploymentId":{"type":"string","format":"uuid"},"accountId":{"type":"string"},"provisionedAt":{"type":"string","format":"date-time"},"timeout":{"type":"string"},"state":{"$ref":"#/components/schemas/DeploymentState"},"deployedAt":{"type":["string","null"],"format":"date-time"},"domains":{"type":"array","items":{"type":"string"}},"envVars":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"DeploymentState":{"type":"string","enum":["provisioning","deployed","failed"]},"ExecuteLogEntry":{"type":"object","required":["deployment","accountId","provisionedAt","state","envVars"],"properties":{"deployment":{"type":"string","format":"uuid"},"accountId":{"type":"string"},"provisionedAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"duration":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/ExecuteRunState"},"envVars":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"ExecuteRunInfo":{"type":"object","required":["code","nodeModules"],"properties":{"code":{"type":"string"},"nodeModules":{"type":"object","additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}}}},"ExecuteRunState":{"type":"string","enum":["starting","running","complete"]},"FreestyleCloudstateDeployConfiguration":{"type":"object","properties":{"domains":{"type":["array","null"],"items":{"type":"string"},"description":"ID of the project to deploy, if not provided will create a new project","default":null},"envVars":{"type":"object","description":"The environment variables that the cloudstate deploy can access","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"}},"cloudstateDatabaseId":{"type":["string","null"],"default":null}}},"FreestyleCloudstateDeployErrorResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"FreestyleCloudstateDeployRequest":{"type":"object","required":["classes"],"properties":{"classes":{"type":"string"},"config":{"$ref":"#/components/schemas/FreestyleCloudstateDeployConfiguration"}}},"FreestyleCloudstateDeploySuccessResponse":{"type":"object","required":["deploymentId","cloudstateDatabaseId"],"properties":{"deploymentId":{"type":"string"},"cloudstateDatabaseId":{"type":"string"}}},"FreestyleDeleteDomainVerificationRequest":{"type":"object","required":["domain","verificationCode"],"properties":{"domain":{"type":"string","description":"The domain to create a verification code for","example":"example.com"},"verificationCode":{"type":"string","description":"The verification code"}}},"FreestyleDeployWebConfiguration":{"type":"object","properties":{"entrypoint":{"type":["string","null"],"description":"The entrypoint file for the website","default":"index.js"},"domains":{"type":["array","null"],"items":{"type":"string"},"description":"The custom domains for the website, eg. [\\\"subdomain.yourwebsite.com\\\"]. You may include a single *.style.dev domain here.","example":["subdomain.yourdomain.com"],"default":null},"projectId":{"type":["string","null"],"description":"Project ID was our original way of tracking deployments together, it is now deprecated and will be removed in the future. Please use the domains field to specify the domains for your project.","default":null,"deprecated":true},"nodeModules":{"type":["object","null"],"description":"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.","default":null,"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"resend":"4.0.1"}},"envVars":{"type":["object","null"],"description":"The environment variables that the website can access\ne.g. { \\\"RESEND_API_KEY\\\": \\\"re_123456789\\\" }","default":null,"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"RESEND_API_KEY":"re_123456789"}},"serverStartCheck":{"type":"boolean","default":false}}},"FreestyleDeployWebErrorResponse":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"FreestyleDeployWebPayload":{"type":"object","required":["files"],"properties":{"files":{"type":"object","description":"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\\\" } }\n\n**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.","additionalProperties":{"$ref":"#/components/schemas/FreestyleFile"},"propertyNames":{"type":"string"},"example":{"index.js":{"content":"import http from 'node:http';\\n// import { resolver } from './file2.js';\\n\\nconsole.log('starting server');\\n\\nconst server = http.createServer(async(req, res) => {\\n // wait 5 seconds before responding\\n // await new Promise((resolve) => setTimeout(resolve, 5000));\\n res.writeHead(200, { 'Content-Type': 'text/plain' });\\n res.end('Welcome to New York its been waiting for you');\\n});\\n\\nserver.listen(3000, () => {\\n console.log('Server is running at http://localhost:3000');\\n});"}}},"config":{"$ref":"#/components/schemas/FreestyleDeployWebConfiguration"}}},"FreestyleDeployWebSuccessResponse":{"type":"object","required":["deploymentId"],"properties":{"deploymentId":{"type":"string"},"domains":{"type":["array","null"],"items":{"type":"string"}},"projectId":{"type":["string","null"],"deprecated":true}}},"FreestyleDomainVerificationRequest":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","description":"The domain to create a verification code for","example":"example.com"}}},"FreestyleExecuteScriptParams":{"type":"object","required":["script"],"properties":{"script":{"type":"string","description":"The JavaScript or TypeScript script to execute","example":"export default () => {\n // get the value of the factorials of the numbers from 1 to 10 combined\n const a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\n function factorial(n) {\n if (n === 0) {\n return 1;\n }\n return n * factorial(n - 1);\n }\n\n const b = a.map(factorial);\n\n return b.reduce((a, b) => a + b);\n};\n"},"config":{"$ref":"#/components/schemas/FreestyleExecuteScriptParamsConfiguration"}}},"FreestyleExecuteScriptParamsConfiguration":{"type":"object","properties":{"envVars":{"type":"object","description":"The environment variables to set for the script","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"RESEND_API_KEY":"re_123456789"}},"nodeModules":{"type":"object","description":"The node modules to install for the script","default":{},"additionalProperties":{"type":"string"},"propertyNames":{"type":"string"},"example":{"resend":"4.0.1"}},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for you to organize your scripts, useful for tracking what you're running","example":["email"],"default":[]},"timeout":{"type":["string","null"],"description":"The script timeout","default":null},"peerDependencyResolution":{"type":"boolean","description":"If false, we'll not resolve peer dependencies for the packages given, this can speed up execute performance, but will break packages with peers unless the peers are manually specified.","default":true}}},"FreestyleExecuteScriptResultSuccess":{"type":"object","required":["result","logs"],"properties":{"result":{},"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleJavaScriptLog"}}}},"FreestyleFile":{"type":"object","required":["content"],"properties":{"content":{"type":"string","description":"The content of the file"},"encoding":{"type":"string","description":"The encoding of the file. Either **utf-8** or **base64**"}}},"FreestyleGetLogsResponse":{"type":"object","required":["logs"],"properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/FreestyleLogResponseObject"}}}},"FreestyleJavaScriptLog":{"type":"object","required":["message","type"],"properties":{"message":{"type":"string","description":"The log message"},"type":{"type":"string","description":"The log level"}}},"FreestyleLogResponseObject":{"type":"object","required":["message","timestamp"],"properties":{"message":{"type":"string"},"timestamp":{"type":"string"}}},"FreestyleVerifyDomainRequest":{"type":"object","required":["domain"],"properties":{"domain":{"type":"string","example":"example.com"}}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Web","description":"APIs for deploying websites. We handle node modules caching, scaling, certificates and the whole end to end process. Send the code using the [deploy](#tag/web/POST/web/v1/deploy) endpoint, and you'll get a full hosted website back. Works with any TypeScript or JavaScript codebase."},{"name":"Execute","description":"APIs for running code. Send the code using the [execute](#tag/execute/POST/execute/v1/execute) endpoint, and you'll get the output back. Works with any TypeScript or JavaScript code + handles any node modules and environment variables you want."},{"name":"Cloudstate","description":"APIs for running cloud functions with persistent state. [Cloudstate](https://github.com/freestyle-sh/cloudstate/) is an opensource, durable JavaScript runtime maintained by the Freestyle Team."},{"name":"Domains","description":"APIs for managing domains. This is only relevant when you want to start to deploy to custom domains. \nPlease read [this guide](https://github.com/freestyle-sh/sandbox_sdks/blob/main/docs/custom_domains.md) to understand how deployments work with custom domains."}]}
|