freestyle-sandboxes 0.0.57 → 0.0.59
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/.env +1 -0
- package/dist/react/dev-server/index.cjs +5 -3
- package/dist/react/dev-server/index.mjs +5 -3
- package/dist/{types.gen-DyY7Deri.d.ts → types.gen-BoJEFWW-.d.ts} +1 -55
- package/package.json +1 -1
- package/src/react/dev-server/index.tsx +6 -4
- package/src/temp.ts +10 -0
- package/dist/index-BBXyg0JQ.cjs +0 -3253
- package/dist/index-BQHqnjZK.mjs +0 -3231
- package/dist/index-CEEa9WHp.cjs +0 -3238
- package/dist/index-D1ulQeJR.mjs +0 -3247
- package/dist/index-DCF70Xbq.mjs +0 -3246
- package/dist/index-H7UNEAjs.cjs +0 -3254
- package/dist/index.d-CXx1AdyW.d.ts +0 -4210
- package/dist/types.gen-1sd31qLV.d.ts +0 -172
- package/dist/types.gen-627pxroW.d.ts +0 -830
- package/dist/types.gen-BCdfx7yt.d.ts +0 -760
- package/dist/types.gen-BaMKzqxQ.d.ts +0 -233
- package/dist/types.gen-BtK6PMQy.d.ts +0 -195
- package/dist/types.gen-BuhQ5LpB.d.ts +0 -764
- package/dist/types.gen-BzRtj_TA.d.ts +0 -725
- package/dist/types.gen-C03gaIPq.d.ts +0 -297
- package/dist/types.gen-CMuCas4r.d.ts +0 -183
- package/dist/types.gen-CZUnqmzP.d.ts +0 -789
- package/dist/types.gen-CnEkmbco.d.ts +0 -314
- package/dist/types.gen-DDYpuDzZ.d.ts +0 -764
- package/dist/types.gen-DHmdEOOa.d.ts +0 -172
- package/dist/types.gen-DLYohMJT.d.ts +0 -382
- package/dist/types.gen-DbTb_SrD.d.ts +0 -156
- package/dist/types.gen-DkQ-Dbs1.d.ts +0 -764
- package/dist/types.gen-MBZCvIhE.d.ts +0 -311
- package/dist/types.gen-YhJAHBw8.d.ts +0 -233
- package/dist/types.gen-cCnnhnB6.d.ts +0 -182
- package/dist/types.gen-mg_JNXrq.d.ts +0 -830
- package/dist/types.gen-uDTr6v-7.d.ts +0 -731
package/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
FREESTYLE_API_KEY=RoZ4n8eAY4ChcgdKV89LjY-Fhvp6Rzqx27bZ4BjHaVf7qpEw7vA7MekK84DdGgZYkR2
|
|
@@ -62,6 +62,11 @@ function FreestyleDevServerInner({
|
|
|
62
62
|
return () => clearInterval(interval);
|
|
63
63
|
}, [data?.ephemeralUrl]);
|
|
64
64
|
const [wasLoaded, setWasLoaded] = React.useState(false);
|
|
65
|
+
React.useMemo(() => {
|
|
66
|
+
if (data?.devCommandRunning) {
|
|
67
|
+
setWasLoaded(true);
|
|
68
|
+
}
|
|
69
|
+
}, [isLoading, data?.devCommandRunning]);
|
|
65
70
|
if (isLoading) {
|
|
66
71
|
return loadingComponent({
|
|
67
72
|
devCommandRunning: false,
|
|
@@ -76,9 +81,6 @@ function FreestyleDevServerInner({
|
|
|
76
81
|
serverStarting: false
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
|
-
React.useMemo(() => {
|
|
80
|
-
setWasLoaded(true);
|
|
81
|
-
});
|
|
82
84
|
return /* @__PURE__ */ React.createElement(
|
|
83
85
|
"iframe",
|
|
84
86
|
{
|
|
@@ -60,6 +60,11 @@ function FreestyleDevServerInner({
|
|
|
60
60
|
return () => clearInterval(interval);
|
|
61
61
|
}, [data?.ephemeralUrl]);
|
|
62
62
|
const [wasLoaded, setWasLoaded] = React.useState(false);
|
|
63
|
+
React.useMemo(() => {
|
|
64
|
+
if (data?.devCommandRunning) {
|
|
65
|
+
setWasLoaded(true);
|
|
66
|
+
}
|
|
67
|
+
}, [isLoading, data?.devCommandRunning]);
|
|
63
68
|
if (isLoading) {
|
|
64
69
|
return loadingComponent({
|
|
65
70
|
devCommandRunning: false,
|
|
@@ -74,9 +79,6 @@ function FreestyleDevServerInner({
|
|
|
74
79
|
serverStarting: false
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
|
-
React.useMemo(() => {
|
|
78
|
-
setWasLoaded(true);
|
|
79
|
-
});
|
|
80
82
|
return /* @__PURE__ */ React.createElement(
|
|
81
83
|
"iframe",
|
|
82
84
|
{
|
|
@@ -10,9 +10,6 @@ type FreestyleCloudstateDeployConfiguration = {
|
|
|
10
10
|
[key: string]: (string);
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
type FreestyleCloudstateDeployErrorResponse = {
|
|
14
|
-
message: string;
|
|
15
|
-
};
|
|
16
13
|
type FreestyleCloudstateDeployRequest = {
|
|
17
14
|
classes: string;
|
|
18
15
|
config?: FreestyleCloudstateDeployConfiguration;
|
|
@@ -50,36 +47,12 @@ type FreestyleDeployWebConfiguration = {
|
|
|
50
47
|
[key: string]: (string);
|
|
51
48
|
} | null;
|
|
52
49
|
};
|
|
53
|
-
type FreestyleDeployWebErrorResponse = {
|
|
54
|
-
message: string;
|
|
55
|
-
};
|
|
56
|
-
type FreestyleDeployWebPayload = {
|
|
57
|
-
/**
|
|
58
|
-
* The files to deploy, a map of file paths to file contents, e.g. { \"index.js\": {\"content\": \"your main\", \"encoding\": \"utf-8\"}, \"file2.js\": {\"content\": \"your helper\" } }
|
|
59
|
-
*
|
|
60
|
-
* **Do not include node modules in this bundle, they will not work**. Instead, includes a package-lock.json, bun.lockb, pnpm-lock.yaml, or yarn.lock, the node modules for the project will be installed from that lock file, or use the node_modules field in the configuration to specify the node modules to install.
|
|
61
|
-
*/
|
|
62
|
-
files: {
|
|
63
|
-
[key: string]: FreestyleFile;
|
|
64
|
-
};
|
|
65
|
-
config?: FreestyleDeployWebConfiguration;
|
|
66
|
-
};
|
|
67
50
|
type FreestyleDeployWebSuccessResponse = {
|
|
68
51
|
projectId: string;
|
|
69
52
|
};
|
|
70
|
-
type FreestyleExecureScriptResultError = {
|
|
71
|
-
error: string;
|
|
72
|
-
};
|
|
73
53
|
type FreestyleExecureScriptResultSuccess = {
|
|
74
54
|
result: unknown;
|
|
75
55
|
};
|
|
76
|
-
type FreestyleExecuteScriptParams = {
|
|
77
|
-
/**
|
|
78
|
-
* The JavaScript or TypeScript script to execute
|
|
79
|
-
*/
|
|
80
|
-
script: string;
|
|
81
|
-
config?: FreestyleExecuteScriptParamsConfiguration;
|
|
82
|
-
};
|
|
83
56
|
type FreestyleExecuteScriptParamsConfiguration = {
|
|
84
57
|
/**
|
|
85
58
|
* The environment variables to set for the script
|
|
@@ -102,37 +75,10 @@ type FreestyleExecuteScriptParamsConfiguration = {
|
|
|
102
75
|
*/
|
|
103
76
|
timeout?: (string) | null;
|
|
104
77
|
};
|
|
105
|
-
type FreestyleFile = {
|
|
106
|
-
/**
|
|
107
|
-
* The content of the file
|
|
108
|
-
*/
|
|
109
|
-
content: string;
|
|
110
|
-
/**
|
|
111
|
-
* The encoding of the file. Either **utf-8** or **base64**
|
|
112
|
-
*/
|
|
113
|
-
encoding?: string;
|
|
114
|
-
};
|
|
115
78
|
type FreestyleLogResponseObject = {
|
|
116
79
|
message: string;
|
|
117
80
|
};
|
|
118
|
-
type HandleDeployCloudstateData = {
|
|
119
|
-
body: FreestyleCloudstateDeployRequest;
|
|
120
|
-
};
|
|
121
|
-
type HandleDeployCloudstateResponse = (FreestyleCloudstateDeploySuccessResponse);
|
|
122
|
-
type HandleDeployCloudstateError = (FreestyleCloudstateDeployErrorResponse);
|
|
123
81
|
type HandleBackupCloudstateResponse = (Array<(number)>);
|
|
124
|
-
type HandleBackupCloudstateError = (unknown);
|
|
125
|
-
type HandleExecuteScriptData = {
|
|
126
|
-
body: FreestyleExecuteScriptParams;
|
|
127
|
-
};
|
|
128
|
-
type HandleExecuteScriptResponse = (FreestyleExecureScriptResultSuccess);
|
|
129
|
-
type HandleExecuteScriptError = (FreestyleExecureScriptResultError);
|
|
130
|
-
type HandleDeployWebData = {
|
|
131
|
-
body: FreestyleDeployWebPayload;
|
|
132
|
-
};
|
|
133
|
-
type HandleDeployWebResponse = (FreestyleDeployWebSuccessResponse);
|
|
134
|
-
type HandleDeployWebError = (FreestyleDeployWebErrorResponse);
|
|
135
82
|
type HandleGetLogsResponse = (Array<FreestyleLogResponseObject>);
|
|
136
|
-
type HandleGetLogsError = unknown;
|
|
137
83
|
|
|
138
|
-
export type { FreestyleExecuteScriptParamsConfiguration as F, HandleBackupCloudstateResponse as H, FreestyleExecureScriptResultSuccess as a, FreestyleDeployWebConfiguration as b, FreestyleDeployWebSuccessResponse as c, FreestyleCloudstateDeployRequest as d, FreestyleCloudstateDeploySuccessResponse as e, HandleGetLogsResponse as f
|
|
84
|
+
export type { FreestyleExecuteScriptParamsConfiguration as F, HandleBackupCloudstateResponse as H, FreestyleExecureScriptResultSuccess as a, FreestyleDeployWebConfiguration as b, FreestyleDeployWebSuccessResponse as c, FreestyleCloudstateDeployRequest as d, FreestyleCloudstateDeploySuccessResponse as e, HandleGetLogsResponse as f };
|
package/package.json
CHANGED
|
@@ -98,6 +98,12 @@ function FreestyleDevServerInner({
|
|
|
98
98
|
|
|
99
99
|
const [wasLoaded, setWasLoaded] = React.useState(false);
|
|
100
100
|
|
|
101
|
+
React.useMemo(() => {
|
|
102
|
+
if (data?.devCommandRunning) {
|
|
103
|
+
setWasLoaded(true);
|
|
104
|
+
}
|
|
105
|
+
}, [isLoading, data?.devCommandRunning]);
|
|
106
|
+
|
|
101
107
|
if (isLoading) {
|
|
102
108
|
return loadingComponent({
|
|
103
109
|
devCommandRunning: false,
|
|
@@ -114,10 +120,6 @@ function FreestyleDevServerInner({
|
|
|
114
120
|
});
|
|
115
121
|
}
|
|
116
122
|
|
|
117
|
-
React.useMemo(() => {
|
|
118
|
-
setWasLoaded(true);
|
|
119
|
-
});
|
|
120
|
-
|
|
121
123
|
return (
|
|
122
124
|
<iframe
|
|
123
125
|
ref={ref}
|
package/src/temp.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FreestyleSandboxes } from "./index";
|
|
2
|
+
import "dotenv/config"
|
|
3
|
+
|
|
4
|
+
const api = new FreestyleSandboxes({
|
|
5
|
+
apiKey: process.env.FREESTYLE_API_KEY,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
api.requestDevServer({
|
|
9
|
+
repoUrl: "https://c6709211-2d68-478e-80b3-7ebe7313f3ac:QqasQD331e3woNyK.Q9dnXy3MR9Aeo759@git.freestyle.sh/15b7ed11-0e7c-452b-b044-70f0dcab9161"
|
|
10
|
+
}).then(console.log)
|