@azrico/webobject 1.4.188 → 1.4.189

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