@phpsandbox/sdk 0.1.10 → 0.1.11
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/browser/phpsandbox-sdk.esm.js +15 -11
- package/dist/browser/phpsandbox-sdk.esm.min.js +10 -10
- package/dist/browser/phpsandbox-sdk.iife.js +15 -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/runtime/rest.js +2 -2
- package/package.json +1 -1
|
@@ -19446,6 +19446,14 @@ var ServerInstance = class {
|
|
|
19446
19446
|
}
|
|
19447
19447
|
};
|
|
19448
19448
|
|
|
19449
|
+
// src/http.ts
|
|
19450
|
+
function authenticatedRequest(input, init) {
|
|
19451
|
+
return new Request(input, {
|
|
19452
|
+
...init,
|
|
19453
|
+
redirect: "manual"
|
|
19454
|
+
});
|
|
19455
|
+
}
|
|
19456
|
+
|
|
19449
19457
|
// src/runtime/rest.ts
|
|
19450
19458
|
var restActionRoutes = {
|
|
19451
19459
|
"runtime.ready": { method: "GET", path: "/runtime" },
|
|
@@ -19565,12 +19573,11 @@ var RestRuntimeInvoker = class {
|
|
|
19565
19573
|
Authorization: `Bearer ${this.ticket}`
|
|
19566
19574
|
};
|
|
19567
19575
|
const body = runtimeActionRequestBody(action, data, url2, headers);
|
|
19568
|
-
return
|
|
19576
|
+
return authenticatedRequest(url2, {
|
|
19569
19577
|
method: route.method,
|
|
19570
19578
|
headers,
|
|
19571
19579
|
body: route.method === "GET" ? void 0 : body,
|
|
19572
|
-
signal
|
|
19573
|
-
redirect: "error"
|
|
19580
|
+
signal
|
|
19574
19581
|
});
|
|
19575
19582
|
}
|
|
19576
19583
|
async refreshAuthorization() {
|
|
@@ -19900,10 +19907,9 @@ var ClientImplementation = class {
|
|
|
19900
19907
|
}
|
|
19901
19908
|
async stream(path) {
|
|
19902
19909
|
const response = await this.fetchResponse(
|
|
19903
|
-
|
|
19910
|
+
authenticatedRequest(new URL(path.replace(/^\//, ""), this.baseUrl), {
|
|
19904
19911
|
method: "GET",
|
|
19905
|
-
headers: this.headers
|
|
19906
|
-
redirect: "error"
|
|
19912
|
+
headers: this.headers
|
|
19907
19913
|
})
|
|
19908
19914
|
);
|
|
19909
19915
|
if (!response.ok) {
|
|
@@ -19916,9 +19922,8 @@ var ClientImplementation = class {
|
|
|
19916
19922
|
}
|
|
19917
19923
|
async sse(url2) {
|
|
19918
19924
|
const response = await this.fetchResponse(
|
|
19919
|
-
|
|
19925
|
+
authenticatedRequest(url2, {
|
|
19920
19926
|
method: "GET",
|
|
19921
|
-
redirect: "error",
|
|
19922
19927
|
headers: {
|
|
19923
19928
|
...this.headers,
|
|
19924
19929
|
"Accept": "text/event-stream"
|
|
@@ -19935,11 +19940,10 @@ var ClientImplementation = class {
|
|
|
19935
19940
|
}
|
|
19936
19941
|
async makeRequest(method, path, init) {
|
|
19937
19942
|
const response = await this.fetchResponse(
|
|
19938
|
-
|
|
19943
|
+
authenticatedRequest(new URL(path.replace(/^\//, ""), this.baseUrl), {
|
|
19939
19944
|
method,
|
|
19940
19945
|
...init,
|
|
19941
|
-
headers: this.headers
|
|
19942
|
-
redirect: "error"
|
|
19946
|
+
headers: this.headers
|
|
19943
19947
|
})
|
|
19944
19948
|
);
|
|
19945
19949
|
if (!response.ok) {
|