@azrico/webobject 1.4.69 → 1.4.71

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.
@@ -38,11 +38,10 @@ export declare class WebObject extends SimpleObject {
38
38
  * Update meta value of this object , meta data is stored in meta_data variable
39
39
  * @param key
40
40
  * @param value
41
- * @param createIfNotExists should we create a new meta if key does not exist
42
41
  * @param sendChange
43
42
  * @returns
44
43
  */
45
- setMetaValue(key: string, value: any, sendChange?: sendChangesType): boolean;
44
+ setMetaValue(key: string, value: any, sendChange?: sendChangesType): Promise<boolean>;
46
45
  /**
47
46
  * Get meta value by key
48
47
  * @param key
@@ -15,10 +15,10 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
15
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); }
16
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
17
  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 new 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 new 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 new 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; }
18
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
19
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
20
18
  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; }
21
19
  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; }
20
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
21
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
22
22
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
23
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
24
24
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -34,7 +34,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
34
34
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
35
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
36
36
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
37
- var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_deltaObject, _onDelete, _onLoad, _onSave, _onAfterSave, _onNew, _saveList, _get_single, _get_list) {
37
+ var WebObject = /*#__PURE__*/function (_SimpleObject, _setMetaValue, _Save, _Delete, _get_deltaObject, _onDelete, _onLoad, _onSave, _onAfterSave, _onNew, _saveList, _get_single, _get_list) {
38
38
  _inherits(WebObject, _SimpleObject);
39
39
  var _super = _createSuper(WebObject);
40
40
  function WebObject() {
@@ -75,32 +75,78 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
75
75
  */
76
76
  }, {
77
77
  key: "setMetaValue",
78
- value: /* -------------------------------------------------------------------------- */
78
+ value:
79
+ /* -------------------------------------------------------------------------- */
79
80
  /* Meta data */
80
81
  /* -------------------------------------------------------------------------- */
81
82
  /**
82
83
  * Update meta value of this object , meta data is stored in meta_data variable
83
84
  * @param key
84
85
  * @param value
85
- * @param createIfNotExists should we create a new meta if key does not exist
86
86
  * @param sendChange
87
87
  * @returns
88
88
  */
89
- function setMetaValue(key, value) {
90
- var sendChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "auto";
91
- if (!this.canModify) {
92
- if (this.__throw_errors !== false) throw Error("Cant use setMetaValue on ".concat(key, " when on readonly mode"));else return false;
93
- }
94
- if (!key || typeof key != "string") {
95
- if (this.__throw_errors !== false) throw Error("Bad key at setMetaValue");else return false;
96
- }
97
- var old_value = WebObject.getMetaValue(this, key);
98
- if ((0, _object.object_equals)(old_value, value)) return false; //same value, no changes
99
- var new_metalist = _objectSpread({}, this.getValue("meta_data"));
100
- new_metalist[key] = value;
101
- this.setValue("meta_data", new_metalist);
102
- if (sendChange !== false) this.notifyChanged("meta", key, value);
103
- return true;
89
+ function setMetaValue(_x, _x2) {
90
+ return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, value) {
91
+ var sendChange,
92
+ old_value,
93
+ new_metalist,
94
+ _args = arguments;
95
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
96
+ while (1) switch (_context.prev = _context.next) {
97
+ case 0:
98
+ sendChange = _args.length > 2 && _args[2] !== undefined ? _args[2] : "auto";
99
+ if (this.canModify) {
100
+ _context.next = 7;
101
+ break;
102
+ }
103
+ if (!(this.__throw_errors !== false)) {
104
+ _context.next = 6;
105
+ break;
106
+ }
107
+ throw Error("Cant use setMetaValue on ".concat(key, " when on readonly mode"));
108
+ case 6:
109
+ return _context.abrupt("return", false);
110
+ case 7:
111
+ if (!(!key || typeof key != "string")) {
112
+ _context.next = 13;
113
+ break;
114
+ }
115
+ if (!(this.__throw_errors !== false)) {
116
+ _context.next = 12;
117
+ break;
118
+ }
119
+ throw Error("Bad key at setMetaValue");
120
+ case 12:
121
+ return _context.abrupt("return", false);
122
+ case 13:
123
+ old_value = WebObject.getMetaValue(this, key);
124
+ if (!(0, _object.object_equals)(old_value, value)) {
125
+ _context.next = 16;
126
+ break;
127
+ }
128
+ return _context.abrupt("return", false);
129
+ case 16:
130
+ //same value, no changes
131
+ new_metalist = _objectSpread({}, this.getValue("meta_data"));
132
+ new_metalist[key] = value;
133
+ _context.next = 20;
134
+ return this.setValue("meta_data", new_metalist);
135
+ case 20:
136
+ if (!(sendChange !== false)) {
137
+ _context.next = 23;
138
+ break;
139
+ }
140
+ _context.next = 23;
141
+ return this.notifyChanged("meta", key, value);
142
+ case 23:
143
+ return _context.abrupt("return", true);
144
+ case 24:
145
+ case "end":
146
+ return _context.stop();
147
+ }
148
+ }, _callee, this);
149
+ }))).apply(this, arguments);
104
150
  }
