@tiba-spark/client-shared-lib 10.3.0-396 → 10.3.0-403
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/esm2022/libraries/service-proxy/edge-service-proxies.mjs +47 -7
- package/esm2022/libraries/utils/custom-validator.util.mjs +39 -16
- package/esm2022/libraries/utils/date.util.mjs +3 -3
- package/fesm2022/tiba-spark-client-shared-lib.mjs +87 -23
- package/fesm2022/tiba-spark-client-shared-lib.mjs.map +1 -1
- package/libraries/service-proxy/edge-service-proxies.d.ts +27 -8
- package/libraries/service-proxy/edge-service-proxies.d.ts.map +1 -1
- package/libraries/utils/custom-validator.util.d.ts +5 -2
- package/libraries/utils/custom-validator.util.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -15477,7 +15477,7 @@ class AccessProfileServiceProxy {
|
|
|
15477
15477
|
return blobToText(responseBlob).pipe(mergeMap(_responseText => {
|
|
15478
15478
|
let result200 = null;
|
|
15479
15479
|
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
15480
|
-
result200 =
|
|
15480
|
+
result200 = DevicesForDeviceGroupDtoIEnumerableHttpResponseData.fromJS(resultData200);
|
|
15481
15481
|
return of(result200);
|
|
15482
15482
|
}));
|
|
15483
15483
|
}
|
|
@@ -59274,6 +59274,46 @@ class UpdateCouponBatchCommand {
|
|
|
59274
59274
|
return result;
|
|
59275
59275
|
}
|
|
59276
59276
|
}
|
|
59277
|
+
class UpdateDevicesForDeviceGroupDto {
|
|
59278
|
+
constructor(data) {
|
|
59279
|
+
if (data) {
|
|
59280
|
+
for (var property in data) {
|
|
59281
|
+
if (data.hasOwnProperty(property))
|
|
59282
|
+
this[property] = data[property];
|
|
59283
|
+
}
|
|
59284
|
+
}
|
|
59285
|
+
}
|
|
59286
|
+
init(_data) {
|
|
59287
|
+
if (_data) {
|
|
59288
|
+
this.id = _data["id"];
|
|
59289
|
+
this.rangeGroupDeviceId = _data["rangeGroupDeviceId"];
|
|
59290
|
+
this.deviceId = _data["deviceId"];
|
|
59291
|
+
this.rangeId = _data["rangeId"];
|
|
59292
|
+
this.isDeleted = _data["isDeleted"];
|
|
59293
|
+
}
|
|
59294
|
+
}
|
|
59295
|
+
static fromJS(data) {
|
|
59296
|
+
data = typeof data === 'object' ? data : {};
|
|
59297
|
+
let result = new UpdateDevicesForDeviceGroupDto();
|
|
59298
|
+
result.init(data);
|
|
59299
|
+
return result;
|
|
59300
|
+
}
|
|
59301
|
+
toJSON(data) {
|
|
59302
|
+
data = typeof data === 'object' ? data : {};
|
|
59303
|
+
data["id"] = this.id;
|
|
59304
|
+
data["rangeGroupDeviceId"] = this.rangeGroupDeviceId;
|
|
59305
|
+
data["deviceId"] = this.deviceId;
|
|
59306
|
+
data["rangeId"] = this.rangeId;
|
|
59307
|
+
data["isDeleted"] = this.isDeleted;
|
|
59308
|
+
return data;
|
|
59309
|
+
}
|
|
59310
|
+
clone() {
|
|
59311
|
+
const json = this.toJSON();
|
|
59312
|
+
let result = new UpdateDevicesForDeviceGroupDto();
|
|
59313
|
+
result.init(json);
|
|
59314
|
+
return result;
|
|
59315
|
+
}
|
|
59316
|
+
}
|
|
59277
59317
|
class UpdateDevicesGroupCommand {
|
|
59278
59318
|
constructor(data) {
|
|
59279
59319
|
if (data) {
|
|
@@ -60183,13 +60223,13 @@ class UpdateRangeDeviceGroupCommand {
|
|
|
60183
60223
|
}
|
|
60184
60224
|
init(_data) {
|
|
60185
60225
|
if (_data) {
|
|
60186
|
-
this.
|
|
60187
|
-
this.parkId = _data["parkId"];
|
|
60226
|
+
this.rangeGroupDeviceId = _data["rangeGroupDeviceId"];
|
|
60188
60227
|
this.deviceGroupName = _data["deviceGroupName"];
|
|
60228
|
+
this.parkId = _data["parkId"];
|
|
60189
60229
|
if (Array.isArray(_data["rangeDeviceGroups"])) {
|
|
60190
60230
|
this.rangeDeviceGroups = [];
|
|
60191
60231
|
for (let item of _data["rangeDeviceGroups"])
|
|
60192
|
-
this.rangeDeviceGroups.push(
|
|
60232
|
+
this.rangeDeviceGroups.push(UpdateDevicesForDeviceGroupDto.fromJS(item));
|
|
60193
60233
|
}
|
|
60194
60234
|
}
|
|
60195
60235
|
}
|
|
@@ -60201,9 +60241,9 @@ class UpdateRangeDeviceGroupCommand {
|
|
|
60201
60241
|
}
|
|
60202
60242
|
toJSON(data) {
|
|
60203
60243
|
data = typeof data === 'object' ? data : {};
|
|
60204
|
-
data["
|
|
60205
|
-
data["parkId"] = this.parkId;
|
|
60244
|
+
data["rangeGroupDeviceId"] = this.rangeGroupDeviceId;
|
|
60206
60245
|
data["deviceGroupName"] = this.deviceGroupName;
|
|
60246
|
+
data["parkId"] = this.parkId;
|
|
60207
60247
|
if (Array.isArray(this.rangeDeviceGroups)) {
|
|
60208
60248
|
data["rangeDeviceGroups"] = [];
|
|
60209
60249
|
for (let item of this.rangeDeviceGroups)
|
|
@@ -63063,6 +63103,7 @@ var edgeServiceProxies = /*#__PURE__*/Object.freeze({
|
|
|
63063
63103
|
UpdateChargeSegmentationCommand: UpdateChargeSegmentationCommand,
|
|
63064
63104
|
UpdateChargeTableCommand: UpdateChargeTableCommand,
|
|
63065
63105
|
UpdateCouponBatchCommand: UpdateCouponBatchCommand,
|
|
63106
|
+
UpdateDevicesForDeviceGroupDto: UpdateDevicesForDeviceGroupDto,
|
|
63066
63107
|
UpdateDevicesGroupCommand: UpdateDevicesGroupCommand,
|
|
63067
63108
|
UpdateDocumentCommand: UpdateDocumentCommand,
|
|
63068
63109
|
UpdateGuestCommand: UpdateGuestCommand,
|
|
@@ -66747,14 +66788,14 @@ function timeToMoment(time) {
|
|
|
66747
66788
|
if (!time || time.hours == null || time.minutes == null) {
|
|
66748
66789
|
return null;
|
|
66749
66790
|
}
|
|
66750
|
-
let { hours, minutes, seconds
|
|
66791
|
+
let { hours, minutes, seconds, middayPeriod } = time;
|
|
66751
66792
|
if (middayPeriod === MiddayPeriod.PM && hours < 12) {
|
|
66752
66793
|
hours += 12;
|
|
66753
66794
|
}
|
|
66754
66795
|
else if (middayPeriod === MiddayPeriod.AM && hours === 12) {
|
|
66755
66796
|
hours = 0;
|
|
66756
66797
|
}
|
|
66757
|
-
return moment$1().hours(hours).minutes(minutes).seconds(seconds);
|
|
66798
|
+
return moment$1().hours(hours).minutes(minutes).seconds(seconds ?? 0);
|
|
66758
66799
|
}
|
|
66759
66800
|
// Wrapper method to format minutes with ":" as separator (e.g., "HH:mm")
|
|
66760
66801
|
function formatTimeWithSeparator(value, isMidnightEnable) {
|
|
@@ -67194,31 +67235,28 @@ class TibaValidators {
|
|
|
67194
67235
|
}
|
|
67195
67236
|
return null;
|
|
67196
67237
|
}
|
|
67197
|
-
static
|
|
67238
|
+
static validateTibaTimeInRangeValidator(minTime, maxTime) {
|
|
67239
|
+
return (control) => {
|
|
67240
|
+
return this.validateTibaTimeInRange(control.value, minTime, maxTime);
|
|
67241
|
+
};
|
|
67242
|
+
}
|
|
67243
|
+
static validateStringHHMMInRangeValidator(minTime, maxTime) {
|
|
67198
67244
|
return (control) => {
|
|
67199
67245
|
if (!!control.value) {
|
|
67200
|
-
if (control.value.length !== 4) { // Assuming
|
|
67246
|
+
if (control.value.length !== 4) { // Assuming time format is 'HHMM'
|
|
67201
67247
|
return { form_validation_invalid_time_format: true };
|
|
67202
67248
|
}
|
|
67203
67249
|
else {
|
|
67204
67250
|
const hours = parseInt(control.value.slice(0, 2));
|
|
67205
67251
|
const minutes = parseInt(control.value.slice(2));
|
|
67206
|
-
const
|
|
67207
|
-
|
|
67208
|
-
if (!isValidTime) {
|
|
67209
|
-
return {
|
|
67210
|
-
form_validation_invalid_time: {
|
|
67211
|
-
from: `${fromHour.toString().padStart(2, '0')}:${fromMinutes.toString().padStart(2, '0')}`,
|
|
67212
|
-
to: `${toHour.toString().padStart(2, '0')}:${toMinutes.toString().padStart(2, '0')}`,
|
|
67213
|
-
}
|
|
67214
|
-
};
|
|
67215
|
-
}
|
|
67252
|
+
const currentTime = { hours, minutes };
|
|
67253
|
+
return this.validateTibaTimeInRange(currentTime, minTime, maxTime);
|
|
67216
67254
|
}
|
|
67217
67255
|
}
|
|
67218
67256
|
return null;
|
|
67219
67257
|
};
|
|
67220
67258
|
}
|
|
67221
|
-
static
|
|
67259
|
+
static timeRangeArrayOverlapValidator() {
|
|
67222
67260
|
return (control) => {
|
|
67223
67261
|
if (control.valid && control.enabled) {
|
|
67224
67262
|
const formArray = control.value;
|
|
@@ -67231,8 +67269,12 @@ class TibaValidators {
|
|
|
67231
67269
|
const compareRange = formArray[j];
|
|
67232
67270
|
const compareFrom = timeToMoment(compareRange.from);
|
|
67233
67271
|
const compareTo = timeToMoment(compareRange.to);
|
|
67234
|
-
if (
|
|
67235
|
-
|
|
67272
|
+
if (compareFrom && compareTo) {
|
|
67273
|
+
// Check for overlap
|
|
67274
|
+
const rangesOverlap = currentFrom.isBefore(compareTo) && currentTo.isAfter(compareFrom);
|
|
67275
|
+
if (rangesOverlap) {
|
|
67276
|
+
return { form_validation_time_range_overlap: true };
|
|
67277
|
+
}
|
|
67236
67278
|
}
|
|
67237
67279
|
}
|
|
67238
67280
|
}
|
|
@@ -67253,6 +67295,28 @@ class TibaValidators {
|
|
|
67253
67295
|
return fromTimeInNumber.toString().length === VALID_TIME_MAX_LENGTH &&
|
|
67254
67296
|
toTimeInNumber.toString().length === VALID_TIME_MAX_LENGTH;
|
|
67255
67297
|
}
|
|
67298
|
+
static validateTibaTimeInRange(currentTime, minTime, maxTime) {
|
|
67299
|
+
// If time is undefined, return null (no error)
|
|
67300
|
+
if (!currentTime) {
|
|
67301
|
+
return null;
|
|
67302
|
+
}
|
|
67303
|
+
const formatTime = (time) => `${time.hours.toString().padStart(2, '0')}:${time.minutes.toString().padStart(2, '0')}`;
|
|
67304
|
+
const hours = +currentTime.hours;
|
|
67305
|
+
const minutes = +currentTime.minutes;
|
|
67306
|
+
const isValidTime = (hours > minTime.hours || (hours === minTime.hours && minutes >= minTime.minutes)) &&
|
|
67307
|
+
(hours < maxTime.hours || (hours === maxTime.hours && minutes <= maxTime.minutes));
|
|
67308
|
+
// If time is valid, return null (no error)
|
|
67309
|
+
if (isValidTime) {
|
|
67310
|
+
return null;
|
|
67311
|
+
}
|
|
67312
|
+
// Otherwise, return the validation error with formatted time range
|
|
67313
|
+
return {
|
|
67314
|
+
form_validation_invalid_time: {
|
|
67315
|
+
from: formatTime(minTime),
|
|
67316
|
+
to: formatTime(maxTime),
|
|
67317
|
+
}
|
|
67318
|
+
};
|
|
67319
|
+
}
|
|
67256
67320
|
}
|
|
67257
67321
|
|
|
67258
67322
|
const lowerCaseFirstLetter = (value) => value.charAt(0).toLocaleLowerCase() + value.slice(1);
|