@azrico/webobject 1.4.97 → 1.4.99

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,45 +42,47 @@ 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;
46
- _this.event_add("on_save", "on_save-sendmsg", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
47
- return _regeneratorRuntime().wrap(function _callee$(_context) {
48
- while (1) switch (_context.prev = _context.next) {
49
- case 0:
50
- _context.t0 = _this.getSaveResultType();
51
- _context.next = _context.t0 === "nothing" ? 3 : _context.t0 === "normal" ? 6 : 9;
52
- break;
53
- case 3:
54
- _context.next = 5;
55
- return _global.gfunc.run_action("show_message", {
56
- message: "Nothing to save",
57
- type: "info"
58
- });
59
- case 5:
60
- return _context.abrupt("return", _context.sent);
61
- case 6:
62
- _context.next = 8;
63
- return _global.gfunc.run_action("show_message", {
64
- message: "Saved",
65
- type: "success"
66
- });
67
- case 8:
68
- return _context.abrupt("return", _context.sent);
69
- case 9:
70
- _context.next = 11;
71
- return _global.gfunc.run_action("show_message", {
72
- message: "Not saved",
73
- type: "error"
74
- });
75
- case 11:
76
- return _context.abrupt("return", _context.sent);
77
- case 12:
78
- case "end":
79
- return _context.stop();
80
- }
81
- }, _callee);
82
- })));
83
- _this.event_add("on_archive", "on_archive-sendmsg", function (_x) {
45
+ var _ref, _ref2, _ref3, _ref4;
46
+ _this.event_add("on_save", "on_save-sendmsg", function (_x) {
47
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(srt) {
48
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
49
+ while (1) switch (_context.prev = _context.next) {
50
+ case 0:
51
+ _context.t0 = srt;
52
+ _context.next = _context.t0 === "nothing" ? 3 : _context.t0 === "normal" ? 6 : 9;
53
+ break;
54
+ case 3:
55
+ _context.next = 5;
56
+ return _global.gfunc.run_action("show_message", {
57
+ message: "Nothing to save",
58
+ type: "info"
59
+ });
60
+ case 5:
61
+ return _context.abrupt("return", _context.sent);
62
+ case 6:
63
+ _context.next = 8;
64
+ return _global.gfunc.run_action("show_message", {
65
+ message: "Saved",
66
+ type: "success"
67
+ });
68
+ case 8:
69
+ return _context.abrupt("return", _context.sent);
70
+ case 9:
71
+ _context.next = 11;
72
+ return _global.gfunc.run_action("show_message", {
73
+ message: "Not saved",
74
+ type: "error"
75
+ });
76
+ case 11:
77
+ return _context.abrupt("return", _context.sent);
78
+ case 12:
79
+ case "end":
80
+ return _context.stop();
81
+ }
82
+ }, _callee);
83
+ }))).apply(this, arguments);
84
+ });
85
+ _this.event_add("on_archive", "on_archive-sendmsg", function (_x2) {
84
86
  return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(srType) {
85
87
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
86
88
  while (1) switch (_context2.prev = _context2.next) {
@@ -111,7 +113,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
111
113
  }, _callee2);
112
114
  }))).apply(this, arguments);
113
115
  });
114
- _this.event_add("on_unarchive", "on_unarchive-sendmsg", function (_x2) {
116
+ _this.event_add("on_unarchive", "on_unarchive-sendmsg", function (_x3) {
115
117
  return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(srType) {
116
118
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
117
119
  while (1) switch (_context3.prev = _context3.next) {
@@ -142,7 +144,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
142
144
  }, _callee3);
143
145
  }))).apply(this, arguments);
144
146
  });
