@obb871001/api-integration-sdk 1.0.19 → 1.0.20
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 +7 -7
- package/dist/index.js +42 -42
- 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"),
|
|
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]),m=T.useCallback(async()=>{const{data:d}=await c.get("/getMemberInfo");return d},[c]),b=T.useCallback(async()=>{const{data:d}=await c.get("/getGameList");return d},[c]),R=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:m,userGameListApi:b,userFavoriteGameApi:P,userCurrencyExchangeApi:R}},hr=()=>{const{userInfoApi:c}=yr(),v=H.useQueries({queries:[{queryKey:["getMemberInfo"],queryFn:c,refetchInterval:5e4}]}),{data:m,isFetching:b,error:R}=v[0]||{};return{data:m,isFetching:b,error:R}};var V={exports:{}},$={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Pe;function gr(){if(Pe)return $;Pe=1;var c=
|
|
9
|
+
*/var Pe;function gr(){if(Pe)return $;Pe=1;var c=T,v=Symbol.for("react.element"),m=Symbol.for("react.fragment"),b=Object.prototype.hasOwnProperty,R=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function d(p,o,C){var y,w={},x=null,Y=null;C!==void 0&&(x=""+C),o.key!==void 0&&(x=""+o.key),o.ref!==void 0&&(Y=o.ref);for(y in o)b.call(o,y)&&!P.hasOwnProperty(y)&&(w[y]=o[y]);if(p&&p.defaultProps)for(y in o=p.defaultProps,o)w[y]===void 0&&(w[y]=o[y]);return{$$typeof:v,type:p,key:x,ref:Y,props:w,_owner:R.current}}return $.Fragment=m,$.jsx=d,$.jsxs=d,$}var W={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Oe;function br(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&(function(){var c=
|
|
18
|
-
`+J+e}}var B=!1,q;{var Ve=typeof WeakMap=="function"?WeakMap:Map;q=new Ve}function fe(e,r){if(!e||B)return"";{var t=q.get(e);if(t!==void 0)return t}var n;B=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=N.current,N.current=null,Me();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(
|
|
17
|
+
*/var Oe;function br(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&(function(){var c=T,v=Symbol.for("react.element"),m=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),P=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"),x=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),ee=Symbol.iterator,ke="@@iterator";function Ae(e){if(e===null||typeof e!="object")return null;var r=ee&&e[ee]||e[ke];return typeof r=="function"?r:null}var k=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Fe("error",e,t)}}function Fe(e,r,t){{var n=k.ReactDebugCurrentFrame,u=n.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var De=!1,Ie=!1,$e=!1,We=!1,Ye=!1,re;re=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===b||e===P||Ye||e===R||e===C||e===y||We||e===Y||De||Ie||$e||typeof e=="object"&&e!==null&&(e.$$typeof===x||e.$$typeof===w||e.$$typeof===d||e.$$typeof===p||e.$$typeof===o||e.$$typeof===re||e.getModuleId!==void 0))}function qe(e,r,t){var n=e.displayName;if(n)return n;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function te(e){return e.displayName||"Context"}function O(e){if(e==null)return null;if(typeof e.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case b:return"Fragment";case m:return"Portal";case P:return"Profiler";case R:return"StrictMode";case C:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p:var r=e;return te(r)+".Consumer";case d:var t=e;return te(t._context)+".Provider";case o:return qe(e,e.render,"ForwardRef");case w:var n=e.displayName||null;return n!==null?n:O(e.type)||"Memo";case x:{var u=e,s=u._payload,i=u._init;try{return O(i(s))}catch{return null}}}return null}var S=Object.assign,D=0,ne,ae,ie,oe,ue,se,ce;function le(){}le.__reactDisabledLog=!0;function Me(){{if(D===0){ne=console.log,ae=console.info,ie=console.warn,oe=console.error,ue=console.group,se=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}}function Ue(){{if(D--,D===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:ne}),info:S({},e,{value:ae}),warn:S({},e,{value:ie}),error:S({},e,{value:oe}),group:S({},e,{value:ue}),groupCollapsed:S({},e,{value:se}),groupEnd:S({},e,{value:ce})})}D<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var N=k.ReactCurrentDispatcher,J;function L(e,r,t){{if(J===void 0)try{throw Error()}catch(u){var n=u.stack.trim().match(/\n( *(at )?)/);J=n&&n[1]||""}return`
|
|
18
|
+
`+J+e}}var B=!1,q;{var Ve=typeof WeakMap=="function"?WeakMap:Map;q=new Ve}function fe(e,r){if(!e||B)return"";{var t=q.get(e);if(t!==void 0)return t}var n;B=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=N.current,N.current=null,Me();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(E){n=E}Reflect.construct(e,[],i)}else{try{i.call()}catch(E){n=E}e.call(i.prototype)}}else{try{throw Error()}catch(E){n=E}e()}}catch(E){if(E&&n&&typeof E.stack=="string"){for(var a=E.stack.split(`
|
|
19
19
|
`),g=n.stack.split(`
|
|
20
20
|
`),l=a.length-1,f=g.length-1;l>=1&&f>=0&&a[l]!==g[f];)f--;for(;l>=1&&f>=0;l--,f--)if(a[l]!==g[f]){if(l!==1||f!==1)do if(l--,f--,f<0||a[l]!==g[f]){var _=`
|
|
21
|
-
`+a[l].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,_),_}while(l>=1&&f>=0);break}}}finally{B=!1,N.current=s,Ue(),Error.prepareStackTrace=u}var F=e?e.displayName||e.name:"",j=F?L(F):"";return typeof e=="function"&&q.set(e,j),j}function Ne(e,r,t){return fe(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function M(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Je(e));if(typeof e=="string")return L(e);switch(e){case
|
|
21
|
+
`+a[l].replace(" at new "," at ");return e.displayName&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,_),_}while(l>=1&&f>=0);break}}}finally{B=!1,N.current=s,Ue(),Error.prepareStackTrace=u}var F=e?e.displayName||e.name:"",j=F?L(F):"";return typeof e=="function"&&q.set(e,j),j}function Ne(e,r,t){return fe(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function M(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Je(e));if(typeof e=="string")return L(e);switch(e){case C:return L("Suspense");case y:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case o:return Ne(e.render);case w:return M(e.type,r,t);case x:{var n=e,u=n._payload,s=n._init;try{return M(s(u),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,de={},ve=k.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);ve.setExtraStackFrame(t)}else ve.setExtraStackFrame(null)}function Be(e,r,t,n,u){{var s=Function.call.bind(I);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var g=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(U(u),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),U(null)),a instanceof Error&&!(a.message in de)&&(de[a.message]=!0,U(u),h("Failed %s type: %s",t,a.message),U(null))}}}var Ge=Array.isArray;function G(e){return Ge(e)}function Ke(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function ze(e){try{return pe(e),!1}catch{return!0}}function pe(e){return""+e}function ye(e){if(ze(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ke(e)),pe(e)}var he=k.ReactCurrentOwner,Xe={key:!0,ref:!0,__self:!0,__source:!0},ge,be;function Qe(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function He(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ze(e,r){typeof e.ref=="string"&&he.current}function er(e,r){{var t=function(){ge||(ge=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){be||(be=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,u,s,i){var a={$$typeof:v,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,u){{var s,i={},a=null,g=null;t!==void 0&&(ye(t),a=""+t),He(r)&&(ye(r.key),a=""+r.key),Qe(r)&&(g=r.ref,Ze(r,u));for(s in r)I.call(r,s)&&!Xe.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)i[s]===void 0&&(i[s]=l[s])}if(a||g){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(i,f),g&&rr(i,f)}return tr(e,a,g,u,n,he.current,i)}}var K=k.ReactCurrentOwner,Ee=k.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var z;z=!1;function X(e){return typeof e=="object"&&e!==null&&e.$$typeof===v}function _e(){{if(K.current){var e=O(K.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function ar(e){return""}var me={};function ir(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(me[t])return;me[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+O(e._owner.type)+"."),A(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Ce(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];X(n)&&Re(n,r)}else if(X(e))e._store&&(e._store.validated=!0);else if(e){var u=Ae(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),i;!(i=s.next()).done;)X(i.value)&&Re(i.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===o||r.$$typeof===w))t=r.propTypes;else return;if(t){var n=O(r);Be(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var u=O(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var Te={};function we(e,r,t,n,u,s){{var i=Le(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var g=ar();g?a+=g:a+=_e();var l;e===null?l="null":G(e)?l="array":e!==void 0&&e.$$typeof===v?(l="<"+(O(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var f=nr(e,r,t,u,s);if(f==null)return f;if(i){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var F=0;F<_.length;F++)Ce(_[F],e);Object.freeze&&Object.freeze(_)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ce(_,e)}if(I.call(r,"key")){var j=O(e),
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Re(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(me[t])return;me[t]=!0;var n="";e&&e._owner&&e._owner!==K.current&&(n=" It was passed a child from "+O(e._owner.type)+"."),A(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Ce(e,r){{if(typeof e!="object")return;if(G(e))for(var t=0;t<e.length;t++){var n=e[t];X(n)&&Re(n,r)}else if(X(e))e._store&&(e._store.validated=!0);else if(e){var u=Ae(e);if(typeof u=="function"&&u!==e.entries)for(var s=u.call(e),i;!(i=s.next()).done;)X(i.value)&&Re(i.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===o||r.$$typeof===w))t=r.propTypes;else return;if(t){var n=O(r);Be(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!z){z=!0;var u=O(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var Te={};function we(e,r,t,n,u,s){{var i=Le(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var g=ar();g?a+=g:a+=_e();var l;e===null?l="null":G(e)?l="array":e!==void 0&&e.$$typeof===v?(l="<"+(O(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var f=nr(e,r,t,u,s);if(f==null)return f;if(i){var _=r.children;if(_!==void 0)if(n)if(G(_)){for(var F=0;F<_.length;F++)Ce(_[F],e);Object.freeze&&Object.freeze(_)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ce(_,e)}if(I.call(r,"key")){var j=O(e),E=Object.keys(r).filter(function(vr){return vr!=="key"}),Q=E.length>0?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}";if(!Te[j+Q]){var dr=E.length>0?"{"+E.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Q,j,dr,j),Te[j+Q]=!0}}return e===
|
|
30
|
+
<%s key={someKey} {...props} />`,Q,j,dr,j),Te[j+Q]=!0}}return e===b?ur(f):or(f),f}}function sr(e,r,t){return we(e,r,t,!0)}function cr(e,r,t){return we(e,r,t,!1)}var lr=cr,fr=sr;W.Fragment=b,W.jsx=lr,W.jsxs=fr})()),W}var xe;function Er(){return xe||(xe=1,process.env.NODE_ENV==="production"?V.exports=gr():V.exports=br()),V.exports}var Se=Er();function _r({baseURL:c,getToken:v,timeoutMs:m=15e3,axiosInstance:b,currency:R,lng:P,onError:d}={}){const p=b??pr.create({baseURL:c,timeout:m,headers:{"Content-Type":"application/json"}});return p.interceptors.request.use(async o=>{if(v){const C=await v();C&&(o.headers=o.headers||{},o.headers.Authorization=`Bearer ${C}`)}return o}),p.interceptors.request.use(o=>{o.headers.Currency=R,o.headers["currency-code"]=R,o.headers.lang=P}),p.interceptors.response.use(o=>o,o=>d?d(o,{instance:p}):Promise.reject(o)),p}function mr({children:c,...v}){const m=T.useMemo(()=>_r(v),[v]),b=new H.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});return Se.jsx(H.QueryClientProvider,{client:b,children:Se.jsx(Z.Provider,{value:{client:m},children:c})})}exports.ApiCtx=Z;exports.ApiProvider=mr;exports.useApiContext=je;exports.usePeriodicDataUpdater=hr;
|
package/dist/index.js
CHANGED
|
@@ -9,10 +9,10 @@ const Se = yr(null), Er = () => {
|
|
|
9
9
|
}, _r = () => {
|
|
10
10
|
const { client: c } = Er(), v = I(
|
|
11
11
|
async (d) => {
|
|
12
|
-
const { mac_address: p = "", app_version: o = "", anydesk_id:
|
|
12
|
+
const { mac_address: p = "", app_version: o = "", anydesk_id: C = "" } = d, { data: h } = await c.post("/cash-register/login", {
|
|
13
13
|
mac_address: p,
|
|
14
14
|
app_version: o,
|
|
15
|
-
anydesk_id:
|
|
15
|
+
anydesk_id: C
|
|
16
16
|
});
|
|
17
17
|
return h;
|
|
18
18
|
},
|
|
@@ -20,10 +20,10 @@ const Se = yr(null), Er = () => {
|
|
|
20
20
|
), _ = I(async () => {
|
|
21
21
|
const { data: d } = await c.get("/getMemberInfo");
|
|
22
22
|
return d;
|
|
23
|
-
}, [c]),
|
|
23
|
+
}, [c]), m = I(async () => {
|
|
24
24
|
const { data: d } = await c.get("/getGameList");
|
|
25
25
|
return d;
|
|
26
|
-
}, [c]),
|
|
26
|
+
}, [c]), R = I(async () => {
|
|
27
27
|
const { data: d } = await c.get("/getNowCurrencyExchange");
|
|
28
28
|
return d;
|
|
29
29
|
}, [c]), w = I(async () => {
|
|
@@ -33,12 +33,12 @@ const Se = yr(null), Er = () => {
|
|
|
33
33
|
return {
|
|
34
34
|
machineLoginApi: v,
|
|
35
35
|
userInfoApi: _,
|
|
36
|
-
userGameListApi:
|
|
36
|
+
userGameListApi: m,
|
|
37
37
|
userFavoriteGameApi: w,
|
|
38
|
-
userCurrencyExchangeApi:
|
|
38
|
+
userCurrencyExchangeApi: R
|
|
39
39
|
};
|
|
40
40
|
}, Sr = () => {
|
|
41
|
-
const { userInfoApi: c } = _r(),
|
|
41
|
+
const { userInfoApi: c } = _r(), v = vr({
|
|
42
42
|
queries: [
|
|
43
43
|
{
|
|
44
44
|
queryKey: ["getMemberInfo"],
|
|
@@ -46,8 +46,8 @@ const Se = yr(null), Er = () => {
|
|
|
46
46
|
refetchInterval: 5e4
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
|
-
});
|
|
50
|
-
return { data:
|
|
49
|
+
}), { data: _, isFetching: m, error: R } = v[0] || {};
|
|
50
|
+
return { data: _, isFetching: m, error: R };
|
|
51
51
|
};
|
|
52
52
|
var V = { exports: {} }, $ = {};
|
|
53
53
|
/**
|
|
@@ -63,13 +63,13 @@ var Te;
|
|
|
63
63
|
function Rr() {
|
|
64
64
|
if (Te) return $;
|
|
65
65
|
Te = 1;
|
|
66
|
-
var c = xe, v = Symbol.for("react.element"), _ = Symbol.for("react.fragment"),
|
|
67
|
-
function d(p, o,
|
|
66
|
+
var c = xe, v = Symbol.for("react.element"), _ = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, R = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, w = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
67
|
+
function d(p, o, C) {
|
|
68
68
|
var h, T = {}, P = null, Y = null;
|
|
69
|
-
|
|
70
|
-
for (h in o)
|
|
69
|
+
C !== void 0 && (P = "" + C), o.key !== void 0 && (P = "" + o.key), o.ref !== void 0 && (Y = o.ref);
|
|
70
|
+
for (h in o) m.call(o, h) && !w.hasOwnProperty(h) && (T[h] = o[h]);
|
|
71
71
|
if (p && p.defaultProps) for (h in o = p.defaultProps, o) T[h] === void 0 && (T[h] = o[h]);
|
|
72
|
-
return { $$typeof: v, type: p, key: P, ref: Y, props: T, _owner:
|
|
72
|
+
return { $$typeof: v, type: p, key: P, ref: Y, props: T, _owner: R.current };
|
|
73
73
|
}
|
|
74
74
|
return $.Fragment = _, $.jsx = d, $.jsxs = d, $;
|
|
75
75
|
}
|
|
@@ -86,7 +86,7 @@ var W = {};
|
|
|
86
86
|
var we;
|
|
87
87
|
function Cr() {
|
|
88
88
|
return we || (we = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
89
|
-
var c = xe, v = Symbol.for("react.element"), _ = Symbol.for("react.portal"),
|
|
89
|
+
var c = xe, v = Symbol.for("react.element"), _ = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), R = 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"), h = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), Q = Symbol.iterator, je = "@@iterator";
|
|
90
90
|
function ke(e) {
|
|
91
91
|
if (e === null || typeof e != "object")
|
|
92
92
|
return null;
|
|
@@ -114,7 +114,7 @@ function Cr() {
|
|
|
114
114
|
var Fe = !1, De = !1, Ie = !1, $e = !1, We = !1, Z;
|
|
115
115
|
Z = Symbol.for("react.module.reference");
|
|
116
116
|
function Ye(e) {
|
|
117
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
117
|
+
return !!(typeof e == "string" || typeof e == "function" || e === m || e === w || We || e === R || e === C || e === h || $e || e === Y || Fe || De || Ie || 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
|
|
118
118
|
// types supported by any Flight configuration anywhere since
|
|
119
119
|
// we don't know which Flight build this will end up being used
|
|
120
120
|
// with.
|
|
@@ -138,15 +138,15 @@ function Cr() {
|
|
|
138
138
|
if (typeof e == "string")
|
|
139
139
|
return e;
|
|
140
140
|
switch (e) {
|
|
141
|
-
case
|
|
141
|
+
case m:
|
|
142
142
|
return "Fragment";
|
|
143
143
|
case _:
|
|
144
144
|
return "Portal";
|
|
145
145
|
case w:
|
|
146
146
|
return "Profiler";
|
|
147
|
-
case C:
|
|
148
|
-
return "StrictMode";
|
|
149
147
|
case R:
|
|
148
|
+
return "StrictMode";
|
|
149
|
+
case C:
|
|
150
150
|
return "Suspense";
|
|
151
151
|
case h:
|
|
152
152
|
return "SuspenseList";
|
|
@@ -282,29 +282,29 @@ function Cr() {
|
|
|
282
282
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
283
283
|
try {
|
|
284
284
|
Reflect.construct(i, []);
|
|
285
|
-
} catch (
|
|
286
|
-
n =
|
|
285
|
+
} catch (b) {
|
|
286
|
+
n = b;
|
|
287
287
|
}
|
|
288
288
|
Reflect.construct(e, [], i);
|
|
289
289
|
} else {
|
|
290
290
|
try {
|
|
291
291
|
i.call();
|
|
292
|
-
} catch (
|
|
293
|
-
n =
|
|
292
|
+
} catch (b) {
|
|
293
|
+
n = b;
|
|
294
294
|
}
|
|
295
295
|
e.call(i.prototype);
|
|
296
296
|
}
|
|
297
297
|
} else {
|
|
298
298
|
try {
|
|
299
299
|
throw Error();
|
|
300
|
-
} catch (
|
|
301
|
-
n =
|
|
300
|
+
} catch (b) {
|
|
301
|
+
n = b;
|
|
302
302
|
}
|
|
303
303
|
e();
|
|
304
304
|
}
|
|
305
|
-
} catch (
|
|
306
|
-
if (
|
|
307
|
-
for (var a =
|
|
305
|
+
} catch (b) {
|
|
306
|
+
if (b && n && typeof b.stack == "string") {
|
|
307
|
+
for (var a = b.stack.split(`
|
|
308
308
|
`), g = n.stack.split(`
|
|
309
309
|
`), l = a.length - 1, f = g.length - 1; l >= 1 && f >= 0 && a[l] !== g[f]; )
|
|
310
310
|
f--;
|
|
@@ -342,7 +342,7 @@ function Cr() {
|
|
|
342
342
|
if (typeof e == "string")
|
|
343
343
|
return L(e);
|
|
344
344
|
switch (e) {
|
|
345
|
-
case
|
|
345
|
+
case C:
|
|
346
346
|
return L("Suspense");
|
|
347
347
|
case h:
|
|
348
348
|
return L("SuspenseList");
|
|
@@ -647,11 +647,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
647
647
|
_e(E, e);
|
|
648
648
|
}
|
|
649
649
|
if (D.call(r, "key")) {
|
|
650
|
-
var S = O(e),
|
|
650
|
+
var S = O(e), b = Object.keys(r).filter(function(dr) {
|
|
651
651
|
return dr !== "key";
|
|
652
|
-
}), H =
|
|
652
|
+
}), H = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
653
653
|
if (!Re[S + H]) {
|
|
654
|
-
var fr =
|
|
654
|
+
var fr = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
|
|
655
655
|
y(`A props object containing a "key" prop is being spread into JSX:
|
|
656
656
|
let props = %s;
|
|
657
657
|
<%s {...props} />
|
|
@@ -660,7 +660,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
660
660
|
<%s key={someKey} {...props} />`, H, S, fr, S), Re[S + H] = !0;
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
return e ===
|
|
663
|
+
return e === m ? or(f) : ir(f), f;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
function ur(e, r, t) {
|
|
@@ -670,7 +670,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
670
670
|
return Ce(e, r, t, !1);
|
|
671
671
|
}
|
|
672
672
|
var cr = sr, lr = ur;
|
|
673
|
-
W.Fragment =
|
|
673
|
+
W.Fragment = m, W.jsx = cr, W.jsxs = lr;
|
|
674
674
|
})()), W;
|
|
675
675
|
}
|
|
676
676
|
var Oe;
|
|
@@ -682,38 +682,38 @@ function wr({
|
|
|
682
682
|
baseURL: c,
|
|
683
683
|
getToken: v,
|
|
684
684
|
timeoutMs: _ = 15e3,
|
|
685
|
-
axiosInstance:
|
|
686
|
-
currency:
|
|
685
|
+
axiosInstance: m,
|
|
686
|
+
currency: R,
|
|
687
687
|
lng: w,
|
|
688
688
|
onError: d
|
|
689
689
|
} = {}) {
|
|
690
|
-
const p =
|
|
690
|
+
const p = m ?? br.create({
|
|
691
691
|
baseURL: c,
|
|
692
692
|
timeout: _,
|
|
693
693
|
headers: { "Content-Type": "application/json" }
|
|
694
694
|
});
|
|
695
695
|
return p.interceptors.request.use(async (o) => {
|
|
696
696
|
if (v) {
|
|
697
|
-
const
|
|
698
|
-
|
|
697
|
+
const C = await v();
|
|
698
|
+
C && (o.headers = o.headers || {}, o.headers.Authorization = `Bearer ${C}`);
|
|
699
699
|
}
|
|
700
700
|
return o;
|
|
701
701
|
}), p.interceptors.request.use((o) => {
|
|
702
|
-
o.headers.Currency =
|
|
702
|
+
o.headers.Currency = R, o.headers["currency-code"] = R, o.headers.lang = w;
|
|
703
703
|
}), p.interceptors.response.use(
|
|
704
704
|
(o) => o,
|
|
705
705
|
(o) => d ? d(o, { instance: p }) : Promise.reject(o)
|
|
706
706
|
), p;
|
|
707
707
|
}
|
|
708
708
|
function jr({ children: c, ...v }) {
|
|
709
|
-
const _ = mr(() => wr(v), [v]),
|
|
709
|
+
const _ = mr(() => wr(v), [v]), m = new pr({
|
|
710
710
|
defaultOptions: {
|
|
711
711
|
queries: {
|
|
712
712
|
refetchOnWindowFocus: !1
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
715
|
});
|
|
716
|
-
return /* @__PURE__ */ Pe.jsx(hr, { client:
|
|
716
|
+
return /* @__PURE__ */ Pe.jsx(hr, { client: m, children: /* @__PURE__ */ Pe.jsx(Se.Provider, { value: { client: _ }, children: c }) });
|
|
717
717
|
}
|
|
718
718
|
export {
|
|
719
719
|
Se as ApiCtx,
|