@obb871001/api-integration-sdk 1.0.21 → 1.0.23

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 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}]});console.log(c());const{data:R,isFetching:E,error:_}=v[0]||{};return{data:R,isFetching:E,error:_}};var V={exports:{}},$={};/**
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}]});console.log(v);const{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 Te } from "react";
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]), w = I(async () => {
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: w,
37
+ userFavoriteGameApi: T,
38
38
  userCurrencyExchangeApi: E
39
39
  };
40
40
  }, Sr = () => {
@@ -42,12 +42,12 @@ 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
49
  });
50
- console.log(c());
50
+ console.log(v);
51
51
  const { data: R, isFetching: b, error: E } = v[0] || {};
52
52
  return { data: R, isFetching: b, error: E };
53
53
  };
@@ -61,17 +61,17 @@ var q = { exports: {} }, $ = {};
61
61
  * This source code is licensed under the MIT license found in the
62
62
  * LICENSE file in the root directory of this source tree.
63
63
  */
64
- var we;
64
+ var Te;
65
65
  function Rr() {
66
- if (we) return $;
67
- we = 1;
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, w = { key: !0, ref: !0, __self: !0, __source: !0 };
66
+ if (Te) return $;
67
+ Te = 1;
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, T = { key: !0, ref: !0, __self: !0, __source: !0 };
69
69
  function d(p, o, C) {
70
- var y, T = {}, P = null, Y = null;
70
+ var y, w = {}, P = null, Y = null;
71
71
  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) && !w.hasOwnProperty(y) && (T[y] = o[y]);
73
- if (p && p.defaultProps) for (y in o = p.defaultProps, o) T[y] === void 0 && (T[y] = o[y]);
74
- return { $$typeof: v, type: p, key: P, ref: Y, props: T, _owner: E.current };
72
+ for (y in o) b.call(o, y) && !T.hasOwnProperty(y) && (w[y] = o[y]);
73
+ if (p && p.defaultProps) for (y in o = p.defaultProps, o) w[y] === void 0 && (w[y] = o[y]);
74
+ return { $$typeof: v, type: p, key: P, ref: Y, props: w, _owner: E.current };
75
75
  }
76
76
  return $.Fragment = R, $.jsx = d, $.jsxs = d, $;
77
77
  }
@@ -88,7 +88,7 @@ var W = {};
88
88
  var Oe;
89
89
  function Cr() {
90
90
  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"), w = 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"), T = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), H = Symbol.iterator, ke = "@@iterator";
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"), 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
92
  function Ae(e) {
93
93
  if (e === null || typeof e != "object")
94
94
  return null;
@@ -116,7 +116,7 @@ function Cr() {
116
116
  var De = !1, Ie = !1, $e = !1, We = !1, Ye = !1, Z;
117
117
  Z = Symbol.for("react.module.reference");
118
118
  function Le(e) {
119
- return !!(typeof e == "string" || typeof e == "function" || e === b || e === w || Ye || e === E || e === C || e === y || We || e === Y || De || Ie || $e || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === T || e.$$typeof === d || e.$$typeof === p || e.$$typeof === o || // This needs to include all possible module reference object
119
+ 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
120
  // types supported by any Flight configuration anywhere since
121
121
  // we don't know which Flight build this will end up being used
122
122
  // with.
@@ -144,7 +144,7 @@ function Cr() {
144
144
  return "Fragment";
145
145
  case R:
146
146
  return "Portal";
147
- case w:
147
+ case T:
148
148
  return "Profiler";
149
149
  case E:
150
150
  return "StrictMode";
@@ -163,7 +163,7 @@ function Cr() {
163
163
  return ee(t._context) + ".Provider";
164
164
  case o:
165
165
  return Me(e, e.render, "ForwardRef");
166
- case T:
166
+ case w:
167
167
  var n = e.displayName || null;
168
168
  return n !== null ? n : O(e.type) || "Memo";
169
169
  case P: {
@@ -353,7 +353,7 @@ function Cr() {
353
353
  switch (e.$$typeof) {
354
354
  case o:
355
355
  return Ne(e.render);
356
- case T:
356
+ case w:
357
357
  return U(e.type, r, t);
358
358
  case P: {
359
359
  var n = e, u = n._payload, s = n._init;
@@ -593,7 +593,7 @@ Check the top-level render call using <` + t + ">.");
593
593
  t = r.propTypes;
594
594
  else if (typeof r == "object" && (r.$$typeof === o || // Note: Memo only checks outer props here.
595
595
  // Inner props are checked in the reconciler.
596
- r.$$typeof === T))
596
+ r.$$typeof === w))
597
597
  t = r.propTypes;
598
598
  else
599
599
  return;
@@ -676,17 +676,17 @@ React keys must be passed directly to JSX without using spread:
676
676
  })()), W;
677
677
  }
678
678
  var Pe;
679
- function Tr() {
679
+ function wr() {
680
680
  return Pe || (Pe = 1, process.env.NODE_ENV === "production" ? q.exports = Rr() : q.exports = Cr()), q.exports;
681
681
  }
682
- var xe = Tr();
683
- function wr({
682
+ var xe = wr();
683
+ function Tr({
684
684
  baseURL: c,
685
685
  getToken: v,
686
686
  timeoutMs: R = 15e3,
687
687
  axiosInstance: b,
688
688
  currency: E,
689
- lng: w,
689
+ lng: T,
690
690
  onError: d
691
691
  } = {}) {
692
692
  const p = b ?? br.create({
@@ -701,14 +701,14 @@ function wr({
701
701
  }
702
702
  return o;
703
703
  }), p.interceptors.request.use((o) => {
704
- o.headers.Currency = E, o.headers["currency-code"] = E, o.headers.lang = w;
704
+ o.headers.Currency = E, o.headers["currency-code"] = E, o.headers.lang = T;
705
705
  }), p.interceptors.response.use(
706
706
  (o) => o,
707
707
  (o) => d ? d(o, { instance: p }) : Promise.reject(o)
708
708
  ), p;
709
709
  }
710
710
  function jr({ children: c, ...v }) {
711
- const R = Te(() => wr(v), [v]), E = Te(
711
+ const R = we(() => Tr(v), [v]), E = we(
712
712
  () => new yr({
713
713
  defaultOptions: {
714
714
  queries: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@obb871001/api-integration-sdk",
3
3
  "private": false,
4
- "version": "1.0.21",
4
+ "version": "1.0.23",
5
5
  "description": "集成API",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",