@ricado/api-client 1.2.6 → 2.0.0

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.
Files changed (141) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  3. package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  4. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +4 -4
  5. package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  6. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  7. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  8. package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  9. package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  10. package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  11. package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  12. package/lib/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  13. package/lib/Controllers/Packhouse/Site/PackingLineController.js +4 -4
  14. package/lib/Controllers/Packhouse/Site/PackrunController.js +4 -4
  15. package/lib/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  16. package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +4 -4
  17. package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  18. package/lib/Controllers/Packhouse/Site/ShiftController.js +4 -4
  19. package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  20. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +4 -4
  21. package/lib/Controllers/Packhouse/Site/VarietyController.js +4 -4
  22. package/lib/Controllers/Site/AlarmController.js +4 -4
  23. package/lib/Controllers/Site/AlarmGroupController.js +4 -4
  24. package/lib/Controllers/Site/DefinitionController.js +4 -4
  25. package/lib/Controllers/Site/PermanentObjectController.js +4 -4
  26. package/lib/Controllers/Site/PermanentObjectDataController.js +4 -4
  27. package/lib/Controllers/Site/PointController.js +6 -4
  28. package/lib/Controllers/Site/TemporaryObjectController.js +4 -4
  29. package/lib/Models/AccountPolicyModel.js +26 -130
  30. package/lib/Models/ApiAccountModel.js +26 -130
  31. package/lib/Models/CompanyModel.js +20 -98
  32. package/lib/Models/FirebaseTokenModel.js +29 -146
  33. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +40 -192
  34. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +37 -176
  35. package/lib/Models/Packhouse/Site/CompacSizerModel.js +55 -272
  36. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +43 -208
  37. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +37 -176
  38. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +31 -144
  39. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +49 -240
  40. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +55 -272
  41. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +37 -176
  42. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +31 -144
  43. package/lib/Models/Packhouse/Site/PackTypeModel.js +37 -176
  44. package/lib/Models/Packhouse/Site/PackingLineModel.js +58 -288
  45. package/lib/Models/Packhouse/Site/PackrunModel.js +58 -288
  46. package/lib/Models/Packhouse/Site/RejectBinModel.js +40 -192
  47. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +49 -240
  48. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +43 -208
  49. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +49 -240
  50. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +124 -640
  51. package/lib/Models/Packhouse/Site/ShiftModel.js +70 -352
  52. package/lib/Models/Packhouse/Site/VarietyModel.js +37 -176
  53. package/lib/Models/RTUModel.js +23 -114
  54. package/lib/Models/RTUPluginModel.js +20 -98
  55. package/lib/Models/Site/AlarmGroupModel.js +34 -160
  56. package/lib/Models/Site/AlarmModel.js +64 -320
  57. package/lib/Models/Site/DefinitionModel.js +31 -144
  58. package/lib/Models/Site/PermanentObjectDataModel.js +37 -176
  59. package/lib/Models/Site/PermanentObjectModel.js +34 -160
  60. package/lib/Models/Site/PointModel.js +46 -224
  61. package/lib/Models/Site/TemporaryObjectModel.js +31 -144
  62. package/lib/Models/Site/index.js +0 -3
  63. package/lib/Models/SiteModel.js +23 -114
  64. package/lib/Models/TokenModel.js +35 -178
  65. package/lib/Models/UserAccountActionTokenModel.js +38 -194
  66. package/lib/Models/UserAccountModel.js +35 -178
  67. package/lib/PackageVersion.js +1 -1
  68. package/lib/Points.js +9 -1
  69. package/lib/index.d.ts +842 -1591
  70. package/lib/index.js +67 -38
  71. package/package.json +2 -2
  72. package/src/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  73. package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  74. package/src/Controllers/Packhouse/Site/CompacSizerController.js +4 -4
  75. package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  76. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  77. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  78. package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  79. package/src/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  80. package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  81. package/src/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  82. package/src/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  83. package/src/Controllers/Packhouse/Site/PackingLineController.js +4 -4
  84. package/src/Controllers/Packhouse/Site/PackrunController.js +4 -4
  85. package/src/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  86. package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +4 -4
  87. package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  88. package/src/Controllers/Packhouse/Site/ShiftController.js +4 -4
  89. package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  90. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +4 -4
  91. package/src/Controllers/Packhouse/Site/VarietyController.js +4 -4
  92. package/src/Controllers/Site/AlarmController.js +4 -4
  93. package/src/Controllers/Site/AlarmGroupController.js +4 -4
  94. package/src/Controllers/Site/DefinitionController.js +4 -4
  95. package/src/Controllers/Site/PermanentObjectController.js +4 -4
  96. package/src/Controllers/Site/PermanentObjectDataController.js +4 -4
  97. package/src/Controllers/Site/PointController.js +6 -4
  98. package/src/Controllers/Site/TemporaryObjectController.js +4 -4
  99. package/src/Models/AccountPolicyModel.js +21 -117
  100. package/src/Models/ApiAccountModel.js +21 -117
  101. package/src/Models/CompanyModel.js +15 -87
  102. package/src/Models/FirebaseTokenModel.js +24 -132
  103. package/src/Models/Packhouse/Site/BinTipWeightModel.js +33 -174
  104. package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +30 -159
  105. package/src/Models/Packhouse/Site/CompacSizerModel.js +48 -249
  106. package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +36 -189
  107. package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +30 -159
  108. package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +24 -129
  109. package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +42 -219
  110. package/src/Models/Packhouse/Site/DowntimeEventModel.js +48 -249
  111. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +30 -159
  112. package/src/Models/Packhouse/Site/GrowingMethodModel.js +24 -129
  113. package/src/Models/Packhouse/Site/PackTypeModel.js +30 -159
  114. package/src/Models/Packhouse/Site/PackingLineModel.js +51 -264
  115. package/src/Models/Packhouse/Site/PackrunModel.js +51 -264
  116. package/src/Models/Packhouse/Site/RejectBinModel.js +33 -174
  117. package/src/Models/Packhouse/Site/RejectBinScaleModel.js +42 -219
  118. package/src/Models/Packhouse/Site/RejectBinWeightModel.js +36 -189
  119. package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +42 -219
  120. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +117 -594
  121. package/src/Models/Packhouse/Site/ShiftModel.js +63 -324
  122. package/src/Models/Packhouse/Site/VarietyModel.js +30 -159
  123. package/src/Models/RTUModel.js +18 -102
  124. package/src/Models/RTUPluginModel.js +15 -87
  125. package/src/Models/Site/AlarmGroupModel.js +27 -144
  126. package/src/Models/Site/AlarmModel.js +57 -294
  127. package/src/Models/Site/DefinitionModel.js +24 -129
  128. package/src/Models/Site/PermanentObjectDataModel.js +30 -159
  129. package/src/Models/Site/PermanentObjectModel.js +27 -144
  130. package/src/Models/Site/PointModel.js +39 -204
  131. package/src/Models/Site/TemporaryObjectModel.js +24 -129
  132. package/src/Models/Site/index.js +0 -2
  133. package/src/Models/SiteModel.js +18 -102
  134. package/src/Models/TokenModel.js +30 -162
  135. package/src/Models/UserAccountActionTokenModel.js +33 -177
  136. package/src/Models/UserAccountModel.js +30 -162
  137. package/src/PackageVersion.js +1 -1
  138. package/src/Points.js +11 -1
  139. package/src/index.js +35 -3
  140. package/lib/Models/Site/BaseSiteModel.js +0 -58
  141. package/src/Models/Site/BaseSiteModel.js +0 -30
