@sgedda/mockifyer-fetch 1.8.32 → 1.8.34
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/clients/fetch-client.js +21 -94
- package/dist/core-proxy.d.ts +7 -0
- package/dist/core-proxy.js +15 -0
- package/dist/index.d.ts +4 -50
- package/dist/index.js +21 -189
- package/dist/metro-config.js +20 -0
- package/dist/utils/dashboard-redis-health.d.ts +1 -19
- package/dist/utils/dashboard-redis-health.js +4 -47
- package/dist/utils/join-proxy-dashboard-api-url.d.ts +1 -11
- package/dist/utils/join-proxy-dashboard-api-url.js +3 -16
- package/package.json +2 -2
- package/src/clients/fetch-client.ts +21 -136
- package/src/core-proxy.ts +12 -0
- package/src/index.ts +31 -265
- package/src/metro-config.ts +24 -0
- package/src/utils/dashboard-redis-health.ts +5 -58
- package/src/utils/join-proxy-dashboard-api-url.ts +1 -15
- package/tsconfig.json +5 -1
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Builds a full URL to the Mockifyer dashboard HTTP API under a given `proxyBaseUrl`.
|
|
3
|
-
*
|
|
4
|
-
* `proxyBaseUrl` may include a path prefix (e.g. `https://host/apim-prefix/mockifyer/`).
|
|
5
|
-
* Avoid `new URL('/api/...', proxyBaseUrl)` — a leading `/` on the second argument replaces the
|
|
6
|
-
* entire pathname of the base URL, so the gateway prefix is lost.
|
|
7
|
-
*
|
|
8
|
-
* @param proxyBaseUrl - Origin and optional path prefix (with or without trailing slash)
|
|
9
|
-
* @param apiSubPath - Path under that prefix without a leading slash (e.g. `api/health`, `api/proxy`)
|
|
10
|
-
*/
|
|
11
|
-
export function joinProxyDashboardApiUrl(proxyBaseUrl: string, apiSubPath: string): string {
|
|
12
|
-
const normalizedBase = proxyBaseUrl.trim().replace(/\/+$/, '');
|
|
13
|
-
const normalizedPath = apiSubPath.trim().replace(/^\/+/, '');
|
|
14
|
-
return `${normalizedBase}/${normalizedPath}`;
|
|
15
|
-
}
|
|
1
|
+
export { joinProxyDashboardApiUrl } from '@sgedda/mockifyer-core';
|
package/tsconfig.json
CHANGED
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
"skipLibCheck": true,
|
|
12
12
|
"forceConsistentCasingInFileNames": true,
|
|
13
13
|
"resolveJsonModule": true,
|
|
14
|
-
"moduleResolution": "node"
|
|
14
|
+
"moduleResolution": "node",
|
|
15
|
+
"baseUrl": ".",
|
|
16
|
+
"paths": {
|
|
17
|
+
"@sgedda/mockifyer-core/utils/*": ["../mockifyer-core/dist/utils/*"]
|
|
18
|
+
}
|
|
15
19
|
},
|
|
16
20
|
"include": ["src/**/*"],
|
|
17
21
|
"exclude": ["node_modules", "dist"]
|