@memberjunction/react-runtime 6.1.1 → 6.1.3
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +24 -0
- package/dist/324.runtime.umd.js +1 -1
- package/dist/runtime.umd.js +1182 -1034
- package/package.json +6 -6
package/dist/runtime.umd.js
CHANGED
|
@@ -62097,16 +62097,16 @@ function baseEngine_slicedToArray(r, e) { return baseEngine_arrayWithHoles(r) ||
|
|
|
62097
62097
|
function baseEngine_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
62098
62098
|
function baseEngine_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
62099
62099
|
function baseEngine_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
62100
|
-
function baseEngine_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return baseEngine_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; 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)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (baseEngine_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, baseEngine_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, baseEngine_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), baseEngine_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", baseEngine_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), baseEngine_regeneratorDefine2(u), baseEngine_regeneratorDefine2(u, o, "Generator"), baseEngine_regeneratorDefine2(u, n, function () { return this; }), baseEngine_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (baseEngine_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
62101
|
-
function baseEngine_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } baseEngine_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { baseEngine_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, baseEngine_regeneratorDefine2(e, r, n, t); }
|
|
62102
|
-
function baseEngine_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
62103
|
-
function baseEngine_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { baseEngine_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { baseEngine_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
62104
62100
|
function baseEngine_toConsumableArray(r) { return baseEngine_arrayWithoutHoles(r) || baseEngine_iterableToArray(r) || baseEngine_unsupportedIterableToArray(r) || baseEngine_nonIterableSpread(); }
|
|
62105
62101
|
function baseEngine_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
62106
62102
|
function baseEngine_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return baseEngine_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? baseEngine_arrayLikeToArray(r, a) : void 0; } }
|
|
62107
62103
|
function baseEngine_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
62108
62104
|
function baseEngine_arrayWithoutHoles(r) { if (Array.isArray(r)) return baseEngine_arrayLikeToArray(r); }
|
|
62109
62105
|
function baseEngine_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
62106
|
+
function baseEngine_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return baseEngine_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; 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)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (baseEngine_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, baseEngine_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, baseEngine_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), baseEngine_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", baseEngine_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), baseEngine_regeneratorDefine2(u), baseEngine_regeneratorDefine2(u, o, "Generator"), baseEngine_regeneratorDefine2(u, n, function () { return this; }), baseEngine_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (baseEngine_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
62107
|
+
function baseEngine_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } baseEngine_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { baseEngine_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, baseEngine_regeneratorDefine2(e, r, n, t); }
|
|
62108
|
+
function baseEngine_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
62109
|
+
function baseEngine_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { baseEngine_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { baseEngine_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
62110
62110
|
function baseEngine_wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return baseEngine_wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !baseEngine_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return baseEngine_construct(t, arguments, baseEngine_getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), baseEngine_setPrototypeOf(Wrapper, t); }, baseEngine_wrapNativeSuper(t); }
|
|
62111
62111
|
function baseEngine_construct(t, e, r) { if (baseEngine_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && baseEngine_setPrototypeOf(p, r.prototype), p; }
|
|
62112
62112
|
function baseEngine_isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
|
|
@@ -62216,6 +62216,10 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62216
62216
|
_this3._entityEventSubjects = new Map();
|
|
62217
62217
|
_this3._dataChange$ = new Subject/* Subject */.B();
|
|
62218
62218
|
_this3._cacheChangeUnsubscribers = [];
|
|
62219
|
+
/**
|
|
62220
|
+
* Tail of the derived-state rebuild queue for this engine. See {@link RebuildDerivedState}.
|
|
62221
|
+
*/
|
|
62222
|
+
_this3._derivedStateRebuild = Promise.resolve();
|
|
62219
62223
|
_this3._propertySubjects = new Map();
|
|
62220
62224
|
_this3._isPermissionConstrained = false;
|
|
62221
62225
|
_this3._deniedEntityNames = [];
|
|
@@ -62253,8 +62257,48 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62253
62257
|
*/
|
|
62254
62258
|
baseEngine_inherits(BaseEngine, _BaseSingleton);
|
|
62255
62259
|
return baseEngine_createClass(BaseEngine, [{
|
|
62256
|
-
key: "
|
|
62260
|
+
key: "RebuildDerivedState",
|
|
62257
62261
|
value:
|
|
62262
|
+
/**
|
|
62263
|
+
* Rebuilds derived state after a cache-change event, one rebuild at a time and without
|
|
62264
|
+
* letting a failure escape.
|
|
62265
|
+
*
|
|
62266
|
+
* `AdditionalLoading` is subclass-supplied and may perform database I/O — some overrides
|
|
62267
|
+
* call `Config()` on another engine, which issues queries. Cache-change events are
|
|
62268
|
+
* dispatched per fingerprint from a fire-and-forget pub/sub callback, so a burst of them
|
|
62269
|
+
* would otherwise run several of those overlapping on the same connection. Serializing
|
|
62270
|
+
* them keeps the rebuild off the critical path of whatever else that connection is doing.
|
|
62271
|
+
*
|
|
62272
|
+
* Failures are logged rather than propagated: this runs from an event callback with no
|
|
62273
|
+
* caller able to handle them, an unhandled rejection there would be lost anyway, and one
|
|
62274
|
+
* engine's rebuild failing must not stop the next event from being applied.
|
|
62275
|
+
*/
|
|
62276
|
+
function RebuildDerivedState(contextUser) {
|
|
62277
|
+
var _this4 = this;
|
|
62278
|
+
this._derivedStateRebuild = this._derivedStateRebuild.catch(function () {
|
|
62279
|
+
return undefined;
|
|
62280
|
+
}).then(/*#__PURE__*/baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee() {
|
|
62281
|
+
var _t;
|
|
62282
|
+
return baseEngine_regenerator().w(function (_context) {
|
|
62283
|
+
while (1) switch (_context.p = _context.n) {
|
|
62284
|
+
case 0:
|
|
62285
|
+
_context.p = 0;
|
|
62286
|
+
_context.n = 1;
|
|
62287
|
+
return _this4.AdditionalLoading(contextUser);
|
|
62288
|
+
case 1:
|
|
62289
|
+
_context.n = 3;
|
|
62290
|
+
break;
|
|
62291
|
+
case 2:
|
|
62292
|
+
_context.p = 2;
|
|
62293
|
+
_t = _context.v;
|
|
62294
|
+
LogError("".concat(_this4.constructor.name, ": derived-state rebuild after a cache change failed \u2014 ") + "".concat(_t instanceof Error ? _t.message : String(_t)));
|
|
62295
|
+
case 3:
|
|
62296
|
+
return _context.a(2);
|
|
62297
|
+
}
|
|
62298
|
+
}, _callee, null, [[0, 2]]);
|
|
62299
|
+
})));
|
|
62300
|
+
return this._derivedStateRebuild;
|
|
62301
|
+
}
|
|
62258
62302
|
/**
|
|
62259
62303
|
* Returns an Observable for a specific engine array property. Subscribers receive the
|
|
62260
62304
|
* current array immediately (BehaviorSubject semantics), then re-receive the same array
|
|
@@ -62265,7 +62309,9 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62265
62309
|
*
|
|
62266
62310
|
* @param propertyName - The name of the backing array property on the engine (e.g. `_UserNotifications`).
|
|
62267
62311
|
*/
|
|
62268
|
-
|
|
62312
|
+
}, {
|
|
62313
|
+
key: "ObserveProperty",
|
|
62314
|
+
value: function ObserveProperty(propertyName) {
|
|
62269
62315
|
var subject = this._propertySubjects.get(propertyName);
|
|
62270
62316
|
if (!subject) {
|
|
62271
62317
|
var _this$propertyName;
|
|
@@ -62399,16 +62445,16 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62399
62445
|
}, {
|
|
62400
62446
|
key: "HandleStartup",
|
|
62401
62447
|
value: (function () {
|
|
62402
|
-
var _HandleStartup = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62403
|
-
return baseEngine_regenerator().w(function (
|
|
62404
|
-
while (1) switch (
|
|
62448
|
+
var _HandleStartup = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee2(contextUser, provider) {
|
|
62449
|
+
return baseEngine_regenerator().w(function (_context2) {
|
|
62450
|
+
while (1) switch (_context2.n) {
|
|
62405
62451
|
case 0:
|
|
62406
|
-
|
|
62452
|
+
_context2.n = 1;
|
|
62407
62453
|
return this.Config(false, contextUser, provider);
|
|
62408
62454
|
case 1:
|
|
62409
|
-
return
|
|
62455
|
+
return _context2.a(2);
|
|
62410
62456
|
}
|
|
62411
|
-
},
|
|
62457
|
+
}, _callee2, this);
|
|
62412
62458
|
}));
|
|
62413
62459
|
function HandleStartup(_x, _x2) {
|
|
62414
62460
|
return _HandleStartup.apply(this, arguments);
|
|
@@ -62462,20 +62508,20 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62462
62508
|
}, {
|
|
62463
62509
|
key: "ConfigEx",
|
|
62464
62510
|
value: (function () {
|
|
62465
|
-
var _ConfigEx = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62511
|
+
var _ConfigEx = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee3() {
|
|
62466
62512
|
var _options$forceRefresh;
|
|
62467
62513
|
var options,
|
|
62468
|
-
|
|
62469
|
-
return baseEngine_regenerator().w(function (
|
|
62470
|
-
while (1) switch (
|
|
62514
|
+
_args3 = arguments;
|
|
62515
|
+
return baseEngine_regenerator().w(function (_context3) {
|
|
62516
|
+
while (1) switch (_context3.n) {
|
|
62471
62517
|
case 0:
|
|
62472
|
-
options =
|
|
62473
|
-
|
|
62518
|
+
options = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
62519
|
+
_context3.n = 1;
|
|
62474
62520
|
return this.Config((_options$forceRefresh = options.forceRefresh) !== null && _options$forceRefresh !== void 0 ? _options$forceRefresh : false, options.contextUser, options.provider);
|
|
62475
62521
|
case 1:
|
|
62476
|
-
return
|
|
62522
|
+
return _context3.a(2, _context3.v);
|
|
62477
62523
|
}
|
|
62478
|
-
},
|
|
62524
|
+
}, _callee3, this);
|
|
62479
62525
|
}));
|
|
62480
62526
|
function ConfigEx() {
|
|
62481
62527
|
return _ConfigEx.apply(this, arguments);
|
|
@@ -62507,22 +62553,22 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62507
62553
|
}, {
|
|
62508
62554
|
key: "EnsureLoaded",
|
|
62509
62555
|
value: (function () {
|
|
62510
|
-
var _EnsureLoaded = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62511
|
-
return baseEngine_regenerator().w(function (
|
|
62512
|
-
while (1) switch (
|
|
62556
|
+
var _EnsureLoaded = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee4(contextUser, provider) {
|
|
62557
|
+
return baseEngine_regenerator().w(function (_context4) {
|
|
62558
|
+
while (1) switch (_context4.n) {
|
|
62513
62559
|
case 0:
|
|
62514
62560
|
if (!this._loaded) {
|
|
62515
|
-
|
|
62561
|
+
_context4.n = 1;
|
|
62516
62562
|
break;
|
|
62517
62563
|
}
|
|
62518
|
-
return
|
|
62564
|
+
return _context4.a(2);
|
|
62519
62565
|
case 1:
|
|
62520
|
-
|
|
62566
|
+
_context4.n = 2;
|
|
62521
62567
|
return this.Config(false, contextUser, provider);
|
|
62522
62568
|
case 2:
|
|
62523
|
-
return
|
|
62569
|
+
return _context4.a(2);
|
|
62524
62570
|
}
|
|
62525
|
-
},
|
|
62571
|
+
}, _callee4, this);
|
|
62526
62572
|
}));
|
|
62527
62573
|
function EnsureLoaded(_x3, _x4) {
|
|
62528
62574
|
return _EnsureLoaded.apply(this, arguments);
|
|
@@ -62540,9 +62586,9 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62540
62586
|
}, {
|
|
62541
62587
|
key: "Load",
|
|
62542
62588
|
value: (function () {
|
|
62543
|
-
var _Load = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62589
|
+
var _Load = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee5(configs, provider) {
|
|
62544
62590
|
var _this$ProviderToUse,
|
|
62545
|
-
|
|
62591
|
+
_this5 = this;
|
|
62546
62592
|
var forceRefresh,
|
|
62547
62593
|
contextUser,
|
|
62548
62594
|
entityNames,
|
|
@@ -62550,25 +62596,25 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62550
62596
|
eventId,
|
|
62551
62597
|
hasFailures,
|
|
62552
62598
|
failedNames,
|
|
62553
|
-
|
|
62554
|
-
|
|
62555
|
-
return baseEngine_regenerator().w(function (
|
|
62556
|
-
while (1) switch (
|
|
62599
|
+
_args5 = arguments,
|
|
62600
|
+
_t2;
|
|
62601
|
+
return baseEngine_regenerator().w(function (_context5) {
|
|
62602
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
62557
62603
|
case 0:
|
|
62558
|
-
forceRefresh =
|
|
62559
|
-
contextUser =
|
|
62604
|
+
forceRefresh = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
|
|
62605
|
+
contextUser = _args5.length > 3 ? _args5[3] : undefined;
|
|
62560
62606
|
if (!(((_this$ProviderToUse = this.ProviderToUse) === null || _this$ProviderToUse === void 0 ? void 0 : _this$ProviderToUse.ProviderType) === ProviderType.Database && !contextUser)) {
|
|
62561
|
-
|
|
62607
|
+
_context5.n = 1;
|
|
62562
62608
|
break;
|
|
62563
62609
|
}
|
|
62564
62610
|
throw new Error('For server-side use of all engine classes, you must provide the contextUser parameter');
|
|
62565
62611
|
case 1:
|
|
62566
62612
|
if (!this._loadingSubject.value) {
|
|
62567
|
-
|
|
62613
|
+
_context5.n = 2;
|
|
62568
62614
|
break;
|
|
62569
62615
|
}
|
|
62570
|
-
return
|
|
62571
|
-
var subscription =
|
|
62616
|
+
return _context5.a(2, new Promise(function (resolve) {
|
|
62617
|
+
var subscription = _this5._loadingSubject.subscribe(function (loading) {
|
|
62572
62618
|
if (!loading) {
|
|
62573
62619
|
subscription.unsubscribe();
|
|
62574
62620
|
resolve();
|
|
@@ -62577,7 +62623,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62577
62623
|
}));
|
|
62578
62624
|
case 2:
|
|
62579
62625
|
if (!(!this._loaded || forceRefresh)) {
|
|
62580
|
-
|
|
62626
|
+
_context5.n = 10;
|
|
62581
62627
|
break;
|
|
62582
62628
|
}
|
|
62583
62629
|
// Reset permission-constrained state on fresh load or force refresh
|
|
@@ -62603,23 +62649,23 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62603
62649
|
datasetNames: datasetNames
|
|
62604
62650
|
}, contextUser === null || contextUser === void 0 ? void 0 : contextUser.ID);
|
|
62605
62651
|
this._loadingSubject.next(true);
|
|
62606
|
-
|
|
62652
|
+
_context5.p = 3;
|
|
62607
62653
|
this.SetProvider(provider);
|
|
62608
62654
|
// Decide which identity this engine acts as — the system user on a server, the
|
|
62609
62655
|
// caller on a client. Sets _contextUser. Must run AFTER SetProvider (so it asks
|
|
62610
62656
|
// the provider this engine is bound to) and BEFORE any load.
|
|
62611
|
-
|
|
62657
|
+
_context5.n = 4;
|
|
62612
62658
|
return this.ResolveContextUser(contextUser);
|
|
62613
62659
|
case 4:
|
|
62614
62660
|
// Register with the engine registry
|
|
62615
62661
|
BaseEngineRegistry.Instance.RegisterEngine(this);
|
|
62616
|
-
|
|
62662
|
+
_context5.n = 5;
|
|
62617
62663
|
return this.LoadConfigs(configs, this._contextUser, forceRefresh);
|
|
62618
62664
|
case 5:
|
|
62619
|
-
|
|
62665
|
+
_context5.n = 6;
|
|
62620
62666
|
return this.AdditionalLoading(this._contextUser);
|
|
62621
62667
|
case 6:
|
|
62622
|
-
|
|
62668
|
+
_context5.n = 7;
|
|
62623
62669
|
return this.SetupGlobalEventListener();
|
|
62624
62670
|
case 7:
|
|
62625
62671
|
// Only mark as loaded if all configs loaded successfully.
|
|
@@ -62629,14 +62675,14 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62629
62675
|
return !entry.loadedSuccessfully;
|
|
62630
62676
|
});
|
|
62631
62677
|
if (hasFailures) {
|
|
62632
|
-
failedNames = Array.from(this._dataMap.entries()).filter(function (
|
|
62633
|
-
var
|
|
62634
|
-
entry =
|
|
62678
|
+
failedNames = Array.from(this._dataMap.entries()).filter(function (_ref2) {
|
|
62679
|
+
var _ref3 = baseEngine_slicedToArray(_ref2, 2),
|
|
62680
|
+
entry = _ref3[1];
|
|
62635
62681
|
return !entry.loadedSuccessfully;
|
|
62636
|
-
}).map(function (
|
|
62637
|
-
var
|
|
62638
|
-
key =
|
|
62639
|
-
entry =
|
|
62682
|
+
}).map(function (_ref4) {
|
|
62683
|
+
var _ref5 = baseEngine_slicedToArray(_ref4, 2),
|
|
62684
|
+
key = _ref5[0],
|
|
62685
|
+
entry = _ref5[1];
|
|
62640
62686
|
return entry.entityName || entry.datasetName || key;
|
|
62641
62687
|
});
|
|
62642
62688
|
LogError("".concat(this.constructor.name, ": Not marking as loaded \u2014 ").concat(failedNames.length, " config(s) failed to load: ").concat(failedNames.join(', '), ". Will retry on next Config()/EnsureLoaded() call."));
|
|
@@ -62645,21 +62691,21 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62645
62691
|
// Notify registry that engine is loaded
|
|
62646
62692
|
BaseEngineRegistry.Instance.NotifyEngineLoaded(this);
|
|
62647
62693
|
}
|
|
62648
|
-
|
|
62694
|
+
_context5.n = 9;
|
|
62649
62695
|
break;
|
|
62650
62696
|
case 8:
|
|
62651
|
-
|
|
62652
|
-
|
|
62653
|
-
LogError(
|
|
62697
|
+
_context5.p = 8;
|
|
62698
|
+
_t2 = _context5.v;
|
|
62699
|
+
LogError(_t2);
|
|
62654
62700
|
case 9:
|
|
62655
|
-
|
|
62701
|
+
_context5.p = 9;
|
|
62656
62702
|
this._loadingSubject.next(false);
|
|
62657
62703
|
TelemetryManager.Instance.EndEvent(eventId);
|
|
62658
|
-
return
|
|
62704
|
+
return _context5.f(9);
|
|
62659
62705
|
case 10:
|
|
62660
|
-
return
|
|
62706
|
+
return _context5.a(2);
|
|
62661
62707
|
}
|
|
62662
|
-
},
|
|
62708
|
+
}, _callee5, this, [[3, 8, 9, 10]]);
|
|
62663
62709
|
}));
|
|
62664
62710
|
function Load(_x5, _x6) {
|
|
62665
62711
|
return _Load.apply(this, arguments);
|
|
@@ -62699,58 +62745,58 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62699
62745
|
* the engine simply acts as the caller, exactly as it did before this existed.
|
|
62700
62746
|
*/
|
|
62701
62747
|
function () {
|
|
62702
|
-
var _ResolveContextUser = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62703
|
-
var provider, systemUser, _yield$source$GetSyst, source,
|
|
62704
|
-
return baseEngine_regenerator().w(function (
|
|
62705
|
-
while (1) switch (
|
|
62748
|
+
var _ResolveContextUser = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee6(contextUser) {
|
|
62749
|
+
var provider, systemUser, _yield$source$GetSyst, source, _t3, _t4, _t5, _t6;
|
|
62750
|
+
return baseEngine_regenerator().w(function (_context6) {
|
|
62751
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
62706
62752
|
case 0:
|
|
62707
62753
|
provider = this.ProviderToUse;
|
|
62708
62754
|
if (!((provider === null || provider === void 0 ? void 0 : provider.ProviderType) !== ProviderType.Database)) {
|
|
62709
|
-
|
|
62755
|
+
_context6.n = 1;
|
|
62710
62756
|
break;
|
|
62711
62757
|
}
|
|
62712
62758
|
this._contextUser = contextUser; // client — the caller is the only identity there is
|
|
62713
|
-
return
|
|
62759
|
+
return _context6.a(2);
|
|
62714
62760
|
case 1:
|
|
62715
62761
|
if (!this._systemUserApplied) {
|
|
62716
|
-
|
|
62762
|
+
_context6.n = 2;
|
|
62717
62763
|
break;
|
|
62718
62764
|
}
|
|
62719
|
-
return
|
|
62765
|
+
return _context6.a(2);
|
|
62720
62766
|
case 2:
|
|
62721
62767
|
this._contextUser = contextUser;
|
|
62722
62768
|
systemUser = null;
|
|
62723
|
-
|
|
62769
|
+
_context6.p = 3;
|
|
62724
62770
|
source = dist/* MJGlobal */.rt.Instance.ClassFactory.CreateInstance(WellKnownUserSource);
|
|
62725
|
-
|
|
62771
|
+
_context6.n = 4;
|
|
62726
62772
|
return source === null || source === void 0 ? void 0 : source.GetSystemUser(provider);
|
|
62727
62773
|
case 4:
|
|
62728
|
-
|
|
62729
|
-
|
|
62730
|
-
if (!
|
|
62731
|
-
|
|
62774
|
+
_t4 = _yield$source$GetSyst = _context6.v;
|
|
62775
|
+
_t3 = _t4 !== null;
|
|
62776
|
+
if (!_t3) {
|
|
62777
|
+
_context6.n = 5;
|
|
62732
62778
|
break;
|
|
62733
62779
|
}
|
|
62734
|
-
|
|
62780
|
+
_t3 = _yield$source$GetSyst !== void 0;
|
|
62735
62781
|
case 5:
|
|
62736
|
-
if (!
|
|
62737
|
-
|
|
62782
|
+
if (!_t3) {
|
|
62783
|
+
_context6.n = 6;
|
|
62738
62784
|
break;
|
|
62739
62785
|
}
|
|
62740
|
-
|
|
62741
|
-
|
|
62786
|
+
_t5 = _yield$source$GetSyst;
|
|
62787
|
+
_context6.n = 7;
|
|
62742
62788
|
break;
|
|
62743
62789
|
case 6:
|
|
62744
|
-
|
|
62790
|
+
_t5 = null;
|
|
62745
62791
|
case 7:
|
|
62746
|
-
systemUser =
|
|
62747
|
-
|
|
62792
|
+
systemUser = _t5;
|
|
62793
|
+
_context6.n = 9;
|
|
62748
62794
|
break;
|
|
62749
62795
|
case 8:
|
|
62750
|
-
|
|
62751
|
-
|
|
62796
|
+
_context6.p = 8;
|
|
62797
|
+
_t6 = _context6.v;
|
|
62752
62798
|
// The contract says implementations never throw; don't take their word for it.
|
|
62753
|
-
LogError(
|
|
62799
|
+
LogError(_t6);
|
|
62754
62800
|
case 9:
|
|
62755
62801
|
if (systemUser) {
|
|
62756
62802
|
this._contextUser = systemUser;
|
|
@@ -62760,9 +62806,9 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62760
62806
|
LogStatus("".concat(this.constructor.name, ": could not resolve the MJ system user for server-side loading \u2014 ") + "falling back to the calling user. This engine's data will reflect that user's permissions " + "and is cached process-wide, so a restricted caller can leave incomplete data cached for everyone.");
|
|
62761
62807
|
}
|
|
62762
62808
|
case 10:
|
|
62763
|
-
return
|
|
62809
|
+
return _context6.a(2);
|
|
62764
62810
|
}
|
|
62765
|
-
},
|
|
62811
|
+
}, _callee6, this, [[3, 8]]);
|
|
62766
62812
|
}));
|
|
62767
62813
|
function ResolveContextUser(_x7) {
|
|
62768
62814
|
return _ResolveContextUser.apply(this, arguments);
|
|
@@ -62830,43 +62876,43 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62830
62876
|
}, {
|
|
62831
62877
|
key: "SetupGlobalEventListener",
|
|
62832
62878
|
value: (function () {
|
|
62833
|
-
var _SetupGlobalEventListener = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62834
|
-
var
|
|
62835
|
-
var
|
|
62836
|
-
return baseEngine_regenerator().w(function (
|
|
62837
|
-
while (1) switch (
|
|
62879
|
+
var _SetupGlobalEventListener = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee8() {
|
|
62880
|
+
var _this6 = this;
|
|
62881
|
+
var _t7;
|
|
62882
|
+
return baseEngine_regenerator().w(function (_context8) {
|
|
62883
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
62838
62884
|
case 0:
|
|
62839
|
-
|
|
62885
|
+
_context8.p = 0;
|
|
62840
62886
|
if (!this._eventListener) {
|
|
62841
62887
|
this._eventListener = dist/* MJGlobal */.rt.Instance.GetEventListener(false);
|
|
62842
62888
|
this._eventListener.subscribe(/*#__PURE__*/function () {
|
|
62843
|
-
var
|
|
62844
|
-
return baseEngine_regenerator().w(function (
|
|
62845
|
-
while (1) switch (
|
|
62889
|
+
var _ref6 = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee7(event) {
|
|
62890
|
+
return baseEngine_regenerator().w(function (_context7) {
|
|
62891
|
+
while (1) switch (_context7.n) {
|
|
62846
62892
|
case 0:
|
|
62847
|
-
|
|
62848
|
-
return
|
|
62893
|
+
_context7.n = 1;
|
|
62894
|
+
return _this6.HandleIndividualEvent(event);
|
|
62849
62895
|
case 1:
|
|
62850
|
-
return
|
|
62896
|
+
return _context7.a(2);
|
|
62851
62897
|
}
|
|
62852
|
-
},
|
|
62898
|
+
}, _callee7);
|
|
62853
62899
|
}));
|
|
62854
62900
|
return function (_x8) {
|
|
62855
|
-
return
|
|
62901
|
+
return _ref6.apply(this, arguments);
|
|
62856
62902
|
};
|
|
62857
62903
|
}());
|
|
62858
62904
|
}
|
|
62859
|
-
|
|
62905
|
+
_context8.n = 2;
|
|
62860
62906
|
break;
|
|
62861
62907
|
case 1:
|
|
62862
|
-
|
|
62863
|
-
|
|
62864
|
-
LogError(
|
|
62865
|
-
return
|
|
62908
|
+
_context8.p = 1;
|
|
62909
|
+
_t7 = _context8.v;
|
|
62910
|
+
LogError(_t7);
|
|
62911
|
+
return _context8.a(2, false);
|
|
62866
62912
|
case 2:
|
|
62867
|
-
return
|
|
62913
|
+
return _context8.a(2);
|
|
62868
62914
|
}
|
|
62869
|
-
},
|
|
62915
|
+
}, _callee8, this, [[0, 1]]);
|
|
62870
62916
|
}));
|
|
62871
62917
|
function SetupGlobalEventListener() {
|
|
62872
62918
|
return _SetupGlobalEventListener.apply(this, arguments);
|
|
@@ -62884,25 +62930,25 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62884
62930
|
}, {
|
|
62885
62931
|
key: "HandleIndividualEvent",
|
|
62886
62932
|
value: (function () {
|
|
62887
|
-
var _HandleIndividualEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62933
|
+
var _HandleIndividualEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee9(event) {
|
|
62888
62934
|
var baseEntityEvent;
|
|
62889
|
-
return baseEngine_regenerator().w(function (
|
|
62890
|
-
while (1) switch (
|
|
62935
|
+
return baseEngine_regenerator().w(function (_context9) {
|
|
62936
|
+
while (1) switch (_context9.n) {
|
|
62891
62937
|
case 0:
|
|
62892
62938
|
if (!(event.event === dist/* MJEventType */.UK.ComponentEvent && event.eventCode === BaseEntity.BaseEventCode)) {
|
|
62893
|
-
|
|
62939
|
+
_context9.n = 2;
|
|
62894
62940
|
break;
|
|
62895
62941
|
}
|
|
62896
62942
|
// we have an entity event
|
|
62897
62943
|
baseEntityEvent = event.args;
|
|
62898
|
-
|
|
62944
|
+
_context9.n = 1;
|
|
62899
62945
|
return this.HandleIndividualBaseEntityEvent(baseEntityEvent);
|
|
62900
62946
|
case 1:
|
|
62901
|
-
return
|
|
62947
|
+
return _context9.a(2, _context9.v);
|
|
62902
62948
|
case 2:
|
|
62903
|
-
return
|
|
62949
|
+
return _context9.a(2);
|
|
62904
62950
|
}
|
|
62905
|
-
},
|
|
62951
|
+
}, _callee9, this);
|
|
62906
62952
|
}));
|
|
62907
62953
|
function HandleIndividualEvent(_x9) {
|
|
62908
62954
|
return _HandleIndividualEvent.apply(this, arguments);
|
|
@@ -62922,30 +62968,30 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62922
62968
|
}, {
|
|
62923
62969
|
key: "HandleIndividualBaseEntityEvent",
|
|
62924
62970
|
value: (function () {
|
|
62925
|
-
var _HandleIndividualBaseEntityEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
62926
|
-
var
|
|
62927
|
-
var eName, matchingConfigs, allCanUseImmediate, _iterator, _step, config,
|
|
62928
|
-
return baseEngine_regenerator().w(function (
|
|
62929
|
-
while (1) switch (
|
|
62971
|
+
var _HandleIndividualBaseEntityEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee0(event) {
|
|
62972
|
+
var _this7 = this;
|
|
62973
|
+
var eName, matchingConfigs, allCanUseImmediate, _iterator, _step, config, _t8, _t9;
|
|
62974
|
+
return baseEngine_regenerator().w(function (_context0) {
|
|
62975
|
+
while (1) switch (_context0.p = _context0.n) {
|
|
62930
62976
|
case 0:
|
|
62931
|
-
|
|
62977
|
+
_context0.p = 0;
|
|
62932
62978
|
if (!this._isPermissionConstrained) {
|
|
62933
|
-
|
|
62979
|
+
_context0.n = 1;
|
|
62934
62980
|
break;
|
|
62935
62981
|
}
|
|
62936
|
-
return
|
|
62982
|
+
return _context0.a(2, true);
|
|
62937
62983
|
case 1:
|
|
62938
62984
|
if (!(event.type === 'remote-invalidate')) {
|
|
62939
|
-
|
|
62985
|
+
_context0.n = 3;
|
|
62940
62986
|
break;
|
|
62941
62987
|
}
|
|
62942
|
-
|
|
62988
|
+
_context0.n = 2;
|
|
62943
62989
|
return this.HandleRemoteInvalidateEvent(event);
|
|
62944
62990
|
case 2:
|
|
62945
|
-
return
|
|
62991
|
+
return _context0.a(2, _context0.v);
|
|
62946
62992
|
case 3:
|
|
62947
62993
|
if (!(event.type === 'delete' || event.type === 'save')) {
|
|
62948
|
-
|
|
62994
|
+
_context0.n = 13;
|
|
62949
62995
|
break;
|
|
62950
62996
|
}
|
|
62951
62997
|
eName = event.baseEntity.EntityInfo.Name.toLowerCase().trim();
|
|
@@ -62953,59 +62999,59 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
62953
62999
|
return config.AutoRefresh && config.EntityName && config.EntityName.trim().toLowerCase() === eName;
|
|
62954
63000
|
});
|
|
62955
63001
|
if (!(matchingConfigs.length === 0)) {
|
|
62956
|
-
|
|
63002
|
+
_context0.n = 4;
|
|
62957
63003
|
break;
|
|
62958
63004
|
}
|
|
62959
|
-
return
|
|
63005
|
+
return _context0.a(2, true);
|
|
62960
63006
|
case 4:
|
|
62961
63007
|
// Check if ALL matching configs can use immediate mutation
|
|
62962
63008
|
allCanUseImmediate = matchingConfigs.every(function (config) {
|
|
62963
|
-
return
|
|
63009
|
+
return _this7.canUseImmediateMutation(config);
|
|
62964
63010
|
});
|
|
62965
63011
|
if (!allCanUseImmediate) {
|
|
62966
|
-
|
|
63012
|
+
_context0.n = 12;
|
|
62967
63013
|
break;
|
|
62968
63014
|
}
|
|
62969
63015
|
// Process immediately without debounce - mutation requires await because the
|
|
62970
63016
|
// entity must be cloned (with its provider rebound) before being cached
|
|
62971
63017
|
_iterator = baseEngine_createForOfIteratorHelper(matchingConfigs);
|
|
62972
|
-
|
|
63018
|
+
_context0.p = 5;
|
|
62973
63019
|
_iterator.s();
|
|
62974
63020
|
case 6:
|
|
62975
63021
|
if ((_step = _iterator.n()).done) {
|
|
62976
|
-
|
|
63022
|
+
_context0.n = 8;
|
|
62977
63023
|
break;
|
|
62978
63024
|
}
|
|
62979
63025
|
config = _step.value;
|
|
62980
|
-
|
|
63026
|
+
_context0.n = 7;
|
|
62981
63027
|
return this.applyImmediateMutation(config, event);
|
|
62982
63028
|
case 7:
|
|
62983
|
-
|
|
63029
|
+
_context0.n = 6;
|
|
62984
63030
|
break;
|
|
62985
63031
|
case 8:
|
|
62986
|
-
|
|
63032
|
+
_context0.n = 10;
|
|
62987
63033
|
break;
|
|
62988
63034
|
case 9:
|
|
62989
|
-
|
|
62990
|
-
|
|
62991
|
-
_iterator.e(
|
|
63035
|
+
_context0.p = 9;
|
|
63036
|
+
_t8 = _context0.v;
|
|
63037
|
+
_iterator.e(_t8);
|
|
62992
63038
|
case 10:
|
|
62993
|
-
|
|
63039
|
+
_context0.p = 10;
|
|
62994
63040
|
_iterator.f();
|
|
62995
|
-
return
|
|
63041
|
+
return _context0.f(10);
|
|
62996
63042
|
case 11:
|
|
62997
|
-
return
|
|
63043
|
+
return _context0.a(2, true);
|
|
62998
63044
|
case 12:
|
|
62999
|
-
return
|
|
63045
|
+
return _context0.a(2, this.DebounceIndividualBaseEntityEvent(event));
|
|
63000
63046
|
case 13:
|
|
63001
|
-
return
|
|
63047
|
+
return _context0.a(2, true);
|
|
63002
63048
|
case 14:
|
|
63003
|
-
|
|
63004
|
-
|
|
63005
|
-
LogError(
|
|
63006
|
-
return
|
|
63049
|
+
_context0.p = 14;
|
|
63050
|
+
_t9 = _context0.v;
|
|
63051
|
+
LogError(_t9);
|
|
63052
|
+
return _context0.a(2, false);
|
|
63007
63053
|
}
|
|
63008
|
-
},
|
|
63054
|
+
}, _callee0, this, [[5, 9, 10, 11], [0, 14]]);
|
|
63009
63055
|
}));
|
|
63010
63056
|
function HandleIndividualBaseEntityEvent(_x0) {
|
|
63011
63057
|
return _HandleIndividualBaseEntityEvent.apply(this, arguments);
|
|
@@ -63025,57 +63071,57 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63025
63071
|
}, {
|
|
63026
63072
|
key: "HandleRemoteInvalidateEvent",
|
|
63027
63073
|
value: (function () {
|
|
63028
|
-
var _HandleRemoteInvalidateEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
63029
|
-
var _event$entityName, entityName, matchingConfigs, payload, action, applied, removed, refreshCount, _iterator2, _step2, config,
|
|
63030
|
-
return baseEngine_regenerator().w(function (
|
|
63031
|
-
while (1) switch (
|
|
63074
|
+
var _HandleRemoteInvalidateEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee1(event) {
|
|
63075
|
+
var _event$entityName, entityName, matchingConfigs, payload, action, applied, removed, refreshCount, _iterator2, _step2, config, _t0, _t1;
|
|
63076
|
+
return baseEngine_regenerator().w(function (_context1) {
|
|
63077
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
63032
63078
|
case 0:
|
|
63033
|
-
|
|
63079
|
+
_context1.p = 0;
|
|
63034
63080
|
entityName = (_event$entityName = event.entityName) === null || _event$entityName === void 0 ? void 0 : _event$entityName.toLowerCase().trim();
|
|
63035
63081
|
if (entityName) {
|
|
63036
|
-
|
|
63082
|
+
_context1.n = 1;
|
|
63037
63083
|
break;
|
|
63038
63084
|
}
|
|
63039
|
-
return
|
|
63085
|
+
return _context1.a(2, true);
|
|
63040
63086
|
case 1:
|
|
63041
63087
|
matchingConfigs = this.Configs.filter(function (config) {
|
|
63042
63088
|
return config.AutoRefresh && config.EntityName && config.EntityName.trim().toLowerCase() === entityName;
|
|
63043
63089
|
});
|
|
63044
63090
|
if (!(matchingConfigs.length === 0)) {
|
|
63045
|
-
|
|
63091
|
+
_context1.n = 2;
|
|
63046
63092
|
break;
|
|
63047
63093
|
}
|
|
63048
|
-
return
|
|
63094
|
+
return _context1.a(2, true);
|
|
63049
63095
|
case 2:
|
|
63050
63096
|
payload = event.payload;
|
|
63051
63097
|
action = payload === null || payload === void 0 ? void 0 : payload.action; // Save with record data: apply directly without a server call
|
|
63052
63098
|
if (!(action === 'save' && payload !== null && payload !== void 0 && payload.recordData)) {
|
|
63053
|
-
|
|
63099
|
+
_context1.n = 4;
|
|
63054
63100
|
break;
|
|
63055
63101
|
}
|
|
63056
|
-
|
|
63102
|
+
_context1.n = 3;
|
|
63057
63103
|
return this.applyRemoteRecordData(matchingConfigs, entityName, payload.recordData);
|
|
63058
63104
|
case 3:
|
|
63059
|
-
applied =
|
|
63105
|
+
applied = _context1.v;
|
|
63060
63106
|
if (!applied) {
|
|
63061
|
-
|
|
63107
|
+
_context1.n = 4;
|
|
63062
63108
|
break;
|
|
63063
63109
|
}
|
|
63064
|
-
return
|
|
63110
|
+
return _context1.a(2, true);
|
|
63065
63111
|
case 4:
|
|
63066
63112
|
if (!(action === 'delete' && payload !== null && payload !== void 0 && payload.primaryKeyValues)) {
|
|
63067
|
-
|
|
63113
|
+
_context1.n = 6;
|
|
63068
63114
|
break;
|
|
63069
63115
|
}
|
|
63070
63116
|
removed = this.applyRemoteDelete(matchingConfigs, payload.primaryKeyValues);
|
|
63071
63117
|
if (!removed) {
|
|
63072
|
-
|
|
63118
|
+
_context1.n = 6;
|
|
63073
63119
|
break;
|
|
63074
63120
|
}
|
|
63075
|
-
|
|
63121
|
+
_context1.n = 5;
|
|
63076
63122
|
return this.AdditionalLoading(this._contextUser);
|
|
63077
63123
|
case 5:
|
|
63078
|
-
return
|
|
63124
|
+
return _context1.a(2, true);
|
|
63079
63125
|
case 6:
|
|
63080
63126
|
// Fallback: re-fetch from server (missing data or apply failure). Bypass the cache
|
|
63081
63127
|
// for the same reason as the local-event path: this fetch runs BECAUSE a
|
|
@@ -63083,15 +63129,15 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63083
63129
|
// re-sync the pre-write snapshot.
|
|
63084
63130
|
refreshCount = 0;
|
|
63085
63131
|
_iterator2 = baseEngine_createForOfIteratorHelper(matchingConfigs);
|
|
63086
|
-
|
|
63132
|
+
_context1.p = 7;
|
|
63087
63133
|
_iterator2.s();
|
|
63088
63134
|
case 8:
|
|
63089
63135
|
if ((_step2 = _iterator2.n()).done) {
|
|
63090
|
-
|
|
63136
|
+
_context1.n = 11;
|
|
63091
63137
|
break;
|
|
63092
63138
|
}
|
|
63093
63139
|
config = _step2.value;
|
|
63094
|
-
|
|
63140
|
+
_context1.n = 9;
|
|
63095
63141
|
return this.LoadSingleConfig(config, this._contextUser, /*bypassCache*/true);
|
|
63096
63142
|
case 9:
|
|
63097
63143
|
if (!this.configLoadedSuccessfully(config.PropertyName)) {
|
|
@@ -63101,35 +63147,35 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63101
63147
|
}
|
|
63102
63148
|
refreshCount++;
|
|
63103
63149
|
case 10:
|
|
63104
|
-
|
|
63150
|
+
_context1.n = 8;
|
|
63105
63151
|
break;
|
|
63106
63152
|
case 11:
|
|
63107
|
-
|
|
63153
|
+
_context1.n = 13;
|
|
63108
63154
|
break;
|
|
63109
63155
|
case 12:
|
|
63110
|
-
|
|
63111
|
-
|
|
63112
|
-
_iterator2.e(
|
|
63156
|
+
_context1.p = 12;
|
|
63157
|
+
_t0 = _context1.v;
|
|
63158
|
+
_iterator2.e(_t0);
|
|
63113
63159
|
case 13:
|
|
63114
|
-
|
|
63160
|
+
_context1.p = 13;
|
|
63115
63161
|
_iterator2.f();
|
|
63116
|
-
return
|
|
63162
|
+
return _context1.f(13);
|
|
63117
63163
|
case 14:
|
|
63118
63164
|
if (!(refreshCount > 0)) {
|
|
63119
|
-
|
|
63165
|
+
_context1.n = 15;
|
|
63120
63166
|
break;
|
|
63121
63167
|
}
|
|
63122
|
-
|
|
63168
|
+
_context1.n = 15;
|
|
63123
63169
|
return this.AdditionalLoading(this._contextUser);
|
|
63124
63170
|
case 15:
|
|
63125
|
-
return
|
|
63171
|
+
return _context1.a(2, true);
|
|
63126
63172
|
case 16:
|
|
63127
|
-
|
|
63128
|
-
|
|
63129
|
-
LogError(
|
|
63130
|
-
return
|
|
63173
|
+
_context1.p = 16;
|
|
63174
|
+
_t1 = _context1.v;
|
|
63175
|
+
LogError(_t1);
|
|
63176
|
+
return _context1.a(2, false);
|
|
63131
63177
|
}
|
|
63132
|
-
},
|
|
63178
|
+
}, _callee1, this, [[7, 12, 13, 14], [0, 16]]);
|
|
63133
63179
|
}));
|
|
63134
63180
|
function HandleRemoteInvalidateEvent(_x1) {
|
|
63135
63181
|
return _HandleRemoteInvalidateEvent.apply(this, arguments);
|
|
@@ -63147,44 +63193,44 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63147
63193
|
}, {
|
|
63148
63194
|
key: "applyRemoteRecordData",
|
|
63149
63195
|
value: (function () {
|
|
63150
|
-
var _applyRemoteRecordData = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
63151
|
-
var recordData, md, originalEntityName, entity, _iterator3, _step3, config, currentData, index,
|
|
63152
|
-
return baseEngine_regenerator().w(function (
|
|
63153
|
-
while (1) switch (
|
|
63196
|
+
var _applyRemoteRecordData = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee10(matchingConfigs, entityName, recordDataJSON) {
|
|
63197
|
+
var recordData, md, originalEntityName, entity, _iterator3, _step3, config, currentData, index, _t10, _t11;
|
|
63198
|
+
return baseEngine_regenerator().w(function (_context10) {
|
|
63199
|
+
while (1) switch (_context10.p = _context10.n) {
|
|
63154
63200
|
case 0:
|
|
63155
|
-
|
|
63201
|
+
_context10.p = 0;
|
|
63156
63202
|
recordData = JSON.parse(recordDataJSON); // Use this engine's bound provider (ProviderToUse) instead of `new Metadata()` so
|
|
63157
63203
|
// multi-provider client setups instantiate entities against the correct server.
|
|
63158
63204
|
md = this.ProviderToUse;
|
|
63159
63205
|
originalEntityName = matchingConfigs[0].EntityName;
|
|
63160
|
-
|
|
63206
|
+
_context10.n = 1;
|
|
63161
63207
|
return md.GetEntityObject(originalEntityName, this._contextUser);
|
|
63162
63208
|
case 1:
|
|
63163
|
-
entity =
|
|
63164
|
-
|
|
63209
|
+
entity = _context10.v;
|
|
63210
|
+
_context10.n = 2;
|
|
63165
63211
|
return entity.LoadFromData(recordData);
|
|
63166
63212
|
case 2:
|
|
63167
63213
|
_iterator3 = baseEngine_createForOfIteratorHelper(matchingConfigs);
|
|
63168
|
-
|
|
63214
|
+
_context10.p = 3;
|
|
63169
63215
|
_iterator3.s();
|
|
63170
63216
|
case 4:
|
|
63171
63217
|
if ((_step3 = _iterator3.n()).done) {
|
|
63172
|
-
|
|
63218
|
+
_context10.n = 8;
|
|
63173
63219
|
break;
|
|
63174
63220
|
}
|
|
63175
63221
|
config = _step3.value;
|
|
63176
63222
|
if (this.canUseImmediateMutation(config, /*skipAdditionalLoadingCheck*/true)) {
|
|
63177
|
-
|
|
63223
|
+
_context10.n = 5;
|
|
63178
63224
|
break;
|
|
63179
63225
|
}
|
|
63180
|
-
return
|
|
63226
|
+
return _context10.a(2, false);
|
|
63181
63227
|
case 5:
|
|
63182
63228
|
currentData = this[config.PropertyName];
|
|
63183
63229
|
if (currentData) {
|
|
63184
|
-
|
|
63230
|
+
_context10.n = 6;
|
|
63185
63231
|
break;
|
|
63186
63232
|
}
|
|
63187
|
-
return
|
|
63233
|
+
return _context10.a(3, 7);
|
|
63188
63234
|
case 6:
|
|
63189
63235
|
index = this.findEntityIndexByPrimaryKeys(currentData, entity);
|
|
63190
63236
|
if (index >= 0) {
|
|
@@ -63208,31 +63254,31 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63208
63254
|
// LocalCacheManager handles its own cache sync by listening for
|
|
63209
63255
|
// remote-invalidate events directly — no need to sync here
|
|
63210
63256
|
case 7:
|
|
63211
|
-
|
|
63257
|
+
_context10.n = 4;
|
|
63212
63258
|
break;
|
|
63213
63259
|
case 8:
|
|
63214
|
-
|
|
63260
|
+
_context10.n = 10;
|
|
63215
63261
|
break;
|
|
63216
63262
|
case 9:
|
|
63217
|
-
|
|
63218
|
-
|
|
63219
|
-
_iterator3.e(
|
|
63263
|
+
_context10.p = 9;
|
|
63264
|
+
_t10 = _context10.v;
|
|
63265
|
+
_iterator3.e(_t10);
|
|
63220
63266
|
case 10:
|
|
63221
|
-
|
|
63267
|
+
_context10.p = 10;
|
|
63222
63268
|
_iterator3.f();
|
|
63223
|
-
return
|
|
63269
|
+
return _context10.f(10);
|
|
63224
63270
|
case 11:
|
|
63225
|
-
|
|
63271
|
+
_context10.n = 12;
|
|
63226
63272
|
return this.AdditionalLoading(this._contextUser);
|
|
63227
63273
|
case 12:
|
|
63228
|
-
return
|
|
63274
|
+
return _context10.a(2, true);
|
|
63229
63275
|
case 13:
|
|
63230
|
-
|
|
63231
|
-
|
|
63232
|
-
LogError(
|
|
63233
|
-
return
|
|
63276
|
+
_context10.p = 13;
|
|
63277
|
+
_t11 = _context10.v;
|
|
63278
|
+
LogError(_t11);
|
|
63279
|
+
return _context10.a(2, false);
|
|
63234
63280
|
}
|
|
63235
|
-
},
|
|
63281
|
+
}, _callee10, this, [[3, 9, 10, 11], [0, 13]]);
|
|
63236
63282
|
}));
|
|
63237
63283
|
function applyRemoteRecordData(_x10, _x11, _x12) {
|
|
63238
63284
|
return _applyRemoteRecordData.apply(this, arguments);
|
|
@@ -63307,13 +63353,13 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63307
63353
|
}, {
|
|
63308
63354
|
key: "DebounceIndividualBaseEntityEvent",
|
|
63309
63355
|
value: (function () {
|
|
63310
|
-
var _DebounceIndividualBaseEntityEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
63311
|
-
var
|
|
63312
|
-
var entityName, _matchingConfig$Debou, matchingConfig, debounceTimeValue, subject,
|
|
63313
|
-
return baseEngine_regenerator().w(function (
|
|
63314
|
-
while (1) switch (
|
|
63356
|
+
var _DebounceIndividualBaseEntityEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee12(event) {
|
|
63357
|
+
var _this8 = this;
|
|
63358
|
+
var entityName, _matchingConfig$Debou, matchingConfig, debounceTimeValue, subject, _t12;
|
|
63359
|
+
return baseEngine_regenerator().w(function (_context12) {
|
|
63360
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
63315
63361
|
case 0:
|
|
63316
|
-
|
|
63362
|
+
_context12.p = 0;
|
|
63317
63363
|
entityName = event.baseEntity.EntityInfo.Name.toLowerCase().trim();
|
|
63318
63364
|
if (!this._entityEventSubjects.has(entityName)) {
|
|
63319
63365
|
// Find matching config to get custom debounce time
|
|
@@ -63329,32 +63375,32 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63329
63375
|
buffer(subject.pipe(debounceTime(debounceTimeValue))), filter(function (batch) {
|
|
63330
63376
|
return batch.length > 0;
|
|
63331
63377
|
})).subscribe(/*#__PURE__*/function () {
|
|
63332
|
-
var
|
|
63333
|
-
return baseEngine_regenerator().w(function (
|
|
63334
|
-
while (1) switch (
|
|
63378
|
+
var _ref7 = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee11(batch) {
|
|
63379
|
+
return baseEngine_regenerator().w(function (_context11) {
|
|
63380
|
+
while (1) switch (_context11.n) {
|
|
63335
63381
|
case 0:
|
|
63336
|
-
|
|
63337
|
-
return
|
|
63382
|
+
_context11.n = 1;
|
|
63383
|
+
return _this8.ProcessEntityEvents(batch);
|
|
63338
63384
|
case 1:
|
|
63339
|
-
return
|
|
63385
|
+
return _context11.a(2);
|
|
63340
63386
|
}
|
|
63341
|
-
},
|
|
63387
|
+
}, _callee11);
|
|
63342
63388
|
}));
|
|
63343
63389
|
return function (_x14) {
|
|
63344
|
-
return
|
|
63390
|
+
return _ref7.apply(this, arguments);
|
|
63345
63391
|
};
|
|
63346
63392
|
}());
|
|
63347
63393
|
this._entityEventSubjects.set(entityName, subject);
|
|
63348
63394
|
}
|
|
63349
63395
|
this._entityEventSubjects.get(entityName).next(event);
|
|
63350
|
-
return
|
|
63396
|
+
return _context12.a(2, true);
|
|
63351
63397
|
case 1:
|
|
63352
|
-
|
|
63353
|
-
|
|
63354
|
-
LogError(
|
|
63355
|
-
return
|
|
63398
|
+
_context12.p = 1;
|
|
63399
|
+
_t12 = _context12.v;
|
|
63400
|
+
LogError(_t12);
|
|
63401
|
+
return _context12.a(2, false);
|
|
63356
63402
|
}
|
|
63357
|
-
},
|
|
63403
|
+
}, _callee12, this, [[0, 1]]);
|
|
63358
63404
|
}));
|
|
63359
63405
|
function DebounceIndividualBaseEntityEvent(_x13) {
|
|
63360
63406
|
return _DebounceIndividualBaseEntityEvent.apply(this, arguments);
|
|
@@ -63384,13 +63430,13 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63384
63430
|
}, {
|
|
63385
63431
|
key: "ProcessEntityEvent",
|
|
63386
63432
|
value: (function () {
|
|
63387
|
-
var _ProcessEntityEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
63388
|
-
return baseEngine_regenerator().w(function (
|
|
63389
|
-
while (1) switch (
|
|
63433
|
+
var _ProcessEntityEvent = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee13(event) {
|
|
63434
|
+
return baseEngine_regenerator().w(function (_context13) {
|
|
63435
|
+
while (1) switch (_context13.n) {
|
|
63390
63436
|
case 0:
|
|
63391
|
-
return
|
|
63437
|
+
return _context13.a(2, this.ProcessEntityEvents([event]));
|
|
63392
63438
|
}
|
|
63393
|
-
},
|
|
63439
|
+
}, _callee13, this);
|
|
63394
63440
|
}));
|
|
63395
63441
|
function ProcessEntityEvent(_x15) {
|
|
63396
63442
|
return _ProcessEntityEvent.apply(this, arguments);
|
|
@@ -63426,90 +63472,90 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63426
63472
|
}, {
|
|
63427
63473
|
key: "ProcessEntityEvents",
|
|
63428
63474
|
value: (function () {
|
|
63429
|
-
var _ProcessEntityEvents = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
63430
|
-
var
|
|
63431
|
-
var entityName, refreshCount, _iterator5, _step5, _loop,
|
|
63432
|
-
return baseEngine_regenerator().w(function (
|
|
63433
|
-
while (1) switch (
|
|
63475
|
+
var _ProcessEntityEvents = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee14(events) {
|
|
63476
|
+
var _this9 = this;
|
|
63477
|
+
var entityName, refreshCount, _iterator5, _step5, _loop, _t14, _t15;
|
|
63478
|
+
return baseEngine_regenerator().w(function (_context15) {
|
|
63479
|
+
while (1) switch (_context15.p = _context15.n) {
|
|
63434
63480
|
case 0:
|
|
63435
63481
|
if (!(!events || events.length === 0)) {
|
|
63436
|
-
|
|
63482
|
+
_context15.n = 1;
|
|
63437
63483
|
break;
|
|
63438
63484
|
}
|
|
63439
|
-
return
|
|
63485
|
+
return _context15.a(2);
|
|
63440
63486
|
case 1:
|
|
63441
|
-
|
|
63487
|
+
_context15.p = 1;
|
|
63442
63488
|
entityName = events[0].baseEntity.EntityInfo.Name.toLowerCase().trim();
|
|
63443
63489
|
refreshCount = 0;
|
|
63444
63490
|
_iterator5 = baseEngine_createForOfIteratorHelper(this.Configs);
|
|
63445
|
-
|
|
63491
|
+
_context15.p = 2;
|
|
63446
63492
|
_loop = /*#__PURE__*/baseEngine_regenerator().m(function _loop() {
|
|
63447
63493
|
var _config$EntityName;
|
|
63448
|
-
var config, classified, needingWork, _iterator6, _step6, c, lastNotify,
|
|
63449
|
-
return baseEngine_regenerator().w(function (
|
|
63450
|
-
while (1) switch (
|
|
63494
|
+
var config, classified, needingWork, _iterator6, _step6, c, lastNotify, _t13;
|
|
63495
|
+
return baseEngine_regenerator().w(function (_context14) {
|
|
63496
|
+
while (1) switch (_context14.p = _context14.n) {
|
|
63451
63497
|
case 0:
|
|
63452
63498
|
config = _step5.value;
|
|
63453
63499
|
if (!(config.AutoRefresh && config.Type === 'entity' && ((_config$EntityName = config.EntityName) === null || _config$EntityName === void 0 ? void 0 : _config$EntityName.trim().toLowerCase()) === entityName)) {
|
|
63454
|
-
|
|
63500
|
+
_context14.n = 12;
|
|
63455
63501
|
break;
|
|
63456
63502
|
}
|
|
63457
63503
|
classified = events.map(function (e) {
|
|
63458
63504
|
return {
|
|
63459
63505
|
event: e,
|
|
63460
|
-
disposition:
|
|
63506
|
+
disposition: _this9.classifyEventForConfig(config, e)
|
|
63461
63507
|
};
|
|
63462
63508
|
});
|
|
63463
63509
|
needingWork = classified.filter(function (c) {
|
|
63464
63510
|
return c.disposition.action === 'refresh';
|
|
63465
63511
|
});
|
|
63466
63512
|
if (!(needingWork.length > 0)) {
|
|
63467
|
-
|
|
63513
|
+
_context14.n = 11;
|
|
63468
63514
|
break;
|
|
63469
63515
|
}
|
|
63470
|
-
if (!
|
|
63471
|
-
|
|
63516
|
+
if (!_this9.canUseImmediateMutation(config)) {
|
|
63517
|
+
_context14.n = 8;
|
|
63472
63518
|
break;
|
|
63473
63519
|
}
|
|
63474
63520
|
// Apply, in order, every event the array hasn't seen yet
|
|
63475
63521
|
_iterator6 = baseEngine_createForOfIteratorHelper(needingWork);
|
|
63476
|
-
|
|
63522
|
+
_context14.p = 1;
|
|
63477
63523
|
_iterator6.s();
|
|
63478
63524
|
case 2:
|
|
63479
63525
|
if ((_step6 = _iterator6.n()).done) {
|
|
63480
|
-
|
|
63526
|
+
_context14.n = 4;
|
|
63481
63527
|
break;
|
|
63482
63528
|
}
|
|
63483
63529
|
c = _step6.value;
|
|
63484
|
-
|
|
63485
|
-
return
|
|
63530
|
+
_context14.n = 3;
|
|
63531
|
+
return _this9.applyImmediateMutation(config, c.event);
|
|
63486
63532
|
case 3:
|
|
63487
|
-
|
|
63533
|
+
_context14.n = 2;
|
|
63488
63534
|
break;
|
|
63489
63535
|
case 4:
|
|
63490
|
-
|
|
63536
|
+
_context14.n = 6;
|
|
63491
63537
|
break;
|
|
63492
63538
|
case 5:
|
|
63493
|
-
|
|
63494
|
-
|
|
63495
|
-
_iterator6.e(
|
|
63539
|
+
_context14.p = 5;
|
|
63540
|
+
_t13 = _context14.v;
|
|
63541
|
+
_iterator6.e(_t13);
|
|
63496
63542
|
case 6:
|
|
63497
|
-
|
|
63543
|
+
_context14.p = 6;
|
|
63498
63544
|
_iterator6.f();
|
|
63499
|
-
return
|
|
63545
|
+
return _context14.f(6);
|
|
63500
63546
|
case 7:
|
|
63501
|
-
|
|
63547
|
+
_context14.n = 10;
|
|
63502
63548
|
break;
|
|
63503
63549
|
case 8:
|
|
63504
|
-
|
|
63505
|
-
return
|
|
63550
|
+
_context14.n = 9;
|
|
63551
|
+
return _this9.LoadSingleConfig(config, _this9._contextUser, /*bypassCache*/true);
|
|
63506
63552
|
case 9:
|
|
63507
|
-
if (!
|
|
63508
|
-
|
|
63553
|
+
if (!_this9.configLoadedSuccessfully(config.PropertyName)) {
|
|
63554
|
+
_this9.scheduleEventRefreshRetry(config, 1);
|
|
63509
63555
|
}
|
|
63510
63556
|
refreshCount++;
|
|
63511
63557
|
case 10:
|
|
63512
|
-
|
|
63558
|
+
_context14.n = 12;
|
|
63513
63559
|
break;
|
|
63514
63560
|
case 11:
|
|
63515
63561
|
// No event requires a refresh. If any event's changes were already
|
|
@@ -63519,52 +63565,52 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63519
63565
|
return c.disposition.action === 'notify';
|
|
63520
63566
|
});
|
|
63521
63567
|
if (lastNotify && lastNotify.disposition.action === 'notify') {
|
|
63522
|
-
|
|
63568
|
+
_this9.notifyAlreadyAppliedMutation(config, lastNotify.disposition.changeType, lastNotify.event.baseEntity);
|
|
63523
63569
|
}
|
|
63524
63570
|
case 12:
|
|
63525
|
-
return
|
|
63571
|
+
return _context14.a(2);
|
|
63526
63572
|
}
|
|
63527
63573
|
}, _loop, null, [[1, 5, 6, 7]]);
|
|
63528
63574
|
});
|
|
63529
63575
|
_iterator5.s();
|
|
63530
63576
|
case 3:
|
|
63531
63577
|
if ((_step5 = _iterator5.n()).done) {
|
|
63532
|
-
|
|
63578
|
+
_context15.n = 5;
|
|
63533
63579
|
break;
|
|
63534
63580
|
}
|
|
63535
|
-
return
|
|
63581
|
+
return _context15.d(baseEngine_regeneratorValues(_loop()), 4);
|
|
63536
63582
|
case 4:
|
|
63537
|
-
|
|
63583
|
+
_context15.n = 3;
|
|
63538
63584
|
break;
|
|
63539
63585
|
case 5:
|
|
63540
|
-
|
|
63586
|
+
_context15.n = 7;
|
|
63541
63587
|
break;
|
|
63542
63588
|
case 6:
|
|
63543
|
-
|
|
63544
|
-
|
|
63545
|
-
_iterator5.e(
|
|
63589
|
+
_context15.p = 6;
|
|
63590
|
+
_t14 = _context15.v;
|
|
63591
|
+
_iterator5.e(_t14);
|
|
63546
63592
|
case 7:
|
|
63547
|
-
|
|
63593
|
+
_context15.p = 7;
|
|
63548
63594
|
_iterator5.f();
|
|
63549
|
-
return
|
|
63595
|
+
return _context15.f(7);
|
|
63550
63596
|
case 8:
|
|
63551
63597
|
if (!(refreshCount > 0)) {
|
|
63552
|
-
|
|
63598
|
+
_context15.n = 9;
|
|
63553
63599
|
break;
|
|
63554
63600
|
}
|
|
63555
|
-
|
|
63601
|
+
_context15.n = 9;
|
|
63556
63602
|
return this.AdditionalLoading(this._contextUser);
|
|
63557
63603
|
case 9:
|
|
63558
|
-
|
|
63604
|
+
_context15.n = 11;
|
|
63559
63605
|
break;
|
|
63560
63606
|
case 10:
|
|
63561
|
-
|
|
63562
|
-
|
|
63563
|
-
LogError(
|
|
63607
|
+
_context15.p = 10;
|
|
63608
|
+
_t15 = _context15.v;
|
|
63609
|
+
LogError(_t15);
|
|
63564
63610
|
case 11:
|
|
63565
|
-
return
|
|
63611
|
+
return _context15.a(2);
|
|
63566
63612
|
}
|
|
63567
|
-
},
|
|
63613
|
+
}, _callee14, this, [[2, 6, 7, 8], [1, 10]]);
|
|
63568
63614
|
}));
|
|
63569
63615
|
function ProcessEntityEvents(_x16) {
|
|
63570
63616
|
return _ProcessEntityEvents.apply(this, arguments);
|
|
@@ -63745,7 +63791,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63745
63791
|
}, {
|
|
63746
63792
|
key: "scheduleEventRefreshRetry",
|
|
63747
63793
|
value: function scheduleEventRefreshRetry(config, attempt) {
|
|
63748
|
-
var
|
|
63794
|
+
var _this0 = this;
|
|
63749
63795
|
var key = config.PropertyName;
|
|
63750
63796
|
if (this._eventRefreshRetryTimers.has(key)) {
|
|
63751
63797
|
return; // a retry is already pending for this property
|
|
@@ -63755,38 +63801,38 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63755
63801
|
return;
|
|
63756
63802
|
}
|
|
63757
63803
|
var delayMs = 2000 * attempt;
|
|
63758
|
-
var timer = setTimeout(/*#__PURE__*/baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
63759
|
-
var
|
|
63760
|
-
return baseEngine_regenerator().w(function (
|
|
63761
|
-
while (1) switch (
|
|
63804
|
+
var timer = setTimeout(/*#__PURE__*/baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee15() {
|
|
63805
|
+
var _t16;
|
|
63806
|
+
return baseEngine_regenerator().w(function (_context16) {
|
|
63807
|
+
while (1) switch (_context16.p = _context16.n) {
|
|
63762
63808
|
case 0:
|
|
63763
|
-
|
|
63764
|
-
|
|
63765
|
-
|
|
63766
|
-
return
|
|
63809
|
+
_this0._eventRefreshRetryTimers.delete(key);
|
|
63810
|
+
_context16.p = 1;
|
|
63811
|
+
_context16.n = 2;
|
|
63812
|
+
return _this0.LoadSingleConfig(config, _this0._contextUser, /*bypassCache*/true);
|
|
63767
63813
|
case 2:
|
|
63768
|
-
if (!
|
|
63769
|
-
|
|
63814
|
+
if (!_this0.configLoadedSuccessfully(key)) {
|
|
63815
|
+
_context16.n = 4;
|
|
63770
63816
|
break;
|
|
63771
63817
|
}
|
|
63772
|
-
|
|
63773
|
-
return
|
|
63818
|
+
_context16.n = 3;
|
|
63819
|
+
return _this0.AdditionalLoading(_this0._contextUser);
|
|
63774
63820
|
case 3:
|
|
63775
|
-
|
|
63821
|
+
_context16.n = 5;
|
|
63776
63822
|
break;
|
|
63777
63823
|
case 4:
|
|
63778
|
-
|
|
63824
|
+
_this0.scheduleEventRefreshRetry(config, attempt + 1);
|
|
63779
63825
|
case 5:
|
|
63780
|
-
|
|
63826
|
+
_context16.n = 7;
|
|
63781
63827
|
break;
|
|
63782
63828
|
case 6:
|
|
63783
|
-
|
|
63784
|
-
|
|
63785
|
-
LogError(
|
|
63829
|
+
_context16.p = 6;
|
|
63830
|
+
_t16 = _context16.v;
|
|
63831
|
+
LogError(_t16);
|
|
63786
63832
|
case 7:
|
|
63787
|
-
return
|
|
63833
|
+
return _context16.a(2);
|
|
63788
63834
|
}
|
|
63789
|
-
},
|
|
63835
|
+
}, _callee15, null, [[1, 6]]);
|
|
63790
63836
|
})), delayMs);
|
|
63791
63837
|
this._eventRefreshRetryTimers.set(key, timer);
|
|
63792
63838
|
}
|
|
@@ -63870,33 +63916,33 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63870
63916
|
}, {
|
|
63871
63917
|
key: "applyImmediateMutation",
|
|
63872
63918
|
value: (function () {
|
|
63873
|
-
var _applyImmediateMutation = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
63919
|
+
var _applyImmediateMutation = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee16(config, event) {
|
|
63874
63920
|
var currentData, entity, cached, existsByRef, indexByKey, _existsByRef, index, _index;
|
|
63875
|
-
return baseEngine_regenerator().w(function (
|
|
63876
|
-
while (1) switch (
|
|
63921
|
+
return baseEngine_regenerator().w(function (_context17) {
|
|
63922
|
+
while (1) switch (_context17.n) {
|
|
63877
63923
|
case 0:
|
|
63878
63924
|
currentData = this[config.PropertyName];
|
|
63879
63925
|
if (currentData) {
|
|
63880
|
-
|
|
63926
|
+
_context17.n = 1;
|
|
63881
63927
|
break;
|
|
63882
63928
|
}
|
|
63883
|
-
return
|
|
63929
|
+
return _context17.a(2);
|
|
63884
63930
|
case 1:
|
|
63885
63931
|
entity = event.baseEntity;
|
|
63886
63932
|
if (!(event.type === 'save')) {
|
|
63887
|
-
|
|
63933
|
+
_context17.n = 4;
|
|
63888
63934
|
break;
|
|
63889
63935
|
}
|
|
63890
|
-
|
|
63936
|
+
_context17.n = 2;
|
|
63891
63937
|
return this.cloneEntityForCache(entity, config);
|
|
63892
63938
|
case 2:
|
|
63893
|
-
cached =
|
|
63939
|
+
cached = _context17.v;
|
|
63894
63940
|
if (cached) {
|
|
63895
|
-
|
|
63941
|
+
_context17.n = 3;
|
|
63896
63942
|
break;
|
|
63897
63943
|
}
|
|
63898
63944
|
LogError("BaseEngine.applyImmediateMutation: failed to clone entity for ".concat(config.EntityName, "; skipping immediate mutation"));
|
|
63899
|
-
return
|
|
63945
|
+
return _context17.a(2);
|
|
63900
63946
|
case 3:
|
|
63901
63947
|
if (event.saveSubType === 'create') {
|
|
63902
63948
|
// For create, first check if the exact object is already in the array
|
|
@@ -63960,7 +64006,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63960
64006
|
this.NotifyDataChange(config, currentData, 'update', entity);
|
|
63961
64007
|
}
|
|
63962
64008
|
}
|
|
63963
|
-
|
|
64009
|
+
_context17.n = 5;
|
|
63964
64010
|
break;
|
|
63965
64011
|
case 4:
|
|
63966
64012
|
if (event.type === 'delete') {
|
|
@@ -63992,9 +64038,9 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
63992
64038
|
});
|
|
63993
64039
|
}
|
|
63994
64040
|
case 6:
|
|
63995
|
-
return
|
|
64041
|
+
return _context17.a(2);
|
|
63996
64042
|
}
|
|
63997
|
-
},
|
|
64043
|
+
}, _callee16, this);
|
|
63998
64044
|
}));
|
|
63999
64045
|
function applyImmediateMutation(_x17, _x18) {
|
|
64000
64046
|
return _applyImmediateMutation.apply(this, arguments);
|
|
@@ -64010,40 +64056,40 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64010
64056
|
}, {
|
|
64011
64057
|
key: "cloneEntityForCache",
|
|
64012
64058
|
value: (function () {
|
|
64013
|
-
var _cloneEntityForCache = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64014
|
-
var provider, fresh,
|
|
64015
|
-
return baseEngine_regenerator().w(function (
|
|
64016
|
-
while (1) switch (
|
|
64059
|
+
var _cloneEntityForCache = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee17(source, config) {
|
|
64060
|
+
var provider, fresh, _t17;
|
|
64061
|
+
return baseEngine_regenerator().w(function (_context18) {
|
|
64062
|
+
while (1) switch (_context18.p = _context18.n) {
|
|
64017
64063
|
case 0:
|
|
64018
|
-
|
|
64064
|
+
_context18.p = 0;
|
|
64019
64065
|
provider = this.ProviderToUse;
|
|
64020
64066
|
if (provider) {
|
|
64021
|
-
|
|
64067
|
+
_context18.n = 1;
|
|
64022
64068
|
break;
|
|
64023
64069
|
}
|
|
64024
|
-
return
|
|
64070
|
+
return _context18.a(2, null);
|
|
64025
64071
|
case 1:
|
|
64026
|
-
|
|
64072
|
+
_context18.n = 2;
|
|
64027
64073
|
return provider.GetEntityObject(config.EntityName, this._contextUser);
|
|
64028
64074
|
case 2:
|
|
64029
|
-
fresh =
|
|
64075
|
+
fresh = _context18.v;
|
|
64030
64076
|
if (fresh) {
|
|
64031
|
-
|
|
64077
|
+
_context18.n = 3;
|
|
64032
64078
|
break;
|
|
64033
64079
|
}
|
|
64034
|
-
return
|
|
64080
|
+
return _context18.a(2, null);
|
|
64035
64081
|
case 3:
|
|
64036
|
-
|
|
64082
|
+
_context18.n = 4;
|
|
64037
64083
|
return fresh.LoadFromData(source.GetAll());
|
|
64038
64084
|
case 4:
|
|
64039
|
-
return
|
|
64085
|
+
return _context18.a(2, fresh);
|
|
64040
64086
|
case 5:
|
|
64041
|
-
|
|
64042
|
-
|
|
64043
|
-
LogError(
|
|
64044
|
-
return
|
|
64087
|
+
_context18.p = 5;
|
|
64088
|
+
_t17 = _context18.v;
|
|
64089
|
+
LogError(_t17);
|
|
64090
|
+
return _context18.a(2, null);
|
|
64045
64091
|
}
|
|
64046
|
-
},
|
|
64092
|
+
}, _callee17, this, [[0, 5]]);
|
|
64047
64093
|
}));
|
|
64048
64094
|
function cloneEntityForCache(_x19, _x20) {
|
|
64049
64095
|
return _cloneEntityForCache.apply(this, arguments);
|
|
@@ -64064,16 +64110,16 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64064
64110
|
}, {
|
|
64065
64111
|
key: "syncLocalCacheForConfig",
|
|
64066
64112
|
value: (function () {
|
|
64067
|
-
var _syncLocalCacheForConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64113
|
+
var _syncLocalCacheForConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee18(config, event) {
|
|
64068
64114
|
var entity, provider, connectionString, fingerprint, key, rawUpdatedAt, updatedAt, entityData;
|
|
64069
|
-
return baseEngine_regenerator().w(function (
|
|
64070
|
-
while (1) switch (
|
|
64115
|
+
return baseEngine_regenerator().w(function (_context19) {
|
|
64116
|
+
while (1) switch (_context19.n) {
|
|
64071
64117
|
case 0:
|
|
64072
64118
|
if (LocalCacheManager.Instance.IsInitialized) {
|
|
64073
|
-
|
|
64119
|
+
_context19.n = 1;
|
|
64074
64120
|
break;
|
|
64075
64121
|
}
|
|
64076
|
-
return
|
|
64122
|
+
return _context19.a(2);
|
|
64077
64123
|
case 1:
|
|
64078
64124
|
entity = event.baseEntity; // Get the connection string from the provider for fingerprint generation
|
|
64079
64125
|
// The provider is needed because fingerprints include connection prefix
|
|
@@ -64088,11 +64134,11 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64088
64134
|
if (!(!key || key.KeyValuePairs.length === 0 || key.KeyValuePairs.some(function (kv) {
|
|
64089
64135
|
return kv.Value == null;
|
|
64090
64136
|
}))) {
|
|
64091
|
-
|
|
64137
|
+
_context19.n = 2;
|
|
64092
64138
|
break;
|
|
64093
64139
|
}
|
|
64094
64140
|
LogStatus("BaseEngine.syncLocalCacheForConfig: Cannot sync - primary key is incomplete for ".concat(config.EntityName));
|
|
64095
|
-
return
|
|
64141
|
+
return _context19.a(2);
|
|
64096
64142
|
case 2:
|
|
64097
64143
|
// Get the updated timestamp from the entity and normalize to an ISO string.
|
|
64098
64144
|
// entity.Get returns Date|string|number|null depending on field hydration and the
|
|
@@ -64103,22 +64149,22 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64103
64149
|
rawUpdatedAt = entity.Get('__mj_UpdatedAt');
|
|
64104
64150
|
updatedAt = rawUpdatedAt ? new Date(rawUpdatedAt).toISOString() : new Date().toISOString();
|
|
64105
64151
|
if (!(event.type === 'delete')) {
|
|
64106
|
-
|
|
64152
|
+
_context19.n = 4;
|
|
64107
64153
|
break;
|
|
64108
64154
|
}
|
|
64109
|
-
|
|
64155
|
+
_context19.n = 3;
|
|
64110
64156
|
return LocalCacheManager.Instance.RemoveSingleEntity(fingerprint, key, updatedAt);
|
|
64111
64157
|
case 3:
|
|
64112
|
-
|
|
64158
|
+
_context19.n = 5;
|
|
64113
64159
|
break;
|
|
64114
64160
|
case 4:
|
|
64115
64161
|
entityData = entity.GetAll();
|
|
64116
|
-
|
|
64162
|
+
_context19.n = 5;
|
|
64117
64163
|
return LocalCacheManager.Instance.UpsertSingleEntity(fingerprint, entityData, key, updatedAt);
|
|
64118
64164
|
case 5:
|
|
64119
|
-
return
|
|
64165
|
+
return _context19.a(2);
|
|
64120
64166
|
}
|
|
64121
|
-
},
|
|
64167
|
+
}, _callee18, this);
|
|
64122
64168
|
}));
|
|
64123
64169
|
function syncLocalCacheForConfig(_x21, _x22) {
|
|
64124
64170
|
return _syncLocalCacheForConfig.apply(this, arguments);
|
|
@@ -64189,19 +64235,19 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64189
64235
|
}, {
|
|
64190
64236
|
key: "LoadConfigs",
|
|
64191
64237
|
value: (function () {
|
|
64192
|
-
var _LoadConfigs = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64193
|
-
var
|
|
64238
|
+
var _LoadConfigs = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee19(configs, contextUser) {
|
|
64239
|
+
var _this1 = this;
|
|
64194
64240
|
var bypassCache,
|
|
64195
64241
|
entityConfigs,
|
|
64196
64242
|
datasetConfigs,
|
|
64197
64243
|
entityConfigsToLoad,
|
|
64198
|
-
|
|
64199
|
-
return baseEngine_regenerator().w(function (
|
|
64200
|
-
while (1) switch (
|
|
64244
|
+
_args20 = arguments;
|
|
64245
|
+
return baseEngine_regenerator().w(function (_context20) {
|
|
64246
|
+
while (1) switch (_context20.n) {
|
|
64201
64247
|
case 0:
|
|
64202
|
-
bypassCache =
|
|
64248
|
+
bypassCache = _args20.length > 2 && _args20[2] !== undefined ? _args20[2] : false;
|
|
64203
64249
|
this._metadataConfigs = configs.map(function (c) {
|
|
64204
|
-
return
|
|
64250
|
+
return _this1.UpgradeObjectToConfig(c);
|
|
64205
64251
|
});
|
|
64206
64252
|
// now, break up the configs into two chunks, datasets and views of entities so we can load all the views in a single network call via RunViews()
|
|
64207
64253
|
entityConfigs = this._metadataConfigs.filter(function (c) {
|
|
@@ -64214,17 +64260,17 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64214
64260
|
// original array unchanged when permissions pass, or an empty array when
|
|
64215
64261
|
// any entity is denied (marking the engine as permission-constrained).
|
|
64216
64262
|
entityConfigsToLoad = this.CheckPermissionsOrSkipAll(entityConfigs, contextUser);
|
|
64217
|
-
|
|
64263
|
+
_context20.n = 1;
|
|
64218
64264
|
return Promise.all([].concat(baseEngine_toConsumableArray(datasetConfigs.map(function (c) {
|
|
64219
|
-
return
|
|
64265
|
+
return _this1.LoadSingleDatasetConfig(c, contextUser, bypassCache);
|
|
64220
64266
|
})), [this.LoadMultipleEntityConfigs(entityConfigsToLoad, contextUser, bypassCache)]));
|
|
64221
64267
|
case 1:
|
|
64222
64268
|
// Register cross-server cache change callbacks for entity configs
|
|
64223
64269
|
this.RegisterCacheChangeCallbacks(entityConfigs);
|
|
64224
64270
|
case 2:
|
|
64225
|
-
return
|
|
64271
|
+
return _context20.a(2);
|
|
64226
64272
|
}
|
|
64227
|
-
},
|
|
64273
|
+
}, _callee19, this);
|
|
64228
64274
|
}));
|
|
64229
64275
|
function LoadConfigs(_x23, _x24) {
|
|
64230
64276
|
return _LoadConfigs.apply(this, arguments);
|
|
@@ -64313,30 +64359,30 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64313
64359
|
}, {
|
|
64314
64360
|
key: "LoadSingleConfig",
|
|
64315
64361
|
value: (function () {
|
|
64316
|
-
var _LoadSingleConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64362
|
+
var _LoadSingleConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee20(config, contextUser) {
|
|
64317
64363
|
var bypassCache,
|
|
64318
|
-
|
|
64319
|
-
return baseEngine_regenerator().w(function (
|
|
64320
|
-
while (1) switch (
|
|
64364
|
+
_args21 = arguments;
|
|
64365
|
+
return baseEngine_regenerator().w(function (_context21) {
|
|
64366
|
+
while (1) switch (_context21.n) {
|
|
64321
64367
|
case 0:
|
|
64322
|
-
bypassCache =
|
|
64368
|
+
bypassCache = _args21.length > 2 && _args21[2] !== undefined ? _args21[2] : false;
|
|
64323
64369
|
if (!(config.Type === 'dataset')) {
|
|
64324
|
-
|
|
64370
|
+
_context21.n = 2;
|
|
64325
64371
|
break;
|
|
64326
64372
|
}
|
|
64327
|
-
|
|
64373
|
+
_context21.n = 1;
|
|
64328
64374
|
return this.LoadSingleDatasetConfig(config, contextUser, bypassCache);
|
|
64329
64375
|
case 1:
|
|
64330
|
-
return
|
|
64376
|
+
return _context21.a(2, _context21.v);
|
|
64331
64377
|
case 2:
|
|
64332
|
-
|
|
64378
|
+
_context21.n = 3;
|
|
64333
64379
|
return this.LoadSingleEntityConfig(config, contextUser, bypassCache);
|
|
64334
64380
|
case 3:
|
|
64335
|
-
return
|
|
64381
|
+
return _context21.a(2, _context21.v);
|
|
64336
64382
|
case 4:
|
|
64337
|
-
return
|
|
64383
|
+
return _context21.a(2);
|
|
64338
64384
|
}
|
|
64339
|
-
},
|
|
64385
|
+
}, _callee20, this);
|
|
64340
64386
|
}));
|
|
64341
64387
|
function LoadSingleConfig(_x25, _x26) {
|
|
64342
64388
|
return _LoadSingleConfig.apply(this, arguments);
|
|
@@ -64402,17 +64448,17 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64402
64448
|
}, {
|
|
64403
64449
|
key: "LoadSingleEntityConfig",
|
|
64404
64450
|
value: (function () {
|
|
64405
|
-
var _LoadSingleEntityConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64451
|
+
var _LoadSingleEntityConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee21(config, contextUser) {
|
|
64406
64452
|
var bypassCache,
|
|
64407
64453
|
generation,
|
|
64408
64454
|
p,
|
|
64409
64455
|
rv,
|
|
64410
64456
|
result,
|
|
64411
|
-
|
|
64412
|
-
return baseEngine_regenerator().w(function (
|
|
64413
|
-
while (1) switch (
|
|
64457
|
+
_args22 = arguments;
|
|
64458
|
+
return baseEngine_regenerator().w(function (_context22) {
|
|
64459
|
+
while (1) switch (_context22.n) {
|
|
64414
64460
|
case 0:
|
|
64415
|
-
bypassCache =
|
|
64461
|
+
bypassCache = _args22.length > 2 && _args22[2] !== undefined ? _args22[2] : false;
|
|
64416
64462
|
// Claim a refresh generation BEFORE the awaited RunView. If another full refresh for
|
|
64417
64463
|
// this same property starts while our RunView is in flight, ours becomes stale and must
|
|
64418
64464
|
// not commit — otherwise concurrent refreshes (the filtered/OrderBy path, e.g.
|
|
@@ -64421,22 +64467,22 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64421
64467
|
generation = this.beginConfigRefresh(config.PropertyName);
|
|
64422
64468
|
p = this.RunViewProviderToUse;
|
|
64423
64469
|
rv = new RunView(p);
|
|
64424
|
-
|
|
64470
|
+
_context22.n = 1;
|
|
64425
64471
|
return rv.RunView(this.BuildRunViewParamsForConfig(config, bypassCache), contextUser);
|
|
64426
64472
|
case 1:
|
|
64427
|
-
result =
|
|
64473
|
+
result = _context22.v;
|
|
64428
64474
|
if (this.isLatestConfigRefresh(config.PropertyName, generation)) {
|
|
64429
|
-
|
|
64475
|
+
_context22.n = 2;
|
|
64430
64476
|
break;
|
|
64431
64477
|
}
|
|
64432
|
-
return
|
|
64478
|
+
return _context22.a(2);
|
|
64433
64479
|
case 2:
|
|
64434
64480
|
this.HandleSingleViewResult(config, result, contextUser);
|
|
64435
64481
|
this.emitPropertyChange(config.PropertyName);
|
|
64436
64482
|
case 3:
|
|
64437
|
-
return
|
|
64483
|
+
return _context22.a(2);
|
|
64438
64484
|
}
|
|
64439
|
-
},
|
|
64485
|
+
}, _callee21, this);
|
|
64440
64486
|
}));
|
|
64441
64487
|
function LoadSingleEntityConfig(_x27, _x28) {
|
|
64442
64488
|
return _LoadSingleEntityConfig.apply(this, arguments);
|
|
@@ -64554,8 +64600,8 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64554
64600
|
}, {
|
|
64555
64601
|
key: "LoadMultipleEntityConfigs",
|
|
64556
64602
|
value: (function () {
|
|
64557
|
-
var _LoadMultipleEntityConfigs = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64558
|
-
var
|
|
64603
|
+
var _LoadMultipleEntityConfigs = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee22(configs, contextUser) {
|
|
64604
|
+
var _this10 = this;
|
|
64559
64605
|
var bypassCache,
|
|
64560
64606
|
p,
|
|
64561
64607
|
rv,
|
|
@@ -64563,24 +64609,24 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64563
64609
|
results,
|
|
64564
64610
|
entityNames,
|
|
64565
64611
|
i,
|
|
64566
|
-
|
|
64567
|
-
return baseEngine_regenerator().w(function (
|
|
64568
|
-
while (1) switch (
|
|
64612
|
+
_args23 = arguments;
|
|
64613
|
+
return baseEngine_regenerator().w(function (_context23) {
|
|
64614
|
+
while (1) switch (_context23.n) {
|
|
64569
64615
|
case 0:
|
|
64570
|
-
bypassCache =
|
|
64616
|
+
bypassCache = _args23.length > 2 && _args23[2] !== undefined ? _args23[2] : false;
|
|
64571
64617
|
if (!(configs && configs.length > 0)) {
|
|
64572
|
-
|
|
64618
|
+
_context23.n = 2;
|
|
64573
64619
|
break;
|
|
64574
64620
|
}
|
|
64575
64621
|
p = this.RunViewProviderToUse;
|
|
64576
64622
|
rv = new RunView(p);
|
|
64577
64623
|
viewConfigs = configs.map(function (c) {
|
|
64578
|
-
return
|
|
64624
|
+
return _this10.BuildRunViewParamsForConfig(c, bypassCache);
|
|
64579
64625
|
});
|
|
64580
|
-
|
|
64626
|
+
_context23.n = 1;
|
|
64581
64627
|
return rv.RunViews(viewConfigs, contextUser);
|
|
64582
64628
|
case 1:
|
|
64583
|
-
results =
|
|
64629
|
+
results = _context23.v;
|
|
64584
64630
|
// Process results and record entity loads for redundancy detection
|
|
64585
64631
|
entityNames = [];
|
|
64586
64632
|
for (i = 0; i < configs.length; i++) {
|
|
@@ -64597,9 +64643,9 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64597
64643
|
BaseEngineRegistry.Instance.RecordEntityLoads(this, entityNames);
|
|
64598
64644
|
}
|
|
64599
64645
|
case 2:
|
|
64600
|
-
return
|
|
64646
|
+
return _context23.a(2);
|
|
64601
64647
|
}
|
|
64602
|
-
},
|
|
64648
|
+
}, _callee22, this);
|
|
64603
64649
|
}));
|
|
64604
64650
|
function LoadMultipleEntityConfigs(_x29, _x30) {
|
|
64605
64651
|
return _LoadMultipleEntityConfigs.apply(this, arguments);
|
|
@@ -64618,7 +64664,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64618
64664
|
}, {
|
|
64619
64665
|
key: "LoadSingleDatasetConfig",
|
|
64620
64666
|
value: (function () {
|
|
64621
|
-
var _LoadSingleDatasetConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64667
|
+
var _LoadSingleDatasetConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee23(config, contextUser) {
|
|
64622
64668
|
var bypassCache,
|
|
64623
64669
|
p,
|
|
64624
64670
|
result,
|
|
@@ -64637,37 +64683,37 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64637
64683
|
_iterator1,
|
|
64638
64684
|
_step1,
|
|
64639
64685
|
_item,
|
|
64640
|
-
|
|
64641
|
-
|
|
64642
|
-
|
|
64643
|
-
return baseEngine_regenerator().w(function (
|
|
64644
|
-
while (1) switch (
|
|
64686
|
+
_args24 = arguments,
|
|
64687
|
+
_t18,
|
|
64688
|
+
_t19;
|
|
64689
|
+
return baseEngine_regenerator().w(function (_context24) {
|
|
64690
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
64645
64691
|
case 0:
|
|
64646
|
-
bypassCache =
|
|
64692
|
+
bypassCache = _args24.length > 2 && _args24[2] !== undefined ? _args24[2] : false;
|
|
64647
64693
|
p = this.ProviderToUse; // When bypassing cache, use GetDatasetByName with forceRefresh to skip all cache reads,
|
|
64648
64694
|
// then CacheDataset to store the fresh results for subsequent non-forced calls.
|
|
64649
64695
|
// Otherwise, use GetAndCacheDatasetByName which validates staleness before returning cached data.
|
|
64650
64696
|
if (!bypassCache) {
|
|
64651
|
-
|
|
64697
|
+
_context24.n = 3;
|
|
64652
64698
|
break;
|
|
64653
64699
|
}
|
|
64654
|
-
|
|
64700
|
+
_context24.n = 1;
|
|
64655
64701
|
return p.GetDatasetByName(config.DatasetName, config.DatasetItemFilters, contextUser, undefined, true);
|
|
64656
64702
|
case 1:
|
|
64657
|
-
result =
|
|
64658
|
-
|
|
64703
|
+
result = _context24.v;
|
|
64704
|
+
_context24.n = 2;
|
|
64659
64705
|
return p.CacheDataset(config.DatasetName, config.DatasetItemFilters, result);
|
|
64660
64706
|
case 2:
|
|
64661
|
-
|
|
64707
|
+
_context24.n = 5;
|
|
64662
64708
|
break;
|
|
64663
64709
|
case 3:
|
|
64664
|
-
|
|
64710
|
+
_context24.n = 4;
|
|
64665
64711
|
return p.GetAndCacheDatasetByName(config.DatasetName, config.DatasetItemFilters);
|
|
64666
64712
|
case 4:
|
|
64667
|
-
result =
|
|
64713
|
+
result = _context24.v;
|
|
64668
64714
|
case 5:
|
|
64669
64715
|
if (result) {
|
|
64670
|
-
|
|
64716
|
+
_context24.n = 6;
|
|
64671
64717
|
break;
|
|
64672
64718
|
}
|
|
64673
64719
|
errorMsg = "GetAndCacheDatasetByName(\"".concat(config.DatasetName, "\") returned undefined/null \u2014 provider: ").concat(p === null || p === void 0 || (_p$constructor = p.constructor) === null || _p$constructor === void 0 ? void 0 : _p$constructor.name);
|
|
@@ -64678,10 +64724,10 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64678
64724
|
loadedSuccessfully: false,
|
|
64679
64725
|
errorMessage: errorMsg
|
|
64680
64726
|
});
|
|
64681
|
-
return
|
|
64727
|
+
return _context24.a(2);
|
|
64682
64728
|
case 6:
|
|
64683
64729
|
if (result.Success) {
|
|
64684
|
-
|
|
64730
|
+
_context24.n = 7;
|
|
64685
64731
|
break;
|
|
64686
64732
|
}
|
|
64687
64733
|
_errorMsg = result.Status || "Dataset \"".concat(config.DatasetName, "\" load returned Success=false");
|
|
@@ -64692,27 +64738,27 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64692
64738
|
loadedSuccessfully: false,
|
|
64693
64739
|
errorMessage: _errorMsg
|
|
64694
64740
|
});
|
|
64695
|
-
return
|
|
64741
|
+
return _context24.a(2);
|
|
64696
64742
|
case 7:
|
|
64697
64743
|
if (!result.Success) {
|
|
64698
|
-
|
|
64744
|
+
_context24.n = 26;
|
|
64699
64745
|
break;
|
|
64700
64746
|
}
|
|
64701
64747
|
if (!(config.AddToObject !== false)) {
|
|
64702
|
-
|
|
64748
|
+
_context24.n = 25;
|
|
64703
64749
|
break;
|
|
64704
64750
|
}
|
|
64705
64751
|
if (!(config.DatasetResultHandling === 'single_property')) {
|
|
64706
|
-
|
|
64752
|
+
_context24.n = 24;
|
|
64707
64753
|
break;
|
|
64708
64754
|
}
|
|
64709
64755
|
singleObject = {};
|
|
64710
64756
|
_iterator9 = baseEngine_createForOfIteratorHelper(result.Results);
|
|
64711
|
-
|
|
64757
|
+
_context24.p = 8;
|
|
64712
64758
|
_iterator9.s();
|
|
64713
64759
|
case 9:
|
|
64714
64760
|
if ((_step9 = _iterator9.n()).done) {
|
|
64715
|
-
|
|
64761
|
+
_context24.n = 20;
|
|
64716
64762
|
break;
|
|
64717
64763
|
}
|
|
64718
64764
|
item = _step9.value;
|
|
@@ -64720,55 +64766,55 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64720
64766
|
//adding them to the singleObject
|
|
64721
64767
|
entities = [];
|
|
64722
64768
|
_iterator0 = baseEngine_createForOfIteratorHelper(item.Results);
|
|
64723
|
-
|
|
64769
|
+
_context24.p = 10;
|
|
64724
64770
|
_iterator0.s();
|
|
64725
64771
|
case 11:
|
|
64726
64772
|
if ((_step0 = _iterator0.n()).done) {
|
|
64727
|
-
|
|
64773
|
+
_context24.n = 15;
|
|
64728
64774
|
break;
|
|
64729
64775
|
}
|
|
64730
64776
|
entityData = _step0.value;
|
|
64731
|
-
|
|
64777
|
+
_context24.n = 12;
|
|
64732
64778
|
return p.GetEntityObject(item.EntityName, contextUser);
|
|
64733
64779
|
case 12:
|
|
64734
|
-
entity =
|
|
64735
|
-
|
|
64780
|
+
entity = _context24.v;
|
|
64781
|
+
_context24.n = 13;
|
|
64736
64782
|
return entity.LoadFromData(entityData);
|
|
64737
64783
|
case 13:
|
|
64738
64784
|
entities.push(entity);
|
|
64739
64785
|
case 14:
|
|
64740
|
-
|
|
64786
|
+
_context24.n = 11;
|
|
64741
64787
|
break;
|
|
64742
64788
|
case 15:
|
|
64743
|
-
|
|
64789
|
+
_context24.n = 17;
|
|
64744
64790
|
break;
|
|
64745
64791
|
case 16:
|
|
64746
|
-
|
|
64747
|
-
|
|
64748
|
-
_iterator0.e(
|
|
64792
|
+
_context24.p = 16;
|
|
64793
|
+
_t18 = _context24.v;
|
|
64794
|
+
_iterator0.e(_t18);
|
|
64749
64795
|
case 17:
|
|
64750
|
-
|
|
64796
|
+
_context24.p = 17;
|
|
64751
64797
|
_iterator0.f();
|
|
64752
|
-
return
|
|
64798
|
+
return _context24.f(17);
|
|
64753
64799
|
case 18:
|
|
64754
64800
|
singleObject[item.Code] = entities;
|
|
64755
64801
|
case 19:
|
|
64756
|
-
|
|
64802
|
+
_context24.n = 9;
|
|
64757
64803
|
break;
|
|
64758
64804
|
case 20:
|
|
64759
|
-
|
|
64805
|
+
_context24.n = 22;
|
|
64760
64806
|
break;
|
|
64761
64807
|
case 21:
|
|
64762
|
-
|
|
64763
|
-
|
|
64764
|
-
_iterator9.e(
|
|
64808
|
+
_context24.p = 21;
|
|
64809
|
+
_t19 = _context24.v;
|
|
64810
|
+
_iterator9.e(_t19);
|
|
64765
64811
|
case 22:
|
|
64766
|
-
|
|
64812
|
+
_context24.p = 22;
|
|
64767
64813
|
_iterator9.f();
|
|
64768
|
-
return
|
|
64814
|
+
return _context24.f(22);
|
|
64769
64815
|
case 23:
|
|
64770
64816
|
this[config.PropertyName] = singleObject;
|
|
64771
|
-
|
|
64817
|
+
_context24.n = 25;
|
|
64772
64818
|
break;
|
|
64773
64819
|
case 24:
|
|
64774
64820
|
// explode out the items within the DS into individual properties
|
|
@@ -64793,9 +64839,9 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64793
64839
|
this.SetExpirationTimer(config.PropertyName, config.Expiration);
|
|
64794
64840
|
}
|
|
64795
64841
|
case 26:
|
|
64796
|
-
return
|
|
64842
|
+
return _context24.a(2);
|
|
64797
64843
|
}
|
|
64798
|
-
},
|
|
64844
|
+
}, _callee23, this, [[10, 16, 17, 18], [8, 21, 22, 23]]);
|
|
64799
64845
|
}));
|
|
64800
64846
|
function LoadSingleDatasetConfig(_x31, _x32) {
|
|
64801
64847
|
return _LoadSingleDatasetConfig.apply(this, arguments);
|
|
@@ -64817,7 +64863,7 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64817
64863
|
}, {
|
|
64818
64864
|
key: "RegisterCacheChangeCallbacks",
|
|
64819
64865
|
value: function RegisterCacheChangeCallbacks(entityConfigs) {
|
|
64820
|
-
var
|
|
64866
|
+
var _this11 = this;
|
|
64821
64867
|
// Unsubscribe any previous callbacks (e.g., on forceRefresh reload)
|
|
64822
64868
|
var _iterator10 = baseEngine_createForOfIteratorHelper(this._cacheChangeUnsubscribers),
|
|
64823
64869
|
_step10;
|
|
@@ -64841,11 +64887,11 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64841
64887
|
try {
|
|
64842
64888
|
var _loop2 = function _loop2() {
|
|
64843
64889
|
var config = _step11.value;
|
|
64844
|
-
var fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(
|
|
64890
|
+
var fingerprint = LocalCacheManager.Instance.GenerateRunViewFingerprint(_this11.BuildRunViewParamsForConfig(config), connectionPrefix);
|
|
64845
64891
|
var unsubscribe = LocalCacheManager.Instance.RegisterChangeCallback(fingerprint, function (event) {
|
|
64846
|
-
return
|
|
64892
|
+
return _this11.OnExternalCacheChange(config, event);
|
|
64847
64893
|
});
|
|
64848
|
-
|
|
64894
|
+
_this11._cacheChangeUnsubscribers.push(unsubscribe);
|
|
64849
64895
|
};
|
|
64850
64896
|
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
64851
64897
|
_loop2();
|
|
@@ -64869,19 +64915,19 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64869
64915
|
}, {
|
|
64870
64916
|
key: "OnExternalCacheChange",
|
|
64871
64917
|
value: (function () {
|
|
64872
|
-
var _OnExternalCacheChange = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
64873
|
-
var parsed, generation, rows, _parsed$totalRowCount,
|
|
64874
|
-
return baseEngine_regenerator().w(function (
|
|
64875
|
-
while (1) switch (
|
|
64918
|
+
var _OnExternalCacheChange = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee24(config, event) {
|
|
64919
|
+
var parsed, generation, rows, _parsed$totalRowCount, _t20;
|
|
64920
|
+
return baseEngine_regenerator().w(function (_context25) {
|
|
64921
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
64876
64922
|
case 0:
|
|
64877
64923
|
if (!(event.Data && event.Action === 'set')) {
|
|
64878
|
-
|
|
64924
|
+
_context25.n = 7;
|
|
64879
64925
|
break;
|
|
64880
64926
|
}
|
|
64881
|
-
|
|
64927
|
+
_context25.p = 1;
|
|
64882
64928
|
parsed = JSON.parse(event.Data);
|
|
64883
64929
|
if (!(parsed !== null && parsed !== void 0 && parsed.results && Array.isArray(parsed.results))) {
|
|
64884
|
-
|
|
64930
|
+
_context25.n = 5;
|
|
64885
64931
|
break;
|
|
64886
64932
|
}
|
|
64887
64933
|
// Claim a refresh generation BEFORE the awaited materialization — the same
|
|
@@ -64889,18 +64935,18 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64889
64935
|
// overlapping cache events (or an event racing a full reload) can resolve out
|
|
64890
64936
|
// of order and the stale result would be the one that assigns last.
|
|
64891
64937
|
generation = this.beginConfigRefresh(config.PropertyName);
|
|
64892
|
-
|
|
64938
|
+
_context25.n = 2;
|
|
64893
64939
|
return this.materializeCacheEventRows(config, parsed.results);
|
|
64894
64940
|
case 2:
|
|
64895
|
-
rows =
|
|
64941
|
+
rows = _context25.v;
|
|
64896
64942
|
if (this.isLatestConfigRefresh(config.PropertyName, generation)) {
|
|
64897
|
-
|
|
64943
|
+
_context25.n = 3;
|
|
64898
64944
|
break;
|
|
64899
64945
|
}
|
|
64900
|
-
return
|
|
64946
|
+
return _context25.a(2);
|
|
64901
64947
|
case 3:
|
|
64902
64948
|
if (!rows) {
|
|
64903
|
-
|
|
64949
|
+
_context25.n = 5;
|
|
64904
64950
|
break;
|
|
64905
64951
|
}
|
|
64906
64952
|
this.HandleSingleViewResult(config, {
|
|
@@ -64912,25 +64958,43 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64912
64958
|
ErrorMessage: '',
|
|
64913
64959
|
UserViewRunID: ''
|
|
64914
64960
|
});
|
|
64915
|
-
|
|
64961
|
+
// HandleSingleViewResult replaces the property with newly materialized
|
|
64962
|
+
// entity objects, so anything a subclass derived from the previous
|
|
64963
|
+
// objects in AdditionalLoading — grouped child collections, memoized
|
|
64964
|
+
// lookups — now refers to instances this engine has discarded and must
|
|
64965
|
+
// be rebuilt. Every other path that replaces a property does this;
|
|
64966
|
+
// omitting it leaves an engine whose arrays are complete and correct
|
|
64967
|
+
// while its derived state is stale or empty, which is invisible to any
|
|
64968
|
+
// row-count check and is not repaired by EnsureLoaded()/Config() because
|
|
64969
|
+
// the config is still marked loaded.
|
|
64970
|
+
_context25.n = 4;
|
|
64971
|
+
return this.RebuildDerivedState(this._contextUser);
|
|
64916
64972
|
case 4:
|
|
64917
|
-
|
|
64918
|
-
|
|
64973
|
+
// Emit after the rebuild, never before, so subscribers cannot observe
|
|
64974
|
+
// the property before its derived state is attached.
|
|
64975
|
+
this.emitPropertyChange(config.PropertyName);
|
|
64976
|
+
return _context25.a(2);
|
|
64919
64977
|
case 5:
|
|
64920
|
-
|
|
64921
|
-
|
|
64978
|
+
_context25.n = 7;
|
|
64979
|
+
break;
|
|
64980
|
+
case 6:
|
|
64981
|
+
_context25.p = 6;
|
|
64982
|
+
_t20 = _context25.v;
|
|
64922
64983
|
// Designed degradation, but not a silent one: this catch also masks
|
|
64923
64984
|
// materialization failures (e.g. an entity class that cannot construct in
|
|
64924
64985
|
// this process), and without a trace the only symptom is every cache event
|
|
64925
64986
|
// turning into a database reload.
|
|
64926
|
-
LogStatus("BaseEngine.OnExternalCacheChange: payload for '".concat(config.PropertyName, "' could not be applied (").concat(
|
|
64927
|
-
case 6:
|
|
64928
|
-
_context24.n = 7;
|
|
64929
|
-
return this.LoadSingleConfig(config, this._contextUser);
|
|
64987
|
+
LogStatus("BaseEngine.OnExternalCacheChange: payload for '".concat(config.PropertyName, "' could not be applied (").concat(_t20 instanceof Error ? _t20.message : String(_t20), ") \u2014 falling back to full reload"));
|
|
64930
64988
|
case 7:
|
|
64931
|
-
|
|
64989
|
+
_context25.n = 8;
|
|
64990
|
+
return this.LoadSingleConfig(config, this._contextUser);
|
|
64991
|
+
case 8:
|
|
64992
|
+
_context25.n = 9;
|
|
64993
|
+
return this.RebuildDerivedState(this._contextUser);
|
|
64994
|
+
case 9:
|
|
64995
|
+
return _context25.a(2);
|
|
64932
64996
|
}
|
|
64933
|
-
},
|
|
64997
|
+
}, _callee24, this, [[1, 6]]);
|
|
64934
64998
|
}));
|
|
64935
64999
|
function OnExternalCacheChange(_x33, _x34) {
|
|
64936
65000
|
return _OnExternalCacheChange.apply(this, arguments);
|
|
@@ -64954,27 +65018,27 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64954
65018
|
}, {
|
|
64955
65019
|
key: "materializeCacheEventRows",
|
|
64956
65020
|
value: (function () {
|
|
64957
|
-
var _materializeCacheEventRows = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
65021
|
+
var _materializeCacheEventRows = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee25(config, rows) {
|
|
64958
65022
|
var effectiveResultType;
|
|
64959
|
-
return baseEngine_regenerator().w(function (
|
|
64960
|
-
while (1) switch (
|
|
65023
|
+
return baseEngine_regenerator().w(function (_context26) {
|
|
65024
|
+
while (1) switch (_context26.n) {
|
|
64961
65025
|
case 0:
|
|
64962
65026
|
effectiveResultType = config.ResultType || this.EngineDefaultResultType;
|
|
64963
65027
|
if (!(effectiveResultType === 'simple')) {
|
|
64964
|
-
|
|
65028
|
+
_context26.n = 1;
|
|
64965
65029
|
break;
|
|
64966
65030
|
}
|
|
64967
|
-
return
|
|
65031
|
+
return _context26.a(2, rows);
|
|
64968
65032
|
case 1:
|
|
64969
65033
|
if (config.EntityName) {
|
|
64970
|
-
|
|
65034
|
+
_context26.n = 2;
|
|
64971
65035
|
break;
|
|
64972
65036
|
}
|
|
64973
|
-
return
|
|
65037
|
+
return _context26.a(2, null);
|
|
64974
65038
|
case 2:
|
|
64975
|
-
return
|
|
65039
|
+
return _context26.a(2, util_TransformSimpleObjectToEntityObject(this.ProviderToUse, config.EntityName, rows, this._contextUser));
|
|
64976
65040
|
}
|
|
64977
|
-
},
|
|
65041
|
+
}, _callee25, this);
|
|
64978
65042
|
}));
|
|
64979
65043
|
function materializeCacheEventRows(_x35, _x36) {
|
|
64980
65044
|
return _materializeCacheEventRows.apply(this, arguments);
|
|
@@ -64990,12 +65054,12 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
64990
65054
|
}, {
|
|
64991
65055
|
key: "SetExpirationTimer",
|
|
64992
65056
|
value: function SetExpirationTimer(propertyName, expiration) {
|
|
64993
|
-
var
|
|
65057
|
+
var _this12 = this;
|
|
64994
65058
|
if (this._expirationTimers.has(propertyName)) {
|
|
64995
65059
|
clearTimeout(this._expirationTimers.get(propertyName));
|
|
64996
65060
|
}
|
|
64997
65061
|
var timer = setTimeout(function () {
|
|
64998
|
-
return
|
|
65062
|
+
return _this12.RefreshItem(propertyName);
|
|
64999
65063
|
}, expiration);
|
|
65000
65064
|
this._expirationTimers.set(propertyName, timer);
|
|
65001
65065
|
}
|
|
@@ -65007,19 +65071,19 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
65007
65071
|
}, {
|
|
65008
65072
|
key: "AddDynamicConfig",
|
|
65009
65073
|
value: (function () {
|
|
65010
|
-
var _AddDynamicConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
65074
|
+
var _AddDynamicConfig = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee26(config, contextUser) {
|
|
65011
65075
|
var c;
|
|
65012
|
-
return baseEngine_regenerator().w(function (
|
|
65013
|
-
while (1) switch (
|
|
65076
|
+
return baseEngine_regenerator().w(function (_context27) {
|
|
65077
|
+
while (1) switch (_context27.n) {
|
|
65014
65078
|
case 0:
|
|
65015
65079
|
c = this.UpgradeObjectToConfig(config);
|
|
65016
65080
|
this._dynamicConfigs.set(c.PropertyName, c);
|
|
65017
|
-
|
|
65081
|
+
_context27.n = 1;
|
|
65018
65082
|
return this.LoadSingleConfig(c, contextUser || this._contextUser);
|
|
65019
65083
|
case 1:
|
|
65020
|
-
return
|
|
65084
|
+
return _context27.a(2);
|
|
65021
65085
|
}
|
|
65022
|
-
},
|
|
65086
|
+
}, _callee26, this);
|
|
65023
65087
|
}));
|
|
65024
65088
|
function AddDynamicConfig(_x37, _x38) {
|
|
65025
65089
|
return _AddDynamicConfig.apply(this, arguments);
|
|
@@ -65048,24 +65112,24 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
65048
65112
|
}, {
|
|
65049
65113
|
key: "RefreshItem",
|
|
65050
65114
|
value: (function () {
|
|
65051
|
-
var _RefreshItem = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
65115
|
+
var _RefreshItem = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee27(propertyName) {
|
|
65052
65116
|
var config;
|
|
65053
|
-
return baseEngine_regenerator().w(function (
|
|
65054
|
-
while (1) switch (
|
|
65117
|
+
return baseEngine_regenerator().w(function (_context28) {
|
|
65118
|
+
while (1) switch (_context28.n) {
|
|
65055
65119
|
case 0:
|
|
65056
65120
|
config = this._metadataConfigs.find(function (c) {
|
|
65057
65121
|
return c.PropertyName === propertyName;
|
|
65058
65122
|
}) || this._dynamicConfigs.get(propertyName);
|
|
65059
65123
|
if (!config) {
|
|
65060
|
-
|
|
65124
|
+
_context28.n = 1;
|
|
65061
65125
|
break;
|
|
65062
65126
|
}
|
|
65063
|
-
|
|
65127
|
+
_context28.n = 1;
|
|
65064
65128
|
return this.LoadSingleConfig(config, this._contextUser);
|
|
65065
65129
|
case 1:
|
|
65066
|
-
return
|
|
65130
|
+
return _context28.a(2);
|
|
65067
65131
|
}
|
|
65068
|
-
},
|
|
65132
|
+
}, _callee27, this);
|
|
65069
65133
|
}));
|
|
65070
65134
|
function RefreshItem(_x39) {
|
|
65071
65135
|
return _RefreshItem.apply(this, arguments);
|
|
@@ -65079,16 +65143,16 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
65079
65143
|
}, {
|
|
65080
65144
|
key: "RefreshAllItems",
|
|
65081
65145
|
value: (function () {
|
|
65082
|
-
var _RefreshAllItems = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
65083
|
-
return baseEngine_regenerator().w(function (
|
|
65084
|
-
while (1) switch (
|
|
65146
|
+
var _RefreshAllItems = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee28() {
|
|
65147
|
+
return baseEngine_regenerator().w(function (_context29) {
|
|
65148
|
+
while (1) switch (_context29.n) {
|
|
65085
65149
|
case 0:
|
|
65086
|
-
|
|
65150
|
+
_context29.n = 1;
|
|
65087
65151
|
return this.LoadConfigs([].concat(baseEngine_toConsumableArray(this._metadataConfigs), baseEngine_toConsumableArray(Array.from(this._dynamicConfigs.values()))), this._contextUser);
|
|
65088
65152
|
case 1:
|
|
65089
|
-
return
|
|
65153
|
+
return _context29.a(2);
|
|
65090
65154
|
}
|
|
65091
|
-
},
|
|
65155
|
+
}, _callee28, this);
|
|
65092
65156
|
}));
|
|
65093
65157
|
function RefreshAllItems() {
|
|
65094
65158
|
return _RefreshAllItems.apply(this, arguments);
|
|
@@ -65103,13 +65167,13 @@ var BaseEngine = /*#__PURE__*/function (_BaseSingleton) {
|
|
|
65103
65167
|
}, {
|
|
65104
65168
|
key: "AdditionalLoading",
|
|
65105
65169
|
value: (function () {
|
|
65106
|
-
var _AdditionalLoading = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function
|
|
65107
|
-
return baseEngine_regenerator().w(function (
|
|
65108
|
-
while (1) switch (
|
|
65170
|
+
var _AdditionalLoading = baseEngine_asyncToGenerator(/*#__PURE__*/baseEngine_regenerator().m(function _callee29(contextUser) {
|
|
65171
|
+
return baseEngine_regenerator().w(function (_context30) {
|
|
65172
|
+
while (1) switch (_context30.n) {
|
|
65109
65173
|
case 0:
|
|
65110
|
-
return
|
|
65174
|
+
return _context30.a(2);
|
|
65111
65175
|
}
|
|
65112
|
-
},
|
|
65176
|
+
}, _callee29);
|
|
65113
65177
|
}));
|
|
65114
65178
|
function AdditionalLoading(_x40) {
|
|
65115
65179
|
return _AdditionalLoading.apply(this, arguments);
|
|
@@ -68517,8 +68581,8 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
68517
68581
|
/**
|
|
68518
68582
|
* Independent instance that **shares the connection pool and metadata cache**
|
|
68519
68583
|
* but has its own transaction stack. Same pattern MJAPI uses for per-request
|
|
68520
|
-
* providers. Used by `mj sync push`
|
|
68521
|
-
*
|
|
68584
|
+
* providers. Used by an entity directory that `mj sync push` writes with isolated
|
|
68585
|
+
* transactions, so parallel graphs do not interleave `EntityTransactionScope`s on one provider.
|
|
68522
68586
|
*
|
|
68523
68587
|
* Not SQL Server-specific: each concrete provider implements this against
|
|
68524
68588
|
* its own pool. {@link ReleaseIndependentInstance} must NOT close the pool.
|
|
@@ -68604,6 +68668,90 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
68604
68668
|
}
|
|
68605
68669
|
return ResetTransactionState;
|
|
68606
68670
|
}()
|
|
68671
|
+
/**
|
|
68672
|
+
* Run `task` once the ambient transaction on this provider has committed, or now if there is
|
|
68673
|
+
* no ambient transaction.
|
|
68674
|
+
*
|
|
68675
|
+
* Use it for side effects that must only happen for work that is actually durable — queueing
|
|
68676
|
+
* background jobs, firing deferred entity actions — and must not run *inside* the caller's
|
|
68677
|
+
* transaction. Providers that track transactions (see `GenericDatabaseProvider`) queue the task
|
|
68678
|
+
* while a transaction is open, run queued tasks in registration order after the **outermost**
|
|
68679
|
+
* commit succeeds (once the transaction lock is released, so a task may open its own
|
|
68680
|
+
* transaction), and discard them — without running them — when the transaction rolls back,
|
|
68681
|
+
* fails to commit, or is abandoned.
|
|
68682
|
+
*
|
|
68683
|
+
* This default is for providers that do not track transactions: the task starts immediately.
|
|
68684
|
+
*
|
|
68685
|
+
* In every case the caller is never blocked by, and never sees an error from, a task that runs
|
|
68686
|
+
* immediately: it is started fire-and-forget and a rejection is logged with {@link LogError}.
|
|
68687
|
+
*
|
|
68688
|
+
* **Registering late.** Work that is caused inside a transaction but registers after an `await`
|
|
68689
|
+
* may find that transaction already settled. Capture a {@link PostCommitToken} with
|
|
68690
|
+
* {@link CapturePostCommitToken} when the work is caused and pass it here: the task then follows
|
|
68691
|
+
* the transaction the token names (run if it committed, dropped if it — or a savepoint the token
|
|
68692
|
+
* was captured in — rolled back), not whatever is open when it registers. A token captured
|
|
68693
|
+
* with no transaction open runs the task whenever it registers. Without a token at all the
|
|
68694
|
+
* task follows the transaction open at registration time, which is right for a caller that
|
|
68695
|
+
* registers synchronously inside its own transaction and wrong for a deferred one — so pass
|
|
68696
|
+
* a token whenever registration can outlive the save.
|
|
68697
|
+
*
|
|
68698
|
+
* @param task The work to run. Should not throw; a rejection is logged and swallowed.
|
|
68699
|
+
* @param description Short label used in log lines (e.g. `'Entity AI Action'`).
|
|
68700
|
+
* @param _token Where the work was caused, from {@link CapturePostCommitToken}. Ignored by this
|
|
68701
|
+
* default, which has no transactions to follow.
|
|
68702
|
+
*/
|
|
68703
|
+
)
|
|
68704
|
+
}, {
|
|
68705
|
+
key: "RunAfterCommit",
|
|
68706
|
+
value: function RunAfterCommit(task) {
|
|
68707
|
+
var description = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'post-commit task';
|
|
68708
|
+
var _token = arguments.length > 2 ? arguments[2] : undefined;
|
|
68709
|
+
void this.RunPostCommitTaskSafely(task, description);
|
|
68710
|
+
}
|
|
68711
|
+
/**
|
|
68712
|
+
* Snapshot of the transaction frames open right now, for a later {@link RunAfterCommit}.
|
|
68713
|
+
* Synchronous by contract — call it before the first `await` of the code that causes the work.
|
|
68714
|
+
*
|
|
68715
|
+
* @returns `undefined` when no transaction is open. This default never tracks transactions, so
|
|
68716
|
+
* it always returns `undefined`.
|
|
68717
|
+
*/
|
|
68718
|
+
}, {
|
|
68719
|
+
key: "CapturePostCommitToken",
|
|
68720
|
+
value: function CapturePostCommitToken() {
|
|
68721
|
+
return undefined;
|
|
68722
|
+
}
|
|
68723
|
+
/**
|
|
68724
|
+
* Await one post-commit task, logging (never rethrowing) its failure. Shared by the immediate
|
|
68725
|
+
* path of {@link RunAfterCommit} and by subclasses that drain a queue after commit.
|
|
68726
|
+
*/
|
|
68727
|
+
}, {
|
|
68728
|
+
key: "RunPostCommitTaskSafely",
|
|
68729
|
+
value: (function () {
|
|
68730
|
+
var _RunPostCommitTaskSafely = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee5(task, description) {
|
|
68731
|
+
var _t2;
|
|
68732
|
+
return databaseProviderBase_regenerator().w(function (_context6) {
|
|
68733
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
68734
|
+
case 0:
|
|
68735
|
+
_context6.p = 0;
|
|
68736
|
+
_context6.n = 1;
|
|
68737
|
+
return task();
|
|
68738
|
+
case 1:
|
|
68739
|
+
_context6.n = 3;
|
|
68740
|
+
break;
|
|
68741
|
+
case 2:
|
|
68742
|
+
_context6.p = 2;
|
|
68743
|
+
_t2 = _context6.v;
|
|
68744
|
+
LogError("Post-commit task '".concat(description, "' failed: ").concat(_t2 instanceof Error ? _t2.message : String(_t2)), undefined, _t2);
|
|
68745
|
+
case 3:
|
|
68746
|
+
return _context6.a(2);
|
|
68747
|
+
}
|
|
68748
|
+
}, _callee5, null, [[0, 2]]);
|
|
68749
|
+
}));
|
|
68750
|
+
function RunPostCommitTaskSafely(_x4, _x5) {
|
|
68751
|
+
return _RunPostCommitTaskSafely.apply(this, arguments);
|
|
68752
|
+
}
|
|
68753
|
+
return RunPostCommitTaskSafely;
|
|
68754
|
+
}()
|
|
68607
68755
|
/**
|
|
68608
68756
|
* Database providers execute multi-record units of work atomically, in-process.
|
|
68609
68757
|
*
|
|
@@ -68639,11 +68787,11 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
68639
68787
|
}, {
|
|
68640
68788
|
key: "BeginEntityTransaction",
|
|
68641
68789
|
value: (function () {
|
|
68642
|
-
var _BeginEntityTransaction = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
68790
|
+
var _BeginEntityTransaction = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee7() {
|
|
68643
68791
|
var _this2 = this;
|
|
68644
68792
|
var isNested, depthAtBegin, settled, settle;
|
|
68645
|
-
return databaseProviderBase_regenerator().w(function (
|
|
68646
|
-
while (1) switch (
|
|
68793
|
+
return databaseProviderBase_regenerator().w(function (_context8) {
|
|
68794
|
+
while (1) switch (_context8.n) {
|
|
68647
68795
|
case 0:
|
|
68648
68796
|
// Capture nesting BEFORE beginning: once BeginTransaction() returns we are, by definition,
|
|
68649
68797
|
// in a transaction, so asking afterwards would always answer "nested". IsInTransaction is
|
|
@@ -68651,22 +68799,22 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
68651
68799
|
// fanning out), which made every scope on the flagship provider report IsNested === false
|
|
68652
68800
|
// even when joining. The depth accessor sees the truth on providers that track it.
|
|
68653
68801
|
isNested = this.IsInTransaction || this.CurrentTransactionDepth > 0;
|
|
68654
|
-
|
|
68802
|
+
_context8.n = 1;
|
|
68655
68803
|
return this.BeginTransaction();
|
|
68656
68804
|
case 1:
|
|
68657
68805
|
depthAtBegin = this.CurrentTransactionDepth;
|
|
68658
68806
|
settled = false;
|
|
68659
68807
|
settle = /*#__PURE__*/function () {
|
|
68660
|
-
var _ref = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
68808
|
+
var _ref = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee6(commit) {
|
|
68661
68809
|
var depthNow;
|
|
68662
|
-
return databaseProviderBase_regenerator().w(function (
|
|
68663
|
-
while (1) switch (
|
|
68810
|
+
return databaseProviderBase_regenerator().w(function (_context7) {
|
|
68811
|
+
while (1) switch (_context7.n) {
|
|
68664
68812
|
case 0:
|
|
68665
68813
|
if (!settled) {
|
|
68666
|
-
|
|
68814
|
+
_context7.n = 1;
|
|
68667
68815
|
break;
|
|
68668
68816
|
}
|
|
68669
|
-
return
|
|
68817
|
+
return _context7.a(2);
|
|
68670
68818
|
case 1:
|
|
68671
68819
|
settled = true;
|
|
68672
68820
|
// Out-of-order settle detection. Depth pairing is strictly LIFO: a scope must settle
|
|
@@ -68681,27 +68829,27 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
68681
68829
|
LogError("EntityTransactionScope settled out of order on ".concat(_this2.constructor.name, ": the scope began at ") + "transaction depth ".concat(depthAtBegin, " but the provider is now at depth ").concat(depthNow, ". Two ") + "transactional units of work are interleaving on one provider instance, so their writes share " + "one physical transaction and a rollback by either can silently undo the other's committed " + "work. Do not run concurrent transactional saves on a shared provider instance \u2014 use " + "per-request providers (as MJServer does) or serialize the units of work.");
|
|
68682
68830
|
}
|
|
68683
68831
|
if (!commit) {
|
|
68684
|
-
|
|
68832
|
+
_context7.n = 3;
|
|
68685
68833
|
break;
|
|
68686
68834
|
}
|
|
68687
|
-
|
|
68835
|
+
_context7.n = 2;
|
|
68688
68836
|
return _this2.CommitTransaction();
|
|
68689
68837
|
case 2:
|
|
68690
|
-
|
|
68838
|
+
_context7.n = 4;
|
|
68691
68839
|
break;
|
|
68692
68840
|
case 3:
|
|
68693
|
-
|
|
68841
|
+
_context7.n = 4;
|
|
68694
68842
|
return _this2.RollbackTransaction();
|
|
68695
68843
|
case 4:
|
|
68696
|
-
return
|
|
68844
|
+
return _context7.a(2);
|
|
68697
68845
|
}
|
|
68698
|
-
},
|
|
68846
|
+
}, _callee6);
|
|
68699
68847
|
}));
|
|
68700
|
-
return function settle(
|
|
68848
|
+
return function settle(_x6) {
|
|
68701
68849
|
return _ref.apply(this, arguments);
|
|
68702
68850
|
};
|
|
68703
68851
|
}();
|
|
68704
|
-
return
|
|
68852
|
+
return _context8.a(2, {
|
|
68705
68853
|
IsNested: isNested,
|
|
68706
68854
|
Commit: function Commit() {
|
|
68707
68855
|
return settle(true);
|
|
@@ -68711,7 +68859,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
68711
68859
|
}
|
|
68712
68860
|
});
|
|
68713
68861
|
}
|
|
68714
|
-
},
|
|
68862
|
+
}, _callee7, this);
|
|
68715
68863
|
}));
|
|
68716
68864
|
function BeginEntityTransaction() {
|
|
68717
68865
|
return _BeginEntityTransaction.apply(this, arguments);
|
|
@@ -68980,42 +69128,42 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
68980
69128
|
}, {
|
|
68981
69129
|
key: "FindISAChildEntity",
|
|
68982
69130
|
value: (function () {
|
|
68983
|
-
var _FindISAChildEntity = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69131
|
+
var _FindISAChildEntity = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee8(entityInfo, recordPKValue, contextUser) {
|
|
68984
69132
|
var childEntities, unionSQL, results;
|
|
68985
|
-
return databaseProviderBase_regenerator().w(function (
|
|
68986
|
-
while (1) switch (
|
|
69133
|
+
return databaseProviderBase_regenerator().w(function (_context9) {
|
|
69134
|
+
while (1) switch (_context9.n) {
|
|
68987
69135
|
case 0:
|
|
68988
69136
|
childEntities = entityInfo.ChildEntities;
|
|
68989
69137
|
if (!(childEntities.length === 0)) {
|
|
68990
|
-
|
|
69138
|
+
_context9.n = 1;
|
|
68991
69139
|
break;
|
|
68992
69140
|
}
|
|
68993
|
-
return
|
|
69141
|
+
return _context9.a(2, null);
|
|
68994
69142
|
case 1:
|
|
68995
69143
|
unionSQL = this.BuildChildDiscoverySQL(childEntities, recordPKValue);
|
|
68996
69144
|
if (unionSQL) {
|
|
68997
|
-
|
|
69145
|
+
_context9.n = 2;
|
|
68998
69146
|
break;
|
|
68999
69147
|
}
|
|
69000
|
-
return
|
|
69148
|
+
return _context9.a(2, null);
|
|
69001
69149
|
case 2:
|
|
69002
|
-
|
|
69150
|
+
_context9.n = 3;
|
|
69003
69151
|
return this.ExecuteSQL(unionSQL, undefined, undefined, contextUser);
|
|
69004
69152
|
case 3:
|
|
69005
|
-
results =
|
|
69153
|
+
results = _context9.v;
|
|
69006
69154
|
if (!(results && results.length > 0 && results[0].EntityName)) {
|
|
69007
|
-
|
|
69155
|
+
_context9.n = 4;
|
|
69008
69156
|
break;
|
|
69009
69157
|
}
|
|
69010
|
-
return
|
|
69158
|
+
return _context9.a(2, {
|
|
69011
69159
|
ChildEntityName: results[0].EntityName
|
|
69012
69160
|
});
|
|
69013
69161
|
case 4:
|
|
69014
|
-
return
|
|
69162
|
+
return _context9.a(2, null);
|
|
69015
69163
|
}
|
|
69016
|
-
},
|
|
69164
|
+
}, _callee8, this);
|
|
69017
69165
|
}));
|
|
69018
|
-
function FindISAChildEntity(
|
|
69166
|
+
function FindISAChildEntity(_x7, _x8, _x9) {
|
|
69019
69167
|
return _FindISAChildEntity.apply(this, arguments);
|
|
69020
69168
|
}
|
|
69021
69169
|
return FindISAChildEntity;
|
|
@@ -69034,34 +69182,34 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69034
69182
|
}, {
|
|
69035
69183
|
key: "FindISAChildEntities",
|
|
69036
69184
|
value: (function () {
|
|
69037
|
-
var _FindISAChildEntities = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69185
|
+
var _FindISAChildEntities = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee9(entityInfo, recordPKValue, contextUser) {
|
|
69038
69186
|
var childEntities, unionSQL, results;
|
|
69039
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69040
|
-
while (1) switch (
|
|
69187
|
+
return databaseProviderBase_regenerator().w(function (_context0) {
|
|
69188
|
+
while (1) switch (_context0.n) {
|
|
69041
69189
|
case 0:
|
|
69042
69190
|
childEntities = entityInfo.ChildEntities;
|
|
69043
69191
|
if (!(childEntities.length === 0)) {
|
|
69044
|
-
|
|
69192
|
+
_context0.n = 1;
|
|
69045
69193
|
break;
|
|
69046
69194
|
}
|
|
69047
|
-
return
|
|
69195
|
+
return _context0.a(2, []);
|
|
69048
69196
|
case 1:
|
|
69049
69197
|
unionSQL = this.BuildChildDiscoverySQL(childEntities, recordPKValue);
|
|
69050
69198
|
if (unionSQL) {
|
|
69051
|
-
|
|
69199
|
+
_context0.n = 2;
|
|
69052
69200
|
break;
|
|
69053
69201
|
}
|
|
69054
|
-
return
|
|
69202
|
+
return _context0.a(2, []);
|
|
69055
69203
|
case 2:
|
|
69056
|
-
|
|
69204
|
+
_context0.n = 3;
|
|
69057
69205
|
return this.ExecuteSQL(unionSQL, undefined, undefined, contextUser);
|
|
69058
69206
|
case 3:
|
|
69059
|
-
results =
|
|
69207
|
+
results = _context0.v;
|
|
69060
69208
|
if (!(results && results.length > 0)) {
|
|
69061
|
-
|
|
69209
|
+
_context0.n = 4;
|
|
69062
69210
|
break;
|
|
69063
69211
|
}
|
|
69064
|
-
return
|
|
69212
|
+
return _context0.a(2, results.filter(function (r) {
|
|
69065
69213
|
return r.EntityName;
|
|
69066
69214
|
}).map(function (r) {
|
|
69067
69215
|
return {
|
|
@@ -69069,11 +69217,11 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69069
69217
|
};
|
|
69070
69218
|
}));
|
|
69071
69219
|
case 4:
|
|
69072
|
-
return
|
|
69220
|
+
return _context0.a(2, []);
|
|
69073
69221
|
}
|
|
69074
|
-
},
|
|
69222
|
+
}, _callee9, this);
|
|
69075
69223
|
}));
|
|
69076
|
-
function FindISAChildEntities(
|
|
69224
|
+
function FindISAChildEntities(_x0, _x1, _x10) {
|
|
69077
69225
|
return _FindISAChildEntities.apply(this, arguments);
|
|
69078
69226
|
}
|
|
69079
69227
|
return FindISAChildEntities;
|
|
@@ -69141,28 +69289,28 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69141
69289
|
}, {
|
|
69142
69290
|
key: "GetRecordChanges",
|
|
69143
69291
|
value: (function () {
|
|
69144
|
-
var _GetRecordChanges = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69145
|
-
var safeEntityName, safeRecordID, schema, sSQL,
|
|
69146
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69147
|
-
while (1) switch (
|
|
69292
|
+
var _GetRecordChanges = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee0(entityName, compositeKey, contextUser) {
|
|
69293
|
+
var safeEntityName, safeRecordID, schema, sSQL, _t3;
|
|
69294
|
+
return databaseProviderBase_regenerator().w(function (_context1) {
|
|
69295
|
+
while (1) switch (_context1.p = _context1.n) {
|
|
69148
69296
|
case 0:
|
|
69149
|
-
|
|
69297
|
+
_context1.p = 0;
|
|
69150
69298
|
safeEntityName = entityName.replace(/'/g, "''");
|
|
69151
69299
|
safeRecordID = compositeKey.ToConcatenatedString().replace(/'/g, "''");
|
|
69152
69300
|
schema = this.MJCoreSchemaName;
|
|
69153
69301
|
sSQL = "SELECT * FROM ".concat(this.QuoteSchemaAndView(schema, 'vwRecordChanges'), " WHERE ").concat(this.QuoteIdentifier('Entity'), "='").concat(safeEntityName, "' AND ").concat(this.QuoteIdentifier('RecordID'), "='").concat(safeRecordID, "' ORDER BY ").concat(this.QuoteIdentifier('ChangedAt'), " DESC");
|
|
69154
|
-
return
|
|
69302
|
+
return _context1.a(2, this.ExecuteSQL(sSQL, undefined, undefined, contextUser));
|
|
69155
69303
|
case 1:
|
|
69156
|
-
|
|
69157
|
-
|
|
69158
|
-
LogError(
|
|
69159
|
-
throw
|
|
69304
|
+
_context1.p = 1;
|
|
69305
|
+
_t3 = _context1.v;
|
|
69306
|
+
LogError(_t3);
|
|
69307
|
+
throw _t3;
|
|
69160
69308
|
case 2:
|
|
69161
|
-
return
|
|
69309
|
+
return _context1.a(2);
|
|
69162
69310
|
}
|
|
69163
|
-
},
|
|
69311
|
+
}, _callee0, this, [[0, 1]]);
|
|
69164
69312
|
}));
|
|
69165
|
-
function GetRecordChanges(
|
|
69313
|
+
function GetRecordChanges(_x11, _x12, _x13) {
|
|
69166
69314
|
return _GetRecordChanges.apply(this, arguments);
|
|
69167
69315
|
}
|
|
69168
69316
|
return GetRecordChanges;
|
|
@@ -69180,20 +69328,20 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69180
69328
|
}, {
|
|
69181
69329
|
key: "GetRecordFavoriteStatus",
|
|
69182
69330
|
value: (function () {
|
|
69183
|
-
var _GetRecordFavoriteStatus = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69331
|
+
var _GetRecordFavoriteStatus = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee1(userId, entityName, compositeKey, contextUser) {
|
|
69184
69332
|
var id;
|
|
69185
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69186
|
-
while (1) switch (
|
|
69333
|
+
return databaseProviderBase_regenerator().w(function (_context10) {
|
|
69334
|
+
while (1) switch (_context10.n) {
|
|
69187
69335
|
case 0:
|
|
69188
|
-
|
|
69336
|
+
_context10.n = 1;
|
|
69189
69337
|
return this.GetRecordFavoriteID(userId, entityName, compositeKey, contextUser);
|
|
69190
69338
|
case 1:
|
|
69191
|
-
id =
|
|
69192
|
-
return
|
|
69339
|
+
id = _context10.v;
|
|
69340
|
+
return _context10.a(2, id !== null);
|
|
69193
69341
|
}
|
|
69194
|
-
},
|
|
69342
|
+
}, _callee1, this);
|
|
69195
69343
|
}));
|
|
69196
|
-
function GetRecordFavoriteStatus(
|
|
69344
|
+
function GetRecordFavoriteStatus(_x14, _x15, _x16, _x17) {
|
|
69197
69345
|
return _GetRecordFavoriteStatus.apply(this, arguments);
|
|
69198
69346
|
}
|
|
69199
69347
|
return GetRecordFavoriteStatus;
|
|
@@ -69205,39 +69353,39 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69205
69353
|
}, {
|
|
69206
69354
|
key: "GetRecordFavoriteID",
|
|
69207
69355
|
value: (function () {
|
|
69208
|
-
var _GetRecordFavoriteID = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69209
|
-
var schema, safeUserId, safeEntityName, safeRecordID, sSQL, result,
|
|
69210
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69211
|
-
while (1) switch (
|
|
69356
|
+
var _GetRecordFavoriteID = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee10(userId, entityName, compositeKey, contextUser) {
|
|
69357
|
+
var schema, safeUserId, safeEntityName, safeRecordID, sSQL, result, _t4;
|
|
69358
|
+
return databaseProviderBase_regenerator().w(function (_context11) {
|
|
69359
|
+
while (1) switch (_context11.p = _context11.n) {
|
|
69212
69360
|
case 0:
|
|
69213
|
-
|
|
69361
|
+
_context11.p = 0;
|
|
69214
69362
|
schema = this.MJCoreSchemaName;
|
|
69215
69363
|
safeUserId = userId.replace(/'/g, "''");
|
|
69216
69364
|
safeEntityName = entityName.replace(/'/g, "''");
|
|
69217
69365
|
safeRecordID = compositeKey.Values().replace(/'/g, "''");
|
|
69218
69366
|
sSQL = "SELECT ".concat(this.QuoteIdentifier('ID'), " FROM ").concat(this.QuoteSchemaAndView(schema, 'vwUserFavorites'), " WHERE ").concat(this.QuoteIdentifier('UserID'), "='").concat(safeUserId, "' AND ").concat(this.QuoteIdentifier('Entity'), "='").concat(safeEntityName, "' AND ").concat(this.QuoteIdentifier('RecordID'), "='").concat(safeRecordID, "'");
|
|
69219
|
-
|
|
69367
|
+
_context11.n = 1;
|
|
69220
69368
|
return this.ExecuteSQL(sSQL, undefined, undefined, contextUser);
|
|
69221
69369
|
case 1:
|
|
69222
|
-
result =
|
|
69370
|
+
result = _context11.v;
|
|
69223
69371
|
if (!(result && result.length > 0)) {
|
|
69224
|
-
|
|
69372
|
+
_context11.n = 2;
|
|
69225
69373
|
break;
|
|
69226
69374
|
}
|
|
69227
|
-
return
|
|
69375
|
+
return _context11.a(2, result[0].ID);
|
|
69228
69376
|
case 2:
|
|
69229
|
-
return
|
|
69377
|
+
return _context11.a(2, null);
|
|
69230
69378
|
case 3:
|
|
69231
|
-
|
|
69232
|
-
|
|
69233
|
-
LogError(
|
|
69234
|
-
throw
|
|
69379
|
+
_context11.p = 3;
|
|
69380
|
+
_t4 = _context11.v;
|
|
69381
|
+
LogError(_t4);
|
|
69382
|
+
throw _t4;
|
|
69235
69383
|
case 4:
|
|
69236
|
-
return
|
|
69384
|
+
return _context11.a(2);
|
|
69237
69385
|
}
|
|
69238
|
-
},
|
|
69386
|
+
}, _callee10, this, [[0, 3]]);
|
|
69239
69387
|
}));
|
|
69240
|
-
function GetRecordFavoriteID(
|
|
69388
|
+
function GetRecordFavoriteID(_x18, _x19, _x20, _x21) {
|
|
69241
69389
|
return _GetRecordFavoriteID.apply(this, arguments);
|
|
69242
69390
|
}
|
|
69243
69391
|
return GetRecordFavoriteID;
|
|
@@ -69250,46 +69398,46 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69250
69398
|
}, {
|
|
69251
69399
|
key: "SetRecordFavoriteStatus",
|
|
69252
69400
|
value: (function () {
|
|
69253
|
-
var _SetRecordFavoriteStatus = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69254
|
-
var currentFavoriteId, e, ufEntity,
|
|
69255
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69256
|
-
while (1) switch (
|
|
69401
|
+
var _SetRecordFavoriteStatus = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee11(userId, entityName, compositeKey, isFavorite, contextUser) {
|
|
69402
|
+
var currentFavoriteId, e, ufEntity, _t5;
|
|
69403
|
+
return databaseProviderBase_regenerator().w(function (_context12) {
|
|
69404
|
+
while (1) switch (_context12.p = _context12.n) {
|
|
69257
69405
|
case 0:
|
|
69258
|
-
|
|
69259
|
-
|
|
69406
|
+
_context12.p = 0;
|
|
69407
|
+
_context12.n = 1;
|
|
69260
69408
|
return this.GetRecordFavoriteID(userId, entityName, compositeKey);
|
|
69261
69409
|
case 1:
|
|
69262
|
-
currentFavoriteId =
|
|
69410
|
+
currentFavoriteId = _context12.v;
|
|
69263
69411
|
if (!(currentFavoriteId === null && !isFavorite || currentFavoriteId !== null && isFavorite)) {
|
|
69264
|
-
|
|
69412
|
+
_context12.n = 2;
|
|
69265
69413
|
break;
|
|
69266
69414
|
}
|
|
69267
|
-
return
|
|
69415
|
+
return _context12.a(2);
|
|
69268
69416
|
case 2:
|
|
69269
69417
|
e = this.EntityByName(entityName);
|
|
69270
|
-
|
|
69418
|
+
_context12.n = 3;
|
|
69271
69419
|
return this.GetEntityObject('MJ: User Favorites', contextUser || this.CurrentUser);
|
|
69272
69420
|
case 3:
|
|
69273
|
-
ufEntity =
|
|
69421
|
+
ufEntity = _context12.v;
|
|
69274
69422
|
if (!(currentFavoriteId !== null)) {
|
|
69275
|
-
|
|
69423
|
+
_context12.n = 8;
|
|
69276
69424
|
break;
|
|
69277
69425
|
}
|
|
69278
|
-
|
|
69426
|
+
_context12.n = 4;
|
|
69279
69427
|
return ufEntity.InnerLoad(CompositeKey.FromID(currentFavoriteId));
|
|
69280
69428
|
case 4:
|
|
69281
|
-
|
|
69429
|
+
_context12.n = 5;
|
|
69282
69430
|
return ufEntity.Delete();
|
|
69283
69431
|
case 5:
|
|
69284
|
-
if (!
|
|
69285
|
-
|
|
69432
|
+
if (!_context12.v) {
|
|
69433
|
+
_context12.n = 6;
|
|
69286
69434
|
break;
|
|
69287
69435
|
}
|
|
69288
|
-
return
|
|
69436
|
+
return _context12.a(2);
|
|
69289
69437
|
case 6:
|
|
69290
69438
|
throw new Error("Error deleting user favorite");
|
|
69291
69439
|
case 7:
|
|
69292
|
-
|
|
69440
|
+
_context12.n = 11;
|
|
69293
69441
|
break;
|
|
69294
69442
|
case 8:
|
|
69295
69443
|
// create the record since we are setting isFavorite to TRUE
|
|
@@ -69297,30 +69445,30 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69297
69445
|
ufEntity.Set('EntityID', e.ID);
|
|
69298
69446
|
ufEntity.Set('RecordID', compositeKey.Values());
|
|
69299
69447
|
ufEntity.Set('UserID', userId);
|
|
69300
|
-
|
|
69448
|
+
_context12.n = 9;
|
|
69301
69449
|
return ufEntity.Save();
|
|
69302
69450
|
case 9:
|
|
69303
|
-
if (!
|
|
69304
|
-
|
|
69451
|
+
if (!_context12.v) {
|
|
69452
|
+
_context12.n = 10;
|
|
69305
69453
|
break;
|
|
69306
69454
|
}
|
|
69307
|
-
return
|
|
69455
|
+
return _context12.a(2);
|
|
69308
69456
|
case 10:
|
|
69309
69457
|
throw new Error("Error saving user favorite");
|
|
69310
69458
|
case 11:
|
|
69311
|
-
|
|
69459
|
+
_context12.n = 13;
|
|
69312
69460
|
break;
|
|
69313
69461
|
case 12:
|
|
69314
|
-
|
|
69315
|
-
|
|
69316
|
-
LogError(
|
|
69317
|
-
throw
|
|
69462
|
+
_context12.p = 12;
|
|
69463
|
+
_t5 = _context12.v;
|
|
69464
|
+
LogError(_t5);
|
|
69465
|
+
throw _t5;
|
|
69318
69466
|
case 13:
|
|
69319
|
-
return
|
|
69467
|
+
return _context12.a(2);
|
|
69320
69468
|
}
|
|
69321
|
-
},
|
|
69469
|
+
}, _callee11, this, [[0, 12]]);
|
|
69322
69470
|
}));
|
|
69323
|
-
function SetRecordFavoriteStatus(
|
|
69471
|
+
function SetRecordFavoriteStatus(_x22, _x23, _x24, _x25, _x26) {
|
|
69324
69472
|
return _SetRecordFavoriteStatus.apply(this, arguments);
|
|
69325
69473
|
}
|
|
69326
69474
|
return SetRecordFavoriteStatus;
|
|
@@ -69344,25 +69492,25 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69344
69492
|
}, {
|
|
69345
69493
|
key: "GetRecordDependencies",
|
|
69346
69494
|
value: (function () {
|
|
69347
|
-
var _GetRecordDependencies = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69348
|
-
var recordDependencies, entityDependencies, hardSQL, softSQL, sSQL, result,
|
|
69349
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69350
|
-
while (1) switch (
|
|
69495
|
+
var _GetRecordDependencies = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee12(entityName, compositeKey, contextUser) {
|
|
69496
|
+
var recordDependencies, entityDependencies, hardSQL, softSQL, sSQL, result, _t6;
|
|
69497
|
+
return databaseProviderBase_regenerator().w(function (_context13) {
|
|
69498
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
69351
69499
|
case 0:
|
|
69352
|
-
|
|
69500
|
+
_context13.p = 0;
|
|
69353
69501
|
recordDependencies = []; // Validate up front. Reporting "no dependencies" for an entity we cannot resolve would be
|
|
69354
69502
|
// indistinguishable, to a caller about to delete a record, from "this record is safe to
|
|
69355
69503
|
// delete" - the same failure mode as skipping the soft-link query altogether.
|
|
69356
69504
|
if (this.EntityByName(entityName)) {
|
|
69357
|
-
|
|
69505
|
+
_context13.n = 1;
|
|
69358
69506
|
break;
|
|
69359
69507
|
}
|
|
69360
69508
|
throw new Error("Entity ".concat(entityName, " not found in metadata"));
|
|
69361
69509
|
case 1:
|
|
69362
|
-
|
|
69510
|
+
_context13.n = 2;
|
|
69363
69511
|
return this.GetEntityDependencies(entityName);
|
|
69364
69512
|
case 2:
|
|
69365
|
-
entityDependencies =
|
|
69513
|
+
entityDependencies = _context13.v;
|
|
69366
69514
|
// Deliberately NO early return when there are no hard (foreign key) dependents. An entity
|
|
69367
69515
|
// whose only dependents are polymorphic EntityID/RecordID links is precisely the case the
|
|
69368
69516
|
// soft-link query exists to serve, and returning here skipped building it entirely.
|
|
@@ -69372,33 +69520,33 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69372
69520
|
return s.length > 0;
|
|
69373
69521
|
}).join(' UNION ALL ');
|
|
69374
69522
|
if (sSQL) {
|
|
69375
|
-
|
|
69523
|
+
_context13.n = 3;
|
|
69376
69524
|
break;
|
|
69377
69525
|
}
|
|
69378
|
-
return
|
|
69526
|
+
return _context13.a(2, recordDependencies);
|
|
69379
69527
|
case 3:
|
|
69380
|
-
|
|
69528
|
+
_context13.n = 4;
|
|
69381
69529
|
return this.ExecuteSQL(sSQL, undefined, undefined, contextUser);
|
|
69382
69530
|
case 4:
|
|
69383
|
-
result =
|
|
69531
|
+
result = _context13.v;
|
|
69384
69532
|
if (!(!result || result.length === 0)) {
|
|
69385
|
-
|
|
69533
|
+
_context13.n = 5;
|
|
69386
69534
|
break;
|
|
69387
69535
|
}
|
|
69388
|
-
return
|
|
69536
|
+
return _context13.a(2, recordDependencies);
|
|
69389
69537
|
case 5:
|
|
69390
|
-
return
|
|
69538
|
+
return _context13.a(2, this.parseRecordDependencyResults(result));
|
|
69391
69539
|
case 6:
|
|
69392
|
-
|
|
69393
|
-
|
|
69394
|
-
LogError(
|
|
69395
|
-
throw
|
|
69540
|
+
_context13.p = 6;
|
|
69541
|
+
_t6 = _context13.v;
|
|
69542
|
+
LogError(_t6);
|
|
69543
|
+
throw _t6;
|
|
69396
69544
|
case 7:
|
|
69397
|
-
return
|
|
69545
|
+
return _context13.a(2);
|
|
69398
69546
|
}
|
|
69399
|
-
},
|
|
69547
|
+
}, _callee12, this, [[0, 6]]);
|
|
69400
69548
|
}));
|
|
69401
|
-
function GetRecordDependencies(
|
|
69549
|
+
function GetRecordDependencies(_x27, _x28, _x29) {
|
|
69402
69550
|
return _GetRecordDependencies.apply(this, arguments);
|
|
69403
69551
|
}
|
|
69404
69552
|
return GetRecordDependencies;
|
|
@@ -69492,15 +69640,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69492
69640
|
}, {
|
|
69493
69641
|
key: "OnValidateBeforeSave",
|
|
69494
69642
|
value: (function () {
|
|
69495
|
-
var _OnValidateBeforeSave = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69496
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69497
|
-
while (1) switch (
|
|
69643
|
+
var _OnValidateBeforeSave = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee13(_entity, _user, _context) {
|
|
69644
|
+
return databaseProviderBase_regenerator().w(function (_context14) {
|
|
69645
|
+
while (1) switch (_context14.n) {
|
|
69498
69646
|
case 0:
|
|
69499
|
-
return
|
|
69647
|
+
return _context14.a(2, null);
|
|
69500
69648
|
}
|
|
69501
|
-
},
|
|
69649
|
+
}, _callee13);
|
|
69502
69650
|
}));
|
|
69503
|
-
function OnValidateBeforeSave(
|
|
69651
|
+
function OnValidateBeforeSave(_x30, _x31, _x32) {
|
|
69504
69652
|
return _OnValidateBeforeSave.apply(this, arguments);
|
|
69505
69653
|
}
|
|
69506
69654
|
return OnValidateBeforeSave;
|
|
@@ -69513,15 +69661,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69513
69661
|
}, {
|
|
69514
69662
|
key: "OnBeforeSaveExecute",
|
|
69515
69663
|
value: (function () {
|
|
69516
|
-
var _OnBeforeSaveExecute = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69517
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69518
|
-
while (1) switch (
|
|
69664
|
+
var _OnBeforeSaveExecute = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee14(_entity, _user, _options, _context) {
|
|
69665
|
+
return databaseProviderBase_regenerator().w(function (_context15) {
|
|
69666
|
+
while (1) switch (_context15.n) {
|
|
69519
69667
|
case 0:
|
|
69520
|
-
return
|
|
69668
|
+
return _context15.a(2);
|
|
69521
69669
|
}
|
|
69522
|
-
},
|
|
69670
|
+
}, _callee14);
|
|
69523
69671
|
}));
|
|
69524
|
-
function OnBeforeSaveExecute(
|
|
69672
|
+
function OnBeforeSaveExecute(_x33, _x34, _x35, _x36) {
|
|
69525
69673
|
return _OnBeforeSaveExecute.apply(this, arguments);
|
|
69526
69674
|
}
|
|
69527
69675
|
return OnBeforeSaveExecute;
|
|
@@ -69544,15 +69692,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69544
69692
|
}, {
|
|
69545
69693
|
key: "OnBeforeDeleteExecute",
|
|
69546
69694
|
value: (function () {
|
|
69547
|
-
var _OnBeforeDeleteExecute = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69548
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69549
|
-
while (1) switch (
|
|
69695
|
+
var _OnBeforeDeleteExecute = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee15(_entity, _user, _options) {
|
|
69696
|
+
return databaseProviderBase_regenerator().w(function (_context16) {
|
|
69697
|
+
while (1) switch (_context16.n) {
|
|
69550
69698
|
case 0:
|
|
69551
|
-
return
|
|
69699
|
+
return _context16.a(2);
|
|
69552
69700
|
}
|
|
69553
|
-
},
|
|
69701
|
+
}, _callee15);
|
|
69554
69702
|
}));
|
|
69555
|
-
function OnBeforeDeleteExecute(
|
|
69703
|
+
function OnBeforeDeleteExecute(_x37, _x38, _x39) {
|
|
69556
69704
|
return _OnBeforeDeleteExecute.apply(this, arguments);
|
|
69557
69705
|
}
|
|
69558
69706
|
return OnBeforeDeleteExecute;
|
|
@@ -69575,15 +69723,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69575
69723
|
}, {
|
|
69576
69724
|
key: "PostProcessRows",
|
|
69577
69725
|
value: (function () {
|
|
69578
|
-
var _PostProcessRows = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69579
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69580
|
-
while (1) switch (
|
|
69726
|
+
var _PostProcessRows = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee16(rows, _entityInfo, _user) {
|
|
69727
|
+
return databaseProviderBase_regenerator().w(function (_context17) {
|
|
69728
|
+
while (1) switch (_context17.n) {
|
|
69581
69729
|
case 0:
|
|
69582
|
-
return
|
|
69730
|
+
return _context17.a(2, rows);
|
|
69583
69731
|
}
|
|
69584
|
-
},
|
|
69732
|
+
}, _callee16);
|
|
69585
69733
|
}));
|
|
69586
|
-
function PostProcessRows(
|
|
69734
|
+
function PostProcessRows(_x40, _x41, _x42) {
|
|
69587
69735
|
return _PostProcessRows.apply(this, arguments);
|
|
69588
69736
|
}
|
|
69589
69737
|
return PostProcessRows;
|
|
@@ -69626,11 +69774,11 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69626
69774
|
}, {
|
|
69627
69775
|
key: "OnSaveCompleted",
|
|
69628
69776
|
value: (function () {
|
|
69629
|
-
var _OnSaveCompleted = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69777
|
+
var _OnSaveCompleted = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee17(entity, saveSQLResult, user, options, _context) {
|
|
69630
69778
|
var _saveSQLResult$extraD;
|
|
69631
69779
|
var overlappingChangeData, _user$ID;
|
|
69632
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69633
|
-
while (1) switch (
|
|
69780
|
+
return databaseProviderBase_regenerator().w(function (_context18) {
|
|
69781
|
+
while (1) switch (_context18.n) {
|
|
69634
69782
|
case 0:
|
|
69635
69783
|
// ISA overlapping-subtype record-change propagation is DB-agnostic: if the save SQL
|
|
69636
69784
|
// generation populated `overlappingChangeData` in extraData and the entity tracks
|
|
@@ -69642,17 +69790,17 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69642
69790
|
// transaction, which BeginEntityTransaction() opened (or joined) for this unit of work.
|
|
69643
69791
|
overlappingChangeData = (_saveSQLResult$extraD = saveSQLResult.extraData) === null || _saveSQLResult$extraD === void 0 ? void 0 : _saveSQLResult$extraD.overlappingChangeData;
|
|
69644
69792
|
if (!(overlappingChangeData && entity.EntityInfo.AllowMultipleSubtypes && entity.EntityInfo.TrackRecordChanges)) {
|
|
69645
|
-
|
|
69793
|
+
_context18.n = 1;
|
|
69646
69794
|
break;
|
|
69647
69795
|
}
|
|
69648
|
-
|
|
69796
|
+
_context18.n = 1;
|
|
69649
69797
|
return this.PropagateRecordChangesToSiblings(entity.EntityInfo, overlappingChangeData, entity.PrimaryKey.Values(), (_user$ID = user === null || user === void 0 ? void 0 : user.ID) !== null && _user$ID !== void 0 ? _user$ID : '', options.ISAActiveChildEntityName);
|
|
69650
69798
|
case 1:
|
|
69651
|
-
return
|
|
69799
|
+
return _context18.a(2, null);
|
|
69652
69800
|
}
|
|
69653
|
-
},
|
|
69801
|
+
}, _callee17, this);
|
|
69654
69802
|
}));
|
|
69655
|
-
function OnSaveCompleted(
|
|
69803
|
+
function OnSaveCompleted(_x43, _x44, _x45, _x46, _x47) {
|
|
69656
69804
|
return _OnSaveCompleted.apply(this, arguments);
|
|
69657
69805
|
}
|
|
69658
69806
|
return OnSaveCompleted;
|
|
@@ -69865,29 +70013,29 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69865
70013
|
}, {
|
|
69866
70014
|
key: "ExecuteAggregateQuery",
|
|
69867
70015
|
value: (function () {
|
|
69868
|
-
var _ExecuteAggregateQuery = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
69869
|
-
var startTime, queryResult, executionTime, nullResults, row, results, validExprIndex, _loop2, i, _executionTime, errorMessage, errorResults,
|
|
69870
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69871
|
-
while (1) switch (
|
|
70016
|
+
var _ExecuteAggregateQuery = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee18(aggregateSQL, aggregates, validationErrors, contextUser) {
|
|
70017
|
+
var startTime, queryResult, executionTime, nullResults, row, results, validExprIndex, _loop2, i, _executionTime, errorMessage, errorResults, _t7;
|
|
70018
|
+
return databaseProviderBase_regenerator().w(function (_context20) {
|
|
70019
|
+
while (1) switch (_context20.p = _context20.n) {
|
|
69872
70020
|
case 0:
|
|
69873
70021
|
startTime = Date.now();
|
|
69874
70022
|
if (aggregateSQL) {
|
|
69875
|
-
|
|
70023
|
+
_context20.n = 1;
|
|
69876
70024
|
break;
|
|
69877
70025
|
}
|
|
69878
|
-
return
|
|
70026
|
+
return _context20.a(2, {
|
|
69879
70027
|
results: validationErrors,
|
|
69880
70028
|
executionTime: 0
|
|
69881
70029
|
});
|
|
69882
70030
|
case 1:
|
|
69883
|
-
|
|
69884
|
-
|
|
70031
|
+
_context20.p = 1;
|
|
70032
|
+
_context20.n = 2;
|
|
69885
70033
|
return this.ExecuteSQL(aggregateSQL, undefined, undefined, contextUser);
|
|
69886
70034
|
case 2:
|
|
69887
|
-
queryResult =
|
|
70035
|
+
queryResult = _context20.v;
|
|
69888
70036
|
executionTime = Date.now() - startTime;
|
|
69889
70037
|
if (!(!queryResult || queryResult.length === 0)) {
|
|
69890
|
-
|
|
70038
|
+
_context20.n = 3;
|
|
69891
70039
|
break;
|
|
69892
70040
|
}
|
|
69893
70041
|
nullResults = aggregates.filter(function (_, i) {
|
|
@@ -69902,7 +70050,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69902
70050
|
error: undefined
|
|
69903
70051
|
};
|
|
69904
70052
|
});
|
|
69905
|
-
return
|
|
70053
|
+
return _context20.a(2, {
|
|
69906
70054
|
results: [].concat(databaseProviderBase_toConsumableArray(validationErrors), databaseProviderBase_toConsumableArray(nullResults)),
|
|
69907
70055
|
executionTime: executionTime
|
|
69908
70056
|
});
|
|
@@ -69912,8 +70060,8 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69912
70060
|
validExprIndex = 0;
|
|
69913
70061
|
_loop2 = /*#__PURE__*/databaseProviderBase_regenerator().m(function _loop2() {
|
|
69914
70062
|
var agg, alias, validationError, value;
|
|
69915
|
-
return databaseProviderBase_regenerator().w(function (
|
|
69916
|
-
while (1) switch (
|
|
70063
|
+
return databaseProviderBase_regenerator().w(function (_context19) {
|
|
70064
|
+
while (1) switch (_context19.n) {
|
|
69917
70065
|
case 0:
|
|
69918
70066
|
agg = aggregates[i];
|
|
69919
70067
|
alias = agg.alias || agg.expression;
|
|
@@ -69933,31 +70081,31 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69933
70081
|
validExprIndex++;
|
|
69934
70082
|
}
|
|
69935
70083
|
case 1:
|
|
69936
|
-
return
|
|
70084
|
+
return _context19.a(2);
|
|
69937
70085
|
}
|
|
69938
70086
|
}, _loop2);
|
|
69939
70087
|
});
|
|
69940
70088
|
i = 0;
|
|
69941
70089
|
case 4:
|
|
69942
70090
|
if (!(i < aggregates.length)) {
|
|
69943
|
-
|
|
70091
|
+
_context20.n = 6;
|
|
69944
70092
|
break;
|
|
69945
70093
|
}
|
|
69946
|
-
return
|
|
70094
|
+
return _context20.d(databaseProviderBase_regeneratorValues(_loop2()), 5);
|
|
69947
70095
|
case 5:
|
|
69948
70096
|
i++;
|
|
69949
|
-
|
|
70097
|
+
_context20.n = 4;
|
|
69950
70098
|
break;
|
|
69951
70099
|
case 6:
|
|
69952
|
-
return
|
|
70100
|
+
return _context20.a(2, {
|
|
69953
70101
|
results: results,
|
|
69954
70102
|
executionTime: executionTime
|
|
69955
70103
|
});
|
|
69956
70104
|
case 7:
|
|
69957
|
-
|
|
69958
|
-
|
|
70105
|
+
_context20.p = 7;
|
|
70106
|
+
_t7 = _context20.v;
|
|
69959
70107
|
_executionTime = Date.now() - startTime;
|
|
69960
|
-
errorMessage =
|
|
70108
|
+
errorMessage = _t7 instanceof Error ? _t7.message : String(_t7);
|
|
69961
70109
|
errorResults = aggregates.map(function (agg) {
|
|
69962
70110
|
return {
|
|
69963
70111
|
expression: agg.expression,
|
|
@@ -69966,14 +70114,14 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
69966
70114
|
error: errorMessage
|
|
69967
70115
|
};
|
|
69968
70116
|
});
|
|
69969
|
-
return
|
|
70117
|
+
return _context20.a(2, {
|
|
69970
70118
|
results: errorResults,
|
|
69971
70119
|
executionTime: _executionTime
|
|
69972
70120
|
});
|
|
69973
70121
|
}
|
|
69974
|
-
},
|
|
70122
|
+
}, _callee18, this, [[1, 7]]);
|
|
69975
70123
|
}));
|
|
69976
|
-
function ExecuteAggregateQuery(
|
|
70124
|
+
function ExecuteAggregateQuery(_x48, _x49, _x50, _x51) {
|
|
69977
70125
|
return _ExecuteAggregateQuery.apply(this, arguments);
|
|
69978
70126
|
}
|
|
69979
70127
|
return ExecuteAggregateQuery;
|
|
@@ -70044,23 +70192,23 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70044
70192
|
}, {
|
|
70045
70193
|
key: "InternalGetEntityRecordName",
|
|
70046
70194
|
value: (function () {
|
|
70047
|
-
var _InternalGetEntityRecordName = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70048
|
-
var sql, data, values,
|
|
70049
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70050
|
-
while (1) switch (
|
|
70195
|
+
var _InternalGetEntityRecordName = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee19(entityName, compositeKey, contextUser) {
|
|
70196
|
+
var sql, data, values, _t8;
|
|
70197
|
+
return databaseProviderBase_regenerator().w(function (_context21) {
|
|
70198
|
+
while (1) switch (_context21.p = _context21.n) {
|
|
70051
70199
|
case 0:
|
|
70052
|
-
|
|
70200
|
+
_context21.p = 0;
|
|
70053
70201
|
sql = this.BuildEntityRecordNameSQL(entityName, compositeKey);
|
|
70054
70202
|
if (!sql) {
|
|
70055
|
-
|
|
70203
|
+
_context21.n = 3;
|
|
70056
70204
|
break;
|
|
70057
70205
|
}
|
|
70058
|
-
|
|
70206
|
+
_context21.n = 1;
|
|
70059
70207
|
return this.ExecuteSQL(sql, undefined, undefined, contextUser);
|
|
70060
70208
|
case 1:
|
|
70061
|
-
data =
|
|
70209
|
+
data = _context21.v;
|
|
70062
70210
|
if (!(data && data.length === 1)) {
|
|
70063
|
-
|
|
70211
|
+
_context21.n = 2;
|
|
70064
70212
|
break;
|
|
70065
70213
|
}
|
|
70066
70214
|
// Concatenate all returned fields with spaces (supports multi-name entities)
|
|
@@ -70069,21 +70217,21 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70069
70217
|
}).map(function (v) {
|
|
70070
70218
|
return String(v);
|
|
70071
70219
|
});
|
|
70072
|
-
return
|
|
70220
|
+
return _context21.a(2, values.join(' '));
|
|
70073
70221
|
case 2:
|
|
70074
70222
|
LogError('Entity ' + entityName + ' record ' + compositeKey.ToString() + ' not found');
|
|
70075
|
-
return
|
|
70223
|
+
return _context21.a(2, '');
|
|
70076
70224
|
case 3:
|
|
70077
|
-
return
|
|
70225
|
+
return _context21.a(2, '');
|
|
70078
70226
|
case 4:
|
|
70079
|
-
|
|
70080
|
-
|
|
70081
|
-
LogError(
|
|
70082
|
-
return
|
|
70227
|
+
_context21.p = 4;
|
|
70228
|
+
_t8 = _context21.v;
|
|
70229
|
+
LogError(_t8);
|
|
70230
|
+
return _context21.a(2, '');
|
|
70083
70231
|
}
|
|
70084
|
-
},
|
|
70232
|
+
}, _callee19, this, [[0, 4]]);
|
|
70085
70233
|
}));
|
|
70086
|
-
function InternalGetEntityRecordName(
|
|
70234
|
+
function InternalGetEntityRecordName(_x52, _x53, _x54) {
|
|
70087
70235
|
return _InternalGetEntityRecordName.apply(this, arguments);
|
|
70088
70236
|
}
|
|
70089
70237
|
return InternalGetEntityRecordName;
|
|
@@ -70095,25 +70243,25 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70095
70243
|
}, {
|
|
70096
70244
|
key: "InternalGetEntityRecordNames",
|
|
70097
70245
|
value: (function () {
|
|
70098
|
-
var _InternalGetEntityRecordNames = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70099
|
-
var results, _iterator6, _step6, item, name,
|
|
70100
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70101
|
-
while (1) switch (
|
|
70246
|
+
var _InternalGetEntityRecordNames = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee20(info, contextUser) {
|
|
70247
|
+
var results, _iterator6, _step6, item, name, _t9;
|
|
70248
|
+
return databaseProviderBase_regenerator().w(function (_context22) {
|
|
70249
|
+
while (1) switch (_context22.p = _context22.n) {
|
|
70102
70250
|
case 0:
|
|
70103
70251
|
results = [];
|
|
70104
70252
|
_iterator6 = databaseProviderBase_createForOfIteratorHelper(info);
|
|
70105
|
-
|
|
70253
|
+
_context22.p = 1;
|
|
70106
70254
|
_iterator6.s();
|
|
70107
70255
|
case 2:
|
|
70108
70256
|
if ((_step6 = _iterator6.n()).done) {
|
|
70109
|
-
|
|
70257
|
+
_context22.n = 5;
|
|
70110
70258
|
break;
|
|
70111
70259
|
}
|
|
70112
70260
|
item = _step6.value;
|
|
70113
|
-
|
|
70261
|
+
_context22.n = 3;
|
|
70114
70262
|
return this.InternalGetEntityRecordName(item.EntityName, item.CompositeKey, contextUser);
|
|
70115
70263
|
case 3:
|
|
70116
|
-
name =
|
|
70264
|
+
name = _context22.v;
|
|
70117
70265
|
results.push({
|
|
70118
70266
|
EntityName: item.EntityName,
|
|
70119
70267
|
CompositeKey: item.CompositeKey,
|
|
@@ -70122,25 +70270,25 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70122
70270
|
Status: name ? 'Success' : 'Error'
|
|
70123
70271
|
});
|
|
70124
70272
|
case 4:
|
|
70125
|
-
|
|
70273
|
+
_context22.n = 2;
|
|
70126
70274
|
break;
|
|
70127
70275
|
case 5:
|
|
70128
|
-
|
|
70276
|
+
_context22.n = 7;
|
|
70129
70277
|
break;
|
|
70130
70278
|
case 6:
|
|
70131
|
-
|
|
70132
|
-
|
|
70133
|
-
_iterator6.e(
|
|
70279
|
+
_context22.p = 6;
|
|
70280
|
+
_t9 = _context22.v;
|
|
70281
|
+
_iterator6.e(_t9);
|
|
70134
70282
|
case 7:
|
|
70135
|
-
|
|
70283
|
+
_context22.p = 7;
|
|
70136
70284
|
_iterator6.f();
|
|
70137
|
-
return
|
|
70285
|
+
return _context22.f(7);
|
|
70138
70286
|
case 8:
|
|
70139
|
-
return
|
|
70287
|
+
return _context22.a(2, results);
|
|
70140
70288
|
}
|
|
70141
|
-
},
|
|
70289
|
+
}, _callee20, this, [[1, 6, 7, 8]]);
|
|
70142
70290
|
}));
|
|
70143
|
-
function InternalGetEntityRecordNames(
|
|
70291
|
+
function InternalGetEntityRecordNames(_x55, _x56) {
|
|
70144
70292
|
return _InternalGetEntityRecordNames.apply(this, arguments);
|
|
70145
70293
|
}
|
|
70146
70294
|
return InternalGetEntityRecordNames;
|
|
@@ -70168,14 +70316,14 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70168
70316
|
}, {
|
|
70169
70317
|
key: "Save",
|
|
70170
70318
|
value: (function () {
|
|
70171
|
-
var _Save = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70319
|
+
var _Save = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee21(entity, user, options) {
|
|
70172
70320
|
var _this6 = this;
|
|
70173
|
-
var entityResult, bNewRecord, bReplay, saveContext, validationMessage, createRLSPass, updateRLSPass, postHookCreatePass, postImagePass, sqlDetails, _sqlDetails$parameter, extraData, result, _sqlDetails$parameter2, execOptions, rawResult, patches,
|
|
70174
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70175
|
-
while (1) switch (
|
|
70321
|
+
var entityResult, bNewRecord, bReplay, saveContext, validationMessage, createRLSPass, updateRLSPass, postHookCreatePass, postImagePass, sqlDetails, _sqlDetails$parameter, extraData, result, _sqlDetails$parameter2, execOptions, rawResult, patches, _t0;
|
|
70322
|
+
return databaseProviderBase_regenerator().w(function (_context23) {
|
|
70323
|
+
while (1) switch (_context23.p = _context23.n) {
|
|
70176
70324
|
case 0:
|
|
70177
70325
|
entityResult = new BaseEntityResult();
|
|
70178
|
-
|
|
70326
|
+
_context23.p = 1;
|
|
70179
70327
|
entity.RegisterTransactionPreprocessing();
|
|
70180
70328
|
// External-data-source entities are read-only — MJ is never the system of record for
|
|
70181
70329
|
// remote data. Refuse writes at the provider layer so the guarantee holds regardless of
|
|
@@ -70186,7 +70334,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70186
70334
|
// than returning false, since by this point the normal read-only path has been bypassed.
|
|
70187
70335
|
// No-op for MJ-DB entities (ExternalDataSourceID null).
|
|
70188
70336
|
if (!entity.EntityInfo.ExternalDataSourceID) {
|
|
70189
|
-
|
|
70337
|
+
_context23.n = 2;
|
|
70190
70338
|
break;
|
|
70191
70339
|
}
|
|
70192
70340
|
throw new Error("Save() not allowed for ".concat(entity.EntityInfo.Name, ": it is sourced from an external data source (read-only)."));
|
|
@@ -70195,19 +70343,19 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70195
70343
|
if (!options) options = new EntitySaveOptions();
|
|
70196
70344
|
bReplay = !!options.ReplayOnly;
|
|
70197
70345
|
if (!(!bReplay && !bNewRecord && !entity.EntityInfo.AllowUpdateAPI)) {
|
|
70198
|
-
|
|
70346
|
+
_context23.n = 3;
|
|
70199
70347
|
break;
|
|
70200
70348
|
}
|
|
70201
70349
|
throw new Error("UPDATE not allowed for entity ".concat(entity.EntityInfo.Name));
|
|
70202
70350
|
case 3:
|
|
70203
70351
|
if (!(!bReplay && bNewRecord && !entity.EntityInfo.AllowCreateAPI)) {
|
|
70204
|
-
|
|
70352
|
+
_context23.n = 4;
|
|
70205
70353
|
break;
|
|
70206
70354
|
}
|
|
70207
70355
|
throw new Error("CREATE not allowed for entity ".concat(entity.EntityInfo.Name));
|
|
70208
70356
|
case 4:
|
|
70209
70357
|
if (!(entity.Dirty || options.IgnoreDirtyState || options.ReplayOnly)) {
|
|
70210
|
-
|
|
70358
|
+
_context23.n = 28;
|
|
70211
70359
|
break;
|
|
70212
70360
|
}
|
|
70213
70361
|
entityResult.StartedAt = new Date();
|
|
@@ -70234,36 +70382,36 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70234
70382
|
entity.RegisterResultHistoryEntry(entityResult);
|
|
70235
70383
|
// Step 2: Validation hook
|
|
70236
70384
|
if (bReplay) {
|
|
70237
|
-
|
|
70385
|
+
_context23.n = 6;
|
|
70238
70386
|
break;
|
|
70239
70387
|
}
|
|
70240
|
-
|
|
70388
|
+
_context23.n = 5;
|
|
70241
70389
|
return this.OnValidateBeforeSave(entity, user, saveContext);
|
|
70242
70390
|
case 5:
|
|
70243
|
-
validationMessage =
|
|
70391
|
+
validationMessage = _context23.v;
|
|
70244
70392
|
if (!validationMessage) {
|
|
70245
|
-
|
|
70393
|
+
_context23.n = 6;
|
|
70246
70394
|
break;
|
|
70247
70395
|
}
|
|
70248
70396
|
entityResult.Success = false;
|
|
70249
70397
|
entityResult.EndedAt = new Date();
|
|
70250
70398
|
entityResult.Message = validationMessage;
|
|
70251
|
-
return
|
|
70399
|
+
return _context23.a(2, false);
|
|
70252
70400
|
case 6:
|
|
70253
70401
|
if (bReplay) {
|
|
70254
|
-
|
|
70402
|
+
_context23.n = 11;
|
|
70255
70403
|
break;
|
|
70256
70404
|
}
|
|
70257
70405
|
if (!bNewRecord) {
|
|
70258
|
-
|
|
70406
|
+
_context23.n = 9;
|
|
70259
70407
|
break;
|
|
70260
70408
|
}
|
|
70261
|
-
|
|
70409
|
+
_context23.n = 7;
|
|
70262
70410
|
return this.CheckCreateRLS(entity, user);
|
|
70263
70411
|
case 7:
|
|
70264
|
-
createRLSPass =
|
|
70412
|
+
createRLSPass = _context23.v;
|
|
70265
70413
|
if (createRLSPass) {
|
|
70266
|
-
|
|
70414
|
+
_context23.n = 8;
|
|
70267
70415
|
break;
|
|
70268
70416
|
}
|
|
70269
70417
|
entityResult.Success = false;
|
|
@@ -70271,15 +70419,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70271
70419
|
entityResult.Message = "Access denied for new ".concat(entity.EntityInfo.Name, " record");
|
|
70272
70420
|
throw new Error(entityResult.Message);
|
|
70273
70421
|
case 8:
|
|
70274
|
-
|
|
70422
|
+
_context23.n = 11;
|
|
70275
70423
|
break;
|
|
70276
70424
|
case 9:
|
|
70277
|
-
|
|
70425
|
+
_context23.n = 10;
|
|
70278
70426
|
return this.CheckRecordRLS(entity, user, EntityPermissionType.Update);
|
|
70279
70427
|
case 10:
|
|
70280
|
-
updateRLSPass =
|
|
70428
|
+
updateRLSPass = _context23.v;
|
|
70281
70429
|
if (updateRLSPass) {
|
|
70282
|
-
|
|
70430
|
+
_context23.n = 11;
|
|
70283
70431
|
break;
|
|
70284
70432
|
}
|
|
70285
70433
|
entityResult.Success = false;
|
|
@@ -70290,26 +70438,26 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70290
70438
|
throw new Error(entityResult.Message);
|
|
70291
70439
|
case 11:
|
|
70292
70440
|
if (bReplay) {
|
|
70293
|
-
|
|
70441
|
+
_context23.n = 12;
|
|
70294
70442
|
break;
|
|
70295
70443
|
}
|
|
70296
|
-
|
|
70444
|
+
_context23.n = 12;
|
|
70297
70445
|
return this.OnBeforeSaveExecute(entity, user, options, saveContext);
|
|
70298
70446
|
case 12:
|
|
70299
70447
|
if (bReplay) {
|
|
70300
|
-
|
|
70448
|
+
_context23.n = 17;
|
|
70301
70449
|
break;
|
|
70302
70450
|
}
|
|
70303
70451
|
if (!bNewRecord) {
|
|
70304
|
-
|
|
70452
|
+
_context23.n = 15;
|
|
70305
70453
|
break;
|
|
70306
70454
|
}
|
|
70307
|
-
|
|
70455
|
+
_context23.n = 13;
|
|
70308
70456
|
return this.CheckCreateRLS(entity, user);
|
|
70309
70457
|
case 13:
|
|
70310
|
-
postHookCreatePass =
|
|
70458
|
+
postHookCreatePass = _context23.v;
|
|
70311
70459
|
if (postHookCreatePass) {
|
|
70312
|
-
|
|
70460
|
+
_context23.n = 14;
|
|
70313
70461
|
break;
|
|
70314
70462
|
}
|
|
70315
70463
|
entityResult.Success = false;
|
|
@@ -70317,15 +70465,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70317
70465
|
entityResult.Message = "Access denied for new ".concat(entity.EntityInfo.Name, " record: a before-save hook produced field values that no longer pass row-level security");
|
|
70318
70466
|
throw new Error(entityResult.Message);
|
|
70319
70467
|
case 14:
|
|
70320
|
-
|
|
70468
|
+
_context23.n = 17;
|
|
70321
70469
|
break;
|
|
70322
70470
|
case 15:
|
|
70323
|
-
|
|
70471
|
+
_context23.n = 16;
|
|
70324
70472
|
return this.CheckUpdateRLSPostImage(entity, user);
|
|
70325
70473
|
case 16:
|
|
70326
|
-
postImagePass =
|
|
70474
|
+
postImagePass = _context23.v;
|
|
70327
70475
|
if (postImagePass) {
|
|
70328
|
-
|
|
70476
|
+
_context23.n = 17;
|
|
70329
70477
|
break;
|
|
70330
70478
|
}
|
|
70331
70479
|
entityResult.Success = false;
|
|
@@ -70333,12 +70481,12 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70333
70481
|
entityResult.Message = "Access denied: the requested changes would move this ".concat(entity.EntityInfo.Name, " record outside your permitted row scope");
|
|
70334
70482
|
throw new Error(entityResult.Message);
|
|
70335
70483
|
case 17:
|
|
70336
|
-
|
|
70484
|
+
_context23.n = 18;
|
|
70337
70485
|
return this.GenerateSaveSQL(entity, bNewRecord, user, options);
|
|
70338
70486
|
case 18:
|
|
70339
|
-
sqlDetails =
|
|
70487
|
+
sqlDetails = _context23.v;
|
|
70340
70488
|
if (!(entity.TransactionGroup && !bReplay)) {
|
|
70341
|
-
|
|
70489
|
+
_context23.n = 19;
|
|
70342
70490
|
break;
|
|
70343
70491
|
}
|
|
70344
70492
|
// ---- Transaction Group path ----
|
|
@@ -70361,32 +70509,32 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70361
70509
|
entityResult.Message = 'Transaction Failed';
|
|
70362
70510
|
}
|
|
70363
70511
|
}));
|
|
70364
|
-
return
|
|
70512
|
+
return _context23.a(2, true);
|
|
70365
70513
|
case 19:
|
|
70366
70514
|
// ---- Direct execution path ----
|
|
70367
70515
|
this.OnSuspendRefresh();
|
|
70368
70516
|
if (!bReplay) {
|
|
70369
|
-
|
|
70517
|
+
_context23.n = 20;
|
|
70370
70518
|
break;
|
|
70371
70519
|
}
|
|
70372
70520
|
result = [entity.GetAll()];
|
|
70373
|
-
|
|
70521
|
+
_context23.n = 23;
|
|
70374
70522
|
break;
|
|
70375
70523
|
case 20:
|
|
70376
70524
|
execOptions = this.BuildSaveExecuteOptions(entity, sqlDetails);
|
|
70377
|
-
|
|
70525
|
+
_context23.n = 21;
|
|
70378
70526
|
return this.ExecuteSQL(sqlDetails.fullSQL, (_sqlDetails$parameter2 = sqlDetails.parameters) !== null && _sqlDetails$parameter2 !== void 0 ? _sqlDetails$parameter2 : undefined, execOptions, user);
|
|
70379
70527
|
case 21:
|
|
70380
|
-
rawResult =
|
|
70381
|
-
|
|
70528
|
+
rawResult = _context23.v;
|
|
70529
|
+
_context23.n = 22;
|
|
70382
70530
|
return this.PostProcessRows(rawResult, entity.EntityInfo, user);
|
|
70383
70531
|
case 22:
|
|
70384
|
-
result =
|
|
70532
|
+
result = _context23.v;
|
|
70385
70533
|
case 23:
|
|
70386
70534
|
this.OnResumeRefresh();
|
|
70387
70535
|
entityResult.EndedAt = new Date();
|
|
70388
70536
|
if (!(result && result.length > 0)) {
|
|
70389
|
-
|
|
70537
|
+
_context23.n = 25;
|
|
70390
70538
|
break;
|
|
70391
70539
|
}
|
|
70392
70540
|
this.OnAfterSaveExecute(entity, user, options, saveContext);
|
|
@@ -70394,44 +70542,44 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70394
70542
|
// OnSaveCompleted may return patch fields (e.g., updated lat/lng
|
|
70395
70543
|
// from geocoding) that need to be merged onto the SP result before
|
|
70396
70544
|
// the entity loads the data via finalizeSave().
|
|
70397
|
-
|
|
70545
|
+
_context23.n = 24;
|
|
70398
70546
|
return this.OnSaveCompleted(entity, sqlDetails, user, options, saveContext);
|
|
70399
70547
|
case 24:
|
|
70400
|
-
patches =
|
|
70548
|
+
patches = _context23.v;
|
|
70401
70549
|
if (patches) {
|
|
70402
70550
|
Object.assign(result[0], patches);
|
|
70403
70551
|
}
|
|
70404
|
-
return
|
|
70552
|
+
return _context23.a(2, result[0]);
|
|
70405
70553
|
case 25:
|
|
70406
70554
|
if (!bNewRecord) {
|
|
70407
|
-
|
|
70555
|
+
_context23.n = 26;
|
|
70408
70556
|
break;
|
|
70409
70557
|
}
|
|
70410
70558
|
throw new Error("SQL Error: Error creating new record, no rows returned from SQL: ".concat(sqlDetails.fullSQL));
|
|
70411
70559
|
case 26:
|
|
70412
70560
|
throw new Error("SQL Error: Error updating record, no MATCHING rows found within the database: ".concat(sqlDetails.fullSQL));
|
|
70413
70561
|
case 27:
|
|
70414
|
-
|
|
70562
|
+
_context23.n = 29;
|
|
70415
70563
|
break;
|
|
70416
70564
|
case 28:
|
|
70417
|
-
return
|
|
70565
|
+
return _context23.a(2, entity.GetAll());
|
|
70418
70566
|
case 29:
|
|
70419
|
-
|
|
70567
|
+
_context23.n = 31;
|
|
70420
70568
|
break;
|
|
70421
70569
|
case 30:
|
|
70422
|
-
|
|
70423
|
-
|
|
70570
|
+
_context23.p = 30;
|
|
70571
|
+
_t0 = _context23.v;
|
|
70424
70572
|
this.OnResumeRefresh();
|
|
70425
70573
|
entityResult.EndedAt = new Date();
|
|
70426
|
-
entityResult.Message =
|
|
70427
|
-
LogError(
|
|
70428
|
-
throw
|
|
70574
|
+
entityResult.Message = _t0.message;
|
|
70575
|
+
LogError(_t0);
|
|
70576
|
+
throw _t0;
|
|
70429
70577
|
case 31:
|
|
70430
|
-
return
|
|
70578
|
+
return _context23.a(2);
|
|
70431
70579
|
}
|
|
70432
|
-
},
|
|
70580
|
+
}, _callee21, this, [[1, 30]]);
|
|
70433
70581
|
}));
|
|
70434
|
-
function Save(
|
|
70582
|
+
function Save(_x57, _x58, _x59) {
|
|
70435
70583
|
return _Save.apply(this, arguments);
|
|
70436
70584
|
}
|
|
70437
70585
|
return Save;
|
|
@@ -70450,21 +70598,21 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70450
70598
|
}, {
|
|
70451
70599
|
key: "Delete",
|
|
70452
70600
|
value: (function () {
|
|
70453
|
-
var _Delete = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70601
|
+
var _Delete = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee22(entity, options, user) {
|
|
70454
70602
|
var _this7 = this;
|
|
70455
|
-
var entityResult, bReplay, sqlDetails, deleteRLSPass, _sqlDetails$parameter3, extraData, d, _sqlDetails$parameter4, execOptions,
|
|
70456
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70457
|
-
while (1) switch (
|
|
70603
|
+
var entityResult, bReplay, sqlDetails, deleteRLSPass, _sqlDetails$parameter3, extraData, d, _sqlDetails$parameter4, execOptions, _t1;
|
|
70604
|
+
return databaseProviderBase_regenerator().w(function (_context24) {
|
|
70605
|
+
while (1) switch (_context24.p = _context24.n) {
|
|
70458
70606
|
case 0:
|
|
70459
70607
|
entityResult = new BaseEntityResult();
|
|
70460
|
-
|
|
70608
|
+
_context24.p = 1;
|
|
70461
70609
|
entity.RegisterTransactionPreprocessing();
|
|
70462
70610
|
// External-data-source entities are read-only (see Save) — refuse deletes at the provider
|
|
70463
70611
|
// layer regardless of the generated base class. The normal path (ReadOnlyExternalBaseEntity)
|
|
70464
70612
|
// returns false before reaching here; this backstop intentionally throws only for the
|
|
70465
70613
|
// custom-subclass edge case that bypasses it. No-op for MJ-DB entities.
|
|
70466
70614
|
if (!entity.EntityInfo.ExternalDataSourceID) {
|
|
70467
|
-
|
|
70615
|
+
_context24.n = 2;
|
|
70468
70616
|
break;
|
|
70469
70617
|
}
|
|
70470
70618
|
throw new Error("Delete() not allowed for ".concat(entity.EntityInfo.Name, ": it is sourced from an external data source (read-only)."));
|
|
@@ -70472,13 +70620,13 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70472
70620
|
if (!options) options = new EntityDeleteOptions();
|
|
70473
70621
|
bReplay = options.ReplayOnly;
|
|
70474
70622
|
if (!(!entity.IsSaved && !bReplay)) {
|
|
70475
|
-
|
|
70623
|
+
_context24.n = 3;
|
|
70476
70624
|
break;
|
|
70477
70625
|
}
|
|
70478
70626
|
throw new Error("Delete() isn't callable for records that haven't yet been saved - ".concat(entity.EntityInfo.Name));
|
|
70479
70627
|
case 3:
|
|
70480
70628
|
if (!(!entity.EntityInfo.AllowDeleteAPI && !bReplay)) {
|
|
70481
|
-
|
|
70629
|
+
_context24.n = 4;
|
|
70482
70630
|
break;
|
|
70483
70631
|
}
|
|
70484
70632
|
throw new Error("Delete() isn't callable for ".concat(entity.EntityInfo.Name, " as AllowDeleteAPI is false"));
|
|
@@ -70494,19 +70642,19 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70494
70642
|
entity.RegisterResultHistoryEntry(entityResult);
|
|
70495
70643
|
// Generate provider-specific delete SQL
|
|
70496
70644
|
sqlDetails = this.GenerateDeleteSQL(entity, user, options); // Before-delete hooks
|
|
70497
|
-
|
|
70645
|
+
_context24.n = 5;
|
|
70498
70646
|
return this.OnBeforeDeleteExecute(entity, user, options);
|
|
70499
70647
|
case 5:
|
|
70500
70648
|
if (bReplay) {
|
|
70501
|
-
|
|
70649
|
+
_context24.n = 7;
|
|
70502
70650
|
break;
|
|
70503
70651
|
}
|
|
70504
|
-
|
|
70652
|
+
_context24.n = 6;
|
|
70505
70653
|
return this.CheckRecordRLS(entity, user, EntityPermissionType.Delete);
|
|
70506
70654
|
case 6:
|
|
70507
|
-
deleteRLSPass =
|
|
70655
|
+
deleteRLSPass = _context24.v;
|
|
70508
70656
|
if (deleteRLSPass) {
|
|
70509
|
-
|
|
70657
|
+
_context24.n = 7;
|
|
70510
70658
|
break;
|
|
70511
70659
|
}
|
|
70512
70660
|
entityResult.Success = false;
|
|
@@ -70517,7 +70665,7 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70517
70665
|
throw new Error(entityResult.Message);
|
|
70518
70666
|
case 7:
|
|
70519
70667
|
if (!(entity.TransactionGroup && !bReplay)) {
|
|
70520
|
-
|
|
70668
|
+
_context24.n = 8;
|
|
70521
70669
|
break;
|
|
70522
70670
|
}
|
|
70523
70671
|
// ---- Transaction Group path ----
|
|
@@ -70553,58 +70701,58 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70553
70701
|
entityResult.Message = 'Transaction failed to commit';
|
|
70554
70702
|
}
|
|
70555
70703
|
}));
|
|
70556
|
-
return
|
|
70704
|
+
return _context24.a(2, true);
|
|
70557
70705
|
case 8:
|
|
70558
70706
|
if (!bReplay) {
|
|
70559
|
-
|
|
70707
|
+
_context24.n = 9;
|
|
70560
70708
|
break;
|
|
70561
70709
|
}
|
|
70562
70710
|
d = [entity.GetAll()];
|
|
70563
|
-
|
|
70711
|
+
_context24.n = 11;
|
|
70564
70712
|
break;
|
|
70565
70713
|
case 9:
|
|
70566
70714
|
execOptions = this.BuildDeleteExecuteOptions(entity, sqlDetails);
|
|
70567
|
-
|
|
70715
|
+
_context24.n = 10;
|
|
70568
70716
|
return this.ExecuteSQL(sqlDetails.fullSQL, (_sqlDetails$parameter4 = sqlDetails.parameters) !== null && _sqlDetails$parameter4 !== void 0 ? _sqlDetails$parameter4 : undefined, execOptions, user);
|
|
70569
70717
|
case 10:
|
|
70570
|
-
d =
|
|
70718
|
+
d = _context24.v;
|
|
70571
70719
|
case 11:
|
|
70572
70720
|
if (!(d && d.length > 0)) {
|
|
70573
|
-
|
|
70721
|
+
_context24.n = 13;
|
|
70574
70722
|
break;
|
|
70575
70723
|
}
|
|
70576
70724
|
if (this.ValidateDeleteResult(entity, d, entityResult)) {
|
|
70577
|
-
|
|
70725
|
+
_context24.n = 12;
|
|
70578
70726
|
break;
|
|
70579
70727
|
}
|
|
70580
70728
|
entityResult.EndedAt = new Date();
|
|
70581
70729
|
entityResult.Success = false;
|
|
70582
|
-
return
|
|
70730
|
+
return _context24.a(2, false);
|
|
70583
70731
|
case 12:
|
|
70584
70732
|
this.OnAfterDeleteExecute(entity, user, options);
|
|
70585
70733
|
entityResult.EndedAt = new Date();
|
|
70586
|
-
return
|
|
70734
|
+
return _context24.a(2, true);
|
|
70587
70735
|
case 13:
|
|
70588
70736
|
entityResult.Message = 'No result returned from SQL';
|
|
70589
70737
|
entityResult.EndedAt = new Date();
|
|
70590
|
-
return
|
|
70738
|
+
return _context24.a(2, false);
|
|
70591
70739
|
case 14:
|
|
70592
|
-
|
|
70740
|
+
_context24.n = 16;
|
|
70593
70741
|
break;
|
|
70594
70742
|
case 15:
|
|
70595
|
-
|
|
70596
|
-
|
|
70597
|
-
LogError(
|
|
70598
|
-
entityResult.Message =
|
|
70743
|
+
_context24.p = 15;
|
|
70744
|
+
_t1 = _context24.v;
|
|
70745
|
+
LogError(_t1);
|
|
70746
|
+
entityResult.Message = _t1.message;
|
|
70599
70747
|
entityResult.Success = false;
|
|
70600
70748
|
entityResult.EndedAt = new Date();
|
|
70601
|
-
return
|
|
70749
|
+
return _context24.a(2, false);
|
|
70602
70750
|
case 16:
|
|
70603
|
-
return
|
|
70751
|
+
return _context24.a(2);
|
|
70604
70752
|
}
|
|
70605
|
-
},
|
|
70753
|
+
}, _callee22, this, [[1, 15]]);
|
|
70606
70754
|
}));
|
|
70607
|
-
function Delete(
|
|
70755
|
+
function Delete(_x60, _x61, _x62) {
|
|
70608
70756
|
return _Delete.apply(this, arguments);
|
|
70609
70757
|
}
|
|
70610
70758
|
return Delete;
|
|
@@ -70635,12 +70783,12 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70635
70783
|
}, {
|
|
70636
70784
|
key: "CreateAuditLogRecord",
|
|
70637
70785
|
value: (function () {
|
|
70638
|
-
var _CreateAuditLogRecord = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70639
|
-
var authorization, auditLogType, auditLog,
|
|
70640
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70641
|
-
while (1) switch (
|
|
70786
|
+
var _CreateAuditLogRecord = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee23(user, authorizationName, auditLogTypeName, status, details, entityId, recordId, auditLogDescription, saveOptions) {
|
|
70787
|
+
var authorization, auditLogType, auditLog, _t10;
|
|
70788
|
+
return databaseProviderBase_regenerator().w(function (_context25) {
|
|
70789
|
+
while (1) switch (_context25.p = _context25.n) {
|
|
70642
70790
|
case 0:
|
|
70643
|
-
|
|
70791
|
+
_context25.p = 0;
|
|
70644
70792
|
authorization = authorizationName ? this.Authorizations.find(function (a) {
|
|
70645
70793
|
var _a$Name;
|
|
70646
70794
|
return (a === null || a === void 0 || (_a$Name = a.Name) === null || _a$Name === void 0 ? void 0 : _a$Name.trim().toLowerCase()) === authorizationName.trim().toLowerCase();
|
|
@@ -70650,21 +70798,21 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70650
70798
|
return (a === null || a === void 0 || (_a$Name2 = a.Name) === null || _a$Name2 === void 0 ? void 0 : _a$Name2.trim().toLowerCase()) === auditLogTypeName.trim().toLowerCase();
|
|
70651
70799
|
}) : null;
|
|
70652
70800
|
if (user) {
|
|
70653
|
-
|
|
70801
|
+
_context25.n = 1;
|
|
70654
70802
|
break;
|
|
70655
70803
|
}
|
|
70656
70804
|
throw new Error('User is a required parameter');
|
|
70657
70805
|
case 1:
|
|
70658
70806
|
if (auditLogType) {
|
|
70659
|
-
|
|
70807
|
+
_context25.n = 2;
|
|
70660
70808
|
break;
|
|
70661
70809
|
}
|
|
70662
70810
|
throw new Error("Audit Log Type ".concat(auditLogTypeName, " not found in metadata"));
|
|
70663
70811
|
case 2:
|
|
70664
|
-
|
|
70812
|
+
_context25.n = 3;
|
|
70665
70813
|
return this.GetEntityObject('MJ: Audit Logs', user);
|
|
70666
70814
|
case 3:
|
|
70667
|
-
auditLog =
|
|
70815
|
+
auditLog = _context25.v;
|
|
70668
70816
|
auditLog.NewRecord();
|
|
70669
70817
|
auditLog.Set('UserID', user.ID);
|
|
70670
70818
|
auditLog.Set('AuditLogTypeID', auditLogType.ID);
|
|
@@ -70674,30 +70822,30 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70674
70822
|
if (authorization) auditLog.Set('AuthorizationID', authorization.ID);
|
|
70675
70823
|
if (details) auditLog.Set('Details', details);
|
|
70676
70824
|
if (auditLogDescription) auditLog.Set('Description', auditLogDescription);
|
|
70677
|
-
|
|
70825
|
+
_context25.n = 4;
|
|
70678
70826
|
return auditLog.Save(saveOptions !== null && saveOptions !== void 0 ? saveOptions : undefined);
|
|
70679
70827
|
case 4:
|
|
70680
|
-
if (!
|
|
70681
|
-
|
|
70828
|
+
if (!_context25.v) {
|
|
70829
|
+
_context25.n = 5;
|
|
70682
70830
|
break;
|
|
70683
70831
|
}
|
|
70684
|
-
return
|
|
70832
|
+
return _context25.a(2, auditLog);
|
|
70685
70833
|
case 5:
|
|
70686
70834
|
throw new Error('Error saving audit log record');
|
|
70687
70835
|
case 6:
|
|
70688
|
-
|
|
70836
|
+
_context25.n = 8;
|
|
70689
70837
|
break;
|
|
70690
70838
|
case 7:
|
|
70691
|
-
|
|
70692
|
-
|
|
70693
|
-
LogError(
|
|
70694
|
-
return
|
|
70839
|
+
_context25.p = 7;
|
|
70840
|
+
_t10 = _context25.v;
|
|
70841
|
+
LogError(_t10);
|
|
70842
|
+
return _context25.a(2, null);
|
|
70695
70843
|
case 8:
|
|
70696
|
-
return
|
|
70844
|
+
return _context25.a(2);
|
|
70697
70845
|
}
|
|
70698
|
-
},
|
|
70846
|
+
}, _callee23, this, [[0, 7]]);
|
|
70699
70847
|
}));
|
|
70700
|
-
function CreateAuditLogRecord(
|
|
70848
|
+
function CreateAuditLogRecord(_x63, _x64, _x65, _x66, _x67, _x68, _x69, _x70, _x71) {
|
|
70701
70849
|
return _CreateAuditLogRecord.apply(this, arguments);
|
|
70702
70850
|
}
|
|
70703
70851
|
return CreateAuditLogRecord;
|
|
@@ -70729,15 +70877,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70729
70877
|
}, {
|
|
70730
70878
|
key: "HandleEntityActions",
|
|
70731
70879
|
value: (function () {
|
|
70732
|
-
var _HandleEntityActions = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70733
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70734
|
-
while (1) switch (
|
|
70880
|
+
var _HandleEntityActions = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee24(_entity, _baseType, _before, _user, _originatingEntityActionIDs) {
|
|
70881
|
+
return databaseProviderBase_regenerator().w(function (_context26) {
|
|
70882
|
+
while (1) switch (_context26.n) {
|
|
70735
70883
|
case 0:
|
|
70736
|
-
return
|
|
70884
|
+
return _context26.a(2, []);
|
|
70737
70885
|
}
|
|
70738
|
-
},
|
|
70886
|
+
}, _callee24);
|
|
70739
70887
|
}));
|
|
70740
|
-
function HandleEntityActions(
|
|
70888
|
+
function HandleEntityActions(_x72, _x73, _x74, _x75, _x76) {
|
|
70741
70889
|
return _HandleEntityActions.apply(this, arguments);
|
|
70742
70890
|
}
|
|
70743
70891
|
return HandleEntityActions;
|
|
@@ -70751,15 +70899,15 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70751
70899
|
}, {
|
|
70752
70900
|
key: "HandleEntityAIActions",
|
|
70753
70901
|
value: (function () {
|
|
70754
|
-
var _HandleEntityAIActions = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70755
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70756
|
-
while (1) switch (
|
|
70902
|
+
var _HandleEntityAIActions = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee25(_entity, _baseType, _before, _user) {
|
|
70903
|
+
return databaseProviderBase_regenerator().w(function (_context27) {
|
|
70904
|
+
while (1) switch (_context27.n) {
|
|
70757
70905
|
case 0:
|
|
70758
|
-
return
|
|
70906
|
+
return _context27.a(2);
|
|
70759
70907
|
}
|
|
70760
|
-
},
|
|
70908
|
+
}, _callee25);
|
|
70761
70909
|
}));
|
|
70762
|
-
function HandleEntityAIActions(
|
|
70910
|
+
function HandleEntityAIActions(_x77, _x78, _x79, _x80) {
|
|
70763
70911
|
return _HandleEntityAIActions.apply(this, arguments);
|
|
70764
70912
|
}
|
|
70765
70913
|
return HandleEntityAIActions;
|
|
@@ -70819,26 +70967,26 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70819
70967
|
}, {
|
|
70820
70968
|
key: "LogRecordChange",
|
|
70821
70969
|
value: (function () {
|
|
70822
|
-
var _LogRecordChange = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70970
|
+
var _LogRecordChange = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee26(newData, oldData, entityName, recordID, entityInfo, type, user, restoreContext) {
|
|
70823
70971
|
var sqlResult, _sqlResult$parameters;
|
|
70824
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70825
|
-
while (1) switch (
|
|
70972
|
+
return databaseProviderBase_regenerator().w(function (_context28) {
|
|
70973
|
+
while (1) switch (_context28.n) {
|
|
70826
70974
|
case 0:
|
|
70827
70975
|
sqlResult = this.BuildRecordChangeSQL(newData, oldData, entityName, recordID, entityInfo, type, user, restoreContext);
|
|
70828
70976
|
if (!sqlResult) {
|
|
70829
|
-
|
|
70977
|
+
_context28.n = 2;
|
|
70830
70978
|
break;
|
|
70831
70979
|
}
|
|
70832
|
-
|
|
70980
|
+
_context28.n = 1;
|
|
70833
70981
|
return this.ExecuteSQL(sqlResult.sql, (_sqlResult$parameters = sqlResult.parameters) !== null && _sqlResult$parameters !== void 0 ? _sqlResult$parameters : undefined, undefined, user);
|
|
70834
70982
|
case 1:
|
|
70835
|
-
return
|
|
70983
|
+
return _context28.a(2, _context28.v);
|
|
70836
70984
|
case 2:
|
|
70837
|
-
return
|
|
70985
|
+
return _context28.a(2, undefined);
|
|
70838
70986
|
}
|
|
70839
|
-
},
|
|
70987
|
+
}, _callee26, this);
|
|
70840
70988
|
}));
|
|
70841
|
-
function LogRecordChange(
|
|
70989
|
+
function LogRecordChange(_x81, _x82, _x83, _x84, _x85, _x86, _x87, _x88) {
|
|
70842
70990
|
return _LogRecordChange.apply(this, arguments);
|
|
70843
70991
|
}
|
|
70844
70992
|
return LogRecordChange;
|
|
@@ -70926,10 +71074,10 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70926
71074
|
}, {
|
|
70927
71075
|
key: "PropagateRecordChangesToSiblings",
|
|
70928
71076
|
value: (function () {
|
|
70929
|
-
var _PropagateRecordChangesToSiblings = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
70930
|
-
var sqlParts, safePKValue, safeUserId, safeChangesJSON, safeChangesDesc, varIndex, _iterator8, _step8, childInfo, subTree, _iterator9, _step9, entityInTree, varName, batch, execOptions,
|
|
70931
|
-
return databaseProviderBase_regenerator().w(function (
|
|
70932
|
-
while (1) switch (
|
|
71077
|
+
var _PropagateRecordChangesToSiblings = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee27(parentInfo, changeData, pkValue, userId, activeChildEntityName, extraExecOptions) {
|
|
71078
|
+
var sqlParts, safePKValue, safeUserId, safeChangesJSON, safeChangesDesc, varIndex, _iterator8, _step8, childInfo, subTree, _iterator9, _step9, entityInTree, varName, batch, execOptions, _t11, _t12;
|
|
71079
|
+
return databaseProviderBase_regenerator().w(function (_context29) {
|
|
71080
|
+
while (1) switch (_context29.p = _context29.n) {
|
|
70933
71081
|
case 0:
|
|
70934
71082
|
sqlParts = [];
|
|
70935
71083
|
safePKValue = pkValue.replace(/'/g, "''");
|
|
@@ -70938,70 +71086,70 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
70938
71086
|
safeChangesDesc = changeData.changesDescription.replace(/'/g, "''");
|
|
70939
71087
|
varIndex = 0;
|
|
70940
71088
|
_iterator8 = databaseProviderBase_createForOfIteratorHelper(parentInfo.ChildEntities);
|
|
70941
|
-
|
|
71089
|
+
_context29.p = 1;
|
|
70942
71090
|
_iterator8.s();
|
|
70943
71091
|
case 2:
|
|
70944
71092
|
if ((_step8 = _iterator8.n()).done) {
|
|
70945
|
-
|
|
71093
|
+
_context29.n = 12;
|
|
70946
71094
|
break;
|
|
70947
71095
|
}
|
|
70948
71096
|
childInfo = _step8.value;
|
|
70949
71097
|
if (!(activeChildEntityName && this.IsEntityOrAncestorOf(childInfo, activeChildEntityName))) {
|
|
70950
|
-
|
|
71098
|
+
_context29.n = 3;
|
|
70951
71099
|
break;
|
|
70952
71100
|
}
|
|
70953
|
-
return
|
|
71101
|
+
return _context29.a(3, 11);
|
|
70954
71102
|
case 3:
|
|
70955
71103
|
// Recursively enumerate this child's entire sub-tree from metadata
|
|
70956
71104
|
subTree = this.GetFullSubTree(childInfo);
|
|
70957
71105
|
_iterator9 = databaseProviderBase_createForOfIteratorHelper(subTree);
|
|
70958
|
-
|
|
71106
|
+
_context29.p = 4;
|
|
70959
71107
|
_iterator9.s();
|
|
70960
71108
|
case 5:
|
|
70961
71109
|
if ((_step9 = _iterator9.n()).done) {
|
|
70962
|
-
|
|
71110
|
+
_context29.n = 8;
|
|
70963
71111
|
break;
|
|
70964
71112
|
}
|
|
70965
71113
|
entityInTree = _step9.value;
|
|
70966
71114
|
if (entityInTree.TrackRecordChanges) {
|
|
70967
|
-
|
|
71115
|
+
_context29.n = 6;
|
|
70968
71116
|
break;
|
|
70969
71117
|
}
|
|
70970
|
-
return
|
|
71118
|
+
return _context29.a(3, 7);
|
|
70971
71119
|
case 6:
|
|
70972
71120
|
varName = "@_rc_prop_".concat(varIndex++);
|
|
70973
71121
|
sqlParts.push(this.BuildSiblingRecordChangeSQL(varName, entityInTree, safeChangesJSON, safeChangesDesc, safePKValue, safeUserId));
|
|
70974
71122
|
case 7:
|
|
70975
|
-
|
|
71123
|
+
_context29.n = 5;
|
|
70976
71124
|
break;
|
|
70977
71125
|
case 8:
|
|
70978
|
-
|
|
71126
|
+
_context29.n = 10;
|
|
70979
71127
|
break;
|
|
70980
71128
|
case 9:
|
|
70981
|
-
|
|
70982
|
-
|
|
70983
|
-
_iterator9.e(
|
|
71129
|
+
_context29.p = 9;
|
|
71130
|
+
_t11 = _context29.v;
|
|
71131
|
+
_iterator9.e(_t11);
|
|
70984
71132
|
case 10:
|
|
70985
|
-
|
|
71133
|
+
_context29.p = 10;
|
|
70986
71134
|
_iterator9.f();
|
|
70987
|
-
return
|
|
71135
|
+
return _context29.f(10);
|
|
70988
71136
|
case 11:
|
|
70989
|
-
|
|
71137
|
+
_context29.n = 2;
|
|
70990
71138
|
break;
|
|
70991
71139
|
case 12:
|
|
70992
|
-
|
|
71140
|
+
_context29.n = 14;
|
|
70993
71141
|
break;
|
|
70994
71142
|
case 13:
|
|
70995
|
-
|
|
70996
|
-
|
|
70997
|
-
_iterator8.e(
|
|
71143
|
+
_context29.p = 13;
|
|
71144
|
+
_t12 = _context29.v;
|
|
71145
|
+
_iterator8.e(_t12);
|
|
70998
71146
|
case 14:
|
|
70999
|
-
|
|
71147
|
+
_context29.p = 14;
|
|
71000
71148
|
_iterator8.f();
|
|
71001
|
-
return
|
|
71149
|
+
return _context29.f(14);
|
|
71002
71150
|
case 15:
|
|
71003
71151
|
if (!(sqlParts.length > 0)) {
|
|
71004
|
-
|
|
71152
|
+
_context29.n = 16;
|
|
71005
71153
|
break;
|
|
71006
71154
|
}
|
|
71007
71155
|
batch = sqlParts.join('\n');
|
|
@@ -71009,14 +71157,14 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71009
71157
|
description: 'IS-A overlapping subtype Record Change propagation',
|
|
71010
71158
|
isMutation: true
|
|
71011
71159
|
}, extraExecOptions !== null && extraExecOptions !== void 0 ? extraExecOptions : {});
|
|
71012
|
-
|
|
71160
|
+
_context29.n = 16;
|
|
71013
71161
|
return this.ExecuteSQL(batch, undefined, execOptions);
|
|
71014
71162
|
case 16:
|
|
71015
|
-
return
|
|
71163
|
+
return _context29.a(2);
|
|
71016
71164
|
}
|
|
71017
|
-
},
|
|
71165
|
+
}, _callee27, this, [[4, 9, 10, 11], [1, 13, 14, 15]]);
|
|
71018
71166
|
}));
|
|
71019
|
-
function PropagateRecordChangesToSiblings(
|
|
71167
|
+
function PropagateRecordChangesToSiblings(_x89, _x90, _x91, _x92, _x93, _x94) {
|
|
71020
71168
|
return _PropagateRecordChangesToSiblings.apply(this, arguments);
|
|
71021
71169
|
}
|
|
71022
71170
|
return PropagateRecordChangesToSiblings;
|
|
@@ -71040,28 +71188,28 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71040
71188
|
}, {
|
|
71041
71189
|
key: "GetRecordDuplicates",
|
|
71042
71190
|
value: (function () {
|
|
71043
|
-
var _GetRecordDuplicates = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
71191
|
+
var _GetRecordDuplicates = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee28(params, contextUser) {
|
|
71044
71192
|
var listEntity, duplicateRun, saveResult, response;
|
|
71045
|
-
return databaseProviderBase_regenerator().w(function (
|
|
71046
|
-
while (1) switch (
|
|
71193
|
+
return databaseProviderBase_regenerator().w(function (_context30) {
|
|
71194
|
+
while (1) switch (_context30.n) {
|
|
71047
71195
|
case 0:
|
|
71048
71196
|
if (contextUser) {
|
|
71049
|
-
|
|
71197
|
+
_context30.n = 1;
|
|
71050
71198
|
break;
|
|
71051
71199
|
}
|
|
71052
71200
|
throw new Error('User context is required to get record duplicates.');
|
|
71053
71201
|
case 1:
|
|
71054
|
-
|
|
71202
|
+
_context30.n = 2;
|
|
71055
71203
|
return this.GetEntityObject('MJ: Lists', contextUser);
|
|
71056
71204
|
case 2:
|
|
71057
|
-
listEntity =
|
|
71058
|
-
|
|
71205
|
+
listEntity = _context30.v;
|
|
71206
|
+
_context30.n = 3;
|
|
71059
71207
|
return listEntity.InnerLoad(CompositeKey.FromID(params.ListID));
|
|
71060
71208
|
case 3:
|
|
71061
|
-
|
|
71209
|
+
_context30.n = 4;
|
|
71062
71210
|
return this.GetEntityObject('MJ: Duplicate Runs', contextUser);
|
|
71063
71211
|
case 4:
|
|
71064
|
-
duplicateRun =
|
|
71212
|
+
duplicateRun = _context30.v;
|
|
71065
71213
|
duplicateRun.NewRecord();
|
|
71066
71214
|
duplicateRun.Set('EntityID', params.EntityID);
|
|
71067
71215
|
duplicateRun.Set('StartedByUserID', contextUser.ID);
|
|
@@ -71069,12 +71217,12 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71069
71217
|
duplicateRun.Set('ProcessingStatus', 'In Progress');
|
|
71070
71218
|
duplicateRun.Set('ApprovalStatus', 'Pending');
|
|
71071
71219
|
duplicateRun.Set('SourceListID', listEntity.Get('ID'));
|
|
71072
|
-
|
|
71220
|
+
_context30.n = 5;
|
|
71073
71221
|
return duplicateRun.Save();
|
|
71074
71222
|
case 5:
|
|
71075
|
-
saveResult =
|
|
71223
|
+
saveResult = _context30.v;
|
|
71076
71224
|
if (saveResult) {
|
|
71077
|
-
|
|
71225
|
+
_context30.n = 6;
|
|
71078
71226
|
break;
|
|
71079
71227
|
}
|
|
71080
71228
|
throw new Error('Failed to save Duplicate Run Entity');
|
|
@@ -71083,11 +71231,11 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71083
71231
|
Status: 'Inprogress',
|
|
71084
71232
|
PotentialDuplicateResult: []
|
|
71085
71233
|
};
|
|
71086
|
-
return
|
|
71234
|
+
return _context30.a(2, response);
|
|
71087
71235
|
}
|
|
71088
|
-
},
|
|
71236
|
+
}, _callee28, this);
|
|
71089
71237
|
}));
|
|
71090
|
-
function GetRecordDuplicates(
|
|
71238
|
+
function GetRecordDuplicates(_x95, _x96) {
|
|
71091
71239
|
return _GetRecordDuplicates.apply(this, arguments);
|
|
71092
71240
|
}
|
|
71093
71241
|
return GetRecordDuplicates;
|
|
@@ -71106,14 +71254,14 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71106
71254
|
}, {
|
|
71107
71255
|
key: "MergeRecords",
|
|
71108
71256
|
value: (function () {
|
|
71109
|
-
var _MergeRecords = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
71110
|
-
var e, result, mergeRecordLog, survivor, _iterator0, _step0, fieldMap, _iterator1, _step1, pksToDelete, newRecStatus, dependencies, _iterator10, _step10, dependency, relatedEntity, recordToDelete,
|
|
71111
|
-
return databaseProviderBase_regenerator().w(function (
|
|
71112
|
-
while (1) switch (
|
|
71257
|
+
var _MergeRecords = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee29(request, contextUser, _options) {
|
|
71258
|
+
var e, result, mergeRecordLog, survivor, _iterator0, _step0, fieldMap, _iterator1, _step1, pksToDelete, newRecStatus, dependencies, _iterator10, _step10, dependency, relatedEntity, recordToDelete, _t13, _t14, _t15;
|
|
71259
|
+
return databaseProviderBase_regenerator().w(function (_context31) {
|
|
71260
|
+
while (1) switch (_context31.p = _context31.n) {
|
|
71113
71261
|
case 0:
|
|
71114
71262
|
e = this.EntityByName(request.EntityName);
|
|
71115
71263
|
if (!(!e || !e.AllowRecordMerge)) {
|
|
71116
|
-
|
|
71264
|
+
_context31.n = 1;
|
|
71117
71265
|
break;
|
|
71118
71266
|
}
|
|
71119
71267
|
throw new Error("Entity ".concat(request.EntityName, " does not allow record merging, check the AllowRecordMerge property in the entity metadata"));
|
|
@@ -71125,23 +71273,23 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71125
71273
|
Request: request,
|
|
71126
71274
|
OverallStatus: null
|
|
71127
71275
|
};
|
|
71128
|
-
|
|
71276
|
+
_context31.n = 2;
|
|
71129
71277
|
return this.StartMergeLogging(request, result, contextUser);
|
|
71130
71278
|
case 2:
|
|
71131
|
-
mergeRecordLog =
|
|
71132
|
-
|
|
71133
|
-
|
|
71279
|
+
mergeRecordLog = _context31.v;
|
|
71280
|
+
_context31.p = 3;
|
|
71281
|
+
_context31.n = 4;
|
|
71134
71282
|
return this.BeginTransaction();
|
|
71135
71283
|
case 4:
|
|
71136
71284
|
if (!(request.FieldMap && request.FieldMap.length > 0)) {
|
|
71137
|
-
|
|
71285
|
+
_context31.n = 8;
|
|
71138
71286
|
break;
|
|
71139
71287
|
}
|
|
71140
|
-
|
|
71288
|
+
_context31.n = 5;
|
|
71141
71289
|
return this.GetEntityObject(request.EntityName, contextUser);
|
|
71142
71290
|
case 5:
|
|
71143
|
-
survivor =
|
|
71144
|
-
|
|
71291
|
+
survivor = _context31.v;
|
|
71292
|
+
_context31.n = 6;
|
|
71145
71293
|
return survivor.InnerLoad(request.SurvivingRecordCompositeKey);
|
|
71146
71294
|
case 6:
|
|
71147
71295
|
_iterator0 = databaseProviderBase_createForOfIteratorHelper(request.FieldMap);
|
|
@@ -71155,11 +71303,11 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71155
71303
|
} finally {
|
|
71156
71304
|
_iterator0.f();
|
|
71157
71305
|
}
|
|
71158
|
-
|
|
71306
|
+
_context31.n = 7;
|
|
71159
71307
|
return survivor.Save();
|
|
71160
71308
|
case 7:
|
|
71161
|
-
if (
|
|
71162
|
-
|
|
71309
|
+
if (_context31.v) {
|
|
71310
|
+
_context31.n = 8;
|
|
71163
71311
|
break;
|
|
71164
71312
|
}
|
|
71165
71313
|
result.OverallStatus = 'Error saving survivor record with values from provided field map.';
|
|
@@ -71167,11 +71315,11 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71167
71315
|
case 8:
|
|
71168
71316
|
// Step 3 - update dependencies and delete each merged record
|
|
71169
71317
|
_iterator1 = databaseProviderBase_createForOfIteratorHelper(request.RecordsToMerge);
|
|
71170
|
-
|
|
71318
|
+
_context31.p = 9;
|
|
71171
71319
|
_iterator1.s();
|
|
71172
71320
|
case 10:
|
|
71173
71321
|
if ((_step1 = _iterator1.n()).done) {
|
|
71174
|
-
|
|
71322
|
+
_context31.n = 27;
|
|
71175
71323
|
break;
|
|
71176
71324
|
}
|
|
71177
71325
|
pksToDelete = _step1.value;
|
|
@@ -71182,64 +71330,64 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71182
71330
|
Message: null
|
|
71183
71331
|
};
|
|
71184
71332
|
result.RecordStatus.push(newRecStatus);
|
|
71185
|
-
|
|
71333
|
+
_context31.n = 11;
|
|
71186
71334
|
return this.GetRecordDependencies(request.EntityName, pksToDelete);
|
|
71187
71335
|
case 11:
|
|
71188
|
-
dependencies =
|
|
71336
|
+
dependencies = _context31.v;
|
|
71189
71337
|
_iterator10 = databaseProviderBase_createForOfIteratorHelper(dependencies);
|
|
71190
|
-
|
|
71338
|
+
_context31.p = 12;
|
|
71191
71339
|
_iterator10.s();
|
|
71192
71340
|
case 13:
|
|
71193
71341
|
if ((_step10 = _iterator10.n()).done) {
|
|
71194
|
-
|
|
71342
|
+
_context31.n = 18;
|
|
71195
71343
|
break;
|
|
71196
71344
|
}
|
|
71197
71345
|
dependency = _step10.value;
|
|
71198
|
-
|
|
71346
|
+
_context31.n = 14;
|
|
71199
71347
|
return this.GetEntityObject(dependency.RelatedEntityName, contextUser);
|
|
71200
71348
|
case 14:
|
|
71201
|
-
relatedEntity =
|
|
71202
|
-
|
|
71349
|
+
relatedEntity = _context31.v;
|
|
71350
|
+
_context31.n = 15;
|
|
71203
71351
|
return relatedEntity.InnerLoad(dependency.PrimaryKey);
|
|
71204
71352
|
case 15:
|
|
71205
71353
|
relatedEntity.Set(dependency.FieldName, this.ResolveMergeLinkValue(dependency, request.SurvivingRecordCompositeKey));
|
|
71206
|
-
|
|
71354
|
+
_context31.n = 16;
|
|
71207
71355
|
return relatedEntity.Save();
|
|
71208
71356
|
case 16:
|
|
71209
|
-
if (
|
|
71210
|
-
|
|
71357
|
+
if (_context31.v) {
|
|
71358
|
+
_context31.n = 17;
|
|
71211
71359
|
break;
|
|
71212
71360
|
}
|
|
71213
71361
|
newRecStatus.Success = false;
|
|
71214
71362
|
newRecStatus.Message = "Error updating dependency record ".concat(dependency.PrimaryKey.ToString(), " for entity ").concat(dependency.RelatedEntityName, " to point to surviving record ").concat(request.SurvivingRecordCompositeKey.ToString());
|
|
71215
71363
|
throw new Error(newRecStatus.Message);
|
|
71216
71364
|
case 17:
|
|
71217
|
-
|
|
71365
|
+
_context31.n = 13;
|
|
71218
71366
|
break;
|
|
71219
71367
|
case 18:
|
|
71220
|
-
|
|
71368
|
+
_context31.n = 20;
|
|
71221
71369
|
break;
|
|
71222
71370
|
case 19:
|
|
71223
|
-
|
|
71224
|
-
|
|
71225
|
-
_iterator10.e(
|
|
71371
|
+
_context31.p = 19;
|
|
71372
|
+
_t13 = _context31.v;
|
|
71373
|
+
_iterator10.e(_t13);
|
|
71226
71374
|
case 20:
|
|
71227
|
-
|
|
71375
|
+
_context31.p = 20;
|
|
71228
71376
|
_iterator10.f();
|
|
71229
|
-
return
|
|
71377
|
+
return _context31.f(20);
|
|
71230
71378
|
case 21:
|
|
71231
|
-
|
|
71379
|
+
_context31.n = 22;
|
|
71232
71380
|
return this.GetEntityObject(request.EntityName, contextUser);
|
|
71233
71381
|
case 22:
|
|
71234
|
-
recordToDelete =
|
|
71235
|
-
|
|
71382
|
+
recordToDelete = _context31.v;
|
|
71383
|
+
_context31.n = 23;
|
|
71236
71384
|
return recordToDelete.InnerLoad(pksToDelete);
|
|
71237
71385
|
case 23:
|
|
71238
|
-
|
|
71386
|
+
_context31.n = 24;
|
|
71239
71387
|
return recordToDelete.Delete();
|
|
71240
71388
|
case 24:
|
|
71241
|
-
if (
|
|
71242
|
-
|
|
71389
|
+
if (_context31.v) {
|
|
71390
|
+
_context31.n = 25;
|
|
71243
71391
|
break;
|
|
71244
71392
|
}
|
|
71245
71393
|
newRecStatus.Message = "Error deleting record ".concat(pksToDelete.ToString(), " for entity ").concat(request.EntityName);
|
|
@@ -71247,46 +71395,46 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71247
71395
|
case 25:
|
|
71248
71396
|
newRecStatus.Success = true;
|
|
71249
71397
|
case 26:
|
|
71250
|
-
|
|
71398
|
+
_context31.n = 10;
|
|
71251
71399
|
break;
|
|
71252
71400
|
case 27:
|
|
71253
|
-
|
|
71401
|
+
_context31.n = 29;
|
|
71254
71402
|
break;
|
|
71255
71403
|
case 28:
|
|
71256
|
-
|
|
71257
|
-
|
|
71258
|
-
_iterator1.e(
|
|
71404
|
+
_context31.p = 28;
|
|
71405
|
+
_t14 = _context31.v;
|
|
71406
|
+
_iterator1.e(_t14);
|
|
71259
71407
|
case 29:
|
|
71260
|
-
|
|
71408
|
+
_context31.p = 29;
|
|
71261
71409
|
_iterator1.f();
|
|
71262
|
-
return
|
|
71410
|
+
return _context31.f(29);
|
|
71263
71411
|
case 30:
|
|
71264
71412
|
result.Success = true;
|
|
71265
|
-
|
|
71413
|
+
_context31.n = 31;
|
|
71266
71414
|
return this.CompleteMergeLogging(mergeRecordLog, result, contextUser);
|
|
71267
71415
|
case 31:
|
|
71268
|
-
|
|
71416
|
+
_context31.n = 32;
|
|
71269
71417
|
return this.CommitTransaction();
|
|
71270
71418
|
case 32:
|
|
71271
71419
|
result.Success = true;
|
|
71272
|
-
return
|
|
71420
|
+
return _context31.a(2, result);
|
|
71273
71421
|
case 33:
|
|
71274
|
-
|
|
71275
|
-
|
|
71276
|
-
LogError(
|
|
71277
|
-
|
|
71422
|
+
_context31.p = 33;
|
|
71423
|
+
_t15 = _context31.v;
|
|
71424
|
+
LogError(_t15);
|
|
71425
|
+
_context31.n = 34;
|
|
71278
71426
|
return this.RollbackTransaction();
|
|
71279
71427
|
case 34:
|
|
71280
|
-
|
|
71428
|
+
_context31.n = 35;
|
|
71281
71429
|
return this.CompleteMergeLogging(mergeRecordLog, result, contextUser);
|
|
71282
71430
|
case 35:
|
|
71283
|
-
throw
|
|
71431
|
+
throw _t15;
|
|
71284
71432
|
case 36:
|
|
71285
|
-
return
|
|
71433
|
+
return _context31.a(2);
|
|
71286
71434
|
}
|
|
71287
|
-
},
|
|
71435
|
+
}, _callee29, this, [[12, 19, 20, 21], [9, 28, 29, 30], [3, 33]]);
|
|
71288
71436
|
}));
|
|
71289
|
-
function MergeRecords(
|
|
71437
|
+
function MergeRecords(_x97, _x98, _x99) {
|
|
71290
71438
|
return _MergeRecords.apply(this, arguments);
|
|
71291
71439
|
}
|
|
71292
71440
|
return MergeRecords;
|
|
@@ -71299,25 +71447,25 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71299
71447
|
}, {
|
|
71300
71448
|
key: "StartMergeLogging",
|
|
71301
71449
|
value: (function () {
|
|
71302
|
-
var _StartMergeLogging = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
71303
|
-
var _this$CurrentUser, _this$CurrentUser2, recordMergeLog, entity,
|
|
71304
|
-
return databaseProviderBase_regenerator().w(function (
|
|
71305
|
-
while (1) switch (
|
|
71450
|
+
var _StartMergeLogging = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee30(request, result, contextUser) {
|
|
71451
|
+
var _this$CurrentUser, _this$CurrentUser2, recordMergeLog, entity, _t16;
|
|
71452
|
+
return databaseProviderBase_regenerator().w(function (_context32) {
|
|
71453
|
+
while (1) switch (_context32.p = _context32.n) {
|
|
71306
71454
|
case 0:
|
|
71307
|
-
|
|
71308
|
-
|
|
71455
|
+
_context32.p = 0;
|
|
71456
|
+
_context32.n = 1;
|
|
71309
71457
|
return this.GetEntityObject('MJ: Record Merge Logs', contextUser);
|
|
71310
71458
|
case 1:
|
|
71311
|
-
recordMergeLog =
|
|
71459
|
+
recordMergeLog = _context32.v;
|
|
71312
71460
|
entity = this.EntityByName(request.EntityName);
|
|
71313
71461
|
if (entity) {
|
|
71314
|
-
|
|
71462
|
+
_context32.n = 2;
|
|
71315
71463
|
break;
|
|
71316
71464
|
}
|
|
71317
71465
|
throw new Error("Entity ".concat(request.EntityName, " not found in metadata"));
|
|
71318
71466
|
case 2:
|
|
71319
71467
|
if (!(!contextUser && !this.CurrentUser)) {
|
|
71320
|
-
|
|
71468
|
+
_context32.n = 3;
|
|
71321
71469
|
break;
|
|
71322
71470
|
}
|
|
71323
71471
|
throw new Error('contextUser is null and no CurrentUser is set');
|
|
@@ -71330,31 +71478,31 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71330
71478
|
recordMergeLog.Set('ApprovedByUserID', contextUser ? contextUser.ID : (_this$CurrentUser2 = this.CurrentUser) === null || _this$CurrentUser2 === void 0 ? void 0 : _this$CurrentUser2.ID);
|
|
71331
71479
|
recordMergeLog.Set('ProcessingStatus', 'Started');
|
|
71332
71480
|
recordMergeLog.Set('ProcessingStartedAt', new Date());
|
|
71333
|
-
|
|
71481
|
+
_context32.n = 4;
|
|
71334
71482
|
return recordMergeLog.Save();
|
|
71335
71483
|
case 4:
|
|
71336
|
-
if (!
|
|
71337
|
-
|
|
71484
|
+
if (!_context32.v) {
|
|
71485
|
+
_context32.n = 5;
|
|
71338
71486
|
break;
|
|
71339
71487
|
}
|
|
71340
71488
|
result.RecordMergeLogID = recordMergeLog.Get('ID');
|
|
71341
|
-
return
|
|
71489
|
+
return _context32.a(2, recordMergeLog);
|
|
71342
71490
|
case 5:
|
|
71343
71491
|
throw new Error('Error saving record merge log');
|
|
71344
71492
|
case 6:
|
|
71345
|
-
|
|
71493
|
+
_context32.n = 8;
|
|
71346
71494
|
break;
|
|
71347
71495
|
case 7:
|
|
71348
|
-
|
|
71349
|
-
|
|
71350
|
-
LogError(
|
|
71351
|
-
throw
|
|
71496
|
+
_context32.p = 7;
|
|
71497
|
+
_t16 = _context32.v;
|
|
71498
|
+
LogError(_t16);
|
|
71499
|
+
throw _t16;
|
|
71352
71500
|
case 8:
|
|
71353
|
-
return
|
|
71501
|
+
return _context32.a(2);
|
|
71354
71502
|
}
|
|
71355
|
-
},
|
|
71503
|
+
}, _callee30, this, [[0, 7]]);
|
|
71356
71504
|
}));
|
|
71357
|
-
function StartMergeLogging(
|
|
71505
|
+
function StartMergeLogging(_x100, _x101, _x102) {
|
|
71358
71506
|
return _StartMergeLogging.apply(this, arguments);
|
|
71359
71507
|
}
|
|
71360
71508
|
return StartMergeLogging;
|
|
@@ -71368,14 +71516,14 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71368
71516
|
}, {
|
|
71369
71517
|
key: "CompleteMergeLogging",
|
|
71370
71518
|
value: (function () {
|
|
71371
|
-
var _CompleteMergeLogging = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function
|
|
71372
|
-
var _iterator11, _step11, d, deletionLog,
|
|
71373
|
-
return databaseProviderBase_regenerator().w(function (
|
|
71374
|
-
while (1) switch (
|
|
71519
|
+
var _CompleteMergeLogging = databaseProviderBase_asyncToGenerator(/*#__PURE__*/databaseProviderBase_regenerator().m(function _callee31(recordMergeLog, result, contextUser) {
|
|
71520
|
+
var _iterator11, _step11, d, deletionLog, _t17, _t18;
|
|
71521
|
+
return databaseProviderBase_regenerator().w(function (_context33) {
|
|
71522
|
+
while (1) switch (_context33.p = _context33.n) {
|
|
71375
71523
|
case 0:
|
|
71376
|
-
|
|
71524
|
+
_context33.p = 0;
|
|
71377
71525
|
if (!(!contextUser && !this.CurrentUser)) {
|
|
71378
|
-
|
|
71526
|
+
_context33.n = 1;
|
|
71379
71527
|
break;
|
|
71380
71528
|
}
|
|
71381
71529
|
throw new Error('contextUser is null and no CurrentUser is set');
|
|
@@ -71385,74 +71533,74 @@ var DatabaseProviderBase = /*#__PURE__*/function (_ProviderBase) {
|
|
|
71385
71533
|
if (!result.Success) {
|
|
71386
71534
|
recordMergeLog.Set('ProcessingLog', result.OverallStatus);
|
|
71387
71535
|
}
|
|
71388
|
-
|
|
71536
|
+
_context33.n = 2;
|
|
71389
71537
|
return recordMergeLog.Save();
|
|
71390
71538
|
case 2:
|
|
71391
|
-
if (!
|
|
71392
|
-
|
|
71539
|
+
if (!_context33.v) {
|
|
71540
|
+
_context33.n = 13;
|
|
71393
71541
|
break;
|
|
71394
71542
|
}
|
|
71395
71543
|
_iterator11 = databaseProviderBase_createForOfIteratorHelper(result.RecordStatus);
|
|
71396
|
-
|
|
71544
|
+
_context33.p = 3;
|
|
71397
71545
|
_iterator11.s();
|
|
71398
71546
|
case 4:
|
|
71399
71547
|
if ((_step11 = _iterator11.n()).done) {
|
|
71400
|
-
|
|
71548
|
+
_context33.n = 9;
|
|
71401
71549
|
break;
|
|
71402
71550
|
}
|
|
71403
71551
|
d = _step11.value;
|
|
71404
|
-
|
|
71552
|
+
_context33.n = 5;
|
|
71405
71553
|
return this.GetEntityObject('MJ: Record Merge Deletion Logs', contextUser);
|
|
71406
71554
|
case 5:
|
|
71407
|
-
deletionLog =
|
|
71555
|
+
deletionLog = _context33.v;
|
|
71408
71556
|
deletionLog.NewRecord();
|
|
71409
71557
|
deletionLog.Set('RecordMergeLogID', recordMergeLog.Get('ID'));
|
|
71410
71558
|
deletionLog.Set('DeletedRecordID', d.CompositeKey.Values());
|
|
71411
71559
|
deletionLog.Set('Status', d.Success ? 'Complete' : 'Error');
|
|
71412
71560
|
if (!d.Success) deletionLog.Set('ProcessingLog', d.Message);
|
|
71413
|
-
|
|
71561
|
+
_context33.n = 6;
|
|
71414
71562
|
return deletionLog.Save();
|
|
71415
71563
|
case 6:
|
|
71416
|
-
if (
|
|
71417
|
-
|
|
71564
|
+
if (_context33.v) {
|
|
71565
|
+
_context33.n = 7;
|
|
71418
71566
|
break;
|
|
71419
71567
|
}
|
|
71420
71568
|
throw new Error('Error saving record merge deletion log');
|
|
71421
71569
|
case 7:
|
|
71422
71570
|
d.RecordMergeDeletionLogID = deletionLog.Get('ID');
|
|
71423
71571
|
case 8:
|
|
71424
|
-
|
|
71572
|
+
_context33.n = 4;
|
|
71425
71573
|
break;
|
|
71426
71574
|
case 9:
|
|
71427
|
-
|
|
71575
|
+
_context33.n = 11;
|
|
71428
71576
|
break;
|
|
71429
71577
|
case 10:
|
|
71430
|
-
|
|
71431
|
-
|
|
71432
|
-
_iterator11.e(
|
|
71578
|
+
_context33.p = 10;
|
|
71579
|
+
_t17 = _context33.v;
|
|
71580
|
+
_iterator11.e(_t17);
|
|
71433
71581
|
case 11:
|
|
71434
|
-
|
|
71582
|
+
_context33.p = 11;
|
|
71435
71583
|
_iterator11.f();
|
|
71436
|
-
return
|
|
71584
|
+
return _context33.f(11);
|
|
71437
71585
|
case 12:
|
|
71438
|
-
|
|
71586
|
+
_context33.n = 14;
|
|
71439
71587
|
break;
|
|
71440
71588
|
case 13:
|
|
71441
71589
|
throw new Error('Error saving record merge log');
|
|
71442
71590
|
case 14:
|
|
71443
|
-
|
|
71591
|
+
_context33.n = 16;
|
|
71444
71592
|
break;
|
|
71445
71593
|
case 15:
|
|
71446
|
-
|
|
71447
|
-
|
|
71594
|
+
_context33.p = 15;
|
|
71595
|
+
_t18 = _context33.v;
|
|
71448
71596
|
// do nothing here because we often will get here since some conditions lead to no DB updates possible
|
|
71449
|
-
LogError(
|
|
71597
|
+
LogError(_t18);
|
|
71450
71598
|
case 16:
|
|
71451
|
-
return
|
|
71599
|
+
return _context33.a(2);
|
|
71452
71600
|
}
|
|
71453
|
-
},
|
|
71601
|
+
}, _callee31, this, [[3, 10, 11, 12], [0, 15]]);
|
|
71454
71602
|
}));
|
|
71455
|
-
function CompleteMergeLogging(
|
|
71603
|
+
function CompleteMergeLogging(_x103, _x104, _x105) {
|
|
71456
71604
|
return _CompleteMergeLogging.apply(this, arguments);
|
|
71457
71605
|
}
|
|
71458
71606
|
return CompleteMergeLogging;
|