@@ -4,24 +4,23 @@
4
4
  * Do Not Edit this File Manually!
5
5
  */
6
6
 
7
- import BaseSiteModel from '../../Models/Site/BaseSiteModel';
7
+ import BaseModel from '../../Models/BaseModel';
8
8
 
9
9
  /**
10
10
  * Model Class for a Permanent Object
11
11
  *
12
12
  * @class
13
13
  * @hideconstructor
14
- * @extends BaseSiteModel
14
+ * @extends BaseModel
15
15
  */
16
- class PermanentObjectModel extends BaseSiteModel
16
+ class PermanentObjectModel extends BaseModel
17
17
  {
18
18
  /**
19
19
  * PermanentObjectModel Constructor
20
20
  *
21
21
  * @protected
22
- * @param {number} siteId The Site ID associated with this Permanent Object
23
22
  */
24
- constructor(siteId)
23
+ constructor()
25
24
  {
26
25
  super();
27
26
 
@@ -29,172 +28,57 @@ class PermanentObjectModel extends BaseSiteModel
29
28
  * The Permanent Object ID
30
29
  *
31
30
  * @type {string}
32
- * @private
31
+ * @public
33
32
  */
34
- this._id = undefined;
33
+ this.id = undefined;
35
34
 
36
35
  /**
37
36
  * The RTU this Permanent Object belongs to
38
37
  *
39
38
  * @type {?number}
40
- * @private
39
+ * @public
41
40
  */
42
- this._rtuId = undefined;
41
+ this.rtuId = undefined;
43
42
 
44
43
  /**
45
44
  * The Permanent Object Key Index
46
45
  *
47
46
  * @type {string}
48
- * @private
47
+ * @public
49
48
  */
50
- this._keyIndex = undefined;
49
+ this.keyIndex = undefined;
51
50
 
52
51
  /**
53
52
  * The Permanent Object Type
54
53
  *
55
54
  * @type {string}
56
- * @private
55
+ * @public
57
56
  */
58
- this._type = undefined;
57
+ this.type = undefined;
59
58
 
60
59
  /**
61
60
  * The Permanent Object Definition
62
61
  *
63
62
  * @type {Object}
64
- * @private
63
+ * @public
65
64
  */
66
- this._definition = undefined;
65
+ this.definition = undefined;
67
66
 
68
67
  /**
69
68
  * Whether the Permanent Object has been deleted
70
69
  *
71
70
  * @type {boolean}
72
- * @private
71
+ * @public
73
72
  */
74
- this._deleted = undefined;
73
+ this.deleted = undefined;
75
74
 
76
75
  /**
77
76
  * When the Permanent Object was last updated
78
77
  *
79
78
  * @type {Date}
80
- * @private
79
+ * @public
81
80
  */
82
- this._updateTimestamp = undefined;
83
-
84
- /**
85
- * The Site ID associated with this Permanent Object
86
- *
87
- * @type {number}
88
- * @private
89
- */
90
- this._siteId = siteId;
91
- }
92
-
93
- /**
94
- * The Permanent Object ID
95
- *
96
- * @public
97
- * @type {string}
98
- */
99
- get id()
100
- {
101
- return this._id;
102
- }
103
-
104
- /**
105
- * The RTU this Permanent Object belongs to
106
- *
107
- * @public
108
- * @type {?number}
109
- */
110
- get rtuId()
111
- {
112
- return this._rtuId;
113
- }
114
-
115
- /**
116
- * The Permanent Object Key Index
117
- *
118
- * @public
119
- * @type {string}
120
- */
121
- get keyIndex()
122
- {
123
- return this._keyIndex;
124
- }
125
-
126
- /**
127
- * The Permanent Object Type
128
- *
129
- * @public
130
- * @type {string}
131
- */
132
- get type()
133
- {
134
- return this._type;
135
- }
136
-
137
- /**
138
- * The Permanent Object Definition
139
- *
140
- * @public
141
- * @type {Object}
142
- */
143
- get definition()
144
- {
145
- return this._definition;
146
- }
147
-
148
- /**
149
- * Whether the Permanent Object has been deleted
150
- *
151
- * @public
152
- * @type {boolean}
153
- */
154
- get deleted()
155
- {
156
- return this._deleted;
157
- }
158
-
159
- /**
160
- * When the Permanent Object was last updated
161
- *
162
- * @public
163
- * @type {Date}
164
- */
165
- get updateTimestamp()
166
- {
167
- return this._updateTimestamp;
168
- }
169
-
170
- /**
171
- * The Site ID associated with this Permanent Object
172
- *
173
- * @public
174
- * @type {number}
175
- */
176
- get siteId()
177
- {
178
- return this._siteId;
179
- }
180
-
181
- /**
182
- * Convert this **PermanentObjectModel** to a JSON Object
183
- *
184
- * @public
185
- * @return {Object<string, any>}
186
- */
187
- toJSON()
188
- {
189
- return {
190
- id: this._id,
191
- rtuId: this._rtuId,
192
- keyIndex: this._keyIndex,
193
- type: this._type,
194
- definition: this._definition,
195
- deleted: this._deleted,
196
- updateTimestamp: this._updateTimestamp
197
- };
81
+ this.updateTimestamp = undefined;
198
82
  }
199
83
 
200
84
  /**
@@ -203,12 +87,11 @@ class PermanentObjectModel extends BaseSiteModel
203
87
  * @static
204
88
  * @public
205
89
  * @param {Object<string, any>|string} json A JSON Object or JSON String
206
- * @param {number} siteId The Site ID associated with this Permanent Object
207
90
  * @return {PermanentObjectModel}
208
91
  */
209
- static fromJSON(json, siteId)
92
+ static fromJSON(json)
210
93
  {
211
- let model = new PermanentObjectModel(siteId);
94
+ let model = new PermanentObjectModel();
212
95
 
213
96
  /**
214
97
  * The JSON Object
@@ -228,7 +111,7 @@ class PermanentObjectModel extends BaseSiteModel
228
111
 
229
112
  if('id' in jsonObject)
230
113
  {
231
- model._id = (function(){
114
+ model.id = (function(){
232
115
  if(typeof jsonObject['id'] !== 'string')
233
116
  {
234
117
  return String(jsonObject['id']);
@@ -240,7 +123,7 @@ class PermanentObjectModel extends BaseSiteModel
240
123
 
241
124
  if('rtuId' in jsonObject)
242
125
  {
243
- model._rtuId = (function(){
126
+ model.rtuId = (function(){
244
127
  if(jsonObject['rtuId'] === null)
245
128
  {
246
129
  return null;
@@ -257,7 +140,7 @@ class PermanentObjectModel extends BaseSiteModel
257
140
 
258
141
  if('keyIndex' in jsonObject)
259
142
  {
260
- model._keyIndex = (function(){
143
+ model.keyIndex = (function(){
261
144
  if(typeof jsonObject['keyIndex'] !== 'string')
262
145
  {
263
146
  return String(jsonObject['keyIndex']);
@@ -269,7 +152,7 @@ class PermanentObjectModel extends BaseSiteModel
269
152
 
270
153
  if('type' in jsonObject)
271
154
  {
272
- model._type = (function(){
155
+ model.type = (function(){
273
156
  if(typeof jsonObject['type'] !== 'string')
274
157
  {
275
158
  return String(jsonObject['type']);
@@ -281,7 +164,7 @@ class PermanentObjectModel extends BaseSiteModel
281
164
 
282
165
  if('definition' in jsonObject)
283
166
  {
284
- model._definition = (function(){
167
+ model.definition = (function(){
285
168
  if(typeof jsonObject['definition'] !== 'object')
286
169
  {
287
170
  return Object(jsonObject['definition']);
@@ -293,7 +176,7 @@ class PermanentObjectModel extends BaseSiteModel
293
176
 
294
177
  if('deleted' in jsonObject)
295
178
  {
296
- model._deleted = (function(){
179
+ model.deleted = (function(){
297
180
  if(typeof jsonObject['deleted'] !== 'boolean')
298
181
  {
299
182
  return Boolean(jsonObject['deleted']);
@@ -305,7 +188,7 @@ class PermanentObjectModel extends BaseSiteModel
305
188
 
306
189
  if('updateTimestamp' in jsonObject)
307
190
  {
308
- model._updateTimestamp = (function(){
191
+ model.updateTimestamp = (function(){
309
192
  if(typeof jsonObject['updateTimestamp'] !== 'string')
310
193
  {
311
194
  return new Date(String(jsonObject['updateTimestamp']));
@@ -4,24 +4,23 @@
4
4
  * Do Not Edit this File Manually!
5
5
  */
6
6
 
7
- import BaseSiteModel from '../../Models/Site/BaseSiteModel';
7
+ import BaseModel from '../../Models/BaseModel';
8
8
 
9
9
  /**
10
10
  * Model Class for a Point
11
11
  *
12
12
  * @class
13
13
  * @hideconstructor
14
- * @extends BaseSiteModel
14
+ * @extends BaseModel
15
15
  */
16
- class PointModel extends BaseSiteModel
16
+ class PointModel extends BaseModel
17
17
  {
18
18
  /**
19
19
  * PointModel Constructor
20
20
  *
21
21
  * @protected
22
- * @param {number} siteId The Site ID associated with this Point
23
22
  */
24
- constructor(siteId)
23
+ constructor()
25
24
  {
26
25
  super();
27
26
 
@@ -29,252 +28,89 @@ class PointModel extends BaseSiteModel
29
28
  * The Point ID
30
29
  *
31
30
  * @type {number}
32
- * @private
31
+ * @public
33
32
  */
34
- this._id = undefined;
33
+ this.id = undefined;
35
34
 
36
35
  /**
37
36
  * The RTU this Point belongs to
38
37
  *
39
38
  * @type {?number}
40
- * @private
39
+ * @public
41
40
  */
42
- this._rtuId = undefined;
41
+ this.rtuId = undefined;
43
42
 
44
43
  /**
45
44
  * The Plugin ID
46
45
  *
47
46
  * @type {?number}
48
- * @private
47
+ * @public
49
48
  */
50
- this._pluginId = undefined;
49
+ this.pluginId = undefined;
51
50
 
52
51
  /**
53
52
  * The Point Name
54
53
  *
55
54
  * @type {string}
56
- * @private
55
+ * @public
57
56
  */
58
- this._name = undefined;
57
+ this.name = undefined;
59
58
 
60
59
  /**
61
60
  * The Point Type
62
61
  *
63
62
  * @type {string}
64
- * @private
63
+ * @public
65
64
  */
66
- this._type = undefined;
65
+ this.type = undefined;
67
66
 
68
67
  /**
69
68
  * The Point's Value Type
70
69
  *
71
70
  * @type {string}
72
- * @private
71
+ * @public
73
72
  */
74
- this._valueType = undefined;
73
+ this.valueType = undefined;
75
74
 
76
75
  /**
77
76
  * The Permissions
78
77
  *
79
78
  * @type {string}
80
- * @private
79
+ * @public
81
80
  */
82
- this._permissions = undefined;
81
+ this.permissions = undefined;
83
82
 
84
83
  /**
85
84
  * Whether the Point is Enabled
86
85
  *
87
86
  * @type {boolean}
88
- * @private
87
+ * @public
89
88
  */
90
- this._enabled = undefined;
89
+ this.enabled = undefined;
91
90
 
92
91
  /**
93
92
  * The Point Settings
94
93
  *
95
94
  * @type {Object}
96
- * @private
95
+ * @public
97
96
  */
98
- this._settings = undefined;
97
+ this.settings = undefined;
99
98
 
100
99
  /**
101
100
  * Whether the Point has been deleted
102
101
  *
103
102
  * @type {boolean}
104
- * @private
103
+ * @public
105
104
  */
106
- this._deleted = undefined;
105
+ this.deleted = undefined;
107
106
 
108
107
  /**
109
108
  * When the Point was last updated
110
109
  *
111
110
  * @type {Date}
112
- * @private
111
+ * @public
113
112
  */
114
- this._updateTimestamp = undefined;
115
-
116
- /**
117
- * The Site ID associated with this Point
118
- *
119
- * @type {number}
120
- * @private
121
- */
122
- this._siteId = siteId;
123
- }
124
-
125
- /**
126
- * The Point ID
127
- *
128
- * @public
129
- * @type {number}
130
- */
131
- get id()
132
- {
133
- return this._id;
134
- }
135
-
136
- /**
137
- * The RTU this Point belongs to
138
- *
139
- * @public
140
- * @type {?number}
141
- */
142
- get rtuId()
143
- {
144
- return this._rtuId;
145
- }
146
-
147
- /**
148
- * The Plugin ID
149
- *
150
- * @public
151
- * @type {?number}
152
- */
153
- get pluginId()
154
- {
155
- return this._pluginId;
156
- }
157
-
158
- /**
159
- * The Point Name
160
- *
161
- * @public
162
- * @type {string}
163
- */
164
- get name()
165
- {
166
- return this._name;
167
- }
168
-
169
- /**
170
- * The Point Type
171
- *
172
- * @public
173
- * @type {string}
174
- */
175
- get type()
176
- {
177
- return this._type;
178
- }
179
-
180
- /**
181
- * The Point's Value Type
182
- *
183
- * @public
184
- * @type {string}
185
- */
186
- get valueType()
187
- {
188
- return this._valueType;
189
- }
190
-
191
- /**
192
- * The Permissions
193
- *
194
- * @public
195
- * @type {string}
196
- */
197
- get permissions()
198
- {
199
- return this._permissions;
200
- }
201
-
202
- /**
203
- * Whether the Point is Enabled
204
- *
205
- * @public
206
- * @type {boolean}
207
- */
208
- get enabled()
209
- {
210
- return this._enabled;
211
- }
212
-
213
- /**
214
- * The Point Settings
215
- *
216
- * @public
217
- * @type {Object}
218
- */
219
- get settings()
220
- {
221
- return this._settings;
222
- }
223
-
224
- /**
225
- * Whether the Point has been deleted
226
- *
227
- * @public
228
- * @type {boolean}
229
- */
230
- get deleted()
231
- {
232
- return this._deleted;
233
- }
234
-
235
- /**
236
- * When the Point was last updated
237
- *
238
- * @public
239
- * @type {Date}
240
- */
241
- get updateTimestamp()
242
- {
243
- return this._updateTimestamp;
244
- }
245
-
246
- /**
247
- * The Site ID associated with this Point
248
- *
249
- * @public
250
- * @type {number}
251
- */
252
- get siteId()
253
- {
254
- return this._siteId;
255
- }
256
-
257
- /**
258
- * Convert this **PointModel** to a JSON Object
259
- *
260
- * @public
261
- * @return {Object<string, any>}
262
- */
263
- toJSON()
264
- {
265
- return {
266
- id: this._id,
267
- rtuId: this._rtuId,
268
- pluginId: this._pluginId,
269
- name: this._name,
270
- type: this._type,
271
- valueType: this._valueType,
272
- permissions: this._permissions,
273
- enabled: this._enabled,
274
- settings: this._settings,
275
- deleted: this._deleted,
276
- updateTimestamp: this._updateTimestamp
277
- };
113
+ this.updateTimestamp = undefined;
278
114
  }
279
115
 
280
116
  /**
@@ -283,12 +119,11 @@ class PointModel extends BaseSiteModel
283
119
  * @static
284
120
  * @public
285
121
  * @param {Object<string, any>|string} json A JSON Object or JSON String
286
- * @param {number} siteId The Site ID associated with this Point
287
122
  * @return {PointModel}
288
123
  */
289
- static fromJSON(json, siteId)
124
+ static fromJSON(json)
290
125
  {
291
- let model = new PointModel(siteId);
126
+ let model = new PointModel();
292
127
 
293
128
  /**
294
129
  * The JSON Object
@@ -308,7 +143,7 @@ class PointModel extends BaseSiteModel
308
143
 
309
144
  if('id' in jsonObject)
310
145
  {
311
- model._id = (function(){
146
+ model.id = (function(){
312
147
  if(typeof jsonObject['id'] !== 'number')
313
148
  {
314
149
  return Number.isInteger(Number(jsonObject['id'])) ? Number(jsonObject['id']) : Math.floor(Number(jsonObject['id']));
@@ -320,7 +155,7 @@ class PointModel extends BaseSiteModel
320
155
 
321
156
  if('rtuId' in jsonObject)
322
157
  {
323
- model._rtuId = (function(){
158
+ model.rtuId = (function(){
324
159
  if(jsonObject['rtuId'] === null)
325
160
  {
326
161
  return null;
@@ -337,7 +172,7 @@ class PointModel extends BaseSiteModel
337
172
 
338
173
  if('pluginId' in jsonObject)
339
174
  {
340
- model._pluginId = (function(){
175
+ model.pluginId = (function(){
341
176
  if(jsonObject['pluginId'] === null)
342
177
  {
343
178
  return null;
@@ -354,7 +189,7 @@ class PointModel extends BaseSiteModel
354
189
 
355
190
  if('name' in jsonObject)
356
191
  {
357
- model._name = (function(){
192
+ model.name = (function(){
358
193
  if(typeof jsonObject['name'] !== 'string')
359
194
  {
360
195
  return String(jsonObject['name']);
@@ -366,7 +201,7 @@ class PointModel extends BaseSiteModel
366
201
 
367
202
  if('type' in jsonObject)
368
203
  {
369
- model._type = (function(){
204
+ model.type = (function(){
370
205
  if(typeof jsonObject['type'] !== 'string')
371
206
  {
372
207
  return String(jsonObject['type']);
@@ -378,7 +213,7 @@ class PointModel extends BaseSiteModel
378
213
 
379
214
  if('valueType' in jsonObject)
380
215
  {
381
- model._valueType = (function(){
216
+ model.valueType = (function(){
382
217
  if(typeof jsonObject['valueType'] !== 'string')
383
218
  {
384
219
  return String(jsonObject['valueType']);
@@ -390,7 +225,7 @@ class PointModel extends BaseSiteModel
390
225
 
391
226
  if('permissions' in jsonObject)
392
227
  {
393
- model._permissions = (function(){
228
+ model.permissions = (function(){
394
229
  if(typeof jsonObject['permissions'] !== 'string')
395
230
  {
396
231
  return String(jsonObject['permissions']);
@@ -402,7 +237,7 @@ class PointModel extends BaseSiteModel
402
237
 
403
238
  if('enabled' in jsonObject)
404
239
  {
405
- model._enabled = (function(){
240
+ model.enabled = (function(){
406
241
  if(typeof jsonObject['enabled'] !== 'boolean')
407
242
  {
408
243
  return Boolean(jsonObject['enabled']);
@@ -414,7 +249,7 @@ class PointModel extends BaseSiteModel
414
249
 
415
250
  if('settings' in jsonObject)
416
251
  {
417
- model._settings = (function(){
252
+ model.settings = (function(){
418
253
  if(typeof jsonObject['settings'] !== 'object')
419
254
  {
420
255
  return Object(jsonObject['settings']);
@@ -426,7 +261,7 @@ class PointModel extends BaseSiteModel
426
261
 
427
262
  if('deleted' in jsonObject)
428
263
  {
429
- model._deleted = (function(){
264
+ model.deleted = (function(){
430
265
  if(typeof jsonObject['deleted'] !== 'boolean')
431
266
  {
432
267
  return Boolean(jsonObject['deleted']);
@@ -438,7 +273,7 @@ class PointModel extends BaseSiteModel
438
273
 
439
274
  if('updateTimestamp' in jsonObject)
440
275
  {
441
- model._updateTimestamp = (function(){
276
+ model.updateTimestamp = (function(){
442
277
  if(typeof jsonObject['updateTimestamp'] !== 'string')
443
278
  {
444
279
  return new Date(String(jsonObject['updateTimestamp']));