/*** * * SaaSquatch Type Definitions * * This file was automatically generated. DO NOT edit it by hand, instead edit the related JSON Schema file. * * Generated on 2026-03-20T21:11:42.771Z * ***/ /*** * rules.schema.json * Generated on 2026-03-20T21:11:43.123Z * This file was automatically generated. DO NOT edit it by hand, instead edit the related JSON Schema file. ***/ /** * The version property allows the JSONata migration script to perform a rules update when required */ export type VersionOfTheCurrentSchema = "4.0.0" /** * This interface was referenced by `Rules`'s JSON-Schema * via the `definition` "action". */ export type Action = (Action1 & { key: string name: string firstTimeOnly?: boolean condition?: string actionType: ("tieredRewardsAndEmail" | "rewardAndEmail" | "email" | "exchangeReward" | "retraction") }) export type Action1 = ({ audience: Audience actionType?: "tieredRewardsAndEmail" /** * @maxItems 100 */ rewardTiers: RewardTier[] overrideEmailKey?: string } | { reward: Reward audience: Audience actionType?: "rewardAndEmail" overrideEmailKey?: string overrideRewardKey?: string } | { audience: Audience actionType?: "email" overrideEmailKey?: string } | (({ subType?: "rewards" /** * @maxItems 100 */ retractedRewardKeys: string[] } | { subType?: ("referral" | "conversion") } | { subType?: "event" sourceEventKey: string sourceEventFilter: string }) & { subType: ("rewards" | "referral" | "event" | "conversion") actionType?: "retraction" }) | { audience: Audience actionType?: "exchangeReward" sourceUnit: string sourceValue: string repeatExchange: ("no-repeat" | "repeat-max") globalRewardKey: string }) /** * This interface was referenced by `Rules`'s JSON-Schema * via the `definition` "audience". */ export type Audience = ("referrer" | "referred") /** * This interface was referenced by `Rules`'s JSON-Schema * via the `definition` "reward". */ export type Reward = (Reward1 & { expiryDate?: string rewardType: ("static" | "dynamic" | "commission") pendingPeriod?: string }) export type Reward1 = ({ rewardType?: "static" } | { unit: string value: string rewardType?: "dynamic" } | { unit: string commissionPercent: number rewardType?: "commission" }) export type ShouldAReferredUserMeetingThisObjectiveSConditionConvertTheReferral = (false | true) /** * This interface was referenced by `Rules`'s JSON-Schema * via the `definition` "rewardLimit". */ export type RewardLimit = (RewardLimit1 & { limitType: ("unlimited" | "limited") }) export type RewardLimit1 = ({ limitType?: "unlimited" } | { limitType?: "limited" maxRewards: number overrideEmailKey?: string }) export interface Rules { version?: VersionOfTheCurrentSchema conversionRule?: ConversionRules } export interface ConversionRules { /** * @minItems 1 * @maxItems 100 */ objectives: Objective[] } /** * This interface was referenced by `Rules`'s JSON-Schema * via the `definition` "objective". */ export interface Objective { key: string name: string /** * @maxItems 100 */ actions?: Action[] trigger: (({ eventKey: string intent?: ("PURCHASE" | "REFUND" | "OTHER") firstTimeOnly?: boolean condition?: string triggerType?: "eventTrigger" } | { firstTimeOnly?: boolean condition?: string edgeFields?: string[] triggerType?: "criteriaTrigger" } | { firstTimeOnly?: boolean condition?: string triggerType?: "referralTrigger" }) & { triggerType: ("eventTrigger" | "criteriaTrigger" | "referralTrigger") }) performsConversion: ShouldAReferredUserMeetingThisObjectiveSConditionConvertTheReferral referrerProgramRewardLimit?: RewardLimit } /** * This interface was referenced by `Rules`'s JSON-Schema * via the `definition` "rewardTier". */ export interface RewardTier { key: string reward: Reward condition: string overrideRewardKey?: string }