105
151
  /**
106
152
  * Get meta value by key
@@ -121,47 +167,47 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
121
167
  }, {
122
168
  key: "Save",
123
169
  value: function Save() {
124
- return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
125
- return _regeneratorRuntime().wrap(function _callee$(_context) {
126
- while (1) switch (_context.prev = _context.next) {
170
+ return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
171
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
172
+ while (1) switch (_context2.prev = _context2.next) {
127
173
  case 0:
128
174
  if (!(this.__throw_errors !== false)) {
129
- _context.next = 2;
175
+ _context2.next = 2;
130
176
  break;
131
177
  }
132
178
  throw new Error("Save not implented");
133
179
  case 2:
134
180
  WebObject.addError(this, "Save not implented", "NOSAVE", true);
135
181
  this.setSaveResult(false, "canceled");
136
- return _context.abrupt("return", false);
182
+ return _context2.abrupt("return", false);
137
183
  case 5:
138
184
  case "end":
139
- return _context.stop();
185
+ return _context2.stop();
140
186
  }
141
- }, _callee, this);
187
+ }, _callee2, this);
142
188
  }))).apply(this, arguments);
143
189
  }
144
190
  }, {
145
191
  key: "Delete",
146
192
  value: function Delete() {
147
- return (_Delete = _Delete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
148
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
149
- while (1) switch (_context2.prev = _context2.next) {
193
+ return (_Delete = _Delete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
194
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
195
+ while (1) switch (_context3.prev = _context3.next) {
150
196
  case 0:
151
197
  if (!(this.__throw_errors !== false)) {
152
- _context2.next = 2;
198
+ _context3.next = 2;
153
199
  break;
154
200
  }
155
201
  throw new Error("Delete not implented");
156
202
  case 2:
157
203
  WebObject.addError(this, "Delete not implented", "NOSAVE", true);
158
204
  this.setSaveResult(false, "canceled");
159
- return _context2.abrupt("return", false);
205
+ return _context3.abrupt("return", false);
160
206
  case 5:
161
207
  case "end":
162
- return _context2.stop();
208
+ return _context3.stop();
163
209
  }
164
- }, _callee2, this);
210
+ }, _callee3, this);
165
211
  }))).apply(this, arguments);
166
212
  } /* -------------------------------------------------------------------------- */
167
213
  }, {
@@ -183,75 +229,75 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
183
229
  */
184
230
  }, {
185
231
  key: "get_deltaObject",
186
- value: function get_deltaObject(_x) {
187
- return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(p) {
232
+ value: function get_deltaObject(_x3) {
233
+ return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(p) {
188
234
  var _this2 = this,
189
235
  _parseObj;
190
236
  var final_object, isChild, useDelta, allProperties, needId, chkChangables, useExtraProps, dlt, allkeys, changableKeys, functionProps, index, fp, parseObj, _iterator, _step, key, tempusers;
191
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
192
- while (1) switch (_context5.prev = _context5.next) {
237
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
238
+ while (1) switch (_context6.prev = _context6.next) {
193
239
  case 0:
194
- parseObj = function _parseObj2(_x2) {
195
- return (_parseObj = _parseObj || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(obj) {
240
+ parseObj = function _parseObj2(_x4) {
241
+ return (_parseObj = _parseObj || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(obj) {
196
242
  var _ref;
197
243
  var newobj_dlt;
198
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
199
- while (1) switch (_context4.prev = _context4.next) {
244
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
245
+ while (1) switch (_context5.prev = _context5.next) {
200
246
  case 0:
201
247
  if (!(obj == null)) {
202
- _context4.next = 2;
248
+ _context5.next = 2;
203
249
  break;
204
250
  }
205
- return _context4.abrupt("return", undefined);
251
+ return _context5.abrupt("return", undefined);
206
252
  case 2:
207
253
  if (!Array.isArray(obj)) {
208
- _context4.next = 6;
254
+ _context5.next = 6;
209
255
  break;
210
256
  }
211
- _context4.next = 5;
212
- return Promise.all(obj.map(function (_x3) {
213
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(r) {
214
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
215
- while (1) switch (_context3.prev = _context3.next) {
257
+ _context5.next = 5;
258
+ return Promise.all(obj.map(function (_x5) {
259
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(r) {
260
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
261
+ while (1) switch (_context4.prev = _context4.next) {
216
262
  case 0:
217
- _context3.next = 2;
263
+ _context4.next = 2;
218
264
  return parseObj(r);
219
265
  case 2:
220
- return _context3.abrupt("return", _context3.sent);
266
+ return _context4.abrupt("return", _context4.sent);
221
267
  case 3:
222
268
  case "end":
223
- return _context3.stop();
269
+ return _context4.stop();
224
270
  }
225
- }, _callee3);
271
+ }, _callee4);
226
272
  }))).apply(this, arguments);
227
273
  }));
228
274
  case 5:
229
- return _context4.abrupt("return", _context4.sent);
275
+ return _context5.abrupt("return", _context5.sent);
230
276
  case 6:
231
277
  if (!(obj instanceof WebObject && typeof obj.get_deltaObject === "function")) {
232
- _context4.next = 15;
278
+ _context5.next = 15;
233
279
  break;
234
280
  }
235
- _context4.next = 9;
281
+ _context5.next = 9;
236
282
  return obj.get_deltaObject(_objectSpread(_objectSpread({}, p), {}, {
237
283
  isChild: true
238
284
  }));
239
285
  case 9:
240
- newobj_dlt = _context4.sent;
286
+ newobj_dlt = _context5.sent;
241
287
  if ((0, _object.object_isEmpty)(newobj_dlt)) {
242
- _context4.next = 14;
288
+ _context5.next = 14;
243
289
  break;
244
290
  }
245
- return _context4.abrupt("return", newobj_dlt);
291
+ return _context5.abrupt("return", newobj_dlt);
246
292
  case 14:
247
- return _context4.abrupt("return", obj);
293
+ return _context5.abrupt("return", obj);
248
294
  case 15:
249
- return _context4.abrupt("return", obj);
295
+ return _context5.abrupt("return", obj);
250
296
  case 16:
251
297
  case "end":
252
- return _context4.stop();
298
+ return _context5.stop();
253
299
  }
254
- }, _callee4);
300
+ }, _callee5);
255
301
  }))).apply(this, arguments);
256
302
  };
257
303
  if (!p) p = {};
@@ -270,7 +316,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
270
316
  ignoreProtected: allProperties
271
317
  });
272
318
  }) : allkeys;
