@tellescope/validation 1.225.0 → 1.227.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/lib/cjs/validation.d.ts +79 -1
- package/lib/cjs/validation.d.ts.map +1 -1
- package/lib/cjs/validation.js +112 -9
- package/lib/cjs/validation.js.map +1 -1
- package/lib/esm/validation.d.ts +79 -1
- package/lib/esm/validation.d.ts.map +1 -1
- package/lib/esm/validation.js +105 -2
- package/lib/esm/validation.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/validation.ts +114 -7
package/src/validation.ts
CHANGED
|
@@ -121,6 +121,7 @@ import {
|
|
|
121
121
|
StateCredentialInfo,
|
|
122
122
|
BaseAvailabilityBlock,
|
|
123
123
|
WeeklyAvailability,
|
|
124
|
+
MonthlyRestriction,
|
|
124
125
|
Timezone,
|
|
125
126
|
TIMEZONE_MAP,
|
|
126
127
|
FormType,
|
|
@@ -267,6 +268,8 @@ import {
|
|
|
267
268
|
SmartMeterPlaceOrderAutomationAction,
|
|
268
269
|
SmartMeterOrderLineItem,
|
|
269
270
|
FormFieldFeedback,
|
|
271
|
+
FormFieldOptionDetails,
|
|
272
|
+
MultipleChoiceOptions,
|
|
270
273
|
CandidProcedureCode,
|
|
271
274
|
BasicWebhook,
|
|
272
275
|
RemoveEnduserTagsAutomationAction,
|
|
@@ -1265,6 +1268,11 @@ export const numberValidator = numberValidatorBuilder({ lower: -10000000000000,
|
|
|
1265
1268
|
export const numberValidatorOptional = numberValidatorBuilder({ lower: -10000000000000, upper: 10000000000000, isOptional: true, emptyStringOk: true }) // max is 2286 in UTC MS
|
|
1266
1269
|
export const listOfNumbersValidatorUniqueOptionalOrEmptyOkay = listValidatorUniqueOptionalEmptyOkay(numberValidator, { isNumber: true })
|
|
1267
1270
|
|
|
1271
|
+
// Day of month and time validators for automation events
|
|
1272
|
+
export const numberValidatorMin1Max31 = numberValidatorBuilder({ lower: 1, upper: 31 })
|
|
1273
|
+
export const numberValidatorMin0Max23Optional = numberValidatorBuilder({ lower: 0, upper: 23, isOptional: true })
|
|
1274
|
+
export const numberValidatorMin0Max59Optional = numberValidatorBuilder({ lower: 0, upper: 59, isOptional: true })
|
|
1275
|
+
|
|
1268
1276
|
export const fileSizeValidator = numberValidatorBuilder({ lower: 0, upper: MAX_FILE_SIZE })
|
|
1269
1277
|
|
|
1270
1278
|
export const numberOrStringValidatorEmptyOkay = orValidator({
|
|
@@ -1541,11 +1549,6 @@ export const labeledFieldsValidator = listValidatorOptionalOrEmptyOk(objectValid
|
|
|
1541
1549
|
value: stringValidator5000,
|
|
1542
1550
|
}))
|
|
1543
1551
|
|
|
1544
|
-
type MultipleChoiceOptions = {
|
|
1545
|
-
choices: string[],
|
|
1546
|
-
other: boolean,
|
|
1547
|
-
radio: boolean,
|
|
1548
|
-
}
|
|
1549
1552
|
|
|
1550
1553
|
const DEFAULT_ENDUSER_FIELDS = [
|
|
1551
1554
|
'_id', 'email', 'phone', 'fname', 'lname', 'journeys', 'tags', 'preference'
|
|
@@ -1665,11 +1668,12 @@ export const FORM_FIELD_VALIDATORS_BY_TYPE: { [K in FormFieldType | 'userEmail'
|
|
|
1665
1668
|
}
|
|
1666
1669
|
|
|
1667
1670
|
const parsed = []
|
|
1671
|
+
const choices = fieldOptions.choices || []
|
|
1668
1672
|
for (const i of indexes) {
|
|
1669
1673
|
if (typeof i !== 'number') throw new Error(`Choice ${i} is not a valid index`)
|
|
1670
|
-
if (i < 0 || i >=
|
|
1674
|
+
if (i < 0 || i >= choices.length) throw new Error(`Choice ${i} is not a valid index`)
|
|
1671
1675
|
|
|
1672
|
-
parsed.push(
|
|
1676
|
+
parsed.push(choices[i])
|
|
1673
1677
|
}
|
|
1674
1678
|
if (otherText && fieldOptions.other === true) parsed.push(otherText)
|
|
1675
1679
|
// todo: add length limit to otherText?
|
|
@@ -2655,6 +2659,11 @@ export const automationEventValidator = orValidator<{ [K in AutomationEventType]
|
|
|
2655
2659
|
eventCondition: objectValidator<AfterActionAutomationEvent['info']['eventCondition']>({
|
|
2656
2660
|
before: booleanValidatorOptional,
|
|
2657
2661
|
}, { isOptional: true, emptyOk: true }),
|
|
2662
|
+
dayOfMonthCondition: objectValidator<AfterActionAutomationEvent['info']['dayOfMonthCondition']>({
|
|
2663
|
+
dayOfMonth: numberValidatorMin1Max31,
|
|
2664
|
+
hour: numberValidatorMin0Max23Optional,
|
|
2665
|
+
minute: numberValidatorMin0Max59Optional,
|
|
2666
|
+
}, { isOptional: true, emptyOk: true }),
|
|
2658
2667
|
skipIfDelayPassed: booleanValidatorOptional,
|
|
2659
2668
|
}, { emptyOk: false }),
|
|
2660
2669
|
}),
|
|
@@ -3419,6 +3428,7 @@ export const portalSettingsValidator = objectValidator<PortalSettings>({
|
|
|
3419
3428
|
loginDescription: stringValidator1000Optional,
|
|
3420
3429
|
loginGraphic: stringValidator1000Optional,
|
|
3421
3430
|
loginTitle: stringValidator1000Optional,
|
|
3431
|
+
loginBottomHTML: stringValidator5000OptionalEmptyOkay,
|
|
3422
3432
|
registerDescription: stringValidator1000Optional,
|
|
3423
3433
|
registerGraphic: stringValidator1000Optional,
|
|
3424
3434
|
registerTitle: stringValidator1000Optional,
|
|
@@ -3577,12 +3587,17 @@ export const formFieldFeedbackValidator = objectValidator<FormFieldFeedback>({
|
|
|
3577
3587
|
ifEquals: stringValidator,
|
|
3578
3588
|
display: stringValidator,
|
|
3579
3589
|
})
|
|
3590
|
+
export const formFieldOptionDetailsValidator = objectValidator<FormFieldOptionDetails>({
|
|
3591
|
+
option: stringValidator,
|
|
3592
|
+
description: stringValidator5000Optional,
|
|
3593
|
+
})
|
|
3580
3594
|
|
|
3581
3595
|
export const formFieldOptionsValidator = objectValidator<FormFieldOptions>({
|
|
3582
3596
|
default: stringValidatorOptional,
|
|
3583
3597
|
bookingPageId: stringValidatorOptional,
|
|
3584
3598
|
tableChoices: listValidatorOptionalOrEmptyOk(tableInputChoiceValidator),
|
|
3585
3599
|
choices: listOfStringsValidatorOptionalOrEmptyOk,
|
|
3600
|
+
optionDetails: listValidatorOptionalOrEmptyOk(formFieldOptionDetailsValidator),
|
|
3586
3601
|
radioChoices: listOfStringsValidatorOptionalOrEmptyOk,
|
|
3587
3602
|
canvasCodings: listValidatorOptionalOrEmptyOk(canvasCodingValidator),
|
|
3588
3603
|
from: numberValidatorOptional,
|
|
@@ -3605,6 +3620,7 @@ export const formFieldOptionsValidator = objectValidator<FormFieldOptions>({
|
|
|
3605
3620
|
databaseId: mongoIdStringOptional,
|
|
3606
3621
|
databaseLabel: stringValidatorOptionalEmptyOkay,
|
|
3607
3622
|
databaseLabels: listOfStringsValidatorOptionalOrEmptyOk,
|
|
3623
|
+
filterByEnduserState: booleanValidatorOptional,
|
|
3608
3624
|
databaseFilter: objectValidator<FormFieldOptions['databaseFilter']>({
|
|
3609
3625
|
databaseLabel: stringValidator1000Optional,
|
|
3610
3626
|
fieldId: mongoIdStringOptional,
|
|
@@ -3652,6 +3668,7 @@ export const formFieldOptionsValidator = objectValidator<FormFieldOptions>({
|
|
|
3652
3668
|
max: numberValidatorOptional,
|
|
3653
3669
|
min: numberValidatorOptional,
|
|
3654
3670
|
stripeKey: stringValidatorOptionalEmptyOkay,
|
|
3671
|
+
stripeProductSelectionMode: booleanValidatorOptional,
|
|
3655
3672
|
dataSource: stringValidatorOptionalEmptyOkay,
|
|
3656
3673
|
esignatureTermsCompanyName: stringValidatorOptionalEmptyOkay,
|
|
3657
3674
|
observationCode: stringValidatorOptionalEmptyOkay,
|
|
@@ -4030,6 +4047,7 @@ export const portalBlockValidator = orValidator<{ [K in PortalBlockType]: Portal
|
|
|
4030
4047
|
title: stringValidator,
|
|
4031
4048
|
roles: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4032
4049
|
showAll: booleanValidatorOptional,
|
|
4050
|
+
hideContactButton: booleanValidatorOptional,
|
|
4033
4051
|
// members: listValidatorEmptyOk(
|
|
4034
4052
|
// objectValidator<CareTeamMemberPortalCustomizationInfo>({
|
|
4035
4053
|
// title: stringValidator(),
|
|
@@ -4121,6 +4139,27 @@ export const baseAvailabilityBlockValidator = objectValidator<BaseAvailabilityBl
|
|
|
4121
4139
|
})
|
|
4122
4140
|
export const baseAvailabilityBlocksValidator = listValidatorEmptyOk(baseAvailabilityBlockValidator)
|
|
4123
4141
|
|
|
4142
|
+
const monthlyOccurrenceValidator: ValidatorDefinition<1 | 2 | 3 | 4 | 5> = {
|
|
4143
|
+
validate: (o={}) => build_validator(
|
|
4144
|
+
(value: JSONType) => {
|
|
4145
|
+
if (![1, 2, 3, 4, 5].includes(value as number)) {
|
|
4146
|
+
throw new Error(`Value must be one of 1, 2, 3, 4, 5`)
|
|
4147
|
+
}
|
|
4148
|
+
return value as 1 | 2 | 3 | 4 | 5
|
|
4149
|
+
},
|
|
4150
|
+
{ ...o, listOf: false }
|
|
4151
|
+
),
|
|
4152
|
+
getExample: () => 1,
|
|
4153
|
+
getType: getTypeString,
|
|
4154
|
+
}
|
|
4155
|
+
|
|
4156
|
+
export const monthlyRestrictionValidator = objectValidator<MonthlyRestriction>({
|
|
4157
|
+
occurrences: listValidator(monthlyOccurrenceValidator),
|
|
4158
|
+
})
|
|
4159
|
+
export const monthlyRestrictionOptionalValidator = objectValidator<MonthlyRestriction>({
|
|
4160
|
+
occurrences: listValidator(monthlyOccurrenceValidator),
|
|
4161
|
+
}, { isOptional: true, emptyOk: true })
|
|
4162
|
+
|
|
4124
4163
|
export const weeklyAvailabilityValidator = objectValidator<WeeklyAvailability>({
|
|
4125
4164
|
dayOfWeekStartingSundayIndexedByZero: nonNegNumberValidator,
|
|
4126
4165
|
endTimeInMinutes: nonNegNumberValidator,
|
|
@@ -4132,6 +4171,7 @@ export const weeklyAvailabilityValidator = objectValidator<WeeklyAvailability>({
|
|
|
4132
4171
|
intervalInMinutes: numberValidatorOptional,
|
|
4133
4172
|
priority: numberValidatorOptional,
|
|
4134
4173
|
bufferStartMinutes: numberValidatorOptional,
|
|
4174
|
+
monthlyRestriction: monthlyRestrictionOptionalValidator,
|
|
4135
4175
|
})
|
|
4136
4176
|
export const weeklyAvailabilitiesValidator = listValidatorEmptyOk(weeklyAvailabilityValidator)
|
|
4137
4177
|
|
|
@@ -4182,6 +4222,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4182
4222
|
required: booleanValidatorOptional,
|
|
4183
4223
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4184
4224
|
requireConfirmation: booleanValidatorOptional,
|
|
4225
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4185
4226
|
}),
|
|
4186
4227
|
"Multiple Select": objectValidator<CustomEnduserFields['Multiple Select']>({
|
|
4187
4228
|
type: exactMatchValidator(['Multiple Select']),
|
|
@@ -4192,6 +4233,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4192
4233
|
required: booleanValidatorOptional,
|
|
4193
4234
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4194
4235
|
requireConfirmation: booleanValidatorOptional,
|
|
4236
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4195
4237
|
}),
|
|
4196
4238
|
Text: objectValidator<CustomEnduserFields['Text']>({
|
|
4197
4239
|
type: exactMatchValidator(['Text']),
|
|
@@ -4200,6 +4242,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4200
4242
|
required: booleanValidatorOptional,
|
|
4201
4243
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4202
4244
|
requireConfirmation: booleanValidatorOptional,
|
|
4245
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4203
4246
|
}),
|
|
4204
4247
|
Number: objectValidator<CustomEnduserFields['Number']>({
|
|
4205
4248
|
type: exactMatchValidator(['Number']),
|
|
@@ -4208,6 +4251,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4208
4251
|
required: booleanValidatorOptional,
|
|
4209
4252
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4210
4253
|
requireConfirmation: booleanValidatorOptional,
|
|
4254
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4211
4255
|
}),
|
|
4212
4256
|
File: objectValidator<CustomEnduserFields['File']>({
|
|
4213
4257
|
type: exactMatchValidator(['File']),
|
|
@@ -4216,6 +4260,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4216
4260
|
required: booleanValidatorOptional,
|
|
4217
4261
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4218
4262
|
requireConfirmation: booleanValidatorOptional,
|
|
4263
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4219
4264
|
}),
|
|
4220
4265
|
"Multiple Text": objectValidator<CustomEnduserFields["Multiple Text"]>({
|
|
4221
4266
|
type: exactMatchValidator(["Multiple Text"]),
|
|
@@ -4224,6 +4269,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4224
4269
|
required: booleanValidatorOptional,
|
|
4225
4270
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4226
4271
|
requireConfirmation: booleanValidatorOptional,
|
|
4272
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4227
4273
|
}),
|
|
4228
4274
|
Date: objectValidator<CustomEnduserFields['Date']>({
|
|
4229
4275
|
type: exactMatchValidator(['Date']),
|
|
@@ -4232,6 +4278,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4232
4278
|
required: booleanValidatorOptional,
|
|
4233
4279
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4234
4280
|
requireConfirmation: booleanValidatorOptional,
|
|
4281
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4235
4282
|
}),
|
|
4236
4283
|
"Auto Detect": objectValidator<CustomEnduserFields["Auto Detect"]>({
|
|
4237
4284
|
type: exactMatchValidator(["Auto Detect"]),
|
|
@@ -4240,6 +4287,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4240
4287
|
required: booleanValidatorOptional,
|
|
4241
4288
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4242
4289
|
requireConfirmation: booleanValidatorOptional,
|
|
4290
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4243
4291
|
}),
|
|
4244
4292
|
"Table": objectValidator<CustomEnduserFields["Table"]>({
|
|
4245
4293
|
type: exactMatchValidator(["Table"]),
|
|
@@ -4250,6 +4298,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4250
4298
|
required: booleanValidatorOptional,
|
|
4251
4299
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4252
4300
|
requireConfirmation: booleanValidatorOptional,
|
|
4301
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4253
4302
|
}),
|
|
4254
4303
|
"Checkbox": objectValidator<CustomEnduserFields["Checkbox"]>({
|
|
4255
4304
|
type: exactMatchValidator(["Checkbox"]),
|
|
@@ -4258,6 +4307,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4258
4307
|
required: booleanValidatorOptional,
|
|
4259
4308
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4260
4309
|
requireConfirmation: booleanValidatorOptional,
|
|
4310
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4261
4311
|
}),
|
|
4262
4312
|
"Database Select": objectValidator<CustomEnduserFields["Database Select"]>({
|
|
4263
4313
|
type: exactMatchValidator(["Database Select"]),
|
|
@@ -4269,6 +4319,7 @@ export const customEnduserFieldValidator = orValidator<{ [K in CustomEnduserFiel
|
|
|
4269
4319
|
required: booleanValidatorOptional,
|
|
4270
4320
|
hiddenFromProfile: booleanValidatorOptional,
|
|
4271
4321
|
requireConfirmation: booleanValidatorOptional,
|
|
4322
|
+
tags: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4272
4323
|
}),
|
|
4273
4324
|
})
|
|
4274
4325
|
export const customEnduserFieldsValidatorOptionalOrEmpty = listValidatorOptionalOrEmptyOk(customEnduserFieldValidator)
|
|
@@ -4537,6 +4588,7 @@ export const automationTriggerEventValidator = orValidator<{ [K in AutomationTri
|
|
|
4537
4588
|
info: objectValidator<AutomationTriggerEvents['Purchase Made']['info']>({
|
|
4538
4589
|
titles: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4539
4590
|
productIds: listOfMongoIdStringValidatorOptionalOrEmptyOk,
|
|
4591
|
+
titlePartialMatches: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4540
4592
|
}),
|
|
4541
4593
|
conditions: optionalEmptyObjectValidator,
|
|
4542
4594
|
}),
|
|
@@ -4612,6 +4664,7 @@ export const automationTriggerEventValidator = orValidator<{ [K in AutomationTri
|
|
|
4612
4664
|
type: exactMatchValidator(['Appointment Rescheduled']),
|
|
4613
4665
|
info: objectValidator<AutomationTriggerEvents['Appointment Rescheduled']['info']>({
|
|
4614
4666
|
titles: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4667
|
+
detectManualReschedules: booleanValidatorOptional,
|
|
4615
4668
|
}),
|
|
4616
4669
|
conditions: optionalEmptyObjectValidator,
|
|
4617
4670
|
}),
|
|
@@ -5415,6 +5468,7 @@ export const analyticsQueryValidator = orValidator<{ [K in AnalyticsQueryType]:
|
|
|
5415
5468
|
State: booleanValidatorOptional,
|
|
5416
5469
|
Phone: booleanValidatorOptional,
|
|
5417
5470
|
"Scheduled By": booleanValidatorOptional,
|
|
5471
|
+
"Completed By": booleanValidatorOptional,
|
|
5418
5472
|
alsoGroupByHost: booleanValidatorOptional,
|
|
5419
5473
|
"Cancel Reason": booleanValidatorOptional,
|
|
5420
5474
|
}, { isOptional: true, emptyOk: true }),
|
|
@@ -5753,6 +5807,56 @@ export const analyticsQueryValidator = orValidator<{ [K in AnalyticsQueryType]:
|
|
|
5753
5807
|
key: exactMatchValidator<AnalyticsQueryRangeKeyForType['Orders']>(['Created At', 'Updated At']),
|
|
5754
5808
|
}, { isOptional: true, emptyOk: true })
|
|
5755
5809
|
}),
|
|
5810
|
+
"Chat Rooms": objectValidator<AnalyticsQueryForType['Chat Rooms']>({
|
|
5811
|
+
resource: exactMatchValidator<'Chat Rooms'>(['Chat Rooms']),
|
|
5812
|
+
filter: objectValidator<AnalyticsQueryFilterForType['Chat Rooms']>({
|
|
5813
|
+
}, { isOptional: true, emptyOk: true }),
|
|
5814
|
+
info: orValidator<{ [K in keyof AnalyticsQueryInfoForType['Chat Rooms']]: AnalyticsQueryInfoForType['Chat Rooms'][K] }>({
|
|
5815
|
+
"Total": objectValidator<AnalyticsQueryInfoForType['Chat Rooms']['Total']>({
|
|
5816
|
+
method: exactMatchValidator<"Total">(['Total']),
|
|
5817
|
+
parameters: optionalEmptyObjectValidator,
|
|
5818
|
+
}),
|
|
5819
|
+
}),
|
|
5820
|
+
grouping: objectValidator<AnalyticsQueryGroupingForType['Chat Rooms']>({
|
|
5821
|
+
Enduser: booleanValidatorOptional,
|
|
5822
|
+
Gender: booleanValidatorOptional,
|
|
5823
|
+
"Assigned To": booleanValidatorOptional,
|
|
5824
|
+
Field: stringValidatorOptionalEmptyOkay,
|
|
5825
|
+
Tags: booleanValidatorOptional,
|
|
5826
|
+
Age: booleanValidatorOptional,
|
|
5827
|
+
State: booleanValidatorOptional,
|
|
5828
|
+
Phone: booleanValidatorOptional,
|
|
5829
|
+
}, { isOptional: true, emptyOk: true }),
|
|
5830
|
+
range: objectValidator<AnalyticsQueryRange<any>>({
|
|
5831
|
+
interval: exactMatchValidator<AnalyticsQueryRangeInterval>(['Daily', 'Weekly', 'Monthly', 'Hourly']),
|
|
5832
|
+
key: exactMatchValidator<AnalyticsQueryRangeKeyForType['Chat Rooms']>(['Created At', 'Updated At']),
|
|
5833
|
+
}, { isOptional: true, emptyOk: true })
|
|
5834
|
+
}),
|
|
5835
|
+
"Chats": objectValidator<AnalyticsQueryForType['Chats']>({
|
|
5836
|
+
resource: exactMatchValidator<'Chats'>(['Chats']),
|
|
5837
|
+
filter: objectValidator<AnalyticsQueryFilterForType['Chats']>({
|
|
5838
|
+
}, { isOptional: true, emptyOk: true }),
|
|
5839
|
+
info: orValidator<{ [K in keyof AnalyticsQueryInfoForType['Chats']]: AnalyticsQueryInfoForType['Chats'][K] }>({
|
|
5840
|
+
"Total": objectValidator<AnalyticsQueryInfoForType['Chats']['Total']>({
|
|
5841
|
+
method: exactMatchValidator<"Total">(['Total']),
|
|
5842
|
+
parameters: optionalEmptyObjectValidator,
|
|
5843
|
+
}),
|
|
5844
|
+
}),
|
|
5845
|
+
grouping: objectValidator<AnalyticsQueryGroupingForType['Chats']>({
|
|
5846
|
+
Enduser: booleanValidatorOptional,
|
|
5847
|
+
Gender: booleanValidatorOptional,
|
|
5848
|
+
"Assigned To": booleanValidatorOptional,
|
|
5849
|
+
Field: stringValidatorOptionalEmptyOkay,
|
|
5850
|
+
Tags: booleanValidatorOptional,
|
|
5851
|
+
Age: booleanValidatorOptional,
|
|
5852
|
+
State: booleanValidatorOptional,
|
|
5853
|
+
Phone: booleanValidatorOptional,
|
|
5854
|
+
}, { isOptional: true, emptyOk: true }),
|
|
5855
|
+
range: objectValidator<AnalyticsQueryRange<any>>({
|
|
5856
|
+
interval: exactMatchValidator<AnalyticsQueryRangeInterval>(['Daily', 'Weekly', 'Monthly', 'Hourly']),
|
|
5857
|
+
key: exactMatchValidator<AnalyticsQueryRangeKeyForType['Chats']>(['Created At', 'Updated At']),
|
|
5858
|
+
}, { isOptional: true, emptyOk: true })
|
|
5859
|
+
}),
|
|
5756
5860
|
})
|
|
5757
5861
|
export const analyticsQueriesValidatorOptional = listValidatorOptionalOrEmptyOk(analyticsQueryValidator)
|
|
5758
5862
|
|
|
@@ -5777,6 +5881,8 @@ const _ANALYTICS_QUERY_TYPES: { [K in AnalyticsQueryType]: any } = {
|
|
|
5777
5881
|
Meetings: true,
|
|
5778
5882
|
"Journey Logs": true,
|
|
5779
5883
|
Orders: true,
|
|
5884
|
+
"Chat Rooms": true,
|
|
5885
|
+
"Chats": true,
|
|
5780
5886
|
}
|
|
5781
5887
|
export const ANALYTICS_QUERY_TYPES = Object.keys(_ANALYTICS_QUERY_TYPES) as AnalyticsQueryType[]
|
|
5782
5888
|
export const analyticsQueryTypeValidator = exactMatchValidator<AnalyticsQueryType>(ANALYTICS_QUERY_TYPES)
|
|
@@ -5810,6 +5916,7 @@ export const userUIRestrictionsValidator = objectValidator<UserUIRestrictions>({
|
|
|
5810
5916
|
hideMergeEndusers: booleanValidatorOptional,
|
|
5811
5917
|
hideQueuedTicketsViewer: booleanValidatorOptional,
|
|
5812
5918
|
hideIncomingFaxesIcon: booleanValidatorOptional,
|
|
5919
|
+
hideNotificationsIcon: booleanValidatorOptional,
|
|
5813
5920
|
hideBulkEnduserActions: booleanValidatorOptional,
|
|
5814
5921
|
visibleIntegrations: listOfStringsValidatorUniqueOptionalOrEmptyOkay,
|
|
5815
5922
|
}, { emptyOk: true })
|