@azrico/webobject 1.4.95 → 1.4.97

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.
@@ -42,6 +42,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
42
42
  _defineProperty(_assertThisInitialized(_this), "__last_web_path", "");
43
43
  _defineProperty(_assertThisInitialized(_this), "__last_web_type", "");
44
44
  if (_this.constructor["__save_message"]) {
45
+ var _ref2, _ref3, _ref4;
45
46
  _this.event_add("on_save", "on_save-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
46
47
  return _regeneratorRuntime().wrap(function _callee$(_context) {
47
48
  while (1) switch (_context.prev = _context.next) {
@@ -79,68 +80,99 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
79
80
  }
80
81
  }, _callee);
81
82
  })));
82
- _this.event_add("on_{archive,unarchive}", "on_archive-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
83
- var srType;
84
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
85
- while (1) switch (_context2.prev = _context2.next) {
86
- case 0:
87
- srType = _this.getSaveResultType();
88
- _context2.t0 = srType;
89
- _context2.next = _context2.t0 === "normal" ? 4 : 7;
90
- break;
91
- case 4:
92
- _context2.next = 6;
93
- return _global.gfunc.run_action("show_message", {
94
- message: _this.isArchived ? "Archived" : "Restored",
95
- type: "success"
96
- });
97
- case 6:
98
- return _context2.abrupt("return", _context2.sent);
99
- case 7:
100
- _context2.next = 9;
101
- return _global.gfunc.run_action("show_message", {
102
- message: "Not archived (".concat(srType, ")"),
103
- type: "error"
104
- });
105
- case 9:
106
- return _context2.abrupt("return", _context2.sent);
107
- case 10:
108
- case "end":
109
- return _context2.stop();
110
- }
111
- }, _callee2);
112
- })));
113
- _this.event_add("on_delete", "on_delete-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
114
- var srType;
115
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
116
- while (1) switch (_context3.prev = _context3.next) {
117
- case 0:
118
- srType = _this.getSaveResultType();
119
- _context3.t0 = srType;
120
- _context3.next = _context3.t0 === "normal" ? 4 : 7;
121
- break;
122
- case 4:
123
- _context3.next = 6;
124
- return _global.gfunc.run_action("show_message", {
125
- message: "Deleted",
126
- type: "success"
127
- });
128
- case 6:
129
- return _context3.abrupt("return", _context3.sent);
130
- case 7:
131
- _context3.next = 9;
132
- return _global.gfunc.run_action("show_message", {
133
- message: "Not deleted (".concat(srType, ")"),
134
- type: "error"
135
- });
136
- case 9:
137
- return _context3.abrupt("return", _context3.sent);
138
- case 10:
139
- case "end":
140
- return _context3.stop();
141
- }
142
- }, _callee3);
143
- })));
83
+ _this.event_add("on_archive", "on_archive-sendmsg", function (_x) {
84
+ return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(srType) {
85
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
86
+ while (1) switch (_context2.prev = _context2.next) {
87
+ case 0:
88
+ _context2.t0 = srType;
89
+ _context2.next = _context2.t0 === "normal" ? 3 : 6;
90
+ break;
91
+ case 3:
92
+ _context2.next = 5;
93
+ return _global.gfunc.run_action("show_message", {
94
+ message: "Archived",
95
+ type: "success"
96
+ });
97
+ case 5:
98
+ return _context2.abrupt("return", _context2.sent);
99
+ case 6:
100
+ _context2.next = 8;
101
+ return _global.gfunc.run_action("show_message", {
102
+ message: "Not archived (".concat(srType, ")"),
103
+ type: "error"
104
+ });
105
+ case 8:
106
+ return _context2.abrupt("return", _context2.sent);
107
+ case 9:
108
+ case "end":
109
+ return _context2.stop();
110
+ }
111
+ }, _callee2);
112
+ }))).apply(this, arguments);
113
+ });
114
+ _this.event_add("on_unarchive", "on_unarchive-sendmsg", function (_x2) {
115
+ return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(srType) {
116
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
117
+ while (1) switch (_context3.prev = _context3.next) {
118
+ case 0:
119
+ _context3.t0 = srType;
120
+ _context3.next = _context3.t0 === "normal" ? 3 : 6;
121
+ break;
122
+ case 3:
123
+ _context3.next = 5;
124
+ return _global.gfunc.run_action("show_message", {
125
+ message: "Restored",
126
+ type: "success"
127
+ });
128
+ case 5:
129
+ return _context3.abrupt("return", _context3.sent);
130
+ case 6:
131
+ _context3.next = 8;
132
+ return _global.gfunc.run_action("show_message", {
133
+ message: "Not restored (".concat(srType, ")"),
134
+ type: "error"
135
+ });
136
+ case 8:
137
+ return _context3.abrupt("return", _context3.sent);
138
+ case 9:
139
+ case "end":
140
+ return _context3.stop();
141
+ }
142
+ }, _callee3);
143
+ }))).apply(this, arguments);
144
+ });
145
+ _this.event_add("on_delete", "on_delete-sendmsg", function (_x3) {
146
+ return (_ref4 = _ref4 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(srType) {
147
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
148
+ while (1) switch (_context4.prev = _context4.next) {
149
+ case 0:
150
+ _context4.t0 = srType;
151
+ _context4.next = _context4.t0 === "normal" ? 3 : 6;
152
+ break;
153
+ case 3:
154
+ _context4.next = 5;
155
+ return _global.gfunc.run_action("show_message", {
156
+ message: "Deleted",
157
+ type: "success"
158
+ });
159
+ case 5:
160
+ return _context4.abrupt("return", _context4.sent);
161
+ case 6:
162
+ _context4.next = 8;
163
+ return _global.gfunc.run_action("show_message", {
164
+ message: "Not deleted (".concat(srType, ")"),
165
+ type: "error"
166
+ });
167
+ case 8:
168
+ return _context4.abrupt("return", _context4.sent);
169
+ case 9:
170
+ case "end":
171
+ return _context4.stop();
172
+ }
173
+ }, _callee4);
174
+ }))).apply(this, arguments);
175
+ });
144
176
  }
