@budibase/backend-core 2.13.12 → 2.13.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -8,6 +8,9 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
8
|
var __esm = (fn, res) => function __init() {
|
|
9
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
10
10
|
};
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
+
};
|
|
11
14
|
var __export = (target, all) => {
|
|
12
15
|
for (var name in all)
|
|
13
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -5601,6 +5604,301 @@ var init_logging = __esm({
|
|
|
5601
5604
|
}
|
|
5602
5605
|
});
|
|
5603
5606
|
|
|
5607
|
+
// ../../node_modules/dayjs/dayjs.min.js
|
|
5608
|
+
var require_dayjs_min = __commonJS({
|
|
5609
|
+
"../../node_modules/dayjs/dayjs.min.js"(exports, module2) {
|
|
5610
|
+
"use strict";
|
|
5611
|
+
!function(t, e) {
|
|
5612
|
+
"object" == typeof exports && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
5613
|
+
}(exports, function() {
|
|
5614
|
+
"use strict";
|
|
5615
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
5616
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
5617
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
5618
|
+
} }, m = function(t2, e2, n2) {
|
|
5619
|
+
var r2 = String(t2);
|
|
5620
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
5621
|
+
}, v = { s: m, z: function(t2) {
|
|
5622
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
5623
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
5624
|
+
}, m: function t2(e2, n2) {
|
|
5625
|
+
if (e2.date() < n2.date())
|
|
5626
|
+
return -t2(n2, e2);
|
|
5627
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
5628
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
5629
|
+
}, a: function(t2) {
|
|
5630
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
5631
|
+
}, p: function(t2) {
|
|
5632
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
5633
|
+
}, u: function(t2) {
|
|
5634
|
+
return void 0 === t2;
|
|
5635
|
+
} }, g = "en", D = {};
|
|
5636
|
+
D[g] = M;
|
|
5637
|
+
var p = function(t2) {
|
|
5638
|
+
return t2 instanceof b;
|
|
5639
|
+
}, S = function t2(e2, n2, r2) {
|
|
5640
|
+
var i2;
|
|
5641
|
+
if (!e2)
|
|
5642
|
+
return g;
|
|
5643
|
+
if ("string" == typeof e2) {
|
|
5644
|
+
var s2 = e2.toLowerCase();
|
|
5645
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
5646
|
+
var u2 = e2.split("-");
|
|
5647
|
+
if (!i2 && u2.length > 1)
|
|
5648
|
+
return t2(u2[0]);
|
|
5649
|
+
} else {
|
|
5650
|
+
var a2 = e2.name;
|
|
5651
|
+
D[a2] = e2, i2 = a2;
|
|
5652
|
+
}
|
|
5653
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
5654
|
+
}, w = function(t2, e2) {
|
|
5655
|
+
if (p(t2))
|
|
5656
|
+
return t2.clone();
|
|
5657
|
+
var n2 = "object" == typeof e2 ? e2 : {};
|
|
5658
|
+
return n2.date = t2, n2.args = arguments, new b(n2);
|
|
5659
|
+
}, O = v;
|
|
5660
|
+
O.l = S, O.i = p, O.w = function(t2, e2) {
|
|
5661
|
+
return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
5662
|
+
};
|
|
5663
|
+
var b = function() {
|
|
5664
|
+
function M2(t2) {
|
|
5665
|
+
this.$L = S(t2.locale, null, true), this.parse(t2);
|
|
5666
|
+
}
|
|
5667
|
+
var m2 = M2.prototype;
|
|
5668
|
+
return m2.parse = function(t2) {
|
|
5669
|
+
this.$d = function(t3) {
|
|
5670
|
+
var e2 = t3.date, n2 = t3.utc;
|
|
5671
|
+
if (null === e2)
|
|
5672
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
5673
|
+
if (O.u(e2))
|
|
5674
|
+
return /* @__PURE__ */ new Date();
|
|
5675
|
+
if (e2 instanceof Date)
|
|
5676
|
+
return new Date(e2);
|
|
5677
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
5678
|
+
var r2 = e2.match($);
|
|
5679
|
+
if (r2) {
|
|
5680
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
5681
|
+
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
5682
|
+
}
|
|
5683
|
+
}
|
|
5684
|
+
return new Date(e2);
|
|
5685
|
+
}(t2), this.$x = t2.x || {}, this.init();
|
|
5686
|
+
}, m2.init = function() {
|
|
5687
|
+
var t2 = this.$d;
|
|
5688
|
+
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
5689
|
+
}, m2.$utils = function() {
|
|
5690
|
+
return O;
|
|
5691
|
+
}, m2.isValid = function() {
|
|
5692
|
+
return !(this.$d.toString() === l);
|
|
5693
|
+
}, m2.isSame = function(t2, e2) {
|
|
5694
|
+
var n2 = w(t2);
|
|
5695
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
5696
|
+
}, m2.isAfter = function(t2, e2) {
|
|
5697
|
+
return w(t2) < this.startOf(e2);
|
|
5698
|
+
}, m2.isBefore = function(t2, e2) {
|
|
5699
|
+
return this.endOf(e2) < w(t2);
|
|
5700
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
5701
|
+
return O.u(t2) ? this[e2] : this.set(n2, t2);
|
|
5702
|
+
}, m2.unix = function() {
|
|
5703
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
5704
|
+
}, m2.valueOf = function() {
|
|
5705
|
+
return this.$d.getTime();
|
|
5706
|
+
}, m2.startOf = function(t2, e2) {
|
|
5707
|
+
var n2 = this, r2 = !!O.u(e2) || e2, f2 = O.p(t2), l2 = function(t3, e3) {
|
|
5708
|
+
var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
5709
|
+
return r2 ? i2 : i2.endOf(a);
|
|
5710
|
+
}, $2 = function(t3, e3) {
|
|
5711
|
+
return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
5712
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
5713
|
+
switch (f2) {
|
|
5714
|
+
case h:
|
|
5715
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
5716
|
+
case c:
|
|
5717
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
5718
|
+
case o:
|
|
5719
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
5720
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
5721
|
+
case a:
|
|
5722
|
+
case d:
|
|
5723
|
+
return $2(v2 + "Hours", 0);
|
|
5724
|
+
case u:
|
|
5725
|
+
return $2(v2 + "Minutes", 1);
|
|
5726
|
+
case s:
|
|
5727
|
+
return $2(v2 + "Seconds", 2);
|
|
5728
|
+
case i:
|
|
5729
|
+
return $2(v2 + "Milliseconds", 3);
|
|
5730
|
+
default:
|
|
5731
|
+
return this.clone();
|
|
5732
|
+
}
|
|
5733
|
+
}, m2.endOf = function(t2) {
|
|
5734
|
+
return this.startOf(t2, false);
|
|
5735
|
+
}, m2.$set = function(t2, e2) {
|
|
5736
|
+
var n2, o2 = O.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
5737
|
+
if (o2 === c || o2 === h) {
|
|
5738
|
+
var y2 = this.clone().set(d, 1);
|
|
5739
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
5740
|
+
} else
|
|
5741
|
+
l2 && this.$d[l2]($2);
|
|
5742
|
+
return this.init(), this;
|
|
5743
|
+
}, m2.set = function(t2, e2) {
|
|
5744
|
+
return this.clone().$set(t2, e2);
|
|
5745
|
+
}, m2.get = function(t2) {
|
|
5746
|
+
return this[O.p(t2)]();
|
|
5747
|
+
}, m2.add = function(r2, f2) {
|
|
5748
|
+
var d2, l2 = this;
|
|
5749
|
+
r2 = Number(r2);
|
|
5750
|
+
var $2 = O.p(f2), y2 = function(t2) {
|
|
5751
|
+
var e2 = w(l2);
|
|
5752
|
+
return O.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
5753
|
+
};
|
|
5754
|
+
if ($2 === c)
|
|
5755
|
+
return this.set(c, this.$M + r2);
|
|
5756
|
+
if ($2 === h)
|
|
5757
|
+
return this.set(h, this.$y + r2);
|
|
5758
|
+
if ($2 === a)
|
|
5759
|
+
return y2(1);
|
|
5760
|
+
if ($2 === o)
|
|
5761
|
+
return y2(7);
|
|
5762
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
5763
|
+
return O.w(m3, this);
|
|
5764
|
+
}, m2.subtract = function(t2, e2) {
|
|
5765
|
+
return this.add(-1 * t2, e2);
|
|
5766
|
+
}, m2.format = function(t2) {
|
|
5767
|
+
var e2 = this, n2 = this.$locale();
|
|
5768
|
+
if (!this.isValid())
|
|
5769
|
+
return n2.invalidDate || l;
|
|
5770
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
5771
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
5772
|
+
}, d2 = function(t3) {
|
|
5773
|
+
return O.s(s2 % 12 || 12, t3, "0");
|
|
5774
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
5775
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
5776
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
5777
|
+
};
|
|
5778
|
+
return r2.replace(y, function(t3, r3) {
|
|
5779
|
+
return r3 || function(t4) {
|
|
5780
|
+
switch (t4) {
|
|
5781
|
+
case "YY":
|
|
5782
|
+
return String(e2.$y).slice(-2);
|
|
5783
|
+
case "YYYY":
|
|
5784
|
+
return O.s(e2.$y, 4, "0");
|
|
5785
|
+
case "M":
|
|
5786
|
+
return a2 + 1;
|
|
5787
|
+
case "MM":
|
|
5788
|
+
return O.s(a2 + 1, 2, "0");
|
|
5789
|
+
case "MMM":
|
|
5790
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
5791
|
+
case "MMMM":
|
|
5792
|
+
return h2(c2, a2);
|
|
5793
|
+
case "D":
|
|
5794
|
+
return e2.$D;
|
|
5795
|
+
case "DD":
|
|
5796
|
+
return O.s(e2.$D, 2, "0");
|
|
5797
|
+
case "d":
|
|
5798
|
+
return String(e2.$W);
|
|
5799
|
+
case "dd":
|
|
5800
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
5801
|
+
case "ddd":
|
|
5802
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
5803
|
+
case "dddd":
|
|
5804
|
+
return o2[e2.$W];
|
|
5805
|
+
case "H":
|
|
5806
|
+
return String(s2);
|
|
5807
|
+
case "HH":
|
|
5808
|
+
return O.s(s2, 2, "0");
|
|
5809
|
+
case "h":
|
|
5810
|
+
return d2(1);
|
|
5811
|
+
case "hh":
|
|
5812
|
+
return d2(2);
|
|
5813
|
+
case "a":
|
|
5814
|
+
return $2(s2, u2, true);
|
|
5815
|
+
case "A":
|
|
5816
|
+
return $2(s2, u2, false);
|
|
5817
|
+
case "m":
|
|
5818
|
+
return String(u2);
|
|
5819
|
+
case "mm":
|
|
5820
|
+
return O.s(u2, 2, "0");
|
|
5821
|
+
case "s":
|
|
5822
|
+
return String(e2.$s);
|
|
5823
|
+
case "ss":
|
|
5824
|
+
return O.s(e2.$s, 2, "0");
|
|
5825
|
+
case "SSS":
|
|
5826
|
+
return O.s(e2.$ms, 3, "0");
|
|
5827
|
+
case "Z":
|
|
5828
|
+
return i2;
|
|
5829
|
+
}
|
|
5830
|
+
return null;
|
|
5831
|
+
}(t3) || i2.replace(":", "");
|
|
5832
|
+
});
|
|
5833
|
+
}, m2.utcOffset = function() {
|
|
5834
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
5835
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
5836
|
+
var $2, y2 = this, M3 = O.p(d2), m3 = w(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
5837
|
+
return O.m(y2, m3);
|
|
5838
|
+
};
|
|
5839
|
+
switch (M3) {
|
|
5840
|
+
case h:
|
|
5841
|
+
$2 = D2() / 12;
|
|
5842
|
+
break;
|
|
5843
|
+
case c:
|
|
5844
|
+
$2 = D2();
|
|
5845
|
+
break;
|
|
5846
|
+
case f:
|
|
5847
|
+
$2 = D2() / 3;
|
|
5848
|
+
break;
|
|
5849
|
+
case o:
|
|
5850
|
+
$2 = (g2 - v2) / 6048e5;
|
|
5851
|
+
break;
|
|
5852
|
+
case a:
|
|
5853
|
+
$2 = (g2 - v2) / 864e5;
|
|
5854
|
+
break;
|
|
5855
|
+
case u:
|
|
5856
|
+
$2 = g2 / n;
|
|
5857
|
+
break;
|
|
5858
|
+
case s:
|
|
5859
|
+
$2 = g2 / e;
|
|
5860
|
+
break;
|
|
5861
|
+
case i:
|
|
5862
|
+
$2 = g2 / t;
|
|
5863
|
+
break;
|
|
5864
|
+
default:
|
|
5865
|
+
$2 = g2;
|
|
5866
|
+
}
|
|
5867
|
+
return l2 ? $2 : O.a($2);
|
|
5868
|
+
}, m2.daysInMonth = function() {
|
|
5869
|
+
return this.endOf(c).$D;
|
|
5870
|
+
}, m2.$locale = function() {
|
|
5871
|
+
return D[this.$L];
|
|
5872
|
+
}, m2.locale = function(t2, e2) {
|
|
5873
|
+
if (!t2)
|
|
5874
|
+
return this.$L;
|
|
5875
|
+
var n2 = this.clone(), r2 = S(t2, e2, true);
|
|
5876
|
+
return r2 && (n2.$L = r2), n2;
|
|
5877
|
+
}, m2.clone = function() {
|
|
5878
|
+
return O.w(this.$d, this);
|
|
5879
|
+
}, m2.toDate = function() {
|
|
5880
|
+
return new Date(this.valueOf());
|
|
5881
|
+
}, m2.toJSON = function() {
|
|
5882
|
+
return this.isValid() ? this.toISOString() : null;
|
|
5883
|
+
}, m2.toISOString = function() {
|
|
5884
|
+
return this.$d.toISOString();
|
|
5885
|
+
}, m2.toString = function() {
|
|
5886
|
+
return this.$d.toUTCString();
|
|
5887
|
+
}, M2;
|
|
5888
|
+
}(), _2 = b.prototype;
|
|
5889
|
+
return w.prototype = _2, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
|
|
5890
|
+
_2[t2[1]] = function(e2) {
|
|
5891
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
5892
|
+
};
|
|
5893
|
+
}), w.extend = function(t2, e2) {
|
|
5894
|
+
return t2.$i || (t2(e2, b, w), t2.$i = true), w;
|
|
5895
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
|
|
5896
|
+
return w(1e3 * t2);
|
|
5897
|
+
}, w.en = D[g], w.Ls = D, w.p = {}, w;
|
|
5898
|
+
});
|
|
5899
|
+
}
|
|
5900
|
+
});
|
|
5901
|
+
|
|
5604
5902
|
// src/index.ts
|
|
5605
5903
|
var src_exports = {};
|
|
5606
5904
|
__export(src_exports, {
|
|
@@ -6079,6 +6377,7 @@ init_init();
|
|
|
6079
6377
|
init_src();
|
|
6080
6378
|
init_context2();
|
|
6081
6379
|
init_environment2();
|
|
6380
|
+
init_logging();
|
|
6082
6381
|
async function getClient(type, opts) {
|
|
6083
6382
|
if (type === "custom" /* CUSTOM */) {
|
|
6084
6383
|
return newRedlock(opts);
|
|
@@ -6161,16 +6460,14 @@ async function doWithLock(opts, task) {
|
|
|
6161
6460
|
const result = await task();
|
|
6162
6461
|
return { executed: true, result };
|
|
6163
6462
|
} catch (e) {
|
|
6164
|
-
|
|
6463
|
+
logWarn(`lock type: ${opts.type} error`, e);
|
|
6165
6464
|
if (e.name === "LockError") {
|
|
6166
6465
|
if (opts.type === "try_once" /* TRY_ONCE */) {
|
|
6167
6466
|
return { executed: false };
|
|
6168
6467
|
} else {
|
|
6169
|
-
console.error(e);
|
|
6170
6468
|
throw e;
|
|
6171
6469
|
}
|
|
6172
6470
|
} else {
|
|
6173
|
-
console.error(e);
|
|
6174
6471
|
throw e;
|
|
6175
6472
|
}
|
|
6176
6473
|
} finally {
|
|
@@ -6950,6 +7247,7 @@ var OperatorOptions = {
|
|
|
6950
7247
|
|
|
6951
7248
|
// ../shared-core/src/filters.ts
|
|
6952
7249
|
init_src();
|
|
7250
|
+
var import_dayjs = __toESM(require_dayjs_min());
|
|
6953
7251
|
|
|
6954
7252
|
// ../shared-core/src/helpers/integrations.ts
|
|
6955
7253
|
init_src();
|