@azrico/webobject 1.4.51 → 1.4.53

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.
@@ -18,6 +18,18 @@ export declare class WebObject extends SimpleObject {
18
18
  _creator?: string;
19
19
  _users?: string[];
20
20
  constructor(is_readonly?: boolean);
21
+ /**
22
+ * get a list of all users that work on this object
23
+ * _creator + _users + attentions(old)
24
+ * @returns
25
+ */
26
+ getAllUsers(): string[];
27
+ /**
28
+ * get a list of all users that work on the given object
29
+ * _creator + _users + attentions(old)
30
+ * @returns
31
+ */
32
+ static getAllUsers(obj: any): string[];
21
33
  /**
22
34
  * Update meta value of this object , meta data is stored in meta_data variable
23
35
  * @param key
@@ -57,20 +57,35 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
57
57
  _this.meta_data = [];
58
58
  return _this;
59
59
  }
60
- /* -------------------------------------------------------------------------- */
61
- /* Meta data */
62
- /* -------------------------------------------------------------------------- */
63
60
  /**
64
- * Update meta value of this object , meta data is stored in meta_data variable
65
- * @param key
66
- * @param value
67
- * @param createIfNotExists should we create a new meta if key does not exist
68
- * @param sendChange
61
+ * get a list of all users that work on this object
62
+ * _creator + _users + attentions(old)
69
63
  * @returns
70
64
  */
71
65
  _createClass(WebObject, [{
66
+ key: "getAllUsers",
67
+ value: function getAllUsers() {
68
+ return WebObject.getAllUsers(this);
69
+ }
70
+ /**
71
+ * get a list of all users that work on the given object
72
+ * _creator + _users + attentions(old)
73
+ * @returns
74
+ */
75
+ }, {
72
76
  key: "setMetaValue",
73
- value: function setMetaValue(key, value) {
77
+ value: /* -------------------------------------------------------------------------- */
78
+ /* Meta data */
79
+ /* -------------------------------------------------------------------------- */
80
+ /**
81
+ * Update meta value of this object , meta data is stored in meta_data variable
82
+ * @param key
83
+ * @param value
84
+ * @param createIfNotExists should we create a new meta if key does not exist
85
+ * @param sendChange
86
+ * @returns
87
+ */
88
+ function setMetaValue(key, value) {
74
89
  var createIfNotExists = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
75
90
  var sendChange = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "auto";
76
91
  if (!this.canModify) {
@@ -548,6 +563,11 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
548
563
  return WebObject.saveResultHasID(s);
549
564
  }
550
565
  }], [{
566
+ key: "getAllUsers",
567
+ value: function getAllUsers(obj) {
568
+ return (0, _object.array_remove_duplicates)((0, _object.array_merge)(obj._creator, (0, _object.wrap_array)(obj._users), (0, _object.wrap_array)(obj.attentions)));
569
+ }
570
+ }, {
551
571
  key: "getMeta",
552
572
  value: function getMeta(o, key) {
553
573
  if (o == null) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.51",
3
+ "version": "1.4.53",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "@azrico/global": "*",
66
66
  "@azrico/object": "*",
67
67
  "@azrico/string": "*",
68
- "@azrico/uid": "^*",
68
+ "@azrico/uid": "*",
69
69
  "lodash.clonedeep": "*"
70
70
  },
71
71
  "dependencies": {