145
177
  return _this;
146
178
  }
@@ -168,24 +200,24 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
168
200
  */
169
201
  }, {
170
202
  key: "setMetaValue",
171
- value: function setMetaValue(_x, _x2) {
172
- return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, value) {
203
+ value: function setMetaValue(_x4, _x5) {
204
+ return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
173
205
  var _this$obj;
174
206
  var sendChange,
175
- _args4 = arguments;
176
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
177
- while (1) switch (_context4.prev = _context4.next) {
207
+ _args5 = arguments;
208
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
209
+ while (1) switch (_context5.prev = _context5.next) {
178
210
  case 0:
179
- sendChange = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : "auto";
180
- _context4.next = 3;
211
+ sendChange = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : "auto";
212
+ _context5.next = 3;
181
213
  return (_this$obj = this.obj) === null || _this$obj === void 0 ? void 0 : _this$obj.setMetaValue(key, value, sendChange);
182
214
  case 3:
183
- return _context4.abrupt("return", _context4.sent);
215
+ return _context5.abrupt("return", _context5.sent);
184
216
  case 4:
185
217
  case "end":
186
- return _context4.stop();
218
+ return _context5.stop();
187
219
  }
188
- }, _callee4, this);
220
+ }, _callee5, this);
189
221
  }))).apply(this, arguments);
190
222
  }
191
223
  }, {
@@ -198,68 +230,68 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
198
230
  }, {
199
231
  key: "get_deltaObject",
200
232
  value: function get_deltaObject() {
201
- return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
233
+ return (_get_deltaObject = _get_deltaObject || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
202
234
  var _this$obj3;
203
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
204
- while (1) switch (_context5.prev = _context5.next) {
235
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
236
+ while (1) switch (_context6.prev = _context6.next) {
205
237
  case 0:
206
- _context5.next = 2;
238
+ _context6.next = 2;
207
239
  return (_this$obj3 = this.obj) === null || _this$obj3 === void 0 ? void 0 : _this$obj3.get_deltaObject();
208
240
  case 2:
209
- _context5.t0 = _context5.sent;
210
- if (_context5.t0) {
211
- _context5.next = 5;
241
+ _context6.t0 = _context6.sent;
242
+ if (_context6.t0) {
243
+ _context6.next = 5;
212
244
  break;
213
245
  }
214
- _context5.t0 = {};
246
+ _context6.t0 = {};
215
247
  case 5:
216
- return _context5.abrupt("return", _context5.t0);
248
+ return _context6.abrupt("return", _context6.t0);
217
249
  case 6:
218
250
  case "end":
219
- return _context5.stop();
251
+ return _context6.stop();
220
252
  }
221
- }, _callee5, this);
253
+ }, _callee6, this);
222
254
  }))).apply(this, arguments);
223
255
  } /* ------------------------------ save and load ----------------------------- */
