@viridial/shared 1.0.4 → 1.0.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.client.d.ts","sourceRoot":"","sources":["../../api/http.client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAsB,KAAK,kBAAkB,EAAsB,MAAM,OAAO,CAAA;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"http.client.d.ts","sourceRoot":"","sources":["../../api/http.client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAsB,KAAK,kBAAkB,EAAsB,MAAM,OAAO,CAAA;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,oBAAoB,CAAA;AAgB/D;;GAEG;AACH,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAe;gBAEjB,OAAO,CAAC,EAAE,MAAM;IAc5B,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,WAAW;IAcb,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASzE,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAStF,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASrF,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IASvF,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAQnF;AAED,eAAO,MAAM,UAAU,YAAmB,CAAA"}
|
package/dist/api/http.client.js
CHANGED
|
@@ -4,15 +4,12 @@ import { tokenUtils } from '../utils/token.utils';
|
|
|
4
4
|
* Get API base URL from environment or use default
|
|
5
5
|
* Note: In the shared package, we use empty string as default
|
|
6
6
|
* The endpoints already include '/api' prefix for Vite proxy
|
|
7
|
+
* The proxy in vite.config.ts redirects /api to VITE_API_BASE_URL
|
|
7
8
|
*/
|
|
8
9
|
const getApiBaseUrl = () => {
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// If baseURL already includes /api, return as is, otherwise add it
|
|
13
|
-
return baseUrl.endsWith('/api') ? baseUrl : `${baseUrl}/api`;
|
|
14
|
-
}
|
|
15
|
-
// Default: empty string (endpoints already include /api prefix)
|
|
10
|
+
// Always use empty string - endpoints already include /api prefix
|
|
11
|
+
// The Vite proxy will handle redirecting /api to the gateway
|
|
12
|
+
// Example: /api/identity/auth/login -> proxy -> http://localhost:8080/api/identity/auth/login
|
|
16
13
|
return '';
|
|
17
14
|
};
|
|
18
15
|
/**
|
|
@@ -28,5 +28,15 @@ export declare const API_ENDPOINTS: {
|
|
|
28
28
|
readonly BY_ID: (id: number) => string;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Get API base URL from environment
|
|
33
|
+
* Note: This constant is not used by httpClient (which uses empty string)
|
|
34
|
+
* It's kept for backward compatibility and documentation purposes
|
|
35
|
+
* The actual routing works as follows:
|
|
36
|
+
* - Frontend requests: /api/identity/auth/login
|
|
37
|
+
* - Vite proxy: redirects /api to VITE_API_BASE_URL (http://localhost:8080)
|
|
38
|
+
* - Final URL: http://localhost:8080/api/identity/auth/login
|
|
39
|
+
* - Gateway routes: /api/identity/** to identity-service:8081
|
|
40
|
+
*/
|
|
41
|
+
export declare const API_BASE_URL = "/api";
|
|
32
42
|
//# sourceMappingURL=api.constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.constants.d.ts","sourceRoot":"","sources":["../../constants/api.constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;6BAcV,MAAM;;;;6BAKN,MAAM;;;;gCAIH,MAAM;;;;6BAKT,MAAM;;CAEZ,CAAA;
|
|
1
|
+
{"version":3,"file":"api.constants.d.ts","sourceRoot":"","sources":["../../constants/api.constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;6BAcV,MAAM;;;;6BAKN,MAAM;;;;gCAIH,MAAM;;;;6BAKT,MAAM;;CAEZ,CAAA;AAEV;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,SAAS,CAAA"}
|
|
@@ -34,15 +34,12 @@ export const API_ENDPOINTS = {
|
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Get API base URL from environment
|
|
37
|
-
* Note:
|
|
38
|
-
*
|
|
37
|
+
* Note: This constant is not used by httpClient (which uses empty string)
|
|
38
|
+
* It's kept for backward compatibility and documentation purposes
|
|
39
|
+
* The actual routing works as follows:
|
|
40
|
+
* - Frontend requests: /api/identity/auth/login
|
|
41
|
+
* - Vite proxy: redirects /api to VITE_API_BASE_URL (http://localhost:8080)
|
|
42
|
+
* - Final URL: http://localhost:8080/api/identity/auth/login
|
|
43
|
+
* - Gateway routes: /api/identity/** to identity-service:8081
|
|
39
44
|
*/
|
|
40
|
-
const
|
|
41
|
-
// Try to get from window (if set by Vite at runtime)
|
|
42
|
-
if (typeof window !== 'undefined' && window.__API_BASE_URL__) {
|
|
43
|
-
return window.__API_BASE_URL__;
|
|
44
|
-
}
|
|
45
|
-
// Default: use proxy path (Vite will proxy /api to the configured backend)
|
|
46
|
-
return '/api';
|
|
47
|
-
};
|
|
48
|
-
export const API_BASE_URL = getApiBaseUrl();
|
|
45
|
+
export const API_BASE_URL = '/api';
|