273
- _context5.next = 14;
319
+ _context6.next = 14;
274
320
  return _convert["default"].applyFormats({
275
321
  inputobject: dlt,
276
322
  formats: (0, _object.object_getStatic)(this, "__formatList"),
@@ -291,32 +337,32 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
291
337
  /* parse all changableKeys */
292
338
  /* -------------------------------------------------------------------------- */
293
339
  _iterator = _createForOfIteratorHelper(changableKeys);
294
- _context5.prev = 17;
340
+ _context6.prev = 17;
295
341
  _iterator.s();
296
342
  case 19:
297
343
  if ((_step = _iterator.n()).done) {
298
- _context5.next = 26;
344
+ _context6.next = 26;
299
345
  break;
300
346
  }
301
347
  key = _step.value;
302
- _context5.next = 23;
348
+ _context6.next = 23;
303
349
  return parseObj(dlt[key]);
304
350
  case 23:
305
- final_object[key] = _context5.sent;
351
+ final_object[key] = _context6.sent;
306
352
  case 24:
307
- _context5.next = 19;
353
+ _context6.next = 19;
308
354
  break;
309
355
  case 26:
310
- _context5.next = 31;
356
+ _context6.next = 31;
311
357
  break;
312
358
  case 28:
313
- _context5.prev = 28;
314
- _context5.t0 = _context5["catch"](17);
315
- _iterator.e(_context5.t0);
359
+ _context6.prev = 28;
360
+ _context6.t0 = _context6["catch"](17);
361
+ _iterator.e(_context6.t0);
316
362
  case 31:
317
- _context5.prev = 31;
363
+ _context6.prev = 31;
318
364
  _iterator.f();
319
- return _context5.finish(31);
365
+ return _context6.finish(31);
320
366
  case 34:
321
367
  /* -------------------------------------------------------------------------- */
322
368
  /* add id properties */
@@ -339,12 +385,12 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
339
385
  });
340
386
  final_object["_users"] = (0, _object.wrap_array)(tempusers);
341
387
  }
342
- return _context5.abrupt("return", final_object);
388
+ return _context6.abrupt("return", final_object);
343
389
  case 38:
344
390
  case "end":
345
- return _context5.stop();
391
+ return _context6.stop();
346
392
  }
347
- }, _callee5, this, [[17, 28, 31, 34]]);
393
+ }, _callee6, this, [[17, 28, 31, 34]]);
348
394
  }))).apply(this, arguments);
349
395
  } /* --------------------------------- Getters -------------------------------- */
350
396
  }, {
@@ -366,127 +412,127 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
366
412
  }, {
367
413
  key: "onDelete",
368
414
  value: function onDelete() {
369
- return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
415
+ return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
370
416
  var _this$manager;
371
417
  var _len,
372
418
  p,
373
419
  _key,
374
- _args6 = arguments;
375
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
376
- while (1) switch (_context6.prev = _context6.next) {
420
+ _args7 = arguments;
421
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
422
+ while (1) switch (_context7.prev = _context7.next) {
377
423
  case 0:
378
424
  this.isDeleted = true;
379
- for (_len = _args6.length, p = new Array(_len), _key = 0; _key < _len; _key++) {
380
- p[_key] = _args6[_key];
425
+ for (_len = _args7.length, p = new Array(_len), _key = 0; _key < _len; _key++) {
426
+ p[_key] = _args7[_key];
381
427
  }
382
- _context6.next = 4;
428
+ _context7.next = 4;
383
429
  return (_this$manager = this.manager) === null || _this$manager === void 0 ? void 0 : _this$manager.onDelete.apply(_this$manager, p);
384
430
  case 4:
385
- return _context6.abrupt("return", _context6.sent);
431
+ return _context7.abrupt("return", _context7.sent);
386
432
  case 5:
387
433
  case "end":
388
- return _context6.stop();
434
+ return _context7.stop();
389
435
  }
390
- }, _callee6, this);
436
+ }, _callee7, this);
391
437
  }))).apply(this, arguments);
392
438
  }
393
439
  }, {
394
440
  key: "onLoad",
395
441
  value: function onLoad() {
396
- return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
442
+ return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
397
443
  var _this$manager2;
398
444
  var _len2,
399
445
  p,
400
446
  _key2,
401
- _args7 = arguments;
402
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
403
- while (1) switch (_context7.prev = _context7.next) {
447
+ _args8 = arguments;
448
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
449
+ while (1) switch (_context8.prev = _context8.next) {
404
450
  case 0:
405
451
  this.isDeleted = false;
406
- for (_len2 = _args7.length, p = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
407
- p[_key2] = _args7[_key2];
452
+ for (_len2 = _args8.length, p = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
453
+ p[_key2] = _args8[_key2];
408
454
  }
409
- _context7.next = 4;
455
+ _context8.next = 4;
410
456
  return (_this$manager2 = this.manager) === null || _this$manager2 === void 0 ? void 0 : _this$manager2.onLoad.apply(_this$manager2, p);
411
457
  case 4:
412
- return _context7.abrupt("return", _context7.sent);
458
+ return _context8.abrupt("return", _context8.sent);
413
459
  case 5:
414
460
  case "end":
415
- return _context7.stop();
461
+ return _context8.stop();
416
462
  }
417
- }, _callee7, this);
463
+ }, _callee8, this);
418
464
  }))).apply(this, arguments);
419
465
  }
