@wix/evalforge-evaluator 0.179.0 → 0.180.0
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/build/index.js +8 -1
- package/build/index.js.map +2 -2
- package/build/index.mjs +8 -1
- package/build/index.mjs.map +2 -2
- package/build/types/api-client.d.ts +20 -0
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -6715,6 +6715,13 @@ function capabilityVersionFromProto(wire, projectId2) {
|
|
|
6715
6715
|
}
|
|
6716
6716
|
|
|
6717
6717
|
// src/api-client.ts
|
|
6718
|
+
function resolveAmbassadorBaseUrl(serverUrl) {
|
|
6719
|
+
try {
|
|
6720
|
+
return new URL(serverUrl).origin;
|
|
6721
|
+
} catch {
|
|
6722
|
+
return serverUrl;
|
|
6723
|
+
}
|
|
6724
|
+
}
|
|
6718
6725
|
function createApiClient(serverUrl, options = "") {
|
|
6719
6726
|
const opts = typeof options === "string" ? { apiPrefix: options } : options;
|
|
6720
6727
|
const apiPrefix = opts.apiPrefix ?? "";
|
|
@@ -6723,7 +6730,7 @@ function createApiClient(serverUrl, options = "") {
|
|
|
6723
6730
|
const grpcAuthToken = opts.grpcAuthToken;
|
|
6724
6731
|
const pathPrefix = authToken ? "/public" : "";
|
|
6725
6732
|
const httpClient = opts.httpClient ?? new import_http_client.HttpClient({
|
|
6726
|
-
baseURL: serverUrl,
|
|
6733
|
+
baseURL: resolveAmbassadorBaseUrl(serverUrl),
|
|
6727
6734
|
...grpcAuthToken ? { getAppToken: () => grpcAuthToken } : {},
|
|
6728
6735
|
...routeHeader ? { headers: { "x-wix-route": routeHeader } } : {},
|
|
6729
6736
|
disableSquidProxy: true
|