@valbuild/shared 0.87.3 → 0.87.4
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.
|
@@ -769,306 +769,114 @@ var VAL_SESSION_COOKIE = core.Internal.VAL_SESSION_COOKIE;
|
|
|
769
769
|
var VAL_STATE_COOKIE = core.Internal.VAL_STATE_COOKIE;
|
|
770
770
|
var VAL_ENABLE_COOKIE_NAME = core.Internal.VAL_ENABLE_COOKIE_NAME;
|
|
771
771
|
|
|
772
|
-
function
|
|
773
|
-
|
|
774
|
-
return e;
|
|
775
|
-
};
|
|
776
|
-
var t,
|
|
777
|
-
e = {},
|
|
778
|
-
r = Object.prototype,
|
|
779
|
-
n = r.hasOwnProperty,
|
|
780
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
781
|
-
t[e] = r.value;
|
|
782
|
-
},
|
|
783
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
784
|
-
a = i.iterator || "@@iterator",
|
|
785
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
786
|
-
u = i.toStringTag || "@@toStringTag";
|
|
787
|
-
function define(t, e, r) {
|
|
788
|
-
return Object.defineProperty(t, e, {
|
|
789
|
-
value: r,
|
|
790
|
-
enumerable: !0,
|
|
791
|
-
configurable: !0,
|
|
792
|
-
writable: !0
|
|
793
|
-
}), t[e];
|
|
794
|
-
}
|
|
772
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
773
|
+
var i = Object.defineProperty;
|
|
795
774
|
try {
|
|
796
|
-
|
|
797
|
-
} catch (
|
|
798
|
-
|
|
799
|
-
return t[e] = r;
|
|
800
|
-
};
|
|
801
|
-
}
|
|
802
|
-
function wrap(t, e, r, n) {
|
|
803
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
804
|
-
a = Object.create(i.prototype),
|
|
805
|
-
c = new Context(n || []);
|
|
806
|
-
return o(a, "_invoke", {
|
|
807
|
-
value: makeInvokeMethod(t, r, c)
|
|
808
|
-
}), a;
|
|
809
|
-
}
|
|
810
|
-
function tryCatch(t, e, r) {
|
|
811
|
-
try {
|
|
812
|
-
return {
|
|
813
|
-
type: "normal",
|
|
814
|
-
arg: t.call(e, r)
|
|
815
|
-
};
|
|
816
|
-
} catch (t) {
|
|
817
|
-
return {
|
|
818
|
-
type: "throw",
|
|
819
|
-
arg: t
|
|
820
|
-
};
|
|
821
|
-
}
|
|
775
|
+
i({}, "", {});
|
|
776
|
+
} catch (e) {
|
|
777
|
+
i = 0;
|
|
822
778
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
s = "completed",
|
|
828
|
-
y = {};
|
|
829
|
-
function Generator() {}
|
|
830
|
-
function GeneratorFunction() {}
|
|
831
|
-
function GeneratorFunctionPrototype() {}
|
|
832
|
-
var p = {};
|
|
833
|
-
define(p, a, function () {
|
|
834
|
-
return this;
|
|
835
|
-
});
|
|
836
|
-
var d = Object.getPrototypeOf,
|
|
837
|
-
v = d && d(d(values([])));
|
|
838
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
839
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
840
|
-
function defineIteratorMethods(t) {
|
|
841
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
842
|
-
define(t, e, function (t) {
|
|
843
|
-
return this._invoke(e, t);
|
|
779
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
780
|
+
function o(r, n) {
|
|
781
|
+
_regeneratorDefine(e, r, function (e) {
|
|
782
|
+
return this._invoke(r, n, e);
|
|
844
783
|
});
|
|
845
|
-
});
|
|
846
|
-
}
|
|
847
|
-
function AsyncIterator(t, e) {
|
|
848
|
-
function invoke(r, o, i, a) {
|
|
849
|
-
var c = tryCatch(t[r], t, o);
|
|
850
|
-
if ("throw" !== c.type) {
|
|
851
|
-
var u = c.arg,
|
|
852
|
-
h = u.value;
|
|
853
|
-
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
854
|
-
invoke("next", t, i, a);
|
|
855
|
-
}, function (t) {
|
|
856
|
-
invoke("throw", t, i, a);
|
|
857
|
-
}) : e.resolve(h).then(function (t) {
|
|
858
|
-
u.value = t, i(u);
|
|
859
|
-
}, function (t) {
|
|
860
|
-
return invoke("throw", t, i, a);
|
|
861
|
-
});
|
|
862
|
-
}
|
|
863
|
-
a(c.arg);
|
|
864
784
|
}
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
785
|
+
r ? i ? i(e, r, {
|
|
786
|
+
value: n,
|
|
787
|
+
enumerable: !t,
|
|
788
|
+
configurable: !t,
|
|
789
|
+
writable: !t
|
|
790
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
791
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
function _regenerator() {
|
|
795
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
796
|
+
var e,
|
|
797
|
+
t,
|
|
798
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
799
|
+
n = r.iterator || "@@iterator",
|
|
800
|
+
o = r.toStringTag || "@@toStringTag";
|
|
801
|
+
function i(r, n, o, i) {
|
|
802
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
803
|
+
u = Object.create(c.prototype);
|
|
804
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
805
|
+
var i,
|
|
806
|
+
c,
|
|
807
|
+
u,
|
|
808
|
+
f = 0,
|
|
809
|
+
p = o || [],
|
|
810
|
+
y = !1,
|
|
811
|
+
G = {
|
|
812
|
+
p: 0,
|
|
813
|
+
n: 0,
|
|
814
|
+
v: e,
|
|
815
|
+
a: d,
|
|
816
|
+
f: d.bind(e, 4),
|
|
817
|
+
d: function (t, r) {
|
|
818
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
function d(r, n) {
|
|
822
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
823
|
+
var o,
|
|
824
|
+
i = p[t],
|
|
825
|
+
d = G.p,
|
|
826
|
+
l = i[2];
|
|
827
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
872
828
|
}
|
|
873
|
-
|
|
829
|
+
if (o || r > 1) return a;
|
|
830
|
+
throw y = !0, n;
|
|
874
831
|
}
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
832
|
+
return function (o, p, l) {
|
|
833
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
834
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
835
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
836
|
+
try {
|
|
837
|
+
if (f = 2, i) {
|
|
838
|
+
if (c || (o = "next"), t = i[o]) {
|
|
839
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
840
|
+
if (!t.done) return t;
|
|
841
|
+
u = t.value, c < 2 && (c = 0);
|
|
842
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
843
|
+
i = e;
|
|
844
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
845
|
+
} catch (t) {
|
|
846
|
+
i = e, c = 1, u = t;
|
|
847
|
+
} finally {
|
|
848
|
+
f = 1;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
883
851
|
return {
|
|
884
852
|
value: t,
|
|
885
|
-
done:
|
|
853
|
+
done: y
|
|
886
854
|
};
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
var c = n.delegate;
|
|
890
|
-
if (c) {
|
|
891
|
-
var u = maybeInvokeDelegate(c, n);
|
|
892
|
-
if (u) {
|
|
893
|
-
if (u === y) continue;
|
|
894
|
-
return u;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
898
|
-
if (o === h) throw o = s, n.arg;
|
|
899
|
-
n.dispatchException(n.arg);
|
|
900
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
901
|
-
o = f;
|
|
902
|
-
var p = tryCatch(e, r, n);
|
|
903
|
-
if ("normal" === p.type) {
|
|
904
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
905
|
-
return {
|
|
906
|
-
value: p.arg,
|
|
907
|
-
done: n.done
|
|
908
|
-
};
|
|
909
|
-
}
|
|
910
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
911
|
-
}
|
|
912
|
-
};
|
|
913
|
-
}
|
|
914
|
-
function maybeInvokeDelegate(e, r) {
|
|
915
|
-
var n = r.method,
|
|
916
|
-
o = e.iterator[n];
|
|
917
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
918
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
919
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
920
|
-
var a = i.arg;
|
|
921
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
922
|
-
}
|
|
923
|
-
function pushTryEntry(t) {
|
|
924
|
-
var e = {
|
|
925
|
-
tryLoc: t[0]
|
|
926
|
-
};
|
|
927
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
928
|
-
}
|
|
929
|
-
function resetTryEntry(t) {
|
|
930
|
-
var e = t.completion || {};
|
|
931
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
932
|
-
}
|
|
933
|
-
function Context(t) {
|
|
934
|
-
this.tryEntries = [{
|
|
935
|
-
tryLoc: "root"
|
|
936
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
855
|
+
};
|
|
856
|
+
}(r, o, i), !0), u;
|
|
937
857
|
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
return i.next = i;
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
858
|
+
var a = {};
|
|
859
|
+
function Generator() {}
|
|
860
|
+
function GeneratorFunction() {}
|
|
861
|
+
function GeneratorFunctionPrototype() {}
|
|
862
|
+
t = Object.getPrototypeOf;
|
|
863
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
864
|
+
return this;
|
|
865
|
+
}), t),
|
|
866
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
867
|
+
function f(e) {
|
|
868
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
953
869
|
}
|
|
954
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
955
|
-
value: GeneratorFunctionPrototype,
|
|
956
|
-
configurable: !0
|
|
957
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
958
|
-
value: GeneratorFunction,
|
|
959
|
-
configurable: !0
|
|
960
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
961
|
-
var e = "function" == typeof t && t.constructor;
|
|
962
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
963
|
-
}, e.mark = function (t) {
|
|
964
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
965
|
-
}, e.awrap = function (t) {
|
|
966
|
-
return {
|
|
967
|
-
__await: t
|
|
968
|
-
};
|
|
969
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
870
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
970
871
|
return this;
|
|
971
|
-
}),
|
|
972
|
-
void 0 === i && (i = Promise);
|
|
973
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
974
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
975
|
-
return t.done ? t.value : a.next();
|
|
976
|
-
});
|
|
977
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
978
|
-
return this;
|
|
979
|
-
}), define(g, "toString", function () {
|
|
872
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
980
873
|
return "[object Generator]";
|
|
981
|
-
}),
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
return r.reverse(), function next() {
|
|
986
|
-
for (; r.length;) {
|
|
987
|
-
var t = r.pop();
|
|
988
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
989
|
-
}
|
|
990
|
-
return next.done = !0, next;
|
|
874
|
+
}), (_regenerator = function () {
|
|
875
|
+
return {
|
|
876
|
+
w: i,
|
|
877
|
+
m: f
|
|
991
878
|
};
|
|
992
|
-
}
|
|
993
|
-
constructor: Context,
|
|
994
|
-
reset: function (e) {
|
|
995
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
996
|
-
},
|
|
997
|
-
stop: function () {
|
|
998
|
-
this.done = !0;
|
|
999
|
-
var t = this.tryEntries[0].completion;
|
|
1000
|
-
if ("throw" === t.type) throw t.arg;
|
|
1001
|
-
return this.rval;
|
|
1002
|
-
},
|
|
1003
|
-
dispatchException: function (e) {
|
|
1004
|
-
if (this.done) throw e;
|
|
1005
|
-
var r = this;
|
|
1006
|
-
function handle(n, o) {
|
|
1007
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
1008
|
-
}
|
|
1009
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
1010
|
-
var i = this.tryEntries[o],
|
|
1011
|
-
a = i.completion;
|
|
1012
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
1013
|
-
if (i.tryLoc <= this.prev) {
|
|
1014
|
-
var c = n.call(i, "catchLoc"),
|
|
1015
|
-
u = n.call(i, "finallyLoc");
|
|
1016
|
-
if (c && u) {
|
|
1017
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
1018
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
1019
|
-
} else if (c) {
|
|
1020
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
1021
|
-
} else {
|
|
1022
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
1023
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
},
|
|
1028
|
-
abrupt: function (t, e) {
|
|
1029
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
1030
|
-
var o = this.tryEntries[r];
|
|
1031
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
1032
|
-
var i = o;
|
|
1033
|
-
break;
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
1037
|
-
var a = i ? i.completion : {};
|
|
1038
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
1039
|
-
},
|
|
1040
|
-
complete: function (t, e) {
|
|
1041
|
-
if ("throw" === t.type) throw t.arg;
|
|
1042
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
1043
|
-
},
|
|
1044
|
-
finish: function (t) {
|
|
1045
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
1046
|
-
var r = this.tryEntries[e];
|
|
1047
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
1048
|
-
}
|
|
1049
|
-
},
|
|
1050
|
-
catch: function (t) {
|
|
1051
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
1052
|
-
var r = this.tryEntries[e];
|
|
1053
|
-
if (r.tryLoc === t) {
|
|
1054
|
-
var n = r.completion;
|
|
1055
|
-
if ("throw" === n.type) {
|
|
1056
|
-
var o = n.arg;
|
|
1057
|
-
resetTryEntry(r);
|
|
1058
|
-
}
|
|
1059
|
-
return o;
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
throw Error("illegal catch attempt");
|
|
1063
|
-
},
|
|
1064
|
-
delegateYield: function (e, r, n) {
|
|
1065
|
-
return this.delegate = {
|
|
1066
|
-
iterator: values(e),
|
|
1067
|
-
resultName: r,
|
|
1068
|
-
nextLoc: n
|
|
1069
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
1070
|
-
}
|
|
1071
|
-
}, e;
|
|
879
|
+
})();
|
|
1072
880
|
}
|
|
1073
881
|
|
|
1074
882
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -2126,11 +1934,11 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2126
1934
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2127
1935
|
var anyApi = Api;
|
|
2128
1936
|
return /*#__PURE__*/function () {
|
|
2129
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/
|
|
1937
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(path, method, req) {
|
|
2130
1938
|
var _anyApi$path, _apiEndpoint$req$body;
|
|
2131
|
-
var anyReq, fullPath, params, _i, _Object$keys, _anyReq$query, key, _anyReq$query2, _iterator, _step, value, _anyReq$query3, _anyReq$query4, apiEndpoint, reqBodyResult, res;
|
|
2132
|
-
return
|
|
2133
|
-
while (1) switch (_context2.
|
|
1939
|
+
var anyReq, fullPath, params, _i, _Object$keys, _anyReq$query, key, _anyReq$query2, _iterator, _step, value, _anyReq$query3, _anyReq$query4, apiEndpoint, reqBodyResult, res, _t;
|
|
1940
|
+
return _regenerator().w(function (_context2) {
|
|
1941
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
2134
1942
|
case 0:
|
|
2135
1943
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2136
1944
|
anyReq = req;
|
|
@@ -2168,10 +1976,10 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2168
1976
|
}
|
|
2169
1977
|
apiEndpoint = anyApi === null || anyApi === void 0 || (_anyApi$path = anyApi[path]) === null || _anyApi$path === void 0 ? void 0 : _anyApi$path[method];
|
|
2170
1978
|
if (apiEndpoint) {
|
|
2171
|
-
_context2.
|
|
1979
|
+
_context2.n = 1;
|
|
2172
1980
|
break;
|
|
2173
1981
|
}
|
|
2174
|
-
return _context2.
|
|
1982
|
+
return _context2.a(2, {
|
|
2175
1983
|
status: null,
|
|
2176
1984
|
json: {
|
|
2177
1985
|
message: "Invalid route ".concat(path, " with method ").concat(method, ". This is most likely a Val bug."),
|
|
@@ -2187,10 +1995,10 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2187
1995
|
}
|
|
2188
1996
|
}
|
|
2189
1997
|
});
|
|
2190
|
-
case
|
|
1998
|
+
case 1:
|
|
2191
1999
|
reqBodyResult = (_apiEndpoint$req$body = apiEndpoint.req.body) === null || _apiEndpoint$req$body === void 0 ? void 0 : _apiEndpoint$req$body.safeParse(anyReq.body);
|
|
2192
2000
|
if (!(reqBodyResult && !reqBodyResult.success)) {
|
|
2193
|
-
_context2.
|
|
2001
|
+
_context2.n = 2;
|
|
2194
2002
|
break;
|
|
2195
2003
|
}
|
|
2196
2004
|
console.error("Got an invalid request body while validating client-side. This is most likely a Val bug.", {
|
|
@@ -2199,7 +2007,7 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2199
2007
|
body: anyReq.body,
|
|
2200
2008
|
error: reqBodyResult.error
|
|
2201
2009
|
});
|
|
2202
|
-
return _context2.
|
|
2010
|
+
return _context2.a(2, {
|
|
2203
2011
|
status: null,
|
|
2204
2012
|
json: {
|
|
2205
2013
|
message: "There was an issue validating your data. This is most likely a Val bug.",
|
|
@@ -2210,9 +2018,9 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2210
2018
|
}
|
|
2211
2019
|
}
|
|
2212
2020
|
});
|
|
2213
|
-
case
|
|
2214
|
-
_context2.
|
|
2215
|
-
_context2.
|
|
2021
|
+
case 2:
|
|
2022
|
+
_context2.p = 2;
|
|
2023
|
+
_context2.n = 3;
|
|
2216
2024
|
return fetch("".concat(host).concat(fullPath), {
|
|
2217
2025
|
method: method,
|
|
2218
2026
|
headers: {
|
|
@@ -2220,18 +2028,18 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2220
2028
|
},
|
|
2221
2029
|
body: anyReq.body !== undefined ? JSON.stringify(anyReq.body) : undefined
|
|
2222
2030
|
}).then(/*#__PURE__*/function () {
|
|
2223
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
2031
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(res) {
|
|
2224
2032
|
var _apiEndpoint$res;
|
|
2225
2033
|
var contentTypeHeaders, json, valClientResult, responseResult;
|
|
2226
|
-
return
|
|
2227
|
-
while (1) switch (_context.
|
|
2034
|
+
return _regenerator().w(function (_context) {
|
|
2035
|
+
while (1) switch (_context.n) {
|
|
2228
2036
|
case 0:
|
|
2229
2037
|
contentTypeHeaders = res.headers.get("content-type");
|
|
2230
2038
|
if (!(res.status === 413)) {
|
|
2231
|
-
_context.
|
|
2039
|
+
_context.n = 1;
|
|
2232
2040
|
break;
|
|
2233
2041
|
}
|
|
2234
|
-
return _context.
|
|
2042
|
+
return _context.a(2, {
|
|
2235
2043
|
status: 413,
|
|
2236
2044
|
json: {
|
|
2237
2045
|
message: "Request too large.",
|
|
@@ -2239,12 +2047,12 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2239
2047
|
path: path
|
|
2240
2048
|
}
|
|
2241
2049
|
});
|
|
2242
|
-
case
|
|
2050
|
+
case 1:
|
|
2243
2051
|
if (contentTypeHeaders !== null && contentTypeHeaders !== void 0 && contentTypeHeaders.includes("application/json")) {
|
|
2244
|
-
_context.
|
|
2052
|
+
_context.n = 2;
|
|
2245
2053
|
break;
|
|
2246
2054
|
}
|
|
2247
|
-
return _context.
|
|
2055
|
+
return _context.a(2, {
|
|
2248
2056
|
status: null,
|
|
2249
2057
|
json: {
|
|
2250
2058
|
type: "client_side_validation_error",
|
|
@@ -2258,34 +2066,34 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2258
2066
|
}
|
|
2259
2067
|
}
|
|
2260
2068
|
});
|
|
2261
|
-
case
|
|
2262
|
-
_context.
|
|
2069
|
+
case 2:
|
|
2070
|
+
_context.n = 3;
|
|
2263
2071
|
return res.json();
|
|
2264
|
-
case
|
|
2265
|
-
json = _context.
|
|
2072
|
+
case 3:
|
|
2073
|
+
json = _context.v;
|
|
2266
2074
|
valClientResult = {
|
|
2267
2075
|
status: res.status,
|
|
2268
2076
|
json: json
|
|
2269
2077
|
};
|
|
2270
2078
|
if (!(res.status === 500)) {
|
|
2271
|
-
_context.
|
|
2079
|
+
_context.n = 4;
|
|
2272
2080
|
break;
|
|
2273
2081
|
}
|
|
2274
2082
|
console.error("Server responded with an error", json);
|
|
2275
|
-
return _context.
|
|
2083
|
+
return _context.a(2, {
|
|
2276
2084
|
status: 500,
|
|
2277
2085
|
json: _objectSpread2({
|
|
2278
2086
|
type: "unknown",
|
|
2279
2087
|
message: json.message
|
|
2280
2088
|
}, json)
|
|
2281
2089
|
});
|
|
2282
|
-
case
|
|
2090
|
+
case 4:
|
|
2283
2091
|
responseResult = (_apiEndpoint$res = apiEndpoint.res) === null || _apiEndpoint$res === void 0 ? void 0 : _apiEndpoint$res.safeParse(valClientResult);
|
|
2284
2092
|
if (!(responseResult && !responseResult.success)) {
|
|
2285
|
-
_context.
|
|
2093
|
+
_context.n = 5;
|
|
2286
2094
|
break;
|
|
2287
2095
|
}
|
|
2288
|
-
return _context.
|
|
2096
|
+
return _context.a(2, {
|
|
2289
2097
|
status: null,
|
|
2290
2098
|
json: {
|
|
2291
2099
|
message: "Response could not be validated. This could also be a result of mismatched Val versions.",
|
|
@@ -2296,14 +2104,11 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2296
2104
|
}
|
|
2297
2105
|
}
|
|
2298
2106
|
});
|
|
2299
|
-
case
|
|
2300
|
-
return _context.
|
|
2107
|
+
case 5:
|
|
2108
|
+
return _context.a(2, {
|
|
2301
2109
|
status: res.status,
|
|
2302
2110
|
json: json
|
|
2303
2111
|
});
|
|
2304
|
-
case 16:
|
|
2305
|
-
case "end":
|
|
2306
|
-
return _context.stop();
|
|
2307
2112
|
}
|
|
2308
2113
|
}, _callee);
|
|
2309
2114
|
}));
|
|
@@ -2311,26 +2116,23 @@ var createValClient = function createValClient(host, config // We want to use th
|
|
|
2311
2116
|
return _ref2.apply(this, arguments);
|
|
2312
2117
|
};
|
|
2313
2118
|
}());
|
|
2314
|
-
case
|
|
2315
|
-
res = _context2.
|
|
2316
|
-
return _context2.
|
|
2317
|
-
case
|
|
2318
|
-
_context2.
|
|
2319
|
-
|
|
2320
|
-
return _context2.
|
|
2119
|
+
case 3:
|
|
2120
|
+
res = _context2.v;
|
|
2121
|
+
return _context2.a(2, res);
|
|
2122
|
+
case 4:
|
|
2123
|
+
_context2.p = 4;
|
|
2124
|
+
_t = _context2.v;
|
|
2125
|
+
return _context2.a(2, {
|
|
2321
2126
|
status: null,
|
|
2322
2127
|
json: {
|
|
2323
2128
|
message: "Failed to fetch data",
|
|
2324
2129
|
type: "network_error",
|
|
2325
|
-
retryable: isRetryable(
|
|
2326
|
-
details:
|
|
2130
|
+
retryable: isRetryable(_t),
|
|
2131
|
+
details: _t instanceof Error ? _t.message : JSON.stringify(_t)
|
|
2327
2132
|
}
|
|
2328
2133
|
});
|
|
2329
|
-
case 21:
|
|
2330
|
-
case "end":
|
|
2331
|
-
return _context2.stop();
|
|
2332
2134
|
}
|
|
2333
|
-
}, _callee2, null, [[
|
|
2135
|
+
}, _callee2, null, [[2, 4]]);
|
|
2334
2136
|
}));
|
|
2335
2137
|
return function (_x, _x2, _x3) {
|
|
2336
2138
|
return _ref.apply(this, arguments);
|