420
466
  }, {
421
467
  key: "onSave",
422
468
  value: function onSave() {
423
- return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
469
+ return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
424
470
  var _this$manager4;
425
471
  var srObject,
426
472
  _this$manager3,
427
473
  _len3,
428
474
  p,
429
475
  _key3,
430
- _args8 = arguments;
431
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
432
- while (1) switch (_context8.prev = _context8.next) {
476
+ _args9 = arguments;
477
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
478
+ while (1) switch (_context9.prev = _context9.next) {
433
479
  case 0:
434
480
  if (!this.isSaved) {
435
- _context8.next = 7;
481
+ _context9.next = 7;
436
482
  break;
437
483
  }
438
484
  this.apply_changes();
439
485
  srObject = this.getSaveResult(true);
440
486
  if (!this.saveResultHasID(srObject)) {
441
- _context8.next = 7;
487
+ _context9.next = 7;
442
488
  break;
443
489
  }
444
490
  /* -------------------------------------------------------------------------- */
445
491
  WebObject.LoadIdsFromSaveResult(this, srObject);
446
- _context8.next = 7;
492
+ _context9.next = 7;
447
493
  return (_this$manager3 = this.manager) === null || _this$manager3 === void 0 ? void 0 : _this$manager3.event_run("on_id_change");
448
494
  case 7:
449
- for (_len3 = _args8.length, p = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
450
- p[_key3] = _args8[_key3];
495
+ for (_len3 = _args9.length, p = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
496
+ p[_key3] = _args9[_key3];
451
497
  }
452
- _context8.next = 10;
498
+ _context9.next = 10;
453
499
  return (_this$manager4 = this.manager) === null || _this$manager4 === void 0 ? void 0 : _this$manager4.onSave.apply(_this$manager4, p);
454
500
  case 10:
455
- _context8.next = 12;
501
+ _context9.next = 12;
456
502
  return this.onAfterSave();
457
503
  case 12:
458
- return _context8.abrupt("return", true);
504
+ return _context9.abrupt("return", true);
459
505
  case 13:
460
506
  case "end":
461
- return _context8.stop();
507
+ return _context9.stop();
462
508
  }
463
- }, _callee8, this);
509
+ }, _callee9, this);
464
510
  }))).apply(this, arguments);
465
511
  }
466
512
  }, {
467
513
  key: "onAfterSave",
468
514
  value: function onAfterSave() {
469
- return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
515
+ return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
470
516
  var _this$manager5;
471
517
  var _len4,
472
518
  p,
473
519
  _key4,
474
- _args9 = arguments;
475
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
476
- while (1) switch (_context9.prev = _context9.next) {
520
+ _args10 = arguments;
521
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
522
+ while (1) switch (_context10.prev = _context10.next) {
477
523
  case 0:
478
- for (_len4 = _args9.length, p = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
479
- p[_key4] = _args9[_key4];
524
+ for (_len4 = _args10.length, p = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
525
+ p[_key4] = _args10[_key4];
480
526
  }
481
- _context9.next = 3;
527
+ _context10.next = 3;
482
528
  return (_this$manager5 = this.manager) === null || _this$manager5 === void 0 ? void 0 : _this$manager5.onAfterSave.apply(_this$manager5, p);
483
529
  case 3:
484
- return _context9.abrupt("return", true);
530
+ return _context10.abrupt("return", true);
485
531
  case 4:
486
532
  case "end":
487
- return _context9.stop();
533
+ return _context10.stop();
488
534
  }
489
- }, _callee9, this);
535
+ }, _callee10, this);
490
536
  }))).apply(this, arguments);
491
537
  }
492
538
  }, {
@@ -507,27 +553,27 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
507
553
  }, {
508
554
  key: "onNew",
509
555
  value: function onNew() {
510
- return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
556
+ return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
511
557
  var _this$manager6;
512
558
  var _len5,
513
559
  p,
514
560
  _key5,
515
- _args10 = arguments;
516
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
517
- while (1) switch (_context10.prev = _context10.next) {
561
+ _args11 = arguments;
562
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
563
+ while (1) switch (_context11.prev = _context11.next) {
518
564
  case 0:
519
- for (_len5 = _args10.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
520
- p[_key5] = _args10[_key5];
565
+ for (_len5 = _args11.length, p = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
566
+ p[_key5] = _args11[_key5];
521
567
  }
522
- _context10.next = 3;
568
+ _context11.next = 3;
523
569
  return (_this$manager6 = this.manager) === null || _this$manager6 === void 0 ? void 0 : _this$manager6.onNew.apply(_this$manager6, p);
524
570
  case 3:
525
- return _context10.abrupt("return", _context10.sent);
571
+ return _context11.abrupt("return", _context11.sent);
526
572
  case 4:
527
573
  case "end":
528
- return _context10.stop();
574
+ return _context11.stop();
529
575
  }
530
- }, _callee10, this);
576
+ }, _callee11, this);
531
577
  }))).apply(this, arguments);
532
578
  } /* -------------------------------------------------------------------------- */
533
579
  }, {
@@ -573,8 +619,8 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
573
619
  }
