@tellescope/validation 1.88.0 → 1.89.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 +14 -4
- package/lib/cjs/validation.d.ts.map +1 -1
- package/lib/cjs/validation.js +42 -2
- package/lib/cjs/validation.js.map +1 -1
- package/lib/esm/validation.d.ts +14 -4
- package/lib/esm/validation.d.ts.map +1 -1
- package/lib/esm/validation.js +42 -2
- package/lib/esm/validation.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/validation.ts +44 -10
package/src/validation.ts
CHANGED
|
@@ -10,9 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
WEBHOOK_MODELS,
|
|
12
12
|
WebhookSupportedModel,
|
|
13
|
-
|
|
14
13
|
FilterType,
|
|
15
|
-
|
|
16
14
|
CustomField,
|
|
17
15
|
Preference,
|
|
18
16
|
JourneyState,
|
|
@@ -73,7 +71,6 @@ import {
|
|
|
73
71
|
CreateTicketAssignmentStrategy,
|
|
74
72
|
CreateTicketAssignmentStrategyType,
|
|
75
73
|
TicketCompletedEventInfo,
|
|
76
|
-
FormResponse,
|
|
77
74
|
FormResponseValueAnswer,
|
|
78
75
|
PreviousFormField,
|
|
79
76
|
PreviousFormFieldAfterInfo,
|
|
@@ -232,9 +229,7 @@ import {
|
|
|
232
229
|
TableViewColumn,
|
|
233
230
|
FormFieldCalloutCondition,
|
|
234
231
|
FormFieldCalloutConditionComparison,
|
|
235
|
-
EndusersReportQueries,
|
|
236
232
|
EnduserReportQuery,
|
|
237
|
-
ReportQuery,
|
|
238
233
|
FormResponsesReportQuery,
|
|
239
234
|
PhoneCallsReportQuery,
|
|
240
235
|
TypedField,
|
|
@@ -256,7 +251,6 @@ import {
|
|
|
256
251
|
SortingField,
|
|
257
252
|
TicketReminder,
|
|
258
253
|
EnduserInsurance,
|
|
259
|
-
InsuranceRelationship,
|
|
260
254
|
FormResponseAnswerInsurance,
|
|
261
255
|
CanvasConsentCategory,
|
|
262
256
|
DiagnosisTypes,
|
|
@@ -278,7 +272,7 @@ import {
|
|
|
278
272
|
RemoveEnduserTagsAutomationAction,
|
|
279
273
|
HealthieSyncAutomationAction,
|
|
280
274
|
SyncDirection,
|
|
281
|
-
|
|
275
|
+
AthenaFieldSync,
|
|
282
276
|
AthenaSubscription,
|
|
283
277
|
CompleteTicketsAutomationAction,
|
|
284
278
|
} from "@tellescope/types-models"
|
|
@@ -2446,6 +2440,15 @@ export const ticketActionValidator = orValidator<{ [K in TicketActionType]: Tick
|
|
|
2446
2440
|
completedAt: dateOptionalOrEmptyStringValidator,
|
|
2447
2441
|
optional: booleanValidatorOptional,
|
|
2448
2442
|
}),
|
|
2443
|
+
"Send SMS": objectValidator<TicketActions['Send SMS']>({
|
|
2444
|
+
type: exactMatchValidator(['Send SMS']),
|
|
2445
|
+
info: objectValidator<TicketActions['Send SMS']['info']>({
|
|
2446
|
+
templateId: mongoIdStringRequired,
|
|
2447
|
+
smsId: mongoIdStringOptional,
|
|
2448
|
+
}, { emptyOk: false }),
|
|
2449
|
+
completedAt: dateOptionalOrEmptyStringValidator,
|
|
2450
|
+
optional: booleanValidatorOptional,
|
|
2451
|
+
}),
|
|
2449
2452
|
})
|
|
2450
2453
|
export const ticketActionsValidator = listValidatorOptionalOrEmptyOk(ticketActionValidator)
|
|
2451
2454
|
|
|
@@ -2477,14 +2480,17 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2477
2480
|
setEnduserStatus: objectValidator<SetEnduserStatusAutomationAction>({
|
|
2478
2481
|
type: exactMatchValidator(['setEnduserStatus']),
|
|
2479
2482
|
info: objectValidator<SetEnduserStatusInfo>({ status: stringValidator250 }, { emptyOk: false }),
|
|
2483
|
+
continueOnError: booleanValidatorOptional,
|
|
2480
2484
|
}),
|
|
2481
2485
|
sendEmail: objectValidator<SendEmailAutomationAction>({
|
|
2482
2486
|
type: exactMatchValidator(['sendEmail']),
|
|
2483
|
-
info: automationForMessageValidator
|
|
2487
|
+
info: automationForMessageValidator,
|
|
2488
|
+
continueOnError: booleanValidatorOptional,
|
|
2484
2489
|
}),
|
|
2485
2490
|
sendSMS: objectValidator<SendSMSAutomationAction>({
|
|
2486
2491
|
type: exactMatchValidator(['sendSMS']),
|
|
2487
2492
|
info: automationForMessageValidator,
|
|
2493
|
+
continueOnError: booleanValidatorOptional,
|
|
2488
2494
|
}),
|
|
2489
2495
|
notifyTeam: objectValidator<NotifyTeamAutomationAction>({
|
|
2490
2496
|
type: exactMatchValidator(['notifyTeam']),
|
|
@@ -2496,6 +2502,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2496
2502
|
},
|
|
2497
2503
|
{ emptyOk: false }
|
|
2498
2504
|
),
|
|
2505
|
+
continueOnError: booleanValidatorOptional,
|
|
2499
2506
|
}),
|
|
2500
2507
|
sendForm: objectValidator<SendFormAutomationAction>({
|
|
2501
2508
|
type: exactMatchValidator(['sendForm']),
|
|
@@ -2505,14 +2512,17 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2505
2512
|
channel: communicationsChannelValidatorOptional,
|
|
2506
2513
|
assignment: senderAssignmentStrategyValidatorOptional,
|
|
2507
2514
|
}, { emptyOk: false }),
|
|
2515
|
+
continueOnError: booleanValidatorOptional,
|
|
2508
2516
|
}),
|
|
2509
2517
|
shareContent: objectValidator<ShareContentAutomationAction>({
|
|
2510
2518
|
type: exactMatchValidator(['shareContent']),
|
|
2511
2519
|
info: objectValidator<ShareContentAutomationAction['info']>({
|
|
2512
2520
|
managedContentRecordIds: listOfMongoIdStringValidator,
|
|
2513
2521
|
}, { emptyOk: false }),
|
|
2522
|
+
continueOnError: booleanValidatorOptional,
|
|
2514
2523
|
}),
|
|
2515
2524
|
createTicket: objectValidator<CreateTicketAutomationAction>({
|
|
2525
|
+
continueOnError: booleanValidatorOptional,
|
|
2516
2526
|
type: exactMatchValidator(['createTicket']),
|
|
2517
2527
|
info: objectValidator<CreateTicketActionInfo>({
|
|
2518
2528
|
title: stringValidator1000,
|
|
@@ -2566,10 +2576,12 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2566
2576
|
}, { emptyOk: false }),
|
|
2567
2577
|
}),
|
|
2568
2578
|
sendWebhook: objectValidator<SendWebhookAutomationAction>({
|
|
2579
|
+
continueOnError: booleanValidatorOptional,
|
|
2569
2580
|
type: exactMatchValidator(['sendWebhook']),
|
|
2570
2581
|
info: objectValidator<AutomationForWebhook>({ message: stringValidator5000 }, { emptyOk: false }),
|
|
2571
2582
|
}),
|
|
2572
2583
|
setEnduserFields: objectValidator<SetEnduserFieldsAutomationAction>({
|
|
2584
|
+
continueOnError: booleanValidatorOptional,
|
|
2573
2585
|
type: exactMatchValidator(['setEnduserFields']),
|
|
2574
2586
|
info: objectValidator<SetEnduserFieldsAutomationAction['info']>({
|
|
2575
2587
|
fields: listValidator(objectValidator<EnduserFieldSetter>({
|
|
@@ -2580,36 +2592,42 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2580
2592
|
}, { emptyOk: false }),
|
|
2581
2593
|
}),
|
|
2582
2594
|
addEnduserTags: objectValidator<AddEnduserTagsAutomationAction>({
|
|
2595
|
+
continueOnError: booleanValidatorOptional,
|
|
2583
2596
|
type: exactMatchValidator(['addEnduserTags']),
|
|
2584
2597
|
info: objectValidator<AddEnduserTagsAutomationAction['info']>({
|
|
2585
2598
|
tags: listOfStringsValidator,
|
|
2586
2599
|
}, { emptyOk: false }),
|
|
2587
2600
|
}),
|
|
2588
2601
|
removeEnduserTags: objectValidator<RemoveEnduserTagsAutomationAction>({
|
|
2602
|
+
continueOnError: booleanValidatorOptional,
|
|
2589
2603
|
type: exactMatchValidator(['removeEnduserTags']),
|
|
2590
2604
|
info: objectValidator<RemoveEnduserTagsAutomationAction['info']>({
|
|
2591
2605
|
tags: listOfStringsValidator,
|
|
2592
2606
|
}, { emptyOk: false }),
|
|
2593
2607
|
}),
|
|
2594
2608
|
addToJourney: objectValidator<AddToJourneyAutomationAction>({
|
|
2609
|
+
continueOnError: booleanValidatorOptional,
|
|
2595
2610
|
type: exactMatchValidator(['addToJourney']),
|
|
2596
2611
|
info: objectValidator<AddToJourneyAutomationAction['info']>({
|
|
2597
2612
|
journeyId: mongoIdStringRequired,
|
|
2598
2613
|
}, { emptyOk: false }),
|
|
2599
2614
|
}),
|
|
2600
2615
|
removeFromJourney: objectValidator<RemoveFromJourneyAutomationAction>({
|
|
2616
|
+
continueOnError: booleanValidatorOptional,
|
|
2601
2617
|
type: exactMatchValidator(['removeFromJourney']),
|
|
2602
2618
|
info: objectValidator<RemoveFromJourneyAutomationAction['info']>({
|
|
2603
2619
|
journeyId: mongoIdStringRequired,
|
|
2604
2620
|
}, { emptyOk: false }),
|
|
2605
2621
|
}),
|
|
2606
2622
|
iterableSendEmail: objectValidator<IterableSendEmailAutomationAction>({
|
|
2623
|
+
continueOnError: booleanValidatorOptional,
|
|
2607
2624
|
type: exactMatchValidator(['iterableSendEmail']),
|
|
2608
2625
|
info: objectValidator<IterableSendEmailAutomationAction['info']>({
|
|
2609
2626
|
campaignId: stringValidator,
|
|
2610
2627
|
}, { emptyOk: false }),
|
|
2611
2628
|
}),
|
|
2612
2629
|
iterableCustomEvent: objectValidator<IterableCustomEventAutomationAction>({
|
|
2630
|
+
continueOnError: booleanValidatorOptional,
|
|
2613
2631
|
type: exactMatchValidator(['iterableCustomEvent']),
|
|
2614
2632
|
info: objectValidator<IterableCustomEventAutomationAction['info']>({
|
|
2615
2633
|
eventName: stringValidator,
|
|
@@ -2623,6 +2641,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2623
2641
|
}, { emptyOk: false }),
|
|
2624
2642
|
}),
|
|
2625
2643
|
zendeskCreateTicket: objectValidator<ZendeskCreateTicketAutomationAction>({
|
|
2644
|
+
continueOnError: booleanValidatorOptional,
|
|
2626
2645
|
type: exactMatchValidator(['zendeskCreateTicket']),
|
|
2627
2646
|
info: objectValidator<ZendeskCreateTicketAutomationAction['info']>({
|
|
2628
2647
|
templateId: mongoIdStringRequired,
|
|
@@ -2630,6 +2649,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2630
2649
|
}, { emptyOk: false }),
|
|
2631
2650
|
}),
|
|
2632
2651
|
createCarePlan: objectValidator<CreateCarePlanAutomationAction>({
|
|
2652
|
+
continueOnError: booleanValidatorOptional,
|
|
2633
2653
|
type: exactMatchValidator(['createCarePlan']),
|
|
2634
2654
|
info: objectValidator<CreateCarePlanAutomationAction['info']>({
|
|
2635
2655
|
title: stringValidator1000,
|
|
@@ -2639,14 +2659,17 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2639
2659
|
}, { emptyOk: false }),
|
|
2640
2660
|
}),
|
|
2641
2661
|
completeCarePlan: objectValidator<CompleteCarePlanAutomationAction>({
|
|
2662
|
+
continueOnError: booleanValidatorOptional,
|
|
2642
2663
|
type: exactMatchValidator(['completeCarePlan']),
|
|
2643
2664
|
info: objectValidator<CompleteCarePlanAutomationAction['info']>({ }, { emptyOk: true }),
|
|
2644
2665
|
}),
|
|
2645
2666
|
zusSync: objectValidator<ZusSyncAutomationAction>({
|
|
2667
|
+
continueOnError: booleanValidatorOptional,
|
|
2646
2668
|
type: exactMatchValidator(['zusSync']),
|
|
2647
2669
|
info: objectValidator<ZusSyncAutomationAction['info']>({ }, { emptyOk: true }),
|
|
2648
2670
|
}),
|
|
2649
2671
|
pagerDutyCreateIncident: objectValidator<PagerDutyCreateIncidentAutomationAction>({
|
|
2672
|
+
continueOnError: booleanValidatorOptional,
|
|
2650
2673
|
type: exactMatchValidator(['pagerDutyCreateIncident']),
|
|
2651
2674
|
info: objectValidator<PagerDutyCreateIncidentAutomationAction['info']>({
|
|
2652
2675
|
title: stringValidator,
|
|
@@ -2655,6 +2678,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2655
2678
|
}),
|
|
2656
2679
|
}),
|
|
2657
2680
|
smartMeterPlaceOrder: objectValidator<SmartMeterPlaceOrderAutomationAction>({
|
|
2681
|
+
continueOnError: booleanValidatorOptional,
|
|
2658
2682
|
type: exactMatchValidator(['smartMeterPlaceOrder']),
|
|
2659
2683
|
info: objectValidator<SmartMeterPlaceOrderAutomationAction['info']>({
|
|
2660
2684
|
lines: smartMeterLinesValidator,
|
|
@@ -2662,10 +2686,12 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2662
2686
|
}),
|
|
2663
2687
|
}),
|
|
2664
2688
|
healthieSync: objectValidator<HealthieSyncAutomationAction>({
|
|
2689
|
+
continueOnError: booleanValidatorOptional,
|
|
2665
2690
|
type: exactMatchValidator(['healthieSync']),
|
|
2666
2691
|
info: objectValidator<HealthieSyncAutomationAction['info']>({ }, { emptyOk: true }),
|
|
2667
2692
|
}),
|
|
2668
2693
|
completeTickets: objectValidator<CompleteTicketsAutomationAction>({
|
|
2694
|
+
continueOnError: booleanValidatorOptional,
|
|
2669
2695
|
type: exactMatchValidator(['completeTickets']),
|
|
2670
2696
|
info: objectValidator<CompleteTicketsAutomationAction['info']>({
|
|
2671
2697
|
journeyIds: listOfMongoIdStringValidatorOptionalOrEmptyOk,
|
|
@@ -2679,6 +2705,7 @@ export const journeyContextValidator = objectValidator<JourneyContext>({
|
|
|
2679
2705
|
purchaseId: mongoIdStringOptional,
|
|
2680
2706
|
templateId: mongoIdStringOptional,
|
|
2681
2707
|
orderId: mongoIdStringOptional,
|
|
2708
|
+
observationId: mongoIdStringOptional,
|
|
2682
2709
|
})
|
|
2683
2710
|
|
|
2684
2711
|
export const relatedRecordValidator = objectValidator<RelatedRecord>({
|
|
@@ -2910,6 +2937,7 @@ export const formFieldOptionsValidator = objectValidator<FormFieldOptions>({
|
|
|
2910
2937
|
}, { isOptional: true, emptyOk: true }),
|
|
2911
2938
|
useDatePicker: booleanValidatorOptional,
|
|
2912
2939
|
sharedIntakeFields: listOfStringsValidatorOptionalOrEmptyOk,
|
|
2940
|
+
copyResponse: booleanValidatorOptional,
|
|
2913
2941
|
disableGoBack: booleanValidatorOptional,
|
|
2914
2942
|
disableNext: booleanValidatorOptional,
|
|
2915
2943
|
canvasConsentCategory: objectValidator<CanvasConsentCategory>({
|
|
@@ -4692,9 +4720,15 @@ const enduserProfileWebhookValidator = objectValidator<BasicWebhook>({
|
|
|
4692
4720
|
export const enduserProfileWebhooksValidator = listValidatorEmptyOk(enduserProfileWebhookValidator)
|
|
4693
4721
|
|
|
4694
4722
|
export const syncDirectionValidator = exactMatchValidator<SyncDirection>(['Bidirectional', 'From Tellescope', 'To Tellescope'])
|
|
4695
|
-
export const fieldSyncValidator = objectValidator<
|
|
4723
|
+
export const fieldSyncValidator = objectValidator<AthenaFieldSync>({
|
|
4696
4724
|
field: stringValidator100,
|
|
4697
|
-
externalField:
|
|
4725
|
+
externalField: objectValidator<AthenaFieldSync['externalField']>({
|
|
4726
|
+
id: stringValidator100,
|
|
4727
|
+
options: listValidatorOptionalOrEmptyOk(objectValidator<{ id: string, value: string }>({
|
|
4728
|
+
id: stringValidator,
|
|
4729
|
+
value: stringValidator,
|
|
4730
|
+
}))
|
|
4731
|
+
}),
|
|
4698
4732
|
direction: syncDirectionValidator,
|
|
4699
4733
|
})
|
|
4700
4734
|
export const fieldsSyncValidator = listValidatorEmptyOk(fieldSyncValidator)
|