@acosmi/sdk-ts 2.2.0 → 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/CHANGELOG.md +20 -0
- package/README.md +7 -4
- package/dist/browser/index.mjs +4 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.cjs +4 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +19 -0
- package/dist/node/index.d.ts +19 -0
- package/dist/node/index.mjs +4 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.cjs
CHANGED
|
@@ -2081,6 +2081,8 @@ var Client = class _Client {
|
|
|
2081
2081
|
serverURL;
|
|
2082
2082
|
/** Compliance API 根地址 (已 trim 尾随 /); null = 走默认 ${serverURL}/admin-api */
|
|
2083
2083
|
complianceBaseURL;
|
|
2084
|
+
/** `/api/v4` 网关调用 base 覆盖 (已 trim 尾随 /); null = 走默认 serverURL */
|
|
2085
|
+
apiBaseURL;
|
|
2084
2086
|
/** OAuth metadata profile — 刷新 token 时发现 metadata 用 (默认 'desktop') */
|
|
2085
2087
|
oauthMetadataProfile;
|
|
2086
2088
|
/** Browser Web OAuth refresh strategy (default 'direct') */
|
|
@@ -2122,6 +2124,7 @@ var Client = class _Client {
|
|
|
2122
2124
|
const picked = pickAndNormalizeGatewayURL(cfg);
|
|
2123
2125
|
this.serverURL = picked ?? DEFAULT_GATEWAY_BASE_URL;
|
|
2124
2126
|
this.complianceBaseURL = cfg.complianceBaseURL ? cfg.complianceBaseURL.replace(/\/+$/, "") : null;
|
|
2127
|
+
this.apiBaseURL = cfg.apiBaseURL ? cfg.apiBaseURL.replace(/\/+$/, "") : null;
|
|
2125
2128
|
this.oauthMetadataProfile = cfg.oauthMetadataProfile ?? "desktop";
|
|
2126
2129
|
this.browserRefreshMode = cfg.browserRefreshMode ?? "direct";
|
|
2127
2130
|
this.refreshProxyURL = cfg.refreshProxyURL ?? null;
|
|
@@ -3048,7 +3051,7 @@ var Client = class _Client {
|
|
|
3048
3051
|
// Internal HTTP
|
|
3049
3052
|
// ===========================================================================
|
|
3050
3053
|
apiURL(path) {
|
|
3051
|
-
let base = this.serverURL;
|
|
3054
|
+
let base = this.apiBaseURL ?? this.serverURL;
|
|
3052
3055
|
if (!base.endsWith("/api/v4")) {
|
|
3053
3056
|
base += "/api/v4";
|
|
3054
3057
|
}
|