@ricado/api-client 2.2.0 → 2.3.2
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/BinTipBinController.js +267 -0
- package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +267 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +267 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +267 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +267 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +267 -0
- package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +267 -0
- package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +267 -0
- package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +267 -0
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +4 -0
- package/lib/Controllers/Packhouse/Site/PackrunController.js +267 -0
- package/lib/Controllers/Packhouse/Site/RejectBinController.js +267 -0
- package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +267 -0
- package/lib/Controllers/Packhouse/Site/ShiftController.js +267 -0
- package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +267 -0
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +267 -0
- package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +267 -0
- package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +267 -0
- package/lib/Controllers/Site/PermanentObjectDataController.js +267 -0
- package/lib/DataItems/PointValueItem.js +3 -3
- package/lib/Models/AccountPolicyModel.js +7 -7
- package/lib/Models/ApiAccountModel.js +7 -7
- package/lib/Models/CompanyModel.js +5 -5
- package/lib/Models/FirebaseTokenModel.js +8 -8
- package/lib/Models/Packhouse/Site/BinTipBinModel.js +13 -13
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +14 -14
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +10 -10
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/lib/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/lib/Models/Packhouse/Site/PackingLineModel.js +60 -16
- package/lib/Models/Packhouse/Site/PackrunModel.js +18 -18
- package/lib/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +44 -44
- package/lib/Models/Packhouse/Site/ShiftModel.js +26 -19
- package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +14 -14
- package/lib/Models/Packhouse/Site/ShiftTaskModel.js +14 -14
- package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
- package/lib/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/lib/Models/RTUModel.js +6 -6
- package/lib/Models/RTUPluginModel.js +5 -5
- package/lib/Models/Site/AlarmGroupModel.js +7 -7
- package/lib/Models/Site/AlarmModel.js +17 -17
- package/lib/Models/Site/DefinitionModel.js +6 -6
- package/lib/Models/Site/PermanentObjectDataModel.js +8 -8
- package/lib/Models/Site/PermanentObjectModel.js +7 -7
- package/lib/Models/Site/PointModel.js +11 -11
- package/lib/Models/Site/TemporaryObjectModel.js +6 -6
- package/lib/Models/SiteModel.js +6 -6
- package/lib/Models/TokenModel.js +10 -10
- package/lib/Models/UserAccountActionTokenModel.js +11 -11
- package/lib/Models/UserAccountModel.js +10 -10
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +22 -12
- package/lib/WebSocketHelper.js +29 -13
- package/lib/index.d.ts +715 -361
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/BinTipBinController.js +355 -0
- package/src/Controllers/Packhouse/Site/BinTipWeightController.js +355 -0
- package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +355 -0
- package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +355 -0
- package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +355 -0
- package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +355 -0
- package/src/Controllers/Packhouse/Site/DowntimeEventController.js +355 -0
- package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +355 -0
- package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +355 -0
- package/src/Controllers/Packhouse/Site/PackingLineController.js +4 -0
- package/src/Controllers/Packhouse/Site/PackrunController.js +355 -0
- package/src/Controllers/Packhouse/Site/RejectBinController.js +355 -0
- package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +355 -0
- package/src/Controllers/Packhouse/Site/ShiftController.js +355 -0
- package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +355 -0
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +355 -0
- package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +355 -0
- package/src/Controllers/Packhouse/Site/ShiftTaskController.js +355 -0
- package/src/Controllers/Site/PermanentObjectDataController.js +355 -0
- package/src/DataItems/PointValueItem.js +3 -3
- package/src/Models/AccountPolicyModel.js +7 -7
- package/src/Models/ApiAccountModel.js +7 -7
- package/src/Models/CompanyModel.js +5 -5
- package/src/Models/FirebaseTokenModel.js +8 -8
- package/src/Models/Packhouse/Site/BinTipBinModel.js +13 -13
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerModel.js +14 -14
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +10 -10
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/src/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/src/Models/Packhouse/Site/PackingLineModel.js +66 -16
- package/src/Models/Packhouse/Site/PackrunModel.js +18 -18
- package/src/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +44 -44
- package/src/Models/Packhouse/Site/ShiftModel.js +29 -19
- package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +14 -14
- package/src/Models/Packhouse/Site/ShiftTaskModel.js +14 -14
- package/src/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
- package/src/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/src/Models/RTUModel.js +6 -6
- package/src/Models/RTUPluginModel.js +5 -5
- package/src/Models/Site/AlarmGroupModel.js +7 -7
- package/src/Models/Site/AlarmModel.js +17 -17
- package/src/Models/Site/DefinitionModel.js +6 -6
- package/src/Models/Site/PermanentObjectDataModel.js +8 -8
- package/src/Models/Site/PermanentObjectModel.js +7 -7
- package/src/Models/Site/PointModel.js +11 -11
- package/src/Models/Site/TemporaryObjectModel.js +6 -6
- package/src/Models/SiteModel.js +6 -6
- package/src/Models/TokenModel.js +10 -10
- package/src/Models/UserAccountActionTokenModel.js +11 -11
- package/src/Models/UserAccountModel.js +10 -10
- package/src/PackageVersion.js +1 -1
- package/src/Points.js +24 -12
- package/src/WebSocketHelper.js +34 -13
- package/src/index.js +3 -3
- package/types/tslint.json +2 -1
|
@@ -31,7 +31,7 @@ class PermanentObjectModel extends BaseModel
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = "";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The RTU this Permanent Object belongs to
|
|
@@ -39,7 +39,7 @@ class PermanentObjectModel extends BaseModel
|
|
|
39
39
|
* @type {?number}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.rtuId =
|
|
42
|
+
this.rtuId = null;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Permanent Object Key Index
|
|
@@ -47,7 +47,7 @@ class PermanentObjectModel extends BaseModel
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.keyIndex =
|
|
50
|
+
this.keyIndex = "";
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Permanent Object Type
|
|
@@ -55,7 +55,7 @@ class PermanentObjectModel extends BaseModel
|
|
|
55
55
|
* @type {string}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.type =
|
|
58
|
+
this.type = "";
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Permanent Object Definition
|
|
@@ -63,7 +63,7 @@ class PermanentObjectModel extends BaseModel
|
|
|
63
63
|
* @type {Object}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.definition =
|
|
66
|
+
this.definition = {}
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Whether the Permanent Object has been deleted
|
|
@@ -71,7 +71,7 @@ class PermanentObjectModel extends BaseModel
|
|
|
71
71
|
* @type {boolean}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.deleted =
|
|
74
|
+
this.deleted = false;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* When the Permanent Object was last updated
|
|
@@ -79,7 +79,7 @@ class PermanentObjectModel extends BaseModel
|
|
|
79
79
|
* @type {Date}
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.updateTimestamp =
|
|
82
|
+
this.updateTimestamp = new Date();
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* The Site ID associated with this Permanent Object
|
|
@@ -31,7 +31,7 @@ class PointModel extends BaseModel
|
|
|
31
31
|
* @type {number}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = 0;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The RTU this Point belongs to
|
|
@@ -39,7 +39,7 @@ class PointModel extends BaseModel
|
|
|
39
39
|
* @type {?number}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.rtuId =
|
|
42
|
+
this.rtuId = null;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Plugin ID
|
|
@@ -47,7 +47,7 @@ class PointModel extends BaseModel
|
|
|
47
47
|
* @type {?number}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.pluginId =
|
|
50
|
+
this.pluginId = null;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Point Name
|
|
@@ -55,7 +55,7 @@ class PointModel extends BaseModel
|
|
|
55
55
|
* @type {string}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.name =
|
|
58
|
+
this.name = "";
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Point Type
|
|
@@ -63,7 +63,7 @@ class PointModel extends BaseModel
|
|
|
63
63
|
* @type {string}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.type =
|
|
66
|
+
this.type = "";
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* The Point's Value Type
|
|
@@ -71,7 +71,7 @@ class PointModel extends BaseModel
|
|
|
71
71
|
* @type {string}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.valueType =
|
|
74
|
+
this.valueType = "";
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Permissions
|
|
@@ -79,7 +79,7 @@ class PointModel extends BaseModel
|
|
|
79
79
|
* @type {string}
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.permissions =
|
|
82
|
+
this.permissions = "";
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Whether the Point is Enabled
|
|
@@ -87,7 +87,7 @@ class PointModel extends BaseModel
|
|
|
87
87
|
* @type {boolean}
|
|
88
88
|
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.enabled =
|
|
90
|
+
this.enabled = false;
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* The Point Settings
|
|
@@ -95,7 +95,7 @@ class PointModel extends BaseModel
|
|
|
95
95
|
* @type {Object}
|
|
96
96
|
* @public
|
|
97
97
|
*/
|
|
98
|
-
this.settings =
|
|
98
|
+
this.settings = {}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Whether the Point has been deleted
|
|
@@ -103,7 +103,7 @@ class PointModel extends BaseModel
|
|
|
103
103
|
* @type {boolean}
|
|
104
104
|
* @public
|
|
105
105
|
*/
|
|
106
|
-
this.deleted =
|
|
106
|
+
this.deleted = false;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* When the Point was last updated
|
|
@@ -111,7 +111,7 @@ class PointModel extends BaseModel
|
|
|
111
111
|
* @type {Date}
|
|
112
112
|
* @public
|
|
113
113
|
*/
|
|
114
|
-
this.updateTimestamp =
|
|
114
|
+
this.updateTimestamp = new Date();
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* The Site ID associated with this Point
|
|
@@ -31,7 +31,7 @@ class TemporaryObjectModel extends BaseModel
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = "";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The Temporary Object Key Index
|
|
@@ -39,7 +39,7 @@ class TemporaryObjectModel extends BaseModel
|
|
|
39
39
|
* @type {string}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.keyIndex =
|
|
42
|
+
this.keyIndex = "";
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Temporary Object Type
|
|
@@ -47,7 +47,7 @@ class TemporaryObjectModel extends BaseModel
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.type =
|
|
50
|
+
this.type = "";
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Temporary Object Definition
|
|
@@ -55,7 +55,7 @@ class TemporaryObjectModel extends BaseModel
|
|
|
55
55
|
* @type {Object}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.definition =
|
|
58
|
+
this.definition = {}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Whether the Temporary Object has been deleted
|
|
@@ -63,7 +63,7 @@ class TemporaryObjectModel extends BaseModel
|
|
|
63
63
|
* @type {boolean}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.deleted =
|
|
66
|
+
this.deleted = false;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* When the Temporary Object was last updated
|
|
@@ -71,7 +71,7 @@ class TemporaryObjectModel extends BaseModel
|
|
|
71
71
|
* @type {Date}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.updateTimestamp =
|
|
74
|
+
this.updateTimestamp = new Date();
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Site ID associated with this Temporary Object
|
package/src/Models/SiteModel.js
CHANGED
|
@@ -30,7 +30,7 @@ class SiteModel extends BaseModel
|
|
|
30
30
|
* @type {number}
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
this.id =
|
|
33
|
+
this.id = 0;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The Site Name
|
|
@@ -38,7 +38,7 @@ class SiteModel extends BaseModel
|
|
|
38
38
|
* @type {string}
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
this.name =
|
|
41
|
+
this.name = "";
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The Company this Site belongs to
|
|
@@ -46,7 +46,7 @@ class SiteModel extends BaseModel
|
|
|
46
46
|
* @type {string}
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
this.companyId =
|
|
49
|
+
this.companyId = "";
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Whether the Site is Enabled
|
|
@@ -54,7 +54,7 @@ class SiteModel extends BaseModel
|
|
|
54
54
|
* @type {boolean}
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
this.enabled =
|
|
57
|
+
this.enabled = false;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Whether the Site has been deleted
|
|
@@ -62,7 +62,7 @@ class SiteModel extends BaseModel
|
|
|
62
62
|
* @type {boolean}
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
|
65
|
-
this.deleted =
|
|
65
|
+
this.deleted = false;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* When the Site was last updated
|
|
@@ -70,7 +70,7 @@ class SiteModel extends BaseModel
|
|
|
70
70
|
* @type {Date}
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
this.updateTimestamp =
|
|
73
|
+
this.updateTimestamp = new Date();
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/**
|
package/src/Models/TokenModel.js
CHANGED
|
@@ -30,7 +30,7 @@ class TokenModel extends BaseModel
|
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
this.id =
|
|
33
|
+
this.id = "";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The Account this Token belongs to
|
|
@@ -38,7 +38,7 @@ class TokenModel extends BaseModel
|
|
|
38
38
|
* @type {string}
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
this.accountId =
|
|
41
|
+
this.accountId = "";
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The Account Type
|
|
@@ -46,7 +46,7 @@ class TokenModel extends BaseModel
|
|
|
46
46
|
* @type {string}
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
this.accountType =
|
|
49
|
+
this.accountType = "";
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* When the Token was issued
|
|
@@ -54,7 +54,7 @@ class TokenModel extends BaseModel
|
|
|
54
54
|
* @type {Date}
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
this.issueTimestamp =
|
|
57
|
+
this.issueTimestamp = new Date();
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* When the Token will expire
|
|
@@ -62,7 +62,7 @@ class TokenModel extends BaseModel
|
|
|
62
62
|
* @type {Date}
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
|
65
|
-
this.expireTimestamp =
|
|
65
|
+
this.expireTimestamp = new Date();
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* When the last API call using this Token was made
|
|
@@ -70,7 +70,7 @@ class TokenModel extends BaseModel
|
|
|
70
70
|
* @type {?Date}
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
this.activityTimestamp =
|
|
73
|
+
this.activityTimestamp = null;
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* When the Token was unlocked
|
|
@@ -78,7 +78,7 @@ class TokenModel extends BaseModel
|
|
|
78
78
|
* @type {?Date}
|
|
79
79
|
* @public
|
|
80
80
|
*/
|
|
81
|
-
this.unlockTimestamp =
|
|
81
|
+
this.unlockTimestamp = null;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* When the Token was locked
|
|
@@ -86,7 +86,7 @@ class TokenModel extends BaseModel
|
|
|
86
86
|
* @type {?Date}
|
|
87
87
|
* @public
|
|
88
88
|
*/
|
|
89
|
-
this.lockTimestamp =
|
|
89
|
+
this.lockTimestamp = null;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Whether the Token has been deleted
|
|
@@ -94,7 +94,7 @@ class TokenModel extends BaseModel
|
|
|
94
94
|
* @type {boolean}
|
|
95
95
|
* @public
|
|
96
96
|
*/
|
|
97
|
-
this.deleted =
|
|
97
|
+
this.deleted = false;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* When the Token was last updated
|
|
@@ -102,7 +102,7 @@ class TokenModel extends BaseModel
|
|
|
102
102
|
* @type {Date}
|
|
103
103
|
* @public
|
|
104
104
|
*/
|
|
105
|
-
this.updateTimestamp =
|
|
105
|
+
this.updateTimestamp = new Date();
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
@@ -30,7 +30,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
this.id =
|
|
33
|
+
this.id = "";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The Account this Action Token belongs to
|
|
@@ -38,7 +38,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
38
38
|
* @type {string}
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
this.accountId =
|
|
41
|
+
this.accountId = "";
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The Company this Action Token belongs to
|
|
@@ -46,7 +46,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
46
46
|
* @type {string}
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
this.companyId =
|
|
49
|
+
this.companyId = "";
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* The Action that can be Performed using this Action Token
|
|
@@ -54,7 +54,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
54
54
|
* @type {string}
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
this.action =
|
|
57
|
+
this.action = "";
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* When the Action Token was issued
|
|
@@ -62,7 +62,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
62
62
|
* @type {Date}
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
|
65
|
-
this.issueTimestamp =
|
|
65
|
+
this.issueTimestamp = new Date();
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* When the Action Token will expire
|
|
@@ -70,7 +70,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
70
70
|
* @type {Date}
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
this.expireTimestamp =
|
|
73
|
+
this.expireTimestamp = new Date();
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* When the last API call using this Action Token was made
|
|
@@ -78,7 +78,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
78
78
|
* @type {?Date}
|
|
79
79
|
* @public
|
|
80
80
|
*/
|
|
81
|
-
this.activityTimestamp =
|
|
81
|
+
this.activityTimestamp = null;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* When the Action was Completed
|
|
@@ -86,7 +86,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
86
86
|
* @type {?Date}
|
|
87
87
|
* @public
|
|
88
88
|
*/
|
|
89
|
-
this.completedTimestamp =
|
|
89
|
+
this.completedTimestamp = null;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* When the Action Email was Sent
|
|
@@ -94,7 +94,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
94
94
|
* @type {?Date}
|
|
95
95
|
* @public
|
|
96
96
|
*/
|
|
97
|
-
this.emailTimestamp =
|
|
97
|
+
this.emailTimestamp = null;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* Whether the User Account Action Token has been deleted
|
|
@@ -102,7 +102,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
102
102
|
* @type {boolean}
|
|
103
103
|
* @public
|
|
104
104
|
*/
|
|
105
|
-
this.deleted =
|
|
105
|
+
this.deleted = false;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* When the User Account Action Token was last updated
|
|
@@ -110,7 +110,7 @@ class UserAccountActionTokenModel extends BaseModel
|
|
|
110
110
|
* @type {Date}
|
|
111
111
|
* @public
|
|
112
112
|
*/
|
|
113
|
-
this.updateTimestamp =
|
|
113
|
+
this.updateTimestamp = new Date();
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
@@ -30,7 +30,7 @@ class UserAccountModel extends BaseModel
|
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
this.id =
|
|
33
|
+
this.id = "";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The User's Email Address
|
|
@@ -38,7 +38,7 @@ class UserAccountModel extends BaseModel
|
|
|
38
38
|
* @type {string}
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
this.email =
|
|
41
|
+
this.email = "";
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The User's First Name
|
|
@@ -46,7 +46,7 @@ class UserAccountModel extends BaseModel
|
|
|
46
46
|
* @type {?string}
|
|
47
47
|
* @public
|
|
48
48
|
*/
|
|
49
|
-
this.firstName =
|
|
49
|
+
this.firstName = null;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* The User's Last Name
|
|
@@ -54,7 +54,7 @@ class UserAccountModel extends BaseModel
|
|
|
54
54
|
* @type {?string}
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
this.lastName =
|
|
57
|
+
this.lastName = null;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* The Company this User belongs to
|
|
@@ -62,7 +62,7 @@ class UserAccountModel extends BaseModel
|
|
|
62
62
|
* @type {string}
|
|
63
63
|
* @public
|
|
64
64
|
*/
|
|
65
|
-
this.companyId =
|
|
65
|
+
this.companyId = "";
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* The Policies that apply to this User Account
|
|
@@ -70,7 +70,7 @@ class UserAccountModel extends BaseModel
|
|
|
70
70
|
* @type {string[]}
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
this.policies =
|
|
73
|
+
this.policies = [];
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Whether a Password has been Set for the User Account
|
|
@@ -78,7 +78,7 @@ class UserAccountModel extends BaseModel
|
|
|
78
78
|
* @type {boolean}
|
|
79
79
|
* @public
|
|
80
80
|
*/
|
|
81
|
-
this.hasPassword =
|
|
81
|
+
this.hasPassword = false;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Whether a Pin Code has been Set for the User Account
|
|
@@ -86,7 +86,7 @@ class UserAccountModel extends BaseModel
|
|
|
86
86
|
* @type {boolean}
|
|
87
87
|
* @public
|
|
88
88
|
*/
|
|
89
|
-
this.hasPinCode =
|
|
89
|
+
this.hasPinCode = false;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Whether the User Account has been deleted
|
|
@@ -94,7 +94,7 @@ class UserAccountModel extends BaseModel
|
|
|
94
94
|
* @type {boolean}
|
|
95
95
|
* @public
|
|
96
96
|
*/
|
|
97
|
-
this.deleted =
|
|
97
|
+
this.deleted = false;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* When the User Account was last updated
|
|
@@ -102,7 +102,7 @@ class UserAccountModel extends BaseModel
|
|
|
102
102
|
* @type {Date}
|
|
103
103
|
* @public
|
|
104
104
|
*/
|
|
105
|
-
this.updateTimestamp =
|
|
105
|
+
this.updateTimestamp = new Date();
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
package/src/PackageVersion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '2.2
|
|
2
|
+
export const version = '2.3.2';
|
package/src/Points.js
CHANGED
|
@@ -24,7 +24,7 @@ class Points
|
|
|
24
24
|
* An EventEmitter Instance
|
|
25
25
|
*
|
|
26
26
|
* @private
|
|
27
|
-
* @type {EventEmitter}
|
|
27
|
+
* @type {EventEmitter|undefined}
|
|
28
28
|
*/
|
|
29
29
|
static _emitter = undefined;
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ class Points
|
|
|
34
34
|
* @private
|
|
35
35
|
* @type {Object<number, {initializing: boolean, completed: boolean, pointIds: number[]}>}
|
|
36
36
|
*/
|
|
37
|
-
static _subscriptions =
|
|
37
|
+
static _subscriptions = {};
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* An Array of PointModel Definitions
|
|
@@ -42,7 +42,7 @@ class Points
|
|
|
42
42
|
* @private
|
|
43
43
|
* @type {Object<number, Object<number, PointModel>>}
|
|
44
44
|
*/
|
|
45
|
-
static _definitions =
|
|
45
|
+
static _definitions = {};
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* An Array of Point Values
|
|
@@ -50,7 +50,7 @@ class Points
|
|
|
50
50
|
* @private
|
|
51
51
|
* @type {Object<number, Object<number, Points.PointValueItem>>}
|
|
52
52
|
*/
|
|
53
|
-
static _values =
|
|
53
|
+
static _values = {};
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Initialize
|
|
@@ -83,7 +83,13 @@ class Points
|
|
|
83
83
|
Points._values = {};
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
WebSocketHelper.on('readpoints',
|
|
86
|
+
WebSocketHelper.on('readpoints',
|
|
87
|
+
/**
|
|
88
|
+
* @param {string} key
|
|
89
|
+
* @param {Array<{id: number, timestamp: string, value: any}>} readPoints
|
|
90
|
+
*/
|
|
91
|
+
(key, readPoints) => {
|
|
92
|
+
|
|
87
93
|
if(isDefined(key) && key.includes('.') && readPoints.length > 0)
|
|
88
94
|
{
|
|
89
95
|
let keyId = key.split('.')[1];
|
|
@@ -102,7 +108,7 @@ class Points
|
|
|
102
108
|
siteId = this.getDefaultSiteId();
|
|
103
109
|
}
|
|
104
110
|
|
|
105
|
-
if(isDefined(siteId) && siteId > 0)
|
|
111
|
+
if(isDefined(siteId) && siteId !== undefined && siteId > 0)
|
|
106
112
|
{
|
|
107
113
|
if((siteId in Points._values) != true)
|
|
108
114
|
{
|
|
@@ -134,7 +140,10 @@ class Points
|
|
|
134
140
|
}
|
|
135
141
|
});
|
|
136
142
|
|
|
137
|
-
Points._emitter
|
|
143
|
+
if(Points._emitter !== undefined)
|
|
144
|
+
{
|
|
145
|
+
Points._emitter.emit('readpoints', siteId, pointValueItems);
|
|
146
|
+
}
|
|
138
147
|
}
|
|
139
148
|
}
|
|
140
149
|
});
|
|
@@ -312,7 +321,7 @@ class Points
|
|
|
312
321
|
*/
|
|
313
322
|
static on(event, handler)
|
|
314
323
|
{
|
|
315
|
-
if(isDefined(Points._emitter) != true)
|
|
324
|
+
if(isDefined(Points._emitter) != true || Points._emitter === undefined)
|
|
316
325
|
{
|
|
317
326
|
Points._emitter = new EventEmitter();
|
|
318
327
|
}
|
|
@@ -330,7 +339,7 @@ class Points
|
|
|
330
339
|
*/
|
|
331
340
|
static off(event, handler)
|
|
332
341
|
{
|
|
333
|
-
if(isDefined(Points._emitter))
|
|
342
|
+
if(isDefined(Points._emitter) && Points._emitter !== undefined)
|
|
334
343
|
{
|
|
335
344
|
Points._emitter.off(event, handler);
|
|
336
345
|
}
|
|
@@ -424,18 +433,21 @@ class Points
|
|
|
424
433
|
if(siteId <= 0)
|
|
425
434
|
{
|
|
426
435
|
reject(new Error("Invalid Site ID `" + siteId + "`"));
|
|
436
|
+
return;
|
|
427
437
|
}
|
|
428
438
|
|
|
429
439
|
if(pointId <= 0)
|
|
430
440
|
{
|
|
431
441
|
reject(new Error("Invalid Point ID `" + pointId + "`"));
|
|
442
|
+
return;
|
|
432
443
|
}
|
|
433
444
|
|
|
434
445
|
let pointDefinition = Points.getDefinition(siteId, pointId);
|
|
435
446
|
|
|
436
|
-
if(isDefined(pointDefinition) != true || pointDefinition.id != pointId)
|
|
447
|
+
if(isDefined(pointDefinition) != true || pointDefinition === undefined || pointDefinition.id != pointId)
|
|
437
448
|
{
|
|
438
449
|
reject(new Error("Unknown Point ID `" + pointId + "` for Site ID `" + siteId + "`"));
|
|
450
|
+
return;
|
|
439
451
|
}
|
|
440
452
|
|
|
441
453
|
WebSocketHelper.emit('createWritePoint', siteId, pointId, value, pointDefinition.valueType, false, (guid) => {
|
|
@@ -522,7 +534,7 @@ class Points
|
|
|
522
534
|
}
|
|
523
535
|
});
|
|
524
536
|
|
|
525
|
-
if(changedPoints.length > 0)
|
|
537
|
+
if(changedPoints.length > 0 && Points._emitter !== undefined)
|
|
526
538
|
{
|
|
527
539
|
Points._emitter.emit('readpoints', siteId, changedPoints);
|
|
528
540
|
}
|
|
@@ -563,7 +575,7 @@ class Points
|
|
|
563
575
|
* The Events Callback
|
|
564
576
|
*
|
|
565
577
|
* @callback Points.eventCallback
|
|
566
|
-
* @param {...any
|
|
578
|
+
* @param {...any} args - The Callback Arguments
|
|
567
579
|
* @return {void}
|
|
568
580
|
*/
|
|
569
581
|
|