224
256
  }, {
225
257
  key: "Save",
226
258
  value: function Save() {
227
- return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
259
+ return (_Save = _Save || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
228
260
  var _this$obj4;
229
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
230
- while (1) switch (_context6.prev = _context6.next) {
261
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
262
+ while (1) switch (_context7.prev = _context7.next) {
231
263
  case 0:
232
- _context6.next = 2;
264
+ _context7.next = 2;
233
265
  return (_this$obj4 = this.obj) === null || _this$obj4 === void 0 ? void 0 : _this$obj4.Save();
234
266
  case 2:
235
- _context6.t0 = _context6.sent;
236
- if (_context6.t0) {
237
- _context6.next = 5;
267
+ _context7.t0 = _context7.sent;
268
+ if (_context7.t0) {
269
+ _context7.next = 5;
238
270
  break;
239
271
  }
240
- _context6.t0 = false;
272
+ _context7.t0 = false;
241
273
  case 5:
242
- return _context6.abrupt("return", _context6.t0);
274
+ return _context7.abrupt("return", _context7.t0);
243
275
  case 6:
244
276
  case "end":
245
- return _context6.stop();
277
+ return _context7.stop();
246
278
  }
247
- }, _callee6, this);
279
+ }, _callee7, this);
248
280
  }))).apply(this, arguments);
249
281
  }
250
282
  }, {
251
283
  key: "Load",
252
- value: function Load(_x3) {
253
- return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(search) {
254
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
255
- while (1) switch (_context7.prev = _context7.next) {
284
+ value: function Load(_x6) {
285
+ return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(search) {
286
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
287
+ while (1) switch (_context8.prev = _context8.next) {
256
288
  case 0:
257
289
  throw Error("load not implented");
258
290
  case 1:
259
291
  case "end":
260
- return _context7.stop();
292
+ return _context8.stop();
261
293
  }
262
- }, _callee7);
294
+ }, _callee8);
263
295
  }))).apply(this, arguments);
264
296
  }
265
297
  /* -------------------------------------------------------------------------- */
@@ -295,32 +327,32 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
295
327
  }, {
296
328
  key: "onNew",
297
329
  value: function onNew() {
298
- return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
330
+ return (_onNew = _onNew || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
299
331
  var _this$obj9;
300
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
301
- while (1) switch (_context8.prev = _context8.next) {
332
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
333
+ while (1) switch (_context9.prev = _context9.next) {
302
334
  case 0:
303
335
  if (this.canModify) {
304
336
  (_this$obj9 = this.obj) === null || _this$obj9 === void 0 || _this$obj9.setOriginal();
305
337
  }
306
- _context8.next = 3;
338
+ _context9.next = 3;
307
339
  return this.event_run("on_new");
308
340
  case 3:
309
- _context8.next = 5;
341
+ _context9.next = 5;
310
342
  return this.event_run("on_change", true);
311
343
  case 5:
312
- _context8.next = 7;
344
+ _context9.next = 7;
313
345
  return this.event_run("on_after_new");
314
346
  case 7:
315
- _context8.next = 9;
347
+ _context9.next = 9;
316
348
  return Promise.resolve(true);
317
349
  case 9:
318
- return _context8.abrupt("return", _context8.sent);
350
+ return _context9.abrupt("return", _context9.sent);
319
351
  case 10:
320
352
  case "end":
321
- return _context8.stop();
353
+ return _context9.stop();
322
354
  }
323
- }, _callee8, this);
355
+ }, _callee9, this);
324
356
  }))).apply(this, arguments);
325
357
  }
