@acosmi/sdk-ts 2.2.1 → 2.3.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/dist/index.mjs CHANGED
@@ -2079,6 +2079,8 @@ var Client = class _Client {
2079
2079
  serverURL;
2080
2080
  /** Compliance API 根地址 (已 trim 尾随 /); null = 走默认 ${serverURL}/admin-api */
2081
2081
  complianceBaseURL;
2082
+ /** `/api/v4` 网关调用 base 覆盖 (已 trim 尾随 /); null = 走默认 serverURL */
2083
+ apiBaseURL;
2082
2084
  /** OAuth metadata profile — 刷新 token 时发现 metadata 用 (默认 'desktop') */
2083
2085
  oauthMetadataProfile;
2084
2086
  /** Browser Web OAuth refresh strategy (default 'direct') */
@@ -2120,6 +2122,7 @@ var Client = class _Client {
2120
2122
  const picked = pickAndNormalizeGatewayURL(cfg);
2121
2123
  this.serverURL = picked ?? DEFAULT_GATEWAY_BASE_URL;
2122
2124
  this.complianceBaseURL = cfg.complianceBaseURL ? cfg.complianceBaseURL.replace(/\/+$/, "") : null;
2125
+ this.apiBaseURL = cfg.apiBaseURL ? cfg.apiBaseURL.replace(/\/+$/, "") : null;
2123
2126
  this.oauthMetadataProfile = cfg.oauthMetadataProfile ?? "desktop";
2124
2127
  this.browserRefreshMode = cfg.browserRefreshMode ?? "direct";
2125
2128
  this.refreshProxyURL = cfg.refreshProxyURL ?? null;
@@ -3046,7 +3049,7 @@ var Client = class _Client {
3046
3049
  // Internal HTTP
3047
3050
  // ===========================================================================
3048
3051
  apiURL(path) {
3049
- let base = this.serverURL;
3052
+ let base = this.apiBaseURL ?? this.serverURL;
3050
3053
  if (!base.endsWith("/api/v4")) {
3051
3054
  base += "/api/v4";
3052
3055
  }