@azrico/webobject 1.4.188 → 1.4.190
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.
|
@@ -70,6 +70,15 @@ export declare class WebObject extends SimpleObject {
|
|
|
70
70
|
canDelete(): boolean;
|
|
71
71
|
canArchive(): boolean;
|
|
72
72
|
deltaIsValid(d: any): true | string;
|
|
73
|
+
/**
|
|
74
|
+
* converts this object to an basic object
|
|
75
|
+
* that can be passed into client components from server components
|
|
76
|
+
*
|
|
77
|
+
* uses `get_fullDeltaObject`
|
|
78
|
+
* @param p
|
|
79
|
+
* @returns
|
|
80
|
+
*/
|
|
81
|
+
get_basicObject(): Promise<Partial<this>>;
|
|
73
82
|
/**
|
|
74
83
|
* calls the `get_deltaObject` with `allProperties=true` `extraProperties=true`
|
|
75
84
|
*
|
|
@@ -116,5 +125,11 @@ export declare class WebObject extends SimpleObject {
|
|
|
116
125
|
* default order of parameters : search,readonly,fetchID
|
|
117
126
|
*/
|
|
118
127
|
static get_list(...p: any[]): Promise<WebObject[]>;
|
|
128
|
+
/**
|
|
129
|
+
* Get a list of web objects and convert them to basic objects
|
|
130
|
+
* can be passed to client components
|
|
131
|
+
* default order of parameters : search,readonly,fetchID
|
|
132
|
+
*/
|
|
133
|
+
static get_basicList(...p: any[]): Promise<Partial<WebObject>[]>;
|
|
119
134
|
}
|
|
120
135
|
export default WebObject;
|
|
@@ -11,10 +11,10 @@ var _global = require("@azrico/global");
|
|
|
11
11
|
var _convert = _interopRequireDefault(require("@azrico/convert"));
|
|
12
12
|
var _WebObjectPathHelper = _interopRequireDefault(require("./WebObjectPathHelper"));
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
14
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
16
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
16
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
18
18
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
19
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
20
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -464,31 +464,78 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
464
464
|
value: function deltaIsValid(d) {
|
|
465
465
|
return true;
|
|
466
466
|
}
|
|
467
|
+
/* -------------------------------------------------------------------------- */
|
|
468
|
+
/* get delta */
|
|
469
|
+
/* -------------------------------------------------------------------------- */
|
|
467
470
|
/**
|
|
468
|
-
*
|
|
471
|
+
* converts this object to an basic object
|
|
472
|
+
* that can be passed into client components from server components
|
|
469
473
|
*
|
|
470
|
-
*
|
|
474
|
+
* uses `get_fullDeltaObject`
|
|
475
|
+
* @param p
|
|
471
476
|
* @returns
|
|
472
477
|
*/
|
|
473
478
|
}, {
|
|
474
|
-
key: "
|
|
479
|
+
key: "get_basicObject",
|
|
475
480
|
value: (function () {
|
|
476
|
-
var
|
|
481
|
+
var _get_basicObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
482
|
+
var fulldelta, key, element;
|
|
477
483
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
478
484
|
while (1) switch (_context8.prev = _context8.next) {
|
|
479
485
|
case 0:
|
|
480
486
|
_context8.next = 2;
|
|
487
|
+
return this.get_fullDeltaObject();
|
|
488
|
+
case 2:
|
|
489
|
+
fulldelta = _context8.sent;
|
|
490
|
+
for (key in fulldelta) {
|
|
491
|
+
element = fulldelta[key];
|
|
492
|
+
/* --------------------------- check for id fields -------------------------- */
|
|
493
|
+
if (element != null && _typeof(element) === "object") {
|
|
494
|
+
if ((key === "id" || key.endsWith("_id")) && typeof element.toString === "function") {
|
|
495
|
+
fulldelta[key] = String(element);
|
|
496
|
+
} else {
|
|
497
|
+
fulldelta[key] = JSON.parse(JSON.stringify(element));
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
return _context8.abrupt("return", fulldelta);
|
|
502
|
+
case 5:
|
|
503
|
+
case "end":
|
|
504
|
+
return _context8.stop();
|
|
505
|
+
}
|
|
506
|
+
}, _callee8, this);
|
|
507
|
+
}));
|
|
508
|
+
function get_basicObject() {
|
|
509
|
+
return _get_basicObject.apply(this, arguments);
|
|
510
|
+
}
|
|
511
|
+
return get_basicObject;
|
|
512
|
+
}()
|
|
513
|
+
/**
|
|
514
|
+
* calls the `get_deltaObject` with `allProperties=true` `extraProperties=true`
|
|
515
|
+
*
|
|
516
|
+
* useful in server applications
|
|
517
|
+
* @returns
|
|
518
|
+
*/
|
|
519
|
+
)
|
|
520
|
+
}, {
|
|
521
|
+
key: "get_fullDeltaObject",
|
|
522
|
+
value: (function () {
|
|
523
|
+
var _get_fullDeltaObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(p) {
|
|
524
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
525
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
526
|
+
case 0:
|
|
527
|
+
_context9.next = 2;
|
|
481
528
|
return this.get_deltaObject({
|
|
482
529
|
allProperties: true,
|
|
483
530
|
extraProperties: true
|
|
484
531
|
});
|
|
485
532
|
case 2:
|
|
486
|
-
return
|
|
533
|
+
return _context9.abrupt("return", _context9.sent);
|
|
487
534
|
case 3:
|
|
488
535
|
case "end":
|
|
489
|
-
return
|
|
536
|
+
return _context9.stop();
|
|
490
537
|
}
|
|
491
|
-
},
|
|
538
|
+
}, _callee9, this);
|
|
492
539
|
}));
|
|
493
540
|
function get_fullDeltaObject(_x3) {
|
|
494
541
|
return _get_fullDeltaObject.apply(this, arguments);
|
|
@@ -504,75 +551,75 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
504
551
|
}, {
|
|
505
552
|
key: "get_deltaObject",
|
|
506
553
|
value: (function () {
|
|
507
|
-
var _get_deltaObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
554
|
+
var _get_deltaObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(p) {
|
|
508
555
|
var _this2 = this;
|
|
509
556
|
var final_object, isChild, useDelta, allProperties, needId, chkChangables, useExtraProps, dlt, allkeys, changableKeys, functionProps, index, fp, parseObj, _parseObj, _iterator, _step, key, gotIndex, gotId, tempusers;
|
|
510
|
-
return _regeneratorRuntime().wrap(function
|
|
511
|
-
while (1) switch (
|
|
557
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
558
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
512
559
|
case 0:
|
|
513
560
|
_parseObj = function _parseObj3() {
|
|
514
|
-
_parseObj = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
561
|
+
_parseObj = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(obj) {
|
|
515
562
|
var newobj_dlt;
|
|
516
|
-
return _regeneratorRuntime().wrap(function
|
|
517
|
-
while (1) switch (
|
|
563
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
564
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
518
565
|
case 0:
|
|
519
566
|
if (!(obj == null)) {
|
|
520
|
-
|
|
567
|
+
_context11.next = 2;
|
|
521
568
|
break;
|
|
522
569
|
}
|
|
523
|
-
return
|
|
570
|
+
return _context11.abrupt("return", undefined);
|
|
524
571
|
case 2:
|
|
525
572
|
if (!Array.isArray(obj)) {
|
|
526
|
-
|
|
573
|
+
_context11.next = 6;
|
|
527
574
|
break;
|
|
528
575
|
}
|
|
529
|
-
|
|
576
|
+
_context11.next = 5;
|
|
530
577
|
return Promise.all(obj.map( /*#__PURE__*/function () {
|
|
531
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
532
|
-
return _regeneratorRuntime().wrap(function
|
|
533
|
-
while (1) switch (
|
|
578
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(r) {
|
|
579
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
580
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
534
581
|
case 0:
|
|
535
|
-
|
|
582
|
+
_context10.next = 2;
|
|
536
583
|
return parseObj(r);
|
|
537
584
|
case 2:
|
|
538
|
-
return
|
|
585
|
+
return _context10.abrupt("return", _context10.sent);
|
|
539
586
|
case 3:
|
|
540
587
|
case "end":
|
|
541
|
-
return
|
|
588
|
+
return _context10.stop();
|
|
542
589
|
}
|
|
543
|
-
},
|
|
590
|
+
}, _callee10);
|
|
544
591
|
}));
|
|
545
592
|
return function (_x6) {
|
|
546
593
|
return _ref.apply(this, arguments);
|
|
547
594
|
};
|
|
548
595
|
}()));
|
|
549
596
|
case 5:
|
|
550
|
-
return
|
|
597
|
+
return _context11.abrupt("return", _context11.sent);
|
|
551
598
|
case 6:
|
|
552
599
|
if (!(obj instanceof WebObject && typeof obj.get_deltaObject === "function")) {
|
|
553
|
-
|
|
600
|
+
_context11.next = 15;
|
|
554
601
|
break;
|
|
555
602
|
}
|
|
556
|
-
|
|
603
|
+
_context11.next = 9;
|
|
557
604
|
return obj.get_deltaObject(_objectSpread(_objectSpread({}, p), {}, {
|
|
558
605
|
isChild: true
|
|
559
606
|
}));
|
|
560
607
|
case 9:
|
|
561
|
-
newobj_dlt =
|
|
608
|
+
newobj_dlt = _context11.sent;
|
|
562
609
|
if ((0, _object.object_isEmpty)(newobj_dlt)) {
|
|
563
|
-
|
|
610
|
+
_context11.next = 14;
|
|
564
611
|
break;
|
|
565
612
|
}
|
|
566
|
-
return
|
|
613
|
+
return _context11.abrupt("return", newobj_dlt);
|
|
567
614
|
case 14:
|
|
568
|
-
return
|
|
615
|
+
return _context11.abrupt("return", obj);
|
|
569
616
|
case 15:
|
|
570
|
-
return
|
|
617
|
+
return _context11.abrupt("return", obj);
|
|
571
618
|
case 16:
|
|
572
619
|
case "end":
|
|
573
|
-
return
|
|
620
|
+
return _context11.stop();
|
|
574
621
|
}
|
|
575
|
-
},
|
|
622
|
+
}, _callee11);
|
|
576
623
|
}));
|
|
577
624
|
return _parseObj.apply(this, arguments);
|
|
578
625
|
};
|
|
@@ -595,11 +642,12 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
595
642
|
ignoreProtected: allProperties
|
|
596
643
|
});
|
|
597
644
|
}) : allkeys;
|
|
598
|
-
|
|
645
|
+
_context12.next = 15;
|
|
599
646
|
return _convert["default"].applyFormats({
|
|
600
647
|
inputobject: dlt,
|
|
601
648
|
formats: (0, _object.object_getStatic)(this, "__formatList"),
|
|
602
|
-
changableKeys: changableKeys
|
|
649
|
+
changableKeys: changableKeys,
|
|
650
|
+
applyDefaults: true
|
|
603
651
|
});
|
|
604
652
|
case 15:
|
|
605
653
|
/* -------------------------------------------------------------------------- */
|
|
@@ -616,32 +664,32 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
616
664
|
/* parse all changableKeys */
|
|
617
665
|
/* -------------------------------------------------------------------------- */
|
|
618
666
|
_iterator = _createForOfIteratorHelper(changableKeys);
|
|
619
|
-
|
|
667
|
+
_context12.prev = 18;
|
|
620
668
|
_iterator.s();
|
|
621
669
|
case 20:
|
|
622
670
|
if ((_step = _iterator.n()).done) {
|
|
623
|
-
|
|
671
|
+
_context12.next = 27;
|
|
624
672
|
break;
|
|
625
673
|
}
|
|
626
674
|
key = _step.value;
|
|
627
|
-
|
|
675
|
+
_context12.next = 24;
|
|
628
676
|
return parseObj(dlt[key]);
|
|
629
677
|
case 24:
|
|
630
|
-
final_object[key] =
|
|
678
|
+
final_object[key] = _context12.sent;
|
|
631
679
|
case 25:
|
|
632
|
-
|
|
680
|
+
_context12.next = 20;
|
|
633
681
|
break;
|
|
634
682
|
case 27:
|
|
635
|
-
|
|
683
|
+
_context12.next = 32;
|
|
636
684
|
break;
|
|
637
685
|
case 29:
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
_iterator.e(
|
|
686
|
+
_context12.prev = 29;
|
|
687
|
+
_context12.t0 = _context12["catch"](18);
|
|
688
|
+
_iterator.e(_context12.t0);
|
|
641
689
|
case 32:
|
|
642
|
-
|
|
690
|
+
_context12.prev = 32;
|
|
643
691
|
_iterator.f();
|
|
644
|
-
return
|
|
692
|
+
return _context12.finish(32);
|
|
645
693
|
case 35:
|
|
646
694
|
/* -------------------- add acrhived and date properties -------------------- */
|
|
647
695
|
if (allProperties) {
|
|
@@ -667,12 +715,12 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
667
715
|
});
|
|
668
716
|
final_object["_users"] = (0, _object.wrap_array)(tempusers);
|
|
669
717
|
}
|
|
670
|
-
return
|
|
718
|
+
return _context12.abrupt("return", final_object);
|
|
671
719
|
case 39:
|
|
672
720
|
case "end":
|
|
673
|
-
return
|
|
721
|
+
return _context12.stop();
|
|
674
722
|
}
|
|
675
|
-
},
|
|
723
|
+
}, _callee12, this, [[18, 29, 32, 35]]);
|
|
676
724
|
}));
|
|
677
725
|
function get_deltaObject(_x4) {
|
|
678
726
|
return _get_deltaObject.apply(this, arguments);
|
|
@@ -697,28 +745,28 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
697
745
|
}, {
|
|
698
746
|
key: "onDelete",
|
|
699
747
|
value: ( /* -------------------------------------------------------------------------- */function () {
|
|
700
|
-
var _onDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
748
|
+
var _onDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
701
749
|
var _this$manager;
|
|
702
750
|
var _len,
|
|
703
751
|
p,
|
|
704
752
|
_key,
|
|
705
|
-
|
|
706
|
-
return _regeneratorRuntime().wrap(function
|
|
707
|
-
while (1) switch (
|
|
753
|
+
_args13 = arguments;
|
|
754
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
755
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
708
756
|
case 0:
|
|
709
757
|
if (this.isSaved) this.isDeleted = true;
|
|
710
|
-
for (_len =
|
|
711
|
-
p[_key] =
|
|
758
|
+
for (_len = _args13.length, p = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
759
|
+
p[_key] = _args13[_key];
|
|
712
760
|
}
|
|
713
|
-
|
|
761
|
+
_context13.next = 4;
|
|
714
762
|
return (_this$manager = this.manager) === null || _this$manager === void 0 ? void 0 : _this$manager.onDelete.apply(_this$manager, p);
|
|
715
763
|
case 4:
|
|
716
|
-
return
|
|
764
|
+
return _context13.abrupt("return", _context13.sent);
|
|
717
765
|
case 5:
|
|
718
766
|
case "end":
|
|
719
|
-
return
|
|
767
|
+
return _context13.stop();
|
|
720
768
|
}
|
|
721
|
-
},
|
|
769
|
+
}, _callee13, this);
|
|
722
770
|
}));
|
|
723
771
|
function onDelete() {
|
|
724
772
|
return _onDelete.apply(this, arguments);
|
|
@@ -728,28 +776,28 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
728
776
|
}, {
|
|
729
777
|
key: "onArchive",
|
|
730
778
|
value: function () {
|
|
731
|
-
var _onArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
779
|
+
var _onArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
|
|
732
780
|
var _this$manager2;
|
|
733
781
|
var _len2,
|
|
734
782
|
p,
|
|
735
783
|
_key2,
|
|
736
|
-
|
|
737
|
-
return _regeneratorRuntime().wrap(function
|
|
738
|
-
while (1) switch (
|
|
784
|
+
_args14 = arguments;
|
|
785
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
786
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
739
787
|
case 0:
|
|
740
788
|
if (this.isSaved) this.isArchived = true;
|
|
741
|
-
for (_len2 =
|
|
742
|
-
p[_key2] =
|
|
789
|
+
for (_len2 = _args14.length, p = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
790
|
+
p[_key2] = _args14[_key2];
|
|
743
791
|
}
|
|
744
|
-
|
|
792
|
+
_context14.next = 4;
|
|
745
793
|
return (_this$manager2 = this.manager) === null || _this$manager2 === void 0 ? void 0 : _this$manager2.onArchive.apply(_this$manager2, p);
|
|
746
794
|
case 4:
|
|
747
|
-
return
|
|
795
|
+
return _context14.abrupt("return", _context14.sent);
|
|
748
796
|
case 5:
|
|
749
797
|
case "end":
|
|
750
|
-
return
|
|
798
|
+
return _context14.stop();
|
|
751
799
|
}
|
|
752
|
-
},
|
|
800
|
+
}, _callee14, this);
|
|
753
801
|
}));
|
|
754
802
|
function onArchive() {
|
|
755
803
|
return _onArchive.apply(this, arguments);
|
|
@@ -759,28 +807,28 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
759
807
|
}, {
|
|
760
808
|
key: "onUnArchive",
|
|
761
809
|
value: function () {
|
|
762
|
-
var _onUnArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
810
|
+
var _onUnArchive = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
763
811
|
var _this$manager3;
|
|
764
812
|
var _len3,
|
|
765
813
|
p,
|
|
766
814
|
_key3,
|
|
767
|
-
|
|
768
|
-
return _regeneratorRuntime().wrap(function
|
|
769
|
-
while (1) switch (
|
|
815
|
+
_args15 = arguments;
|
|
816
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
817
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
770
818
|
case 0:
|
|
771
819
|
if (this.isSaved) this.isArchived = false;
|
|
772
|
-
for (_len3 =
|
|
773
|
-
p[_key3] =
|
|
820
|
+
for (_len3 = _args15.length, p = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
821
|
+
p[_key3] = _args15[_key3];
|
|
774
822
|
}
|
|
775
|
-
|
|
823
|
+
_context15.next = 4;
|
|
776
824
|
return (_this$manager3 = this.manager) === null || _this$manager3 === void 0 ? void 0 : _this$manager3.onUnArchive.apply(_this$manager3, p);
|
|
777
825
|
case 4:
|
|
778
|
-
return
|
|
826
|
+
return _context15.abrupt("return", _context15.sent);
|
|
779
827
|
case 5:
|
|
780
828
|
case "end":
|
|
781
|
-
return
|
|
829
|
+
return _context15.stop();
|
|
782
830
|
}
|
|
783
|
-
},
|
|
831
|
+
}, _callee15, this);
|
|
784
832
|
}));
|
|
785
833
|
function onUnArchive() {
|
|
786
834
|
return _onUnArchive.apply(this, arguments);
|
|
@@ -790,28 +838,28 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
790
838
|
}, {
|
|
791
839
|
key: "onLock",
|
|
792
840
|
value: function () {
|
|
793
|
-
var _onLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
841
|
+
var _onLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
794
842
|
var _this$manager4;
|
|
795
843
|
var _len4,
|
|
796
844
|
p,
|
|
797
845
|
_key4,
|
|
798
|
-
|
|
799
|
-
return _regeneratorRuntime().wrap(function
|
|
800
|
-
while (1) switch (
|
|
846
|
+
_args16 = arguments;
|
|
847
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
848
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
801
849
|
case 0:
|
|
802
850
|
if (this.isSaved) this.isLocked = true;
|
|
803
|
-
for (_len4 =
|
|
804
|
-
p[_key4] =
|
|
851
|
+
for (_len4 = _args16.length, p = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
852
|
+
p[_key4] = _args16[_key4];
|
|
805
853
|
}
|
|
806
|
-
|
|
854
|
+
_context16.next = 4;
|
|
807
855
|
return (_this$manager4 = this.manager) === null || _this$manager4 === void 0 ? void 0 : _this$manager4.onLock.apply(_this$manager4, p);
|
|
808
856
|
case 4:
|
|
809
|
-
return
|
|
857
|
+
return _context16.abrupt("return", _context16.sent);
|
|
810
858
|
case 5:
|
|
811
859
|
case "end":
|
|
812
|
-
return
|
|
860
|
+
return _context16.stop();
|
|
813
861
|
}
|
|
814
|
-
},
|
|
862
|
+
}, _callee16, this);
|
|
815
863
|
}));
|
|
816
864
|
function onLock() {
|
|
817
865
|
return _onLock.apply(this, arguments);
|
|
@@ -821,28 +869,28 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
821
869
|
}, {
|
|
822
870
|
key: "onUnLock",
|
|
823
871
|
value: function () {
|
|
824
|
-
var _onUnLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
872
|
+
var _onUnLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
|
|
825
873
|
var _this$manager5;
|
|
826
874
|
var _len5,
|
|
827
875
|
p,
|
|
828
876
|
_key5,
|
|
829
|
-
|
|
830
|
-
return _regeneratorRuntime().wrap(function
|
|
831
|
-
while (1) switch (
|
|
877
|
+
_args17 = arguments;
|
|
878
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
879
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
832
880
|
case 0:
|
|
833
881
|
if (this.isSaved) this.isLocked = false;
|
|
834
|
-
for (_len5 =
|
|
835
|
-
p[_key5] =
|
|
882
|
+
for (_len5 = _args17.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
883
|
+
p[_key5] = _args17[_key5];
|
|
836
884
|
}
|
|
837
|
-
|
|
885
|
+
_context17.next = 4;
|
|
838
886
|
return (_this$manager5 = this.manager) === null || _this$manager5 === void 0 ? void 0 : _this$manager5.onUnLock.apply(_this$manager5, p);
|
|
839
887
|
case 4:
|
|
840
|
-
return
|
|
888
|
+
return _context17.abrupt("return", _context17.sent);
|
|
841
889
|
case 5:
|
|
842
890
|
case "end":
|
|
843
|
-
return
|
|
891
|
+
return _context17.stop();
|
|
844
892
|
}
|
|
845
|
-
},
|
|
893
|
+
}, _callee17, this);
|
|
846
894
|
}));
|
|
847
895
|
function onUnLock() {
|
|
848
896
|
return _onUnLock.apply(this, arguments);
|
|
@@ -852,28 +900,28 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
852
900
|
}, {
|
|
853
901
|
key: "onLoad",
|
|
854
902
|
value: function () {
|
|
855
|
-
var _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
903
|
+
var _onLoad = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
856
904
|
var _this$manager6;
|
|
857
905
|
var _len6,
|
|
858
906
|
p,
|
|
859
907
|
_key6,
|
|
860
|
-
|
|
861
|
-
return _regeneratorRuntime().wrap(function
|
|
862
|
-
while (1) switch (
|
|
908
|
+
_args18 = arguments;
|
|
909
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
910
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
863
911
|
case 0:
|
|
864
912
|
this.isDeleted = false;
|
|
865
|
-
for (_len6 =
|
|
866
|
-
p[_key6] =
|
|
913
|
+
for (_len6 = _args18.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
914
|
+
p[_key6] = _args18[_key6];
|
|
867
915
|
}
|
|
868
|
-
|
|
916
|
+
_context18.next = 4;
|
|
869
917
|
return (_this$manager6 = this.manager) === null || _this$manager6 === void 0 ? void 0 : _this$manager6.onLoad.apply(_this$manager6, p);
|
|
870
918
|
case 4:
|
|
871
|
-
return
|
|
919
|
+
return _context18.abrupt("return", _context18.sent);
|
|
872
920
|
case 5:
|
|
873
921
|
case "end":
|
|
874
|
-
return
|
|
922
|
+
return _context18.stop();
|
|
875
923
|
}
|
|
876
|
-
},
|
|
924
|
+
}, _callee18, this);
|
|
877
925
|
}));
|
|
878
926
|
function onLoad() {
|
|
879
927
|
return _onLoad.apply(this, arguments);
|
|
@@ -883,47 +931,47 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
883
931
|
}, {
|
|
884
932
|
key: "onSave",
|
|
885
933
|
value: function () {
|
|
886
|
-
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
934
|
+
var _onSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
|
|
887
935
|
var _this$manager8;
|
|
888
936
|
var srObject,
|
|
889
937
|
_this$manager7,
|
|
890
938
|
_len7,
|
|
891
939
|
p,
|
|
892
940
|
_key7,
|
|
893
|
-
|
|
894
|
-
return _regeneratorRuntime().wrap(function
|
|
895
|
-
while (1) switch (
|
|
941
|
+
_args19 = arguments;
|
|
942
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
943
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
896
944
|
case 0:
|
|
897
945
|
if (!this.isSaved) {
|
|
898
|
-
|
|
946
|
+
_context19.next = 7;
|
|
899
947
|
break;
|
|
900
948
|
}
|
|
901
949
|
this.apply_changes();
|
|
902
950
|
srObject = this.getSaveResult(true);
|
|
903
951
|
if (!this.saveResultHasID(srObject)) {
|
|
904
|
-
|
|
952
|
+
_context19.next = 7;
|
|
905
953
|
break;
|
|
906
954
|
}
|
|
907
955
|
/* -------------------------------------------------------------------------- */
|
|
908
956
|
WebObject.LoadIdsFromSaveResult(this, srObject);
|
|
909
|
-
|
|
957
|
+
_context19.next = 7;
|
|
910
958
|
return (_this$manager7 = this.manager) === null || _this$manager7 === void 0 ? void 0 : _this$manager7.event_run("on_id_change");
|
|
911
959
|
case 7:
|
|
912
|
-
for (_len7 =
|
|
913
|
-
p[_key7] =
|
|
960
|
+
for (_len7 = _args19.length, p = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
961
|
+
p[_key7] = _args19[_key7];
|
|
914
962
|
}
|
|
915
|
-
|
|
963
|
+
_context19.next = 10;
|
|
916
964
|
return (_this$manager8 = this.manager) === null || _this$manager8 === void 0 ? void 0 : _this$manager8.onSave.apply(_this$manager8, p);
|
|
917
965
|
case 10:
|
|
918
|
-
|
|
966
|
+
_context19.next = 12;
|
|
919
967
|
return this.onAfterSave();
|
|
920
968
|
case 12:
|
|
921
|
-
return
|
|
969
|
+
return _context19.abrupt("return", true);
|
|
922
970
|
case 13:
|
|
923
971
|
case "end":
|
|
924
|
-
return
|
|
972
|
+
return _context19.stop();
|
|
925
973
|
}
|
|
926
|
-
},
|
|
974
|
+
}, _callee19, this);
|
|
927
975
|
}));
|
|
928
976
|
function onSave() {
|
|
929
977
|
return _onSave.apply(this, arguments);
|
|
@@ -933,27 +981,27 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
933
981
|
}, {
|
|
934
982
|
key: "onAfterSave",
|
|
935
983
|
value: function () {
|
|
936
|
-
var _onAfterSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
984
|
+
var _onAfterSave = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
937
985
|
var _this$manager9;
|
|
938
986
|
var _len8,
|
|
939
987
|
p,
|
|
940
988
|
_key8,
|
|
941
|
-
|
|
942
|
-
return _regeneratorRuntime().wrap(function
|
|
943
|
-
while (1) switch (
|
|
989
|
+
_args20 = arguments;
|
|
990
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
991
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
944
992
|
case 0:
|
|
945
|
-
for (_len8 =
|
|
946
|
-
p[_key8] =
|
|
993
|
+
for (_len8 = _args20.length, p = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
|
994
|
+
p[_key8] = _args20[_key8];
|
|
947
995
|
}
|
|
948
|
-
|
|
996
|
+
_context20.next = 3;
|
|
949
997
|
return (_this$manager9 = this.manager) === null || _this$manager9 === void 0 ? void 0 : _this$manager9.onAfterSave.apply(_this$manager9, p);
|
|
950
998
|
case 3:
|
|
951
|
-
return
|
|
999
|
+
return _context20.abrupt("return", true);
|
|
952
1000
|
case 4:
|
|
953
1001
|
case "end":
|
|
954
|
-
return
|
|
1002
|
+
return _context20.stop();
|
|
955
1003
|
}
|
|
956
|
-
},
|
|
1004
|
+
}, _callee20, this);
|
|
957
1005
|
}));
|
|
958
1006
|
function onAfterSave() {
|
|
959
1007
|
return _onAfterSave.apply(this, arguments);
|
|
@@ -978,27 +1026,27 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
978
1026
|
}, {
|
|
979
1027
|
key: "onNew",
|
|
980
1028
|
value: function () {
|
|
981
|
-
var _onNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1029
|
+
var _onNew = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
982
1030
|
var _this$manager10;
|
|
983
1031
|
var _len9,
|
|
984
1032
|
p,
|
|
985
1033
|
_key9,
|
|
986
|
-
|
|
987
|
-
return _regeneratorRuntime().wrap(function
|
|
988
|
-
while (1) switch (
|
|
1034
|
+
_args21 = arguments;
|
|
1035
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
1036
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
989
1037
|
case 0:
|
|
990
|
-
for (_len9 =
|
|
991
|
-
p[_key9] =
|
|
1038
|
+
for (_len9 = _args21.length, p = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
|
1039
|
+
p[_key9] = _args21[_key9];
|
|
992
1040
|
}
|
|
993
|
-
|
|
1041
|
+
_context21.next = 3;
|
|
994
1042
|
return (_this$manager10 = this.manager) === null || _this$manager10 === void 0 ? void 0 : _this$manager10.onNew.apply(_this$manager10, p);
|
|
995
1043
|
case 3:
|
|
996
|
-
return
|
|
1044
|
+
return _context21.abrupt("return", _context21.sent);
|
|
997
1045
|
case 4:
|
|
998
1046
|
case "end":
|
|
999
|
-
return
|
|
1047
|
+
return _context21.stop();
|
|
1000
1048
|
}
|
|
1001
|
-
},
|
|
1049
|
+
}, _callee21, this);
|
|
1002
1050
|
}));
|
|
1003
1051
|
function onNew() {
|
|
1004
1052
|
return _onNew.apply(this, arguments);
|
|
@@ -1054,7 +1102,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1054
1102
|
}, {
|
|
1055
1103
|
key: "saveList",
|
|
1056
1104
|
value: function () {
|
|
1057
|
-
var _saveList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1105
|
+
var _saveList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(itemList) {
|
|
1058
1106
|
var _extraOptions$chunksi;
|
|
1059
1107
|
var extraOptions,
|
|
1060
1108
|
chunks,
|
|
@@ -1071,11 +1119,11 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1071
1119
|
_item,
|
|
1072
1120
|
_index2,
|
|
1073
1121
|
_item2,
|
|
1074
|
-
|
|
1075
|
-
return _regeneratorRuntime().wrap(function
|
|
1076
|
-
while (1) switch (
|
|
1122
|
+
_args22 = arguments;
|
|
1123
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
1124
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
1077
1125
|
case 0:
|
|
1078
|
-
extraOptions =
|
|
1126
|
+
extraOptions = _args22.length > 1 && _args22[1] !== undefined ? _args22[1] : {};
|
|
1079
1127
|
if (!extraOptions) extraOptions = {};
|
|
1080
1128
|
chunks = (0, _object.array_chunks)(itemList, (_extraOptions$chunksi = extraOptions.chunksize) !== null && _extraOptions$chunksi !== void 0 ? _extraOptions$chunksi : 50);
|
|
1081
1129
|
delete extraOptions.chunksize;
|
|
@@ -1083,7 +1131,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1083
1131
|
index = 0;
|
|
1084
1132
|
case 6:
|
|
1085
1133
|
if (!(index < chunks.length)) {
|
|
1086
|
-
|
|
1134
|
+
_context22.next = 36;
|
|
1087
1135
|
break;
|
|
1088
1136
|
}
|
|
1089
1137
|
items_to_save = chunks[index];
|
|
@@ -1091,81 +1139,81 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1091
1139
|
k = 0;
|
|
1092
1140
|
case 10:
|
|
1093
1141
|
if (!(k < items_to_save.length)) {
|
|
1094
|
-
|
|
1142
|
+
_context22.next = 19;
|
|
1095
1143
|
break;
|
|
1096
1144
|
}
|
|
1097
1145
|
item = items_to_save[k];
|
|
1098
|
-
|
|
1146
|
+
_context22.next = 14;
|
|
1099
1147
|
return item.get_deltaObject();
|
|
1100
1148
|
case 14:
|
|
1101
|
-
dlt =
|
|
1149
|
+
dlt = _context22.sent;
|
|
1102
1150
|
save_array.push(item.isNew ? _objectSpread({}, dlt) : _objectSpread({
|
|
1103
1151
|
_id: item.getID()
|
|
1104
1152
|
}, dlt));
|
|
1105
1153
|
case 16:
|
|
1106
1154
|
k++;
|
|
1107
|
-
|
|
1155
|
+
_context22.next = 10;
|
|
1108
1156
|
break;
|
|
1109
1157
|
case 19:
|
|
1110
|
-
|
|
1158
|
+
_context22.next = 21;
|
|
1111
1159
|
return _global.gfunc.run_action("post", putAddress, _objectSpread({
|
|
1112
1160
|
__save_list: WebObject.zipSaveList(save_array)
|
|
1113
1161
|
}, extraOptions));
|
|
1114
1162
|
case 21:
|
|
1115
|
-
resultObject =
|
|
1163
|
+
resultObject = _context22.sent;
|
|
1116
1164
|
if (!Array.isArray(resultObject)) {
|
|
1117
|
-
|
|
1165
|
+
_context22.next = 33;
|
|
1118
1166
|
break;
|
|
1119
1167
|
}
|
|
1120
1168
|
_index = 0;
|
|
1121
1169
|
case 24:
|
|
1122
1170
|
if (!(_index < Math.min(resultObject.length, items_to_save.length))) {
|
|
1123
|
-
|
|
1171
|
+
_context22.next = 33;
|
|
1124
1172
|
break;
|
|
1125
1173
|
}
|
|
1126
1174
|
res = resultObject[_index];
|
|
1127
1175
|
_item = items_to_save[_index];
|
|
1128
1176
|
_item.setSaveResult(res);
|
|
1129
|
-
|
|
1177
|
+
_context22.next = 30;
|
|
1130
1178
|
return _item.onSave();
|
|
1131
1179
|
case 30:
|
|
1132
1180
|
_index++;
|
|
1133
|
-
|
|
1181
|
+
_context22.next = 24;
|
|
1134
1182
|
break;
|
|
1135
1183
|
case 33:
|
|
1136
1184
|
index++;
|
|
1137
|
-
|
|
1185
|
+
_context22.next = 6;
|
|
1138
1186
|
break;
|
|
1139
1187
|
case 36:
|
|
1140
1188
|
_index2 = 0;
|
|
1141
1189
|
case 37:
|
|
1142
1190
|
if (!(_index2 < itemList.length)) {
|
|
1143
|
-
|
|
1191
|
+
_context22.next = 46;
|
|
1144
1192
|
break;
|
|
1145
1193
|
}
|
|
1146
1194
|
_item2 = itemList[_index2];
|
|
1147
1195
|
if (_item2.isSaved) {
|
|
1148
|
-
|
|
1196
|
+
_context22.next = 41;
|
|
1149
1197
|
break;
|
|
1150
1198
|
}
|
|
1151
|
-
return
|
|
1199
|
+
return _context22.abrupt("return", false);
|
|
1152
1200
|
case 41:
|
|
1153
1201
|
if (!(_item2.getSaveResultType() != "normal")) {
|
|
1154
|
-
|
|
1202
|
+
_context22.next = 43;
|
|
1155
1203
|
break;
|
|
1156
1204
|
}
|
|
1157
|
-
return
|
|
1205
|
+
return _context22.abrupt("return", false);
|
|
1158
1206
|
case 43:
|
|
1159
1207
|
_index2++;
|
|
1160
|
-
|
|
1208
|
+
_context22.next = 37;
|
|
1161
1209
|
break;
|
|
1162
1210
|
case 46:
|
|
1163
|
-
return
|
|
1211
|
+
return _context22.abrupt("return", true);
|
|
1164
1212
|
case 47:
|
|
1165
1213
|
case "end":
|
|
1166
|
-
return
|
|
1214
|
+
return _context22.stop();
|
|
1167
1215
|
}
|
|
1168
|
-
},
|
|
1216
|
+
}, _callee22, this);
|
|
1169
1217
|
}));
|
|
1170
1218
|
function saveList(_x7) {
|
|
1171
1219
|
return _saveList.apply(this, arguments);
|
|
@@ -1215,7 +1263,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1215
1263
|
}, {
|
|
1216
1264
|
key: "get_single",
|
|
1217
1265
|
value: (function () {
|
|
1218
|
-
var _get_single = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1266
|
+
var _get_single = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
1219
1267
|
var _len10,
|
|
1220
1268
|
p,
|
|
1221
1269
|
_key10,
|
|
@@ -1224,54 +1272,54 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1224
1272
|
fetchID,
|
|
1225
1273
|
res,
|
|
1226
1274
|
params,
|
|
1227
|
-
|
|
1228
|
-
return _regeneratorRuntime().wrap(function
|
|
1229
|
-
while (1) switch (
|
|
1275
|
+
_args23 = arguments;
|
|
1276
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
1277
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
1230
1278
|
case 0:
|
|
1231
|
-
for (_len10 =
|
|
1232
|
-
p[_key10] =
|
|
1279
|
+
for (_len10 = _args23.length, p = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
|
1280
|
+
p[_key10] = _args23[_key10];
|
|
1233
1281
|
}
|
|
1234
1282
|
search = p.shift();
|
|
1235
1283
|
readonly = p.shift();
|
|
1236
1284
|
fetchID = p.shift();
|
|
1237
1285
|
if (!(0, _object.object_isEmpty)(search)) {
|
|
1238
|
-
|
|
1286
|
+
_context23.next = 6;
|
|
1239
1287
|
break;
|
|
1240
1288
|
}
|
|
1241
|
-
return
|
|
1289
|
+
return _context23.abrupt("return", undefined);
|
|
1242
1290
|
case 6:
|
|
1243
1291
|
params = {};
|
|
1244
1292
|
params.context = readonly ? "view" : "edit";
|
|
1245
|
-
|
|
1246
|
-
|
|
1293
|
+
_context23.t0 = _typeof(search);
|
|
1294
|
+
_context23.next = _context23.t0 === "string" ? 11 : _context23.t0 === "number" ? 11 : _context23.t0 === "object" ? 16 : 16;
|
|
1247
1295
|
break;
|
|
1248
1296
|
case 11:
|
|
1249
1297
|
search = String(search);
|
|
1250
|
-
|
|
1298
|
+
_context23.next = 14;
|
|
1251
1299
|
return _global.gfunc.run_action("get", this.__web_path + "/" + search, params, {
|
|
1252
1300
|
fetchID: fetchID
|
|
1253
1301
|
});
|
|
1254
1302
|
case 14:
|
|
1255
|
-
res =
|
|
1256
|
-
return
|
|
1303
|
+
res = _context23.sent;
|
|
1304
|
+
return _context23.abrupt("break", 20);
|
|
1257
1305
|
case 16:
|
|
1258
|
-
|
|
1306
|
+
_context23.next = 18;
|
|
1259
1307
|
return this.get_list(search, readonly, fetchID);
|
|
1260
1308
|
case 18:
|
|
1261
|
-
res =
|
|
1262
|
-
return
|
|
1309
|
+
res = _context23.sent;
|
|
1310
|
+
return _context23.abrupt("break", 20);
|
|
1263
1311
|
case 20:
|
|
1264
1312
|
if (res) res = (0, _object.array_first)(res);
|
|
1265
1313
|
if (!(0, _object.object_isEmpty)(res)) {
|
|
1266
1314
|
res = this.ensure(this, res);
|
|
1267
1315
|
WebObject.setReadonly(res, readonly);
|
|
1268
1316
|
}
|
|
1269
|
-
return
|
|
1317
|
+
return _context23.abrupt("return", res);
|
|
1270
1318
|
case 23:
|
|
1271
1319
|
case "end":
|
|
1272
|
-
return
|
|
1320
|
+
return _context23.stop();
|
|
1273
1321
|
}
|
|
1274
|
-
},
|
|
1322
|
+
}, _callee23, this);
|
|
1275
1323
|
}));
|
|
1276
1324
|
function get_single() {
|
|
1277
1325
|
return _get_single.apply(this, arguments);
|
|
@@ -1286,7 +1334,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1286
1334
|
}, {
|
|
1287
1335
|
key: "get_list",
|
|
1288
1336
|
value: (function () {
|
|
1289
|
-
var _get_list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1337
|
+
var _get_list = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
1290
1338
|
var _len11,
|
|
1291
1339
|
p,
|
|
1292
1340
|
_key11,
|
|
@@ -1296,42 +1344,94 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
1296
1344
|
usepath,
|
|
1297
1345
|
result_items,
|
|
1298
1346
|
res,
|
|
1299
|
-
|
|
1300
|
-
return _regeneratorRuntime().wrap(function
|
|
1301
|
-
while (1) switch (
|
|
1347
|
+
_args24 = arguments;
|
|
1348
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1349
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
1302
1350
|
case 0:
|
|
1303
|
-
for (_len11 =
|
|
1304
|
-
p[_key11] =
|
|
1351
|
+
for (_len11 = _args24.length, p = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
|
1352
|
+
p[_key11] = _args24[_key11];
|
|
1305
1353
|
}
|
|
1306
1354
|
search = p.shift();
|
|
1307
1355
|
readonly = p.shift();
|
|
1308
1356
|
fetchID = p.shift();
|
|
1309
1357
|
if (!search) search = {};
|
|
1310
|
-
|
|
1358
|
+
_context24.next = 7;
|
|
1311
1359
|
return _WebObjectPathHelper["default"].get_path(this, "get");
|
|
1312
1360
|
case 7:
|
|
1313
|
-
usepath =
|
|
1314
|
-
|
|
1361
|
+
usepath = _context24.sent;
|
|
1362
|
+
_context24.next = 10;
|
|
1315
1363
|
return _global.gfunc.run_action("get", usepath, search, {
|
|
1316
1364
|
fetchID: fetchID
|
|
1317
1365
|
});
|
|
1318
1366
|
case 10:
|
|
1319
|
-
result_items =
|
|
1367
|
+
result_items = _context24.sent;
|
|
1320
1368
|
// const selftype = (this.constructor ||
|
|
1321
1369
|
// Object.getPrototypeOf(this)) as any;
|
|
1322
1370
|
res = WebObject.map_rowindex(WebObject.mapto(this, result_items, readonly));
|
|
1323
1371
|
WebObject.setReadonly(res, readonly);
|
|
1324
|
-
return
|
|
1372
|
+
return _context24.abrupt("return", res);
|
|
1325
1373
|
case 14:
|
|
1326
1374
|
case "end":
|
|
1327
|
-
return
|
|
1375
|
+
return _context24.stop();
|
|
1328
1376
|
}
|
|
1329
|
-
},
|
|
1377
|
+
}, _callee24, this);
|
|
1330
1378
|
}));
|
|
1331
1379
|
function get_list() {
|
|
1332
1380
|
return _get_list.apply(this, arguments);
|
|
1333
1381
|
}
|
|
1334
1382
|
return get_list;
|
|
1383
|
+
}()
|
|
1384
|
+
/**
|
|
1385
|
+
* Get a list of web objects and convert them to basic objects
|
|
1386
|
+
* can be passed to client components
|
|
1387
|
+
* default order of parameters : search,readonly,fetchID
|
|
1388
|
+
*/
|
|
1389
|
+
)
|
|
1390
|
+
}, {
|
|
1391
|
+
key: "get_basicList",
|
|
1392
|
+
value: (function () {
|
|
1393
|
+
var _get_basicList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
1394
|
+
var itemlist,
|
|
1395
|
+
_args26 = arguments;
|
|
1396
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
1397
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
1398
|
+
case 0:
|
|
1399
|
+
_context26.next = 2;
|
|
1400
|
+
return this.get_list.apply(this, _args26);
|
|
1401
|
+
case 2:
|
|
1402
|
+
itemlist = _context26.sent;
|
|
1403
|
+
_context26.next = 5;
|
|
1404
|
+
return Promise.all(itemlist.map( /*#__PURE__*/function () {
|
|
1405
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(r) {
|
|
1406
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1407
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
1408
|
+
case 0:
|
|
1409
|
+
_context25.next = 2;
|
|
1410
|
+
return r.get_basicObject();
|
|
1411
|
+
case 2:
|
|
1412
|
+
return _context25.abrupt("return", _context25.sent);
|
|
1413
|
+
case 3:
|
|
1414
|
+
case "end":
|
|
1415
|
+
return _context25.stop();
|
|
1416
|
+
}
|
|
1417
|
+
}, _callee25);
|
|
1418
|
+
}));
|
|
1419
|
+
return function (_x8) {
|
|
1420
|
+
return _ref2.apply(this, arguments);
|
|
1421
|
+
};
|
|
1422
|
+
}()));
|
|
1423
|
+
case 5:
|
|
1424
|
+
return _context26.abrupt("return", _context26.sent);
|
|
1425
|
+
case 6:
|
|
1426
|
+
case "end":
|
|
1427
|
+
return _context26.stop();
|
|
1428
|
+
}
|
|
1429
|
+
}, _callee26, this);
|
|
1430
|
+
}));
|
|
1431
|
+
function get_basicList() {
|
|
1432
|
+
return _get_basicList.apply(this, arguments);
|
|
1433
|
+
}
|
|
1434
|
+
return get_basicList;
|
|
1335
1435
|
}())
|
|
1336
1436
|
}]);
|
|
1337
1437
|
}(_index3.SimpleObject);
|
|
@@ -69,6 +69,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
69
69
|
_defineProperty(_this, "__saveResultObject", void 0);
|
|
70
70
|
_defineProperty(_this, "__saveResultIsSuccess", true);
|
|
71
71
|
_defineProperty(_this, "__saveResultType", void 0);
|
|
72
|
+
//id in the database
|
|
72
73
|
_defineProperty(_this, "_id", "");
|
|
73
74
|
//sequence key (usually managed by the database)
|
|
74
75
|
_defineProperty(_this, "_index_key", "");
|
|
@@ -827,7 +828,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
827
828
|
////for (const key in this.__delta) {
|
|
828
829
|
//// return true;
|
|
829
830
|
////}
|
|
830
|
-
////return false;
|
|
831
|
+
////return false;
|
|
831
832
|
}
|
|
832
833
|
/* --------------------- check the properties one by one -------------------- */
|
|
833
834
|
var orig = this.getOriginal();
|