@odynn/awayz-core 0.2.15 → 0.2.16

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.
@@ -7710,12 +7710,12 @@ class bA {
7710
7710
  }
7711
7711
  const gM = new bA();
7712
7712
  export {
7713
- gM as A,
7713
+ Zo as A,
7714
7714
  f0 as E,
7715
- e1 as a,
7716
- E0 as b,
7715
+ gM as a,
7716
+ e1 as b,
7717
7717
  Z as c,
7718
- Zo as d,
7718
+ E0 as d,
7719
7719
  nA as g,
7720
7720
  $o as i
7721
7721
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as Fe, Fragment as GO, jsxs as Jo } from "react/jsx-runtime";
2
2
  import * as Q from "react";
3
3
  import Jl, { useLayoutEffect as XO, useEffect as qO, useMemo as KO } from "react";
4
- import { g as ZO, a as JO } from "../../AccountService-Dt2-k7CN.js";
4
+ import { g as ZO, b as JO } from "../../AccountService--d4c37gO.js";
5
5
  import { useQuery as e_ } from "@tanstack/react-query";
6
6
  import { CurrencyService as t_ } from "../../services/currency/CurrencyService.js";
7
7
  import '../../assets/_styles.css';/* empty css */
@@ -1,24 +1,24 @@
1
- import { d as _, E as r, A as o, a as U } from "../../AccountService-Dt2-k7CN.js";
1
+ import { A as _, E as r, a as o, b as U } from "../../AccountService--d4c37gO.js";
2
2
  import { useState as E, useCallback as R, useEffect as y } from "react";
3
3
  import { EAuthFlow as S } from "../../types/EAuthFlow.js";
4
4
  import { awayzClient as H } from "../../configs/awayzClient.js";
