@phpsandbox/sdk 0.1.10 → 0.1.12
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/README.md +1 -0
- package/dist/browser/phpsandbox-sdk.esm.js +22 -11
- package/dist/browser/phpsandbox-sdk.esm.min.js +10 -10
- package/dist/browser/phpsandbox-sdk.iife.js +22 -11
- package/dist/browser/phpsandbox-sdk.iife.min.js +10 -10
- package/dist/http.d.ts +6 -0
- package/dist/http.js +11 -0
- package/dist/index.js +4 -6
- package/dist/ports.d.ts +1 -0
- package/dist/ports.js +3 -0
- package/dist/runtime/rest.js +3 -2
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.js +3 -0
- package/docs/api-summary.md +1 -0
- package/package.json +1 -1
|
@@ -1216,6 +1216,9 @@ var PHPSandbox = (() => {
|
|
|
1216
1216
|
list() {
|
|
1217
1217
|
return this.okra.invoke("container.opened-ports");
|
|
1218
1218
|
}
|
|
1219
|
+
resolve(port) {
|
|
1220
|
+
return this.okra.invoke("container.resolve-port", { port });
|
|
1221
|
+
}
|
|
1219
1222
|
watch(options = {}) {
|
|
1220
1223
|
return watchRuntimeTelemetry(this.okra, this.telemetry, "ports", "container.ports", (ports) => ports, options);
|
|
1221
1224
|
}
|
|
@@ -1248,6 +1251,9 @@ var PHPSandbox = (() => {
|
|
|
1248
1251
|
list() {
|
|
1249
1252
|
return this.ports.list();
|
|
1250
1253
|
}
|
|
1254
|
+
resolve(port) {
|
|
1255
|
+
return this.ports.resolve(port);
|
|
1256
|
+
}
|
|
1251
1257
|
watch(options = {}) {
|
|
1252
1258
|
return this.ports.watch(options);
|
|
1253
1259
|
}
|
|
@@ -19475,6 +19481,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19475
19481
|
}
|
|
19476
19482
|
};
|
|
19477
19483
|
|
|
19484
|
+
// src/http.ts
|
|
19485
|
+
function authenticatedRequest(input, init) {
|
|
19486
|
+
return new Request(input, {
|
|
19487
|
+
...init,
|
|
19488
|
+
redirect: "manual"
|
|
19489
|
+
});
|
|
19490
|
+
}
|
|
19491
|
+
|
|
19478
19492
|
// src/runtime/rest.ts
|
|
19479
19493
|
var restActionRoutes = {
|
|
19480
19494
|
"runtime.ready": { method: "GET", path: "/runtime" },
|
|
@@ -19485,6 +19499,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19485
19499
|
"container.stop": { method: "POST", path: "/runtime/container/stop" },
|
|
19486
19500
|
"container.set-php": { method: "PUT", path: "/runtime/container/php" },
|
|
19487
19501
|
"container.opened-ports": { method: "GET", path: "/runtime/container/ports" },
|
|
19502
|
+
"container.resolve-port": { method: "POST", path: "/runtime/container/ports/resolve" },
|
|
19488
19503
|
"container.stats": { method: "GET", path: "/runtime/container/stats" },
|
|
19489
19504
|
"terminal.list": { method: "GET", path: "/runtime/terminals" },
|
|
19490
19505
|
"shell.exec": { method: "POST", path: "/runtime/executions" },
|
|
@@ -19594,12 +19609,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19594
19609
|
Authorization: `Bearer ${this.ticket}`
|
|
19595
19610
|
};
|
|
19596
19611
|
const body = runtimeActionRequestBody(action, data, url2, headers);
|
|
19597
|
-
return
|
|
19612
|
+
return authenticatedRequest(url2, {
|
|
19598
19613
|
method: route.method,
|
|
19599
19614
|
headers,
|
|
19600
19615
|
body: route.method === "GET" ? void 0 : body,
|
|
19601
|
-
signal
|
|
19602
|
-
redirect: "error"
|
|
19616
|
+
signal
|
|
19603
19617
|
});
|
|
19604
19618
|
}
|
|
19605
19619
|
async refreshAuthorization() {
|
|
@@ -19929,10 +19943,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19929
19943
|
}
|
|
19930
19944
|
async stream(path) {
|
|
19931
19945
|
const response = await this.fetchResponse(
|
|
19932
|
-
|
|
19946
|
+
authenticatedRequest(new URL(path.replace(/^\//, ""), this.baseUrl), {
|
|
19933
19947
|
method: "GET",
|
|
19934
|
-
headers: this.headers
|
|
19935
|
-
redirect: "error"
|
|
19948
|
+
headers: this.headers
|
|
19936
19949
|
})
|
|
19937
19950
|
);
|
|
19938
19951
|
if (!response.ok) {
|
|
@@ -19945,9 +19958,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19945
19958
|
}
|
|
19946
19959
|
async sse(url2) {
|
|
19947
19960
|
const response = await this.fetchResponse(
|
|
19948
|
-
|
|
19961
|
+
authenticatedRequest(url2, {
|
|
19949
19962
|
method: "GET",
|
|
19950
|
-
redirect: "error",
|
|
19951
19963
|
headers: {
|
|
19952
19964
|
...this.headers,
|
|
19953
19965
|
"Accept": "text/event-stream"
|
|
@@ -19964,11 +19976,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19964
19976
|
}
|
|
19965
19977
|
async makeRequest(method, path, init) {
|
|
19966
19978
|
const response = await this.fetchResponse(
|
|
19967
|
-
|
|
19979
|
+
authenticatedRequest(new URL(path.replace(/^\//, ""), this.baseUrl), {
|
|
19968
19980
|
method,
|
|
19969
19981
|
...init,
|
|
19970
|
-
headers: this.headers
|
|
19971
|
-
redirect: "error"
|
|
19982
|
+
headers: this.headers
|
|
19972
19983
|
})
|
|
19973
19984
|
);
|
|
19974
19985
|
if (!response.ok) {
|