@readyfor/api-client-base 1.75.0-pr1470.8f97733 → 1.75.0-pr1471.32551ce

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
@@ -142,13 +142,10 @@ const createVoidFetcher = (customRequestInit = {}, options = {}) => (input, requ
142
142
  });
143
143
  //#endregion
144
144
  //#region src/requestUrl.ts
145
- function __internal__requestUrl(...args) {
145
+ const __internal__requestUrl = (rawPath, { path: pathParams = {}, query } = {}) => {
146
146
  const config = store.getState();
147
- const rawPath = args[0];
148
- const params = args[1] || {};
149
- const query = args[2];
150
- const path = (config.hostName ? typeof config.hostName === "string" ? config.hostName : config.hostName(rawPath) : "") + Object.entries(params).reduce((path, [key, value]) => path.replace(`{${key}}`, String(value)), rawPath);
147
+ const path = (config.hostName ? typeof config.hostName === "string" ? config.hostName : config.hostName(rawPath) : "") + Object.entries(pathParams).reduce((path, [key, value]) => path.replace(`{${key}}`, String(value)), rawPath);
151
148
  return query ? `${path}?${qs.stringify(query)}` : path;
152
- }
149
+ };
153
150
  //#endregion
154
151
  export { HTTPError, __internal__requestUrl, buildRequestInitWithDefaultConfig, createBlobFetcher, createFileOrBlobFetcher, createJsonFetcher, createStore, createTextFetcher, createVoidFetcher, errorStatusCode, errorTitle, getErrorStatus, getHttpErrorBody, getHttpErrorBodyReason, isHttpErrorWithStatus, isZodError, mergeHeadersInit, mergeRequestInit, schemaForType, setApiClientConfig, store, toHeadersInit };
@@ -1,4 +1,10 @@
1
1
  //#region src/requestUrl.d.ts
2
- declare function __internal__requestUrl(...args: any[]): string;
2
+ type PathParams = Record<string, string | number>;
3
+ type QueryParams = Record<string, unknown>;
4
+ type UrlArgs = {
5
+ path?: PathParams;
6
+ query?: QueryParams;
7
+ };
8
+ declare const __internal__requestUrl: (rawPath: string, { path: pathParams, query }?: UrlArgs) => string;
3
9
  //#endregion
4
10
  export { __internal__requestUrl };
@@ -4,13 +4,10 @@ const require_apiClientConfigStore = require("./apiClientConfigStore.js");
4
4
  let qs = require("qs");
5
5
  qs = require_runtime.__toESM(qs);
6
6
  //#region src/requestUrl.ts
7
- function __internal__requestUrl(...args) {
7
+ const __internal__requestUrl = (rawPath, { path: pathParams = {}, query } = {}) => {
8
8
  const config = require_apiClientConfigStore.store.getState();
9
- const rawPath = args[0];
10
- const params = args[1] || {};
11
- const query = args[2];
12
- const path = (config.hostName ? typeof config.hostName === "string" ? config.hostName : config.hostName(rawPath) : "") + Object.entries(params).reduce((path, [key, value]) => path.replace(`{${key}}`, String(value)), rawPath);
9
+ const path = (config.hostName ? typeof config.hostName === "string" ? config.hostName : config.hostName(rawPath) : "") + Object.entries(pathParams).reduce((path, [key, value]) => path.replace(`{${key}}`, String(value)), rawPath);
13
10
  return query ? `${path}?${qs.default.stringify(query)}` : path;
14
- }
11
+ };
15
12
  //#endregion
16
13
  exports.__internal__requestUrl = __internal__requestUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readyfor/api-client-base",
3
- "version": "1.75.0-pr1470.8f97733",
3
+ "version": "1.75.0-pr1471.32551ce",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",