fina-react-ds 1.0.23 → 1.0.24

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,7 +1,7 @@
1
1
  /**
2
2
  * Makes a HTTP request to the API.
3
3
  * @param {"GET" | "POST" | "PUT" | "PATCH" | "DELETE"} method - The HTTP method
4
- * @param {string} route - The route to call (do not include any prefixes, host or port)
4
+ * @param {string} url - The url to call
5
5
  * @param {Object} queryParams - The query params to add to the URL
6
6
  * @param {(FormData | Object)} body - The request's body
7
7
  * @param {Object} headers - Additional headers to include in the request
@@ -9,5 +9,5 @@
9
9
  * @returns {Promise<Object>} The response from the API.
10
10
  * @throws {ApiClientError} If the request fails, an error object with the status code, raw response, and a message is returned.
11
11
  */
12
- declare const requestApi: (method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", route: string, queryParams?: object | null, body?: FormData | object | null, headers?: object | null, isMultipart?: boolean) => Promise<any>;
12
+ declare const requestApi: (method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, queryParams?: object | null, body?: FormData | object | null, headers?: object | null, isMultipart?: boolean) => Promise<any>;
13
13
  export { requestApi };
package/dist/lib/http.js CHANGED
@@ -1,8 +1,7 @@
1
1
  var p = Object.defineProperty;
2
2
  var s = (t, r) => p(t, "name", { value: r, configurable: !0 });
3
3
  import m from "qs";
4
- import { joinURL as j } from "ufo";
5
- const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ */ s((t, r) => {
4
+ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), j = /* @__PURE__ */ s((t, r) => {
6
5
  if (t) {
7
6
  if (t instanceof FormData)
8
7
  return t;
@@ -21,9 +20,9 @@ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ *
21
20
  return JSON.stringify(t);
22
21
  }
23
22
  }, "formatBodyForRequest"), g = /* @__PURE__ */ s((t, r = null) => {
24
- let e = j(void 0, t);
23
+ let e = t;
25
24
  return r && (e += `?${m.stringify(r, { encode: !1 })}`), e;
26
- }, "formatUrlForRequest"), A = /* @__PURE__ */ s(async (t, r, e = null, a = null, n = null, o = !1) => {
25
+ }, "formatUrlForRequest"), v = /* @__PURE__ */ s(async (t, r, e = null, a = null, n = null, o = !1) => {
27
26
  const u = new Headers({
28
27
  Accept: "application/json",
29
28
  ...n
@@ -32,7 +31,7 @@ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ *
32
31
  const c = {
33
32
  method: t,
34
33
  headers: u,
35
- body: d(a, o)
34
+ body: j(a, o)
36
35
  };
37
36
  let i = null;
38
37
  const l = await fetch(
@@ -55,5 +54,5 @@ const h = /* @__PURE__ */ s((t) => t != null, "valueExists"), d = /* @__PURE__ *
55
54
  });
56
55
  }, "handleResponse");
57
56
  export {
58
- A as requestApi
57
+ v as requestApi
59
58
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://github.com/F1na/fina-react-ds"
6
6
  },
7
7
  "private": false,
8
- "version": "1.0.23",
8
+ "version": "1.0.24",
9
9
  "type": "module",
10
10
  "files": [
11
11
  "dist"
@@ -37,7 +37,6 @@
37
37
  "sonner": "^2.0.5",
38
38
  "tailwind-merge": "^3.3.1",
39
39
  "tw-animate-css": "^1.3.5",
40
- "ufo": "^1.6.1",
41
40
  "yup": "^1.6.1"
42
41
  },
43
42
  "devDependencies": {