574
620
  }, {
575
621
  key: "saveList",
576
- value: function saveList(_x4) {
577
- return (_saveList = _saveList || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(itemList) {
622
+ value: function saveList(_x6) {
623
+ return (_saveList = _saveList || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(itemList) {
578
624
  var _extraOptions$chunksi;
579
625
  var extraOptions,
580
626
  chunks,
@@ -591,11 +637,11 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
591
637
  _item,
592
638
  _index2,
593
639
  _item2,
594
- _args11 = arguments;
595
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
596
- while (1) switch (_context11.prev = _context11.next) {
640
+ _args12 = arguments;
641
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
642
+ while (1) switch (_context12.prev = _context12.next) {
597
643
  case 0:
598
- extraOptions = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
644
+ extraOptions = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : {};
599
645
  if (!extraOptions) extraOptions = {};
600
646
  chunks = (0, _object.array_chunks)(itemList, (_extraOptions$chunksi = extraOptions.chunksize) !== null && _extraOptions$chunksi !== void 0 ? _extraOptions$chunksi : 50);
601
647
  delete extraOptions.chunksize;
@@ -603,7 +649,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
603
649
  index = 0;
604
650
  case 6:
605
651
  if (!(index < chunks.length)) {
606
- _context11.next = 36;
652
+ _context12.next = 36;
607
653
  break;
608
654
  }
609
655
  items_to_save = chunks[index];
@@ -611,81 +657,81 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
611
657
  k = 0;
612
658
  case 10:
613
659
  if (!(k < items_to_save.length)) {
614
- _context11.next = 19;
660
+ _context12.next = 19;
615
661
  break;
616
662
  }
617
663
  item = items_to_save[k];
618
- _context11.next = 14;
664
+ _context12.next = 14;
619
665
  return item.get_deltaObject();
620
666
  case 14:
621
- dlt = _context11.sent;
667
+ dlt = _context12.sent;
622
668
  save_array.push(item.isNew ? _objectSpread({}, dlt) : _objectSpread({
623
669
  _id: item.getID()
624
670
  }, dlt));
625
671
  case 16:
626
672
  k++;
627
- _context11.next = 10;
673
+ _context12.next = 10;
628
674
  break;
629
675
  case 19:
630
- _context11.next = 21;
676
+ _context12.next = 21;
631
677
  return _global.gfunc.run_action("post", putAddress, _objectSpread({
632
678
  __save_list: WebObject.zipSaveList(save_array)
633
679
  }, extraOptions));
634
680
  case 21:
635
- resultObject = _context11.sent;
681
+ resultObject = _context12.sent;
636
682
  if (!Array.isArray(resultObject)) {
637
- _context11.next = 33;
683
+ _context12.next = 33;
638
684
  break;
639
685
  }
640
686
  _index = 0;
641
687
  case 24:
642
688
  if (!(_index < Math.min(resultObject.length, items_to_save.length))) {
643
- _context11.next = 33;
689
+ _context12.next = 33;
644
690
  break;
645
691
  }
646
692
  res = resultObject[_index];
647
693
  _item = items_to_save[_index];
648
694
  _item.setSaveResult(res);
649
- _context11.next = 30;
695
+ _context12.next = 30;
650
696
  return _item.onSave();
651
697
  case 30:
652
698
  _index++;
653
- _context11.next = 24;
699
+ _context12.next = 24;
654
700
  break;
655
701
  case 33:
656
702
  index++;
657
- _context11.next = 6;
703
+ _context12.next = 6;
658
704
  break;
659
705
  case 36:
660
706
  _index2 = 0;
661
707
  case 37:
662
708
  if (!(_index2 < itemList.length)) {
663
- _context11.next = 46;
709
+ _context12.next = 46;
664
710
  break;
665
711
  }
666
712
  _item2 = itemList[_index2];
667
713
  if (_item2.isSaved) {
668
- _context11.next = 41;
714
+ _context12.next = 41;
669
715
  break;
670
716
  }
671
- return _context11.abrupt("return", false);
717
+ return _context12.abrupt("return", false);
672
718
  case 41:
673
719
  if (!(_item2.getSaveResultType() != "normal")) {
674
- _context11.next = 43;
720
+ _context12.next = 43;
675
721
  break;
676
722
  }
677
- return _context11.abrupt("return", false);
723
+ return _context12.abrupt("return", false);
678
724
  case 43:
679
725
  _index2++;
680
- _context11.next = 37;
726
+ _context12.next = 37;
681
727
  break;
682
728
  case 46:
683
- return _context11.abrupt("return", true);
729
+ return _context12.abrupt("return", true);
684
730
  case 47:
685
731
  case "end":
686
- return _context11.stop();
732
+ return _context12.stop();
687
733
  }
688
- }, _callee11, this);
734
+ }, _callee12, this);
689
735
  }))).apply(this, arguments);
690
736
  }
691
737
  }, {
@@ -731,7 +777,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
731
777
  }, {
732
778
  key: "get_single",
733
779
  value: function get_single() {
734
- return (_get_single = _get_single || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
780
+ return (_get_single = _get_single || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
735
781
  var _len6,
736
782
  p,
737
783
  _key6,
@@ -740,55 +786,55 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
740
786
  fetchID,
741
787
  res,
742
788
  params,
743
- _args12 = arguments;
744
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
745
- while (1) switch (_context12.prev = _context12.next) {
789
+ _args13 = arguments;
790
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
791
+ while (1) switch (_context13.prev = _context13.next) {
746
792
  case 0:
747
- for (_len6 = _args12.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
748
- p[_key6] = _args12[_key6];
793
+ for (_len6 = _args13.length, p = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
794
+ p[_key6] = _args13[_key6];
749
795
  }
750
796
  search = p.shift();
751
797
  readonly = p.shift();
752
798
  fetchID = p.shift();
753
799
  if (!(0, _object.object_isEmpty)(search)) {
754
- _context12.next = 6;
800
+ _context13.next = 6;
755
801
  break;
756
802
  }
757
- return _context12.abrupt("return", undefined);
803
+ return _context13.abrupt("return", undefined);
758
804
  case 6:
759
805
  params = {};
760
806
  params.context = readonly ? "view" : "edit";
761
- _context12.t0 = _typeof(search);
762
- _context12.next = _context12.t0 === "string" ? 11 : _context12.t0 === "number" ? 11 : _context12.t0 === "object" ? 19 : 19;
807
+ _context13.t0 = _typeof(search);
808
+ _context13.next = _context13.t0 === "string" ? 11 : _context13.t0 === "number" ? 11 : _context13.t0 === "object" ? 19 : 19;
763
809
  break;
764
810
  case 11:
765
811
  search = String(search);
766
- _context12.t1 = this;
767
- _context12.t2 = this;
768
- _context12.next = 16;
812
+ _context13.t1 = this;
813
+ _context13.t2 = this;
814
+ _context13.next = 16;
769
815
  return _global.gfunc.run_action("get", this.__web_path + "/" + search, params, {
770
816
  fetchID: fetchID
771
817
  });
772
818
  case 16:
773
- _context12.t3 = _context12.sent;
774
- res = _context12.t1.ensure.call(_context12.t1, _context12.t2, _context12.t3);
775
- return _context12.abrupt("break", 25);
819
+ _context13.t3 = _context13.sent;
820
+ res = _context13.t1.ensure.call(_context13.t1, _context13.t2, _context13.t3);
821
+ return _context13.abrupt("break", 25);
776
822
  case 19:
777
- _context12.t4 = _object.object_first;
778
- _context12.next = 22;
823
+ _context13.t4 = _object.object_first;
824
+ _context13.next = 22;
779
825
  return this.get_list(search, readonly, fetchID);
780
826
  case 22:
781
- _context12.t5 = _context12.sent;
782
- res = (0, _context12.t4)(_context12.t5);
783
- return _context12.abrupt("break", 25);
827
+ _context13.t5 = _context13.sent;
828
+ res = (0, _context13.t4)(_context13.t5);
829
+ return _context13.abrupt("break", 25);
784
830
  case 25:
785
831
  WebObject.setReadonly(res, readonly);
786
- return _context12.abrupt("return", res);
832
+ return _context13.abrupt("return", res);
787
833
  case 27:
788
834
  case "end":
789
- return _context12.stop();
835
+ return _context13.stop();
790
836
  }
791
- }, _callee12, this);
837
+ }, _callee13, this);
792
838
  }))).apply(this, arguments);
