@budibase/backend-core 2.13.35 → 2.13.37

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
@@ -974,6 +974,7 @@ var init_document = __esm({
974
974
  DocumentType2["USER_FLAG"] = "flag";
975
975
  DocumentType2["AUTOMATION_METADATA"] = "meta_au";
976
976
  DocumentType2["AUDIT_LOG"] = "al";
977
+ DocumentType2["APP_MIGRATION_METADATA"] = "_design/migrations";
977
978
  return DocumentType2;
978
979
  })(DocumentType || {});
979
980
  InternalTable = /* @__PURE__ */ ((InternalTable2) => {
@@ -4918,7 +4919,7 @@ async function listAllObjects(bucketName, path2) {
4918
4919
  } while (isTruncated);
4919
4920
  return objects;
4920
4921
  }
4921
- function getPresignedUrl(bucketName, key, durationSeconds = 129600) {
4922
+ function getPresignedUrl(bucketName, key, durationSeconds = 3600) {
4922
4923
  const objectStore = ObjectStore(bucketName, { presigning: true });
4923
4924
  const params2 = {
4924
4925
  Bucket: sanitizeBucket(bucketName),
@@ -5669,9 +5670,9 @@ var require_dayjs_min = __commonJS({
5669
5670
  return void 0 === t2;
5670
5671
  } }, g = "en", D = {};
5671
5672
  D[g] = M;
5672
- var p = function(t2) {
5673
- return t2 instanceof b;
5674
- }, S = function t2(e2, n2, r2) {
5673
+ var p = "$isDayjsObject", S = function(t2) {
5674
+ return t2 instanceof _2 || !(!t2 || !t2[p]);
5675
+ }, w = function t2(e2, n2, r2) {
5675
5676
  var i2;
5676
5677
  if (!e2)
5677
5678
  return g;
@@ -5686,18 +5687,18 @@ var require_dayjs_min = __commonJS({
5686
5687
  D[a2] = e2, i2 = a2;
5687
5688
  }
5688
5689
  return !r2 && i2 && (g = i2), i2 || !r2 && g;
5689
- }, w = function(t2, e2) {
5690
- if (p(t2))
5690
+ }, O = function(t2, e2) {
5691
+ if (S(t2))
5691
5692
  return t2.clone();
5692
5693
  var n2 = "object" == typeof e2 ? e2 : {};
5693
- return n2.date = t2, n2.args = arguments, new b(n2);
5694
- }, O = v;
5695
- O.l = S, O.i = p, O.w = function(t2, e2) {
5696
- return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
5694
+ return n2.date = t2, n2.args = arguments, new _2(n2);
5695
+ }, b = v;
5696
+ b.l = w, b.i = S, b.w = function(t2, e2) {
5697
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
5697
5698
  };
5698
- var b = function() {
5699
+ var _2 = function() {
5699
5700
  function M2(t2) {
5700
- this.$L = S(t2.locale, null, true), this.parse(t2);
5701
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
5701
5702
  }
5702
5703
  var m2 = M2.prototype;
5703
5704
  return m2.parse = function(t2) {
@@ -5705,7 +5706,7 @@ var require_dayjs_min = __commonJS({
5705
5706
  var e2 = t3.date, n2 = t3.utc;
5706
5707
  if (null === e2)
5707
5708
  return /* @__PURE__ */ new Date(NaN);
5708
- if (O.u(e2))
5709
+ if (b.u(e2))
5709
5710
  return /* @__PURE__ */ new Date();
5710
5711
  if (e2 instanceof Date)
5711
5712
  return new Date(e2);
@@ -5717,33 +5718,33 @@ var require_dayjs_min = __commonJS({
5717
5718
  }
5718
5719
  }
5719
5720
  return new Date(e2);
5720
- }(t2), this.$x = t2.x || {}, this.init();
5721
+ }(t2), this.init();
5721
5722
  }, m2.init = function() {
5722
5723
  var t2 = this.$d;
5723
5724
  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();
5724
5725
  }, m2.$utils = function() {
5725
- return O;
5726
+ return b;
5726
5727
  }, m2.isValid = function() {
5727
5728
  return !(this.$d.toString() === l);
5728
5729
  }, m2.isSame = function(t2, e2) {
5729
- var n2 = w(t2);
5730
+ var n2 = O(t2);
5730
5731
  return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
5731
5732
  }, m2.isAfter = function(t2, e2) {
5732
- return w(t2) < this.startOf(e2);
5733
+ return O(t2) < this.startOf(e2);
5733
5734
  }, m2.isBefore = function(t2, e2) {
5734
- return this.endOf(e2) < w(t2);
5735
+ return this.endOf(e2) < O(t2);
5735
5736
  }, m2.$g = function(t2, e2, n2) {
5736
- return O.u(t2) ? this[e2] : this.set(n2, t2);
5737
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
5737
5738
  }, m2.unix = function() {
5738
5739
  return Math.floor(this.valueOf() / 1e3);
5739
5740
  }, m2.valueOf = function() {
5740
5741
  return this.$d.getTime();
5741
5742
  }, m2.startOf = function(t2, e2) {
5742
- var n2 = this, r2 = !!O.u(e2) || e2, f2 = O.p(t2), l2 = function(t3, e3) {
5743
- var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
5743
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
5744
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
5744
5745
  return r2 ? i2 : i2.endOf(a);
5745
5746
  }, $2 = function(t3, e3) {
5746
- return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
5747
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
5747
5748
  }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
5748
5749
  switch (f2) {
5749
5750
  case h:
@@ -5768,7 +5769,7 @@ var require_dayjs_min = __commonJS({
5768
5769
  }, m2.endOf = function(t2) {
5769
5770
  return this.startOf(t2, false);
5770
5771
  }, m2.$set = function(t2, e2) {
5771
- 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;
5772
+ var n2, o2 = b.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;
5772
5773
  if (o2 === c || o2 === h) {
5773
5774
  var y2 = this.clone().set(d, 1);
5774
5775
  y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
@@ -5778,13 +5779,13 @@ var require_dayjs_min = __commonJS({
5778
5779
  }, m2.set = function(t2, e2) {
5779
5780
  return this.clone().$set(t2, e2);
5780
5781
  }, m2.get = function(t2) {
5781
- return this[O.p(t2)]();
5782
+ return this[b.p(t2)]();
5782
5783
  }, m2.add = function(r2, f2) {
5783
5784
  var d2, l2 = this;
5784
5785
  r2 = Number(r2);
5785
- var $2 = O.p(f2), y2 = function(t2) {
5786
- var e2 = w(l2);
5787
- return O.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
5786
+ var $2 = b.p(f2), y2 = function(t2) {
5787
+ var e2 = O(l2);
5788
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
5788
5789
  };
5789
5790
  if ($2 === c)
5790
5791
  return this.set(c, this.$M + r2);
@@ -5795,17 +5796,17 @@ var require_dayjs_min = __commonJS({
5795
5796
  if ($2 === o)
5796
5797
  return y2(7);
5797
5798
  var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
5798
- return O.w(m3, this);
5799
+ return b.w(m3, this);
5799
5800
  }, m2.subtract = function(t2, e2) {
5800
5801
  return this.add(-1 * t2, e2);
5801
5802
  }, m2.format = function(t2) {
5802
5803
  var e2 = this, n2 = this.$locale();
5803
5804
  if (!this.isValid())
5804
5805
  return n2.invalidDate || l;
5805
- 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) {
5806
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.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) {
5806
5807
  return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
5807
5808
  }, d2 = function(t3) {
5808
- return O.s(s2 % 12 || 12, t3, "0");
5809
+ return b.s(s2 % 12 || 12, t3, "0");
5809
5810
  }, $2 = f2 || function(t3, e3, n3) {
5810
5811
  var r3 = t3 < 12 ? "AM" : "PM";
5811
5812
  return n3 ? r3.toLowerCase() : r3;
@@ -5816,11 +5817,11 @@ var require_dayjs_min = __commonJS({
5816
5817
  case "YY":
5817
5818
  return String(e2.$y).slice(-2);
5818
5819
  case "YYYY":
5819
- return O.s(e2.$y, 4, "0");
5820
+ return b.s(e2.$y, 4, "0");
5820
5821
  case "M":
5821
5822
  return a2 + 1;
5822
5823
  case "MM":
5823
- return O.s(a2 + 1, 2, "0");
5824
+ return b.s(a2 + 1, 2, "0");
5824
5825
  case "MMM":
5825
5826
  return h2(n2.monthsShort, a2, c2, 3);
5826
5827
  case "MMMM":
@@ -5828,7 +5829,7 @@ var require_dayjs_min = __commonJS({
5828
5829
  case "D":
5829
5830
  return e2.$D;
5830
5831
  case "DD":
5831
- return O.s(e2.$D, 2, "0");
5832
+ return b.s(e2.$D, 2, "0");
5832
5833
  case "d":
5833
5834
  return String(e2.$W);
5834
5835
  case "dd":
@@ -5840,7 +5841,7 @@ var require_dayjs_min = __commonJS({
5840
5841
  case "H":
5841
5842
  return String(s2);
5842
5843
  case "HH":
5843
- return O.s(s2, 2, "0");
5844
+ return b.s(s2, 2, "0");
5844
5845
  case "h":
5845
5846
  return d2(1);
5846
5847
  case "hh":
@@ -5852,13 +5853,13 @@ var require_dayjs_min = __commonJS({
5852
5853
  case "m":
5853
5854
  return String(u2);
5854
5855
  case "mm":
5855
- return O.s(u2, 2, "0");
5856
+ return b.s(u2, 2, "0");
5856
5857
  case "s":
5857
5858
  return String(e2.$s);
5858
5859
  case "ss":
5859
- return O.s(e2.$s, 2, "0");
5860
+ return b.s(e2.$s, 2, "0");
5860
5861
  case "SSS":
5861
- return O.s(e2.$ms, 3, "0");
5862
+ return b.s(e2.$ms, 3, "0");
5862
5863
  case "Z":
5863
5864
  return i2;
5864
5865
  }
@@ -5868,8 +5869,8 @@ var require_dayjs_min = __commonJS({
5868
5869
  }, m2.utcOffset = function() {
5869
5870
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
5870
5871
  }, m2.diff = function(r2, d2, l2) {
5871
- var $2, y2 = this, M3 = O.p(d2), m3 = w(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
5872
- return O.m(y2, m3);
5872
+ var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
5873
+ return b.m(y2, m3);
5873
5874
  };
5874
5875
  switch (M3) {
5875
5876
  case h:
@@ -5899,7 +5900,7 @@ var require_dayjs_min = __commonJS({
5899
5900
  default:
5900
5901
  $2 = g2;
5901
5902
  }
5902
- return l2 ? $2 : O.a($2);
5903
+ return l2 ? $2 : b.a($2);
5903
5904
  }, m2.daysInMonth = function() {
5904
5905
  return this.endOf(c).$D;
5905
5906
  }, m2.$locale = function() {
@@ -5907,10 +5908,10 @@ var require_dayjs_min = __commonJS({
5907
5908
  }, m2.locale = function(t2, e2) {
5908
5909
  if (!t2)
5909
5910
  return this.$L;
5910
- var n2 = this.clone(), r2 = S(t2, e2, true);
5911
+ var n2 = this.clone(), r2 = w(t2, e2, true);
5911
5912
  return r2 && (n2.$L = r2), n2;
5912
5913
  }, m2.clone = function() {
5913
- return O.w(this.$d, this);
5914
+ return b.w(this.$d, this);
5914
5915
  }, m2.toDate = function() {
5915
5916
  return new Date(this.valueOf());
5916
5917
  }, m2.toJSON = function() {
@@ -5920,16 +5921,16 @@ var require_dayjs_min = __commonJS({
5920
5921
  }, m2.toString = function() {
5921
5922
  return this.$d.toUTCString();
5922
5923
  }, M2;
5923
- }(), _2 = b.prototype;
5924
- return w.prototype = _2, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
5925
- _2[t2[1]] = function(e2) {
5924
+ }(), k = _2.prototype;
5925
+ return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
5926
+ k[t2[1]] = function(e2) {
5926
5927
  return this.$g(e2, t2[0], t2[1]);
5927
5928
  };
5928
- }), w.extend = function(t2, e2) {
5929
- return t2.$i || (t2(e2, b, w), t2.$i = true), w;
5930
- }, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
5931
- return w(1e3 * t2);
5932
- }, w.en = D[g], w.Ls = D, w.p = {}, w;
5929
+ }), O.extend = function(t2, e2) {
5930
+ return t2.$i || (t2(e2, _2, O), t2.$i = true), O;
5931
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
5932
+ return O(1e3 * t2);
5933
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
5933
5934
  });
5934
5935
  }
5935
5936
  });
@@ -8004,6 +8005,7 @@ var JobQueue = /* @__PURE__ */ ((JobQueue2) => {
8004
8005
  JobQueue2["APP_BACKUP"] = "appBackupQueue";
8005
8006
  JobQueue2["AUDIT_LOG"] = "auditLogQueue";
8006
8007
  JobQueue2["SYSTEM_EVENT_QUEUE"] = "systemEventQueue";
8008
+ JobQueue2["APP_MIGRATION"] = "appMigration";
8007
8009
  return JobQueue2;
8008
8010
  })(JobQueue || {});
8009
8011
 
@@ -8055,7 +8057,8 @@ var EventTypeMap = {
8055
8057
  ["automationQueue" /* AUTOMATION */]: "automation-event" /* AUTOMATION_EVENT */,
8056
8058
  ["appBackupQueue" /* APP_BACKUP */]: "app-backup-event" /* APP_BACKUP_EVENT */,
8057
8059
  ["auditLogQueue" /* AUDIT_LOG */]: "audit-log-event" /* AUDIT_LOG_EVENT */,
8058
- ["systemEventQueue" /* SYSTEM_EVENT_QUEUE */]: "system-event" /* SYSTEM_EVENT */
8060
+ ["systemEventQueue" /* SYSTEM_EVENT_QUEUE */]: "system-event" /* SYSTEM_EVENT */,
8061
+ ["appMigration" /* APP_MIGRATION */]: "app-migration" /* APP_MIGRATION */
8059
8062
  };
8060
8063
  function logging(queue, jobQueue) {
8061
8064
  const eventType = EventTypeMap[jobQueue];