@tellescope/validation 1.210.0 → 1.212.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 +11 -106
- package/lib/cjs/validation.d.ts.map +1 -1
- package/lib/cjs/validation.js +105 -293
- package/lib/cjs/validation.js.map +1 -1
- package/lib/esm/validation.d.ts +11 -106
- package/lib/esm/validation.d.ts.map +1 -1
- package/lib/esm/validation.js +105 -293
- package/lib/esm/validation.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -10
- package/src/validation.ts +80 -61
package/src/validation.ts
CHANGED
|
@@ -324,6 +324,7 @@ import {
|
|
|
324
324
|
CallUserAutomationAction,
|
|
325
325
|
StripeChargeCardOnFileAutomationAction,
|
|
326
326
|
FormResponseAnswerTimezone,
|
|
327
|
+
BrandedWebhookActions,
|
|
327
328
|
} from "@tellescope/types-models"
|
|
328
329
|
import {
|
|
329
330
|
AppointmentBookingPage,
|
|
@@ -2547,6 +2548,7 @@ export const calendarEventReminderValidator = orValidator<{ [K in CalendarEventR
|
|
|
2547
2548
|
info: objectValidator<CalendarEventReminderNotificationInfo>({
|
|
2548
2549
|
templateId: mongoIdStringOptional,
|
|
2549
2550
|
channel: communicationsChannelValidatorOptional,
|
|
2551
|
+
useTemplateForSMS: booleanValidatorOptional,
|
|
2550
2552
|
}, { emptyOk: true }),
|
|
2551
2553
|
type: exactMatchValidator<'enduser-notification'>(['enduser-notification']),
|
|
2552
2554
|
...sharedReminderValidators,
|
|
@@ -2555,6 +2557,7 @@ export const calendarEventReminderValidator = orValidator<{ [K in CalendarEventR
|
|
|
2555
2557
|
info: objectValidator<CalendarEventReminderNotificationInfo>({
|
|
2556
2558
|
templateId: mongoIdStringOptional,
|
|
2557
2559
|
channel: communicationsChannelValidatorOptional,
|
|
2560
|
+
useTemplateForSMS: booleanValidatorOptional,
|
|
2558
2561
|
}, { emptyOk: true }),
|
|
2559
2562
|
type: exactMatchValidator<'user-notification'>(['user-notification']),
|
|
2560
2563
|
...sharedReminderValidators,
|
|
@@ -2798,7 +2801,20 @@ export const canvasCodingValidatorOptional = objectValidator<CanvasCoding>({
|
|
|
2798
2801
|
system: stringValidatorOptional,
|
|
2799
2802
|
}, { })
|
|
2800
2803
|
|
|
2801
|
-
|
|
2804
|
+
const sharedAutomationActionValidators = {
|
|
2805
|
+
continueOnError: booleanValidatorOptional,
|
|
2806
|
+
isBrandedWebhook: booleanValidatorOptional,
|
|
2807
|
+
}
|
|
2808
|
+
const sendWebhookInfoValidator = objectValidator<AutomationForWebhook>({
|
|
2809
|
+
message: stringValidator5000Optional, // optional when custom url is provided
|
|
2810
|
+
url: stringValidator20000ptional,
|
|
2811
|
+
fields: labeledFieldsValidator,
|
|
2812
|
+
secret: stringValidatorOptional,
|
|
2813
|
+
method: stringValidatorOptional,
|
|
2814
|
+
headers: labeledFieldsValidator,
|
|
2815
|
+
}, { emptyOk: false })
|
|
2816
|
+
|
|
2817
|
+
export const automationActionValidator = orValidator<{ [K in AutomationActionType]: AutomationAction & { type: K } } | { [K in BrandedWebhookActions]: SendWebhookAutomationAction } >({
|
|
2802
2818
|
developHealthMedEligibility: objectValidator<DevelopHealthMedicationEligibilityAutomationAction>({
|
|
2803
2819
|
type: exactMatchValidator(['developHealthMedEligibility']),
|
|
2804
2820
|
info: objectValidator<DevelopHealthMedicationEligibilityAutomationAction['info']>({
|
|
@@ -2807,12 +2823,12 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2807
2823
|
mock_result: developHealthMockResultValidator,
|
|
2808
2824
|
providerUserId: mongoIdStringRequired,
|
|
2809
2825
|
}, { emptyOk: false }),
|
|
2810
|
-
|
|
2826
|
+
...sharedAutomationActionValidators,
|
|
2811
2827
|
}),
|
|
2812
2828
|
setEnduserStatus: objectValidator<SetEnduserStatusAutomationAction>({
|
|
2813
2829
|
type: exactMatchValidator(['setEnduserStatus']),
|
|
2814
2830
|
info: objectValidator<SetEnduserStatusInfo>({ status: stringValidator250 }, { emptyOk: false }),
|
|
2815
|
-
|
|
2831
|
+
...sharedAutomationActionValidators,
|
|
2816
2832
|
}),
|
|
2817
2833
|
sendEmail: objectValidator<SendEmailAutomationAction>({
|
|
2818
2834
|
type: exactMatchValidator(['sendEmail']),
|
|
@@ -2825,12 +2841,12 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2825
2841
|
ccRelatedContactTypes: listOfStringsValidatorOptionalOrEmptyOk,
|
|
2826
2842
|
hiddenFromTimeline: booleanValidatorOptional,
|
|
2827
2843
|
}, { emptyOk: false }),
|
|
2828
|
-
|
|
2844
|
+
...sharedAutomationActionValidators,
|
|
2829
2845
|
}),
|
|
2830
2846
|
sendSMS: objectValidator<SendSMSAutomationAction>({
|
|
2831
2847
|
type: exactMatchValidator(['sendSMS']),
|
|
2832
2848
|
info: automationForMessageValidator,
|
|
2833
|
-
|
|
2849
|
+
...sharedAutomationActionValidators,
|
|
2834
2850
|
}),
|
|
2835
2851
|
notifyTeam: objectValidator<NotifyTeamAutomationAction>({
|
|
2836
2852
|
type: exactMatchValidator(['notifyTeam']),
|
|
@@ -2843,7 +2859,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2843
2859
|
},
|
|
2844
2860
|
{ emptyOk: false }
|
|
2845
2861
|
),
|
|
2846
|
-
|
|
2862
|
+
...sharedAutomationActionValidators,
|
|
2847
2863
|
}),
|
|
2848
2864
|
sendForm: objectValidator<SendFormAutomationAction>({
|
|
2849
2865
|
type: exactMatchValidator(['sendForm']),
|
|
@@ -2853,17 +2869,17 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2853
2869
|
channel: communicationsChannelValidatorOptional,
|
|
2854
2870
|
assignment: senderAssignmentStrategyValidatorOptional,
|
|
2855
2871
|
}, { emptyOk: false }),
|
|
2856
|
-
|
|
2872
|
+
...sharedAutomationActionValidators,
|
|
2857
2873
|
}),
|
|
2858
2874
|
shareContent: objectValidator<ShareContentAutomationAction>({
|
|
2859
2875
|
type: exactMatchValidator(['shareContent']),
|
|
2860
2876
|
info: objectValidator<ShareContentAutomationAction['info']>({
|
|
2861
2877
|
managedContentRecordIds: listOfMongoIdStringValidator,
|
|
2862
2878
|
}, { emptyOk: false }),
|
|
2863
|
-
|
|
2879
|
+
...sharedAutomationActionValidators,
|
|
2864
2880
|
}),
|
|
2865
2881
|
createTicket: objectValidator<CreateTicketAutomationAction>({
|
|
2866
|
-
|
|
2882
|
+
...sharedAutomationActionValidators,
|
|
2867
2883
|
type: exactMatchValidator(['createTicket']),
|
|
2868
2884
|
info: objectValidator<CreateTicketActionInfo>({
|
|
2869
2885
|
title: stringValidator1000,
|
|
@@ -2928,19 +2944,12 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2928
2944
|
}, { emptyOk: false }),
|
|
2929
2945
|
}),
|
|
2930
2946
|
sendWebhook: objectValidator<SendWebhookAutomationAction>({
|
|
2931
|
-
|
|
2947
|
+
...sharedAutomationActionValidators,
|
|
2932
2948
|
type: exactMatchValidator(['sendWebhook']),
|
|
2933
|
-
info:
|
|
2934
|
-
message: stringValidator5000Optional, // optional when custom url is provided
|
|
2935
|
-
url: stringValidator20000ptional,
|
|
2936
|
-
fields: labeledFieldsValidator,
|
|
2937
|
-
secret: stringValidatorOptional,
|
|
2938
|
-
method: stringValidatorOptional,
|
|
2939
|
-
headers: labeledFieldsValidator,
|
|
2940
|
-
}, { emptyOk: false }),
|
|
2949
|
+
info: sendWebhookInfoValidator,
|
|
2941
2950
|
}),
|
|
2942
2951
|
setEnduserFields: objectValidator<SetEnduserFieldsAutomationAction>({
|
|
2943
|
-
|
|
2952
|
+
...sharedAutomationActionValidators,
|
|
2944
2953
|
type: exactMatchValidator(['setEnduserFields']),
|
|
2945
2954
|
info: objectValidator<SetEnduserFieldsAutomationAction['info']>({
|
|
2946
2955
|
fields: listValidator(objectValidator<EnduserFieldSetter>({
|
|
@@ -2952,7 +2961,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2952
2961
|
}, { emptyOk: false }),
|
|
2953
2962
|
}),
|
|
2954
2963
|
addEnduserTags: objectValidator<AddEnduserTagsAutomationAction>({
|
|
2955
|
-
|
|
2964
|
+
...sharedAutomationActionValidators,
|
|
2956
2965
|
type: exactMatchValidator(['addEnduserTags']),
|
|
2957
2966
|
info: objectValidator<AddEnduserTagsAutomationAction['info']>({
|
|
2958
2967
|
tags: listOfStringsValidator,
|
|
@@ -2960,14 +2969,14 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2960
2969
|
}, { emptyOk: false }),
|
|
2961
2970
|
}),
|
|
2962
2971
|
removeEnduserTags: objectValidator<RemoveEnduserTagsAutomationAction>({
|
|
2963
|
-
|
|
2972
|
+
...sharedAutomationActionValidators,
|
|
2964
2973
|
type: exactMatchValidator(['removeEnduserTags']),
|
|
2965
2974
|
info: objectValidator<RemoveEnduserTagsAutomationAction['info']>({
|
|
2966
2975
|
tags: listOfStringsValidator,
|
|
2967
2976
|
}, { emptyOk: false }),
|
|
2968
2977
|
}),
|
|
2969
2978
|
addAccessTags: objectValidator<AddAccessTagsAutomationAction>({
|
|
2970
|
-
|
|
2979
|
+
...sharedAutomationActionValidators,
|
|
2971
2980
|
type: exactMatchValidator(['addAccessTags']),
|
|
2972
2981
|
info: objectValidator<AddAccessTagsAutomationAction['info']>({
|
|
2973
2982
|
tags: listOfStringsValidator,
|
|
@@ -2975,40 +2984,40 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
2975
2984
|
}, { emptyOk: false }),
|
|
2976
2985
|
}),
|
|
2977
2986
|
removeAccessTags: objectValidator<RemoveAccessTagsAutomationAction>({
|
|
2978
|
-
|
|
2987
|
+
...sharedAutomationActionValidators,
|
|
2979
2988
|
type: exactMatchValidator(['removeAccessTags']),
|
|
2980
2989
|
info: objectValidator<RemoveAccessTagsAutomationAction['info']>({
|
|
2981
2990
|
tags: listOfStringsValidator,
|
|
2982
2991
|
}, { emptyOk: false }),
|
|
2983
2992
|
}),
|
|
2984
2993
|
addToJourney: objectValidator<AddToJourneyAutomationAction>({
|
|
2985
|
-
|
|
2994
|
+
...sharedAutomationActionValidators,
|
|
2986
2995
|
type: exactMatchValidator(['addToJourney']),
|
|
2987
2996
|
info: objectValidator<AddToJourneyAutomationAction['info']>({
|
|
2988
2997
|
journeyId: mongoIdStringRequired,
|
|
2989
2998
|
}, { emptyOk: false }),
|
|
2990
2999
|
}),
|
|
2991
3000
|
removeFromJourney: objectValidator<RemoveFromJourneyAutomationAction>({
|
|
2992
|
-
|
|
3001
|
+
...sharedAutomationActionValidators,
|
|
2993
3002
|
type: exactMatchValidator(['removeFromJourney']),
|
|
2994
3003
|
info: objectValidator<RemoveFromJourneyAutomationAction['info']>({
|
|
2995
3004
|
journeyId: mongoIdStringRequired,
|
|
2996
3005
|
}, { emptyOk: false }),
|
|
2997
3006
|
}),
|
|
2998
3007
|
removeFromAllJourneys: objectValidator<RemoveFromAllJourneysAutomationAction>({
|
|
2999
|
-
|
|
3008
|
+
...sharedAutomationActionValidators,
|
|
3000
3009
|
type: exactMatchValidator(['removeFromAllJourneys']),
|
|
3001
3010
|
info: objectValidator<RemoveFromAllJourneysAutomationAction['info']>({}, { emptyOk: true, isOptional: true }),
|
|
3002
3011
|
}),
|
|
3003
3012
|
iterableSendEmail: objectValidator<IterableSendEmailAutomationAction>({
|
|
3004
|
-
|
|
3013
|
+
...sharedAutomationActionValidators,
|
|
3005
3014
|
type: exactMatchValidator(['iterableSendEmail']),
|
|
3006
3015
|
info: objectValidator<IterableSendEmailAutomationAction['info']>({
|
|
3007
3016
|
campaignId: stringValidator,
|
|
3008
3017
|
}, { emptyOk: false }),
|
|
3009
3018
|
}),
|
|
3010
3019
|
iterableCustomEvent: objectValidator<IterableCustomEventAutomationAction>({
|
|
3011
|
-
|
|
3020
|
+
...sharedAutomationActionValidators,
|
|
3012
3021
|
type: exactMatchValidator(['iterableCustomEvent']),
|
|
3013
3022
|
info: objectValidator<IterableCustomEventAutomationAction['info']>({
|
|
3014
3023
|
eventName: stringValidator,
|
|
@@ -3024,7 +3033,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3024
3033
|
}, { emptyOk: false }),
|
|
3025
3034
|
}),
|
|
3026
3035
|
zendeskCreateTicket: objectValidator<ZendeskCreateTicketAutomationAction>({
|
|
3027
|
-
|
|
3036
|
+
...sharedAutomationActionValidators,
|
|
3028
3037
|
type: exactMatchValidator(['zendeskCreateTicket']),
|
|
3029
3038
|
info: objectValidator<ZendeskCreateTicketAutomationAction['info']>({
|
|
3030
3039
|
templateId: mongoIdStringRequired,
|
|
@@ -3032,7 +3041,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3032
3041
|
}, { emptyOk: false }),
|
|
3033
3042
|
}),
|
|
3034
3043
|
createCarePlan: objectValidator<CreateCarePlanAutomationAction>({
|
|
3035
|
-
|
|
3044
|
+
...sharedAutomationActionValidators,
|
|
3036
3045
|
type: exactMatchValidator(['createCarePlan']),
|
|
3037
3046
|
info: objectValidator<CreateCarePlanAutomationAction['info']>({
|
|
3038
3047
|
title: stringValidator1000,
|
|
@@ -3043,22 +3052,22 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3043
3052
|
}, { emptyOk: false }),
|
|
3044
3053
|
}),
|
|
3045
3054
|
completeCarePlan: objectValidator<CompleteCarePlanAutomationAction>({
|
|
3046
|
-
|
|
3055
|
+
...sharedAutomationActionValidators,
|
|
3047
3056
|
type: exactMatchValidator(['completeCarePlan']),
|
|
3048
3057
|
info: objectValidator<CompleteCarePlanAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3049
3058
|
}),
|
|
3050
3059
|
zusSync: objectValidator<ZusSyncAutomationAction>({
|
|
3051
|
-
|
|
3060
|
+
...sharedAutomationActionValidators,
|
|
3052
3061
|
type: exactMatchValidator(['zusSync']),
|
|
3053
3062
|
info: objectValidator<ZusSyncAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3054
3063
|
}),
|
|
3055
3064
|
zusPull: objectValidator<ZusPullAutomationAction>({
|
|
3056
|
-
|
|
3065
|
+
...sharedAutomationActionValidators,
|
|
3057
3066
|
type: exactMatchValidator(['zusPull']),
|
|
3058
3067
|
info: objectValidator<ZusPullAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3059
3068
|
}),
|
|
3060
3069
|
zusSubscribe: objectValidator<ZusSubscribeAutomationAction>({
|
|
3061
|
-
|
|
3070
|
+
...sharedAutomationActionValidators,
|
|
3062
3071
|
type: exactMatchValidator(['zusSubscribe']),
|
|
3063
3072
|
info: objectValidator<ZusSubscribeAutomationAction['info']>({
|
|
3064
3073
|
practitionerId: stringValidator,
|
|
@@ -3066,7 +3075,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3066
3075
|
}),
|
|
3067
3076
|
}),
|
|
3068
3077
|
pagerDutyCreateIncident: objectValidator<PagerDutyCreateIncidentAutomationAction>({
|
|
3069
|
-
|
|
3078
|
+
...sharedAutomationActionValidators,
|
|
3070
3079
|
type: exactMatchValidator(['pagerDutyCreateIncident']),
|
|
3071
3080
|
info: objectValidator<PagerDutyCreateIncidentAutomationAction['info']>({
|
|
3072
3081
|
title: stringValidator,
|
|
@@ -3075,7 +3084,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3075
3084
|
}),
|
|
3076
3085
|
}),
|
|
3077
3086
|
smartMeterPlaceOrder: objectValidator<SmartMeterPlaceOrderAutomationAction>({
|
|
3078
|
-
|
|
3087
|
+
...sharedAutomationActionValidators,
|
|
3079
3088
|
type: exactMatchValidator(['smartMeterPlaceOrder']),
|
|
3080
3089
|
info: objectValidator<SmartMeterPlaceOrderAutomationAction['info']>({
|
|
3081
3090
|
lines: smartMeterLinesValidator,
|
|
@@ -3083,7 +3092,7 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3083
3092
|
}),
|
|
3084
3093
|
}),
|
|
3085
3094
|
sendChat: objectValidator<SendChatAutomationAction>({
|
|
3086
|
-
|
|
3095
|
+
...sharedAutomationActionValidators,
|
|
3087
3096
|
type: exactMatchValidator(['sendChat']),
|
|
3088
3097
|
info: objectValidator<SendChatAutomationAction['info']>({
|
|
3089
3098
|
templateId: mongoIdStringRequired,
|
|
@@ -3094,27 +3103,27 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3094
3103
|
}),
|
|
3095
3104
|
}),
|
|
3096
3105
|
healthieSync: objectValidator<HealthieSyncAutomationAction>({
|
|
3097
|
-
|
|
3106
|
+
...sharedAutomationActionValidators,
|
|
3098
3107
|
type: exactMatchValidator(['healthieSync']),
|
|
3099
3108
|
info: objectValidator<HealthieSyncAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3100
3109
|
}),
|
|
3101
3110
|
elationSync: objectValidator<ElationSyncAutomationAction>({
|
|
3102
|
-
|
|
3111
|
+
...sharedAutomationActionValidators,
|
|
3103
3112
|
type: exactMatchValidator(['elationSync']),
|
|
3104
3113
|
info: objectValidator<ElationSyncAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3105
3114
|
}),
|
|
3106
3115
|
athenaSync: objectValidator<AthenaSyncAutomationAction>({
|
|
3107
|
-
|
|
3116
|
+
...sharedAutomationActionValidators,
|
|
3108
3117
|
type: exactMatchValidator(['athenaSync']),
|
|
3109
3118
|
info: objectValidator<AthenaSyncAutomationAction['info']>({ departmentid: stringValidator100 }, { emptyOk: true }),
|
|
3110
3119
|
}),
|
|
3111
3120
|
canvasSync: objectValidator<CanvasSyncAutomationAction>({
|
|
3112
|
-
|
|
3121
|
+
...sharedAutomationActionValidators,
|
|
3113
3122
|
type: exactMatchValidator(['canvasSync']),
|
|
3114
3123
|
info: objectValidator<CanvasSyncAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3115
3124
|
}),
|
|
3116
3125
|
canvasCreateNote: objectValidator<CanvasCreateNoteAutomationAction>({
|
|
3117
|
-
|
|
3126
|
+
...sharedAutomationActionValidators,
|
|
3118
3127
|
type: exactMatchValidator(['canvasCreateNote']),
|
|
3119
3128
|
info: objectValidator<CanvasCreateNoteAutomationAction['info']>({
|
|
3120
3129
|
formIds: listOfMongoIdStringValidator,
|
|
@@ -3123,12 +3132,12 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3123
3132
|
}),
|
|
3124
3133
|
}),
|
|
3125
3134
|
healthieAddToCourse: objectValidator<HealthieAddToCourseAutomationAction>({
|
|
3126
|
-
|
|
3135
|
+
...sharedAutomationActionValidators,
|
|
3127
3136
|
type: exactMatchValidator(['healthieAddToCourse']),
|
|
3128
3137
|
info: objectValidator<HealthieAddToCourseAutomationAction['info']>({ courseId: stringValidator100 }),
|
|
3129
3138
|
}),
|
|
3130
3139
|
healthieSendChat: objectValidator<HealthieSendChatAutomationAction>({
|
|
3131
|
-
|
|
3140
|
+
...sharedAutomationActionValidators,
|
|
3132
3141
|
type: exactMatchValidator(['healthieSendChat']),
|
|
3133
3142
|
info: objectValidator<HealthieSendChatAutomationAction['info']>({
|
|
3134
3143
|
templateId: mongoIdStringRequired,
|
|
@@ -3137,33 +3146,33 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3137
3146
|
}),
|
|
3138
3147
|
}),
|
|
3139
3148
|
completeTickets: objectValidator<CompleteTicketsAutomationAction>({
|
|
3140
|
-
|
|
3149
|
+
...sharedAutomationActionValidators,
|
|
3141
3150
|
type: exactMatchValidator(['completeTickets']),
|
|
3142
3151
|
info: objectValidator<CompleteTicketsAutomationAction['info']>({
|
|
3143
3152
|
journeyIds: listOfMongoIdStringValidatorOptionalOrEmptyOk,
|
|
3144
3153
|
}),
|
|
3145
3154
|
}),
|
|
3146
3155
|
changeContactType: objectValidator<ChangeContactTypeAutomationAction>({
|
|
3147
|
-
|
|
3156
|
+
...sharedAutomationActionValidators,
|
|
3148
3157
|
type: exactMatchValidator(['changeContactType']),
|
|
3149
3158
|
info: objectValidator<ChangeContactTypeAutomationAction['info']>({
|
|
3150
3159
|
type: stringValidatorOptional, // can be empty string for default contact type or id for others
|
|
3151
3160
|
}),
|
|
3152
3161
|
}),
|
|
3153
3162
|
activeCampaignSync: objectValidator<ActiveCampaignSyncAutomationAction>({
|
|
3154
|
-
|
|
3163
|
+
...sharedAutomationActionValidators,
|
|
3155
3164
|
type: exactMatchValidator(['activeCampaignSync']),
|
|
3156
3165
|
info: objectValidator<ActiveCampaignSyncAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3157
3166
|
}),
|
|
3158
3167
|
activeCampaignAddToLists: objectValidator<ActiveCampaignAddToListsAutomationAction>({
|
|
3159
|
-
|
|
3168
|
+
...sharedAutomationActionValidators,
|
|
3160
3169
|
type: exactMatchValidator(['activeCampaignAddToLists']),
|
|
3161
3170
|
info: objectValidator<ActiveCampaignAddToListsAutomationAction['info']>({
|
|
3162
3171
|
listIds: listOfStringsValidator,
|
|
3163
3172
|
}),
|
|
3164
3173
|
}),
|
|
3165
3174
|
switchToRelatedContact: objectValidator<SwitchToRelatedContactAutomationAction>({
|
|
3166
|
-
|
|
3175
|
+
...sharedAutomationActionValidators,
|
|
3167
3176
|
type: exactMatchValidator(['switchToRelatedContact']),
|
|
3168
3177
|
info: objectValidator<SwitchToRelatedContactAutomationAction['info']>({
|
|
3169
3178
|
type: stringValidator100,
|
|
@@ -3171,24 +3180,24 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3171
3180
|
}, { }),
|
|
3172
3181
|
}),
|
|
3173
3182
|
pushFormsToPortal: objectValidator<PushFormsAutomationAction>({
|
|
3174
|
-
|
|
3183
|
+
...sharedAutomationActionValidators,
|
|
3175
3184
|
type: exactMatchValidator(['pushFormsToPortal']),
|
|
3176
3185
|
info: objectValidator<PushFormsAutomationAction['info']>({
|
|
3177
3186
|
formIds: listOfMongoIdStringValidator,
|
|
3178
3187
|
}, { emptyOk: false }),
|
|
3179
3188
|
}),
|
|
3180
3189
|
cancelFutureAppointments: objectValidator<CancelFutureAppointmentsAutomationAction>({
|
|
3181
|
-
|
|
3190
|
+
...sharedAutomationActionValidators,
|
|
3182
3191
|
type: exactMatchValidator(['cancelFutureAppointments']),
|
|
3183
3192
|
info: objectValidator<CancelFutureAppointmentsAutomationAction['info']>({ }, { emptyOk: true }),
|
|
3184
3193
|
}),
|
|
3185
3194
|
customerIOIdentify: objectValidator<CustomerIOIdentifyAction>({
|
|
3186
|
-
|
|
3195
|
+
...sharedAutomationActionValidators,
|
|
3187
3196
|
type: exactMatchValidator(['customerIOIdentify']),
|
|
3188
3197
|
info: objectValidator<CustomerIOIdentifyAction['info']>({ }, { emptyOk: true }),
|
|
3189
3198
|
}),
|
|
3190
3199
|
customerIOTrack: objectValidator<CustomerIOTrackAction>({
|
|
3191
|
-
|
|
3200
|
+
...sharedAutomationActionValidators,
|
|
3192
3201
|
type: exactMatchValidator(['customerIOTrack']),
|
|
3193
3202
|
info: objectValidator<CustomerIOTrackAction['info']>({
|
|
3194
3203
|
event: stringValidator,
|
|
@@ -3196,24 +3205,24 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3196
3205
|
}, { emptyOk: false }),
|
|
3197
3206
|
}),
|
|
3198
3207
|
cancelCurrentEvent: objectValidator<CancelCurrentEventAction>({
|
|
3199
|
-
|
|
3208
|
+
...sharedAutomationActionValidators,
|
|
3200
3209
|
type: exactMatchValidator(['cancelCurrentEvent']),
|
|
3201
3210
|
info: objectValidator<CancelCurrentEventAction['info']>({}, { emptyOk: true, isOptional: true }),
|
|
3202
3211
|
}),
|
|
3203
3212
|
confirmCurrentEvent: objectValidator<ConfirmCurrentEventAction>({
|
|
3204
|
-
|
|
3213
|
+
...sharedAutomationActionValidators,
|
|
3205
3214
|
type: exactMatchValidator(['confirmCurrentEvent']),
|
|
3206
3215
|
info: objectValidator<ConfirmCurrentEventAction['info']>({}, { emptyOk: true, isOptional: true }),
|
|
3207
3216
|
}),
|
|
3208
3217
|
outboundCall: objectValidator<OutboundCallAutomationAction>({
|
|
3209
|
-
|
|
3218
|
+
...sharedAutomationActionValidators,
|
|
3210
3219
|
type: exactMatchValidator(['outboundCall']),
|
|
3211
3220
|
info: objectValidator<OutboundCallAutomationAction['info']>({
|
|
3212
3221
|
treeId: mongoIdStringRequired,
|
|
3213
3222
|
}, { emptyOk: false }),
|
|
3214
3223
|
}),
|
|
3215
3224
|
assignCareTeam: objectValidator<AssignCareTeamAutomationAction>({
|
|
3216
|
-
|
|
3225
|
+
...sharedAutomationActionValidators,
|
|
3217
3226
|
type: exactMatchValidator(['assignCareTeam']),
|
|
3218
3227
|
info: objectValidator<AssignCareTeamAutomationAction['info']>({
|
|
3219
3228
|
tags: listOfStringsWithQualifierValidator,
|
|
@@ -3222,14 +3231,14 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3222
3231
|
}, { emptyOk: false }) // at least tags is required
|
|
3223
3232
|
}),
|
|
3224
3233
|
removeCareTeam: objectValidator<RemoveCareTeamAutomationAction>({
|
|
3225
|
-
|
|
3234
|
+
...sharedAutomationActionValidators,
|
|
3226
3235
|
type: exactMatchValidator(['removeCareTeam']),
|
|
3227
3236
|
info: objectValidator<RemoveCareTeamAutomationAction['info']>({
|
|
3228
3237
|
tags: listOfStringsWithQualifierValidator,
|
|
3229
3238
|
}, { emptyOk: false }) // at least tags is required
|
|
3230
3239
|
}),
|
|
3231
3240
|
callUser: objectValidator<CallUserAutomationAction>({
|
|
3232
|
-
|
|
3241
|
+
...sharedAutomationActionValidators,
|
|
3233
3242
|
type: exactMatchValidator(['callUser']),
|
|
3234
3243
|
info: objectValidator<CallUserAutomationAction['info']>({
|
|
3235
3244
|
message: stringValidator25000,
|
|
@@ -3237,13 +3246,19 @@ export const automationActionValidator = orValidator<{ [K in AutomationActionTyp
|
|
|
3237
3246
|
}, { emptyOk: false }) // at least tags is required
|
|
3238
3247
|
}),
|
|
3239
3248
|
stripeChargeCardOnFile: objectValidator<StripeChargeCardOnFileAutomationAction>({
|
|
3240
|
-
|
|
3249
|
+
...sharedAutomationActionValidators,
|
|
3241
3250
|
type: exactMatchValidator(['stripeChargeCardOnFile']),
|
|
3242
3251
|
info: objectValidator<StripeChargeCardOnFileAutomationAction['info']>({
|
|
3243
3252
|
stripeKey: stringValidatorOptionalEmptyOkay,
|
|
3244
3253
|
priceIds: listOfStringsValidator,
|
|
3245
3254
|
}, { emptyOk: false }) // at least tags is required
|
|
3246
3255
|
}),
|
|
3256
|
+
|
|
3257
|
+
"Puppeteer: Start Agent": objectValidator<SendWebhookAutomationAction>({
|
|
3258
|
+
...sharedAutomationActionValidators,
|
|
3259
|
+
type: exactMatchValidator(["Puppeteer: Start Agent"]),
|
|
3260
|
+
info: sendWebhookInfoValidator,
|
|
3261
|
+
}),
|
|
3247
3262
|
})
|
|
3248
3263
|
|
|
3249
3264
|
export const journeyContextValidator = objectValidator<JourneyContext>({
|
|
@@ -4558,6 +4573,7 @@ export const automationTriggerEventValidator = orValidator<{ [K in AutomationTri
|
|
|
4558
4573
|
fills: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4559
4574
|
skus: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4560
4575
|
skuPartials: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4576
|
+
titlePartials: listOfStringsValidatorOptionalOrEmptyOk,
|
|
4561
4577
|
}),
|
|
4562
4578
|
conditions: optionalEmptyObjectValidator,
|
|
4563
4579
|
}),
|
|
@@ -5316,7 +5332,9 @@ export const analyticsQueryValidator = orValidator<{ [K in AnalyticsQueryType]:
|
|
|
5316
5332
|
}),
|
|
5317
5333
|
"Purchases": objectValidator<AnalyticsQueryForType['Purchases']>({
|
|
5318
5334
|
resource: exactMatchValidator<'Purchases'>(['Purchases']),
|
|
5319
|
-
filter: objectValidator<AnalyticsQueryFilterForType['Purchases']>({
|
|
5335
|
+
filter: objectValidator<AnalyticsQueryFilterForType['Purchases']>({
|
|
5336
|
+
titles: listOfStringsValidatorOptionalOrEmptyOk,
|
|
5337
|
+
}, { isOptional: true, emptyOk: true }),
|
|
5320
5338
|
info: orValidator<{ [K in keyof AnalyticsQueryInfoForType['Purchases']]: AnalyticsQueryInfoForType['Purchases'][K] }>({
|
|
5321
5339
|
"Total": objectValidator<AnalyticsQueryInfoForType['Purchases']['Total']>({
|
|
5322
5340
|
method: exactMatchValidator<"Total">(['Total']),
|
|
@@ -5326,6 +5344,7 @@ export const analyticsQueryValidator = orValidator<{ [K in AnalyticsQueryType]:
|
|
|
5326
5344
|
grouping: objectValidator<AnalyticsQueryGroupingForType['Purchases']>({
|
|
5327
5345
|
Enduser: booleanValidatorOptional,
|
|
5328
5346
|
Cost: booleanValidatorOptional,
|
|
5347
|
+
Title: booleanValidatorOptional,
|
|
5329
5348
|
Gender: booleanValidatorOptional,
|
|
5330
5349
|
"Assigned To": booleanValidatorOptional,
|
|
5331
5350
|
Field: stringValidatorOptionalEmptyOkay,
|