freestyle-sandboxes 0.0.74 → 0.0.76
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/index.cjs +4 -13
- package/dist/index.mjs +4 -13
- package/package.json +1 -1
- package/src/index.ts +8 -12
package/dist/index.cjs
CHANGED
|
@@ -63,12 +63,6 @@ const handleExecOnEphemeralDevServer = (options) => {
|
|
|
63
63
|
url: "/ephemeral/v1/dev-servers/exec"
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
|
-
const handleWriteFileFromEphemeralDevServer = (options) => {
|
|
67
|
-
return (options?.client ?? client).put({
|
|
68
|
-
...options,
|
|
69
|
-
url: "/ephemeral/v1/dev-servers/files/{*filepath}"
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
66
|
const handleReadFileFromEphemeralDevServer = (options) => {
|
|
73
67
|
return (options?.client ?? client).post({
|
|
74
68
|
...options,
|
|
@@ -1001,20 +995,17 @@ ${response.error.message}`);
|
|
|
1001
995
|
},
|
|
1002
996
|
async writeFile(path, content, encoding = "utf-8") {
|
|
1003
997
|
const contentStr = typeof content === "string" ? content : Buffer.from(content).toString(encoding);
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
path: {
|
|
1007
|
-
filepath: path
|
|
1008
|
-
},
|
|
998
|
+
await client.put({
|
|
999
|
+
url: `/ephemeral/v1/dev-servers/files/${path}`,
|
|
1009
1000
|
body: {
|
|
1010
1001
|
devServer: devServerInstance,
|
|
1011
1002
|
content: contentStr,
|
|
1012
1003
|
encoding
|
|
1013
1004
|
}
|
|
1014
1005
|
});
|
|
1015
|
-
if (
|
|
1006
|
+
if (response.error) {
|
|
1016
1007
|
throw new Error(
|
|
1017
|
-
`Failed to write file: ${JSON.stringify(
|
|
1008
|
+
`Failed to write file: ${JSON.stringify(response.error)}`
|
|
1018
1009
|
);
|
|
1019
1010
|
}
|
|
1020
1011
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -61,12 +61,6 @@ const handleExecOnEphemeralDevServer = (options) => {
|
|
|
61
61
|
url: "/ephemeral/v1/dev-servers/exec"
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
|
-
const handleWriteFileFromEphemeralDevServer = (options) => {
|
|
65
|
-
return (options?.client ?? client).put({
|
|
66
|
-
...options,
|
|
67
|
-
url: "/ephemeral/v1/dev-servers/files/{*filepath}"
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
64
|
const handleReadFileFromEphemeralDevServer = (options) => {
|
|
71
65
|
return (options?.client ?? client).post({
|
|
72
66
|
...options,
|
|
@@ -999,20 +993,17 @@ ${response.error.message}`);
|
|
|
999
993
|
},
|
|
1000
994
|
async writeFile(path, content, encoding = "utf-8") {
|
|
1001
995
|
const contentStr = typeof content === "string" ? content : Buffer.from(content).toString(encoding);
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
path: {
|
|
1005
|
-
filepath: path
|
|
1006
|
-
},
|
|
996
|
+
await client.put({
|
|
997
|
+
url: `/ephemeral/v1/dev-servers/files/${path}`,
|
|
1007
998
|
body: {
|
|
1008
999
|
devServer: devServerInstance,
|
|
1009
1000
|
content: contentStr,
|
|
1010
1001
|
encoding
|
|
1011
1002
|
}
|
|
1012
1003
|
});
|
|
1013
|
-
if (
|
|
1004
|
+
if (response.error) {
|
|
1014
1005
|
throw new Error(
|
|
1015
|
-
`Failed to write file: ${JSON.stringify(
|
|
1006
|
+
`Failed to write file: ${JSON.stringify(response.error)}`
|
|
1016
1007
|
);
|
|
1017
1008
|
}
|
|
1018
1009
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1083,18 +1083,14 @@ export class FreestyleSandboxes {
|
|
|
1083
1083
|
? content
|
|
1084
1084
|
: Buffer.from(content).toString(encoding);
|
|
1085
1085
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
content: contentStr,
|
|
1095
|
-
encoding,
|
|
1096
|
-
},
|
|
1097
|
-
});
|
|
1086
|
+
await client.put({
|
|
1087
|
+
url: `/ephemeral/v1/dev-servers/files/${path}`,
|
|
1088
|
+
body: {
|
|
1089
|
+
devServer: devServerInstance,
|
|
1090
|
+
content: contentStr,
|
|
1091
|
+
encoding,
|
|
1092
|
+
},
|
|
1093
|
+
});
|
|
1098
1094
|
|
|
1099
1095
|
if (response.error) {
|
|
1100
1096
|
throw new Error(
|