api-core-lib 2.1.1 → 2.2.2
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.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
@@ -87,12 +87,13 @@ interface RequestConfig extends AxiosRequestConfig {
|
|
87
87
|
* الواجهة الرئيسية لتهيئة عميل الـ API.
|
88
88
|
*/
|
89
89
|
interface ApiClientConfig {
|
90
|
-
baseURL
|
90
|
+
baseURL?: string;
|
91
91
|
tokenManager: TokenManager;
|
92
92
|
timeout?: number;
|
93
93
|
headers?: Record<string, string>;
|
94
94
|
withCredentials?: boolean;
|
95
95
|
responseType?: ResponseType;
|
96
|
+
pathRefreshToken?: string;
|
96
97
|
onRefreshError?: (error: any) => void;
|
97
98
|
}
|
98
99
|
/**
|
package/dist/index.d.ts
CHANGED
@@ -87,12 +87,13 @@ interface RequestConfig extends AxiosRequestConfig {
|
|
87
87
|
* الواجهة الرئيسية لتهيئة عميل الـ API.
|
88
88
|
*/
|
89
89
|
interface ApiClientConfig {
|
90
|
-
baseURL
|
90
|
+
baseURL?: string;
|
91
91
|
tokenManager: TokenManager;
|
92
92
|
timeout?: number;
|
93
93
|
headers?: Record<string, string>;
|
94
94
|
withCredentials?: boolean;
|
95
95
|
responseType?: ResponseType;
|
96
|
+
pathRefreshToken?: string;
|
96
97
|
onRefreshError?: (error: any) => void;
|
97
98
|
}
|
98
99
|
/**
|
package/dist/index.js
CHANGED
@@ -47,7 +47,7 @@ async function refreshToken(config, tokenManager) {
|
|
47
47
|
const currentTokens = await tokenManager.getTokens();
|
48
48
|
if (!currentTokens.refreshToken) throw new Error("No refresh token available.");
|
49
49
|
const response = await import_axios.default.post(
|
50
|
-
`${config.baseURL}/auth/refresh`,
|
50
|
+
`${config.baseURL}${config.pathRefreshToken || "/auth/refresh"}`,
|
51
51
|
{ refresh_token: currentTokens.refreshToken },
|
52
52
|
{ withCredentials: config.withCredentials }
|
53
53
|
);
|
package/dist/index.mjs
CHANGED
@@ -6,7 +6,7 @@ async function refreshToken(config, tokenManager) {
|
|
6
6
|
const currentTokens = await tokenManager.getTokens();
|
7
7
|
if (!currentTokens.refreshToken) throw new Error("No refresh token available.");
|
8
8
|
const response = await axios.post(
|
9
|
-
`${config.baseURL}/auth/refresh`,
|
9
|
+
`${config.baseURL}${config.pathRefreshToken || "/auth/refresh"}`,
|
10
10
|
{ refresh_token: currentTokens.refreshToken },
|
11
11
|
{ withCredentials: config.withCredentials }
|
12
12
|
);
|