793
839
  }
794
840
  /**
@@ -798,7 +844,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
798
844
  }, {
799
845
  key: "get_list",
800
846
  value: function get_list() {
801
- return (_get_list = _get_list || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
847
+ return (_get_list = _get_list || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
802
848
  var _len7,
803
849
  p,
804
850
  _key7,
@@ -808,32 +854,32 @@ var WebObject = /*#__PURE__*/function (_SimpleObject, _Save, _Delete, _get_delta
808
854
  result_items,
809
855
  selftype,
810
856
  res,
811
- _args13 = arguments;
812
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
813
- while (1) switch (_context13.prev = _context13.next) {
857
+ _args14 = arguments;
858
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
859
+ while (1) switch (_context14.prev = _context14.next) {
814
860
  case 0:
815
- for (_len7 = _args13.length, p = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
816
- p[_key7] = _args13[_key7];
861
+ for (_len7 = _args14.length, p = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
862
+ p[_key7] = _args14[_key7];
817
863
  }
818
864
  search = p.shift();
819
865
  readonly = p.shift();
820
866
  fetchID = p.shift();
821
867
  if (!search) search = {};
822
- _context13.next = 7;
868
+ _context14.next = 7;
823
869
  return _global.gfunc.run_action("get", this.__web_path, search, {
824
870
  fetchID: fetchID
825
871
  });
826
872
  case 7:
827
- result_items = _context13.sent;
873
+ result_items = _context14.sent;
828
874
  selftype = this.prototype;
829
875
  res = WebObject.map_rowindex(WebObject.mapto(selftype, result_items, readonly));
830
876
  WebObject.setReadonly(res, readonly);
831
- return _context13.abrupt("return", res);
877
+ return _context14.abrupt("return", res);
832
878
  case 12:
833
879
  case "end":
834
- return _context13.stop();
880
+ return _context14.stop();
835
881
  }
836
- }, _callee13, this);
882
+ }, _callee14, this);
837
883
  }))).apply(this, arguments);
838
884
  }
839
885
  }]);
@@ -17,7 +17,7 @@ export declare class WebObjectManager<T extends WebObject> extends ObjectManager
17
17
  * @param sendChange
18
18
  * @returns
19
19
  */
20
- setMetaValue(key: string, value: any, sendChange?: sendChangesType): boolean | undefined;
20
+ setMetaValue(key: string, value: any, sendChange?: sendChangesType): Promise<boolean | undefined>;
21
21
  getMetaValue(key: string): any;
22
22
  get_deltaObject(): Promise<any>;
23
23
  Save(): Promise<boolean>;
@@ -27,7 +27,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
27
27
  /**
28
28
  * This class manages the events of an Simple Object
29
29
  */
30
- var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _get_deltaObject, _Save, _Load, _onNew, _onDelete, _onLoad, _onSave, _onAfterSave) {
30
+ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _get_deltaObject, _Save, _Load, _onNew, _onDelete, _onLoad, _onSave, _onAfterSave) {
31
31
  _inherits(WebObjectManager, _ObjectManager);
32
32
  var _super = _createSuper(WebObjectManager);
33
33
  /* -------------------------------------------------------------------------- */
@@ -90,10 +90,25 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _get_deltaObject,
90
90
  */
91
91
  _createClass(WebObjectManager, [{
92
92
  key: "setMetaValue",
93
- value: function setMetaValue(key, value) {
94
- var _this$obj;
95
- var sendChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "auto";
96
- return (_this$obj = this.obj) === null || _this$obj === void 0 ? void 0 : _this$obj.setMetaValue(key, value, sendChange);
93
+ value: function setMetaValue(_x, _x2) {
94
+ return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, value) {
95
+ var _this$obj;
96
+ var sendChange,
97
+ _args2 = arguments;
98
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
99
+ while (1) switch (_context2.prev = _context2.next) {
100
+ case 0:
101
+ sendChange = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : "auto";
102
+ _context2.next = 3;
103
+ return (_this$obj = this.obj) === null || _this$obj === void 0 ? void 0 : _this$obj.setMetaValue(key, value, sendChange);
104
+ case 3:
105
+ return _context2.abrupt("return", _context2.sent);
106
+ case 4:
107
+ case "end":
108
+ return _context2.stop();
109
+ }
110
+ }, _callee2, this);
111
+ }))).apply(this, arguments);
97
112
  }
