@ricado/api-client 1.3.0 → 2.0.1
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/index.d.ts +841 -1588
- package/lib/index.js +67 -38
- package/package.json +3 -3
- 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/index.js +35 -3
- package/lib/Models/Site/BaseSiteModel.js +0 -58
- package/src/Models/Site/BaseSiteModel.js +0 -30
|
@@ -28,213 +28,81 @@ class UserAccountModel extends BaseModel
|
|
|
28
28
|
* The User Account ID
|
|
29
29
|
*
|
|
30
30
|
* @type {string}
|
|
31
|
-
* @
|
|
31
|
+
* @public
|
|
32
32
|
*/
|
|
33
|
-
this.
|
|
33
|
+
this.id = undefined;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The User's Email Address
|
|
37
37
|
*
|
|
38
38
|
* @type {string}
|
|
39
|
-
* @
|
|
39
|
+
* @public
|
|
40
40
|
*/
|
|
41
|
-
this.
|
|
41
|
+
this.email = undefined;
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* The User's First Name
|
|
45
45
|
*
|
|
46
46
|
* @type {?string}
|
|
47
|
-
* @
|
|
47
|
+
* @public
|
|
48
48
|
*/
|
|
49
|
-
this.
|
|
49
|
+
this.firstName = undefined;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* The User's Last Name
|
|
53
53
|
*
|
|
54
54
|
* @type {?string}
|
|
55
|
-
* @
|
|
55
|
+
* @public
|
|
56
56
|
*/
|
|
57
|
-
this.
|
|
57
|
+
this.lastName = undefined;
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* The Company this User belongs to
|
|
61
61
|
*
|
|
62
62
|
* @type {string}
|
|
63
|
-
* @
|
|
63
|
+
* @public
|
|
64
64
|
*/
|
|
65
|
-
this.
|
|
65
|
+
this.companyId = undefined;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* The Policies that apply to this User Account
|
|
69
69
|
*
|
|
70
70
|
* @type {string[]}
|
|
71
|
-
* @
|
|
71
|
+
* @public
|
|
72
72
|
*/
|
|
73
|
-
this.
|
|
73
|
+
this.policies = undefined;
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Whether a Password has been Set for the User Account
|
|
77
77
|
*
|
|
78
78
|
* @type {boolean}
|
|
79
|
-
* @
|
|
79
|
+
* @public
|
|
80
80
|
*/
|
|
81
|
-
this.
|
|
81
|
+
this.hasPassword = undefined;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Whether a Pin Code has been Set for the User Account
|
|
85
85
|
*
|
|
86
86
|
* @type {boolean}
|
|
87
|
-
* @
|
|
87
|
+
* @public
|
|
88
88
|
*/
|
|
89
|
-
this.
|
|
89
|
+
this.hasPinCode = undefined;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Whether the User Account has been deleted
|
|
93
93
|
*
|
|
94
94
|
* @type {boolean}
|
|
95
|
-
* @
|
|
95
|
+
* @public
|
|
96
96
|
*/
|
|
97
|
-
this.
|
|
97
|
+
this.deleted = undefined;
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
100
|
* When the User Account was last updated
|
|
101
101
|
*
|
|
102
102
|
* @type {Date}
|
|
103
|
-
* @
|
|
103
|
+
* @public
|
|
104
104
|
*/
|
|
105
|
-
this.
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* The User Account ID
|
|
110
|
-
*
|
|
111
|
-
* @public
|
|
112
|
-
* @type {string}
|
|
113
|
-
*/
|
|
114
|
-
get id()
|
|
115
|
-
{
|
|
116
|
-
return this._id;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* The User's Email Address
|
|
121
|
-
*
|
|
122
|
-
* @public
|
|
123
|
-
* @type {string}
|
|
124
|
-
*/
|
|
125
|
-
get email()
|
|
126
|
-
{
|
|
127
|
-
return this._email;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* The User's First Name
|
|
132
|
-
*
|
|
133
|
-
* @public
|
|
134
|
-
* @type {?string}
|
|
135
|
-
*/
|
|
136
|
-
get firstName()
|
|
137
|
-
{
|
|
138
|
-
return this._firstName;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* The User's Last Name
|
|
143
|
-
*
|
|
144
|
-
* @public
|
|
145
|
-
* @type {?string}
|
|
146
|
-
*/
|
|
147
|
-
get lastName()
|
|
148
|
-
{
|
|
149
|
-
return this._lastName;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* The Company this User belongs to
|
|
154
|
-
*
|
|
155
|
-
* @public
|
|
156
|
-
* @type {string}
|
|
157
|
-
*/
|
|
158
|
-
get companyId()
|
|
159
|
-
{
|
|
160
|
-
return this._companyId;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* The Policies that apply to this User Account
|
|
165
|
-
*
|
|
166
|
-
* @public
|
|
167
|
-
* @type {string[]}
|
|
168
|
-
*/
|
|
169
|
-
get policies()
|
|
170
|
-
{
|
|
171
|
-
return this._policies;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Whether a Password has been Set for the User Account
|
|
176
|
-
*
|
|
177
|
-
* @public
|
|
178
|
-
* @type {boolean}
|
|
179
|
-
*/
|
|
180
|
-
get hasPassword()
|
|
181
|
-
{
|
|
182
|
-
return this._hasPassword;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Whether a Pin Code has been Set for the User Account
|
|
187
|
-
*
|
|
188
|
-
* @public
|
|
189
|
-
* @type {boolean}
|
|
190
|
-
*/
|
|
191
|
-
get hasPinCode()
|
|
192
|
-
{
|
|
193
|
-
return this._hasPinCode;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Whether the User Account has been deleted
|
|
198
|
-
*
|
|
199
|
-
* @public
|
|
200
|
-
* @type {boolean}
|
|
201
|
-
*/
|
|
202
|
-
get deleted()
|
|
203
|
-
{
|
|
204
|
-
return this._deleted;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* When the User Account was last updated
|
|
209
|
-
*
|
|
210
|
-
* @public
|
|
211
|
-
* @type {Date}
|
|
212
|
-
*/
|
|
213
|
-
get updateTimestamp()
|
|
214
|
-
{
|
|
215
|
-
return this._updateTimestamp;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Convert this **UserAccountModel** to a JSON Object
|
|
220
|
-
*
|
|
221
|
-
* @public
|
|
222
|
-
* @return {Object<string, any>}
|
|
223
|
-
*/
|
|
224
|
-
toJSON()
|
|
225
|
-
{
|
|
226
|
-
return {
|
|
227
|
-
id: this._id,
|
|
228
|
-
email: this._email,
|
|
229
|
-
firstName: this._firstName,
|
|
230
|
-
lastName: this._lastName,
|
|
231
|
-
companyId: this._companyId,
|
|
232
|
-
policies: this._policies,
|
|
233
|
-
hasPassword: this._hasPassword,
|
|
234
|
-
hasPinCode: this._hasPinCode,
|
|
235
|
-
deleted: this._deleted,
|
|
236
|
-
updateTimestamp: this._updateTimestamp
|
|
237
|
-
};
|
|
105
|
+
this.updateTimestamp = undefined;
|
|
238
106
|
}
|
|
239
107
|
|
|
240
108
|
/**
|
|
@@ -267,7 +135,7 @@ class UserAccountModel extends BaseModel
|
|
|
267
135
|
|
|
268
136
|
if('id' in jsonObject)
|
|
269
137
|
{
|
|
270
|
-
model.
|
|
138
|
+
model.id = (function(){
|
|
271
139
|
if(typeof jsonObject['id'] !== 'string')
|
|
272
140
|
{
|
|
273
141
|
return String(jsonObject['id']);
|
|
@@ -279,7 +147,7 @@ class UserAccountModel extends BaseModel
|
|
|
279
147
|
|
|
280
148
|
if('email' in jsonObject)
|
|
281
149
|
{
|
|
282
|
-
model.
|
|
150
|
+
model.email = (function(){
|
|
283
151
|
if(typeof jsonObject['email'] !== 'string')
|
|
284
152
|
{
|
|
285
153
|
return String(jsonObject['email']);
|
|
@@ -291,7 +159,7 @@ class UserAccountModel extends BaseModel
|
|
|
291
159
|
|
|
292
160
|
if('firstName' in jsonObject)
|
|
293
161
|
{
|
|
294
|
-
model.
|
|
162
|
+
model.firstName = (function(){
|
|
295
163
|
if(jsonObject['firstName'] === null)
|
|
296
164
|
{
|
|
297
165
|
return null;
|
|
@@ -308,7 +176,7 @@ class UserAccountModel extends BaseModel
|
|
|
308
176
|
|
|
309
177
|
if('lastName' in jsonObject)
|
|
310
178
|
{
|
|
311
|
-
model.
|
|
179
|
+
model.lastName = (function(){
|
|
312
180
|
if(jsonObject['lastName'] === null)
|
|
313
181
|
{
|
|
314
182
|
return null;
|
|
@@ -325,7 +193,7 @@ class UserAccountModel extends BaseModel
|
|
|
325
193
|
|
|
326
194
|
if('companyId' in jsonObject)
|
|
327
195
|
{
|
|
328
|
-
model.
|
|
196
|
+
model.companyId = (function(){
|
|
329
197
|
if(typeof jsonObject['companyId'] !== 'string')
|
|
330
198
|
{
|
|
331
199
|
return String(jsonObject['companyId']);
|
|
@@ -337,7 +205,7 @@ class UserAccountModel extends BaseModel
|
|
|
337
205
|
|
|
338
206
|
if('policies' in jsonObject)
|
|
339
207
|
{
|
|
340
|
-
model.
|
|
208
|
+
model.policies = (function(){
|
|
341
209
|
if(Array.isArray(jsonObject['policies']) !== true)
|
|
342
210
|
{
|
|
343
211
|
return [];
|
|
@@ -358,7 +226,7 @@ class UserAccountModel extends BaseModel
|
|
|
358
226
|
|
|
359
227
|
if('hasPassword' in jsonObject)
|
|
360
228
|
{
|
|
361
|
-
model.
|
|
229
|
+
model.hasPassword = (function(){
|
|
362
230
|
if(typeof jsonObject['hasPassword'] !== 'boolean')
|
|
363
231
|
{
|
|
364
232
|
return Boolean(jsonObject['hasPassword']);
|
|
@@ -370,7 +238,7 @@ class UserAccountModel extends BaseModel
|
|
|
370
238
|
|
|
371
239
|
if('hasPinCode' in jsonObject)
|
|
372
240
|
{
|
|
373
|
-
model.
|
|
241
|
+
model.hasPinCode = (function(){
|
|
374
242
|
if(typeof jsonObject['hasPinCode'] !== 'boolean')
|
|
375
243
|
{
|
|
376
244
|
return Boolean(jsonObject['hasPinCode']);
|
|
@@ -382,7 +250,7 @@ class UserAccountModel extends BaseModel
|
|
|
382
250
|
|
|
383
251
|
if('deleted' in jsonObject)
|
|
384
252
|
{
|
|
385
|
-
model.
|
|
253
|
+
model.deleted = (function(){
|
|
386
254
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
387
255
|
{
|
|
388
256
|
return Boolean(jsonObject['deleted']);
|
|
@@ -394,7 +262,7 @@ class UserAccountModel extends BaseModel
|
|
|
394
262
|
|
|
395
263
|
if('updateTimestamp' in jsonObject)
|
|
396
264
|
{
|
|
397
|
-
model.
|
|
265
|
+
model.updateTimestamp = (function(){
|
|
398
266
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
399
267
|
{
|
|
400
268
|
return new Date(String(jsonObject['updateTimestamp']));
|
package/src/PackageVersion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// generated by genversion
|
|
2
|
-
export const version = '
|
|
2
|
+
export const version = '2.0.1';
|
package/src/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import NoAuthPaths from './NoAuthPaths';
|
|
|
10
10
|
import Controllers from './Controllers/index';
|
|
11
11
|
import Errors from './Errors/index';
|
|
12
12
|
import Models from './Models/index';
|
|
13
|
-
import {
|
|
13
|
+
import { decode as base64Decode } from 'js-base64';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Determines if a Variable has been Defined
|
|
@@ -55,7 +55,7 @@ export function getToken()
|
|
|
55
55
|
*/
|
|
56
56
|
export function setToken(jwt)
|
|
57
57
|
{
|
|
58
|
-
if(
|
|
58
|
+
if(isJwtValid(jwt))
|
|
59
59
|
{
|
|
60
60
|
JWT = jwt;
|
|
61
61
|
}
|
|
@@ -74,7 +74,7 @@ export function setToken(jwt)
|
|
|
74
74
|
*/
|
|
75
75
|
export function hasToken()
|
|
76
76
|
{
|
|
77
|
-
return isDefined(JWT) &&
|
|
77
|
+
return isDefined(JWT) && isJwtValid(JWT);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
@@ -405,6 +405,38 @@ export function ping() {
|
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
+
/**
|
|
409
|
+
*
|
|
410
|
+
* @param {string} jwt The JWT Token
|
|
411
|
+
* @return {boolean}
|
|
412
|
+
*/
|
|
413
|
+
function isJwtValid(jwt)
|
|
414
|
+
{
|
|
415
|
+
if(jwt === null || typeof jwt !== 'string')
|
|
416
|
+
{
|
|
417
|
+
return false;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
let jwtSegments = jwt.split('.');
|
|
421
|
+
|
|
422
|
+
if(jwtSegments.length !== 3)
|
|
423
|
+
{
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
try
|
|
428
|
+
{
|
|
429
|
+
JSON.parse(base64Decode(jwtSegments[0]));
|
|
430
|
+
JSON.parse(base64Decode(jwtSegments[1]));
|
|
431
|
+
|
|
432
|
+
return true;
|
|
433
|
+
}
|
|
434
|
+
catch
|
|
435
|
+
{
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
408
440
|
/**
|
|
409
441
|
* The Library Version
|
|
410
442
|
*
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _BaseModel2 = _interopRequireDefault(require("../../Models/BaseModel"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
-
|
|
16
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
17
|
-
|
|
18
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
19
|
-
|
|
20
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
21
|
-
|
|
22
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
23
|
-
|
|
24
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
|
-
|
|
26
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
-
|
|
28
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The Abstract **BaseSiteModel** Class
|
|
32
|
-
*
|
|
33
|
-
* @class
|
|
34
|
-
* @abstract
|
|
35
|
-
* @hideconstructor
|
|
36
|
-
* @extends BaseModel
|
|
37
|
-
*/
|
|
38
|
-
var BaseSiteModel = /*#__PURE__*/function (_BaseModel) {
|
|
39
|
-
_inherits(BaseSiteModel, _BaseModel);
|
|
40
|
-
|
|
41
|
-
var _super = _createSuper(BaseSiteModel);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* BaseSiteModel Constructor
|
|
45
|
-
*
|
|
46
|
-
* @protected
|
|
47
|
-
*/
|
|
48
|
-
function BaseSiteModel() {
|
|
49
|
-
_classCallCheck(this, BaseSiteModel);
|
|
50
|
-
|
|
51
|
-
return _super.call(this);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return BaseSiteModel;
|
|
55
|
-
}(_BaseModel2.default);
|
|
56
|
-
|
|
57
|
-
var _default = BaseSiteModel;
|
|
58
|
-
exports.default = _default;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File Auto-Generated by the RICADO Gen 4 PHP API Project
|
|
3
|
-
*
|
|
4
|
-
* Do Not Edit this File Manually!
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import BaseModel from '../../Models/BaseModel';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* The Abstract **BaseSiteModel** Class
|
|
11
|
-
*
|
|
12
|
-
* @class
|
|
13
|
-
* @abstract
|
|
14
|
-
* @hideconstructor
|
|
15
|
-
* @extends BaseModel
|
|
16
|
-
*/
|
|
17
|
-
class BaseSiteModel extends BaseModel
|
|
18
|
-
{
|
|
19
|
-
/**
|
|
20
|
-
* BaseSiteModel Constructor
|
|
21
|
-
*
|
|
22
|
-
* @protected
|
|
23
|
-
*/
|
|
24
|
-
constructor()
|
|
25
|
-
{
|
|
26
|
-
super();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default BaseSiteModel;
|