@odynn/awayz-core 0.2.3 → 0.2.4
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/{AccountService-BfXbgViU.js → AccountService-CbMoOJMJ.js} +1175 -1144
- package/dist/components/CashValue/CashValue.js +1 -1
- package/dist/configs/endpoints.js +1 -1
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +1 -1
- package/dist/lib/configs/endpoints.d.ts +2 -1
- package/dist/lib/services/account/AccountService.d.ts +11 -2
- package/dist/lib/types/EAuthFlow.d.ts +1 -0
- package/dist/lib/types/auth.d.ts +1 -0
- package/dist/main.js +1 -1
- package/dist/providers/AwayzProvider.js +14 -14
- package/dist/services/account/AccountService.js +1 -1
- package/dist/services/currency/CurrencyService.js +1 -1
- package/dist/services/instance.js +4 -3
- package/dist/types/EAuthFlow.js +2 -2
- package/package.json +1 -1
|
@@ -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, b as JO } from "../../AccountService-
|
|
4
|
+
import { g as ZO, b as JO } from "../../AccountService-CbMoOJMJ.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,4 +1,4 @@
|
|
|
1
|
-
var r = /* @__PURE__ */ ((e) => (e.SIGN_IN = "auth/user-login", e.SIGN_UP = "auth/sign-up", e.ME = "user", e.RESEND_VERIFICATION_EMAIL = "auth/resend-verification-email", e.UPDATE_USER_DETAILS = "account/update/user", e.CONFIRM_EMAIL = "account/verifyAccount", e.FORGOT_PASSWORD = "email/sendVeri", e.RESEND_OTP = "email/sendForgotPasswordVerification", e.RESET_PASSWORD = "account/updateUserPassword", e.REQUEST_LIMIT = "user/request-limit", e.APPLE_SOCIAL_SIGN_UP = "tp/apple/get/user", e.GOOGLE_SOCIAL_SIGN_UP = "tp/google/get/user", e.UPDATE_USER = "account/details/addUserDetails", e.ACKNOWLEDGEMENT = "account/update/userAcknowledgement", e.REGIONS = "user/region", e.UPDATE_USER_REGION = "/account/update/userRegion", e.UPDATE_PASSENGER_DETAILS = "/account/awayz", e.EXCHANGE_TOKEN = "user/exchange-token", e.
|
|
1
|
+
var r = /* @__PURE__ */ ((e) => (e.SIGN_IN = "auth/user-login", e.SIGN_UP = "auth/sign-up", e.ME = "user", e.RESEND_VERIFICATION_EMAIL = "auth/resend-verification-email", e.UPDATE_USER_DETAILS = "account/update/user", e.CONFIRM_EMAIL = "account/verifyAccount", e.FORGOT_PASSWORD = "email/sendVeri", e.RESEND_OTP = "email/sendForgotPasswordVerification", e.RESET_PASSWORD = "account/updateUserPassword", e.REQUEST_LIMIT = "user/request-limit", e.APPLE_SOCIAL_SIGN_UP = "tp/apple/get/user", e.GOOGLE_SOCIAL_SIGN_UP = "tp/google/get/user", e.UPDATE_USER = "account/details/addUserDetails", e.ACKNOWLEDGEMENT = "account/update/userAcknowledgement", e.REGIONS = "user/region", e.UPDATE_USER_REGION = "/account/update/userRegion", e.UPDATE_PASSENGER_DETAILS = "/account/awayz", e.REFRESH_TOKEN = "auth/refresh-token", e.EXCHANGE_TOKEN = "user/exchange-token", e.REFRESH_EMBED_TOKEN = "user/refresh-token", e.OAUTH_INITIATE = "user/oauth2/initiate", e.OAUTH_CALLBACK = "user/oauth2/callback", e))(r || {}), a = /* @__PURE__ */ ((e) => (e.CURRENCY_CONVERSION = "currency/convert", e))(a || {});
|
|
2
2
|
export {
|
|
3
3
|
r as EAuthEndpoints,
|
|
4
4
|
a as ECurrencyEndpoints
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as N, E as r, a as u, b as F } from "../../AccountService-
|
|
1
|
+
import { A as N, E as r, a as u, b as F } from "../../AccountService-CbMoOJMJ.js";
|
|
2
2
|
import { useState as m, useCallback as x, useEffect as w } from "react";
|
|
3
3
|
import { EAuthFlow as k } from "../../types/EAuthFlow.js";
|
|
4
4
|
import { awayzClient as U } from "../../configs/awayzClient.js";
|
|
@@ -16,8 +16,9 @@ export declare enum EAuthEndpoints {
|
|
|
16
16
|
REGIONS = "user/region",
|
|
17
17
|
UPDATE_USER_REGION = "/account/update/userRegion",
|
|
18
18
|
UPDATE_PASSENGER_DETAILS = "/account/awayz",
|
|
19
|
+
REFRESH_TOKEN = "auth/refresh-token",
|
|
19
20
|
EXCHANGE_TOKEN = "user/exchange-token",
|
|
20
|
-
|
|
21
|
+
REFRESH_EMBED_TOKEN = "user/refresh-token",
|
|
21
22
|
OAUTH_INITIATE = "user/oauth2/initiate",
|
|
22
23
|
OAUTH_CALLBACK = "user/oauth2/callback"
|
|
23
24
|
}
|
|
@@ -58,15 +58,24 @@ declare class _AccountService {
|
|
|
58
58
|
*/
|
|
59
59
|
checkUser: () => Promise<TServiceResponse<IUser>>;
|
|
60
60
|
/**
|
|
61
|
-
* @description In the case of a 401 error, the refresh token is used to get a new access token and user details
|
|
61
|
+
* @description In the case of a 401 error, the refresh token is used to get a new access token and user details, by exchanging the
|
|
62
|
+
* refresh token for a new id_token and in turn exchanging that for a new awayz token
|
|
62
63
|
*
|
|
63
64
|
* @param refreshToken - The refresh token
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
+
refreshEmbedToken: (refreshToken: string) => Promise<TServiceResponse<{
|
|
66
67
|
user: IUser;
|
|
67
68
|
token: string;
|
|
68
69
|
id_token: string;
|
|
69
70
|
}>>;
|
|
71
|
+
/**
|
|
72
|
+
* @description In the case of a 401 error, the refresh token is used to get a new access token and user details
|
|
73
|
+
*
|
|
74
|
+
* @param refreshToken - The refresh token
|
|
75
|
+
*/
|
|
76
|
+
refreshToken: (refreshToken: string) => Promise<TServiceResponse<{
|
|
77
|
+
token: string;
|
|
78
|
+
}>>;
|
|
70
79
|
/**
|
|
71
80
|
* Retrieves the request limit for the authenticated user.
|
|
72
81
|
*
|
package/dist/lib/types/auth.d.ts
CHANGED
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AwayzProvider as r } from "./providers/AwayzProvider.js";
|
|
2
2
|
import { useAwayzContext as a } from "./hooks/useAwayzContext.js";
|
|
3
3
|
import { EAuthFlow as n } from "./types/EAuthFlow.js";
|
|
4
|
-
import { c as s, i as x } from "./AccountService-
|
|
4
|
+
import { c as s, i as x } from "./AccountService-CbMoOJMJ.js";
|
|
5
5
|
import { awayzClient as m } from "./configs/awayzClient.js";
|
|
6
6
|
import { CashValue as c, EToolTipPosition as w } from "./components/CashValue/CashValue.js";
|
|
7
7
|
import { getBaseUrl as y } from "./configs/baseUrl.js";
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } 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
|
|
5
|
-
import { useAwayzAuth as
|
|
6
|
-
import { setBaseUrl as
|
|
4
|
+
import { E as e } from "../AccountService-CbMoOJMJ.js";
|
|
5
|
+
import { useAwayzAuth as l } from "../hooks/useAwayzAuth/useAwayzAuth.js";
|
|
6
|
+
import { setBaseUrl as s } from "../configs/baseUrl.js";
|
|
7
7
|
import { QueryClientProvider as u } from "@tanstack/react-query";
|
|
8
8
|
import { awayzClient as d } from "../configs/awayzClient.js";
|
|
9
9
|
import '../assets/_styles.css';/* empty css */
|
|
10
10
|
import { defaultAwayzConfig as n } from "../configs/defaultAwayzConfig.js";
|
|
11
|
-
const C = ({ children:
|
|
12
|
-
const
|
|
13
|
-
authFlow:
|
|
11
|
+
const C = ({ children: o, config: t }) => {
|
|
12
|
+
const a = l({
|
|
13
|
+
authFlow: t.authFlow,
|
|
14
14
|
onSuccess: () => {
|
|
15
15
|
},
|
|
16
|
-
trustedOrigins:
|
|
16
|
+
trustedOrigins: t.trustedOrigins
|
|
17
17
|
});
|
|
18
18
|
return i(() => {
|
|
19
|
-
if (!
|
|
19
|
+
if (!t.clientId) {
|
|
20
20
|
console.error("You need to provide a client ID to the AwayzProvider");
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
localStorage.setItem(
|
|
24
|
-
}, [
|
|
23
|
+
localStorage.setItem(e.CLIENT_ID, t.clientId), localStorage.setItem(e.AUTH_FLOW, t.authFlow), s(t.testMode ?? !1);
|
|
24
|
+
}, [t]), /* @__PURE__ */ r(u, { client: d, children: /* @__PURE__ */ r(
|
|
25
25
|
m.Provider,
|
|
26
26
|
{
|
|
27
27
|
value: {
|
|
28
|
-
...
|
|
28
|
+
...a,
|
|
29
29
|
config: {
|
|
30
30
|
...n,
|
|
31
|
-
...
|
|
31
|
+
...t
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
children:
|
|
34
|
+
children: o
|
|
35
35
|
}
|
|
36
36
|
) });
|
|
37
37
|
};
|
|
@@ -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, b as y, c as p } from "../../AccountService-
|
|
4
|
+
import { a as u, b as y, c as p } from "../../AccountService-CbMoOJMJ.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { ECurrencyEndpoints as m } from "../../configs/endpoints.js";
|
|
7
7
|
import "react/jsx-runtime";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as p, i as a } from "../AccountService-CbMoOJMJ.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../configs/endpoints.js";
|
|
4
4
|
import "../configs/baseUrl.js";
|
|
5
|
+
import "../types/EAuthFlow.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
p as clientInstance,
|
|
8
|
+
a as instance
|
|
8
9
|
};
|
package/dist/types/EAuthFlow.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a = /* @__PURE__ */ ((r) => (r.STANDARD = "standard", r.POST_MESSAGE = "postMessage", r.OAUTH = "oauth", r.QUERY = "query", r))(a || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
a as EAuthFlow
|
|
4
4
|
};
|