@azrico/webobject 1.4.155 → 1.4.157

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.
@@ -17,7 +17,6 @@ export declare class WebObject extends SimpleObject {
17
17
  meta_data: {
18
18
  [key: string]: any;
19
19
  };
20
- _id: string;
21
20
  _created_date?: string | Date;
22
21
  _creator?: string;
23
22
  _users?: string[];
@@ -43,7 +43,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
43
43
  _classCallCheck(this, WebObject);
44
44
  _this = _callSuper(this, WebObject, [is_readonly]);
45
45
  _defineProperty(_assertThisInitialized(_this), "meta_data", void 0);
46
- _defineProperty(_assertThisInitialized(_this), "_id", "");
46
+ //created date
47
47
  _defineProperty(_assertThisInitialized(_this), "_created_date", void 0);
48
48
  //the owner of the object
49
49
  _defineProperty(_assertThisInitialized(_this), "_creator", void 0);
@@ -9,7 +9,7 @@ export declare class WebObjectManager<T extends WebObject> extends ObjectManager
9
9
  static readonly __save_message: boolean;
10
10
  protected __last_web_path: string;
11
11
  protected __last_web_type: string;
12
- constructor();
12
+ constructor(defaultObject?: T);
13
13
  setObject(toObj: T | undefined): boolean;
14
14
  /**
15
15
  * Update meta value of this object , meta data is stored in meta_data variable
@@ -33,10 +33,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
33
33
  var WebObjectManager = exports.WebObjectManager = /*#__PURE__*/function (_ObjectManager) {
34
34
  _inherits(WebObjectManager, _ObjectManager);
35
35
  /* -------------------------------------------------------------------------- */
36
- function WebObjectManager() {
36
+ function WebObjectManager(defaultObject) {
37
37
  var _this;
38
38
  _classCallCheck(this, WebObjectManager);
39
- _this = _callSuper(this, WebObjectManager);
39
+ _this = _callSuper(this, WebObjectManager, [defaultObject]);
40
40
  /* ---------------- should we display a message after saving ? -------------- */
41
41
  _defineProperty(_assertThisInitialized(_this), "__last_web_path", "");
42
42
  _defineProperty(_assertThisInitialized(_this), "__last_web_type", "");
@@ -5,7 +5,6 @@ declare type FirstInTuple<T extends any[]> = ((...args: T) => any) extends (arg:
5
5
  */
6
6
  export declare class MapableObject extends ObjectWithTemp {
7
7
  readonly __uid: string;
8
- __data_id?: string;
9
8
  __table_id?: string;
10
9
  __parent__table_id?: string;
11
10
  __row_number?: number;
@@ -34,7 +34,6 @@ var MapableObject = exports.MapableObject = /*#__PURE__*/function (_ObjectWithTe
34
34
  _classCallCheck(this, MapableObject);
35
35
  _this = _callSuper(this, MapableObject);
36
36
  _defineProperty(_assertThisInitialized(_this), "__uid", void 0);
37
- _defineProperty(_assertThisInitialized(_this), "__data_id", void 0);
38
37
  _defineProperty(_assertThisInitialized(_this), "__table_id", void 0);
39
38
  _defineProperty(_assertThisInitialized(_this), "__parent__table_id", void 0);
40
39
  _defineProperty(_assertThisInitialized(_this), "__row_number", void 0);
@@ -14,6 +14,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> extends RawObje
14
14
  protected __currentObject?: ObjType | null;
15
15
  protected __options?: object;
16
16
  __object_nullable: boolean;
17
+ constructor(defaultObject?: ObjType);
17
18
  notifyChanged(type: string, key: PropOf<ObjType> | string, value?: any, subvalue?: string): Promise<false | any[] | undefined>;
18
19
  /**
19
20
  * Get the object this manager is managing
@@ -35,13 +35,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
35
35
  */
36
36
  var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
37
37
  _inherits(ObjectManager, _RawObject);
38
- function ObjectManager() {
38
+ function ObjectManager(defaultObject) {
39
39
  var _this;
40
40
  _classCallCheck(this, ObjectManager);
41
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
- args[_key] = arguments[_key];
43
- }
44
- _this = _callSuper(this, ObjectManager, [].concat(args));
41
+ _this = _callSuper(this, ObjectManager);
45
42
  _defineProperty(_assertThisInitialized(_this), "__eventList", {});
46
43
  _defineProperty(_assertThisInitialized(_this), "__eventPrefix", void 0);
47
44
  _defineProperty(_assertThisInitialized(_this), "__stopEvents", void 0);
@@ -50,6 +47,7 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
50
47
  //can the current object be set to null safely?
51
48
  _defineProperty(_assertThisInitialized(_this), "__object_nullable", false);
52
49
  _defineProperty(_assertThisInitialized(_this), "get", _this.getValue);
50
+ _this.setObject(defaultObject);
53
51
  return _this;
54
52
  }
55
53
  _createClass(ObjectManager, [{
@@ -453,9 +451,9 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
453
451
  key: "event_run",
454
452
  value: (function () {
455
453
  var _event_run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventName) {
456
- var _len2,
454
+ var _len,
457
455
  params,
458
- _key2,
456
+ _key,
459
457
  _args7 = arguments;
460
458
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
461
459
  while (1) switch (_context7.prev = _context7.next) {
@@ -466,8 +464,8 @@ var ObjectManager = exports.ObjectManager = /*#__PURE__*/function (_RawObject) {
466
464
  }
467
465
  return _context7.abrupt("return");
468
466
  case 2:
469
- for (_len2 = _args7.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
470
- params[_key2 - 1] = _args7[_key2];
467
+ for (_len = _args7.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
468
+ params[_key - 1] = _args7[_key];
471
469
  }
472
470
  _context7.next = 5;
473
471
  return _event.EventManager.run.apply(_event.EventManager, [this, eventName].concat(params));
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This object can be mapped and converted
2
+ * This object supports temp values
3
3
  */
4
4
  export declare class ObjectWithTemp {
5
5
  #private;
@@ -19,7 +19,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
19
19
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
20
  function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
21
21
  /**
22
- * This object can be mapped and converted
22
+ * This object supports temp values
23
23
  */
24
24
  var _getTempProperty = /*#__PURE__*/new WeakSet();
25
25
  var _setTempProperty = /*#__PURE__*/new WeakSet();
@@ -39,6 +39,7 @@ export declare class SimpleObject extends MapableObject {
39
39
  protected __saveResultObject?: any;
40
40
  protected __saveResultIsSuccess: boolean;
41
41
  protected __saveResultType?: saveResultType;
42
+ _id: string;
42
43
  _index_key: string;
43
44
  _index_value: number;
44
45
  constructor(is_readonly?: boolean);
@@ -86,6 +86,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
86
86
  _defineProperty(_assertThisInitialized(_this), "__saveResultObject", void 0);
87
87
  _defineProperty(_assertThisInitialized(_this), "__saveResultIsSuccess", true);
88
88
  _defineProperty(_assertThisInitialized(_this), "__saveResultType", void 0);
89
+ _defineProperty(_assertThisInitialized(_this), "_id", "");
89
90
  //sequence key (usually managed by the database)
90
91
  _defineProperty(_assertThisInitialized(_this), "_index_key", "");
91
92
  //sequence value , used to index the object with increasing numbers
@@ -118,6 +119,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
118
119
  return undefined;
119
120
  });
120
121
  _this.__is_readonly = is_readonly;
122
+ if (_this._id) _this.__table_id = _this._id;
121
123
  _this.clear_changes();
122
124
  return _this;
123
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.155",
3
+ "version": "1.4.157",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",