@obb871001/api-integration-sdk 1.0.21 → 1.0.22
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.cjs +1 -1
- package/dist/index.js +25 -27
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("@tanstack/react-query"),T=require("react"),pr=require("axios"),Z=T.createContext(null),je=()=>{const c=T.useContext(Z);if(!c)throw new Error("useApiContext must be used within ApiProvider");return c},yr=()=>{const{client:c}=je(),v=T.useCallback(async d=>{const{mac_address:p="",app_version:o="",anydesk_id:C=""}=d,{data:y}=await c.post("/cash-register/login",{mac_address:p,app_version:o,anydesk_id:C});return y},[c]),R=T.useCallback(async()=>{const{data:d}=await c.get("/getMemberInfo");return d},[c]),E=T.useCallback(async()=>{const{data:d}=await c.get("/getGameList");return d},[c]),_=T.useCallback(async()=>{const{data:d}=await c.get("/getNowCurrencyExchange");return d},[c]),P=T.useCallback(async()=>{const{data:d}=await c.get("/getFavoriteGame");return d},[c]);return{machineLoginApi:v,userInfoApi:R,userGameListApi:E,userFavoriteGameApi:P,userCurrencyExchangeApi:_}},hr=()=>{const{userInfoApi:c}=yr(),v=H.useQueries({queries:[{queryKey:["getMemberInfo"],queryFn:c,refetchInterval:5e4}]})
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("@tanstack/react-query"),T=require("react"),pr=require("axios"),Z=T.createContext(null),je=()=>{const c=T.useContext(Z);if(!c)throw new Error("useApiContext must be used within ApiProvider");return c},yr=()=>{const{client:c}=je(),v=T.useCallback(async d=>{const{mac_address:p="",app_version:o="",anydesk_id:C=""}=d,{data:y}=await c.post("/cash-register/login",{mac_address:p,app_version:o,anydesk_id:C});return y},[c]),R=T.useCallback(async()=>{const{data:d}=await c.get("/getMemberInfo");return d},[c]),E=T.useCallback(async()=>{const{data:d}=await c.get("/getGameList");return d},[c]),_=T.useCallback(async()=>{const{data:d}=await c.get("/getNowCurrencyExchange");return d},[c]),P=T.useCallback(async()=>{const{data:d}=await c.get("/getFavoriteGame");return d},[c]);return{machineLoginApi:v,userInfoApi:R,userGameListApi:E,userFavoriteGameApi:P,userCurrencyExchangeApi:_}},hr=()=>{const{userInfoApi:c}=yr(),v=H.useQueries({queries:[{queryKey:["getMemberInfo"],queryFn:async()=>await c(),refetchInterval:5e4}]}),{data:R,isFetching:E,error:_}=v[0]||{};return{data:R,isFetching:E,error:_}};var V={exports:{}},$={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useQueries as pr, QueryClient as yr, QueryClientProvider as hr } from "@tanstack/react-query";
|
|
2
|
-
import Se, { createContext as gr, useContext as mr, useCallback as I, useMemo as
|
|
2
|
+
import Se, { createContext as gr, useContext as mr, useCallback as I, useMemo as we } from "react";
|
|
3
3
|
import br from "axios";
|
|
4
4
|
const je = gr(null), Er = () => {
|
|
5
5
|
const c = mr(je);
|
|
@@ -26,7 +26,7 @@ const je = gr(null), Er = () => {
|
|
|
26
26
|
}, [c]), E = I(async () => {
|
|
27
27
|
const { data: d } = await c.get("/getNowCurrencyExchange");
|
|
28
28
|
return d;
|
|
29
|
-
}, [c]),
|
|
29
|
+
}, [c]), T = I(async () => {
|
|
30
30
|
const { data: d } = await c.get("/getFavoriteGame");
|
|
31
31
|
return d;
|
|
32
32
|
}, [c]);
|
|
@@ -34,7 +34,7 @@ const je = gr(null), Er = () => {
|
|
|
34
34
|
machineLoginApi: v,
|
|
35
35
|
userInfoApi: R,
|
|
36
36
|
userGameListApi: b,
|
|
37
|
-
userFavoriteGameApi:
|
|
37
|
+
userFavoriteGameApi: T,
|
|
38
38
|
userCurrencyExchangeApi: E
|
|
39
39
|
};
|
|
40
40
|
}, Sr = () => {
|
|
@@ -42,13 +42,11 @@ const je = gr(null), Er = () => {
|
|
|
42
42
|
queries: [
|
|
43
43
|
{
|
|
44
44
|
queryKey: ["getMemberInfo"],
|
|
45
|
-
queryFn: c,
|
|
45
|
+
queryFn: async () => await c(),
|
|
46
46
|
refetchInterval: 5e4
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
|
-
});
|
|
50
|
-
console.log(c());
|
|
51
|
-
const { data: R, isFetching: b, error: E } = v[0] || {};
|
|
49
|
+
}), { data: R, isFetching: b, error: E } = v[0] || {};
|
|
52
50
|
return { data: R, isFetching: b, error: E };
|
|
53
51
|
};
|
|
54
52
|
var q = { exports: {} }, $ = {};
|
|
@@ -61,17 +59,17 @@ var q = { exports: {} }, $ = {};
|
|
|
61
59
|
* This source code is licensed under the MIT license found in the
|
|
62
60
|
* LICENSE file in the root directory of this source tree.
|
|
63
61
|
*/
|
|
64
|
-
var
|
|
62
|
+
var Te;
|
|
65
63
|
function Rr() {
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
var c = Se, v = Symbol.for("react.element"), R = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, E = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
64
|
+
if (Te) return $;
|
|
65
|
+
Te = 1;
|
|
66
|
+
var c = Se, v = Symbol.for("react.element"), R = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, E = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
69
67
|
function d(p, o, C) {
|
|
70
|
-
var y,
|
|
68
|
+
var y, w = {}, P = null, Y = null;
|
|
71
69
|
C !== void 0 && (P = "" + C), o.key !== void 0 && (P = "" + o.key), o.ref !== void 0 && (Y = o.ref);
|
|
72
|
-
for (y in o) b.call(o, y) && !
|
|
73
|
-
if (p && p.defaultProps) for (y in o = p.defaultProps, o)
|
|
74
|
-
return { $$typeof: v, type: p, key: P, ref: Y, props:
|
|
70
|
+
for (y in o) b.call(o, y) && !T.hasOwnProperty(y) && (w[y] = o[y]);
|
|
71
|
+
if (p && p.defaultProps) for (y in o = p.defaultProps, o) w[y] === void 0 && (w[y] = o[y]);
|
|
72
|
+
return { $$typeof: v, type: p, key: P, ref: Y, props: w, _owner: E.current };
|
|
75
73
|
}
|
|
76
74
|
return $.Fragment = R, $.jsx = d, $.jsxs = d, $;
|
|
77
75
|
}
|
|
@@ -88,7 +86,7 @@ var W = {};
|
|
|
88
86
|
var Oe;
|
|
89
87
|
function Cr() {
|
|
90
88
|
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
91
|
-
var c = Se, v = Symbol.for("react.element"), R = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"),
|
|
89
|
+
var c = Se, v = Symbol.for("react.element"), R = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), p = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), H = Symbol.iterator, ke = "@@iterator";
|
|
92
90
|
function Ae(e) {
|
|
93
91
|
if (e === null || typeof e != "object")
|
|
94
92
|
return null;
|
|
@@ -116,7 +114,7 @@ function Cr() {
|
|
|
116
114
|
var De = !1, Ie = !1, $e = !1, We = !1, Ye = !1, Z;
|
|
117
115
|
Z = Symbol.for("react.module.reference");
|
|
118
116
|
function Le(e) {
|
|
119
|
-
return !!(typeof e == "string" || typeof e == "function" || e === b || e ===
|
|
117
|
+
return !!(typeof e == "string" || typeof e == "function" || e === b || e === T || Ye || e === E || e === C || e === y || We || e === Y || De || Ie || $e || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === w || e.$$typeof === d || e.$$typeof === p || e.$$typeof === o || // This needs to include all possible module reference object
|
|
120
118
|
// types supported by any Flight configuration anywhere since
|
|
121
119
|
// we don't know which Flight build this will end up being used
|
|
122
120
|
// with.
|
|
@@ -144,7 +142,7 @@ function Cr() {
|
|
|
144
142
|
return "Fragment";
|
|
145
143
|
case R:
|
|
146
144
|
return "Portal";
|
|
147
|
-
case
|
|
145
|
+
case T:
|
|
148
146
|
return "Profiler";
|
|
149
147
|
case E:
|
|
150
148
|
return "StrictMode";
|
|
@@ -163,7 +161,7 @@ function Cr() {
|
|
|
163
161
|
return ee(t._context) + ".Provider";
|
|
164
162
|
case o:
|
|
165
163
|
return Me(e, e.render, "ForwardRef");
|
|
166
|
-
case
|
|
164
|
+
case w:
|
|
167
165
|
var n = e.displayName || null;
|
|
168
166
|
return n !== null ? n : O(e.type) || "Memo";
|
|
169
167
|
case P: {
|
|
@@ -353,7 +351,7 @@ function Cr() {
|
|
|
353
351
|
switch (e.$$typeof) {
|
|
354
352
|
case o:
|
|
355
353
|
return Ne(e.render);
|
|
356
|
-
case
|
|
354
|
+
case w:
|
|
357
355
|
return U(e.type, r, t);
|
|
358
356
|
case P: {
|
|
359
357
|
var n = e, u = n._payload, s = n._init;
|
|
@@ -593,7 +591,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
593
591
|
t = r.propTypes;
|
|
594
592
|
else if (typeof r == "object" && (r.$$typeof === o || // Note: Memo only checks outer props here.
|
|
595
593
|
// Inner props are checked in the reconciler.
|
|
596
|
-
r.$$typeof ===
|
|
594
|
+
r.$$typeof === w))
|
|
597
595
|
t = r.propTypes;
|
|
598
596
|
else
|
|
599
597
|
return;
|
|
@@ -676,17 +674,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
676
674
|
})()), W;
|
|
677
675
|
}
|
|
678
676
|
var Pe;
|
|
679
|
-
function
|
|
677
|
+
function wr() {
|
|
680
678
|
return Pe || (Pe = 1, process.env.NODE_ENV === "production" ? q.exports = Rr() : q.exports = Cr()), q.exports;
|
|
681
679
|
}
|
|
682
|
-
var xe =
|
|
683
|
-
function
|
|
680
|
+
var xe = wr();
|
|
681
|
+
function Tr({
|
|
684
682
|
baseURL: c,
|
|
685
683
|
getToken: v,
|
|
686
684
|
timeoutMs: R = 15e3,
|
|
687
685
|
axiosInstance: b,
|
|
688
686
|
currency: E,
|
|
689
|
-
lng:
|
|
687
|
+
lng: T,
|
|
690
688
|
onError: d
|
|
691
689
|
} = {}) {
|
|
692
690
|
const p = b ?? br.create({
|
|
@@ -701,14 +699,14 @@ function wr({
|
|
|
701
699
|
}
|
|
702
700
|
return o;
|
|
703
701
|
}), p.interceptors.request.use((o) => {
|
|
704
|
-
o.headers.Currency = E, o.headers["currency-code"] = E, o.headers.lang =
|
|
702
|
+
o.headers.Currency = E, o.headers["currency-code"] = E, o.headers.lang = T;
|
|
705
703
|
}), p.interceptors.response.use(
|
|
706
704
|
(o) => o,
|
|
707
705
|
(o) => d ? d(o, { instance: p }) : Promise.reject(o)
|
|
708
706
|
), p;
|
|
709
707
|
}
|
|
710
708
|
function jr({ children: c, ...v }) {
|
|
711
|
-
const R =
|
|
709
|
+
const R = we(() => Tr(v), [v]), E = we(
|
|
712
710
|
() => new yr({
|
|
713
711
|
defaultOptions: {
|
|
714
712
|
queries: {
|