98
113
  }, {
99
114
  key: "getMetaValue",
@@ -105,68 +120,68 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _get_deltaObject,
105
120
  }, {
106
121
  key: "get_deltaObject",
107
122
  value: function get_deltaObject() {
108
- return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
123
+ return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
109
124
  var _this$obj3;
110
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
111
- while (1) switch (_context2.prev = _context2.next) {
125
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
126
+ while (1) switch (_context3.prev = _context3.next) {
112
127
  case 0:
113
- _context2.next = 2;
128
+ _context3.next = 2;
114
129
  return (_this$obj3 = this.obj) === null || _this$obj3 === void 0 ? void 0 : _this$obj3.get_deltaObject();
115
130
  case 2:
116
- _context2.t0 = _context2.sent;
117
- if (_context2.t0) {
118
- _context2.next = 5;
131
+ _context3.t0 = _context3.sent;
132
+ if (_context3.t0) {
133
+ _context3.next = 5;
119
134
  break;
120
135
  }
121
- _context2.t0 = {};
136
+ _context3.t0 = {};
122
137
  case 5:
123
- return _context2.abrupt("return", _context2.t0);
138
+ return _context3.abrupt("return", _context3.t0);
124
139
  case 6:
125
140
  case "end":
126
- return _context2.stop();
141
+ return _context3.stop();
127
142
  }
128
- }, _callee2, this);
143
+ }, _callee3, this);
129
144
  }))).apply(this, arguments);
130
145
  } /* ------------------------------ save and load ----------------------------- */
131
146
  }, {
132
147
  key: "Save",
133
148
  value: function Save() {
134
- return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
149
+ return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
135
150
  var _this$obj4;
136
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
137
- while (1) switch (_context3.prev = _context3.next) {
151
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
152
+ while (1) switch (_context4.prev = _context4.next) {
138
153
  case 0:
139
- _context3.next = 2;
154
+ _context4.next = 2;
140
155
  return (_this$obj4 = this.obj) === null || _this$obj4 === void 0 ? void 0 : _this$obj4.Save();
141
156
  case 2:
142
- _context3.t0 = _context3.sent;
143
- if (_context3.t0) {
144
- _context3.next = 5;
157
+ _context4.t0 = _context4.sent;
158
+ if (_context4.t0) {
159
+ _context4.next = 5;
145
160
  break;
146
161
  }
147
- _context3.t0 = false;
162
+ _context4.t0 = false;
148
163
  case 5:
149
- return _context3.abrupt("return", _context3.t0);
164
+ return _context4.abrupt("return", _context4.t0);
150
165
  case 6:
151
166
  case "end":
152
- return _context3.stop();
167
+ return _context4.stop();
153
168
  }
154
- }, _callee3, this);
169
+ }, _callee4, this);
155
170
  }))).apply(this, arguments);
156
171
  }
157
172
  }, {
158
173
  key: "Load",
159
- value: function Load(_x) {
160
- return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(search) {
161
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
162
- while (1) switch (_context4.prev = _context4.next) {
174
+ value: function Load(_x3) {
175
+ return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(search) {
176
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
177
+ while (1) switch (_context5.prev = _context5.next) {
163
178
  case 0:
164
179
  throw Error("load not implented");
165
180
  case 1:
166
181
  case "end":
167
- return _context4.stop();
182
+ return _context5.stop();
168
183
  }
169
- }, _callee4);
184
+ }, _callee5);
170
185
  }))).apply(this, arguments);
171
186
  }
172
187
  /* -------------------------------------------------------------------------- */
@@ -200,32 +215,32 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _get_deltaObject,
200
215
  }, {
201
216
  key: "onNew",
202
217
  value: function onNew() {
203
- return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
218
+ return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
204
219
  var _this$obj7;
205
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
206
- while (1) switch (_context5.prev = _context5.next) {
220
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
221
+ while (1) switch (_context6.prev = _context6.next) {
207
222
  case 0:
208
223
  if (this.canModify) {
209
224
  (_this$obj7 = this.obj) === null || _this$obj7 === void 0 || _this$obj7.setOriginal();
210
225
  }
211
- _context5.next = 3;
226
+ _context6.next = 3;
212
227
  return this.event_run("on_new");
213
228
  case 3:
214
- _context5.next = 5;
229
+ _context6.next = 5;
215
230
  return this.event_run("on_change", true);
216
231
  case 5:
217
- _context5.next = 7;
232
+ _context6.next = 7;
218
233
  return this.event_run("on_after_new");
219
234
  case 7:
220
- _context5.next = 9;
235
+ _context6.next = 9;
221
236
  return Promise.resolve(true);
222
237
  case 9:
223
- return _context5.abrupt("return", _context5.sent);
238
+ return _context6.abrupt("return", _context6.sent);
224
239
  case 10:
225
240
  case "end":
226
- return _context5.stop();
241
+ return _context6.stop();
227
242
  }
228
- }, _callee5, this);
243
+ }, _callee6, this);
229
244
  }))).apply(this, arguments);
230
245
  }