5
5
  const M = (s, t) => {
6
- var f, m;
7
- let c = "", d = t;
8
- typeof t == "string" ? c = t : t instanceof _ ? (c = t.message, d = {
6
+ var f, d;
7
+ let c = "", m = t;
8
+ typeof t == "string" ? c = t : t instanceof _ ? (c = t.message, m = {
9
9
  message: t.message,
10
10
  cause: t.cause,
11
11
  status: t.status,
12
12
  data: (f = t == null ? void 0 : t.response) == null ? void 0 : f.data
13
- }) : c = t.message, (m = window.parent) == null || m.postMessage(
13
+ }) : c = t.message, (d = window.parent) == null || d.postMessage(
14
14
  {
15
15
  type: "auth_error",
16
- details: { message: c, action: s, info: d }
16
+ details: { message: c, action: s, info: m }
17
17
  },
18
18
  "*"
19
19
  );
20
20
  }, V = (s) => {
21
- const [t, c] = E(!0), [d, f] = E(!1), [m, T] = E(), [A, k] = E(), [O, I] = E([]), w = R(
21
+ const [t, c] = E(!0), [m, f] = E(!1), [d, T] = E(), [A, k] = E(), [O, I] = E([]), w = R(
22
22
  async (a) => {
23
23
  s != null && s.onSuccess && (s == null || s.onSuccess(a)), s != null && s.onSuccessAsync && await (s == null ? void 0 : s.onSuccessAsync(a)), c(!1), f(!0), T(a.token), k(a.user);
24
24
  },
@@ -135,8 +135,8 @@ const M = (s, t) => {
135
135
  };
136
136
  }, []), {
137
137
  isAuthenticating: t,
138
- isAuthenticated: d,
139
- token: m,
138
+ isAuthenticated: m,
139
+ token: d,
140
140
  user: A,
141
141
  supportedRegions: O,
142
142
  signIn: async (a) => {
@@ -1,13 +1,14 @@
1
- import { a as s, A as a, b as i } from "../AccountService-Dt2-k7CN.js";
2
- import { useQuery as o } from "@tanstack/react-query";
1
+ import { b as o, a as s, d as i } from "../AccountService--d4c37gO.js";
2
+ import { useQuery as n } from "@tanstack/react-query";
3
3
  import "react";
4
- const n = () => {
5
- const { data: r } = o({
6
- queryKey: [s.SEARCH_LIMIT],
4
+ var a = /* @__PURE__ */ ((e) => (e.HOTEL = "Hotel", e.FLIGHT = "Flight", e))(a || {});
5
+ const d = () => {
6
+ const { data: e } = n({
7
+ queryKey: [o.SEARCH_LIMIT],
7
8
  queryFn: async () => {
8
- const { data: t, ...e } = await a.getRequestLimit();
9
- if (!e.success) {
10
- console.error({ reqLimitError: e });
9
+ const { data: t, ...r } = await s.getRequestLimit();
10
+ if (!r.success) {
11
+ console.error({ reqLimitError: r });
11
12
  return;
12
13
  }
13
14
  return i(t);
@@ -15,8 +16,10 @@ const n = () => {
15
16
  staleTime: 3e5
16
17
  // 5 minutes
17
18
  });
18
- return r;
19
+ return e ? [a.FLIGHT, a.HOTEL].map(
20
+ (t) => e.find((r) => r.searchType === t)
21
+ ) : [void 0, void 0];
19
22
  };
20
23
  export {
21
- n as useSearchLimit
24
+ d as useSearchLimit
22
25
  };
@@ -1,5 +1,5 @@
1
1
  import { ISearchLimit } from '../services/account/AccountServices.types';
2
- export declare const useSearchLimit: () => ISearchLimit[] | undefined;
2
+ export declare const useSearchLimit: () => [ISearchLimit, ISearchLimit] | [undefined, undefined];
3
3
  /**
4
4
  * "data": [
5
5
  {
package/dist/main.js CHANGED
@@ -2,7 +2,7 @@ import { AwayzProvider as r } from "./providers/AwayzProvider.js";
2
2
  import { useAwayzContext as a } from "./hooks/useAwayzContext.js";
3
3
  import { useSearchLimit as m } from "./hooks/useSearchLimit.js";
4
4
  import { EAuthFlow as s } from "./types/EAuthFlow.js";
5
- import { c as f, i as n } from "./AccountService-Dt2-k7CN.js";
5
+ import { c as f, i as n } from "./AccountService--d4c37gO.js";
6
6
  import { awayzClient as c } from "./configs/awayzClient.js";
7
7
  import { CashValue as w, EToolTipPosition as h } from "./components/CashValue/CashValue.js";
8
8
  import { getBaseUrl as z } from "./configs/baseUrl.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { useEffect as i } from "react";
3
3
  import { AwayzContext as m } from "../context/AwayzContext.js";
4
- import { E as e } from "../AccountService-Dt2-k7CN.js";
4
+ import { E as e } from "../AccountService--d4c37gO.js";
5
5
  import { useAwayzAuth as s } from "../hooks/useAwayzAuth/useAwayzAuth.js";
6
6
  import { setBaseUrl as l } from "../configs/baseUrl.js";
7
7
  import { QueryClientProvider as u } from "@tanstack/react-query";
@@ -1,4 +1,4 @@
1
- import { A as p } from "../../AccountService-Dt2-k7CN.js";
1
+ import { a as p } from "../../AccountService--d4c37gO.js";
2
2
  import "react";
3
3
  import "../../configs/endpoints.js";
4
4
  import "../../configs/awayzClient.js";
@@ -1,7 +1,7 @@
1
1
  import '../../assets/_styles.css';var s = Object.defineProperty;
2
2
  var i = (t, r, e) => r in t ? s(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
3
  var c = (t, r, e) => i(t, typeof r != "symbol" ? r + "" : r, e);
4
- import { A as u, a as y, c as p } from "../../AccountService-Dt2-k7CN.js";
4
+ import { a as u, b as y, c as p } from "../../AccountService--d4c37gO.js";
5
5
  import "react";
6
6
  import { ECurrencyEndpoints as m } from "../../configs/endpoints.js";
7
7
  import "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { c as p, i as a } from "../AccountService-Dt2-k7CN.js";
1
+ import { c as p, i as a } from "../AccountService--d4c37gO.js";
2
2
  import "react";
3
3
  import "../configs/endpoints.js";
4
4
  import "../configs/baseUrl.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-core",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"