import {z} from 'zod' export type GetApiV2CampaignsCampaignIdVersionBuiltArgs = {campaignId: string, version: string}; export type GetApiV2CampaignsCampaignIdVersionBuiltOptions = {baseUrl?: string | undefined, HEADER?: string | undefined, fetch?: typeof fetch | undefined}; export const builtComponentAssetResponse = z.object({description: z.string(), filename: z.string(), id: z.string(), name: z.string(), tags: z.array(z.string())}); export const componentReferenceResponse = z.object({component_id: z.string().optional(), socket_names: z.array(z.string()).optional()}); export const zonedDateTime = z.string(); export const campaignComponentFacetResponse = z.object({name: z.string().optional(), value: z.string().optional()}); export const installInBuiltCampaignComponentResponse = z.union([z.object({}), z.string(), z.string()]); export const componentOriginResponse = z.object({client_id: z.string().optional(), component_id: z.string().optional(), component_version: z.number().int().optional()}); export const deweyDecimal = z.string(); export const defaultInBuiltComponentSettingValues = z.union([z.object({}), z.string(), z.string()]); export const enInBuiltComponentSettingValues = z.union([z.object({}), z.string(), z.string()]); export const builtComponentSettingValues = z.object({default: defaultInBuiltComponentSettingValues.optional(), en: enInBuiltComponentSettingValues.optional()}).and(z.record(z.string(), z.unknown())); export const componentIdFilterResponse = z.object({component_types: z.array(z.string()).optional()}); export const componentTypeSettingFilterResponse = z.object({type: z.literal("COMPONENT_TYPE"), component_type: z.string()}); export const expressionInExpressionSettingFilterResponse = z.union([z.boolean(), z.string(), z.string()]); export const expressionSettingFilterResponse = z.object({type: z.literal("EXPRESSION"), expression: expressionInExpressionSettingFilterResponse}); export const componentFacetSettingFilterResponse = z.object({type: z.literal("FACET"), name: z.string(), value: z.string()}); export const settingFilterResponse = z.discriminatedUnion("type", [componentTypeSettingFilterResponse, expressionSettingFilterResponse, componentFacetSettingFilterResponse]); export const builtCampaignComponentVariableResponse = z.object({description: z.string().optional(), display_name: z.string().optional(), name: z.string().optional(), priority: deweyDecimal.optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional(), tags: z.array(z.string()).optional(), type: z.enum(["ADMIN_ICON", "AUDIENCE_ID", "AUDIENCE_ID_LIST", "BOOLEAN", "BROWSER_SIDE_JAVASCRIPT", "CLIENT_DOMAIN_ID_LIST", "CLIENT_KEY", "CLIENT_KEY_FLOW", "COLOR", "COMPONENT_ID", "COMPONENT_SETTING_LOOKUP", "CSS", "DELAY", "DELAY_LIST", "ENUM", "ENUM_LIST", "EXTOLE_CLIENT_KEY", "FONT", "GLOB_COMPONENT_PATH", "HTML", "IMAGE", "INTEGER", "INTEGER_LIST", "JSON", "MULTI_SOCKET", "PARTNER_ENUM", "PARTNER_ENUM_LIST", "PERSON_KEY_NAME", "REWARD_SUPPLIER_ID", "REWARD_SUPPLIER_ID_LIST", "SOCKET", "STRING", "STRING_LIST", "STRING_MAP", "URL", "WEBHOOK_ID"]).optional(), values: builtComponentSettingValues.optional()}); export const partnerEnumListVariableOptionResponse = z.object({id: z.string().optional(), name: z.string().optional()}); export const builtCampaignComponentSettingResponse = z.discriminatedUnion("type", [z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("ADMIN_ICON"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("AUDIENCE_ID"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("AUDIENCE_ID_LIST"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("BOOLEAN"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("BROWSER_SIDE_JAVASCRIPT"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("CLIENT_DOMAIN_ID_LIST"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("CLIENT_KEY"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("CLIENT_KEY_FLOW"), values: builtComponentSettingValues, authorization_url: z.string(), client_secret_key_id: z.string(), description: z.string(), redirect_url: z.string(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("COLOR"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("COMPONENT_ID"), values: builtComponentSettingValues, description: z.string(), filter: componentIdFilterResponse, source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("COMPONENT_SETTING_LOOKUP"), values: builtComponentSettingValues, capture_settings: z.array(z.string()), captured_setting_values_description: z.string(), description: z.string(), filters: z.array(settingFilterResponse), matching_filters: z.array(settingFilterResponse), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("CSS"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("DELAY"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("DELAY_LIST"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("ENUM"), values: builtComponentSettingValues, allowed_values: z.array(z.string()), description: z.string(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("ENUM_LIST"), values: builtComponentSettingValues, allowed_values: z.array(z.string()), description: z.string(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("EXTOLE_CLIENT_KEY"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("FONT"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("GLOB_COMPONENT_PATH"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("HTML"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("IMAGE"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("INTEGER"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("INTEGER_LIST"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("JSON"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("MULTI_SOCKET"), values: builtComponentSettingValues, description: z.string(), filters: z.array(settingFilterResponse), parameters: z.array(builtCampaignComponentVariableResponse)}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("PARTNER_ENUM"), values: builtComponentSettingValues, description: z.string(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int(), webhook_id: z.string(), options: z.array(partnerEnumListVariableOptionResponse)}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("PARTNER_ENUM_LIST"), values: builtComponentSettingValues, description: z.string(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int(), webhook_id: z.string(), options: z.array(partnerEnumListVariableOptionResponse)}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("PERSON_KEY_NAME"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("REWARD_SUPPLIER_ID"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("REWARD_SUPPLIER_ID_LIST"), values: builtComponentSettingValues, allowed_reward_supplier_ids: z.array(z.string()), description: z.string(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("SOCKET"), values: builtComponentSettingValues, description: z.string(), filters: z.array(settingFilterResponse), parameters: z.array(builtCampaignComponentVariableResponse)}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("STRING"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("STRING_LIST"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("STRING_MAP"), values: builtComponentSettingValues, allowed_keys: z.array(z.string()), description: z.string(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]), source_component_id: z.string(), source_version: z.number().int()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("URL"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()}), z.object({display_name: z.string(), name: z.string(), priority: deweyDecimal, tags: z.array(z.string()), type: z.literal("WEBHOOK_ID"), values: builtComponentSettingValues, description: z.string().optional(), source: z.enum(["INHERITED", "LOCAL", "PARAMETER"]).optional(), source_component_id: z.string().optional(), source_version: z.number().int().optional()})]); export const builtCampaignComponentResponse = z.object({assets: z.array(builtComponentAssetResponse), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_date: zonedDateTime, description: z.string(), display_name: z.string(), facets: z.array(campaignComponentFacetResponse), id: z.string(), install: installInBuiltCampaignComponentResponse, installed_into_socket: z.string(), name: z.string(), origin: componentOriginResponse, tags: z.array(z.string()), type: z.string(), types: z.array(z.string()), updated_date: zonedDateTime, upload_version: z.string(), variables: z.array(builtCampaignComponentSettingResponse), version: z.number().int()}); export const builtCampaignFlowStepAppTypeResponse = z.object({name: z.string().optional()}); export const builtCampaignFlowStepAppResponse = z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), description: z.string(), name: z.string(), type: builtCampaignFlowStepAppTypeResponse}); export const builtCampaignFlowStepMetricResponse = z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), description: z.string().nullable(), expression: z.string(), id: z.string(), name: z.string(), tags: z.array(z.string()), unit: z.string()}); export const builtCampaignFlowStepWordsResponse = z.object({person_counting_name: z.string().optional(), plural_noun_name: z.string().optional(), rate_name: z.string().optional(), singular_noun_name: z.string().optional(), verb_name: z.string().optional()}); export const builtCampaignFlowStepResponse = z.object({apps: z.array(builtCampaignFlowStepAppResponse), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), description: z.string(), flow_path: z.string(), flow_step_id: z.string(), icon_color: z.string(), icon_type: z.string(), metrics: z.array(builtCampaignFlowStepMetricResponse), name: z.string(), sequence: z.number(), step_name: z.string(), tags: z.array(z.string()), words: builtCampaignFlowStepWordsResponse}); export const qualityRuleResponse = z.object({action_types: z.array(z.enum(["ANY_CLICK", "ANY_PROMOTION", "ANY_PURCHASE", "ANY_REGISTER", "ANY_SHARE", "ANY_SHARE_REWARD", "GENERIC_ACTION_1", "GENERIC_ACTION_10", "GENERIC_ACTION_100", "GENERIC_ACTION_101", "GENERIC_ACTION_102", "GENERIC_ACTION_103", "GENERIC_ACTION_104", "GENERIC_ACTION_105", "GENERIC_ACTION_106", "GENERIC_ACTION_107", "GENERIC_ACTION_108", "GENERIC_ACTION_109", "GENERIC_ACTION_11", "GENERIC_ACTION_110", "GENERIC_ACTION_111", "GENERIC_ACTION_112", "GENERIC_ACTION_113", "GENERIC_ACTION_114", "GENERIC_ACTION_115", "GENERIC_ACTION_116", "GENERIC_ACTION_117", "GENERIC_ACTION_118", "GENERIC_ACTION_119", "GENERIC_ACTION_12", "GENERIC_ACTION_120", "GENERIC_ACTION_121", "GENERIC_ACTION_122", "GENERIC_ACTION_123", "GENERIC_ACTION_124", "GENERIC_ACTION_125", "GENERIC_ACTION_126", "GENERIC_ACTION_127", "GENERIC_ACTION_128", "GENERIC_ACTION_129", "GENERIC_ACTION_13", "GENERIC_ACTION_130", "GENERIC_ACTION_131", "GENERIC_ACTION_132", "GENERIC_ACTION_133", "GENERIC_ACTION_134", "GENERIC_ACTION_135", "GENERIC_ACTION_136", "GENERIC_ACTION_137", "GENERIC_ACTION_138", "GENERIC_ACTION_139", "GENERIC_ACTION_14", "GENERIC_ACTION_140", "GENERIC_ACTION_141", "GENERIC_ACTION_142", "GENERIC_ACTION_143", "GENERIC_ACTION_144", "GENERIC_ACTION_145", "GENERIC_ACTION_146", "GENERIC_ACTION_147", "GENERIC_ACTION_148", "GENERIC_ACTION_149", "GENERIC_ACTION_15", "GENERIC_ACTION_150", "GENERIC_ACTION_151", "GENERIC_ACTION_152", "GENERIC_ACTION_153", "GENERIC_ACTION_154", "GENERIC_ACTION_155", "GENERIC_ACTION_156", "GENERIC_ACTION_157", "GENERIC_ACTION_158", "GENERIC_ACTION_159", "GENERIC_ACTION_16", "GENERIC_ACTION_160", "GENERIC_ACTION_161", "GENERIC_ACTION_162", "GENERIC_ACTION_163", "GENERIC_ACTION_164", "GENERIC_ACTION_165", "GENERIC_ACTION_166", "GENERIC_ACTION_167", "GENERIC_ACTION_168", "GENERIC_ACTION_169", "GENERIC_ACTION_17", "GENERIC_ACTION_170", "GENERIC_ACTION_171", "GENERIC_ACTION_172", "GENERIC_ACTION_173", "GENERIC_ACTION_174", "GENERIC_ACTION_175", "GENERIC_ACTION_176", "GENERIC_ACTION_177", "GENERIC_ACTION_178", "GENERIC_ACTION_179", "GENERIC_ACTION_18", "GENERIC_ACTION_180", "GENERIC_ACTION_181", "GENERIC_ACTION_182", "GENERIC_ACTION_183", "GENERIC_ACTION_184", "GENERIC_ACTION_185", "GENERIC_ACTION_186", "GENERIC_ACTION_187", "GENERIC_ACTION_188", "GENERIC_ACTION_189", "GENERIC_ACTION_19", "GENERIC_ACTION_190", "GENERIC_ACTION_191", "GENERIC_ACTION_192", "GENERIC_ACTION_193", "GENERIC_ACTION_194", "GENERIC_ACTION_195", "GENERIC_ACTION_196", "GENERIC_ACTION_197", "GENERIC_ACTION_198", "GENERIC_ACTION_199", "GENERIC_ACTION_2", "GENERIC_ACTION_20", "GENERIC_ACTION_200", "GENERIC_ACTION_21", "GENERIC_ACTION_22", "GENERIC_ACTION_23", "GENERIC_ACTION_24", "GENERIC_ACTION_25", "GENERIC_ACTION_26", "GENERIC_ACTION_27", "GENERIC_ACTION_28", "GENERIC_ACTION_29", "GENERIC_ACTION_3", "GENERIC_ACTION_30", "GENERIC_ACTION_31", "GENERIC_ACTION_32", "GENERIC_ACTION_33", "GENERIC_ACTION_34", "GENERIC_ACTION_35", "GENERIC_ACTION_36", "GENERIC_ACTION_37", "GENERIC_ACTION_38", "GENERIC_ACTION_39", "GENERIC_ACTION_4", "GENERIC_ACTION_40", "GENERIC_ACTION_41", "GENERIC_ACTION_42", "GENERIC_ACTION_43", "GENERIC_ACTION_44", "GENERIC_ACTION_45", "GENERIC_ACTION_46", "GENERIC_ACTION_47", "GENERIC_ACTION_48", "GENERIC_ACTION_49", "GENERIC_ACTION_5", "GENERIC_ACTION_50", "GENERIC_ACTION_51", "GENERIC_ACTION_52", "GENERIC_ACTION_53", "GENERIC_ACTION_54", "GENERIC_ACTION_55", "GENERIC_ACTION_56", "GENERIC_ACTION_57", "GENERIC_ACTION_58", "GENERIC_ACTION_59", "GENERIC_ACTION_6", "GENERIC_ACTION_60", "GENERIC_ACTION_61", "GENERIC_ACTION_62", "GENERIC_ACTION_63", "GENERIC_ACTION_64", "GENERIC_ACTION_65", "GENERIC_ACTION_66", "GENERIC_ACTION_67", "GENERIC_ACTION_68", "GENERIC_ACTION_69", "GENERIC_ACTION_7", "GENERIC_ACTION_70", "GENERIC_ACTION_71", "GENERIC_ACTION_72", "GENERIC_ACTION_73", "GENERIC_ACTION_74", "GENERIC_ACTION_75", "GENERIC_ACTION_76", "GENERIC_ACTION_77", "GENERIC_ACTION_78", "GENERIC_ACTION_79", "GENERIC_ACTION_8", "GENERIC_ACTION_80", "GENERIC_ACTION_81", "GENERIC_ACTION_82", "GENERIC_ACTION_83", "GENERIC_ACTION_84", "GENERIC_ACTION_85", "GENERIC_ACTION_86", "GENERIC_ACTION_87", "GENERIC_ACTION_88", "GENERIC_ACTION_89", "GENERIC_ACTION_9", "GENERIC_ACTION_90", "GENERIC_ACTION_91", "GENERIC_ACTION_92", "GENERIC_ACTION_93", "GENERIC_ACTION_94", "GENERIC_ACTION_95", "GENERIC_ACTION_96", "GENERIC_ACTION_97", "GENERIC_ACTION_98", "GENERIC_ACTION_99", "THEME_GENERIC_ACTION_1", "THEME_GENERIC_ACTION_10", "THEME_GENERIC_ACTION_11", "THEME_GENERIC_ACTION_12", "THEME_GENERIC_ACTION_13", "THEME_GENERIC_ACTION_14", "THEME_GENERIC_ACTION_15", "THEME_GENERIC_ACTION_16", "THEME_GENERIC_ACTION_17", "THEME_GENERIC_ACTION_18", "THEME_GENERIC_ACTION_19", "THEME_GENERIC_ACTION_2", "THEME_GENERIC_ACTION_20", "THEME_GENERIC_ACTION_21", "THEME_GENERIC_ACTION_22", "THEME_GENERIC_ACTION_23", "THEME_GENERIC_ACTION_24", "THEME_GENERIC_ACTION_25", "THEME_GENERIC_ACTION_26", "THEME_GENERIC_ACTION_27", "THEME_GENERIC_ACTION_28", "THEME_GENERIC_ACTION_29", "THEME_GENERIC_ACTION_3", "THEME_GENERIC_ACTION_30", "THEME_GENERIC_ACTION_4", "THEME_GENERIC_ACTION_5", "THEME_GENERIC_ACTION_6", "THEME_GENERIC_ACTION_7", "THEME_GENERIC_ACTION_8", "THEME_GENERIC_ACTION_9"])), enabled: z.boolean(), id: z.string(), properties: z.record(z.string(), z.array(z.string())), rule_type: z.enum(["BAD_COUNTRY", "BLACKLIST_DOMAIN", "BLACKLIST_REFERER_HEADER", "BLOCKED", "BOT_FILTER", "EVENT_SPEED", "EXISTING_CUSTOMER", "FRIENDS_OF_ADVOCATE_CLICK_LIMIT", "FRIENDS_OF_ADVOCATE_CONVERSION_LIMIT", "FRIENDS_OF_ADVOCATE_REGISTRATION_LIMIT", "GENERIC", "GLOBAL_BLOCK", "IP_FILTER", "PERSON_DATA", "PREVIEW", "PROFILE_DISPLACED", "RECENT_CUSTOMER", "RECIPIENT_LIMIT", "REFERRAL_AGE", "REFERRAL_CAP", "SAME_IP", "SELF_REFERRAL", "SHARE_COUNT_LIMIT", "SIMILAR_FRIEND_ADVOCATE_EMAIL", "SPAM_MESSAGE", "VALID_EMAIL"])}); export const rewardRuleExpression = z.object({type: z.enum(["JS", "SPEL"]).optional(), value: z.string().optional()}); export const rewardRuleResponse = z.object({count_rewards_based_on_partner_user_id: z.boolean().nullable(), data_attribute_matcher_type: z.enum(["EXACT", "REGEX"]).nullable(), data_attribute_name: z.string().nullable(), data_attribute_value: z.string().nullable(), expression: rewardRuleExpression, id: z.string(), is_email_required: z.boolean(), is_referral_loop_allowed: z.boolean(), is_unique_friend_required: z.boolean(), min_cart_value: z.number(), referrals_per_reward: z.number().int(), reward_count_limit: z.number().int(), reward_count_since_days: z.number().int().nullable(), reward_count_since_month: z.number().int().nullable(), reward_every_x_friend_actions: z.number().int().nullable(), reward_slots: z.array(z.string()), reward_supplier_id: z.string(), reward_value_limit: z.number(), reward_value_since_days: z.number().int().nullable(), reward_value_since_month: z.number().int().nullable(), rewardee: z.enum(["ADVOCATE", "FRIEND"]), trigger_action_type: z.enum(["ANY_CLICK", "ANY_PROMOTION", "ANY_PURCHASE", "ANY_REGISTER", "ANY_SHARE", "ANY_SHARE_REWARD", "GENERIC_ACTION_1", "GENERIC_ACTION_10", "GENERIC_ACTION_100", "GENERIC_ACTION_101", "GENERIC_ACTION_102", "GENERIC_ACTION_103", "GENERIC_ACTION_104", "GENERIC_ACTION_105", "GENERIC_ACTION_106", "GENERIC_ACTION_107", "GENERIC_ACTION_108", "GENERIC_ACTION_109", "GENERIC_ACTION_11", "GENERIC_ACTION_110", "GENERIC_ACTION_111", "GENERIC_ACTION_112", "GENERIC_ACTION_113", "GENERIC_ACTION_114", "GENERIC_ACTION_115", "GENERIC_ACTION_116", "GENERIC_ACTION_117", "GENERIC_ACTION_118", "GENERIC_ACTION_119", "GENERIC_ACTION_12", "GENERIC_ACTION_120", "GENERIC_ACTION_121", "GENERIC_ACTION_122", "GENERIC_ACTION_123", "GENERIC_ACTION_124", "GENERIC_ACTION_125", "GENERIC_ACTION_126", "GENERIC_ACTION_127", "GENERIC_ACTION_128", "GENERIC_ACTION_129", "GENERIC_ACTION_13", "GENERIC_ACTION_130", "GENERIC_ACTION_131", "GENERIC_ACTION_132", "GENERIC_ACTION_133", "GENERIC_ACTION_134", "GENERIC_ACTION_135", "GENERIC_ACTION_136", "GENERIC_ACTION_137", "GENERIC_ACTION_138", "GENERIC_ACTION_139", "GENERIC_ACTION_14", "GENERIC_ACTION_140", "GENERIC_ACTION_141", "GENERIC_ACTION_142", "GENERIC_ACTION_143", "GENERIC_ACTION_144", "GENERIC_ACTION_145", "GENERIC_ACTION_146", "GENERIC_ACTION_147", "GENERIC_ACTION_148", "GENERIC_ACTION_149", "GENERIC_ACTION_15", "GENERIC_ACTION_150", "GENERIC_ACTION_151", "GENERIC_ACTION_152", "GENERIC_ACTION_153", "GENERIC_ACTION_154", "GENERIC_ACTION_155", "GENERIC_ACTION_156", "GENERIC_ACTION_157", "GENERIC_ACTION_158", "GENERIC_ACTION_159", "GENERIC_ACTION_16", "GENERIC_ACTION_160", "GENERIC_ACTION_161", "GENERIC_ACTION_162", "GENERIC_ACTION_163", "GENERIC_ACTION_164", "GENERIC_ACTION_165", "GENERIC_ACTION_166", "GENERIC_ACTION_167", "GENERIC_ACTION_168", "GENERIC_ACTION_169", "GENERIC_ACTION_17", "GENERIC_ACTION_170", "GENERIC_ACTION_171", "GENERIC_ACTION_172", "GENERIC_ACTION_173", "GENERIC_ACTION_174", "GENERIC_ACTION_175", "GENERIC_ACTION_176", "GENERIC_ACTION_177", "GENERIC_ACTION_178", "GENERIC_ACTION_179", "GENERIC_ACTION_18", "GENERIC_ACTION_180", "GENERIC_ACTION_181", "GENERIC_ACTION_182", "GENERIC_ACTION_183", "GENERIC_ACTION_184", "GENERIC_ACTION_185", "GENERIC_ACTION_186", "GENERIC_ACTION_187", "GENERIC_ACTION_188", "GENERIC_ACTION_189", "GENERIC_ACTION_19", "GENERIC_ACTION_190", "GENERIC_ACTION_191", "GENERIC_ACTION_192", "GENERIC_ACTION_193", "GENERIC_ACTION_194", "GENERIC_ACTION_195", "GENERIC_ACTION_196", "GENERIC_ACTION_197", "GENERIC_ACTION_198", "GENERIC_ACTION_199", "GENERIC_ACTION_2", "GENERIC_ACTION_20", "GENERIC_ACTION_200", "GENERIC_ACTION_21", "GENERIC_ACTION_22", "GENERIC_ACTION_23", "GENERIC_ACTION_24", "GENERIC_ACTION_25", "GENERIC_ACTION_26", "GENERIC_ACTION_27", "GENERIC_ACTION_28", "GENERIC_ACTION_29", "GENERIC_ACTION_3", "GENERIC_ACTION_30", "GENERIC_ACTION_31", "GENERIC_ACTION_32", "GENERIC_ACTION_33", "GENERIC_ACTION_34", "GENERIC_ACTION_35", "GENERIC_ACTION_36", "GENERIC_ACTION_37", "GENERIC_ACTION_38", "GENERIC_ACTION_39", "GENERIC_ACTION_4", "GENERIC_ACTION_40", "GENERIC_ACTION_41", "GENERIC_ACTION_42", "GENERIC_ACTION_43", "GENERIC_ACTION_44", "GENERIC_ACTION_45", "GENERIC_ACTION_46", "GENERIC_ACTION_47", "GENERIC_ACTION_48", "GENERIC_ACTION_49", "GENERIC_ACTION_5", "GENERIC_ACTION_50", "GENERIC_ACTION_51", "GENERIC_ACTION_52", "GENERIC_ACTION_53", "GENERIC_ACTION_54", "GENERIC_ACTION_55", "GENERIC_ACTION_56", "GENERIC_ACTION_57", "GENERIC_ACTION_58", "GENERIC_ACTION_59", "GENERIC_ACTION_6", "GENERIC_ACTION_60", "GENERIC_ACTION_61", "GENERIC_ACTION_62", "GENERIC_ACTION_63", "GENERIC_ACTION_64", "GENERIC_ACTION_65", "GENERIC_ACTION_66", "GENERIC_ACTION_67", "GENERIC_ACTION_68", "GENERIC_ACTION_69", "GENERIC_ACTION_7", "GENERIC_ACTION_70", "GENERIC_ACTION_71", "GENERIC_ACTION_72", "GENERIC_ACTION_73", "GENERIC_ACTION_74", "GENERIC_ACTION_75", "GENERIC_ACTION_76", "GENERIC_ACTION_77", "GENERIC_ACTION_78", "GENERIC_ACTION_79", "GENERIC_ACTION_8", "GENERIC_ACTION_80", "GENERIC_ACTION_81", "GENERIC_ACTION_82", "GENERIC_ACTION_83", "GENERIC_ACTION_84", "GENERIC_ACTION_85", "GENERIC_ACTION_86", "GENERIC_ACTION_87", "GENERIC_ACTION_88", "GENERIC_ACTION_89", "GENERIC_ACTION_9", "GENERIC_ACTION_90", "GENERIC_ACTION_91", "GENERIC_ACTION_92", "GENERIC_ACTION_93", "GENERIC_ACTION_94", "GENERIC_ACTION_95", "GENERIC_ACTION_96", "GENERIC_ACTION_97", "GENERIC_ACTION_98", "GENERIC_ACTION_99", "THEME_GENERIC_ACTION_1", "THEME_GENERIC_ACTION_10", "THEME_GENERIC_ACTION_11", "THEME_GENERIC_ACTION_12", "THEME_GENERIC_ACTION_13", "THEME_GENERIC_ACTION_14", "THEME_GENERIC_ACTION_15", "THEME_GENERIC_ACTION_16", "THEME_GENERIC_ACTION_17", "THEME_GENERIC_ACTION_18", "THEME_GENERIC_ACTION_19", "THEME_GENERIC_ACTION_2", "THEME_GENERIC_ACTION_20", "THEME_GENERIC_ACTION_21", "THEME_GENERIC_ACTION_22", "THEME_GENERIC_ACTION_23", "THEME_GENERIC_ACTION_24", "THEME_GENERIC_ACTION_25", "THEME_GENERIC_ACTION_26", "THEME_GENERIC_ACTION_27", "THEME_GENERIC_ACTION_28", "THEME_GENERIC_ACTION_29", "THEME_GENERIC_ACTION_3", "THEME_GENERIC_ACTION_30", "THEME_GENERIC_ACTION_4", "THEME_GENERIC_ACTION_5", "THEME_GENERIC_ACTION_6", "THEME_GENERIC_ACTION_7", "THEME_GENERIC_ACTION_8", "THEME_GENERIC_ACTION_9"])}); export const transitionRuleResponse = z.object({action_type: z.enum(["ANY_CLICK", "ANY_PROMOTION", "ANY_PURCHASE", "ANY_REGISTER", "ANY_SHARE", "ANY_SHARE_REWARD", "GENERIC_ACTION_1", "GENERIC_ACTION_10", "GENERIC_ACTION_100", "GENERIC_ACTION_101", "GENERIC_ACTION_102", "GENERIC_ACTION_103", "GENERIC_ACTION_104", "GENERIC_ACTION_105", "GENERIC_ACTION_106", "GENERIC_ACTION_107", "GENERIC_ACTION_108", "GENERIC_ACTION_109", "GENERIC_ACTION_11", "GENERIC_ACTION_110", "GENERIC_ACTION_111", "GENERIC_ACTION_112", "GENERIC_ACTION_113", "GENERIC_ACTION_114", "GENERIC_ACTION_115", "GENERIC_ACTION_116", "GENERIC_ACTION_117", "GENERIC_ACTION_118", "GENERIC_ACTION_119", "GENERIC_ACTION_12", "GENERIC_ACTION_120", "GENERIC_ACTION_121", "GENERIC_ACTION_122", "GENERIC_ACTION_123", "GENERIC_ACTION_124", "GENERIC_ACTION_125", "GENERIC_ACTION_126", "GENERIC_ACTION_127", "GENERIC_ACTION_128", "GENERIC_ACTION_129", "GENERIC_ACTION_13", "GENERIC_ACTION_130", "GENERIC_ACTION_131", "GENERIC_ACTION_132", "GENERIC_ACTION_133", "GENERIC_ACTION_134", "GENERIC_ACTION_135", "GENERIC_ACTION_136", "GENERIC_ACTION_137", "GENERIC_ACTION_138", "GENERIC_ACTION_139", "GENERIC_ACTION_14", "GENERIC_ACTION_140", "GENERIC_ACTION_141", "GENERIC_ACTION_142", "GENERIC_ACTION_143", "GENERIC_ACTION_144", "GENERIC_ACTION_145", "GENERIC_ACTION_146", "GENERIC_ACTION_147", "GENERIC_ACTION_148", "GENERIC_ACTION_149", "GENERIC_ACTION_15", "GENERIC_ACTION_150", "GENERIC_ACTION_151", "GENERIC_ACTION_152", "GENERIC_ACTION_153", "GENERIC_ACTION_154", "GENERIC_ACTION_155", "GENERIC_ACTION_156", "GENERIC_ACTION_157", "GENERIC_ACTION_158", "GENERIC_ACTION_159", "GENERIC_ACTION_16", "GENERIC_ACTION_160", "GENERIC_ACTION_161", "GENERIC_ACTION_162", "GENERIC_ACTION_163", "GENERIC_ACTION_164", "GENERIC_ACTION_165", "GENERIC_ACTION_166", "GENERIC_ACTION_167", "GENERIC_ACTION_168", "GENERIC_ACTION_169", "GENERIC_ACTION_17", "GENERIC_ACTION_170", "GENERIC_ACTION_171", "GENERIC_ACTION_172", "GENERIC_ACTION_173", "GENERIC_ACTION_174", "GENERIC_ACTION_175", "GENERIC_ACTION_176", "GENERIC_ACTION_177", "GENERIC_ACTION_178", "GENERIC_ACTION_179", "GENERIC_ACTION_18", "GENERIC_ACTION_180", "GENERIC_ACTION_181", "GENERIC_ACTION_182", "GENERIC_ACTION_183", "GENERIC_ACTION_184", "GENERIC_ACTION_185", "GENERIC_ACTION_186", "GENERIC_ACTION_187", "GENERIC_ACTION_188", "GENERIC_ACTION_189", "GENERIC_ACTION_19", "GENERIC_ACTION_190", "GENERIC_ACTION_191", "GENERIC_ACTION_192", "GENERIC_ACTION_193", "GENERIC_ACTION_194", "GENERIC_ACTION_195", "GENERIC_ACTION_196", "GENERIC_ACTION_197", "GENERIC_ACTION_198", "GENERIC_ACTION_199", "GENERIC_ACTION_2", "GENERIC_ACTION_20", "GENERIC_ACTION_200", "GENERIC_ACTION_21", "GENERIC_ACTION_22", "GENERIC_ACTION_23", "GENERIC_ACTION_24", "GENERIC_ACTION_25", "GENERIC_ACTION_26", "GENERIC_ACTION_27", "GENERIC_ACTION_28", "GENERIC_ACTION_29", "GENERIC_ACTION_3", "GENERIC_ACTION_30", "GENERIC_ACTION_31", "GENERIC_ACTION_32", "GENERIC_ACTION_33", "GENERIC_ACTION_34", "GENERIC_ACTION_35", "GENERIC_ACTION_36", "GENERIC_ACTION_37", "GENERIC_ACTION_38", "GENERIC_ACTION_39", "GENERIC_ACTION_4", "GENERIC_ACTION_40", "GENERIC_ACTION_41", "GENERIC_ACTION_42", "GENERIC_ACTION_43", "GENERIC_ACTION_44", "GENERIC_ACTION_45", "GENERIC_ACTION_46", "GENERIC_ACTION_47", "GENERIC_ACTION_48", "GENERIC_ACTION_49", "GENERIC_ACTION_5", "GENERIC_ACTION_50", "GENERIC_ACTION_51", "GENERIC_ACTION_52", "GENERIC_ACTION_53", "GENERIC_ACTION_54", "GENERIC_ACTION_55", "GENERIC_ACTION_56", "GENERIC_ACTION_57", "GENERIC_ACTION_58", "GENERIC_ACTION_59", "GENERIC_ACTION_6", "GENERIC_ACTION_60", "GENERIC_ACTION_61", "GENERIC_ACTION_62", "GENERIC_ACTION_63", "GENERIC_ACTION_64", "GENERIC_ACTION_65", "GENERIC_ACTION_66", "GENERIC_ACTION_67", "GENERIC_ACTION_68", "GENERIC_ACTION_69", "GENERIC_ACTION_7", "GENERIC_ACTION_70", "GENERIC_ACTION_71", "GENERIC_ACTION_72", "GENERIC_ACTION_73", "GENERIC_ACTION_74", "GENERIC_ACTION_75", "GENERIC_ACTION_76", "GENERIC_ACTION_77", "GENERIC_ACTION_78", "GENERIC_ACTION_79", "GENERIC_ACTION_8", "GENERIC_ACTION_80", "GENERIC_ACTION_81", "GENERIC_ACTION_82", "GENERIC_ACTION_83", "GENERIC_ACTION_84", "GENERIC_ACTION_85", "GENERIC_ACTION_86", "GENERIC_ACTION_87", "GENERIC_ACTION_88", "GENERIC_ACTION_89", "GENERIC_ACTION_9", "GENERIC_ACTION_90", "GENERIC_ACTION_91", "GENERIC_ACTION_92", "GENERIC_ACTION_93", "GENERIC_ACTION_94", "GENERIC_ACTION_95", "GENERIC_ACTION_96", "GENERIC_ACTION_97", "GENERIC_ACTION_98", "GENERIC_ACTION_99", "THEME_GENERIC_ACTION_1", "THEME_GENERIC_ACTION_10", "THEME_GENERIC_ACTION_11", "THEME_GENERIC_ACTION_12", "THEME_GENERIC_ACTION_13", "THEME_GENERIC_ACTION_14", "THEME_GENERIC_ACTION_15", "THEME_GENERIC_ACTION_16", "THEME_GENERIC_ACTION_17", "THEME_GENERIC_ACTION_18", "THEME_GENERIC_ACTION_19", "THEME_GENERIC_ACTION_2", "THEME_GENERIC_ACTION_20", "THEME_GENERIC_ACTION_21", "THEME_GENERIC_ACTION_22", "THEME_GENERIC_ACTION_23", "THEME_GENERIC_ACTION_24", "THEME_GENERIC_ACTION_25", "THEME_GENERIC_ACTION_26", "THEME_GENERIC_ACTION_27", "THEME_GENERIC_ACTION_28", "THEME_GENERIC_ACTION_29", "THEME_GENERIC_ACTION_3", "THEME_GENERIC_ACTION_30", "THEME_GENERIC_ACTION_4", "THEME_GENERIC_ACTION_5", "THEME_GENERIC_ACTION_6", "THEME_GENERIC_ACTION_7", "THEME_GENERIC_ACTION_8", "THEME_GENERIC_ACTION_9"]), approve_high_quality: z.boolean(), approve_low_quality: z.boolean(), transition_period_milliseconds: z.number().int(), transition_rule_id: z.string()}); export const incentiveResponse = z.object({id: z.string(), quality_rules: z.array(qualityRuleResponse), reward_rules: z.array(rewardRuleResponse), transition_rules: z.array(transitionRuleResponse)}); export const campaignLabelResponse = z.object({name: z.string().optional(), type: z.enum(["DATA", "PROGRAM"]).optional()}); export const defaultValueInBuiltStepDataResponse = z.union([z.object({}), z.string(), z.string()]); export const valueInBuiltStepDataResponse = z.union([z.object({}), z.string(), z.string()]); export const builtStepDataResponse = z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), default_value: defaultValueInBuiltStepDataResponse, dimension: z.boolean(), enabled: z.boolean(), id: z.string(), key_type: z.enum(["NONE", "PARTNER_EVENT_KEY", "PARTNER_PROFILE_KEY", "UNIQUE_PARTNER_EVENT_KEY", "VALUE"]), name: z.string(), persist_types: z.array(z.enum(["JOURNEY", "PROFILE", "STEP"])), scope: z.enum(["CLIENT", "PRIVATE", "PUBLIC"]), value: valueInBuiltStepDataResponse}); export const stepBuilderInBuiltCampaignStepResponseBase = z.union([z.object({}), z.string(), z.string()]); export const personIdInBuiltCampaignControllerTriggerAudienceMembershipResponse = z.union([z.string(), z.string(), z.string()]); export const expressionInBuiltCampaignControllerTriggerExpressionResponse = z.union([z.boolean(), z.string(), z.string()]); export const duration = z.string(); export const monthDay = z.string(); export const filterCampaignIdsInBuiltCampaignControllerTriggerHasPriorStepResponse = z.union([z.array(z.string()), z.string(), z.string()]); export const filterExpressionInBuiltCampaignControllerTriggerHasPriorStepResponse = z.union([z.boolean(), z.string(), z.string()]); export const partnerEventId = z.object({name: z.string().optional(), value: z.string().optional()}); export const filterProgramLabelsInBuiltCampaignControllerTriggerHasPriorStepResponse = z.union([z.array(z.string()), z.string(), z.string()]); export const havingAllNamesInBuiltCampaignControllerTriggerHasPriorStepResponse = z.union([z.array(z.string()), z.string(), z.string()]); export const personIdInBuiltCampaignControllerTriggerHasPriorStepResponse = z.union([z.string(), z.string(), z.string()]); export const personIdInBuiltCampaignControllerTriggerJourneyCheckResponse = z.union([z.string(), z.string(), z.string()]); export const builtCampaignControllerTriggerResponse = z.discriminatedUnion("trigger_type", [z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("ACCESS"), trusted_scopes: z.array(z.enum(["BACKEND", "CLIENT_ADMIN", "CLIENT_REPORT_DOWNLOAD", "CLIENT_SUPERUSER", "ONE_TIME", "PASSWORD_RESET", "UPDATE_PROFILE", "USER_SUPPORT", "VERIFIED_CONSUMER"]))}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("AUDIENCE_MEMBERSHIP"), having_any_audience_id: z.array(z.string()), person_id: personIdInBuiltCampaignControllerTriggerAudienceMembershipResponse}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("AUDIENCE_MEMBERSHIP_EVENT"), audience_ids: z.array(z.string()), event_types: z.array(z.enum(["CREATED", "REMOVED", "UPDATED"]))}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("CLIENT_DOMAIN"), client_domain_ids: z.array(z.string())}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("DATA_INTELLIGENCE_EVENT"), event_name: z.string()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("EVENT"), event_names: z.array(z.string()).optional(), event_type: z.enum(["ASSET", "DATA_INTELLIGENCE", "DISPLACED", "DISPLACED_BY", "FORWARDED", "IDENTIFIED", "INPUT", "INTERNAL", "LEGACY_CONSUMER_EVENT", "MESSAGE", "MESSAGE_NOT_DELIVERED", "REFERRED", "REFERRED_BY", "SCHEDULED", "SHARE", "SHAREABLE", "STEP"]).optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("EVENT_TARGETING"), targeting_attributes: z.record(z.string(), z.string()).optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("EXPRESSION"), data: z.record(z.string(), z.string()).optional(), expression: expressionInBuiltCampaignControllerTriggerExpressionResponse.optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("GROUP"), operator: z.enum(["AND", "OR"]).optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("HAS_IDENTITY")}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("HAS_PRIOR_REWARD"), count_matches: z.array(z.number().int()), count_max: z.number().int(), count_min: z.number().int(), filter_expressions: z.array(z.string()), filter_face_value_types: z.array(z.enum(["AUD", "BRL", "CAD", "CNY", "EUR", "GBP", "HKD", "INR", "JPY", "KRW", "MONTH", "MXN", "NZD", "PERCENT_OFF", "POINTS", "TRY", "TWD", "USD"])), filter_max_age: duration, filter_max_date: zonedDateTime, filter_min_age: duration, filter_min_date: zonedDateTime, filter_names: z.array(z.string()), filter_reward_supplier_ids: z.array(z.string()), filter_scope: z.enum(["CAMPAIGN", "CLIENT", "JOURNEY", "PROGRAM"]), filter_states: z.array(z.enum(["CANCELED", "EARNED", "FAILED", "FULFILLED", "REDEEMED", "REVOKED", "SENT"])), filter_tags: z.array(z.string()), sum_of_face_value_max: z.number(), sum_of_face_value_min: z.number(), tax_year_start: monthDay}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("HAS_PRIOR_STEP"), count_matches: z.array(z.number().int()), count_max: z.number().int(), count_min: z.number().int(), filter_campaign_id: z.string(), filter_campaign_ids: filterCampaignIdsInBuiltCampaignControllerTriggerHasPriorStepResponse, filter_expression: filterExpressionInBuiltCampaignControllerTriggerHasPriorStepResponse, filter_expressions: z.array(z.string()), filter_max_age: duration, filter_max_date: zonedDateTime, filter_max_value: z.number(), filter_min_age: duration, filter_min_date: zonedDateTime, filter_min_value: z.number(), filter_names: z.array(z.string()), filter_partner_event_id: partnerEventId, filter_partner_event_id_name: z.string(), filter_partner_event_id_value: z.string(), filter_program_label: z.string(), filter_program_labels: filterProgramLabelsInBuiltCampaignControllerTriggerHasPriorStepResponse, filter_quality: z.enum(["ANY", "HIGH", "LOW"]), filter_scope: z.enum(["ATTRIBUTED", "CAMPAIGN", "CLIENT", "JOURNEY", "PROGRAM"]), having_all_names: havingAllNamesInBuiltCampaignControllerTriggerHasPriorStepResponse, person_id: personIdInBuiltCampaignControllerTriggerHasPriorStepResponse, sum_of_value_max: z.number(), sum_of_value_min: z.number()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("JOURNEY_CHECK"), journey_name: z.string().optional(), person_id: personIdInBuiltCampaignControllerTriggerJourneyCheckResponse.optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("LEGACY_LABEL_TARGETING")}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("LEGACY_QUALITY"), action_type: z.enum(["ANY_CLICK", "ANY_PROMOTION", "ANY_PURCHASE", "ANY_REGISTER", "ANY_SHARE", "ANY_SHARE_REWARD", "GENERIC_ACTION_1", "GENERIC_ACTION_10", "GENERIC_ACTION_100", "GENERIC_ACTION_101", "GENERIC_ACTION_102", "GENERIC_ACTION_103", "GENERIC_ACTION_104", "GENERIC_ACTION_105", "GENERIC_ACTION_106", "GENERIC_ACTION_107", "GENERIC_ACTION_108", "GENERIC_ACTION_109", "GENERIC_ACTION_11", "GENERIC_ACTION_110", "GENERIC_ACTION_111", "GENERIC_ACTION_112", "GENERIC_ACTION_113", "GENERIC_ACTION_114", "GENERIC_ACTION_115", "GENERIC_ACTION_116", "GENERIC_ACTION_117", "GENERIC_ACTION_118", "GENERIC_ACTION_119", "GENERIC_ACTION_12", "GENERIC_ACTION_120", "GENERIC_ACTION_121", "GENERIC_ACTION_122", "GENERIC_ACTION_123", "GENERIC_ACTION_124", "GENERIC_ACTION_125", "GENERIC_ACTION_126", "GENERIC_ACTION_127", "GENERIC_ACTION_128", "GENERIC_ACTION_129", "GENERIC_ACTION_13", "GENERIC_ACTION_130", "GENERIC_ACTION_131", "GENERIC_ACTION_132", "GENERIC_ACTION_133", "GENERIC_ACTION_134", "GENERIC_ACTION_135", "GENERIC_ACTION_136", "GENERIC_ACTION_137", "GENERIC_ACTION_138", "GENERIC_ACTION_139", "GENERIC_ACTION_14", "GENERIC_ACTION_140", "GENERIC_ACTION_141", "GENERIC_ACTION_142", "GENERIC_ACTION_143", "GENERIC_ACTION_144", "GENERIC_ACTION_145", "GENERIC_ACTION_146", "GENERIC_ACTION_147", "GENERIC_ACTION_148", "GENERIC_ACTION_149", "GENERIC_ACTION_15", "GENERIC_ACTION_150", "GENERIC_ACTION_151", "GENERIC_ACTION_152", "GENERIC_ACTION_153", "GENERIC_ACTION_154", "GENERIC_ACTION_155", "GENERIC_ACTION_156", "GENERIC_ACTION_157", "GENERIC_ACTION_158", "GENERIC_ACTION_159", "GENERIC_ACTION_16", "GENERIC_ACTION_160", "GENERIC_ACTION_161", "GENERIC_ACTION_162", "GENERIC_ACTION_163", "GENERIC_ACTION_164", "GENERIC_ACTION_165", "GENERIC_ACTION_166", "GENERIC_ACTION_167", "GENERIC_ACTION_168", "GENERIC_ACTION_169", "GENERIC_ACTION_17", "GENERIC_ACTION_170", "GENERIC_ACTION_171", "GENERIC_ACTION_172", "GENERIC_ACTION_173", "GENERIC_ACTION_174", "GENERIC_ACTION_175", "GENERIC_ACTION_176", "GENERIC_ACTION_177", "GENERIC_ACTION_178", "GENERIC_ACTION_179", "GENERIC_ACTION_18", "GENERIC_ACTION_180", "GENERIC_ACTION_181", "GENERIC_ACTION_182", "GENERIC_ACTION_183", "GENERIC_ACTION_184", "GENERIC_ACTION_185", "GENERIC_ACTION_186", "GENERIC_ACTION_187", "GENERIC_ACTION_188", "GENERIC_ACTION_189", "GENERIC_ACTION_19", "GENERIC_ACTION_190", "GENERIC_ACTION_191", "GENERIC_ACTION_192", "GENERIC_ACTION_193", "GENERIC_ACTION_194", "GENERIC_ACTION_195", "GENERIC_ACTION_196", "GENERIC_ACTION_197", "GENERIC_ACTION_198", "GENERIC_ACTION_199", "GENERIC_ACTION_2", "GENERIC_ACTION_20", "GENERIC_ACTION_200", "GENERIC_ACTION_21", "GENERIC_ACTION_22", "GENERIC_ACTION_23", "GENERIC_ACTION_24", "GENERIC_ACTION_25", "GENERIC_ACTION_26", "GENERIC_ACTION_27", "GENERIC_ACTION_28", "GENERIC_ACTION_29", "GENERIC_ACTION_3", "GENERIC_ACTION_30", "GENERIC_ACTION_31", "GENERIC_ACTION_32", "GENERIC_ACTION_33", "GENERIC_ACTION_34", "GENERIC_ACTION_35", "GENERIC_ACTION_36", "GENERIC_ACTION_37", "GENERIC_ACTION_38", "GENERIC_ACTION_39", "GENERIC_ACTION_4", "GENERIC_ACTION_40", "GENERIC_ACTION_41", "GENERIC_ACTION_42", "GENERIC_ACTION_43", "GENERIC_ACTION_44", "GENERIC_ACTION_45", "GENERIC_ACTION_46", "GENERIC_ACTION_47", "GENERIC_ACTION_48", "GENERIC_ACTION_49", "GENERIC_ACTION_5", "GENERIC_ACTION_50", "GENERIC_ACTION_51", "GENERIC_ACTION_52", "GENERIC_ACTION_53", "GENERIC_ACTION_54", "GENERIC_ACTION_55", "GENERIC_ACTION_56", "GENERIC_ACTION_57", "GENERIC_ACTION_58", "GENERIC_ACTION_59", "GENERIC_ACTION_6", "GENERIC_ACTION_60", "GENERIC_ACTION_61", "GENERIC_ACTION_62", "GENERIC_ACTION_63", "GENERIC_ACTION_64", "GENERIC_ACTION_65", "GENERIC_ACTION_66", "GENERIC_ACTION_67", "GENERIC_ACTION_68", "GENERIC_ACTION_69", "GENERIC_ACTION_7", "GENERIC_ACTION_70", "GENERIC_ACTION_71", "GENERIC_ACTION_72", "GENERIC_ACTION_73", "GENERIC_ACTION_74", "GENERIC_ACTION_75", "GENERIC_ACTION_76", "GENERIC_ACTION_77", "GENERIC_ACTION_78", "GENERIC_ACTION_79", "GENERIC_ACTION_8", "GENERIC_ACTION_80", "GENERIC_ACTION_81", "GENERIC_ACTION_82", "GENERIC_ACTION_83", "GENERIC_ACTION_84", "GENERIC_ACTION_85", "GENERIC_ACTION_86", "GENERIC_ACTION_87", "GENERIC_ACTION_88", "GENERIC_ACTION_89", "GENERIC_ACTION_9", "GENERIC_ACTION_90", "GENERIC_ACTION_91", "GENERIC_ACTION_92", "GENERIC_ACTION_93", "GENERIC_ACTION_94", "GENERIC_ACTION_95", "GENERIC_ACTION_96", "GENERIC_ACTION_97", "GENERIC_ACTION_98", "GENERIC_ACTION_99", "THEME_GENERIC_ACTION_1", "THEME_GENERIC_ACTION_10", "THEME_GENERIC_ACTION_11", "THEME_GENERIC_ACTION_12", "THEME_GENERIC_ACTION_13", "THEME_GENERIC_ACTION_14", "THEME_GENERIC_ACTION_15", "THEME_GENERIC_ACTION_16", "THEME_GENERIC_ACTION_17", "THEME_GENERIC_ACTION_18", "THEME_GENERIC_ACTION_19", "THEME_GENERIC_ACTION_2", "THEME_GENERIC_ACTION_20", "THEME_GENERIC_ACTION_21", "THEME_GENERIC_ACTION_22", "THEME_GENERIC_ACTION_23", "THEME_GENERIC_ACTION_24", "THEME_GENERIC_ACTION_25", "THEME_GENERIC_ACTION_26", "THEME_GENERIC_ACTION_27", "THEME_GENERIC_ACTION_28", "THEME_GENERIC_ACTION_29", "THEME_GENERIC_ACTION_3", "THEME_GENERIC_ACTION_30", "THEME_GENERIC_ACTION_4", "THEME_GENERIC_ACTION_5", "THEME_GENERIC_ACTION_6", "THEME_GENERIC_ACTION_7", "THEME_GENERIC_ACTION_8", "THEME_GENERIC_ACTION_9"]).optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("MAXMIND"), allow_high_risk_email: z.boolean(), default_quality_score: z.enum(["ERROR", "HIGH", "LOW"]), ip_threshold: z.number().int(), risk_threshold: z.number().int()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("REFERRED_BY_EVENT"), referral_originator: z.enum(["ADVOCATE", "FRIEND"]).nullable()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("REWARD_EVENT"), event_names: z.array(z.string()), reward_states: z.array(z.enum(["CANCELED", "EARNED", "FAILED", "FULFILLED", "REDEEMED", "REVOKED"])), slots: z.array(z.string()), tags: z.array(z.string())}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("SCORE"), cause_event_name: z.string(), channel: z.string(), score_result: z.string()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("SEND_REWARD_EVENT"), reward_names: z.array(z.string()), reward_states: z.array(z.enum(["FULFILLED", "SENT"])), tags: z.array(z.string())}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("SHARE"), channels: z.array(z.enum(["ANY", "EMAIL", "EXTOLE_EMAIL", "EXTOLE_TWITTER", "FACEBOOK", "TWITTER"])), quality: z.enum(["ANY", "HIGH", "LOW"]), share_types: z.array(z.enum(["ANY", "EMAIL", "EXTOLE_EMAIL", "EXTOLE_TWITTER", "FACEBOOK", "TWITTER"])).optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("STEP_EVENT"), event_names: z.array(z.string()).optional(), having_any_data_name: z.array(z.string()).optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("STICKY_JOURNEY"), label: z.string().optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("TARGETING"), scope: z.enum(["CAMPAIGN", "JOURNEY", "PROGRAM"]).optional()}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), negated: z.boolean(), parent_trigger_group_name: z.string(), trigger_description: z.string(), trigger_id: z.string(), trigger_name: z.string(), trigger_phase: z.enum(["MATCHING", "QUALIFYING", "QUALITY"]), trigger_type: z.literal("ZONE_STATE"), invert_mapping_state: z.boolean(), step_name: z.string().nullable(), zone_name: z.string().nullable()})]); export const rewardTagsInBuiltCampaignControllerActionApproveResponse = z.union([z.array(z.string()), z.string(), z.string()]); export const builtCampaignControllerActionApproveResponse = z.object({action_id: z.string(), action_type: z.literal("APPROVE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), cause_type: z.string(), event_type: z.string(), force: z.string(), legacy_action_id: z.string(), note: z.string(), partner_event_id: z.string(), polling_id: z.string(), polling_name: z.string(), reward_tags: rewardTagsInBuiltCampaignControllerActionApproveResponse}); export const builtCampaignControllerActionCancelRewardResponse = z.object({action_id: z.string(), action_type: z.literal("CANCEL_REWARD"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), message: z.string(), reward_id: z.string()}); export const builtCampaignControllerActionCreateMembershipResponse = z.object({action_id: z.string(), action_type: z.literal("CREATE_MEMBERSHIP"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), audience_id: z.string()}); export const builtCampaignControllerActionCreativeResponse = z.object({action_id: z.string(), action_type: z.literal("CREATIVE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), api_version: z.number().int(), build_version: z.number().int(), classification: z.enum(["EMAIL", "JAVASCRIPT", "PAGE"]), has_creative: z.boolean(), latest_version: z.number().int(), theme_version: z.string()}); export const builtCampaignControllerActionDataIntelligenceResponse = z.object({action_id: z.string(), action_type: z.literal("DATA_INTELLIGENCE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), event_name: z.string(), intelligence_provider: z.enum(["EMAIL_AGE", "MAXMIND", "NOOP"]), profile_risk_update_interval: duration}); export const builtCampaignControllerActionDeclineResponse = z.object({action_id: z.string(), action_type: z.literal("DECLINE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), cause_type: z.string(), event_type: z.string(), legacy_action_id: z.string(), note: z.string(), partner_event_id: z.string(), polling_id: z.string(), polling_name: z.string()}); export const bodyInBuiltCampaignControllerActionDisplayResponse = z.union([z.string(), z.string()]); export const headersInBuiltCampaignControllerActionDisplayResponse = z.union([z.record(z.string(), z.string()), z.string(), z.string()]); export const responseInBuiltCampaignControllerActionDisplayResponse = z.union([z.object({body: z.string().optional(), headers: z.record(z.string(), z.string()).optional(), statusCode: z.number().int().optional()}), z.string(), z.string()]); export const builtCampaignControllerActionDisplayResponse = z.object({action_id: z.string().optional(), action_type: z.literal("DISPLAY").optional(), component_ids: z.array(z.string()).optional(), component_references: z.array(componentReferenceResponse).optional(), enabled: z.boolean().optional(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]).optional(), body: bodyInBuiltCampaignControllerActionDisplayResponse.optional(), headers: headersInBuiltCampaignControllerActionDisplayResponse.optional(), response: responseInBuiltCampaignControllerActionDisplayResponse.optional()}); export const dataInBuiltCampaignControllerActionEarnRewardResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionEarnRewardResponse = z.record(z.string(), dataInBuiltCampaignControllerActionEarnRewardResponse); export const extraDataInBuiltCampaignControllerActionEarnRewardResponse = z.union([z.record(z.string(), z.object({})), z.string(), z.string()]); export const rewardActionIdInBuiltCampaignControllerActionEarnRewardResponse = z.union([z.string(), z.string(), z.string()]); export const slotsInBuiltCampaignControllerActionEarnRewardResponse = z.union([z.array(z.string()), z.string(), z.string()]); export const tagsInBuiltCampaignControllerActionEarnRewardResponse = z.union([z.array(z.string()), z.string(), z.string()]); export const valueOfEventBeingRewardedInBuiltCampaignControllerActionEarnRewardResponse = z.union([z.object({}), z.string(), z.string()]); export const builtCampaignControllerActionEarnRewardResponse = z.object({action_id: z.string(), action_type: z.literal("EARN_REWARD"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), data: dataMapInBuiltCampaignControllerActionEarnRewardResponse, extra_data: extraDataInBuiltCampaignControllerActionEarnRewardResponse, reward_action_id: rewardActionIdInBuiltCampaignControllerActionEarnRewardResponse, reward_name: z.string(), reward_supplier_id: z.string(), slots: slotsInBuiltCampaignControllerActionEarnRewardResponse, tags: tagsInBuiltCampaignControllerActionEarnRewardResponse, value_of_event_being_rewarded: valueOfEventBeingRewardedInBuiltCampaignControllerActionEarnRewardResponse}); export const dataInBuiltCampaignControllerActionEmailResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionEmailResponse = z.record(z.string(), dataInBuiltCampaignControllerActionEmailResponse); export const builtCampaignControllerActionEmailResponse = z.object({action_id: z.string().optional(), action_type: z.literal("EMAIL").optional(), component_ids: z.array(z.string()).optional(), component_references: z.array(componentReferenceResponse).optional(), enabled: z.boolean().optional(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]).optional(), data: dataMapInBuiltCampaignControllerActionEmailResponse.optional(), zone_name: z.string().optional()}); export const dataInBuiltCampaignControllerActionExpressionResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionExpressionResponse = z.record(z.string(), dataInBuiltCampaignControllerActionExpressionResponse); export const expressionInBuiltCampaignControllerActionExpressionResponse = z.union([z.object({}), z.string(), z.string()]); export const builtCampaignControllerActionExpressionResponse = z.object({action_id: z.string(), action_type: z.literal("EXPRESSION"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), data: dataMapInBuiltCampaignControllerActionExpressionResponse, expression: expressionInBuiltCampaignControllerActionExpressionResponse}); export const emailFireAsPersonIdentification = z.object({person_identification_type: z.literal("EMAIL").optional(), value: z.string().optional()}); export const partnerEventIdFireAsPersonIdentification = z.object({person_identification_type: z.literal("PARTNER_EVENT_ID").optional(), value: z.string().optional(), partner_event_key: z.string().optional()}); export const partnerUserIdFireAsPersonIdentification = z.object({person_identification_type: z.literal("PARTNER_USER_ID").optional(), value: z.string().optional()}); export const personIdFireAsPersonIdentification = z.object({person_identification_type: z.literal("PERSON_ID").optional(), value: z.string().optional()}); export const fireAsPersonIdentification = z.discriminatedUnion("person_identification_type", [emailFireAsPersonIdentification, partnerEventIdFireAsPersonIdentification, partnerUserIdFireAsPersonIdentification, personIdFireAsPersonIdentification]); export const fireAsPersonJourney = z.object({advocate_code: z.string().optional(), advocate_partner_user_id: z.string().optional(), campaign_id: z.string().optional(), container: z.string().optional(), coupon_code: z.string().optional(), journey_type: z.string().optional(), label: z.string().optional(), promotable_code: z.string().optional(), reason: z.string().optional(), referral_reason: z.enum(["ADVOCATE", "ADVOCATE_CODE", "ADVOCATE_PARTNER_USER_ID", "COUPON_CODE", "DISPLACED_PARTNER_USER_ID", "INCENTIVIZED_SHARE", "PARTNER_EVENT_ID", "PARTNER_SHARE_ID", "SHAREABLE_ID", "SHARE_ID", "SHARE_RECIPIENT", "UNKNOWN_REASON"]).optional(), share_id: z.string().optional(), shareable_id: z.string().optional(), zone: z.string().optional()}); export const dataInBuiltCampaignControllerActionFireAsPersonResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionFireAsPersonResponse = z.record(z.string(), dataInBuiltCampaignControllerActionFireAsPersonResponse); export const eventTimeInBuiltCampaignControllerActionFireAsPersonResponse = z.union([z.string(), z.string(), z.string()]); export const extraDataInBuiltCampaignControllerActionFireAsPersonResponse = z.union([z.record(z.string(), z.object({})), z.string(), z.string()]); export const personIdInBuiltCampaignControllerActionFireAsPersonResponse = z.union([z.string(), z.string(), z.string()]); export const builtCampaignControllerActionFireAsPersonResponse = z.object({action_id: z.string().optional(), action_type: z.literal("FIRE_AS_PERSON").optional(), component_ids: z.array(z.string()).optional(), component_references: z.array(componentReferenceResponse).optional(), enabled: z.boolean().optional(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]).optional(), as_person_identification: fireAsPersonIdentification.optional(), as_person_journey: fireAsPersonJourney.optional(), data: dataMapInBuiltCampaignControllerActionFireAsPersonResponse.optional(), event_name: z.string().optional(), event_time: eventTimeInBuiltCampaignControllerActionFireAsPersonResponse.optional(), extra_data: extraDataInBuiltCampaignControllerActionFireAsPersonResponse.optional(), labels: z.array(z.string()).optional(), person_id: personIdInBuiltCampaignControllerActionFireAsPersonResponse.optional()}); export const partnerRewardIdInBuiltCampaignControllerActionFulfillRewardResponse = z.union([z.string(), z.string(), z.string()]); export const builtCampaignControllerActionFulfillRewardResponse = z.object({action_id: z.string(), action_type: z.literal("FULFILL_REWARD"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), message: z.string(), partner_reward_id: partnerRewardIdInBuiltCampaignControllerActionFulfillRewardResponse, reward_id: z.string(), success: z.string()}); export const dataInBuiltCampaignControllerActionIncentivizeResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionIncentivizeResponse = z.record(z.string(), dataInBuiltCampaignControllerActionIncentivizeResponse); export const builtCampaignControllerActionIncentivizeResponse = z.object({action_id: z.string().optional(), action_type: z.literal("INCENTIVIZE").optional(), component_ids: z.array(z.string()).optional(), component_references: z.array(componentReferenceResponse).optional(), enabled: z.boolean().optional(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]).optional(), action_name: z.string().optional(), data: dataMapInBuiltCampaignControllerActionIncentivizeResponse.optional(), incentivize_action_type: z.enum(["CLICK", "GENERIC_ACTION_1", "GENERIC_ACTION_10", "GENERIC_ACTION_100", "GENERIC_ACTION_101", "GENERIC_ACTION_102", "GENERIC_ACTION_103", "GENERIC_ACTION_104", "GENERIC_ACTION_105", "GENERIC_ACTION_106", "GENERIC_ACTION_107", "GENERIC_ACTION_108", "GENERIC_ACTION_109", "GENERIC_ACTION_11", "GENERIC_ACTION_110", "GENERIC_ACTION_111", "GENERIC_ACTION_112", "GENERIC_ACTION_113", "GENERIC_ACTION_114", "GENERIC_ACTION_115", "GENERIC_ACTION_116", "GENERIC_ACTION_117", "GENERIC_ACTION_118", "GENERIC_ACTION_119", "GENERIC_ACTION_12", "GENERIC_ACTION_120", "GENERIC_ACTION_121", "GENERIC_ACTION_122", "GENERIC_ACTION_123", "GENERIC_ACTION_124", "GENERIC_ACTION_125", "GENERIC_ACTION_126", "GENERIC_ACTION_127", "GENERIC_ACTION_128", "GENERIC_ACTION_129", "GENERIC_ACTION_13", "GENERIC_ACTION_130", "GENERIC_ACTION_131", "GENERIC_ACTION_132", "GENERIC_ACTION_133", "GENERIC_ACTION_134", "GENERIC_ACTION_135", "GENERIC_ACTION_136", "GENERIC_ACTION_137", "GENERIC_ACTION_138", "GENERIC_ACTION_139", "GENERIC_ACTION_14", "GENERIC_ACTION_140", "GENERIC_ACTION_141", "GENERIC_ACTION_142", "GENERIC_ACTION_143", "GENERIC_ACTION_144", "GENERIC_ACTION_145", "GENERIC_ACTION_146", "GENERIC_ACTION_147", "GENERIC_ACTION_148", "GENERIC_ACTION_149", "GENERIC_ACTION_15", "GENERIC_ACTION_150", "GENERIC_ACTION_151", "GENERIC_ACTION_152", "GENERIC_ACTION_153", "GENERIC_ACTION_154", "GENERIC_ACTION_155", "GENERIC_ACTION_156", "GENERIC_ACTION_157", "GENERIC_ACTION_158", "GENERIC_ACTION_159", "GENERIC_ACTION_16", "GENERIC_ACTION_160", "GENERIC_ACTION_161", "GENERIC_ACTION_162", "GENERIC_ACTION_163", "GENERIC_ACTION_164", "GENERIC_ACTION_165", "GENERIC_ACTION_166", "GENERIC_ACTION_167", "GENERIC_ACTION_168", "GENERIC_ACTION_169", "GENERIC_ACTION_17", "GENERIC_ACTION_170", "GENERIC_ACTION_171", "GENERIC_ACTION_172", "GENERIC_ACTION_173", "GENERIC_ACTION_174", "GENERIC_ACTION_175", "GENERIC_ACTION_176", "GENERIC_ACTION_177", "GENERIC_ACTION_178", "GENERIC_ACTION_179", "GENERIC_ACTION_18", "GENERIC_ACTION_180", "GENERIC_ACTION_181", "GENERIC_ACTION_182", "GENERIC_ACTION_183", "GENERIC_ACTION_184", "GENERIC_ACTION_185", "GENERIC_ACTION_186", "GENERIC_ACTION_187", "GENERIC_ACTION_188", "GENERIC_ACTION_189", "GENERIC_ACTION_19", "GENERIC_ACTION_190", "GENERIC_ACTION_191", "GENERIC_ACTION_192", "GENERIC_ACTION_193", "GENERIC_ACTION_194", "GENERIC_ACTION_195", "GENERIC_ACTION_196", "GENERIC_ACTION_197", "GENERIC_ACTION_198", "GENERIC_ACTION_199", "GENERIC_ACTION_2", "GENERIC_ACTION_20", "GENERIC_ACTION_200", "GENERIC_ACTION_21", "GENERIC_ACTION_22", "GENERIC_ACTION_23", "GENERIC_ACTION_24", "GENERIC_ACTION_25", "GENERIC_ACTION_26", "GENERIC_ACTION_27", "GENERIC_ACTION_28", "GENERIC_ACTION_29", "GENERIC_ACTION_3", "GENERIC_ACTION_30", "GENERIC_ACTION_31", "GENERIC_ACTION_32", "GENERIC_ACTION_33", "GENERIC_ACTION_34", "GENERIC_ACTION_35", "GENERIC_ACTION_36", "GENERIC_ACTION_37", "GENERIC_ACTION_38", "GENERIC_ACTION_39", "GENERIC_ACTION_4", "GENERIC_ACTION_40", "GENERIC_ACTION_41", "GENERIC_ACTION_42", "GENERIC_ACTION_43", "GENERIC_ACTION_44", "GENERIC_ACTION_45", "GENERIC_ACTION_46", "GENERIC_ACTION_47", "GENERIC_ACTION_48", "GENERIC_ACTION_49", "GENERIC_ACTION_5", "GENERIC_ACTION_50", "GENERIC_ACTION_51", "GENERIC_ACTION_52", "GENERIC_ACTION_53", "GENERIC_ACTION_54", "GENERIC_ACTION_55", "GENERIC_ACTION_56", "GENERIC_ACTION_57", "GENERIC_ACTION_58", "GENERIC_ACTION_59", "GENERIC_ACTION_6", "GENERIC_ACTION_60", "GENERIC_ACTION_61", "GENERIC_ACTION_62", "GENERIC_ACTION_63", "GENERIC_ACTION_64", "GENERIC_ACTION_65", "GENERIC_ACTION_66", "GENERIC_ACTION_67", "GENERIC_ACTION_68", "GENERIC_ACTION_69", "GENERIC_ACTION_7", "GENERIC_ACTION_70", "GENERIC_ACTION_71", "GENERIC_ACTION_72", "GENERIC_ACTION_73", "GENERIC_ACTION_74", "GENERIC_ACTION_75", "GENERIC_ACTION_76", "GENERIC_ACTION_77", "GENERIC_ACTION_78", "GENERIC_ACTION_79", "GENERIC_ACTION_8", "GENERIC_ACTION_80", "GENERIC_ACTION_81", "GENERIC_ACTION_82", "GENERIC_ACTION_83", "GENERIC_ACTION_84", "GENERIC_ACTION_85", "GENERIC_ACTION_86", "GENERIC_ACTION_87", "GENERIC_ACTION_88", "GENERIC_ACTION_89", "GENERIC_ACTION_9", "GENERIC_ACTION_90", "GENERIC_ACTION_91", "GENERIC_ACTION_92", "GENERIC_ACTION_93", "GENERIC_ACTION_94", "GENERIC_ACTION_95", "GENERIC_ACTION_96", "GENERIC_ACTION_97", "GENERIC_ACTION_98", "GENERIC_ACTION_99", "IMPRESSION", "PROMOTION", "PURCHASE", "REGISTER", "SHARE", "SHARE_REWARD", "THEME_GENERIC_ACTION_1", "THEME_GENERIC_ACTION_10", "THEME_GENERIC_ACTION_11", "THEME_GENERIC_ACTION_12", "THEME_GENERIC_ACTION_13", "THEME_GENERIC_ACTION_14", "THEME_GENERIC_ACTION_15", "THEME_GENERIC_ACTION_16", "THEME_GENERIC_ACTION_17", "THEME_GENERIC_ACTION_18", "THEME_GENERIC_ACTION_19", "THEME_GENERIC_ACTION_2", "THEME_GENERIC_ACTION_20", "THEME_GENERIC_ACTION_21", "THEME_GENERIC_ACTION_22", "THEME_GENERIC_ACTION_23", "THEME_GENERIC_ACTION_24", "THEME_GENERIC_ACTION_25", "THEME_GENERIC_ACTION_26", "THEME_GENERIC_ACTION_27", "THEME_GENERIC_ACTION_28", "THEME_GENERIC_ACTION_29", "THEME_GENERIC_ACTION_3", "THEME_GENERIC_ACTION_30", "THEME_GENERIC_ACTION_4", "THEME_GENERIC_ACTION_5", "THEME_GENERIC_ACTION_6", "THEME_GENERIC_ACTION_7", "THEME_GENERIC_ACTION_8", "THEME_GENERIC_ACTION_9"]).optional(), overrides: z.record(z.string(), z.string()).optional(), review_status: z.enum(["EVALUATING", "PENDING"]).optional()}); export const dataInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse = z.record(z.string(), dataInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse); export const eventTypeInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse = z.union([z.enum(["CLICK", "GENERIC_ACTION_1", "GENERIC_ACTION_10", "GENERIC_ACTION_100", "GENERIC_ACTION_101", "GENERIC_ACTION_102", "GENERIC_ACTION_103", "GENERIC_ACTION_104", "GENERIC_ACTION_105", "GENERIC_ACTION_106", "GENERIC_ACTION_107", "GENERIC_ACTION_108", "GENERIC_ACTION_109", "GENERIC_ACTION_11", "GENERIC_ACTION_110", "GENERIC_ACTION_111", "GENERIC_ACTION_112", "GENERIC_ACTION_113", "GENERIC_ACTION_114", "GENERIC_ACTION_115", "GENERIC_ACTION_116", "GENERIC_ACTION_117", "GENERIC_ACTION_118", "GENERIC_ACTION_119", "GENERIC_ACTION_12", "GENERIC_ACTION_120", "GENERIC_ACTION_121", "GENERIC_ACTION_122", "GENERIC_ACTION_123", "GENERIC_ACTION_124", "GENERIC_ACTION_125", "GENERIC_ACTION_126", "GENERIC_ACTION_127", "GENERIC_ACTION_128", "GENERIC_ACTION_129", "GENERIC_ACTION_13", "GENERIC_ACTION_130", "GENERIC_ACTION_131", "GENERIC_ACTION_132", "GENERIC_ACTION_133", "GENERIC_ACTION_134", "GENERIC_ACTION_135", "GENERIC_ACTION_136", "GENERIC_ACTION_137", "GENERIC_ACTION_138", "GENERIC_ACTION_139", "GENERIC_ACTION_14", "GENERIC_ACTION_140", "GENERIC_ACTION_141", "GENERIC_ACTION_142", "GENERIC_ACTION_143", "GENERIC_ACTION_144", "GENERIC_ACTION_145", "GENERIC_ACTION_146", "GENERIC_ACTION_147", "GENERIC_ACTION_148", "GENERIC_ACTION_149", "GENERIC_ACTION_15", "GENERIC_ACTION_150", "GENERIC_ACTION_151", "GENERIC_ACTION_152", "GENERIC_ACTION_153", "GENERIC_ACTION_154", "GENERIC_ACTION_155", "GENERIC_ACTION_156", "GENERIC_ACTION_157", "GENERIC_ACTION_158", "GENERIC_ACTION_159", "GENERIC_ACTION_16", "GENERIC_ACTION_160", "GENERIC_ACTION_161", "GENERIC_ACTION_162", "GENERIC_ACTION_163", "GENERIC_ACTION_164", "GENERIC_ACTION_165", "GENERIC_ACTION_166", "GENERIC_ACTION_167", "GENERIC_ACTION_168", "GENERIC_ACTION_169", "GENERIC_ACTION_17", "GENERIC_ACTION_170", "GENERIC_ACTION_171", "GENERIC_ACTION_172", "GENERIC_ACTION_173", "GENERIC_ACTION_174", "GENERIC_ACTION_175", "GENERIC_ACTION_176", "GENERIC_ACTION_177", "GENERIC_ACTION_178", "GENERIC_ACTION_179", "GENERIC_ACTION_18", "GENERIC_ACTION_180", "GENERIC_ACTION_181", "GENERIC_ACTION_182", "GENERIC_ACTION_183", "GENERIC_ACTION_184", "GENERIC_ACTION_185", "GENERIC_ACTION_186", "GENERIC_ACTION_187", "GENERIC_ACTION_188", "GENERIC_ACTION_189", "GENERIC_ACTION_19", "GENERIC_ACTION_190", "GENERIC_ACTION_191", "GENERIC_ACTION_192", "GENERIC_ACTION_193", "GENERIC_ACTION_194", "GENERIC_ACTION_195", "GENERIC_ACTION_196", "GENERIC_ACTION_197", "GENERIC_ACTION_198", "GENERIC_ACTION_199", "GENERIC_ACTION_2", "GENERIC_ACTION_20", "GENERIC_ACTION_200", "GENERIC_ACTION_21", "GENERIC_ACTION_22", "GENERIC_ACTION_23", "GENERIC_ACTION_24", "GENERIC_ACTION_25", "GENERIC_ACTION_26", "GENERIC_ACTION_27", "GENERIC_ACTION_28", "GENERIC_ACTION_29", "GENERIC_ACTION_3", "GENERIC_ACTION_30", "GENERIC_ACTION_31", "GENERIC_ACTION_32", "GENERIC_ACTION_33", "GENERIC_ACTION_34", "GENERIC_ACTION_35", "GENERIC_ACTION_36", "GENERIC_ACTION_37", "GENERIC_ACTION_38", "GENERIC_ACTION_39", "GENERIC_ACTION_4", "GENERIC_ACTION_40", "GENERIC_ACTION_41", "GENERIC_ACTION_42", "GENERIC_ACTION_43", "GENERIC_ACTION_44", "GENERIC_ACTION_45", "GENERIC_ACTION_46", "GENERIC_ACTION_47", "GENERIC_ACTION_48", "GENERIC_ACTION_49", "GENERIC_ACTION_5", "GENERIC_ACTION_50", "GENERIC_ACTION_51", "GENERIC_ACTION_52", "GENERIC_ACTION_53", "GENERIC_ACTION_54", "GENERIC_ACTION_55", "GENERIC_ACTION_56", "GENERIC_ACTION_57", "GENERIC_ACTION_58", "GENERIC_ACTION_59", "GENERIC_ACTION_6", "GENERIC_ACTION_60", "GENERIC_ACTION_61", "GENERIC_ACTION_62", "GENERIC_ACTION_63", "GENERIC_ACTION_64", "GENERIC_ACTION_65", "GENERIC_ACTION_66", "GENERIC_ACTION_67", "GENERIC_ACTION_68", "GENERIC_ACTION_69", "GENERIC_ACTION_7", "GENERIC_ACTION_70", "GENERIC_ACTION_71", "GENERIC_ACTION_72", "GENERIC_ACTION_73", "GENERIC_ACTION_74", "GENERIC_ACTION_75", "GENERIC_ACTION_76", "GENERIC_ACTION_77", "GENERIC_ACTION_78", "GENERIC_ACTION_79", "GENERIC_ACTION_8", "GENERIC_ACTION_80", "GENERIC_ACTION_81", "GENERIC_ACTION_82", "GENERIC_ACTION_83", "GENERIC_ACTION_84", "GENERIC_ACTION_85", "GENERIC_ACTION_86", "GENERIC_ACTION_87", "GENERIC_ACTION_88", "GENERIC_ACTION_89", "GENERIC_ACTION_9", "GENERIC_ACTION_90", "GENERIC_ACTION_91", "GENERIC_ACTION_92", "GENERIC_ACTION_93", "GENERIC_ACTION_94", "GENERIC_ACTION_95", "GENERIC_ACTION_96", "GENERIC_ACTION_97", "GENERIC_ACTION_98", "GENERIC_ACTION_99", "IMPRESSION", "PROMOTION", "PURCHASE", "REGISTER", "SHARE", "SHARE_REWARD", "THEME_GENERIC_ACTION_1", "THEME_GENERIC_ACTION_10", "THEME_GENERIC_ACTION_11", "THEME_GENERIC_ACTION_12", "THEME_GENERIC_ACTION_13", "THEME_GENERIC_ACTION_14", "THEME_GENERIC_ACTION_15", "THEME_GENERIC_ACTION_16", "THEME_GENERIC_ACTION_17", "THEME_GENERIC_ACTION_18", "THEME_GENERIC_ACTION_19", "THEME_GENERIC_ACTION_2", "THEME_GENERIC_ACTION_20", "THEME_GENERIC_ACTION_21", "THEME_GENERIC_ACTION_22", "THEME_GENERIC_ACTION_23", "THEME_GENERIC_ACTION_24", "THEME_GENERIC_ACTION_25", "THEME_GENERIC_ACTION_26", "THEME_GENERIC_ACTION_27", "THEME_GENERIC_ACTION_28", "THEME_GENERIC_ACTION_29", "THEME_GENERIC_ACTION_3", "THEME_GENERIC_ACTION_30", "THEME_GENERIC_ACTION_4", "THEME_GENERIC_ACTION_5", "THEME_GENERIC_ACTION_6", "THEME_GENERIC_ACTION_7", "THEME_GENERIC_ACTION_8", "THEME_GENERIC_ACTION_9"]), z.string(), z.string()]); export const legacyActionIdInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse = z.union([z.string(), z.string(), z.string()]); export const messageInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse = z.union([z.string(), z.string(), z.string()]); export const partnerEventIdInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse = z.union([z.string(), z.string(), z.string()]); export const reviewStatusInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse = z.union([z.string(), z.string()]); export const builtCampaignControllerActionIncentivizeStatusUpdateResponse = z.object({action_id: z.string().optional(), action_type: z.literal("INCENTIVIZE_STATUS_UPDATE").optional(), component_ids: z.array(z.string()).optional(), component_references: z.array(componentReferenceResponse).optional(), enabled: z.boolean().optional(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]).optional(), data: dataMapInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse.optional(), event_type: eventTypeInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse.optional(), legacy_action_id: legacyActionIdInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse.optional(), message: messageInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse.optional(), move_to_pending: z.boolean().optional(), partner_event_id: partnerEventIdInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse.optional(), review_status: reviewStatusInBuiltCampaignControllerActionIncentivizeStatusUpdateResponse.optional()}); export const builtCampaignControllerActionRedeemRewardResponse = z.object({action_id: z.string(), action_type: z.literal("REDEEM_REWARD"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), data: z.record(z.string(), z.string()), partner_event_id: z.string(), reward_id: z.string()}); export const builtCampaignControllerActionRemoveMembershipResponse = z.object({action_id: z.string(), action_type: z.literal("REMOVE_MEMBERSHIP"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), audience_id: z.string()}); export const builtCampaignControllerActionRevokeRewardResponse = z.object({action_id: z.string(), action_type: z.literal("REVOKE_REWARD"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), message: z.string(), reward_id: z.string()}); export const dataInBuiltCampaignControllerActionScheduleResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionScheduleResponse = z.record(z.string(), dataInBuiltCampaignControllerActionScheduleResponse); export const datesInBuiltCampaignControllerActionScheduleResponse = z.union([z.array(zonedDateTime), z.string(), z.string()]); export const delaysInBuiltCampaignControllerActionScheduleResponse = z.union([z.array(duration), z.string(), z.string()]); export const extraDataInBuiltCampaignControllerActionScheduleResponse = z.union([z.record(z.string(), z.object({})), z.string(), z.string()]); export const scheduleNameInBuiltCampaignControllerActionScheduleResponse = z.union([z.string(), z.string()]); export const builtCampaignControllerActionScheduleResponse = z.object({action_id: z.string(), action_type: z.literal("SCHEDULE"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), data: dataMapInBuiltCampaignControllerActionScheduleResponse, dates: datesInBuiltCampaignControllerActionScheduleResponse, delays: delaysInBuiltCampaignControllerActionScheduleResponse, extra_data: extraDataInBuiltCampaignControllerActionScheduleResponse, force: z.boolean(), schedule_name: scheduleNameInBuiltCampaignControllerActionScheduleResponse}); export const builtCampaignControllerActionShareEventResponse = z.object({action_id: z.string(), action_type: z.literal("SHARE_EVENT"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"])}); export const dataInBuiltCampaignControllerActionSignalResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionSignalResponse = z.record(z.string(), dataInBuiltCampaignControllerActionSignalResponse); export const nameInBuiltCampaignControllerActionSignalResponse = z.union([z.string(), z.string()]); export const signalPollingIdInBuiltCampaignControllerActionSignalResponse = z.union([z.string(), z.string()]); export const builtCampaignControllerActionSignalResponse = z.object({action_id: z.string(), action_type: z.literal("SIGNAL"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), data: dataMapInBuiltCampaignControllerActionSignalResponse, name: nameInBuiltCampaignControllerActionSignalResponse, signal_polling_id: signalPollingIdInBuiltCampaignControllerActionSignalResponse}); export const builtCampaignControllerActionSignalV1Response = z.object({action_id: z.string(), action_type: z.literal("SIGNAL_V1"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), data: z.record(z.string(), z.string()), signal_polling_id: z.string()}); export const builtCampaignControllerActionStepSignalResponse = z.object({action_id: z.string(), action_type: z.literal("STEP_SIGNAL"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), name: z.string(), polling_id: z.string()}); export const dataInBuiltCampaignControllerActionWebhookResponse = z.union([z.object({}), z.string(), z.string()]); export const dataMapInBuiltCampaignControllerActionWebhookResponse = z.record(z.string(), dataInBuiltCampaignControllerActionWebhookResponse); export const builtCampaignControllerActionWebhookResponse = z.object({action_id: z.string(), action_type: z.literal("WEBHOOK"), component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), enabled: z.boolean(), quality: z.enum(["ALWAYS", "HIGH", "LOW"]), data: dataMapInBuiltCampaignControllerActionWebhookResponse, webhook_id: z.string()}); export const builtCampaignControllerActionResponse = z.discriminatedUnion("action_type", [builtCampaignControllerActionApproveResponse, builtCampaignControllerActionCancelRewardResponse, builtCampaignControllerActionCreateMembershipResponse, builtCampaignControllerActionCreativeResponse, builtCampaignControllerActionDataIntelligenceResponse, builtCampaignControllerActionDeclineResponse, builtCampaignControllerActionDisplayResponse, builtCampaignControllerActionEarnRewardResponse, builtCampaignControllerActionEmailResponse, builtCampaignControllerActionExpressionResponse, builtCampaignControllerActionFireAsPersonResponse, builtCampaignControllerActionFulfillRewardResponse, builtCampaignControllerActionIncentivizeResponse, builtCampaignControllerActionIncentivizeStatusUpdateResponse, builtCampaignControllerActionRedeemRewardResponse, builtCampaignControllerActionRemoveMembershipResponse, builtCampaignControllerActionRevokeRewardResponse, builtCampaignControllerActionScheduleResponse, builtCampaignControllerActionShareEventResponse, builtCampaignControllerActionSignalResponse, builtCampaignControllerActionSignalV1Response, builtCampaignControllerActionStepSignalResponse, builtCampaignControllerActionWebhookResponse]); export const valueInBuiltJourneyKeyResponse = z.union([z.object({}), z.string(), z.string()]); export const builtJourneyKeyResponse = z.object({name: z.string().optional(), value: valueInBuiltJourneyKeyResponse.optional()}); export const builtCampaignStepResponse = z.discriminatedUnion("type", [z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_date: zonedDateTime, data: z.array(builtStepDataResponse), enabled: z.boolean(), id: z.string(), step_builder: stepBuilderInBuiltCampaignStepResponseBase, triggers: z.array(builtCampaignControllerTriggerResponse), type: z.literal("CONTROLLER"), updated_date: zonedDateTime, actions: z.array(builtCampaignControllerActionResponse), aliases: z.array(z.string()), controller_id: z.string(), enabled_on_states: z.array(z.enum(["ARCHIVED", "ENDED", "LIVE", "NOT_LAUNCHED", "PAUSED", "STOPPED"])), journey_names: z.array(z.string()), name: z.string(), scope: z.enum(["CLIENT", "PRIVATE", "PUBLIC"]), selectors: z.array(z.enum(["BEST_REFERRAL", "BEST_REFERRAL_SAME_PROGRAM", "MATCHING_CAMPAIGN", "TARGET"])), send_policy: z.enum(["ALL", "FIRST_ONLY"])}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_date: zonedDateTime, data: z.array(builtStepDataResponse), enabled: z.boolean(), id: z.string(), step_builder: stepBuilderInBuiltCampaignStepResponseBase, triggers: z.array(builtCampaignControllerTriggerResponse), type: z.literal("FRONTEND_CONTROLLER"), updated_date: zonedDateTime, actions: z.array(builtCampaignControllerActionResponse), aliases: z.array(z.string()), category: z.string(), enabled_on_states: z.array(z.enum(["ARCHIVED", "ENDED", "LIVE", "NOT_LAUNCHED", "PAUSED", "STOPPED"])), journey_names: z.array(z.string()), name: z.string(), scope: z.enum(["CLIENT", "PRIVATE", "PUBLIC"]), send_policy: z.enum(["ALL", "FIRST_ONLY"])}), z.object({component_ids: z.array(z.string()), component_references: z.array(componentReferenceResponse), created_date: zonedDateTime, data: z.array(builtStepDataResponse), enabled: z.boolean(), id: z.string(), step_builder: stepBuilderInBuiltCampaignStepResponseBase, triggers: z.array(builtCampaignControllerTriggerResponse), type: z.literal("JOURNEY_ENTRY"), updated_date: zonedDateTime, journey_name: z.string(), key: builtJourneyKeyResponse, priority: deweyDecimal})]); export const variantSelectorInBuiltCampaignResponse = z.union([z.string(), z.string()]); export const builtCampaignResponse = z.object({campaign_id: z.string(), campaign_locks: z.array(z.enum(["DUPLICATE", "EDIT"])), campaign_type: z.enum(["CONFIGURATION", "EXTENSION", "INTEGRATION", "MARKETING"]), components: z.array(builtCampaignComponentResponse), description: z.string(), end_date: zonedDateTime, flow_steps: z.array(builtCampaignFlowStepResponse), incentive: incentiveResponse, incentive_id: z.string(), is_published: z.boolean(), labels: z.array(campaignLabelResponse), last_published_date: zonedDateTime, name: z.string(), parent_version: z.number().int(), pause_date: zonedDateTime, program_label: z.string(), program_type: z.string(), start_date: zonedDateTime, state: z.enum(["ARCHIVED", "ENDED", "LIVE", "NOT_LAUNCHED", "PAUSED", "STOPPED"]), steps: z.array(builtCampaignStepResponse), stop_date: zonedDateTime, tags: z.array(z.string()), theme_name: z.string(), updated_date: zonedDateTime, variant_selector: variantSelectorInBuiltCampaignResponse, variants: z.array(z.string()), version: z.number().int()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Get a built campaign * * GET /v2/campaigns/{campaignId}{version}/built * * Also accepts auth: QUERY, COOKIE */ export const getApiV2CampaignsCampaignIdVersionBuilt = async (args: GetApiV2CampaignsCampaignIdVersionBuiltArgs, options?: GetApiV2CampaignsCampaignIdVersionBuiltOptions) => { const {baseUrl = "https://api.extole.io", fetch: fetchFn = fetch, HEADER} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (HEADER !== undefined) headers.set("Authorization", HEADER) const url = `${baseUrl.replace(/\/+$/, '')}/v2/campaigns/${encodeURIComponent(String(args.campaignId))}${encodeURIComponent(String(args.version))}/built${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(builtCampaignResponse, await res.json()) };