@fuul/sdk 4.12.2 → 6.0.0
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/README.md +5 -5
- package/dist/affiliates/AffiliateService.d.ts +4 -3
- package/dist/affiliates/AffiliateService.d.ts.map +1 -1
- package/dist/core.d.ts +17 -8
- package/dist/core.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +214 -210
- package/dist/index.umd.js +5 -5
- package/dist/release.json.d.ts +1 -1
- package/dist/types/api.d.ts +2 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/sdk.d.ts +4 -1
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9,9 +9,9 @@ function Qe(e, t) {
|
|
|
9
9
|
const { toString: At } = Object.prototype, { getPrototypeOf: Ee } = Object, te = /* @__PURE__ */ ((e) => (t) => {
|
|
10
10
|
const n = At.call(t);
|
|
11
11
|
return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)), _ = (e) => (e = e.toLowerCase(), (t) => te(t) === e), ne = (e) => (t) => typeof t === e, { isArray: j } = Array,
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), _ = (e) => (e = e.toLowerCase(), (t) => te(t) === e), ne = (e) => (t) => typeof t === e, { isArray: j } = Array, K = ne("undefined");
|
|
13
13
|
function Pt(e) {
|
|
14
|
-
return e !== null && !
|
|
14
|
+
return e !== null && !K(e) && e.constructor !== null && !K(e.constructor) && O(e.constructor.isBuffer) && e.constructor.isBuffer(e);
|
|
15
15
|
}
|
|
16
16
|
const Ge = _("ArrayBuffer");
|
|
17
17
|
function Ot(e) {
|
|
@@ -28,7 +28,7 @@ const _t = ne("string"), O = ne("function"), Xe = ne("number"), re = (e) => e !=
|
|
|
28
28
|
return e && (typeof FormData == "function" && e instanceof FormData || O(e.append) && ((t = te(e)) === "formdata" || // detect form-data instance
|
|
29
29
|
t === "object" && O(e.toString) && e.toString() === "[object FormData]"));
|
|
30
30
|
}, kt = _("URLSearchParams"), [vt, qt, It, jt] = ["ReadableStream", "Request", "Response", "Headers"].map(_), Ht = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
31
|
-
function
|
|
31
|
+
function J(e, t, { allOwnKeys: n = !1 } = {}) {
|
|
32
32
|
if (e === null || typeof e > "u")
|
|
33
33
|
return;
|
|
34
34
|
let r, s;
|
|
@@ -51,23 +51,23 @@ function Ye(e, t) {
|
|
|
51
51
|
return s;
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ze = (e) => !
|
|
54
|
+
const k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ze = (e) => !K(e) && e !== k;
|
|
55
55
|
function de() {
|
|
56
56
|
const { caseless: e } = Ze(this) && this || {}, t = {}, n = (r, s) => {
|
|
57
57
|
const o = e && Ye(t, s) || s;
|
|
58
58
|
X(t[o]) && X(r) ? t[o] = de(t[o], r) : X(r) ? t[o] = de({}, r) : j(r) ? t[o] = r.slice() : t[o] = r;
|
|
59
59
|
};
|
|
60
60
|
for (let r = 0, s = arguments.length; r < s; r++)
|
|
61
|
-
arguments[r] &&
|
|
61
|
+
arguments[r] && J(arguments[r], n);
|
|
62
62
|
return t;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const Mt = (e, t, n, { allOwnKeys: r } = {}) => (J(t, (s, o) => {
|
|
65
65
|
n && O(s) ? e[o] = Qe(s, n) : e[o] = s;
|
|
66
|
-
}, { allOwnKeys: r }), e),
|
|
66
|
+
}, { allOwnKeys: r }), e), $t = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), zt = (e, t, n, r) => {
|
|
67
67
|
e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
|
|
68
68
|
value: t.prototype
|
|
69
69
|
}), n && Object.assign(e.prototype, n);
|
|
70
|
-
},
|
|
70
|
+
}, Vt = (e, t, n, r) => {
|
|
71
71
|
let s, o, i;
|
|
72
72
|
const c = {};
|
|
73
73
|
if (t = t || {}, e == null) return t;
|
|
@@ -77,11 +77,11 @@ const $t = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
77
77
|
e = n !== !1 && Ee(e);
|
|
78
78
|
} while (e && (!n || n(e, t)) && e !== Object.prototype);
|
|
79
79
|
return t;
|
|
80
|
-
},
|
|
80
|
+
}, Kt = (e, t, n) => {
|
|
81
81
|
e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
|
|
82
82
|
const r = e.indexOf(t, n);
|
|
83
83
|
return r !== -1 && r === n;
|
|
84
|
-
},
|
|
84
|
+
}, Jt = (e) => {
|
|
85
85
|
if (!e) return null;
|
|
86
86
|
if (j(e)) return e;
|
|
87
87
|
let t = e.length;
|
|
@@ -110,7 +110,7 @@ const $t = (e, t, n, { allOwnKeys: r } = {}) => (M(t, (s, o) => {
|
|
|
110
110
|
}
|
|
111
111
|
), xe = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), Zt = _("RegExp"), et = (e, t) => {
|
|
112
112
|
const n = Object.getOwnPropertyDescriptors(e), r = {};
|
|
113
|
-
|
|
113
|
+
J(n, (s, o) => {
|
|
114
114
|
let i;
|
|
115
115
|
(i = t(s, o, e)) !== !1 && (r[o] = i || s);
|
|
116
116
|
}), Object.defineProperties(e, r);
|
|
@@ -159,9 +159,9 @@ const an = (e) => {
|
|
|
159
159
|
if (!("toJSON" in r)) {
|
|
160
160
|
t[s] = r;
|
|
161
161
|
const o = j(r) ? [] : {};
|
|
162
|
-
return
|
|
163
|
-
const
|
|
164
|
-
!
|
|
162
|
+
return J(r, (i, c) => {
|
|
163
|
+
const l = n(i, s + 1);
|
|
164
|
+
!K(l) && (o[c] = l);
|
|
165
165
|
}), t[s] = void 0, o;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
@@ -190,7 +190,7 @@ const an = (e) => {
|
|
|
190
190
|
isRequest: qt,
|
|
191
191
|
isResponse: It,
|
|
192
192
|
isHeaders: jt,
|
|
193
|
-
isUndefined:
|
|
193
|
+
isUndefined: K,
|
|
194
194
|
isDate: Nt,
|
|
195
195
|
isFile: Ut,
|
|
196
196
|
isBlob: Lt,
|
|
@@ -200,17 +200,17 @@ const an = (e) => {
|
|
|
200
200
|
isURLSearchParams: kt,
|
|
201
201
|
isTypedArray: Wt,
|
|
202
202
|
isFileList: Dt,
|
|
203
|
-
forEach:
|
|
203
|
+
forEach: J,
|
|
204
204
|
merge: de,
|
|
205
|
-
extend:
|
|
205
|
+
extend: Mt,
|
|
206
206
|
trim: Ht,
|
|
207
|
-
stripBOM:
|
|
208
|
-
inherits:
|
|
209
|
-
toFlatObject:
|
|
207
|
+
stripBOM: $t,
|
|
208
|
+
inherits: zt,
|
|
209
|
+
toFlatObject: Vt,
|
|
210
210
|
kindOf: te,
|
|
211
211
|
kindOfTest: _,
|
|
212
|
-
endsWith:
|
|
213
|
-
toArray:
|
|
212
|
+
endsWith: Kt,
|
|
213
|
+
toArray: Jt,
|
|
214
214
|
forEachEntry: Qt,
|
|
215
215
|
matchAll: Gt,
|
|
216
216
|
isHTMLForm: Xt,
|
|
@@ -281,8 +281,8 @@ Object.defineProperties(m, st);
|
|
|
281
281
|
Object.defineProperty(rt, "isAxiosError", { value: !0 });
|
|
282
282
|
m.from = (e, t, n, r, s, o) => {
|
|
283
283
|
const i = Object.create(rt);
|
|
284
|
-
return a.toFlatObject(e, i, function(
|
|
285
|
-
return
|
|
284
|
+
return a.toFlatObject(e, i, function(l) {
|
|
285
|
+
return l !== Error.prototype;
|
|
286
286
|
}, (c) => c !== "isAxiosError"), m.call(i, e.message, t, n, r, s), i.cause = e, i.name = e.name, o && Object.assign(i, o), i;
|
|
287
287
|
};
|
|
288
288
|
const fn = null;
|
|
@@ -313,18 +313,18 @@ function se(e, t, n) {
|
|
|
313
313
|
}, !1, function(y, p) {
|
|
314
314
|
return !a.isUndefined(p[y]);
|
|
315
315
|
});
|
|
316
|
-
const r = n.metaTokens, s = n.visitor ||
|
|
316
|
+
const r = n.metaTokens, s = n.visitor || f, o = n.dots, i = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && a.isSpecCompliantForm(t);
|
|
317
317
|
if (!a.isFunction(s))
|
|
318
318
|
throw new TypeError("visitor must be a function");
|
|
319
319
|
function u(h) {
|
|
320
320
|
if (h === null) return "";
|
|
321
321
|
if (a.isDate(h))
|
|
322
322
|
return h.toISOString();
|
|
323
|
-
if (!
|
|
323
|
+
if (!l && a.isBlob(h))
|
|
324
324
|
throw new m("Blob is not supported. Use a Buffer instead.");
|
|
325
|
-
return a.isArrayBuffer(h) || a.isTypedArray(h) ?
|
|
325
|
+
return a.isArrayBuffer(h) || a.isTypedArray(h) ? l && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function f(h, y, p) {
|
|
328
328
|
let w = h;
|
|
329
329
|
if (h && !p && typeof h == "object") {
|
|
330
330
|
if (a.endsWith(y, "{}"))
|
|
@@ -341,7 +341,7 @@ function se(e, t, n) {
|
|
|
341
341
|
return he(h) ? !0 : (t.append(Ue(p, y, o), u(h)), !1);
|
|
342
342
|
}
|
|
343
343
|
const d = [], g = Object.assign(hn, {
|
|
344
|
-
defaultVisitor:
|
|
344
|
+
defaultVisitor: f,
|
|
345
345
|
convertValue: u,
|
|
346
346
|
isVisitable: he
|
|
347
347
|
});
|
|
@@ -508,8 +508,8 @@ function ut(e) {
|
|
|
508
508
|
function t(n, r, s, o) {
|
|
509
509
|
let i = n[o++];
|
|
510
510
|
if (i === "__proto__") return !0;
|
|
511
|
-
const c = Number.isFinite(+i),
|
|
512
|
-
return i = !i && a.isArray(s) ? s.length : i,
|
|
511
|
+
const c = Number.isFinite(+i), l = o >= n.length;
|
|
512
|
+
return i = !i && a.isArray(s) ? s.length : i, l ? (a.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !c) : ((!s[i] || !a.isObject(s[i])) && (s[i] = []), t(n, r, s[i], o) && a.isArray(s[i]) && (s[i] = An(s[i])), !c);
|
|
513
513
|
}
|
|
514
514
|
if (a.isFormData(e) && a.isFunction(e.entries)) {
|
|
515
515
|
const n = {};
|
|
@@ -547,10 +547,10 @@ const W = {
|
|
|
547
547
|
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
548
548
|
return Rn(t, this.formSerializer).toString();
|
|
549
549
|
if ((c = a.isFileList(t)) || r.indexOf("multipart/form-data") > -1) {
|
|
550
|
-
const
|
|
550
|
+
const l = this.env && this.env.FormData;
|
|
551
551
|
return se(
|
|
552
552
|
c ? { "files[]": t } : t,
|
|
553
|
-
|
|
553
|
+
l && new l(),
|
|
554
554
|
this.formSerializer
|
|
555
555
|
);
|
|
556
556
|
}
|
|
@@ -624,7 +624,7 @@ const On = a.toObjectSet([
|
|
|
624
624
|
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || t[n] && On[n]) && (n === "set-cookie" ? t[n] ? t[n].push(r) : t[n] = [r] : t[n] = t[n] ? t[n] + ", " + r : r);
|
|
625
625
|
}), t;
|
|
626
626
|
}, Fe = Symbol("internals");
|
|
627
|
-
function
|
|
627
|
+
function z(e) {
|
|
628
628
|
return e && String(e).trim().toLowerCase();
|
|
629
629
|
}
|
|
630
630
|
function Y(e) {
|
|
@@ -668,27 +668,27 @@ let P = class {
|
|
|
668
668
|
}
|
|
669
669
|
set(t, n, r) {
|
|
670
670
|
const s = this;
|
|
671
|
-
function o(c,
|
|
672
|
-
const
|
|
673
|
-
if (!
|
|
671
|
+
function o(c, l, u) {
|
|
672
|
+
const f = z(l);
|
|
673
|
+
if (!f)
|
|
674
674
|
throw new Error("header name must be a non-empty string");
|
|
675
|
-
const d = a.findKey(s,
|
|
676
|
-
(!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d ||
|
|
675
|
+
const d = a.findKey(s, f);
|
|
676
|
+
(!d || s[d] === void 0 || u === !0 || u === void 0 && s[d] !== !1) && (s[d || l] = Y(c));
|
|
677
677
|
}
|
|
678
|
-
const i = (c,
|
|
678
|
+
const i = (c, l) => a.forEach(c, (u, f) => o(u, f, l));
|
|
679
679
|
if (a.isPlainObject(t) || t instanceof this.constructor)
|
|
680
680
|
i(t, n);
|
|
681
681
|
else if (a.isString(t) && (t = t.trim()) && !Nn(t))
|
|
682
682
|
i(_n(t), n);
|
|
683
683
|
else if (a.isHeaders(t))
|
|
684
|
-
for (const [c,
|
|
685
|
-
o(
|
|
684
|
+
for (const [c, l] of t.entries())
|
|
685
|
+
o(l, c, r);
|
|
686
686
|
else
|
|
687
687
|
t != null && o(n, t, r);
|
|
688
688
|
return this;
|
|
689
689
|
}
|
|
690
690
|
get(t, n) {
|
|
691
|
-
if (t =
|
|
691
|
+
if (t = z(t), t) {
|
|
692
692
|
const r = a.findKey(this, t);
|
|
693
693
|
if (r) {
|
|
694
694
|
const s = this[r];
|
|
@@ -705,7 +705,7 @@ let P = class {
|
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
has(t, n) {
|
|
708
|
-
if (t =
|
|
708
|
+
if (t = z(t), t) {
|
|
709
709
|
const r = a.findKey(this, t);
|
|
710
710
|
return !!(r && this[r] !== void 0 && (!n || ue(this, this[r], r, n)));
|
|
711
711
|
}
|
|
@@ -715,7 +715,7 @@ let P = class {
|
|
|
715
715
|
const r = this;
|
|
716
716
|
let s = !1;
|
|
717
717
|
function o(i) {
|
|
718
|
-
if (i =
|
|
718
|
+
if (i = z(i), i) {
|
|
719
719
|
const c = a.findKey(r, i);
|
|
720
720
|
c && (!n || ue(r, r[c], c, n)) && (delete r[c], s = !0);
|
|
721
721
|
}
|
|
@@ -774,7 +774,7 @@ let P = class {
|
|
|
774
774
|
accessors: {}
|
|
775
775
|
}).accessors, s = this.prototype;
|
|
776
776
|
function o(i) {
|
|
777
|
-
const c =
|
|
777
|
+
const c = z(i);
|
|
778
778
|
r[c] || (Ln(s, i), r[c] = !0);
|
|
779
779
|
}
|
|
780
780
|
return a.isArray(t) ? t.forEach(o) : o(t), this;
|
|
@@ -825,26 +825,26 @@ function Fn(e, t) {
|
|
|
825
825
|
e = e || 10;
|
|
826
826
|
const n = new Array(e), r = new Array(e);
|
|
827
827
|
let s = 0, o = 0, i;
|
|
828
|
-
return t = t !== void 0 ? t : 1e3, function(
|
|
829
|
-
const u = Date.now(),
|
|
830
|
-
i || (i = u), n[s] =
|
|
828
|
+
return t = t !== void 0 ? t : 1e3, function(l) {
|
|
829
|
+
const u = Date.now(), f = r[o];
|
|
830
|
+
i || (i = u), n[s] = l, r[s] = u;
|
|
831
831
|
let d = o, g = 0;
|
|
832
832
|
for (; d !== s; )
|
|
833
833
|
g += n[d++], d = d % e;
|
|
834
834
|
if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
|
|
835
835
|
return;
|
|
836
|
-
const E =
|
|
836
|
+
const E = f && u - f;
|
|
837
837
|
return E ? Math.round(g * 1e3 / E) : void 0;
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
840
|
function Bn(e, t) {
|
|
841
841
|
let n = 0, r = 1e3 / t, s, o;
|
|
842
|
-
const i = (u,
|
|
843
|
-
n =
|
|
842
|
+
const i = (u, f = Date.now()) => {
|
|
843
|
+
n = f, s = null, o && (clearTimeout(o), o = null), e.apply(null, u);
|
|
844
844
|
};
|
|
845
845
|
return [(...u) => {
|
|
846
|
-
const
|
|
847
|
-
d >= r ? i(u,
|
|
846
|
+
const f = Date.now(), d = f - n;
|
|
847
|
+
d >= r ? i(u, f) : (s = u, o || (o = setTimeout(() => {
|
|
848
848
|
o = null, i(s);
|
|
849
849
|
}, r - d)));
|
|
850
850
|
}, () => s && i(s)];
|
|
@@ -853,15 +853,15 @@ const Z = (e, t, n = 3) => {
|
|
|
853
853
|
let r = 0;
|
|
854
854
|
const s = Fn(50, 250);
|
|
855
855
|
return Bn((o) => {
|
|
856
|
-
const i = o.loaded, c = o.lengthComputable ? o.total : void 0,
|
|
856
|
+
const i = o.loaded, c = o.lengthComputable ? o.total : void 0, l = i - r, u = s(l), f = i <= c;
|
|
857
857
|
r = i;
|
|
858
858
|
const d = {
|
|
859
859
|
loaded: i,
|
|
860
860
|
total: c,
|
|
861
861
|
progress: c ? i / c : void 0,
|
|
862
|
-
bytes:
|
|
862
|
+
bytes: l,
|
|
863
863
|
rate: u || void 0,
|
|
864
|
-
estimated: u && c &&
|
|
864
|
+
estimated: u && c && f ? (c - i) / u : void 0,
|
|
865
865
|
event: o,
|
|
866
866
|
lengthComputable: c != null,
|
|
867
867
|
[t ? "download" : "upload"]: !0
|
|
@@ -946,32 +946,32 @@ const ve = (e) => e instanceof P ? { ...e } : e;
|
|
|
946
946
|
function q(e, t) {
|
|
947
947
|
t = t || {};
|
|
948
948
|
const n = {};
|
|
949
|
-
function r(u,
|
|
950
|
-
return a.isPlainObject(u) && a.isPlainObject(
|
|
949
|
+
function r(u, f, d) {
|
|
950
|
+
return a.isPlainObject(u) && a.isPlainObject(f) ? a.merge.call({ caseless: d }, u, f) : a.isPlainObject(f) ? a.merge({}, f) : a.isArray(f) ? f.slice() : f;
|
|
951
951
|
}
|
|
952
|
-
function s(u,
|
|
953
|
-
if (a.isUndefined(
|
|
952
|
+
function s(u, f, d) {
|
|
953
|
+
if (a.isUndefined(f)) {
|
|
954
954
|
if (!a.isUndefined(u))
|
|
955
955
|
return r(void 0, u, d);
|
|
956
|
-
} else return r(u,
|
|
956
|
+
} else return r(u, f, d);
|
|
957
957
|
}
|
|
958
|
-
function o(u,
|
|
959
|
-
if (!a.isUndefined(
|
|
960
|
-
return r(void 0,
|
|
958
|
+
function o(u, f) {
|
|
959
|
+
if (!a.isUndefined(f))
|
|
960
|
+
return r(void 0, f);
|
|
961
961
|
}
|
|
962
|
-
function i(u,
|
|
963
|
-
if (a.isUndefined(
|
|
962
|
+
function i(u, f) {
|
|
963
|
+
if (a.isUndefined(f)) {
|
|
964
964
|
if (!a.isUndefined(u))
|
|
965
965
|
return r(void 0, u);
|
|
966
|
-
} else return r(void 0,
|
|
966
|
+
} else return r(void 0, f);
|
|
967
967
|
}
|
|
968
|
-
function c(u,
|
|
968
|
+
function c(u, f, d) {
|
|
969
969
|
if (d in t)
|
|
970
|
-
return r(u,
|
|
970
|
+
return r(u, f);
|
|
971
971
|
if (d in e)
|
|
972
972
|
return r(void 0, u);
|
|
973
973
|
}
|
|
974
|
-
const
|
|
974
|
+
const l = {
|
|
975
975
|
url: o,
|
|
976
976
|
method: o,
|
|
977
977
|
data: o,
|
|
@@ -1000,11 +1000,11 @@ function q(e, t) {
|
|
|
1000
1000
|
socketPath: i,
|
|
1001
1001
|
responseEncoding: i,
|
|
1002
1002
|
validateStatus: c,
|
|
1003
|
-
headers: (u,
|
|
1003
|
+
headers: (u, f) => s(ve(u), ve(f), !0)
|
|
1004
1004
|
};
|
|
1005
|
-
return a.forEach(Object.keys(Object.assign({}, e, t)), function(
|
|
1006
|
-
const d = f
|
|
1007
|
-
a.isUndefined(g) && d !== c || (n[
|
|
1005
|
+
return a.forEach(Object.keys(Object.assign({}, e, t)), function(f) {
|
|
1006
|
+
const d = l[f] || s, g = d(e[f], t[f], f);
|
|
1007
|
+
a.isUndefined(g) && d !== c || (n[f] = g);
|
|
1008
1008
|
}), n;
|
|
1009
1009
|
}
|
|
1010
1010
|
const ht = (e) => {
|
|
@@ -1014,13 +1014,13 @@ const ht = (e) => {
|
|
|
1014
1014
|
"Authorization",
|
|
1015
1015
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1016
1016
|
);
|
|
1017
|
-
let
|
|
1017
|
+
let l;
|
|
1018
1018
|
if (a.isFormData(n)) {
|
|
1019
1019
|
if (A.hasStandardBrowserEnv || A.hasStandardBrowserWebWorkerEnv)
|
|
1020
1020
|
i.setContentType(void 0);
|
|
1021
|
-
else if ((
|
|
1022
|
-
const [u, ...
|
|
1023
|
-
i.setContentType([u || "multipart/form-data", ...
|
|
1021
|
+
else if ((l = i.getContentType()) !== !1) {
|
|
1022
|
+
const [u, ...f] = l ? l.split(";").map((d) => d.trim()).filter(Boolean) : [];
|
|
1023
|
+
i.setContentType([u || "multipart/form-data", ...f].join("; "));
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
1026
|
if (A.hasStandardBrowserEnv && (r && a.isFunction(r) && (r = r(t)), r || r !== !1 && kn(t.url))) {
|
|
@@ -1033,9 +1033,9 @@ const ht = (e) => {
|
|
|
1033
1033
|
const s = ht(e);
|
|
1034
1034
|
let o = s.data;
|
|
1035
1035
|
const i = P.from(s.headers).normalize();
|
|
1036
|
-
let { responseType: c, onUploadProgress:
|
|
1036
|
+
let { responseType: c, onUploadProgress: l, onDownloadProgress: u } = s, f, d, g, E, h;
|
|
1037
1037
|
function y() {
|
|
1038
|
-
E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(
|
|
1038
|
+
E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(f), s.signal && s.signal.removeEventListener("abort", f);
|
|
1039
1039
|
}
|
|
1040
1040
|
let p = new XMLHttpRequest();
|
|
1041
1041
|
p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
|
|
@@ -1075,9 +1075,9 @@ const ht = (e) => {
|
|
|
1075
1075
|
)), p = null;
|
|
1076
1076
|
}, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(N, T) {
|
|
1077
1077
|
p.setRequestHeader(T, N);
|
|
1078
|
-
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([g, h] = Z(u, !0), p.addEventListener("progress", g)),
|
|
1078
|
+
}), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([g, h] = Z(u, !0), p.addEventListener("progress", g)), l && p.upload && ([d, E] = Z(l), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (f = (C) => {
|
|
1079
1079
|
p && (r(!C || C.type ? new H(null, e, p) : C), p.abort(), p = null);
|
|
1080
|
-
}, s.cancelToken && s.cancelToken.subscribe(
|
|
1080
|
+
}, s.cancelToken && s.cancelToken.subscribe(f), s.signal && (s.signal.aborted ? f() : s.signal.addEventListener("abort", f)));
|
|
1081
1081
|
const S = Dn(s.url);
|
|
1082
1082
|
if (S && A.protocols.indexOf(S) === -1) {
|
|
1083
1083
|
r(new m("Unsupported protocol " + S + ":", m.ERR_BAD_REQUEST, e));
|
|
@@ -1085,15 +1085,15 @@ const ht = (e) => {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
p.send(o || null);
|
|
1087
1087
|
});
|
|
1088
|
-
},
|
|
1088
|
+
}, Mn = (e, t) => {
|
|
1089
1089
|
const { length: n } = e = e ? e.filter(Boolean) : [];
|
|
1090
1090
|
if (t || n) {
|
|
1091
1091
|
let r = new AbortController(), s;
|
|
1092
1092
|
const o = function(u) {
|
|
1093
1093
|
if (!s) {
|
|
1094
1094
|
s = !0, c();
|
|
1095
|
-
const
|
|
1096
|
-
r.abort(
|
|
1095
|
+
const f = u instanceof Error ? u : this.reason;
|
|
1096
|
+
r.abort(f instanceof m ? f : new H(f instanceof Error ? f.message : f));
|
|
1097
1097
|
}
|
|
1098
1098
|
};
|
|
1099
1099
|
let i = t && setTimeout(() => {
|
|
@@ -1105,10 +1105,10 @@ const ht = (e) => {
|
|
|
1105
1105
|
}), e = null);
|
|
1106
1106
|
};
|
|
1107
1107
|
e.forEach((u) => u.addEventListener("abort", o));
|
|
1108
|
-
const { signal:
|
|
1109
|
-
return
|
|
1108
|
+
const { signal: l } = r;
|
|
1109
|
+
return l.unsubscribe = () => a.asap(c), l;
|
|
1110
1110
|
}
|
|
1111
|
-
},
|
|
1111
|
+
}, $n = function* (e, t) {
|
|
1112
1112
|
let n = e.byteLength;
|
|
1113
1113
|
if (n < t) {
|
|
1114
1114
|
yield e;
|
|
@@ -1117,10 +1117,10 @@ const ht = (e) => {
|
|
|
1117
1117
|
let r = 0, s;
|
|
1118
1118
|
for (; r < n; )
|
|
1119
1119
|
s = r + t, yield e.slice(r, s), r = s;
|
|
1120
|
-
},
|
|
1121
|
-
for await (const n of
|
|
1122
|
-
yield*
|
|
1123
|
-
},
|
|
1120
|
+
}, zn = async function* (e, t) {
|
|
1121
|
+
for await (const n of Vn(e))
|
|
1122
|
+
yield* $n(n, t);
|
|
1123
|
+
}, Vn = async function* (e) {
|
|
1124
1124
|
if (e[Symbol.asyncIterator]) {
|
|
1125
1125
|
yield* e;
|
|
1126
1126
|
return;
|
|
@@ -1137,41 +1137,41 @@ const ht = (e) => {
|
|
|
1137
1137
|
await t.cancel();
|
|
1138
1138
|
}
|
|
1139
1139
|
}, qe = (e, t, n, r) => {
|
|
1140
|
-
const s =
|
|
1141
|
-
let o = 0, i, c = (
|
|
1142
|
-
i || (i = !0, r && r(
|
|
1140
|
+
const s = zn(e, t);
|
|
1141
|
+
let o = 0, i, c = (l) => {
|
|
1142
|
+
i || (i = !0, r && r(l));
|
|
1143
1143
|
};
|
|
1144
1144
|
return new ReadableStream({
|
|
1145
|
-
async pull(
|
|
1145
|
+
async pull(l) {
|
|
1146
1146
|
try {
|
|
1147
|
-
const { done: u, value:
|
|
1147
|
+
const { done: u, value: f } = await s.next();
|
|
1148
1148
|
if (u) {
|
|
1149
|
-
c(),
|
|
1149
|
+
c(), l.close();
|
|
1150
1150
|
return;
|
|
1151
1151
|
}
|
|
1152
|
-
let d =
|
|
1152
|
+
let d = f.byteLength;
|
|
1153
1153
|
if (n) {
|
|
1154
1154
|
let g = o += d;
|
|
1155
1155
|
n(g);
|
|
1156
1156
|
}
|
|
1157
|
-
|
|
1157
|
+
l.enqueue(new Uint8Array(f));
|
|
1158
1158
|
} catch (u) {
|
|
1159
1159
|
throw c(u), u;
|
|
1160
1160
|
}
|
|
1161
1161
|
},
|
|
1162
|
-
cancel(
|
|
1163
|
-
return c(
|
|
1162
|
+
cancel(l) {
|
|
1163
|
+
return c(l), s.return();
|
|
1164
1164
|
}
|
|
1165
1165
|
}, {
|
|
1166
1166
|
highWaterMark: 2
|
|
1167
1167
|
});
|
|
1168
|
-
}, oe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", pt = oe && typeof ReadableStream == "function",
|
|
1168
|
+
}, oe = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", pt = oe && typeof ReadableStream == "function", Kn = oe && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), mt = (e, ...t) => {
|
|
1169
1169
|
try {
|
|
1170
1170
|
return !!e(...t);
|
|
1171
1171
|
} catch {
|
|
1172
1172
|
return !1;
|
|
1173
1173
|
}
|
|
1174
|
-
},
|
|
1174
|
+
}, Jn = pt && mt(() => {
|
|
1175
1175
|
let e = !1;
|
|
1176
1176
|
const t = new Request(A.origin, {
|
|
1177
1177
|
body: new ReadableStream(),
|
|
@@ -1204,7 +1204,7 @@ const Wn = async (e) => {
|
|
|
1204
1204
|
if (a.isArrayBufferView(e) || a.isArrayBuffer(e))
|
|
1205
1205
|
return e.byteLength;
|
|
1206
1206
|
if (a.isURLSearchParams(e) && (e = e + ""), a.isString(e))
|
|
1207
|
-
return (await
|
|
1207
|
+
return (await Kn(e)).byteLength;
|
|
1208
1208
|
}, Qn = async (e, t) => {
|
|
1209
1209
|
const n = a.toFiniteNumber(e.getContentLength());
|
|
1210
1210
|
return n ?? Wn(t);
|
|
@@ -1217,29 +1217,29 @@ const Wn = async (e) => {
|
|
|
1217
1217
|
cancelToken: o,
|
|
1218
1218
|
timeout: i,
|
|
1219
1219
|
onDownloadProgress: c,
|
|
1220
|
-
onUploadProgress:
|
|
1220
|
+
onUploadProgress: l,
|
|
1221
1221
|
responseType: u,
|
|
1222
|
-
headers:
|
|
1222
|
+
headers: f,
|
|
1223
1223
|
withCredentials: d = "same-origin",
|
|
1224
1224
|
fetchOptions: g
|
|
1225
1225
|
} = ht(e);
|
|
1226
1226
|
u = u ? (u + "").toLowerCase() : "text";
|
|
1227
|
-
let E =
|
|
1227
|
+
let E = Mn([s, o && o.toAbortSignal()], i), h;
|
|
1228
1228
|
const y = E && E.unsubscribe && (() => {
|
|
1229
1229
|
E.unsubscribe();
|
|
1230
1230
|
});
|
|
1231
1231
|
let p;
|
|
1232
1232
|
try {
|
|
1233
|
-
if (
|
|
1233
|
+
if (l && Jn && n !== "get" && n !== "head" && (p = await Qn(f, r)) !== 0) {
|
|
1234
1234
|
let T = new Request(t, {
|
|
1235
1235
|
method: "POST",
|
|
1236
1236
|
body: r,
|
|
1237
1237
|
duplex: "half"
|
|
1238
1238
|
}), U;
|
|
1239
|
-
if (a.isFormData(r) && (U = T.headers.get("content-type")) &&
|
|
1239
|
+
if (a.isFormData(r) && (U = T.headers.get("content-type")) && f.setContentType(U), T.body) {
|
|
1240
1240
|
const [F, Q] = Be(
|
|
1241
1241
|
p,
|
|
1242
|
-
Z(ke(
|
|
1242
|
+
Z(ke(l))
|
|
1243
1243
|
);
|
|
1244
1244
|
r = qe(T.body, Ie, F, Q);
|
|
1245
1245
|
}
|
|
@@ -1250,7 +1250,7 @@ const Wn = async (e) => {
|
|
|
1250
1250
|
...g,
|
|
1251
1251
|
signal: E,
|
|
1252
1252
|
method: n.toUpperCase(),
|
|
1253
|
-
headers:
|
|
1253
|
+
headers: f.normalize().toJSON(),
|
|
1254
1254
|
body: r,
|
|
1255
1255
|
duplex: "half",
|
|
1256
1256
|
credentials: w ? d : void 0
|
|
@@ -1324,7 +1324,7 @@ const je = (e) => `- ${e}`, Xn = (e) => a.isFunction(e) || e === null || e === !
|
|
|
1324
1324
|
}
|
|
1325
1325
|
if (!r) {
|
|
1326
1326
|
const o = Object.entries(s).map(
|
|
1327
|
-
([c,
|
|
1327
|
+
([c, l]) => `adapter ${c} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1328
1328
|
);
|
|
1329
1329
|
let i = t ? o.length > 1 ? `since :
|
|
1330
1330
|
` + o.map(je).join(`
|
|
@@ -1366,7 +1366,7 @@ const gt = "1.7.7", Re = {};
|
|
|
1366
1366
|
return typeof r === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1367
1367
|
};
|
|
1368
1368
|
});
|
|
1369
|
-
const
|
|
1369
|
+
const Me = {};
|
|
1370
1370
|
Re.transitional = function(t, n, r) {
|
|
1371
1371
|
function s(o, i) {
|
|
1372
1372
|
return "[Axios v" + gt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
@@ -1377,7 +1377,7 @@ Re.transitional = function(t, n, r) {
|
|
|
1377
1377
|
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1378
1378
|
m.ERR_DEPRECATED
|
|
1379
1379
|
);
|
|
1380
|
-
return n &&
|
|
1380
|
+
return n && !Me[i] && (Me[i] = !0, console.warn(
|
|
1381
1381
|
s(
|
|
1382
1382
|
i,
|
|
1383
1383
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1393,9 +1393,9 @@ function Yn(e, t, n) {
|
|
|
1393
1393
|
for (; s-- > 0; ) {
|
|
1394
1394
|
const o = r[s], i = t[o];
|
|
1395
1395
|
if (i) {
|
|
1396
|
-
const c = e[o],
|
|
1397
|
-
if (
|
|
1398
|
-
throw new m("option " + o + " must be " +
|
|
1396
|
+
const c = e[o], l = c === void 0 || i(c, o, e);
|
|
1397
|
+
if (l !== !0)
|
|
1398
|
+
throw new m("option " + o + " must be " + l, m.ERR_BAD_OPTION_VALUE);
|
|
1399
1399
|
continue;
|
|
1400
1400
|
}
|
|
1401
1401
|
if (n !== !0)
|
|
@@ -1462,20 +1462,20 @@ let v = class {
|
|
|
1462
1462
|
}
|
|
1463
1463
|
), n.headers = P.concat(i, o);
|
|
1464
1464
|
const c = [];
|
|
1465
|
-
let
|
|
1465
|
+
let l = !0;
|
|
1466
1466
|
this.interceptors.request.forEach(function(y) {
|
|
1467
|
-
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (
|
|
1467
|
+
typeof y.runWhen == "function" && y.runWhen(n) === !1 || (l = l && y.synchronous, c.unshift(y.fulfilled, y.rejected));
|
|
1468
1468
|
});
|
|
1469
1469
|
const u = [];
|
|
1470
1470
|
this.interceptors.response.forEach(function(y) {
|
|
1471
1471
|
u.push(y.fulfilled, y.rejected);
|
|
1472
1472
|
});
|
|
1473
|
-
let
|
|
1474
|
-
if (!
|
|
1473
|
+
let f, d = 0, g;
|
|
1474
|
+
if (!l) {
|
|
1475
1475
|
const h = [He.bind(this), void 0];
|
|
1476
|
-
for (h.unshift.apply(h, c), h.push.apply(h, u), g = h.length,
|
|
1477
|
-
|
|
1478
|
-
return
|
|
1476
|
+
for (h.unshift.apply(h, c), h.push.apply(h, u), g = h.length, f = Promise.resolve(n); d < g; )
|
|
1477
|
+
f = f.then(h[d++], h[d++]);
|
|
1478
|
+
return f;
|
|
1479
1479
|
}
|
|
1480
1480
|
g = c.length;
|
|
1481
1481
|
let E = n;
|
|
@@ -1489,13 +1489,13 @@ let v = class {
|
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
try {
|
|
1492
|
-
|
|
1492
|
+
f = He.call(this, E);
|
|
1493
1493
|
} catch (h) {
|
|
1494
1494
|
return Promise.reject(h);
|
|
1495
1495
|
}
|
|
1496
1496
|
for (d = 0, g = u.length; d < g; )
|
|
1497
|
-
|
|
1498
|
-
return
|
|
1497
|
+
f = f.then(u[d++], u[d++]);
|
|
1498
|
+
return f;
|
|
1499
1499
|
}
|
|
1500
1500
|
getUri(t) {
|
|
1501
1501
|
t = q(this.defaults, t);
|
|
@@ -1720,28 +1720,28 @@ const {
|
|
|
1720
1720
|
getAdapter: us,
|
|
1721
1721
|
mergeConfig: ls
|
|
1722
1722
|
} = b;
|
|
1723
|
-
class
|
|
1723
|
+
class $e extends Error {
|
|
1724
1724
|
constructor(n) {
|
|
1725
1725
|
super(n.join(", "));
|
|
1726
1726
|
R(this, "errors");
|
|
1727
1727
|
this.name = "ValidationError", this.errors = n;
|
|
1728
1728
|
}
|
|
1729
1729
|
}
|
|
1730
|
-
class
|
|
1730
|
+
class ze extends Error {
|
|
1731
1731
|
constructor(n) {
|
|
1732
1732
|
super("Address already registered.");
|
|
1733
1733
|
R(this, "address");
|
|
1734
1734
|
this.name = "AddressInUseError", this.address = n;
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
|
-
class
|
|
1737
|
+
class Ve extends Error {
|
|
1738
1738
|
constructor(n) {
|
|
1739
1739
|
super("Code already registered.");
|
|
1740
1740
|
R(this, "code");
|
|
1741
1741
|
this.name = "CodeInUseError", this.code = n;
|
|
1742
1742
|
}
|
|
1743
1743
|
}
|
|
1744
|
-
class
|
|
1744
|
+
class Ke extends Error {
|
|
1745
1745
|
constructor() {
|
|
1746
1746
|
super("Invalid signature provided"), this.name = "InvalidSignatureError";
|
|
1747
1747
|
}
|
|
@@ -1752,53 +1752,55 @@ class nr {
|
|
|
1752
1752
|
R(this, "_debug");
|
|
1753
1753
|
this.httpClient = t.httpClient, this._debug = t.debug;
|
|
1754
1754
|
}
|
|
1755
|
-
async create(t, n, r, s) {
|
|
1756
|
-
var
|
|
1755
|
+
async create(t, n, r, s, o) {
|
|
1756
|
+
var i;
|
|
1757
1757
|
try {
|
|
1758
1758
|
await this.httpClient.post({
|
|
1759
1759
|
path: "/affiliates",
|
|
1760
1760
|
postData: {
|
|
1761
1761
|
address: t,
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1762
|
+
blockchain: n,
|
|
1763
|
+
name: r,
|
|
1764
|
+
code: r,
|
|
1765
|
+
signature: s,
|
|
1766
|
+
account_chain_id: o
|
|
1766
1767
|
}
|
|
1767
1768
|
});
|
|
1768
|
-
} catch (
|
|
1769
|
-
if (
|
|
1770
|
-
const
|
|
1771
|
-
if (typeof (
|
|
1772
|
-
const
|
|
1773
|
-
throw
|
|
1774
|
-
} else if ((
|
|
1775
|
-
throw new
|
|
1769
|
+
} catch (c) {
|
|
1770
|
+
if (c instanceof G) {
|
|
1771
|
+
const l = (i = c.response) == null ? void 0 : i.data;
|
|
1772
|
+
if (typeof (l == null ? void 0 : l.message) == "string") {
|
|
1773
|
+
const u = l.message.toLowerCase();
|
|
1774
|
+
throw u == "invalid signature" ? new Ke() : u == "address in use" ? new ze(t) : u == "code in use" ? new Ve(r) : new Error(u);
|
|
1775
|
+
} else if ((l == null ? void 0 : l.message) instanceof Array)
|
|
1776
|
+
throw new $e(l.message);
|
|
1776
1777
|
}
|
|
1777
|
-
throw
|
|
1778
|
+
throw c;
|
|
1778
1779
|
}
|
|
1779
1780
|
}
|
|
1780
|
-
async update(t, n, r, s) {
|
|
1781
|
-
var
|
|
1781
|
+
async update(t, n, r, s, o) {
|
|
1782
|
+
var i;
|
|
1782
1783
|
try {
|
|
1783
1784
|
await this.httpClient.post({
|
|
1784
1785
|
path: `/affiliates/${t}`,
|
|
1785
1786
|
postData: {
|
|
1786
|
-
code:
|
|
1787
|
+
code: r,
|
|
1787
1788
|
address: t,
|
|
1788
|
-
|
|
1789
|
-
|
|
1789
|
+
blockchain: n,
|
|
1790
|
+
signature: s,
|
|
1791
|
+
account_chain_id: o
|
|
1790
1792
|
}
|
|
1791
1793
|
});
|
|
1792
|
-
} catch (
|
|
1793
|
-
if (
|
|
1794
|
-
const
|
|
1795
|
-
if (typeof (
|
|
1796
|
-
const
|
|
1797
|
-
throw
|
|
1798
|
-
} else if ((
|
|
1799
|
-
throw new
|
|
1794
|
+
} catch (c) {
|
|
1795
|
+
if (c instanceof G) {
|
|
1796
|
+
const l = (i = c.response) == null ? void 0 : i.data;
|
|
1797
|
+
if (typeof (l == null ? void 0 : l.message) == "string") {
|
|
1798
|
+
const u = l.message.toLowerCase();
|
|
1799
|
+
throw u == "invalid signature" ? new Ke() : u == "address in use" ? new ze(t) : u == "code in use" ? new Ve(r) : new Error(u);
|
|
1800
|
+
} else if ((l == null ? void 0 : l.message) instanceof Array)
|
|
1801
|
+
throw new $e(l.message);
|
|
1800
1802
|
}
|
|
1801
|
-
throw
|
|
1803
|
+
throw c;
|
|
1802
1804
|
}
|
|
1803
1805
|
}
|
|
1804
1806
|
async isCodeFree(t) {
|
|
@@ -1811,14 +1813,14 @@ class nr {
|
|
|
1811
1813
|
throw console.error("Fuul SDK: Could not check affiliate code", r), r;
|
|
1812
1814
|
}
|
|
1813
1815
|
}
|
|
1814
|
-
async getCode(t) {
|
|
1815
|
-
var
|
|
1816
|
+
async getCode(t, n) {
|
|
1817
|
+
var r;
|
|
1816
1818
|
try {
|
|
1817
|
-
return (await this.httpClient.get({ path: `/affiliates/${t}
|
|
1818
|
-
} catch (
|
|
1819
|
-
if (
|
|
1819
|
+
return (await this.httpClient.get({ path: `/affiliates/${t}`, queryParams: { blockchain: n } })).data.code;
|
|
1820
|
+
} catch (s) {
|
|
1821
|
+
if (s instanceof G && ((r = s.response) == null ? void 0 : r.status) === 404)
|
|
1820
1822
|
return null;
|
|
1821
|
-
throw console.error("Fuul SDK: Could not get affiliate code",
|
|
1823
|
+
throw console.error("Fuul SDK: Could not get affiliate code", s), s;
|
|
1822
1824
|
}
|
|
1823
1825
|
}
|
|
1824
1826
|
}
|
|
@@ -1846,7 +1848,7 @@ class or {
|
|
|
1846
1848
|
return n;
|
|
1847
1849
|
}
|
|
1848
1850
|
}
|
|
1849
|
-
const
|
|
1851
|
+
const Je = "fuul.sent", ir = 60;
|
|
1850
1852
|
class ar {
|
|
1851
1853
|
constructor(t) {
|
|
1852
1854
|
R(this, "debug");
|
|
@@ -1868,26 +1870,26 @@ class ar {
|
|
|
1868
1870
|
this.debug && console.debug(`Fuul SDK: Sent '${t.name}' event`), this.saveSentEvent(t);
|
|
1869
1871
|
}
|
|
1870
1872
|
isDuplicate(t) {
|
|
1871
|
-
const n = `${
|
|
1873
|
+
const n = `${Je}_${t.name}`, r = localStorage.getItem(n);
|
|
1872
1874
|
if (!r)
|
|
1873
1875
|
return !1;
|
|
1874
1876
|
const s = JSON.parse(r);
|
|
1875
1877
|
if (this.getCurrentTimestamp() - s.timestamp > ir)
|
|
1876
1878
|
return !1;
|
|
1877
|
-
let
|
|
1878
|
-
t.metadata && (
|
|
1879
|
+
let l = !1;
|
|
1880
|
+
t.metadata && (l = s.metadata.tracking_id === t.metadata.tracking_id && s.metadata.project_id === t.metadata.project_id && s.metadata.referrer === t.metadata.referrer && s.metadata.source === t.metadata.source && s.metadata.category === t.metadata.category && s.metadata.title === t.metadata.title && s.metadata.tag === t.metadata.tag && s.user_address === t.user_address && s.signature === t.signature && s.signature_message === t.signature_message);
|
|
1879
1881
|
let u = !1;
|
|
1880
|
-
return t.args && s.args && (u = s.args.page === t.args.page), u &&
|
|
1882
|
+
return t.args && s.args && (u = s.args.page === t.args.page), u && l;
|
|
1881
1883
|
}
|
|
1882
1884
|
getCurrentTimestamp() {
|
|
1883
1885
|
return Date.now() / 1e3;
|
|
1884
1886
|
}
|
|
1885
1887
|
saveSentEvent(t) {
|
|
1886
|
-
const n = `${
|
|
1888
|
+
const n = `${Je}_${t.name}`, r = this.getCurrentTimestamp(), s = { ...t, timestamp: r };
|
|
1887
1889
|
localStorage.setItem(n, JSON.stringify(s));
|
|
1888
1890
|
}
|
|
1889
1891
|
}
|
|
1890
|
-
const cr = "
|
|
1892
|
+
const cr = "6.0.0", ur = {
|
|
1891
1893
|
version: cr
|
|
1892
1894
|
};
|
|
1893
1895
|
class lr {
|
|
@@ -1960,7 +1962,7 @@ class fr {
|
|
|
1960
1962
|
})).data;
|
|
1961
1963
|
}
|
|
1962
1964
|
}
|
|
1963
|
-
const
|
|
1965
|
+
const V = "/payouts";
|
|
1964
1966
|
class dr {
|
|
1965
1967
|
constructor(t) {
|
|
1966
1968
|
R(this, "httpClient");
|
|
@@ -1969,31 +1971,31 @@ class dr {
|
|
|
1969
1971
|
}
|
|
1970
1972
|
async getUserPayoutsByConversion(t) {
|
|
1971
1973
|
return (await this.httpClient.get({
|
|
1972
|
-
path:
|
|
1974
|
+
path: V,
|
|
1973
1975
|
queryParams: { ...t, type: "onchain-currency" }
|
|
1974
1976
|
})).data;
|
|
1975
1977
|
}
|
|
1976
1978
|
async getUserPointsByConversion(t) {
|
|
1977
1979
|
return (await this.httpClient.get({
|
|
1978
|
-
path:
|
|
1980
|
+
path: V,
|
|
1979
1981
|
queryParams: { ...t, type: "point" }
|
|
1980
1982
|
})).data;
|
|
1981
1983
|
}
|
|
1982
1984
|
async getUserPayoutMovements(t) {
|
|
1983
1985
|
return (await this.httpClient.get({
|
|
1984
|
-
path: `${
|
|
1986
|
+
path: `${V}/movements`,
|
|
1985
1987
|
queryParams: { ...t, type: "onchain-currency" }
|
|
1986
1988
|
})).data;
|
|
1987
1989
|
}
|
|
1988
1990
|
async getUserPointsMovements(t) {
|
|
1989
1991
|
return (await this.httpClient.get({
|
|
1990
|
-
path: `${
|
|
1992
|
+
path: `${V}/movements`,
|
|
1991
1993
|
queryParams: { ...t, type: "point" }
|
|
1992
1994
|
})).data;
|
|
1993
1995
|
}
|
|
1994
1996
|
async getVolumeLeaderboard(t) {
|
|
1995
1997
|
return (await this.httpClient.get({
|
|
1996
|
-
path: `${
|
|
1998
|
+
path: `${V}/leaderboard/volume`,
|
|
1997
1999
|
queryParams: { ...t }
|
|
1998
2000
|
})).data;
|
|
1999
2001
|
}
|
|
@@ -2022,9 +2024,9 @@ class Rr {
|
|
|
2022
2024
|
}
|
|
2023
2025
|
}
|
|
2024
2026
|
const Tr = "https://api.fuul.xyz/api/v1/";
|
|
2025
|
-
let B = !1, be = !1, Ae, D, Et, St,
|
|
2027
|
+
let B = !1, be = !1, Ae, D, Et, St, M, ie, $, Ct, ae;
|
|
2026
2028
|
function Ar(e) {
|
|
2027
|
-
B = !!e.debug, !be && (Ae = e.apiKey,
|
|
2029
|
+
B = !!e.debug, !be && (Ae = e.apiKey, Vr(), D = Kr(e.baseApiUrl ?? Tr, e.defaultQueryParams ?? {}), Et = new or({ httpClient: D, debug: B }), ie = new ar({ httpClient: D, debug: B }), M = new nr({ httpClient: D, debug: B }), $ = new dr({ httpClient: D, debug: B }), St = new Rr({ httpClient: D }), Ct = new sr({ httpClient: D, debug: B }), ae = new fr({ httpClient: D }), be = !0, B && console.debug("Fuul SDK: init() complete"));
|
|
2028
2030
|
}
|
|
2029
2031
|
function x() {
|
|
2030
2032
|
if (!be)
|
|
@@ -2066,6 +2068,8 @@ async function _r(e, t) {
|
|
|
2066
2068
|
x(), Pe(), Oe();
|
|
2067
2069
|
const n = {
|
|
2068
2070
|
name: "connect_wallet",
|
|
2071
|
+
user_address: e.address,
|
|
2072
|
+
blockchain: e.blockchain,
|
|
2069
2073
|
args: {
|
|
2070
2074
|
page: document.location.pathname,
|
|
2071
2075
|
locationOrigin: document.location.origin
|
|
@@ -2074,26 +2078,26 @@ async function _r(e, t) {
|
|
|
2074
2078
|
tracking_id: Te()
|
|
2075
2079
|
}
|
|
2076
2080
|
};
|
|
2077
|
-
e != null && e.
|
|
2081
|
+
e != null && e.signature && (n.signature = e == null ? void 0 : e.signature, n.signature_message = e == null ? void 0 : e.message), e != null && e.accountChainId && (n.account_chain_id = e.accountChainId), await ie.sendEvent(n, t);
|
|
2078
2082
|
}
|
|
2079
2083
|
async function xr(e) {
|
|
2080
|
-
x(), await
|
|
2084
|
+
x(), await M.create(e.address, e.blockchain, e.code, e.signature, e.accountChainId);
|
|
2081
2085
|
}
|
|
2082
2086
|
async function Nr(e) {
|
|
2083
|
-
x(), await
|
|
2087
|
+
x(), await M.update(e.address, e.blockchain, e.code, e.signature, e.accountChainId);
|
|
2084
2088
|
}
|
|
2085
|
-
async function Ur(e) {
|
|
2086
|
-
return x(), await
|
|
2089
|
+
async function Ur(e, t) {
|
|
2090
|
+
return x(), await M.getCode(e, t);
|
|
2087
2091
|
}
|
|
2088
2092
|
async function Lr(e) {
|
|
2089
|
-
return x(), await
|
|
2093
|
+
return x(), await M.isCodeFree(e);
|
|
2090
2094
|
}
|
|
2091
|
-
async function Dr(e, t, n) {
|
|
2095
|
+
async function Dr(e, t, n, r) {
|
|
2092
2096
|
x();
|
|
2093
|
-
const
|
|
2094
|
-
af:
|
|
2097
|
+
const s = await M.getCode(t, n), o = new URLSearchParams({
|
|
2098
|
+
af: s ?? t
|
|
2095
2099
|
});
|
|
2096
|
-
return
|
|
2100
|
+
return r != null && r.title && o.append("af_title", r.title), r != null && r.format && o.append("af_format", r.format), r != null && r.place && o.append("af_place", r.place), `${e}?${o.toString()}`;
|
|
2097
2101
|
}
|
|
2098
2102
|
function Fr(e) {
|
|
2099
2103
|
return ae.getPayoutsLeaderboard(e);
|
|
@@ -2105,27 +2109,27 @@ function kr(e) {
|
|
|
2105
2109
|
return ae.getReferredUsersLeaderboard(e);
|
|
2106
2110
|
}
|
|
2107
2111
|
function vr(e) {
|
|
2108
|
-
return
|
|
2112
|
+
return $.getVolumeLeaderboard(e);
|
|
2109
2113
|
}
|
|
2110
2114
|
function qr(e) {
|
|
2111
|
-
return
|
|
2115
|
+
return $.getUserPayoutsByConversion(e);
|
|
2112
2116
|
}
|
|
2113
2117
|
function Ir(e) {
|
|
2114
|
-
return
|
|
2118
|
+
return $.getUserPointsByConversion(e);
|
|
2115
2119
|
}
|
|
2116
2120
|
function jr(e) {
|
|
2117
|
-
return
|
|
2121
|
+
return $.getUserPayoutMovements(e);
|
|
2118
2122
|
}
|
|
2119
2123
|
function Hr(e) {
|
|
2120
|
-
return
|
|
2124
|
+
return $.getUserPointsMovements(e);
|
|
2121
2125
|
}
|
|
2122
|
-
async function
|
|
2126
|
+
async function Mr(e) {
|
|
2123
2127
|
return x(), Et.getAll(e);
|
|
2124
2128
|
}
|
|
2125
|
-
async function
|
|
2129
|
+
async function $r(e) {
|
|
2126
2130
|
return x(), St.getUserAffiliates(e);
|
|
2127
2131
|
}
|
|
2128
|
-
async function
|
|
2132
|
+
async function zr(e) {
|
|
2129
2133
|
return x(), Ct.getUserAudiences(e);
|
|
2130
2134
|
}
|
|
2131
2135
|
function Pe() {
|
|
@@ -2136,11 +2140,11 @@ function Oe() {
|
|
|
2136
2140
|
if (navigator.webdriver)
|
|
2137
2141
|
throw new Error("Fuul SDK: You are using a browser automation tool");
|
|
2138
2142
|
}
|
|
2139
|
-
function
|
|
2143
|
+
function Vr() {
|
|
2140
2144
|
if (!Ae)
|
|
2141
2145
|
throw new Error("Fuul SDK: Invalid API key");
|
|
2142
2146
|
}
|
|
2143
|
-
function
|
|
2147
|
+
function Kr(e, t) {
|
|
2144
2148
|
return new lr({
|
|
2145
2149
|
baseURL: e,
|
|
2146
2150
|
timeout: 3e4,
|
|
@@ -2154,7 +2158,7 @@ const fs = {
|
|
|
2154
2158
|
sendPageview: Or,
|
|
2155
2159
|
sendConnectWallet: _r,
|
|
2156
2160
|
generateTrackingLink: Dr,
|
|
2157
|
-
getConversions:
|
|
2161
|
+
getConversions: Mr,
|
|
2158
2162
|
createAffiliateCode: xr,
|
|
2159
2163
|
updateAffiliateCode: Nr,
|
|
2160
2164
|
getAffiliateCode: Ur,
|
|
@@ -2162,18 +2166,18 @@ const fs = {
|
|
|
2162
2166
|
getPayoutsLeaderboard: Fr,
|
|
2163
2167
|
getPointsLeaderboard: Br,
|
|
2164
2168
|
getReferredUsersLeaderboard: kr,
|
|
2165
|
-
getUserAudiences:
|
|
2169
|
+
getUserAudiences: zr,
|
|
2166
2170
|
getUserPayoutsByConversion: qr,
|
|
2167
2171
|
getUserPointsByConversion: Ir,
|
|
2168
2172
|
getUserPointsMovements: Hr,
|
|
2169
2173
|
getUserPayoutMovements: jr,
|
|
2170
|
-
getUserAffiliates:
|
|
2174
|
+
getUserAffiliates: $r,
|
|
2171
2175
|
getVolumeLeaderboard: vr
|
|
2172
2176
|
};
|
|
2173
2177
|
export {
|
|
2174
|
-
|
|
2175
|
-
|
|
2178
|
+
ze as AddressInUseError,
|
|
2179
|
+
Ve as CodeInUseError,
|
|
2176
2180
|
fs as Fuul,
|
|
2177
|
-
|
|
2178
|
-
|
|
2181
|
+
Ke as InvalidSignatureError,
|
|
2182
|
+
$e as ValidationError
|
|
2179
2183
|
};
|