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