/*** * * 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 * ***/ /*** * AfterUserCreatedOrUpdatedTriggerContext.schema.json * Generated on 2026-03-20T21:11:43.087Z * This file was automatically generated. DO NOT edit it by hand, instead edit the related JSON Schema file. ***/ export type UserId = string export type AccountId = string export type FirstName = (string | null) export type LastName = (string | null) export type ImageUrl = (string | null) export type EmailAddress = (string | null) export type CookieId = (string | null) export type Locale = (string | null) export type CountryCode = (string | null) export type IsReferable = boolean export type FirstSeenIPAddress = (string | null) export type LastSeenIPAddress = (string | null) export type DateUserCreated = (number | null) export type DateUserBlocked = (number | null) /** * A segment key this user has been assigned to (e.g. VIP) */ export type SegmentKey = string /** * A list of segments this user has been assigned to */ export type Segments = SegmentKey[] export type FlagType = ("IP" | "EMAIL" | "NAME" | "RATE" | "DAILY_REFERRAL_REWARD_LIMIT" | "TEMP_EMAIL" | "BLOCKED_USER" | "BLOCKED_IP") export type FlagDescription = string /** * Flags indicating whether this user was marked as a potentially fradulent user */ export type FraudFlags = FraudFlag[] /** * The number of rewards this user has received */ export type TotalCount = number /** * The reward identifier */ export type RewardId = string /** * The date the reward was given */ export type DateGiven = (string | null) /** * The date the reward expires */ export type DateExpires = (string | null) /** * The date the reward was cancelled */ export type DateCancelled = (string | null) /** * The identifier of the program that generated this reward */ export type ProgramId = (string | null) /** * The reward key assigned by the program that generated this reward */ export type ProgramRewardKey = string /** * The referral identifier assocaited with this reward */ export type ReferralId = string /** * A list of the rewards this user has received (up to 20) */ export type TheDataSchema = Reward[] /** * The number of referrals this user has made */ export type TotalCount1 = number /** * The unique identifier for this referral */ export type ReferralId1 = string /** * The date this referral was created (attributed) */ export type DateReferralStarted = number export type UserId1 = string export type AccountId1 = string export type FirstName1 = (string | null) export type LastName1 = (string | null) export type ImageUrl1 = (string | null) export type EmailAddress1 = (string | null) export type CookieId1 = (string | null) export type Locale1 = (string | null) export type CountryCode1 = (string | null) export type IsReferable1 = boolean export type FirstSeenIPAddress1 = (string | null) export type LastSeenIPAddress1 = (string | null) export type DateUserCreated1 = (number | null) export type DateUserBlocked1 = (number | null) /** * A segment key this user has been assigned to (e.g. VIP) */ export type SegmentKey1 = string /** * A list of segments this user has been assigned to */ export type Segments1 = SegmentKey1[] export type FlagType1 = ("IP" | "EMAIL" | "NAME" | "RATE" | "DAILY_REFERRAL_REWARD_LIMIT" | "TEMP_EMAIL" | "BLOCKED_USER" | "BLOCKED_IP") export type FlagDescription1 = string /** * Flags indicating whether this user was marked as a potentially fradulent user */ export type FraudFlags1 = FraudFlag1[] /** * The reward identifier */ export type RewardId1 = string /** * The date the reward was given */ export type DateGiven1 = (string | null) /** * The date the reward expires */ export type DateExpires1 = (string | null) /** * The date the reward was cancelled */ export type DateCancelled1 = (string | null) /** * The identifier of the program that generated this reward */ export type ProgramId1 = (string | null) /** * The reward key assigned by the program that generated this reward */ export type ProgramRewardKey1 = string /** * The referral identifier assocaited with this reward */ export type ReferralId2 = string /** * A list of rewards associated with this referral */ export type ReferralRewards = Reward1[] export type UserId2 = string export type AccountId2 = string export type FirstName2 = (string | null) export type LastName2 = (string | null) export type ImageUrl2 = (string | null) export type EmailAddress2 = (string | null) export type CookieId2 = (string | null) export type Locale2 = (string | null) export type CountryCode2 = (string | null) export type IsReferable2 = boolean export type FirstSeenIPAddress2 = (string | null) export type LastSeenIPAddress2 = (string | null) export type DateUserCreated2 = (number | null) export type DateUserBlocked2 = (number | null) /** * A segment key this user has been assigned to (e.g. VIP) */ export type SegmentKey2 = string /** * A list of segments this user has been assigned to */ export type Segments2 = SegmentKey2[] export type FlagType2 = ("IP" | "EMAIL" | "NAME" | "RATE" | "DAILY_REFERRAL_REWARD_LIMIT" | "TEMP_EMAIL" | "BLOCKED_USER" | "BLOCKED_IP") export type FlagDescription2 = string /** * Flags indicating whether this user was marked as a potentially fradulent user */ export type FraudFlags2 = FraudFlag2[] /** * The current time at the moment the program is evaluated */ export type TriggerTime = number /** * The key of the evaluated event (e.g. purchase) */ export type EventKey = string /** * The date this event was created */ export type DateTriggered = number /** * Defines the trigger variables available to an AFTER_USER_CREATED_OR_UPDATED trigger */ export interface AfterUserCreatedOrUpdatedTriggerContext { type?: "AFTER_USER_CREATED_OR_UPDATED" user?: CurrentUser previous?: PreviousUser time?: TriggerTime [k: string]: unknown } export interface CurrentUser { id?: UserId accountId?: AccountId firstName?: FirstName lastName?: LastName imageUrl?: ImageUrl email?: EmailAddress cookieId?: CookieId locale?: Locale countryCode?: CountryCode referable?: IsReferable firstSeenIP?: FirstSeenIPAddress lastSeenIP?: LastSeenIPAddress dateCreated?: DateUserCreated dateBlocked?: DateUserBlocked customFields?: UserCustomFieldsSchema segments?: Segments fraudFlags?: FraudFlags rewards?: Rewards referrals?: TheReferralsSchema referredByReferral?: ReferredByReferral [k: string]: unknown } /** * Defines how custom fields can be specified on a user. Allows alphanumeric numbers and underscores. * * This interface was referenced by `AfterUserCreatedOrUpdatedTriggerContext`'s JSON-Schema * via the `definition` "customFieldsContext". */ export interface UserCustomFieldsSchema { /** * This interface was referenced by `UserCustomFieldsSchema`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". */ [k: string]: (string | boolean | number | null) } export interface FraudFlag { type: FlagType message: FlagDescription } export interface Rewards { totalCount: TotalCount data: TheDataSchema } /** * The set of reward fields */ export interface Reward { id?: RewardId dateGiven?: DateGiven dateExpires?: DateExpires dateCancelled?: DateCancelled programId?: ProgramId programRewardKey?: ProgramRewardKey referralId?: ReferralId [k: string]: unknown } export interface TheReferralsSchema { totalCount: TotalCount1 [k: string]: unknown } /** * The referral where this user was referred. Null when not a referral or partner program. */ export interface ReferredByReferral { id?: ReferralId1 dateReferralStarted?: DateReferralStarted referrerUser?: Referrer rewards?: ReferralRewards [k: string]: unknown } /** * The referring user, the one that referred the current user */ export interface Referrer { id?: UserId1 accountId?: AccountId1 firstName?: FirstName1 lastName?: LastName1 imageUrl?: ImageUrl1 email?: EmailAddress1 cookieId?: CookieId1 locale?: Locale1 countryCode?: CountryCode1 referable?: IsReferable1 firstSeenIP?: FirstSeenIPAddress1 lastSeenIP?: LastSeenIPAddress1 dateCreated?: DateUserCreated1 dateBlocked?: DateUserBlocked1 customFields?: UserCustomFieldsSchema segments?: Segments1 fraudFlags?: FraudFlags1 [k: string]: unknown } export interface FraudFlag1 { type: FlagType1 message: FlagDescription1 } /** * The set of reward fields */ export interface Reward1 { id?: RewardId1 dateGiven?: DateGiven1 dateExpires?: DateExpires1 dateCancelled?: DateCancelled1 programId?: ProgramId1 programRewardKey?: ProgramRewardKey1 referralId?: ReferralId2 [k: string]: unknown } export interface PreviousUser { id?: UserId2 accountId?: AccountId2 firstName?: FirstName2 lastName?: LastName2 imageUrl?: ImageUrl2 email?: EmailAddress2 cookieId?: CookieId2 locale?: Locale2 countryCode?: CountryCode2 referable?: IsReferable2 firstSeenIP?: FirstSeenIPAddress2 lastSeenIP?: LastSeenIPAddress2 dateCreated?: DateUserCreated2 dateBlocked?: DateUserBlocked2 customFields?: UserCustomFieldsSchema segments?: Segments2 fraudFlags?: FraudFlags2 [k: string]: unknown } export interface FraudFlag2 { type: FlagType2 message: FlagDescription2 } /** * The variables for the event that triggered the program * * This interface was referenced by `AfterUserCreatedOrUpdatedTriggerContext`'s JSON-Schema * via the `definition` "eventContext". */ export interface Event { key?: EventKey dateTriggered?: DateTriggered fields?: EventFields [k: string]: unknown } /** * The body of the event (e.g. a purchase event would have fields for revenue, currency, etc.) * * This interface was referenced by `AfterUserCreatedOrUpdatedTriggerContext`'s JSON-Schema * via the `definition` "eventFieldsContext". */ export interface EventFields { [k: string]: unknown }