326
358
  /**
@@ -331,64 +363,70 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
331
363
  }, {
332
364
  key: "onDelete",
333
365
  value: function onDelete() {
334
- return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
335
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
336
- while (1) switch (_context9.prev = _context9.next) {
366
+ return (_onDelete = _onDelete || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
367
+ var srt;
368
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
369
+ while (1) switch (_context10.prev = _context10.next) {
337
370
  case 0:
338
- _context9.next = 2;
339
- return this.event_run("on_delete");
340
- case 2:
341
- _context9.next = 4;
342
- return this.event_run("on_after_delete");
343
- case 4:
344
- return _context9.abrupt("return", true);
371
+ srt = this.getSaveResultType();
372
+ _context10.next = 3;
373
+ return this.event_run("on_delete", srt);
374
+ case 3:
375
+ _context10.next = 5;
376
+ return this.event_run("on_after_delete", srt);
345
377
  case 5:
378
+ return _context10.abrupt("return", true);
379
+ case 6:
346
380
  case "end":
347
- return _context9.stop();
381
+ return _context10.stop();
348
382
  }
349
- }, _callee9, this);
383
+ }, _callee10, this);
350
384
  }))).apply(this, arguments);
351
385
  }
352
386
  }, {
353
387
  key: "onArchive",
354
388
  value: function onArchive() {
355
- return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
356
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
357
- while (1) switch (_context10.prev = _context10.next) {
389
+ return (_onArchive = _onArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
390
+ var srt;
391
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
392
+ while (1) switch (_context11.prev = _context11.next) {
358
393
  case 0:
359
- _context10.next = 2;
360
- return this.event_run("on_archive");
361
- case 2:
362
- _context10.next = 4;
363
- return this.event_run("on_after_archive");
364
- case 4:
365
- return _context10.abrupt("return", true);
394
+ srt = this.getSaveResultType();
395
+ _context11.next = 3;
396
+ return this.event_run("on_archive", srt);
397
+ case 3:
398
+ _context11.next = 5;
399
+ return this.event_run("on_after_archive", srt);
366
400
  case 5:
401
+ return _context11.abrupt("return", true);
402
+ case 6:
367
403
  case "end":
368
- return _context10.stop();
404
+ return _context11.stop();
369
405
  }
370
- }, _callee10, this);
406
+ }, _callee11, this);
371
407
  }))).apply(this, arguments);
372
408
  }
373
409
  }, {
374
410
  key: "onUnArchive",
375
411
  value: function onUnArchive() {
376
- return (_onUnArchive = _onUnArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
377
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
378
- while (1) switch (_context11.prev = _context11.next) {
412
+ return (_onUnArchive = _onUnArchive || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
413
+ var srt;
414
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
415
+ while (1) switch (_context12.prev = _context12.next) {
379
416
  case 0:
380
- _context11.next = 2;
381
- return this.event_run("on_unarchive");
382
- case 2:
383
- _context11.next = 4;
384
- return this.event_run("on_after_unarchive");
385
- case 4:
386
- return _context11.abrupt("return", true);
417
+ srt = this.getSaveResultType();
418
+ _context12.next = 3;
419
+ return this.event_run("on_unarchive", srt);
420
+ case 3:
421
+ _context12.next = 5;
422
+ return this.event_run("on_after_unarchive", srt);
387
423
  case 5:
424
+ return _context12.abrupt("return", true);
425
+ case 6:
388
426
  case "end":
389
- return _context11.stop();
427
+ return _context12.stop();
390
428
  }
391
- }, _callee11, this);
429
+ }, _callee12, this);
392
430
  }))).apply(this, arguments);
393
431
  }
394
432
  /**
@@ -399,32 +437,32 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
399
437
  }, {
400
438
  key: "onLoad",
401
439
  value: function onLoad() {
402
- return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
403
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
404
- while (1) switch (_context12.prev = _context12.next) {
440
+ return (_onLoad = _onLoad || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
441
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
442
+ while (1) switch (_context13.prev = _context13.next) {
405
443
  case 0:
406
444
  if (this.canModify && this.obj) {
407
445
  this.obj.isDeleted = false;
408
446
  this.obj.setOriginal();
409
447
  }
410
- _context12.next = 3;
448
+ _context13.next = 3;
411
449
  return this.event_run("on_load");
412
450
  case 3:
413
- _context12.next = 5;
451
+ _context13.next = 5;
414
452
  return this.event_run("on_change", true);
415
453
  case 5:
416
- _context12.next = 7;
454
+ _context13.next = 7;
417
455
  return this.event_run("on_after_load");
418
456
  case 7:
419
- _context12.next = 9;
457
+ _context13.next = 9;
420
458
  return this.event_run("on_load_finished");
421
459
  case 9:
422
- return _context12.abrupt("return", true);
460
+ return _context13.abrupt("return", true);
423
461
  case 10:
424
462
  case "end":
425
- return _context12.stop();
463
+ return _context13.stop();
426
464
  }
427
- }, _callee12, this);
465
+ }, _callee13, this);
428
466
  }))).apply(this, arguments);
429
467
  }
430
468
  /**
@@ -435,49 +473,53 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
435
473
  }, {
436
474
  key: "onSave",
437
475
  value: function onSave() {
438
- return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
439
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
440
- while (1) switch (_context13.prev = _context13.next) {
476
+ return (_onSave = _onSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
477
+ var srt;
478
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
479
+ while (1) switch (_context14.prev = _context14.next) {
441
480
  case 0:
442
- _context13.next = 2;
443
- return this.event_run("on_save");
444
- case 2:
445
- _context13.next = 4;
481
+ srt = this.getSaveResultType();
482
+ _context14.next = 3;
483
+ return this.event_run("on_save", srt);
484
+ case 3:
485
+ _context14.next = 5;
446
486
  return this.event_run("on_change", true);
447
- case 4:
448
- _context13.next = 6;
487
+ case 5:
488
+ _context14.next = 7;
449
489
  return Promise.resolve(true);
450
- case 6:
451
- return _context13.abrupt("return", _context13.sent);
452
490
  case 7:
491
+ return _context14.abrupt("return", _context14.sent);
492
+ case 8:
453
493
  case "end":
454
- return _context13.stop();
494
+ return _context14.stop();
455
495
  }
456
- }, _callee13, this);
496
+ }, _callee14, this);
457
497
  }))).apply(this, arguments);
458
498
  }
459
499
  }, {
460
500
  key: "onAfterSave",
461
501
  value: function onAfterSave() {
462
- return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
463
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
464
- while (1) switch (_context14.prev = _context14.next) {
502
+ return (_onAfterSave = _onAfterSave || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
503
+ var srt;
504
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
505
+ while (1) switch (_context15.prev = _context15.next) {
465
506
  case 0:
466
- _context14.next = 2;
467
- return this.event_run("on_after_save");
468
- case 2:
469
- _context14.next = 4;
470
- return this.event_run("on_save_finished");
471
- case 4:
472
- _context14.next = 6;
507
+ srt = this.getSaveResultType();
508
+ _context15.next = 3;
509
+ return this.event_run("on_after_save", srt);
510
+ case 3:
511
+ _context15.next = 5;
512
+ return this.event_run("on_save_finished", srt);
513
+ case 5:
514
+ _context15.next = 7;
473
515
  return Promise.resolve(true);
474
- case 6:
475
- return _context14.abrupt("return", _context14.sent);
476
516
  case 7:
517
+ return _context15.abrupt("return", _context15.sent);
518
+ case 8:
477
519
  case "end":
478
- return _context14.stop();
520
+ return _context15.stop();
479
521
  }
480
- }, _callee14, this);
522
+ }, _callee15, this);
481
523
  }))).apply(this, arguments);
482
524
  }
483
525
  }]);
@@ -38,9 +38,9 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
38
38
  get isNew(): boolean;
39
39
  get isSaved(): boolean;
40
40
  get __cache_name(): string;
41
- getSaveResult(): any;
41
+ getSaveResult(): any | null;
42
42
  getSaveResultType(): saveResultType | null;
43
- setSaveResult(toObj: any, type: saveResultType): void | undefined;
43
+ setSaveResult(toObj: any, type: saveResultType): saveResultType | undefined;
44
44
  apply_changes(): boolean;
45
45
  getValue(key: PropOf<ObjType>, original?: boolean): import("./SimpleObject").PropType<ObjType, any> | null;
46
46
  get: (key: PropOf<ObjType>, original?: boolean) => import("./SimpleObject").PropType<ObjType, any> | null;
@@ -152,7 +152,7 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
152
152
  key: "getSaveResult",
153
153
  value: function getSaveResult() {
154
154
  var _this$obj5;
155
- return ((_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.getSaveResult()) || undefined;
155
+ return ((_this$obj5 = this.obj) === null || _this$obj5 === void 0 ? void 0 : _this$obj5.getSaveResult()) || null;
156
156
  }
157
157
  }, {
158
158
  key: "getSaveResultType",
@@ -191,7 +191,7 @@ export declare class SimpleObject extends MapableObject {
191
191
  * and its type
192
192
  * @param toObj
193
193
  */
194
- setSaveResult(toObj: any, type?: saveResultType | "auto", registerErrors?: boolean): void;
194
+ setSaveResult(toObj: any, type?: saveResultType | "auto", registerErrors?: boolean): saveResultType;
195
195
  getSaveResult(original?: boolean): any;
196
196
  getSaveResultType(): saveResultType;
197
197
  static setTemp(obj: SimpleObject | any, key: string, value: any, sendChanges?: sendChangesType): Promise<void>;
@@ -877,6 +877,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
877
877
  SimpleObject.addError(this, "save result is not valid", "the response from server was not valid", true);
878
878
  }
879
879
  this.__saveResultType = type;
880
+ return type;
880
881
  }
881
882
  }, {
882
883
  key: "getSaveResult",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.95",
3
+ "version": "1.4.97",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",