145
- _this.event_add("on_delete", "on_delete-sendmsg", function (_x3) {
147
+ _this.event_add("on_delete", "on_delete-sendmsg", function (_x4) {
146
148
  return (_ref4 = _ref4 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(srType) {
147
149
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
148
150
  while (1) switch (_context4.prev = _context4.next) {
@@ -200,7 +202,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
200
202
  */
201
203
  }, {
202
204
  key: "setMetaValue",
203
- value: function setMetaValue(_x4, _x5) {
205
+ value: function setMetaValue(_x5, _x6) {
204
206
  return (_setMetaValue = _setMetaValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
205
207
  var _this$obj;
206
208
  var sendChange,
@@ -281,7 +283,7 @@ var WebObjectManager = /*#__PURE__*/function (_ObjectManager, _setMetaValue, _ge
281
283
  }
282
284
  }, {
283
285
  key: "Load",
284
- value: function Load(_x6) {
286
+ value: function Load(_x7) {
285
287
  return (_Load = _Load || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(search) {
286
288
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
287
289
  while (1) switch (_context8.prev = _context8.next) {
@@ -1,4 +1,4 @@
1
- import { convObject } from "@azrico/convert";
1
+ import { formatObject } from "@azrico/convert";
2
2
  import { MapableObject } from "./MapableObject";
3
3
  import ObjectManager from "./ObjectManager";
4
4
  export type saveResultType = "normal" | "nothing" | "error" | "canceled";
@@ -14,7 +14,7 @@ export declare class SimpleObject extends MapableObject {
14
14
  static readonly __changeables?: string[];
15
15
  static readonly __protectedProperties?: string[];
16
16
  static readonly __functionProperties?: string[];
17
- static readonly __formatList?: convObject;
17
+ static readonly __formatList?: formatObject;
18
18
  static readonly __extraProperties?: string[];
19
19
  static readonly __childTypes?: any[];
20
20
  static readonly __importColumns?: string[];
@@ -196,7 +196,7 @@ export declare class SimpleObject extends MapableObject {
196
196
  getSaveResultType(): saveResultType;
197
197
  static setTemp(obj: SimpleObject | any, key: string, value: any, sendChanges?: sendChangesType): Promise<void>;
198
198
  static factoryClear(obj: SimpleObject): void;
199
- static delete_cache(): void;
199
+ static delete_cache(context?: string): Promise<void>;
200
200
  static get_canModify(o: SimpleObject): boolean;
201
201
  static equals(a?: SimpleObject | any, b?: SimpleObject | any): boolean;
202
202
  }
@@ -46,7 +46,7 @@ var _getProperty = /*#__PURE__*/new WeakSet();
46
46
  var _getTempProperty = /*#__PURE__*/new WeakSet();
47
47
  var _setTempProperty = /*#__PURE__*/new WeakSet();
48
48
  var _setSaveResultObject = /*#__PURE__*/new WeakSet();
49
- var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _setAll, _setSubValue, _pushValue, _notifyChanged, _reset, _resetAll, _event_run, _event_add, _setTemp2) {
49
+ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _setAll, _setSubValue, _pushValue, _notifyChanged, _reset, _resetAll, _event_run, _event_add, _setTemp2, _delete_cache) {
50
50
  _inherits(SimpleObject, _MapableObject);
51
51
  var _super = _createSuper(SimpleObject);
52
52
  function SimpleObject() {
@@ -1179,9 +1179,37 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
1179
1179
  }
1180
1180
  }, {
1181
1181
  key: "delete_cache",
1182
- value: function delete_cache() {
1183
- if (!this.__cache_name) return;
1184
- _global.gcache.delete_session_cache(this.__cache_name);
1182
+ value: function delete_cache(_x23) {
1183
+ return (_delete_cache = _delete_cache || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(context) {
1184
+ var cacheKey;
1185
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1186
+ while (1) switch (_context12.prev = _context12.next) {
1187
+ case 0:
1188
+ if (this.__cache_name) {
1189
+ _context12.next = 2;
1190
+ break;
1191
+ }
1192
+ return _context12.abrupt("return");
1193
+ case 2:
1194
+ if (context) {
1195
+ _context12.next = 7;
1196
+ break;
1197
+ }
1198
+ _context12.next = 5;
1199
+ return _global.gcache.delete_session_cache(this.__cache_name);
1200
+ case 5:
1201
+ _context12.next = 10;
1202
+ break;
1203
+ case 7:
1204
+ cacheKey = "".concat(this.__cache_name, "-").concat(context);
1205
+ _context12.next = 10;
1206
+ return _global.gcache.delete_session_cache(cacheKey);
1207
+ case 10:
1208
+ case "end":
1209
+ return _context12.stop();
1210
+ }
1211
+ }, _callee12, this);
1212
+ }))).apply(this, arguments);
1185
1213
  }
1186
1214
  }, {
1187
1215
  key: "get_canModify",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.97",
3
+ "version": "1.4.99",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",
@@ -71,12 +71,12 @@
71
71
  "@azrico/uid": "*"
72
72
  },
73
73
  "dependencies": {
74
- "@azrico/convert": "^1.0.3",
74
+ "@azrico/convert": "^1.0.5",
75
75
  "@azrico/event": "^1.2.17",
76
- "@azrico/global": "^1.3.50",
77
- "@azrico/math": "^1.0.3",
78
- "@azrico/object": "^1.4.87",
79
- "@azrico/string": "^1.2.84",
76
+ "@azrico/global": "^1.3.65",
77
+ "@azrico/math": "^1.0.5",
78
+ "@azrico/object": "^1.4.91",
79
+ "@azrico/string": "^1.2.88",
80
80
  "@azrico/types": "^1.0.4",
81
81
  "@azrico/uid": "^1.0.5"
82
82
  },