@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
|
@@ -19475,6 +19475,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19475
19475
|
}
|
|
19476
19476
|
};
|
|
19477
19477
|
|
|
19478
|
+
// src/http.ts
|
|
19479
|
+
function authenticatedRequest(input, init) {
|
|
19480
|
+
return new Request(input, {
|
|
19481
|
+
...init,
|
|
19482
|
+
redirect: "manual"
|
|
19483
|
+
});
|
|
19484
|
+
}
|
|
19485
|
+
|
|
19478
19486
|
// src/runtime/rest.ts
|
|
19479
19487
|
var restActionRoutes = {
|
|
19480
19488
|
"runtime.ready": { method: "GET", path: "/runtime" },
|
|
@@ -19594,12 +19602,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19594
19602
|
Authorization: `Bearer ${this.ticket}`
|
|
19595
19603
|
};
|
|
19596
19604
|
const body = runtimeActionRequestBody(action, data, url2, headers);
|
|
19597
|
-
return
|
|
19605
|
+
return authenticatedRequest(url2, {
|
|
19598
19606
|
method: route.method,
|
|
19599
19607
|
headers,
|
|
19600
19608
|
body: route.method === "GET" ? void 0 : body,
|
|
19601
|
-
signal
|
|
19602
|
-
redirect: "error"
|
|
19609
|
+
signal
|
|
19603
19610
|
});
|
|
19604
19611
|
}
|
|
19605
19612
|
async refreshAuthorization() {
|
|
@@ -19929,10 +19936,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19929
19936
|
}
|
|
19930
19937
|
async stream(path) {
|
|
19931
19938
|
const response = await this.fetchResponse(
|
|
19932
|
-
|
|
19939
|
+
authenticatedRequest(new URL(path.replace(/^\//, ""), this.baseUrl), {
|
|
19933
19940
|
method: "GET",
|
|
19934
|
-
headers: this.headers
|
|
19935
|
-
redirect: "error"
|
|
19941
|
+
headers: this.headers
|
|
19936
19942
|
})
|
|
19937
19943
|
);
|
|
19938
19944
|
if (!response.ok) {
|
|
@@ -19945,9 +19951,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19945
19951
|
}
|
|
19946
19952
|
async sse(url2) {
|
|
19947
19953
|
const response = await this.fetchResponse(
|
|
19948
|
-
|
|
19954
|
+
authenticatedRequest(url2, {
|
|
19949
19955
|
method: "GET",
|
|
19950
|
-
redirect: "error",
|
|
19951
19956
|
headers: {
|
|
19952
19957
|
...this.headers,
|
|
19953
19958
|
"Accept": "text/event-stream"
|
|
@@ -19964,11 +19969,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19964
19969
|
}
|
|
19965
19970
|
async makeRequest(method, path, init) {
|
|
19966
19971
|
const response = await this.fetchResponse(
|
|
19967
|
-
|
|
19972
|
+
authenticatedRequest(new URL(path.replace(/^\//, ""), this.baseUrl), {
|
|
19968
19973
|
method,
|
|
19969
19974
|
...init,
|
|
19970
|
-
headers: this.headers
|
|
19971
|
-
redirect: "error"
|
|
19975
|
+
headers: this.headers
|
|
19972
19976
|
})
|
|
19973
19977
|
);
|
|
19974
19978
|
if (!response.ok) {
|