231
246
  /**
@@ -236,28 +251,28 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _get_deltaObject,
236
251
  }, {
237
252
  key: "onDelete",
238
253
  value: function onDelete() {
239
- return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
240
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
241
- while (1) switch (_context6.prev = _context6.next) {
254
+ return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
255
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
256
+ while (1) switch (_context7.prev = _context7.next) {
242
257
  case 0:
243
258
  if (this.obj) {
244
259
  this.obj.isDeleted = true;
245
260
  }
246
- _context6.next = 3;
261
+ _context7.next = 3;
247
262
  return this.event_run("on_delete");
248
263
  case 3:
249
- _context6.next = 5;
264
+ _context7.next = 5;
250
265
  return this.event_run("on_after_delete");
251
266
  case 5:
252
- _context6.next = 7;
267
+ _context7.next = 7;
253
268
  return Promise.resolve(true);
254
269
  case 7:
255
- return _context6.abrupt("return", _context6.sent);
270
+ return _context7.abrupt("return", _context7.sent);
256
271
  case 8:
257
272
  case "end":
258
- return _context6.stop();
273
+ return _context7.stop();
259
274
  }
260
- }, _callee6, this);
275
+ }, _callee7, this);
261
276
  }))).apply(this, arguments);
262
277
  }
263
278
  /**
@@ -268,35 +283,35 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _get_deltaObject,
268
283
  }, {
269
284
  key: "onLoad",
270
285
  value: function onLoad() {
271
- return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
272
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
273
- while (1) switch (_context7.prev = _context7.next) {
286
+ return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
287
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
288
+ while (1) switch (_context8.prev = _context8.next) {
274
289
  case 0:
275
290
  if (this.canModify && this.obj) {
276
291
  this.obj.isDeleted = false;
277
292
  this.obj.setOriginal();
278
293
  }
279
- _context7.next = 3;
294
+ _context8.next = 3;
280
295
  return this.event_run("on_load");
281
296
  case 3:
282
- _context7.next = 5;
297
+ _context8.next = 5;
283
298
  return this.event_run("on_change", true);
284
299
  case 5:
285
- _context7.next = 7;
300
+ _context8.next = 7;
286
301
  return this.event_run("on_after_load");
287
302
  case 7:
288
- _context7.next = 9;
303
+ _context8.next = 9;
289
304
  return this.event_run("on_load_finished");
290
305
  case 9:
291
- _context7.next = 11;
306
+ _context8.next = 11;
292
307
  return Promise.resolve(true);
293
308
  case 11:
294
- return _context7.abrupt("return", _context7.sent);
309
+ return _context8.abrupt("return", _context8.sent);
295
310
  case 12:
296
311
  case "end":
297
- return _context7.stop();
312
+ return _context8.stop();
298
313
  }
299
- }, _callee7, this);
314
+ }, _callee8, this);
300
315
  }))).apply(this, arguments);
301
316
  }
302
317
  /**
@@ -307,49 +322,49 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _get_deltaObject,
307
322
  }, {
308
323
  key: "onSave",
309
324
  value: function onSave() {
310
- return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
311
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
312
- while (1) switch (_context8.prev = _context8.next) {
325
+ return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
326
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
327
+ while (1) switch (_context9.prev = _context9.next) {
313
328
  case 0:
314
- _context8.next = 2;
329
+ _context9.next = 2;
315
330
  return this.event_run("on_save");
316
331
  case 2:
317
- _context8.next = 4;
332
+ _context9.next = 4;
318
333
  return this.event_run("on_change", true);
319
334
  case 4:
320
- _context8.next = 6;
335
+ _context9.next = 6;
321
336
  return Promise.resolve(true);
322
337
  case 6:
323
- return _context8.abrupt("return", _context8.sent);
338
+ return _context9.abrupt("return", _context9.sent);
324
339
  case 7:
325
340
  case "end":
326
- return _context8.stop();
341
+ return _context9.stop();
327
342
  }
328
- }, _callee8, this);
343
+ }, _callee9, this);
329
344
  }))).apply(this, arguments);
330
345
  }
331
346
  }, {
332
347
  key: "onAfterSave",
333
348
  value: function onAfterSave() {
334
- return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
335
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
336
- while (1) switch (_context9.prev = _context9.next) {
349
+ return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
350
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
351
+ while (1) switch (_context10.prev = _context10.next) {
337
352
  case 0:
338
- _context9.next = 2;
353
+ _context10.next = 2;
339
354
  return this.event_run("on_after_save");
340
355
  case 2:
341
- _context9.next = 4;
356
+ _context10.next = 4;
342
357
  return this.event_run("on_save_finished");
343
358
  case 4:
344
- _context9.next = 6;
359
+ _context10.next = 6;
345
360
  return Promise.resolve(true);
346
361
  case 6:
347
- return _context9.abrupt("return", _context9.sent);
362
+ return _context10.abrupt("return", _context10.sent);
348
363
  case 7:
349
364
  case "end":
350
- return _context9.stop();
365
+ return _context10.stop();
351
366
  }
352
- }, _callee9, this);
367
+ }, _callee10, this);
353
368
  }))).apply(this, arguments);
354
369
  }
355
370
  }]);
@@ -104,6 +104,12 @@ export declare class SimpleObject extends MapableObject {
104
104
  * Apply the changes and empty the delta object
105
105
  */
106
106
  apply_changes(): boolean;
107
+ /**
108
+ * apply changes for the given field
109
+ * @param key
110
+ * @returns
111
+ */
112
+ apply(key: string): boolean;
107
113
  /**
108
114
  * set the value to its original
109
115
  * @param key
@@ -434,6 +434,26 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setAll, _s
434
434
  this.clear_changes();
435
435
  }
436
436
  }
437
+ /**
438
+ * apply changes for the given field
439
+ * @param key
440
+ * @returns
441
+ */
442
+ }, {
443
+ key: "apply",
444
+ value: function apply(key) {
445
+ try {
446
+ if (!this.__use_delta) {
447
+ //in this mode , we track changes by updating the original
448
+ return true;
449
+ }
450
+ if (this.__delta != null && key in this.__delta) {
451
+ this[key] = this.__delta[key];
452
+ delete this.__delta[key];
453
+ }
454
+ return true;
455
+ } finally {}
456
+ }
437
457
  /**
438
458
  * set the value to its original
439
459
  * @param key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.69",
3
+ "version": "1.4.71",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",