@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.mjs
CHANGED
|
@@ -6720,6 +6720,13 @@ function capabilityVersionFromProto(wire, projectId2) {
|
|
|
6720
6720
|
}
|
|
6721
6721
|
|
|
6722
6722
|
// src/api-client.ts
|
|
6723
|
+
function resolveAmbassadorBaseUrl(serverUrl) {
|
|
6724
|
+
try {
|
|
6725
|
+
return new URL(serverUrl).origin;
|
|
6726
|
+
} catch {
|
|
6727
|
+
return serverUrl;
|
|
6728
|
+
}
|
|
6729
|
+
}
|
|
6723
6730
|
function createApiClient(serverUrl, options = "") {
|
|
6724
6731
|
const opts = typeof options === "string" ? { apiPrefix: options } : options;
|
|
6725
6732
|
const apiPrefix = opts.apiPrefix ?? "";
|
|
@@ -6728,7 +6735,7 @@ function createApiClient(serverUrl, options = "") {
|
|
|
6728
6735
|
const grpcAuthToken = opts.grpcAuthToken;
|
|
6729
6736
|
const pathPrefix = authToken ? "/public" : "";
|
|
6730
6737
|
const httpClient = opts.httpClient ?? new import_http_client.HttpClient({
|
|
6731
|
-
baseURL: serverUrl,
|
|
6738
|
+
baseURL: resolveAmbassadorBaseUrl(serverUrl),
|
|
6732
6739
|
...grpcAuthToken ? { getAppToken: () => grpcAuthToken } : {},
|
|
6733
6740
|
...routeHeader ? { headers: { "x-wix-route": routeHeader } } : {},
|
|
6734
6741
|
disableSquidProxy: true
|