@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.
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
- package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +4 -4
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
- package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
- package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
- package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
- package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
- package/lib/Controllers/Packhouse/Site/PackTypeController.js +4 -4
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +4 -4
- package/lib/Controllers/Packhouse/Site/PackrunController.js +4 -4
- package/lib/Controllers/Packhouse/Site/RejectBinController.js +4 -4
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +4 -4
- package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
- package/lib/Controllers/Packhouse/Site/ShiftController.js +4 -4
- package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +4 -4
- package/lib/Controllers/Packhouse/Site/VarietyController.js +4 -4
- package/lib/Controllers/Site/AlarmController.js +4 -4
- package/lib/Controllers/Site/AlarmGroupController.js +4 -4
- package/lib/Controllers/Site/DefinitionController.js +4 -4
- package/lib/Controllers/Site/PermanentObjectController.js +4 -4
- package/lib/Controllers/Site/PermanentObjectDataController.js +4 -4
- package/lib/Controllers/Site/PointController.js +6 -4
- package/lib/Controllers/Site/TemporaryObjectController.js +4 -4
- package/lib/Models/AccountPolicyModel.js +26 -130
- package/lib/Models/ApiAccountModel.js +26 -130
- package/lib/Models/CompanyModel.js +20 -98
- package/lib/Models/FirebaseTokenModel.js +29 -146
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +40 -192
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +37 -176
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +55 -272
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +43 -208
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +37 -176
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +31 -144
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +49 -240
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +55 -272
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +37 -176
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +31 -144
- package/lib/Models/Packhouse/Site/PackTypeModel.js +37 -176
- package/lib/Models/Packhouse/Site/PackingLineModel.js +58 -288
- package/lib/Models/Packhouse/Site/PackrunModel.js +58 -288
- package/lib/Models/Packhouse/Site/RejectBinModel.js +40 -192
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +49 -240
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +43 -208
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +49 -240
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +124 -640
- package/lib/Models/Packhouse/Site/ShiftModel.js +70 -352
- package/lib/Models/Packhouse/Site/VarietyModel.js +37 -176
- package/lib/Models/RTUModel.js +23 -114
- package/lib/Models/RTUPluginModel.js +20 -98
- package/lib/Models/Site/AlarmGroupModel.js +34 -160
- package/lib/Models/Site/AlarmModel.js +64 -320
- package/lib/Models/Site/DefinitionModel.js +31 -144
- package/lib/Models/Site/PermanentObjectDataModel.js +37 -176
- package/lib/Models/Site/PermanentObjectModel.js +34 -160
- package/lib/Models/Site/PointModel.js +46 -224
- package/lib/Models/Site/TemporaryObjectModel.js +31 -144
- package/lib/Models/Site/index.js +0 -3
- package/lib/Models/SiteModel.js +23 -114
- package/lib/Models/TokenModel.js +35 -178
- package/lib/Models/UserAccountActionTokenModel.js +38 -194
- package/lib/Models/UserAccountModel.js +35 -178
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +9 -1
- package/lib/index.d.ts +842 -1591
- package/lib/index.js +67 -38
- package/package.json +2 -2
- package/src/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
- package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
- package/src/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
- package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
- package/src/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
- package/src/Controllers/Packhouse/Site/PackTypeController.js +4 -4
- package/src/Controllers/Packhouse/Site/PackingLineController.js +4 -4
- package/src/Controllers/Packhouse/Site/PackrunController.js +4 -4
- package/src/Controllers/Packhouse/Site/RejectBinController.js +4 -4
- package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +4 -4
- package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
- package/src/Controllers/Packhouse/Site/ShiftController.js +4 -4
- package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +4 -4
- package/src/Controllers/Packhouse/Site/VarietyController.js +4 -4
- package/src/Controllers/Site/AlarmController.js +4 -4
- package/src/Controllers/Site/AlarmGroupController.js +4 -4
- package/src/Controllers/Site/DefinitionController.js +4 -4
- package/src/Controllers/Site/PermanentObjectController.js +4 -4
- package/src/Controllers/Site/PermanentObjectDataController.js +4 -4
- package/src/Controllers/Site/PointController.js +6 -4
- package/src/Controllers/Site/TemporaryObjectController.js +4 -4
- package/src/Models/AccountPolicyModel.js +21 -117
- package/src/Models/ApiAccountModel.js +21 -117
- package/src/Models/CompanyModel.js +15 -87
- package/src/Models/FirebaseTokenModel.js +24 -132
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +33 -174
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +30 -159
- package/src/Models/Packhouse/Site/CompacSizerModel.js +48 -249
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +36 -189
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +30 -159
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +24 -129
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +42 -219
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +48 -249
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +30 -159
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +24 -129
- package/src/Models/Packhouse/Site/PackTypeModel.js +30 -159
- package/src/Models/Packhouse/Site/PackingLineModel.js +51 -264
- package/src/Models/Packhouse/Site/PackrunModel.js +51 -264
- package/src/Models/Packhouse/Site/RejectBinModel.js +33 -174
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +42 -219
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +36 -189
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +42 -219
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +117 -594
- package/src/Models/Packhouse/Site/ShiftModel.js +63 -324
- package/src/Models/Packhouse/Site/VarietyModel.js +30 -159
- package/src/Models/RTUModel.js +18 -102
- package/src/Models/RTUPluginModel.js +15 -87
- package/src/Models/Site/AlarmGroupModel.js +27 -144
- package/src/Models/Site/AlarmModel.js +57 -294
- package/src/Models/Site/DefinitionModel.js +24 -129
- package/src/Models/Site/PermanentObjectDataModel.js +30 -159
- package/src/Models/Site/PermanentObjectModel.js +27 -144
- package/src/Models/Site/PointModel.js +39 -204
- package/src/Models/Site/TemporaryObjectModel.js +24 -129
- package/src/Models/Site/index.js +0 -2
- package/src/Models/SiteModel.js +18 -102
- package/src/Models/TokenModel.js +30 -162
- package/src/Models/UserAccountActionTokenModel.js +33 -177
- package/src/Models/UserAccountModel.js +30 -162
- package/src/PackageVersion.js +1 -1
- package/src/Points.js +11 -1
- package/src/index.js +35 -3
- package/lib/Models/Site/BaseSiteModel.js +0 -58
- 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
|
|
7
|
+
import BaseModel from '../../Models/BaseModel';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Model Class for a Definition
|
|
11
11
|
*
|
|
12
12
|
* @class
|
|
13
13
|
* @hideconstructor
|
|
14
|
-
* @extends
|
|
14
|
+
* @extends BaseModel
|
|
15
15
|
*/
|
|
16
|
-
class DefinitionModel extends
|
|
16
|
+
class DefinitionModel extends BaseModel
|
|
17
17
|
{
|
|
18
18
|
/**
|
|
19
19
|
* DefinitionModel Constructor
|
|
20
20
|
*
|
|
21
21
|
* @protected
|
|
22
|
-
* @param {number} siteId The Site ID associated with this Definition
|
|
23
22
|
*/
|
|
24
|
-
constructor(
|
|
23
|
+
constructor()
|
|
25
24
|
{
|
|
26
25
|
super();
|
|
27
26
|
|
|
@@ -29,152 +28,49 @@ class DefinitionModel extends BaseSiteModel
|
|
|
29
28
|
* The Definition ID
|
|
30
29
|
*
|
|
31
30
|
* @type {string}
|
|
32
|
-
* @
|
|
31
|
+
* @public
|
|
33
32
|
*/
|
|
34
|
-
this.
|
|
33
|
+
this.id = undefined;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* The Definition Key Index
|
|
38
37
|
*
|
|
39
38
|
* @type {string}
|
|
40
|
-
* @
|
|
39
|
+
* @public
|
|
41
40
|
*/
|
|
42
|
-
this.
|
|
41
|
+
this.keyIndex = undefined;
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
44
|
* The Definition Type
|
|
46
45
|
*
|
|
47
46
|
* @type {string}
|
|
48
|
-
* @
|
|
47
|
+
* @public
|
|
49
48
|
*/
|
|
50
|
-
this.
|
|
49
|
+
this.type = undefined;
|
|
51
50
|
|
|
52
51
|
/**
|
|
53
52
|
* The Definition Data
|
|
54
53
|
*
|
|
55
54
|
* @type {Object}
|
|
56
|
-
* @
|
|
55
|
+
* @public
|
|
57
56
|
*/
|
|
58
|
-
this.
|
|
57
|
+
this.data = undefined;
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* Whether the Definition has been deleted
|
|
62
61
|
*
|
|
63
62
|
* @type {boolean}
|
|
64
|
-
* @
|
|
63
|
+
* @public
|
|
65
64
|
*/
|
|
66
|
-
this.
|
|
65
|
+
this.deleted = undefined;
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
68
|
* When the Definition was last updated
|
|
70
69
|
*
|
|
71
70
|
* @type {Date}
|
|
72
|
-
* @
|
|
71
|
+
* @public
|
|
73
72
|
*/
|
|
74
|
-
this.
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The Site ID associated with this Definition
|
|
78
|
-
*
|
|
79
|
-
* @type {number}
|
|
80
|
-
* @private
|
|
81
|
-
*/
|
|
82
|
-
this._siteId = siteId;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* The Definition ID
|
|
87
|
-
*
|
|
88
|
-
* @public
|
|
89
|
-
* @type {string}
|
|
90
|
-
*/
|
|
91
|
-
get id()
|
|
92
|
-
{
|
|
93
|
-
return this._id;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* The Definition Key Index
|
|
98
|
-
*
|
|
99
|
-
* @public
|
|
100
|
-
* @type {string}
|
|
101
|
-
*/
|
|
102
|
-
get keyIndex()
|
|
103
|
-
{
|
|
104
|
-
return this._keyIndex;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* The Definition Type
|
|
109
|
-
*
|
|
110
|
-
* @public
|
|
111
|
-
* @type {string}
|
|
112
|
-
*/
|
|
113
|
-
get type()
|
|
114
|
-
{
|
|
115
|
-
return this._type;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* The Definition Data
|
|
120
|
-
*
|
|
121
|
-
* @public
|
|
122
|
-
* @type {Object}
|
|
123
|
-
*/
|
|
124
|
-
get data()
|
|
125
|
-
{
|
|
126
|
-
return this._data;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Whether the Definition has been deleted
|
|
131
|
-
*
|
|
132
|
-
* @public
|
|
133
|
-
* @type {boolean}
|
|
134
|
-
*/
|
|
135
|
-
get deleted()
|
|
136
|
-
{
|
|
137
|
-
return this._deleted;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* When the Definition was last updated
|
|
142
|
-
*
|
|
143
|
-
* @public
|
|
144
|
-
* @type {Date}
|
|
145
|
-
*/
|
|
146
|
-
get updateTimestamp()
|
|
147
|
-
{
|
|
148
|
-
return this._updateTimestamp;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* The Site ID associated with this Definition
|
|
153
|
-
*
|
|
154
|
-
* @public
|
|
155
|
-
* @type {number}
|
|
156
|
-
*/
|
|
157
|
-
get siteId()
|
|
158
|
-
{
|
|
159
|
-
return this._siteId;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Convert this **DefinitionModel** to a JSON Object
|
|
164
|
-
*
|
|
165
|
-
* @public
|
|
166
|
-
* @return {Object<string, any>}
|
|
167
|
-
*/
|
|
168
|
-
toJSON()
|
|
169
|
-
{
|
|
170
|
-
return {
|
|
171
|
-
id: this._id,
|
|
172
|
-
keyIndex: this._keyIndex,
|
|
173
|
-
type: this._type,
|
|
174
|
-
data: this._data,
|
|
175
|
-
deleted: this._deleted,
|
|
176
|
-
updateTimestamp: this._updateTimestamp
|
|
177
|
-
};
|
|
73
|
+
this.updateTimestamp = undefined;
|
|
178
74
|
}
|
|
179
75
|
|
|
180
76
|
/**
|
|
@@ -183,12 +79,11 @@ class DefinitionModel extends BaseSiteModel
|
|
|
183
79
|
* @static
|
|
184
80
|
* @public
|
|
185
81
|
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
186
|
-
* @param {number} siteId The Site ID associated with this Definition
|
|
187
82
|
* @return {DefinitionModel}
|
|
188
83
|
*/
|
|
189
|
-
static fromJSON(json
|
|
84
|
+
static fromJSON(json)
|
|
190
85
|
{
|
|
191
|
-
let model = new DefinitionModel(
|
|
86
|
+
let model = new DefinitionModel();
|
|
192
87
|
|
|
193
88
|
/**
|
|
194
89
|
* The JSON Object
|
|
@@ -208,7 +103,7 @@ class DefinitionModel extends BaseSiteModel
|
|
|
208
103
|
|
|
209
104
|
if('id' in jsonObject)
|
|
210
105
|
{
|
|
211
|
-
model.
|
|
106
|
+
model.id = (function(){
|
|
212
107
|
if(typeof jsonObject['id'] !== 'string')
|
|
213
108
|
{
|
|
214
109
|
return String(jsonObject['id']);
|
|
@@ -220,7 +115,7 @@ class DefinitionModel extends BaseSiteModel
|
|
|
220
115
|
|
|
221
116
|
if('keyIndex' in jsonObject)
|
|
222
117
|
{
|
|
223
|
-
model.
|
|
118
|
+
model.keyIndex = (function(){
|
|
224
119
|
if(typeof jsonObject['keyIndex'] !== 'string')
|
|
225
120
|
{
|
|
226
121
|
return String(jsonObject['keyIndex']);
|
|
@@ -232,7 +127,7 @@ class DefinitionModel extends BaseSiteModel
|
|
|
232
127
|
|
|
233
128
|
if('type' in jsonObject)
|
|
234
129
|
{
|
|
235
|
-
model.
|
|
130
|
+
model.type = (function(){
|
|
236
131
|
if(typeof jsonObject['type'] !== 'string')
|
|
237
132
|
{
|
|
238
133
|
return String(jsonObject['type']);
|
|
@@ -244,7 +139,7 @@ class DefinitionModel extends BaseSiteModel
|
|
|
244
139
|
|
|
245
140
|
if('data' in jsonObject)
|
|
246
141
|
{
|
|
247
|
-
model.
|
|
142
|
+
model.data = (function(){
|
|
248
143
|
if(typeof jsonObject['data'] !== 'object')
|
|
249
144
|
{
|
|
250
145
|
return Object(jsonObject['data']);
|
|
@@ -256,7 +151,7 @@ class DefinitionModel extends BaseSiteModel
|
|
|
256
151
|
|
|
257
152
|
if('deleted' in jsonObject)
|
|
258
153
|
{
|
|
259
|
-
model.
|
|
154
|
+
model.deleted = (function(){
|
|
260
155
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
261
156
|
{
|
|
262
157
|
return Boolean(jsonObject['deleted']);
|
|
@@ -268,7 +163,7 @@ class DefinitionModel extends BaseSiteModel
|
|
|
268
163
|
|
|
269
164
|
if('updateTimestamp' in jsonObject)
|
|
270
165
|
{
|
|
271
|
-
model.
|
|
166
|
+
model.updateTimestamp = (function(){
|
|
272
167
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
273
168
|
{
|
|
274
169
|
return new Date(String(jsonObject['updateTimestamp']));
|
|
@@ -4,24 +4,23 @@
|
|
|
4
4
|
* Do Not Edit this File Manually!
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import BaseModel from '../../Models/BaseModel';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Model Class for a Permanent Object Data
|
|
11
11
|
*
|
|
12
12
|
* @class
|
|
13
13
|
* @hideconstructor
|
|
14
|
-
* @extends
|
|
14
|
+
* @extends BaseModel
|
|
15
15
|
*/
|
|
16
|
-
class PermanentObjectDataModel extends
|
|
16
|
+
class PermanentObjectDataModel extends BaseModel
|
|
17
17
|
{
|
|
18
18
|
/**
|
|
19
19
|
* PermanentObjectDataModel Constructor
|
|
20
20
|
*
|
|
21
21
|
* @protected
|
|
22
|
-
* @param {number} siteId The Site ID associated with this Permanent Object Data
|
|
23
22
|
*/
|
|
24
|
-
constructor(
|
|
23
|
+
constructor()
|
|
25
24
|
{
|
|
26
25
|
super();
|
|
27
26
|
|
|
@@ -29,192 +28,65 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
29
28
|
* The Permanent Object Data ID
|
|
30
29
|
*
|
|
31
30
|
* @type {string}
|
|
32
|
-
* @
|
|
31
|
+
* @public
|
|
33
32
|
*/
|
|
34
|
-
this.
|
|
33
|
+
this.id = undefined;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
36
|
* An Optional Key Index for this Data
|
|
38
37
|
*
|
|
39
38
|
* @type {string}
|
|
40
|
-
* @
|
|
39
|
+
* @public
|
|
41
40
|
*/
|
|
42
|
-
this.
|
|
41
|
+
this.keyIndex = undefined;
|
|
43
42
|
|
|
44
43
|
/**
|
|
45
44
|
* The Permanent Object this Data is related to
|
|
46
45
|
*
|
|
47
46
|
* @type {string}
|
|
48
|
-
* @
|
|
47
|
+
* @public
|
|
49
48
|
*/
|
|
50
|
-
this.
|
|
49
|
+
this.permanentObjectId = undefined;
|
|
51
50
|
|
|
52
51
|
/**
|
|
53
52
|
* The Permanent Object Data Type
|
|
54
53
|
*
|
|
55
54
|
* @type {string}
|
|
56
|
-
* @
|
|
55
|
+
* @public
|
|
57
56
|
*/
|
|
58
|
-
this.
|
|
57
|
+
this.type = undefined;
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* The Timestamp when this Data was Created
|
|
62
61
|
*
|
|
63
62
|
* @type {Date}
|
|
64
|
-
* @
|
|
63
|
+
* @public
|
|
65
64
|
*/
|
|
66
|
-
this.
|
|
65
|
+
this.timestamp = undefined;
|
|
67
66
|
|
|
68
67
|
/**
|
|
69
68
|
* The Data Object specific to this Permanent Object Data Type
|
|
70
69
|
*
|
|
71
70
|
* @type {Object}
|
|
72
|
-
* @
|
|
71
|
+
* @public
|
|
73
72
|
*/
|
|
74
|
-
this.
|
|
73
|
+
this.data = undefined;
|
|
75
74
|
|
|
76
75
|
/**
|
|
77
76
|
* Whether the Permanent Object Data has been deleted
|
|
78
77
|
*
|
|
79
78
|
* @type {boolean}
|
|
80
|
-
* @
|
|
79
|
+
* @public
|
|
81
80
|
*/
|
|
82
|
-
this.
|
|
81
|
+
this.deleted = undefined;
|
|
83
82
|
|
|
84
83
|
/**
|
|
85
84
|
* When the Permanent Object Data was last updated
|
|
86
85
|
*
|
|
87
86
|
* @type {Date}
|
|
88
|
-
* @
|
|
87
|
+
* @public
|
|
89
88
|
*/
|
|
90
|
-
this.
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* The Site ID associated with this Permanent Object Data
|
|
94
|
-
*
|
|
95
|
-
* @type {number}
|
|
96
|
-
* @private
|
|
97
|
-
*/
|
|
98
|
-
this._siteId = siteId;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* The Permanent Object Data ID
|
|
103
|
-
*
|
|
104
|
-
* @public
|
|
105
|
-
* @type {string}
|
|
106
|
-
*/
|
|
107
|
-
get id()
|
|
108
|
-
{
|
|
109
|
-
return this._id;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* An Optional Key Index for this Data
|
|
114
|
-
*
|
|
115
|
-
* @public
|
|
116
|
-
* @type {string}
|
|
117
|
-
*/
|
|
118
|
-
get keyIndex()
|
|
119
|
-
{
|
|
120
|
-
return this._keyIndex;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The Permanent Object this Data is related to
|
|
125
|
-
*
|
|
126
|
-
* @public
|
|
127
|
-
* @type {string}
|
|
128
|
-
*/
|
|
129
|
-
get permanentObjectId()
|
|
130
|
-
{
|
|
131
|
-
return this._permanentObjectId;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* The Permanent Object Data Type
|
|
136
|
-
*
|
|
137
|
-
* @public
|
|
138
|
-
* @type {string}
|
|
139
|
-
*/
|
|
140
|
-
get type()
|
|
141
|
-
{
|
|
142
|
-
return this._type;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* The Timestamp when this Data was Created
|
|
147
|
-
*
|
|
148
|
-
* @public
|
|
149
|
-
* @type {Date}
|
|
150
|
-
*/
|
|
151
|
-
get timestamp()
|
|
152
|
-
{
|
|
153
|
-
return this._timestamp;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* The Data Object specific to this Permanent Object Data Type
|
|
158
|
-
*
|
|
159
|
-
* @public
|
|
160
|
-
* @type {Object}
|
|
161
|
-
*/
|
|
162
|
-
get data()
|
|
163
|
-
{
|
|
164
|
-
return this._data;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Whether the Permanent Object Data has been deleted
|
|
169
|
-
*
|
|
170
|
-
* @public
|
|
171
|
-
* @type {boolean}
|
|
172
|
-
*/
|
|
173
|
-
get deleted()
|
|
174
|
-
{
|
|
175
|
-
return this._deleted;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* When the Permanent Object Data was last updated
|
|
180
|
-
*
|
|
181
|
-
* @public
|
|
182
|
-
* @type {Date}
|
|
183
|
-
*/
|
|
184
|
-
get updateTimestamp()
|
|
185
|
-
{
|
|
186
|
-
return this._updateTimestamp;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* The Site ID associated with this Permanent Object Data
|
|
191
|
-
*
|
|
192
|
-
* @public
|
|
193
|
-
* @type {number}
|
|
194
|
-
*/
|
|
195
|
-
get siteId()
|
|
196
|
-
{
|
|
197
|
-
return this._siteId;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Convert this **PermanentObjectDataModel** to a JSON Object
|
|
202
|
-
*
|
|
203
|
-
* @public
|
|
204
|
-
* @return {Object<string, any>}
|
|
205
|
-
*/
|
|
206
|
-
toJSON()
|
|
207
|
-
{
|
|
208
|
-
return {
|
|
209
|
-
id: this._id,
|
|
210
|
-
keyIndex: this._keyIndex,
|
|
211
|
-
permanentObjectId: this._permanentObjectId,
|
|
212
|
-
type: this._type,
|
|
213
|
-
timestamp: this._timestamp,
|
|
214
|
-
data: this._data,
|
|
215
|
-
deleted: this._deleted,
|
|
216
|
-
updateTimestamp: this._updateTimestamp
|
|
217
|
-
};
|
|
89
|
+
this.updateTimestamp = undefined;
|
|
218
90
|
}
|
|
219
91
|
|
|
220
92
|
/**
|
|
@@ -223,12 +95,11 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
223
95
|
* @static
|
|
224
96
|
* @public
|
|
225
97
|
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
226
|
-
* @param {number} siteId The Site ID associated with this Permanent Object Data
|
|
227
98
|
* @return {PermanentObjectDataModel}
|
|
228
99
|
*/
|
|
229
|
-
static fromJSON(json
|
|
100
|
+
static fromJSON(json)
|
|
230
101
|
{
|
|
231
|
-
let model = new PermanentObjectDataModel(
|
|
102
|
+
let model = new PermanentObjectDataModel();
|
|
232
103
|
|
|
233
104
|
/**
|
|
234
105
|
* The JSON Object
|
|
@@ -248,7 +119,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
248
119
|
|
|
249
120
|
if('id' in jsonObject)
|
|
250
121
|
{
|
|
251
|
-
model.
|
|
122
|
+
model.id = (function(){
|
|
252
123
|
if(typeof jsonObject['id'] !== 'string')
|
|
253
124
|
{
|
|
254
125
|
return String(jsonObject['id']);
|
|
@@ -260,7 +131,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
260
131
|
|
|
261
132
|
if('keyIndex' in jsonObject)
|
|
262
133
|
{
|
|
263
|
-
model.
|
|
134
|
+
model.keyIndex = (function(){
|
|
264
135
|
if(typeof jsonObject['keyIndex'] !== 'string')
|
|
265
136
|
{
|
|
266
137
|
return String(jsonObject['keyIndex']);
|
|
@@ -272,7 +143,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
272
143
|
|
|
273
144
|
if('permanentObjectId' in jsonObject)
|
|
274
145
|
{
|
|
275
|
-
model.
|
|
146
|
+
model.permanentObjectId = (function(){
|
|
276
147
|
if(typeof jsonObject['permanentObjectId'] !== 'string')
|
|
277
148
|
{
|
|
278
149
|
return String(jsonObject['permanentObjectId']);
|
|
@@ -284,7 +155,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
284
155
|
|
|
285
156
|
if('type' in jsonObject)
|
|
286
157
|
{
|
|
287
|
-
model.
|
|
158
|
+
model.type = (function(){
|
|
288
159
|
if(typeof jsonObject['type'] !== 'string')
|
|
289
160
|
{
|
|
290
161
|
return String(jsonObject['type']);
|
|
@@ -296,7 +167,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
296
167
|
|
|
297
168
|
if('timestamp' in jsonObject)
|
|
298
169
|
{
|
|
299
|
-
model.
|
|
170
|
+
model.timestamp = (function(){
|
|
300
171
|
if(typeof jsonObject['timestamp'] !== 'string')
|
|
301
172
|
{
|
|
302
173
|
return new Date(String(jsonObject['timestamp']));
|
|
@@ -308,7 +179,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
308
179
|
|
|
309
180
|
if('data' in jsonObject)
|
|
310
181
|
{
|
|
311
|
-
model.
|
|
182
|
+
model.data = (function(){
|
|
312
183
|
if(typeof jsonObject['data'] !== 'object')
|
|
313
184
|
{
|
|
314
185
|
return Object(jsonObject['data']);
|
|
@@ -320,7 +191,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
320
191
|
|
|
321
192
|
if('deleted' in jsonObject)
|
|
322
193
|
{
|
|
323
|
-
model.
|
|
194
|
+
model.deleted = (function(){
|
|
324
195
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
325
196
|
{
|
|
326
197
|
return Boolean(jsonObject['deleted']);
|
|
@@ -332,7 +203,7 @@ class PermanentObjectDataModel extends BaseSiteModel
|
|
|
332
203
|
|
|
333
204
|
if('updateTimestamp' in jsonObject)
|
|
334
205
|
{
|
|
335
|
-
model.
|
|
206
|
+
model.updateTimestamp = (function(){
|
|
336
207
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
337
208
|
{
|
|
338
209
|
return new Date(String(jsonObject['updateTimestamp']));
|