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