@obb871001/api-integration-sdk 1.0.10 → 1.0.12
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 +4 -4
- package/dist/index.js +36 -34
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tanstack/react-query");const A=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tanstack/react-query");const A=require("react"),re=require("axios"),S=A.createContext(null),te=()=>{const s=A.useContext(S);if(!s)throw new Error("useApiContext must be used within ApiProvider");return s};var T={exports:{}},E={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.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
|
|
9
|
+
*/var D;function ne(){if(D)return E;D=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function f(m,u,l){var d=null;if(l!==void 0&&(d=""+l),u.key!==void 0&&(d=""+u.key),"key"in u){l={};for(var i in u)i!=="key"&&(l[i]=u[i])}else l=u;return u=l.ref,{$$typeof:s,type:m,key:d,ref:u!==void 0?u:null,props:l}}return E.Fragment=c,E.jsx=f,E.jsxs=f,E}var p={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
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
|
|
17
|
+
*/var M;function ae(){return M||(M=1,process.env.NODE_ENV!=="production"&&(function(){function s(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case z:return"Profiler";case W:return"StrictMode";case X:return"Suspense";case B:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case U:return"Portal";case V:return e.displayName||"Context";case J:return(e._context.displayName||"Context")+".Consumer";case G:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return r=e.displayName||null,r!==null?r:s(e.type)||"Memo";case x:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function c(e){return""+e}function f(e){try{c(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),c(e)}}function m(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===x)return"<...>";try{var r=s(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=P.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function d(e){if(N.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function i(e,r){function t(){Y||(Y=!0,console.error("%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://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function o(){var e=s(this.type);return $[e]||($[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function v(e,r,t,n,b,h){var a=t.ref;return e={$$typeof:g,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:o}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:b}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:h}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,r,t,n,b,h){var a=r.children;if(a!==void 0)if(n)if(K(a)){for(n=0;n<a.length;n++)j(a[n]);Object.freeze&&Object.freeze(a)}else console.error("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 j(a);if(N.call(r,"key")){a=s(e);var _=Object.keys(r).filter(function(ee){return ee!=="key"});n=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",q[a+n]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,n,a,_,a),
|
|
22
|
+
<%s key={someKey} {...props} />`,n,a,_,a),q[a+n]=!0)}if(a=null,t!==void 0&&(f(t),a=""+t),d(r)&&(f(r.key),a=""+r.key),"key"in r){t={};for(var y in r)y!=="key"&&(t[y]=r[y])}else t=r;return a&&i(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),v(e,a,t,u(),b,h)}function j(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===x&&(e._payload.status==="fulfilled"?C(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}var R=A,g=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),V=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),P=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,K=Array.isArray,O=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var Y,$={},I=R.react_stack_bottom_frame.bind(R,l)(),F=O(m(l)),q={};p.Fragment=k,p.jsx=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return w(e,r,t,!1,n?Error("react-stack-top-frame"):I,n?O(m(e)):F)},p.jsxs=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return w(e,r,t,!0,n?Error("react-stack-top-frame"):I,n?O(m(e)):F)}})()),p}var L;function oe(){return L||(L=1,process.env.NODE_ENV==="production"?T.exports=ne():T.exports=ae()),T.exports}var se=oe();function ue({baseURL:s,getToken:c,timeoutMs:f=15e3,axiosInstance:m,currency:u,lng:l,onError:d}={}){const i=m??re.create({baseURL:s,timeout:f,headers:{"Content-Type":"application/json"}});return i.interceptors.request.use(async o=>{if(c){const v=await c();v&&(o.headers=o.headers||{},o.headers.Authorization=`Bearer ${v}`)}return o}),i.interceptors.request.use(o=>{o.headers.Currency=u,o.headers["currency-code"]=u,o.headers.lang=l}),i.interceptors.response.use(o=>o,o=>d?d(o,{instance:i}):Promise.reject(o)),i}function le({children:s,...c}){const f=A.useMemo(()=>ue(c),[c]);return se.jsx(S.Provider,{value:{client:f},children:s})}exports.ApiCtx=S;exports.ApiProvider=le;exports.useApiContext=te;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "@tanstack/react-query";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const s =
|
|
6
|
-
if (!s)
|
|
7
|
-
|
|
2
|
+
import ee, { createContext as re, useContext as te, useMemo as ne } from "react";
|
|
3
|
+
import ae from "axios";
|
|
4
|
+
const M = re(null), me = () => {
|
|
5
|
+
const s = te(M);
|
|
6
|
+
if (!s)
|
|
7
|
+
throw new Error("useApiContext must be used within ApiProvider");
|
|
8
|
+
return s;
|
|
8
9
|
};
|
|
9
10
|
var T = { exports: {} }, E = {};
|
|
10
11
|
/**
|
|
@@ -54,36 +55,36 @@ function se() {
|
|
|
54
55
|
function s(e) {
|
|
55
56
|
if (e == null) return null;
|
|
56
57
|
if (typeof e == "function")
|
|
57
|
-
return e.$$typeof ===
|
|
58
|
+
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
58
59
|
if (typeof e == "string") return e;
|
|
59
60
|
switch (e) {
|
|
60
61
|
case A:
|
|
61
62
|
return "Fragment";
|
|
62
|
-
case
|
|
63
|
+
case q:
|
|
63
64
|
return "Profiler";
|
|
64
|
-
case
|
|
65
|
+
case W:
|
|
65
66
|
return "StrictMode";
|
|
66
|
-
case V:
|
|
67
|
-
return "Suspense";
|
|
68
67
|
case G:
|
|
68
|
+
return "Suspense";
|
|
69
|
+
case X:
|
|
69
70
|
return "SuspenseList";
|
|
70
|
-
case
|
|
71
|
+
case H:
|
|
71
72
|
return "Activity";
|
|
72
73
|
}
|
|
73
74
|
if (typeof e == "object")
|
|
74
75
|
switch (typeof e.tag == "number" && console.error(
|
|
75
76
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
76
77
|
), e.$$typeof) {
|
|
77
|
-
case
|
|
78
|
+
case U:
|
|
78
79
|
return "Portal";
|
|
79
|
-
case
|
|
80
|
+
case J:
|
|
80
81
|
return e.displayName || "Context";
|
|
81
|
-
case
|
|
82
|
+
case z:
|
|
82
83
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
83
|
-
case
|
|
84
|
+
case V:
|
|
84
85
|
var r = e.render;
|
|
85
86
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
86
|
-
case
|
|
87
|
+
case B:
|
|
87
88
|
return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
|
|
88
89
|
case k:
|
|
89
90
|
r = e._payload, e = e._init;
|
|
@@ -157,7 +158,7 @@ function se() {
|
|
|
157
158
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
158
159
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
159
160
|
}
|
|
160
|
-
function R(e, r, t, n, b,
|
|
161
|
+
function R(e, r, t, n, b, O) {
|
|
161
162
|
var a = t.ref;
|
|
162
163
|
return e = {
|
|
163
164
|
$$typeof: j,
|
|
@@ -187,14 +188,14 @@ function se() {
|
|
|
187
188
|
configurable: !1,
|
|
188
189
|
enumerable: !1,
|
|
189
190
|
writable: !0,
|
|
190
|
-
value:
|
|
191
|
+
value: O
|
|
191
192
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
192
193
|
}
|
|
193
|
-
function w(e, r, t, n, b,
|
|
194
|
+
function w(e, r, t, n, b, O) {
|
|
194
195
|
var a = r.children;
|
|
195
196
|
if (a !== void 0)
|
|
196
197
|
if (n)
|
|
197
|
-
if (
|
|
198
|
+
if (Q(a)) {
|
|
198
199
|
for (n = 0; n < a.length; n++)
|
|
199
200
|
y(a[n]);
|
|
200
201
|
Object.freeze && Object.freeze(a);
|
|
@@ -205,8 +206,8 @@ function se() {
|
|
|
205
206
|
else y(a);
|
|
206
207
|
if (C.call(r, "key")) {
|
|
207
208
|
a = s(e);
|
|
208
|
-
var _ = Object.keys(r).filter(function(
|
|
209
|
-
return
|
|
209
|
+
var _ = Object.keys(r).filter(function(K) {
|
|
210
|
+
return K !== "key";
|
|
210
211
|
});
|
|
211
212
|
n = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
212
213
|
`A props object containing a "key" prop is being spread into JSX:
|
|
@@ -223,8 +224,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
223
224
|
}
|
|
224
225
|
if (a = null, t !== void 0 && (f(t), a = "" + t), d(r) && (f(r.key), a = "" + r.key), "key" in r) {
|
|
225
226
|
t = {};
|
|
226
|
-
for (var
|
|
227
|
-
|
|
227
|
+
for (var P in r)
|
|
228
|
+
P !== "key" && (t[P] = r[P]);
|
|
228
229
|
} else t = r;
|
|
229
230
|
return a && i(
|
|
230
231
|
t,
|
|
@@ -235,7 +236,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
236
|
t,
|
|
236
237
|
u(),
|
|
237
238
|
b,
|
|
238
|
-
|
|
239
|
+
O
|
|
239
240
|
);
|
|
240
241
|
}
|
|
241
242
|
function y(e) {
|
|
@@ -244,7 +245,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
244
245
|
function S(e) {
|
|
245
246
|
return typeof e == "object" && e !== null && e.$$typeof === j;
|
|
246
247
|
}
|
|
247
|
-
var v =
|
|
248
|
+
var v = ee, j = Symbol.for("react.transitional.element"), U = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), J = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), x = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, Q = Array.isArray, h = console.createTask ? console.createTask : function() {
|
|
248
249
|
return null;
|
|
249
250
|
};
|
|
250
251
|
v = {
|
|
@@ -255,7 +256,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
255
256
|
var N, g = {}, Y = v.react_stack_bottom_frame.bind(
|
|
256
257
|
v,
|
|
257
258
|
l
|
|
258
|
-
)(), $ =
|
|
259
|
+
)(), $ = h(m(l)), I = {};
|
|
259
260
|
p.Fragment = A, p.jsx = function(e, r, t) {
|
|
260
261
|
var n = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
261
262
|
return w(
|
|
@@ -264,7 +265,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
264
265
|
t,
|
|
265
266
|
!1,
|
|
266
267
|
n ? Error("react-stack-top-frame") : Y,
|
|
267
|
-
n ?
|
|
268
|
+
n ? h(m(e)) : $
|
|
268
269
|
);
|
|
269
270
|
}, p.jsxs = function(e, r, t) {
|
|
270
271
|
var n = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
@@ -274,7 +275,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
274
275
|
t,
|
|
275
276
|
!0,
|
|
276
277
|
n ? Error("react-stack-top-frame") : Y,
|
|
277
|
-
n ?
|
|
278
|
+
n ? h(m(e)) : $
|
|
278
279
|
);
|
|
279
280
|
};
|
|
280
281
|
})()), p;
|
|
@@ -293,7 +294,7 @@ function ie({
|
|
|
293
294
|
lng: l,
|
|
294
295
|
onError: d
|
|
295
296
|
} = {}) {
|
|
296
|
-
const i = m ??
|
|
297
|
+
const i = m ?? ae.create({
|
|
297
298
|
baseURL: s,
|
|
298
299
|
timeout: f,
|
|
299
300
|
headers: { "Content-Type": "application/json" }
|
|
@@ -312,10 +313,11 @@ function ie({
|
|
|
312
313
|
), i;
|
|
313
314
|
}
|
|
314
315
|
function _e({ children: s, ...c }) {
|
|
315
|
-
const f =
|
|
316
|
-
return /* @__PURE__ */ le.jsx(
|
|
316
|
+
const f = ne(() => ie(c), [c]);
|
|
317
|
+
return /* @__PURE__ */ le.jsx(M.Provider, { value: { client: f }, children: s });
|
|
317
318
|
}
|
|
318
319
|
export {
|
|
320
|
+
M as ApiCtx,
|
|
319
321
|
_e as ApiProvider,
|
|
320
|
-
me as
|
|
322
|
+
me as useApiContext
|
|
321
323
|
};
|