/*** * * 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 * ***/ // Start of DataEvaluationOptions declare namespace saasquatch.DataEvaluationOptions { /** * If true then all triggered webhook types will be sent */ export type WebhooksEnabled = boolean export type EnabledWebhookTypes = ("user.created" | "coupon.created" | "reward.created" | "referral.started" | "referral.converted" | "user.reward.balance.changed" | "email.referred.reward.earned" | "email.referral.started" | "email.referral.paid" | "email.referral.rewardLimitReached" | "referral.automoderation.complete" | "referral.ended" | "theme.publish.finished")[] /** * If true then all applicable active programs will be triggered */ export type ProgramEvaluationEnabled = boolean export type EnabledProgramIds = string[] export type AnalyticsTrackingEnabled = boolean export type CollectionName = ("userCreated" | "userReferralProgramLoaded" | "userReferralProgramEngagement" | "userReferralShareLinkClicked" | "userReferralCreated" | "userApprovedReferralCreated" | "userReferralModerated" | "userReferralConverted" | "userApprovedReferralConverted" | "userReferralEnded" | "rewardCreated" | "rewardRedeemed" | "programEvaluated" | "userActivity" | "programGoal") export type AnalyticsEventCollections = { collectionName?: CollectionName [k: string]: unknown }[] export interface DataEvaluationOptions { webhooks?: (WebhooksEnabled | { enabledWebhookTypes: EnabledWebhookTypes }) programs?: (ProgramEvaluationEnabled | { enabledProgramIds: EnabledProgramIds }) analytics?: (AnalyticsTrackingEnabled | { enabledAnalyticsEventCollections: AnalyticsEventCollections }) } } // End of DataEvaluationOptions // Start of FormHandlerErrorResponseBody declare namespace saasquatch.FormHandlerErrorResponseBody { /** * The error message */ export type Error = string /** * The error code defined by the integration */ export type ErrorCode = string /** * The response body from a form handler when there is a catastrophic error */ export interface FormHandlerErrorResponseBody { error: Error errorCode?: ErrorCode } } // End of FormHandlerErrorResponseBody // Start of FormHandlerInitialDataResponseBody declare namespace saasquatch.FormHandlerInitialDataResponseBody { /** * The response body of a form handler for an INITIAL_DATA request */ export interface FormHandlerInitialDataResponseBody { inputData?: InputData } /** * The input data for initial data from this form handler */ export interface InputData { [k: string]: unknown } } // End of FormHandlerInitialDataResponseBody // Start of FormHandlerIntrospectionResponseBody declare namespace saasquatch.FormHandlerIntrospectionResponseBody { /** * Actions to be performed */ export type Actions = { name: string description?: string }[] /** * Information about the input data */ export type InputDataInformation = { name: string description?: string }[] /** * The response body of a form handler for an INTROSPECTION request */ export interface FormHandlerIntrospectionResponseBody { actions?: Actions inputData?: InputDataInformation inputDataSchema?: InputDataSchema } /** * JSON schema of the input data */ export interface InputDataSchema { [k: string]: unknown } } // End of FormHandlerIntrospectionResponseBody // Start of FormHandlerRequestBody declare namespace saasquatch.FormHandlerRequestBody { /** * The type of this request */ export type RequestType = ("SUBMIT" | "VALIDATE" | "INTROSPECTION" | "INITIAL_DATA") /** * The tenant alias of the request form */ export type TenantAlias = string /** * The key of the form */ export type FormKey = string /** * The ID of the form submission record to be saved */ export type FormSubmissionRecordID = string /** * The date this form was submitted at */ export type DateSubmitted = number /** * The user's unique identifier */ export type UserId = string /** * The user's unique account identifier */ export type AccountId = string /** * The user's first name */ export type FirstName = string /** * The user's last name */ export type FirstName1 = string /** * The user's email address */ export type Email = string /** * The user's locale */ export type Locale = string /** * The user's country code */ export type CountryCode = string /** * The user's locale */ export type Locale1 = string export type LanguageCode = string export type CountryCode1 = string /** * The user's segments */ export type Segments = string[] /** * The POST request body sent to form handlers */ export interface FormHandlerRequestBodySchema { type?: RequestType tenantAlias: TenantAlias form: Form formData: FormData formSubmissionRecordId: FormSubmissionRecordID dateSubmitted: DateSubmitted integrationConfig?: IntegrationConfiguration user?: User } /** * The form details */ export interface Form { key: FormKey integrationConfig?: IntegrationConfig } /** * The integration configuration for this form */ export interface IntegrationConfig { [k: string]: unknown } /** * The form data */ export interface FormData { [k: string]: unknown } /** * Global integration configuration */ export interface IntegrationConfiguration { [k: string]: unknown } /** * The user sending the form request */ export interface User { id: UserId accountId: AccountId firstName?: FirstName lastName?: FirstName1 email?: Email locale?: Locale countryCode?: CountryCode localization?: UserLocalization referralCodes?: ReferralCodes customFields?: CustomFields segments?: Segments } /** * The user's localization information */ export interface UserLocalization { locale?: Locale1 language?: Language country?: Country [k: string]: unknown } /** * The user's language */ export interface Language { languageCode?: LanguageCode [k: string]: unknown } /** * The user's country */ export interface Country { countryCode?: CountryCode1 [k: string]: unknown } /** * The user's referral codes */ export interface ReferralCodes { [k: string]: unknown } /** * The user's custom fields */ export interface CustomFields { [k: string]: unknown } } // End of FormHandlerRequestBody // Start of FormHandlerSubmitResponseBody declare namespace saasquatch.FormHandlerSubmitResponseBody { /** * Whether this result is successful */ export type Success = boolean /** * The message of this result */ export type Message = string /** * A list of descriptive result messages * * @maxItems 100 */ export type Results = { success: Success message: Message /** * Optional form handler submission response data */ data?: { [k: string]: unknown } }[] /** * The response body of a form handler for a SUBMIT request */ export interface FormHandlerSubmitResponseBody { results: Results } } // End of FormHandlerSubmitResponseBody // Start of FormHandlerValidateResponseBody declare namespace saasquatch.FormHandlerValidateResponseBody { /** * Whether the form data is valid */ export type Valid = boolean /** * The relative location of the validating keyword that follows the validation path */ export type KeywordRelativeLocation = string /** * The location of the JSON value within the instance being validated */ export type InstanceLocation = string /** * The error message produced by the validation */ export type Error = string /** * The form data validation errors * * @maxItems 100 */ export type Errors = { keywordLocation?: KeywordRelativeLocation instanceLocation?: InstanceLocation error: Error }[] /** * The response body of a form handler for a VALIDATE request */ export interface FormHandlerValidateResponseBody { valid: Valid errors?: Errors } } // End of FormHandlerValidateResponseBody // Start of HostedPortalConfig declare namespace saasquatch.HostedPortalConfig { /** * Enable the hosted portal */ export type Enabled = boolean /** * The domain the hosted portal is hosted on */ export type Domain = string /** * The HTML to be injected into the element of the hosted portal */ export type HeadHTML = string /** * The widget key of the hosted portal */ export type WidgetKey = string /** * A list of NPM resources to load into the widget */ export type Dependencies = { /** * An NPM package name or scoped package */ package: string /** * An NPM version string, such as Patch releases: 1.0 or 1.0.x or ~1.0.4 Minor releases: 1 or 1.x or ^1.0.4 Major releases: * or x */ version: string /** * The path to a resource in the specified package */ filePath?: string }[] /** * The URL path for the 404 Not Found page */ export type NotFoundURLPath = string /** * The Google OAuth SDK Client ID configured for the client */ export type GoogleOAuthSDKClientID = string export interface HostedPortalConfig { enabled: Enabled domain?: Domain headHtml?: HeadHTML brandingConfig?: BrandingConfig widgetKey?: WidgetKey dependencies?: Dependencies notFoundUrlPath?: NotFoundURLPath googleOAuthSdkClientId?: GoogleOAuthSDKClientID } export interface BrandingConfig { [k: string]: unknown } } // End of HostedPortalConfig // Start of HtmlEmail declare namespace saasquatch.HtmlEmail { export type FromName = string export type FromAddress = string export type Subject = string export type BCC = string[] /** * Raw HTML content that can use {{mergeTags}} from handlebars */ export type HTMLContent = string /** * Defines the customization points available in an HTML body email template. */ export interface HTMLEmailTemplateSchema { meta: Email htmlContent: HTMLContent jsonContent?: JSONContent } export interface Email { fromName: FromName fromAddress: FromAddress subject: Subject bcc?: BCC } /** * The JSON content for the email editor */ export interface JSONContent { [k: string]: unknown } } // End of HtmlEmail // Start of HtmlWidget declare namespace saasquatch.HtmlWidget { /** * Raw HTML content that can use web components. */ export type HTMLTemplate = string /** * Whether this widget should automatically popup on page load */ export type AutoPopup = boolean /** * Defines a web-component based widget template that uses vanilla HTML. */ export interface HTMLWidgetTemplateSchema { meta?: TemplateMeta htmlTemplate: HTMLTemplate autoPopup?: AutoPopup brandingConfig?: BrandingConfig } export interface TemplateMeta { /** * A list of NPM resources to load into the widget */ dependencies?: NpmDependency[] /** * A list of component editors used in editing the widget */ plugins?: NpmDependency[] } /** * This interface was referenced by `HTMLWidgetTemplateSchema`'s JSON-Schema * via the `definition` "npmDependency". */ export interface NpmDependency { /** * An NPM package name or scoped package */ package: string /** * An NPM version string, such as Patch releases: 1.0 or 1.0.x or ~1.0.4 Minor releases: 1 or 1.x or ^1.0.4 Major releases: * or x */ version: string /** * The path to a resource in the specified package */ filePath?: string [k: string]: unknown } export interface BrandingConfig { [k: string]: unknown } } // End of HtmlWidget // Start of IntegrationConfig declare namespace saasquatch.IntegrationConfig { /** * The webhook destination */ export type EndpointUrl = string /** * The name of the webhook (e.g. Stripe Integration Entry Point) */ export type Name = string /** * Webhook types accepted by this webhook endpoint */ export type WebhookTypes = ("coupon.created" | "reward.created" | "email.referral.started" | "email.referred.reward.earned" | "email.referral.paid" | "user.created" | "theme.publish.finished" | "email.referral.rewardLimitReached" | "export.created" | "export.completed" | "referral.started" | "referral.converted" | "referral.ended" | "referral.automoderation.complete" | "user.reward.balance.changed")[] /** * A list of webhooks managed by this integration */ export type ManagedWebhooks = ManagedWebhook[] /** * The link interceptor POST endpoint URL */ export type EndpointUrl1 = string /** * The name of the link interceptor */ export type Name1 = string /** * The order of this link interceptor among other link interceptors */ export type Order = number /** * A list of link interceptors managed by this integration */ export type ManagedLinkInterceptors = ManagedLinkInterceptor[] /** * The form handler POST endpoint URL */ export type EndpointUrl2 = string /** * The name of the form handler */ export type Name2 = string /** * The custom field key */ export type Key = string /** * The human readable name of the custom field */ export type Name3 = string /** * A list of custom fields managed by this integration */ export type ManagedCustomFields = ManagedCustomField[] /** * The user event key */ export type Key1 = string /** * The human readable name of the user event key */ export type Name4 = string /** * A list of user events managed by this integration */ export type ManagedUserEvents = ManagedUserEventMeta[] export type RewardUnit = string /** * A list of reward units fulfilled by this integration */ export type FulfilledRewardUnits = RewardUnit[] /** * The schema used to generate integration configuration in Contentful */ export interface IntegrationConfiguration { webhooks?: ManagedWebhooks linkInterceptors?: ManagedLinkInterceptors formHandler?: ManagedFormHandler customFields?: ManagedCustomFields userEvents?: ManagedUserEvents fulfilledRewardUnits?: FulfilledRewardUnits } /** * Configuration for setting up a webhook * * This interface was referenced by `IntegrationConfiguration`'s JSON-Schema * via the `definition` "webhook". */ export interface ManagedWebhook { endpointUrl: EndpointUrl name: Name webhookTypes?: WebhookTypes } /** * Configuration for a link interceptor * * This interface was referenced by `IntegrationConfiguration`'s JSON-Schema * via the `definition` "linkInterceptor". */ export interface ManagedLinkInterceptor { endpointUrl: EndpointUrl1 name: Name1 order: Order } /** * Configuration for a form handler * * This interface was referenced by `IntegrationConfiguration`'s JSON-Schema * via the `definition` "formHandler". */ export interface ManagedFormHandler { endpointUrl: EndpointUrl2 name: Name2 } /** * Configuration for a custom field * * This interface was referenced by `IntegrationConfiguration`'s JSON-Schema * via the `definition` "customField". */ export interface ManagedCustomField { key: Key name?: Name3 schema?: Schema } /** * The JSON Schema for the values of this custom field */ export interface Schema { [k: string]: unknown } /** * This interface was referenced by `IntegrationConfiguration`'s JSON-Schema * via the `definition` "userEventMeta". */ export interface ManagedUserEventMeta { key: Key1 name?: Name4 fieldsSchema?: Schema1 } /** * The JSON Schema for the user event fields */ export interface Schema1 { [k: string]: unknown } } // End of IntegrationConfig // Start of AppsFlyerIntegrationConfig declare namespace saasquatch.AppsFlyerIntegrationConfig { /** * The AppsFlyer link configured for this tenant */ export type AppsFlyerLink = string /** * Configuration setting for the AppsFlyer integration */ export interface AppsFlyerIntegrationConfiguration { appsflyerLink?: AppsFlyerLink [k: string]: unknown } } // End of AppsFlyerIntegrationConfig // Start of LinkInterceptorRequestBody declare namespace saasquatch.LinkInterceptorRequestBody { /** * Tenant from which the given shareLink is from */ export type TenantAlias = string /** * The Id of the program the given shareLink is from */ export type ProgramId = string /** * The Referrers code that will be used by the referred for the referral */ export type ReferralCode = string /** * The referrer's shareLink clicked by the referred for the referral */ export type ShareLink = string /** * The user's unique identifier */ export type UserId = string /** * The user's unique account identifier */ export type AccountId = string /** * The user's first name */ export type FirstName = string /** * The user's last name */ export type FirstName1 = string /** * The user's email address */ export type Email = string /** * The URL to an image of this user */ export type ImageUrl = string /** * The link that the user would be redirected to in absence of an integration */ export type DownStreamLink = string /** * The original signup URL configured by the program which has not been changed or processed by any integrations */ export type SignupLink = string /** * Sent when a shareLink is clicked and the Link Interceptor is on */ export interface LinkInterceptorPOSTRequestSchema { tenantAlias?: TenantAlias programId?: ProgramId referralCode?: ReferralCode shareLink?: ShareLink /** * The Referrer user who is associated with the shareLink that was clicked on */ referrer?: { id?: UserId accountId?: AccountId firstName?: FirstName lastName?: FirstName1 email?: Email imageUrl?: ImageUrl [k: string]: unknown } integrationConfig?: IntegrationConfiguration downstreamUrl?: DownStreamLink signupUrl?: SignupLink urlParams?: URLParameters [k: string]: unknown } /** * Configuration setting for the integration */ export interface IntegrationConfiguration { [k: string]: unknown } /** * The URL parameters SaaSquatch backend would be attaching to the signupUrl */ export interface URLParameters { [k: string]: unknown } } // End of LinkInterceptorRequestBody // Start of LinkInterceptorResponseBody declare namespace saasquatch.LinkInterceptorResponseBody { /** * Either the downstream from the POST request or a link that was created/manipulated by the Link Interceptor */ export type Link = string /** * The response sent back when a POST request is sent to the integration */ export interface LinkInterceptorPOSTResponseSchema { redirectUrl: Link } } // End of LinkInterceptorResponseBody // Start of IntegrationTemplate declare namespace saasquatch.IntegrationTemplate { /** * The name of this integration */ export type Name = string /** * The Auth0 client Id corresponding to this integration */ export type ClientId = string /** * A URL to the UI to be presented for configuring this integration */ export type ConfigUrl = string /** * A description of what this integration supports (presented on the integrations page) */ export type Description = string /** * The webhook destination */ export type EndpointUrl = string /** * The name of the webhook (e.g. Stripe Integration Entry Point) */ export type Name1 = string /** * Webhook types accepted by this webhook endpoint */ export type WebhookTypes = ("coupon.created" | "reward.created" | "email.referral.started" | "email.referred.reward.earned" | "email.referral.paid" | "user.created" | "theme.publish.finished" | "email.referral.rewardLimitReached" | "export.created" | "export.completed" | "referral.started" | "referral.converted" | "referral.ended" | "referral.automoderation.complete" | "user.reward.balance.changed")[] /** * A list of webhooks managed by this integration */ export type ManagedWebhooks = ManagedWebhook[] /** * The link interceptor POST endpoint URL */ export type EndpointUrl1 = string /** * The name of the link interceptor */ export type Name2 = string /** * The order of this link interceptor among other link interceptors */ export type Order = number /** * A list of link interceptors managed by this integration */ export type ManagedLinkInterceptors = ManagedLinkInterceptor[] /** * The form handler POST endpoint URL */ export type EndpointUrl2 = string /** * The name of the form handler */ export type Name3 = string /** * The custom field key */ export type Key = string /** * The human readable name of the custom field */ export type Name4 = string /** * A list of custom fields managed by this integration */ export type ManagedCustomFields = ManagedCustomField[] /** * The user event key */ export type Key1 = string /** * The human readable name of the user event key */ export type Name5 = string /** * A list of user events managed by this integration */ export type ManagedUserEvents = ManagedUserEventMeta[] export type RewardUnit = string /** * A list of reward units fulfilled by this integration */ export type FulfilledRewardUnits = RewardUnit[] /** * A logo representing this integration (presented on the integrations page) */ export type Logo = string /** * A descriptive heading title for this integration (presented on the integrations page) */ export type PanelHeading = string /** * Indicates whether this integration can be installed by any tenant */ export type GloballyInstallable = boolean /** * The tenants that can install this integration if it's not globally installable */ export type InstallableByTenants = (TenantAlias[] | null) /** * The tenant alias for a tenant that can install this integration */ export type TenantAlias = string /** * The integration template supported by Contentful */ export interface IntegrationTemplate { name: Name clientId: ClientId configUrl: ConfigUrl description: Description integrationConfig?: IntegrationConfig logo: Logo panelHeading: PanelHeading globallyInstallable?: GloballyInstallable installableByTenants?: InstallableByTenants } /** * Common integration JSON configuration to reflect how this integration interacts with SaaSquatch */ export interface IntegrationConfig { webhooks?: ManagedWebhooks linkInterceptors?: ManagedLinkInterceptors formHandler?: ManagedFormHandler customFields?: ManagedCustomFields userEvents?: ManagedUserEvents fulfilledRewardUnits?: FulfilledRewardUnits } /** * Configuration for setting up a webhook * * This interface was referenced by `IntegrationConfig`'s JSON-Schema * via the `definition` "webhook". */ export interface ManagedWebhook { endpointUrl: EndpointUrl name: Name1 webhookTypes?: WebhookTypes } /** * Configuration for a link interceptor * * This interface was referenced by `IntegrationConfig`'s JSON-Schema * via the `definition` "linkInterceptor". */ export interface ManagedLinkInterceptor { endpointUrl: EndpointUrl1 name: Name2 order: Order } /** * Configuration for a form handler * * This interface was referenced by `IntegrationConfig`'s JSON-Schema * via the `definition` "formHandler". */ export interface ManagedFormHandler { endpointUrl: EndpointUrl2 name: Name3 } /** * Configuration for a custom field * * This interface was referenced by `IntegrationConfig`'s JSON-Schema * via the `definition` "customField". */ export interface ManagedCustomField { key: Key name?: Name4 schema?: Schema } /** * The JSON Schema for the values of this custom field */ export interface Schema { [k: string]: unknown } /** * This interface was referenced by `IntegrationConfig`'s JSON-Schema * via the `definition` "userEventMeta". */ export interface ManagedUserEventMeta { key: Key1 name?: Name5 fieldsSchema?: Schema1 } /** * The JSON Schema for the user event fields */ export interface Schema1 { [k: string]: unknown } } // End of IntegrationTemplate // Start of ReferralImportLine declare namespace saasquatch.ReferralImportLine { /** * This user's unique identifier */ export type UserId = string /** * The unique identifier of the account this user belongs to */ export type AccountId = string /** * This user's unique identifier */ export type UserId1 = string /** * The unique identifier of the account this user belongs to */ export type AccountId1 = string export type ProgramId = string export type DateReferralStarted = number export type DateConverted = number /** * Defines the reward API data input structure. */ export type RewardAPIInput = (({ type: "PCT_DISCOUNT" discountPercent: DiscountPercent name?: RewardName dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate programRewardKey?: RewardKey dateGiven?: DateGiven userId?: UserId2 accountId?: AccountId2 } | { type: "FUELTANK" fuelTankCode: FuelTankCode unit?: Unit amount: Amount dateExpires?: RewardExpiryDate fuelTankType: FuelTankType cancellable?: Cancellable programRewardKey?: RewardKey1 dateGiven?: DateGiven1 userId?: UserId3 accountId?: AccountId3 } | { type: "CREDIT" unit: Unit name?: RewardName assignedCredit: AssignedCredit dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate redemptions?: Redemptions programRewardKey?: RewardKey2 dateGiven?: DateGiven2 userId?: UserId4 accountId?: AccountId4 } | { type: "INTEGRATION" unit: Unit name?: RewardName description?: RewardDescription valueInCents: RewardAmount integrationSettings: IntegrationSettings programRewardKey?: RewardKey3 dateGiven?: DateGiven3 userId?: UserId5 accountId?: AccountId5 }) & { type?: RewardType [k: string]: unknown }) /** * The discount associated with this reward */ export type DiscountPercent = number /** * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "rewardName". */ export type RewardName = (string | null) /** * The date this reward will expire * * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "rewardDateExpires". */ export type RewardExpiryDate = (number | null) /** * Whether this reward can be cancelled * * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "rewardCancellable". */ export type Cancellable = (boolean | null) /** * If the reward is created in a PENDING state this is the date we will attempt to 'give' it * * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "rewardDateScheduledFor". */ export type ScheduledRewardGivenDate = (number | null) export type RewardKey = string export type DateGiven = number export type UserId2 = string export type AccountId2 = string /** * The associated coupon code uploaded via the fuel tank API or portal code manager */ export type FuelTankCode = string /** * The unit of credit associated with this reward (i.e. months or usd) * * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "rewardUnit". */ export type Unit = string /** * The amount of credit or discount to be given */ export type Amount = string /** * The type of fuel tank reward being given */ export type FuelTankType = ("PCT_DISCOUNT" | "CREDIT") export type RewardKey1 = string export type DateGiven1 = number export type UserId3 = string export type AccountId3 = string /** * The initial redeemable credit assigned to be assigned to reward */ export type AssignedCredit = number export type RedeemedAmount = number export type DateRedeemed = number /** * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "redemptions". */ export type Redemptions = { quantityRedeemed: RedeemedAmount dateRedeemed?: DateRedeemed }[] export type RewardKey2 = string export type DateGiven2 = number export type UserId4 = string export type AccountId4 = string /** * This text describes the integration reward given in more detail */ export type RewardDescription = string /** * The value in base currency unit (i.e. cents) to be assigned to this reward */ export type RewardAmount = string export type EmailTemplateID = string export type RewardKey3 = string export type DateGiven3 = number export type UserId5 = string export type AccountId5 = string export type RewardType = ("PCT_DISCOUNT" | "FUELTANK" | "CREDIT" | "INTEGRATION") /** * The unit of credit associated with this reward (i.e. months or usd) * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardUnit". */ export type Unit1 = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardName". */ export type RewardName1 = (string | null) /** * The date this reward will expire * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateExpires". */ export type RewardExpiryDate1 = (number | null) /** * Whether this reward can be cancelled * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardCancellable". */ export type Cancellable1 = (boolean | null) /** * If the reward is created in a PENDING state this is the date we will attempt to 'give' it * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateScheduledFor". */ export type ScheduledRewardGivenDate1 = (number | null) export type EmailTemplateID1 = string /** * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "rewards". */ export type Rewards = RewardAPIInput[] /** * Represents the schema for a single line of the referral import JSONL file */ export interface ReferralImportLine { referrerUser: UserIdentifierSchema referredUser: UserIdentifierSchema1 programId: ProgramId dateReferralStarted?: DateReferralStarted dateConverted?: DateConverted rewards?: Rewards } /** * The unique identifiers used to distinguish a user. */ export interface UserIdentifierSchema { id: UserId accountId: AccountId } /** * The unique identifiers used to distinguish a user. */ export interface UserIdentifierSchema1 { id: UserId1 accountId: AccountId1 } /** * This interface was referenced by `ReferralImportLine`'s JSON-Schema * via the `definition` "integrationSettings". */ export interface IntegrationSettings { templateId?: EmailTemplateID giftId?: string utid?: string [k: string]: unknown } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "integrationSettings". */ export interface IntegrationSettings1 { templateId?: EmailTemplateID1 giftId?: string utid?: string [k: string]: unknown } } // End of ReferralImportLine // Start of UserEventImportLine declare namespace saasquatch.UserEventImportLine { export type UserID = string export type AccountID = string export type IdempotencyKey = string export type EventKey = string export type DateTriggered = number /** * Represents the schema for a single line of the user event import JSONL file */ export interface UserEventImportLine { userId: UserID accountId: AccountID idempotencyKey?: IdempotencyKey event: Event } export interface Event { key: EventKey dateTriggered?: DateTriggered fields?: EventFields } export interface EventFields { [k: string]: unknown } } // End of UserEventImportLine // Start of UserImportLine declare namespace saasquatch.UserImportLine { export type UserIdentifier = string export type AccountIdentifier = string export type PaymentProviderIdentifierClassicOnly = string export type FirstName = string export type LastName = string export type TimeZone = string export type UserIsReferable = boolean export type ReferralCodeClassicOnly = string /** * The primary referral code associated with the programId key * * This interface was referenced by `ReferralCodes`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export type ReferralCode = string /** * The shareLink to be primary for the associated programId key * * This interface was referenced by `ShareLinks`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export type ShareLink = string export type Code = string export type IsConvertedClassicOnly = string export type ReferredByCodes = string[] export type ImageURL = null export type Locale = string export type Email = string export type DateCreated = number /** * Represents the schema for a single line of the user import JSONL file */ export interface UserImportLine { id: UserIdentifier accountId: AccountIdentifier paymentProviderId?: PaymentProviderIdentifierClassicOnly firstName?: FirstName lastName?: LastName customFields?: { timeZone?: TimeZone [k: string]: unknown } referable?: UserIsReferable referralCode?: ReferralCodeClassicOnly referralCodes?: ReferralCodes shareLinks?: ShareLinks referredBy?: { code?: Code isConverted?: IsConvertedClassicOnly [k: string]: unknown } referredByCodes?: ReferredByCodes imageUrl?: ImageURL locale?: Locale email?: Email dateCreated?: DateCreated [k: string]: unknown } /** * A map of programs to referral codes. */ export interface ReferralCodes { [k: string]: ReferralCode } /** * A map of programs to shareLinks. * * This interface was referenced by `UserImportLine`'s JSON-Schema * via the `definition` "shareLinks". */ export interface ShareLinks { [k: string]: ShareLink } } // End of UserImportLine // Start of JSOptions declare namespace saasquatch.JSOptions { export type DefaultWidgetType = string /** * Defines how squatch js interacts. */ export interface JSOptionsSchema { widget?: { defaultWidgetType?: DefaultWidgetType [k: string]: unknown } conversionUrls?: string[] widgetUrlMappings?: { url?: string showAsCTA?: boolean displayOnLoad?: boolean widgetType?: string [k: string]: unknown }[] fuelTankAutofillUrls?: { url?: string formSelector?: string [k: string]: unknown }[] [k: string]: unknown } } // End of JSOptions // Start of ManagedIdentityConfig declare namespace saasquatch.ManagedIdentityConfig { /** * Enable managed identity */ export type Enabled = boolean /** * The Google Identity tenant ID */ export type FirebaseAuthTenantID = string /** * The email key used for reset password emails */ export type ResetPasswordEmailKey = string /** * The email key used for verification emails */ export type VerifyEmailEmailKey = string /** * The source of id and accountId for new users, email or firebase uid */ export type IDMethod = ("EMAIL" | "UID" | "HASHED_EMAIL") /** * The prefix added to new users' id and accountId */ export type IDPrefix = string /** * Prevent new users from being created via managed identity. Only works with 'EMAIL' ID Method */ export type DisallowNewUsers = boolean /** * The URL of a handler for external processing of registration, authentication, and session data */ export type ManagedIdentityHandlerURL = string /** * A JSONata expression for transforming registration form data into a user upsert body */ export type UserUpsertTransformer = string export interface ManagedIdentityConfig { enabled: Enabled firebaseAuthTenantId?: FirebaseAuthTenantID resetPasswordEmailKey?: ResetPasswordEmailKey verifyEmailEmailKey?: VerifyEmailEmailKey idMethod?: IDMethod idPrefix?: IDPrefix disallowNewUsers?: DisallowNewUsers managedIdentityHandlerUrl?: ManagedIdentityHandlerURL userUpsertTransformer?: UserUpsertTransformer } } // End of ManagedIdentityConfig // Start of MicrositeLayoutConfigValues declare namespace saasquatch.MicrositeLayoutConfigValues { /** * The HTML template */ export type HTML = string export interface MicrositeLayoutConfigValues { html: HTML } } // End of MicrositeLayoutConfigValues // Start of MicrositePageConfigValues declare namespace saasquatch.MicrositePageConfigValues { /** * The HTML page title */ export type Title = string /** * The HTML page description */ export type Description = string /** * The HTML template */ export type HTML = string export interface MicrositePageConfigValues { title: Title description?: Description html: HTML } } // End of MicrositePageConfigValues // Start of MicrositeTemplate declare namespace saasquatch.MicrositeTemplate { /** * Enable the hosted portal */ export type Enabled = boolean /** * The domain the hosted portal is hosted on */ export type Domain = string /** * The HTML to be injected into the element of the hosted portal */ export type HeadHTML = string /** * The widget key of the hosted portal */ export type WidgetKey = string /** * A list of NPM resources to load into the widget */ export type Dependencies = { /** * An NPM package name or scoped package */ package: string /** * An NPM version string, such as Patch releases: 1.0 or 1.0.x or ~1.0.4 Minor releases: 1 or 1.x or ^1.0.4 Major releases: * or x */ version: string /** * The path to a resource in the specified package */ filePath?: string }[] /** * The URL path for the 404 Not Found page */ export type NotFoundURLPath = string /** * The Google OAuth SDK Client ID configured for the client */ export type GoogleOAuthSDKClientID = string /** * Enable managed identity */ export type Enabled1 = boolean /** * The Google Identity tenant ID */ export type FirebaseAuthTenantID = string /** * The email key used for reset password emails */ export type ResetPasswordEmailKey = string /** * The email key used for verification emails */ export type VerifyEmailEmailKey = string /** * The source of id and accountId for new users, email or firebase uid */ export type IDMethod = ("EMAIL" | "UID" | "HASHED_EMAIL") /** * The prefix added to new users' id and accountId */ export type IDPrefix = string /** * Prevent new users from being created via managed identity. Only works with 'EMAIL' ID Method */ export type DisallowNewUsers = boolean /** * The URL of a handler for external processing of registration, authentication, and session data */ export type ManagedIdentityHandlerURL = string /** * A JSONata expression for transforming registration form data into a user upsert body */ export type UserUpsertTransformer = string export type FromName = string export type FromAddress = string export type Subject = string export type BCC = string[] /** * Raw HTML content that can use {{mergeTags}} from handlebars */ export type HTMLContent = string /** * The HTML template */ export type HTML = string /** * The HTML page title */ export type Title = string /** * The HTML page description */ export type Description = string /** * The HTML template */ export type HTML1 = string /** * Defines the schema for a microsite auto-setup template */ export interface MicrositeTemplateSchema { /** * A unique identifier for this template */ key: string /** * The name of this template */ name: string /** * A brief description of this template */ description: string hostedPortalConfig: HostedPortalConfig managedIdentityConfig: ManagedIdentityConfig tenantSettings?: { usTaxNotificationEmailKey?: string [k: string]: unknown } /** * The emails to be created by this template */ emails: { /** * The global email key */ key: string values: HTMLEmailTemplateSchema }[] /** * The registration forms to be created by this template */ registrationForms: { key: string name: string globalConfig?: { [k: string]: unknown } }[] /** * The layouts to be created by this template */ layouts: { key: string name: string parentKey?: string values?: MicrositeLayoutConfigValues }[] /** * The pages to be created by this template */ pages: { key: string layoutKey: string urlPath: string allowedUsers: string disallowedUrlPath?: string values?: MicrositePageConfigValues }[] } export interface HostedPortalConfig { enabled: Enabled domain?: Domain headHtml?: HeadHTML brandingConfig?: BrandingConfig widgetKey?: WidgetKey dependencies?: Dependencies notFoundUrlPath?: NotFoundURLPath googleOAuthSdkClientId?: GoogleOAuthSDKClientID } export interface BrandingConfig { [k: string]: unknown } export interface ManagedIdentityConfig { enabled: Enabled1 firebaseAuthTenantId?: FirebaseAuthTenantID resetPasswordEmailKey?: ResetPasswordEmailKey verifyEmailEmailKey?: VerifyEmailEmailKey idMethod?: IDMethod idPrefix?: IDPrefix disallowNewUsers?: DisallowNewUsers managedIdentityHandlerUrl?: ManagedIdentityHandlerURL userUpsertTransformer?: UserUpsertTransformer } /** * Defines the customization points available in an HTML body email template. */ export interface HTMLEmailTemplateSchema { meta: Email htmlContent: HTMLContent jsonContent?: JSONContent } export interface Email { fromName: FromName fromAddress: FromAddress subject: Subject bcc?: BCC } /** * The JSON content for the email editor */ export interface JSONContent { [k: string]: unknown } export interface MicrositeLayoutConfigValues { html: HTML } export interface MicrositePageConfigValues { title: Title description?: Description html: HTML1 } } // End of MicrositeTemplate // Start of PredefinedReward declare namespace saasquatch.PredefinedReward { export type PredefiendReward = (({ rewardType?: "PCT_DISCOUNT" amount: DiscountPercent validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown } | { rewardType?: "CREDIT" amount: CreditAmount unit: Unit validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown } | (({ fuelTankType?: "PCT_DISCOUNT" amount: DiscountPercent1 validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown } | { fuelTankType?: "CREDIT" amount: CreditAmount1 unit: Unit1 [k: string]: unknown }) & { rewardType?: "FUELTANK" fuelTankType: RewardType validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown }) | { rewardType?: "INTEGRATION" amount: RewardAmount unit?: GiftCardType integrationId?: IntegrationIdentifier integrationSettings?: IntegrationSettings pendingDuration?: DurationRewardIsPending [k: string]: unknown }) & { rewardType: ("PCT_DISCOUNT" | "CREDIT" | "FUELTANK" | "INTEGRATION") key?: RewardKey [k: string]: unknown }) export type DiscountPercent = number /** * This interface was referenced by `Reward`'s JSON-Schema * via the `definition` "validityDuration". */ export type DurationRewardIsValid = string /** * This interface was referenced by `Reward`'s JSON-Schema * via the `definition` "pendingDuration". */ export type DurationRewardIsPending = string export type CreditAmount = number export type Unit = string export type DiscountPercent1 = number export type CreditAmount1 = number export type Unit1 = string export type RewardType = ("PCT_DISCOUNT" | "CREDIT") export type RewardAmount = number export type GiftCardType = string export type IntegrationIdentifier = string export type EmailTemplateID = string export type RewardKey = string /** * Establishes the available configuration for pre-defined. */ export interface PreDefinedRewardsSchema { reward?: PredefiendReward [k: string]: unknown } export interface IntegrationSettings { templateId?: EmailTemplateID giftId?: string utid?: string [k: string]: unknown } /** * This interface was referenced by `PreDefinedRewardsSchema`'s JSON-Schema * via the `definition` "reward". */ export interface Reward { [k: string]: unknown } } // End of PredefinedReward // Start of AfterUserCreatedOrUpdatedTriggerContext declare namespace saasquatch.AfterUserCreatedOrUpdatedTriggerContext { 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 } } // End of AfterUserCreatedOrUpdatedTriggerContext // Start of AfterUserEventProcessedTriggerContext declare namespace saasquatch.AfterUserEventProcessedTriggerContext { 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[] /** * The key of the evaluated event (e.g. purchase) */ export type EventKey = string /** * The date this event was created */ export type DateTriggered = number /** * The current time at the moment the program is evaluated */ export type TriggerTime = number /** * These variables are available for designing conversion rules for Event triggers */ export interface EventTriggerVariables { type?: "AFTER_USER_EVENT_PROCESSED" user?: UserData event?: Event time?: TriggerTime [k: string]: unknown } export interface UserData { 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 `EventTriggerVariables`'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 } /** * The variables for the event that triggered the program * * This interface was referenced by `EventTriggerVariables`'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 `EventTriggerVariables`'s JSON-Schema * via the `definition` "eventFieldsContext". */ export interface EventFields { [k: string]: unknown } } // End of AfterUserEventProcessedTriggerContext // Start of rules declare namespace saasquatch.rules { /** * 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 } } // End of rules // Start of ProgramTriggerVariableContext declare namespace saasquatch.ProgramTriggerVariableContext { /** * Defines the variables used for evaluating externally defined inputs (e.g. JSONata) */ export type ProgramTriggerVariables = ({ [k: string]: unknown } & { type?: TriggerType [k: string]: unknown }) /** * The reason the program was triggered (e.g. referral created, user changed something, etc.) */ export type TriggerType = ("AFTER_USER_CREATED_OR_UPDATED" | "SCHEDULED" | "REWARD_SCHEDULED" | "REFERRAL" | "AFTER_USER_EVENT_PROCESSED") /** * The key of the evaluated event (e.g. purchase) */ export type EventKey = string /** * The date this event was created */ export type DateTriggered = number /** * The variables for the event that triggered the program * * This interface was referenced by `undefined`'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 `undefined`'s JSON-Schema * via the `definition` "eventFieldsContext". */ export interface EventFields { [k: string]: unknown } /** * Defines how custom fields can be specified on a user. Allows alphanumeric numbers and underscores. * * This interface was referenced by `undefined`'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) } } // End of ProgramTriggerVariableContext // Start of ReferralTriggerContext declare namespace saasquatch.ReferralTriggerContext { 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[] /** * The unique identifier for this referral */ export type ReferralId3 = string /** * The date this referral was created (attributed) */ export type DateReferralStarted1 = number 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 total number of rewards earned by the referrer in this program */ export type TotalCount2 = number /** * The reward identifier */ export type RewardId2 = string /** * The date the reward was given */ export type DateGiven2 = (string | null) /** * The date the reward expires */ export type DateExpires2 = (string | null) /** * The date the reward was cancelled */ export type DateCancelled2 = (string | null) /** * The identifier of the program that generated this reward */ export type ProgramId2 = (string | null) /** * The reward key assigned by the program that generated this reward */ export type ProgramRewardKey2 = string /** * The referral identifier assocaited with this reward */ export type ReferralId4 = string /** * A list of the rewards earned by the referrer in this program. (up to 20) */ export type Rewards2 = Reward2[] /** * The reward identifier */ export type RewardId3 = string /** * The date the reward was given */ export type DateGiven3 = (string | null) /** * The date the reward expires */ export type DateExpires3 = (string | null) /** * The date the reward was cancelled */ export type DateCancelled3 = (string | null) /** * The identifier of the program that generated this reward */ export type ProgramId3 = (string | null) /** * The reward key assigned by the program that generated this reward */ export type ProgramRewardKey3 = string /** * The referral identifier assocaited with this reward */ export type ReferralId5 = string /** * A list of rewards associated with this referral */ export type ReferralRewards1 = Reward3[] /** * 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 a REFERRAL trigger */ export interface ReferralTriggerContext { type?: "REFERRAL" user?: CurrentUserData referral?: Referral time?: TriggerTime [k: string]: unknown } export interface CurrentUserData { 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 `ReferralTriggerContext`'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 } /** * The referral associated with this referral trigger */ export interface Referral { id?: ReferralId3 dateReferralStarted?: DateReferralStarted1 referrerUser?: Referrer1 rewards?: ReferralRewards1 [k: string]: unknown } export interface Referrer1 { 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 rewards?: Rewards1 [k: string]: unknown } export interface FraudFlag2 { type: FlagType2 message: FlagDescription2 } /** * Rewards earned in this program by the referrer */ export interface Rewards1 { totalCount?: TotalCount2 data?: Rewards2 [k: string]: unknown } /** * The set of reward fields */ export interface Reward2 { id?: RewardId2 dateGiven?: DateGiven2 dateExpires?: DateExpires2 dateCancelled?: DateCancelled2 programId?: ProgramId2 programRewardKey?: ProgramRewardKey2 referralId?: ReferralId4 [k: string]: unknown } /** * The set of reward fields */ export interface Reward3 { id?: RewardId3 dateGiven?: DateGiven3 dateExpires?: DateExpires3 dateCancelled?: DateCancelled3 programId?: ProgramId3 programRewardKey?: ProgramRewardKey3 referralId?: ReferralId5 [k: string]: unknown } /** * The variables for the event that triggered the program * * This interface was referenced by `ReferralTriggerContext`'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 `ReferralTriggerContext`'s JSON-Schema * via the `definition` "eventFieldsContext". */ export interface EventFields { [k: string]: unknown } } // End of ReferralTriggerContext // Start of RewardScheduledProgramTriggerContext declare namespace saasquatch.RewardScheduledProgramTriggerContext { 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[] /** * 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 a REWARD_SCHEDULED trigger */ export interface RewardScheduledTriggerVariables { type?: "REWARD_SCHEDULED" user?: User time?: TriggerTime [k: string]: unknown } export interface User { 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 `RewardScheduledTriggerVariables`'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 } /** * The variables for the event that triggered the program * * This interface was referenced by `RewardScheduledTriggerVariables`'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 `RewardScheduledTriggerVariables`'s JSON-Schema * via the `definition` "eventFieldsContext". */ export interface EventFields { [k: string]: unknown } } // End of RewardScheduledProgramTriggerContext // Start of ScheduledProgramTriggerContext declare namespace saasquatch.ScheduledProgramTriggerContext { 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[] /** * 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 a SCHEDULED trigger */ export interface ScheduledTriggerVariables { type?: "SCHEDULED" user?: CurrentUserData time?: TriggerTime [k: string]: unknown } export interface CurrentUserData { 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 `ScheduledTriggerVariables`'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 } /** * The variables for the event that triggered the program * * This interface was referenced by `ScheduledTriggerVariables`'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 `ScheduledTriggerVariables`'s JSON-Schema * via the `definition` "eventFieldsContext". */ export interface EventFields { [k: string]: unknown } } // End of ScheduledProgramTriggerContext // Start of ProgramAnalytics declare namespace saasquatch.ProgramAnalytics { /** * Set when the user achieves the program goal */ export type GoalCompletion = ("rewardCreated" | "rewardRedeemed") /** * Record the following revenue in analytics */ export type RevenueMultiplier = number /** * Defines the program analytics configuration. */ export interface ProgramAnalytics { goals: RevenueTrackingRules } /** * Defines the program goals and how they relate to projected revenue. */ export interface RevenueTrackingRules { event: GoalCompletion value: RevenueMultiplier } } // End of ProgramAnalytics // Start of ProgramMessages declare namespace saasquatch.ProgramMessages { /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "openGraph". */ export type ShareLinkOpenGraph = (OpenGraph & OpenGraph1) export type OpenGraph = ({ source: "HOSTED" title: Title description: Description image?: Image } | { source: "LANDING_PAGE" }) export type Title = string export type Description = string export type Image = string /** * @minItems 7 * @maxItems 7 */ export type ShareMessages = [Twitter, Email, Linkedin, Sms, Whatsapp, Linemessenger, Pinterest] export type XShareBody = string export type EmailShareSubject = string export type EmailShareBody = string export type LinkedInShareSubject = string export type LinkedInShareBody = string export type LinkedInURLImage = string export type SMSShareBody = string export type WhatsAppShareBody = string export type LineMessengerShareBody = string export type PinterestImageURL = string export type PinterestShareBody = string /** * Defines the configurable share messages provided by this program. */ export interface ProgramMessaging { shareLinkOpenGraph: ShareLinkOpenGraph messageLinkOpenGraph: ShareLinkOpenGraph messages: ShareMessages } export interface OpenGraph1 { source?: ("HOSTED" | "LANDING_PAGE") [k: string]: unknown } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "twitter". */ export interface Twitter { shareMedium?: "TWITTER" config?: X } export interface X { twitterShareBody: XShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "email". */ export interface Email { shareMedium?: "EMAIL" config?: Email1 } export interface Email1 { emailShareSubject: EmailShareSubject emailShareBody: EmailShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "linkedin". */ export interface Linkedin { shareMedium?: "LINKEDIN" config?: LinkedIn } export interface LinkedIn { linkedinShareSubject: LinkedInShareSubject linkedinShareBody: LinkedInShareBody linkedinShareImageURL?: LinkedInURLImage } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "sms". */ export interface Sms { shareMedium?: "SMS" config?: SMS } export interface SMS { smsShareBody: SMSShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "whatsapp". */ export interface Whatsapp { shareMedium?: "WHATSAPP" config?: WhatsApp } export interface WhatsApp { whatsAppShareBody: WhatsAppShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "linemessenger". */ export interface Linemessenger { shareMedium?: "LINEMESSENGER" config?: LineMessenger } export interface LineMessenger { lineMessengerShareBody: LineMessengerShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "pinterest". */ export interface Pinterest { shareMedium?: "PINTEREST" config?: Pinterest1 } export interface Pinterest1 { pinterestImageURL?: PinterestImageURL pinterestShareBody?: PinterestShareBody } } // End of ProgramMessages // Start of ProgramRequest declare namespace saasquatch.ProgramRequest { /** * The requests that will be sent from the backend to the program */ export type ProgramRequest = ((ProgramTrigger | ProgramValidation | ProgramIntrospection | ProgramTriggerVariablesSchemaRequest) & { messageType?: MessageType version?: RPCVersion [k: string]: unknown }) /** * The requirement key we're validating */ export type RequirementKey = string /** * The validations we're asking the program to perform for a given set of requirement keys and associated query results */ export type ValidationRequests = { key?: RequirementKey queryResult?: QueryResult }[] /** * The unique contentful ID associated with this program template */ export type ID = string /** * A human-readable name for the program. Dispayed in the SaaSquatch Portal during Program setup. */ export type ProgramName = string /** * A human-readable summary of the program. Dispayed in the SaaSquatch Portal during Program setup. */ export type ProgramSummary = string /** * A long-form article that sells the benefits of this program. Dispayed in the SaaSquatch Portal during Program setup. */ export type ProgramLongDescription = string /** * This describes how to setup the current program and may update depending on how you've configured your program rules */ export type ProgramInstallGuide = string /** * A unique key to identify this reward type. Only numbers and latin characers are allowed. Reward types must be unique within the scope of a program. e.g. `FirstPurchaseReward` */ export type Key = string /** * A human-readable name for the reward type that gets displayed in the SaaSquatch portal during program setup. e.g. `First Purchase Reward` */ export type Name = string /** * A human-readable description that explains this reward type. Displayed in the SaaSquatch portal during program setup. e.g. `This reward is given to people when they make their first purchase.` */ export type Description = string /** * A list of reward units this reward can potentially have */ export type Units = string[] /** * A list of all the possible types of rewards this program will give. Your business logic will trigger these based on key */ export type Rewards = RewardType[] /** * A unique key to identify this email type. Only numbers and latin characers are allowed. Email types must be unique within the scope of a program. e.g. `RewardCreatedEmail` */ export type Key1 = string /** * A human-readable name for the email type that gets displayed in the SaaSquatch portal during program setup. e.g. `Reward Created Email` */ export type Name1 = string /** * A human-readable description that explains this email type. Displayed in the SaaSquatch portal during program setup. e.g. `This email is sent when a new reward is created by this program` */ export type Description1 = string export type DefaultTemplateId = string export type FromName = string export type FromAddress = string export type Subject = string export type HeaderImage = string export type Header = string /** * Supports markdown and handlebars expressions. e.g. *bold* _underline_ and [link](https://example.com) */ export type Body = string export type DisplayCTAButton = boolean export type Text = string export type Link = string export type Footer = string export type FromName1 = string export type FromAddress1 = string export type Subject1 = string export type BCC = string[] /** * Raw HTML content that can use {{mergeTags}} from handlebars */ export type HTMLContent = string /** * A list of all the possible types of emails this program will send. Your business logic will trigger these based on key */ export type Emails = EmailType[] /** * The URL for the logo associated with this program */ export type LogoURL = string /** * A list of all the possible types of widgets this program will send. Your business logic will trigger these based on key */ export type Widgets = EmailType1[] /** * Indicates whether this program can be installed by any tenant that support GA */ export type GloballyInstallable = boolean /** * The tenants that can install this program if it's not globally installable */ export type InstallableByTenants = (TenantAlias[] | null) /** * The tenant alias for a tenant that can install this program */ export type TenantAlias = string export type Sharing = (({ enabled?: SharingEnabled linksConfig?: LinksConfiguration [k: string]: unknown } | (null & { enabled?: SharingEnabled linksConfig?: LinksConfiguration [k: string]: unknown })) & { enabled?: SharingEnabled linksConfig?: LinksConfiguration [k: string]: unknown }) /** * When sharing is enabled the program will create/support referral share links */ export type SharingEnabled = boolean /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "openGraph". */ export type ShareLinkOpenGraph = (({ source: "HOSTED" title: Title description: Description2 image?: Image } | { source: "LANDING_PAGE" }) & { source?: ("HOSTED" | "LANDING_PAGE") [k: string]: unknown }) export type Title = string export type Description2 = string export type Image = string /** * @minItems 7 * @maxItems 7 */ export type ShareMessages = [Twitter, Email2, Linkedin, Sms, Whatsapp, Linemessenger, Pinterest] export type XShareBody = string export type EmailShareSubject = string export type EmailShareBody = string export type LinkedInShareSubject = string export type LinkedInShareBody = string export type LinkedInURLImage = string export type SMSShareBody = string export type WhatsAppShareBody = string export type LineMessengerShareBody = string export type PinterestImageURL = string export type PinterestShareBody = string export type RecurringSchedule = (({ userFilter?: UserFilter /** * Your program logic will be run on this schedule. */ periodInHours?: number [k: string]: unknown } | (null & { userFilter?: UserFilter /** * Your program logic will be run on this schedule. */ periodInHours?: number [k: string]: unknown })) & { userFilter?: UserFilter /** * Your program logic will be run on this schedule. */ periodInHours?: number [k: string]: unknown }) /** * The backend schedules that will run at a specified interval and trigger the program for specified users */ export type ProgramSchedules = ({ type?: ScheduleType key?: ScheduleKey periodInHours?: PeriodInHours filter?: Filter query?: Query [k: string]: unknown }[] | null) /** * The type of schedule to run */ export type ScheduleType = ("USER" | "REWARD") /** * A unique identifier for this specific schedule */ export type ScheduleKey = string /** * The interval by which this schedule will run (e.g. every x hours) */ export type PeriodInHours = number /** * The query used to create the program context when a user is evaluated by the schedule */ export type Query = string /** * All of these conditions should be satisfied to confirm the program is working */ export type ProgramRequirements = (ProgramRequirement[] | null) /** * A unique identifier used to validate this requirement */ export type Key2 = string /** * The human-friendly name of this requirement */ export type Name2 = string /** * A description of how this requirement can be satisfied */ export type Description3 = string /** * Rich content regarding the implementation and other details relevant to this requirement */ export type LongDescription = string /** * The results of this query will be used to validate this requirement has been satisfied */ export type GraphQLQuery = (string | null) /** * These are passed in as parameters to the query */ export type GraphQLQueryVariables = ({ [k: string]: unknown } | null) /** * User metrics establish how aggregate functions can be used to update a custom user field with respect to an event. */ export type UserMetric = (({ aggregateId?: "SUM" aggregateRules?: SingleFieldWithWindowingAggregate [k: string]: unknown } | { aggregateId?: "COUNT" aggregateRules?: WindowingAggregate [k: string]: unknown } | { aggregateId?: "FIRST_SEEN" [k: string]: unknown } | { aggregateId?: "LAST_SEEN" [k: string]: unknown } | { aggregateId?: "FIRST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "LAST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "THROTTLED_LAST_NUMERIC_VALUE" aggregateRules?: { fieldName: FieldName diff?: ThrottleInterval } [k: string]: unknown }) & { customFieldKey: CustomField aggregateId: AggregateIdentifier dateTriggeredWindow?: DateTriggeredWindow userEventKey: UserEventKey filter?: Filter1 [k: string]: unknown }) /** * The field on which this aggregate will be performed. * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "fieldName". */ export type FieldName = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowing". */ export type Windowing = (({ type: "FIXED" unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") [k: string]: unknown } | { type: "SLIDING" duration: number unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") maxBucketValue?: number [k: string]: unknown }) & { type: ("FIXED" | "SLIDING") [k: string]: unknown }) /** * The minimum interval time that can elapse between recording the value of field name. Default is milliseconds per hour. */ export type ThrottleInterval = string /** * The name of the custom field associated with this metric. */ export type CustomField = string /** * An unique identifier for the aggregate operation to perform. */ export type AggregateIdentifier = ("SUM" | "COUNT" | "FIRST_SEEN" | "LAST_SEEN" | "FIRST_VALUE" | "LAST_VALUE" | "THROTTLED_LAST_NUMERIC_VALUE") /** * An ISO 8601 interval. The aggregate operation will only be performed between this window. */ export type DateTriggeredWindow = string /** * The event that will be aggregated by this metric. */ export type UserEventKey = string /** * A JSONata expression which will filter out non-matching events */ export type Filter1 = string /** * Custom metrics defined by this program that will only be activated when the program is live */ export type ProgramUserMetrics = UserMetric[] /** * The URL that will be requested for this program when triggered */ export type WebtaskURL = string /** * When an event with this key is received this program will be triggered. Deprecated in favour of userEventKeys. */ export type EventKey = string /** * A list of events that can trigger this program */ export type EventKeys = EventKey[] /** * When an event with this key is received this program will be triggered */ export type UserEventKey1 = string /** * A list of events that can trigger this program */ export type UserEventKeys = UserEventKey1[] /** * When a custom field with this key is received this program may perform mutations */ export type CustomFieldKey = string /** * A list of custom field keys that this program evaluates on */ export type CustomFieldKeys = CustomFieldKey[] /** * A JSONata script that transforms program rules JSON to be compatible with the most recently published schema version */ export type RulesMigrationScript = string /** * The program goal ID */ export type GoalID = string /** * The human readable name */ export type Name3 = string /** * Template of program goals provided by this program */ export type Goals = { goalId: GoalID name?: Name3 }[] /** * A unique key to identify this widget type. Only numbers and latin characers are allowed. Widget types must be unique within the scope of a program. e.g. `ReferrerWidget` */ export type Key3 = string /** * A human-readable name for the widget type that gets displayed in the SaaSquatch portal during program setup. e.g. `Referrer Widget` */ export type Name4 = string /** * A human-readable description that explains this widget type. Displayed in the SaaSquatch portal during program setup. e.g. `This widget is sent when a new reward is created by this program` */ export type Description4 = string /** * Raw HTML content that can use web components. */ export type HTMLTemplate = string /** * Whether this widget should automatically popup on page load */ export type AutoPopup = boolean /** * The unique program ID */ export type ProgramID = string export type PredefiendReward = (({ rewardType?: "PCT_DISCOUNT" amount: DiscountPercent validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown } | { rewardType?: "CREDIT" amount: CreditAmount unit: Unit validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown } | (({ fuelTankType?: "PCT_DISCOUNT" amount: DiscountPercent1 validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown } | { fuelTankType?: "CREDIT" amount: CreditAmount1 unit: Unit1 [k: string]: unknown }) & { rewardType?: "FUELTANK" fuelTankType: RewardType2 validityDuration?: DurationRewardIsValid pendingDuration?: DurationRewardIsPending [k: string]: unknown }) | { rewardType?: "INTEGRATION" amount: RewardAmount unit?: GiftCardType integrationId?: IntegrationIdentifier integrationSettings?: IntegrationSettings pendingDuration?: DurationRewardIsPending [k: string]: unknown }) & { rewardType: ("PCT_DISCOUNT" | "CREDIT" | "FUELTANK" | "INTEGRATION") key?: RewardKey [k: string]: unknown }) export type DiscountPercent = number /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "validityDuration". */ export type DurationRewardIsValid = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "pendingDuration". */ export type DurationRewardIsPending = string export type CreditAmount = number export type Unit = string export type DiscountPercent1 = number export type CreditAmount1 = number export type Unit1 = string export type RewardType2 = ("PCT_DISCOUNT" | "CREDIT") export type RewardAmount = number export type GiftCardType = string export type IntegrationIdentifier = string export type EmailTemplateID = string export type RewardKey = string /** * Rewards associated with this program */ export type ProgramRewards = PreDefinedRewardsSchema[] /** * A request for the programs trigger variables schema in case it is custom * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "programTriggerVariablesSchemaRequest". */ export type ProgramTriggerVariablesSchemaRequest = (ProgramTriggerVariablesSchemaRequest1 & ProgramTriggerVariablesSchemaRequest2) export type ProgramTriggerVariablesSchemaRequest1 = ({ triggerType?: "SCHEDULED" scheduleKey?: ScheduleKey1 [k: string]: unknown } | { triggerType?: TriggerType scheduleKey?: ScheduleKey2 [k: string]: unknown }) /** * Will match on the user schedule variables schema we're requesting */ export type ScheduleKey1 = string export type TriggerType = "REWARD_SCHEDULED" /** * Will match on the reward schedule variables schema we're requesting */ export type ScheduleKey2 = string /** * The type of request being made to the program */ export type MessageType = ("PROGRAM_TRIGGER" | "PROGRAM_VALIDATION" | "PROGRAM_INTROSPECTION" | "PROGRAM_TRIGGER_VARIABLES_SCHEMA_REQUEST") /** * The RPC version for this program request */ export type RPCVersion = string /** * A request for the program to evaluate a user for against its criteria (determines whether to reward/email/etc. the user) * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "programTrigger". */ export interface ProgramTrigger { messageType?: "PROGRAM_TRIGGER" [k: string]: unknown } /** * A request for the program to validate requirement query results * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "programValidation". */ export interface ProgramValidation { messageType?: "PROGRAM_VALIDATION" validationRequests?: ValidationRequests [k: string]: unknown } /** * The requests from running the query associated with this requirement key */ export interface QueryResult { [k: string]: unknown } /** * A request for the program to alter its template according to the provided program rules * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "programIntrospection". */ export interface ProgramIntrospection { messageType?: "PROGRAM_INTROSPECTION" template?: ProgramTemplateBuilder rules?: ProgramRulesDeprecated program?: Program [k: string]: unknown } /** * Build your program using the magic of magic! */ export interface ProgramTemplateBuilder { id?: ID name?: ProgramName summary?: ProgramSummary longDescription?: ProgramLongDescription installGuide?: ProgramInstallGuide rewards?: Rewards emails?: Emails logo?: LogoURL widgets?: Widgets globallyInstallable?: GloballyInstallable installableByTenants?: InstallableByTenants rules?: BusinessRuleVariables sharing?: Sharing schedule?: RecurringSchedule schedules?: ProgramSchedules settings?: { referrals?: { /** * Whether this program supports referrals */ enabled?: boolean [k: string]: unknown } [k: string]: unknown } rulesUISchema?: RulesUISchema requirements?: ProgramRequirements userMetrics?: ProgramUserMetrics url?: WebtaskURL trigger?: ProgramTriggers rulesMigrationScript?: RulesMigrationScript goals?: Goals } /** * A type of reward that is given by this program. */ export interface RewardType { key?: Key name?: Name description?: Description units?: Units [k: string]: unknown } /** * A type of email that is given by this program. */ export interface EmailType { key?: Key1 name?: Name1 description?: Description1 defaults?: (DefaultTemplateId | SimpleEmailTemplateSchema | HTMLEmailTemplateSchema) [k: string]: unknown } /** * Defines the customization points available in a Simple Email Template. */ export interface SimpleEmailTemplateSchema { meta: Email content: Content } export interface Email { fromName: FromName fromAddress: FromAddress subject: Subject } export interface Content { headerImage?: HeaderImage headerContent?: Header bodyContent: Body cta?: CallToAction footerContent?: Footer } export interface CallToAction { enabled?: DisplayCTAButton text?: Text link?: Link [k: string]: unknown } /** * Defines the customization points available in an HTML body email template. */ export interface HTMLEmailTemplateSchema { meta: Email1 htmlContent: HTMLContent jsonContent?: JSONContent } export interface Email1 { fromName: FromName1 fromAddress: FromAddress1 subject: Subject1 bcc?: BCC } /** * The JSON content for the email editor */ export interface JSONContent { [k: string]: unknown } /** * A type of email that is given by this program. * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "EmailType". */ export interface EmailType1 { key?: Key1 name?: Name1 description?: Description1 defaults?: (DefaultTemplateId | SimpleEmailTemplateSchema | HTMLEmailTemplateSchema) [k: string]: unknown } /** * The business rule variables define a JSON schema of the possible configuration points in the business logic. */ export interface BusinessRuleVariables { [k: string]: unknown } /** * Message links configuration (default share text/content for Open Graph/Twitter/etc) */ export interface LinksConfiguration { defaults?: ProgramMessaging [k: string]: unknown } /** * Defines the configurable share messages provided by this program. */ export interface ProgramMessaging { shareLinkOpenGraph: ShareLinkOpenGraph messageLinkOpenGraph: ShareLinkOpenGraph messages: ShareMessages } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "twitter". */ export interface Twitter { shareMedium?: "TWITTER" config?: X } export interface X { twitterShareBody: XShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "email". */ export interface Email2 { shareMedium?: "EMAIL" config?: Email3 } export interface Email3 { emailShareSubject: EmailShareSubject emailShareBody: EmailShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "linkedin". */ export interface Linkedin { shareMedium?: "LINKEDIN" config?: LinkedIn } export interface LinkedIn { linkedinShareSubject: LinkedInShareSubject linkedinShareBody: LinkedInShareBody linkedinShareImageURL?: LinkedInURLImage } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "sms". */ export interface Sms { shareMedium?: "SMS" config?: SMS } export interface SMS { smsShareBody: SMSShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "whatsapp". */ export interface Whatsapp { shareMedium?: "WHATSAPP" config?: WhatsApp } export interface WhatsApp { whatsAppShareBody: WhatsAppShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "linemessenger". */ export interface Linemessenger { shareMedium?: "LINEMESSENGER" config?: LineMessenger } export interface LineMessenger { lineMessengerShareBody: LineMessengerShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "pinterest". */ export interface Pinterest { shareMedium?: "PINTEREST" config?: Pinterest1 } export interface Pinterest1 { pinterestImageURL?: PinterestImageURL pinterestShareBody?: PinterestShareBody } /** * This should be a GraphQL-compatible query json object */ export interface UserFilter { [k: string]: unknown } /** * The filter used to determine which users are evaluated when the schedule is run */ export interface Filter { [k: string]: unknown } /** * Defines how the rules will be shown via schema form */ export interface RulesUISchema { [k: string]: unknown } /** * A condition that should be satified to confirm this program is working * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "Requirement". */ export interface ProgramRequirement { key: Key2 name: Name2 description: Description3 longDescription?: LongDescription query?: GraphQLQuery queryVariables?: GraphQLQueryVariables [k: string]: unknown } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldWithWindowingAggregate". */ export interface SingleFieldWithWindowingAggregate { fieldName: FieldName windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowingAggregate". */ export interface WindowingAggregate { windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldAggregate". */ export interface SingleFieldAggregate { fieldName: FieldName } /** * Defines specific triggers for this program */ export interface ProgramTriggers { eventKeys?: EventKeys userEventKeys?: UserEventKeys customFieldKeys?: CustomFieldKeys [k: string]: unknown } /** * A type of widget that is displayed by this program. * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "WidgetType". */ export interface WidgetType { key?: Key3 name?: Name4 description?: Description4 defaults?: HTMLWidgetTemplateSchema [k: string]: unknown } /** * Defines a web-component based widget template that uses vanilla HTML. */ export interface HTMLWidgetTemplateSchema { meta?: TemplateMeta htmlTemplate: HTMLTemplate autoPopup?: AutoPopup brandingConfig?: BrandingConfig } export interface TemplateMeta { /** * A list of NPM resources to load into the widget */ dependencies?: NpmDependency[] /** * A list of component editors used in editing the widget */ plugins?: NpmDependency[] } /** * This interface was referenced by `HTMLWidgetTemplateSchema`'s JSON-Schema * via the `definition` "npmDependency". */ export interface NpmDependency { /** * An NPM package name or scoped package */ package: string /** * An NPM version string, such as Patch releases: 1.0 or 1.0.x or ~1.0.4 Minor releases: 1 or 1.x or ^1.0.4 Major releases: * or x */ version: string /** * The path to a resource in the specified package */ filePath?: string [k: string]: unknown } export interface BrandingConfig { [k: string]: unknown } /** * A type of reward that is given by this program. * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "RewardType". */ export interface RewardType1 { key?: Key name?: Name description?: Description units?: Units [k: string]: unknown } /** * The rules configured for this program */ export interface ProgramRulesDeprecated { [k: string]: unknown } export interface Program { rules?: ProgramRules id?: ProgramID rewards?: ProgramRewards } /** * The rules configured for this program */ export interface ProgramRules { [k: string]: unknown } /** * Establishes the available configuration for pre-defined. */ export interface PreDefinedRewardsSchema { reward?: PredefiendReward [k: string]: unknown } export interface IntegrationSettings { templateId?: EmailTemplateID giftId?: string utid?: string [k: string]: unknown } export interface ProgramTriggerVariablesSchemaRequest2 { messageType?: "PROGRAM_TRIGGER_VARIABLES_SCHEMA_REQUEST" triggerType?: ("AFTER_USER_CREATED_OR_UPDATED" | "SCHEDULED" | "REWARD_SCHEDULED" | "REFERRAL" | "AFTER_USER_EVENT_PROCESSED") schema?: DefaultSchema [k: string]: unknown } /** * The default schema for the request, which will be overridden if necessary */ export interface DefaultSchema { [k: string]: unknown } } // End of ProgramRequest // Start of ProgramShareLinks declare namespace saasquatch.ProgramShareLinks { /** * If the program's primary link is a vanity link then this will be the unencoded link, if not it is the UNKNOWN engagement medium and UNKOWN share medium link */ export type CleanLinkForGivenProgram = string /** * Share link associated with the DIRECT share medium */ export type DirectShareLink = string /** * Links this user can share to make referrals */ export interface ProgramShareLinks { [k: string]: ProgramShareLink } /** * The primary share links available for this program * * This interface was referenced by `ProgramShareLinks`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export interface ProgramShareLink { cleanShareLink: CleanLinkForGivenProgram MOBILE: MobileShareLinks EMAIL: EmailShareLinks UNKNOWN: ShareLinks } /** * Share links tracked with the MOBILE engagement medium */ export interface MobileShareLinks { DIRECT: DirectShareLink } /** * Share links tracked with the EMAIL engagement medium */ export interface EmailShareLinks { DIRECT: DirectShareLink } /** * Share links tracked with the UNKNOWN engagement medium */ export interface ShareLinks { DIRECT: DirectShareLink } /** * This interface was referenced by `ProgramShareLinks`'s JSON-Schema * via the `definition` "subShareLinks". */ export interface SubShareLinks { DIRECT: DirectShareLink } } // End of ProgramShareLinks // Start of ProgramTemplate declare namespace saasquatch.ProgramTemplate { /** * The unique contentful ID associated with this program template */ export type ID = string /** * A human-readable name for the program. Dispayed in the SaaSquatch Portal during Program setup. */ export type ProgramName = string /** * A human-readable summary of the program. Dispayed in the SaaSquatch Portal during Program setup. */ export type ProgramSummary = string /** * A long-form article that sells the benefits of this program. Dispayed in the SaaSquatch Portal during Program setup. */ export type ProgramLongDescription = string /** * This describes how to setup the current program and may update depending on how you've configured your program rules */ export type ProgramInstallGuide = string /** * A unique key to identify this reward type. Only numbers and latin characers are allowed. Reward types must be unique within the scope of a program. e.g. `FirstPurchaseReward` */ export type Key = string /** * A human-readable name for the reward type that gets displayed in the SaaSquatch portal during program setup. e.g. `First Purchase Reward` */ export type Name = string /** * A human-readable description that explains this reward type. Displayed in the SaaSquatch portal during program setup. e.g. `This reward is given to people when they make their first purchase.` */ export type Description = string /** * A list of reward units this reward can potentially have */ export type Units = string[] /** * A list of all the possible types of rewards this program will give. Your business logic will trigger these based on key */ export type Rewards = RewardType[] /** * A unique key to identify this email type. Only numbers and latin characers are allowed. Email types must be unique within the scope of a program. e.g. `RewardCreatedEmail` */ export type Key1 = string /** * A human-readable name for the email type that gets displayed in the SaaSquatch portal during program setup. e.g. `Reward Created Email` */ export type Name1 = string /** * A human-readable description that explains this email type. Displayed in the SaaSquatch portal during program setup. e.g. `This email is sent when a new reward is created by this program` */ export type Description1 = string export type DefaultTemplateId = string export type FromName = string export type FromAddress = string export type Subject = string export type HeaderImage = string export type Header = string /** * Supports markdown and handlebars expressions. e.g. *bold* _underline_ and [link](https://example.com) */ export type Body = string export type DisplayCTAButton = boolean export type Text = string export type Link = string export type Footer = string export type FromName1 = string export type FromAddress1 = string export type Subject1 = string export type BCC = string[] /** * Raw HTML content that can use {{mergeTags}} from handlebars */ export type HTMLContent = string /** * A list of all the possible types of emails this program will send. Your business logic will trigger these based on key */ export type Emails = EmailType[] /** * The URL for the logo associated with this program */ export type LogoURL = string /** * A list of all the possible types of widgets this program will send. Your business logic will trigger these based on key */ export type Widgets = EmailType1[] /** * Indicates whether this program can be installed by any tenant that support GA */ export type GloballyInstallable = boolean /** * The tenants that can install this program if it's not globally installable */ export type InstallableByTenants = (TenantAlias[] | null) /** * The tenant alias for a tenant that can install this program */ export type TenantAlias = string export type Sharing = (({ enabled?: SharingEnabled linksConfig?: LinksConfiguration [k: string]: unknown } | (null & { enabled?: SharingEnabled linksConfig?: LinksConfiguration [k: string]: unknown })) & { enabled?: SharingEnabled linksConfig?: LinksConfiguration [k: string]: unknown }) /** * When sharing is enabled the program will create/support referral share links */ export type SharingEnabled = boolean /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "openGraph". */ export type ShareLinkOpenGraph = (({ source: "HOSTED" title: Title description: Description2 image?: Image } | { source: "LANDING_PAGE" }) & { source?: ("HOSTED" | "LANDING_PAGE") [k: string]: unknown }) export type Title = string export type Description2 = string export type Image = string /** * @minItems 7 * @maxItems 7 */ export type ShareMessages = [Twitter, Email2, Linkedin, Sms, Whatsapp, Linemessenger, Pinterest] export type XShareBody = string export type EmailShareSubject = string export type EmailShareBody = string export type LinkedInShareSubject = string export type LinkedInShareBody = string export type LinkedInURLImage = string export type SMSShareBody = string export type WhatsAppShareBody = string export type LineMessengerShareBody = string export type PinterestImageURL = string export type PinterestShareBody = string export type RecurringSchedule = (({ userFilter?: UserFilter /** * Your program logic will be run on this schedule. */ periodInHours?: number [k: string]: unknown } | (null & { userFilter?: UserFilter /** * Your program logic will be run on this schedule. */ periodInHours?: number [k: string]: unknown })) & { userFilter?: UserFilter /** * Your program logic will be run on this schedule. */ periodInHours?: number [k: string]: unknown }) /** * The backend schedules that will run at a specified interval and trigger the program for specified users */ export type ProgramSchedules = ({ type?: ScheduleType key?: ScheduleKey periodInHours?: PeriodInHours filter?: Filter query?: Query [k: string]: unknown }[] | null) /** * The type of schedule to run */ export type ScheduleType = ("USER" | "REWARD") /** * A unique identifier for this specific schedule */ export type ScheduleKey = string /** * The interval by which this schedule will run (e.g. every x hours) */ export type PeriodInHours = number /** * The query used to create the program context when a user is evaluated by the schedule */ export type Query = string /** * All of these conditions should be satisfied to confirm the program is working */ export type ProgramRequirements = (ProgramRequirement[] | null) /** * A unique identifier used to validate this requirement */ export type Key2 = string /** * The human-friendly name of this requirement */ export type Name2 = string /** * A description of how this requirement can be satisfied */ export type Description3 = string /** * Rich content regarding the implementation and other details relevant to this requirement */ export type LongDescription = string /** * The results of this query will be used to validate this requirement has been satisfied */ export type GraphQLQuery = (string | null) /** * These are passed in as parameters to the query */ export type GraphQLQueryVariables = ({ [k: string]: unknown } | null) /** * User metrics establish how aggregate functions can be used to update a custom user field with respect to an event. */ export type UserMetric = (({ aggregateId?: "SUM" aggregateRules?: SingleFieldWithWindowingAggregate [k: string]: unknown } | { aggregateId?: "COUNT" aggregateRules?: WindowingAggregate [k: string]: unknown } | { aggregateId?: "FIRST_SEEN" [k: string]: unknown } | { aggregateId?: "LAST_SEEN" [k: string]: unknown } | { aggregateId?: "FIRST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "LAST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "THROTTLED_LAST_NUMERIC_VALUE" aggregateRules?: { fieldName: FieldName diff?: ThrottleInterval } [k: string]: unknown }) & { customFieldKey: CustomField aggregateId: AggregateIdentifier dateTriggeredWindow?: DateTriggeredWindow userEventKey: UserEventKey filter?: Filter1 [k: string]: unknown }) /** * The field on which this aggregate will be performed. * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "fieldName". */ export type FieldName = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowing". */ export type Windowing = (({ type: "FIXED" unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") [k: string]: unknown } | { type: "SLIDING" duration: number unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") maxBucketValue?: number [k: string]: unknown }) & { type: ("FIXED" | "SLIDING") [k: string]: unknown }) /** * The minimum interval time that can elapse between recording the value of field name. Default is milliseconds per hour. */ export type ThrottleInterval = string /** * The name of the custom field associated with this metric. */ export type CustomField = string /** * An unique identifier for the aggregate operation to perform. */ export type AggregateIdentifier = ("SUM" | "COUNT" | "FIRST_SEEN" | "LAST_SEEN" | "FIRST_VALUE" | "LAST_VALUE" | "THROTTLED_LAST_NUMERIC_VALUE") /** * An ISO 8601 interval. The aggregate operation will only be performed between this window. */ export type DateTriggeredWindow = string /** * The event that will be aggregated by this metric. */ export type UserEventKey = string /** * A JSONata expression which will filter out non-matching events */ export type Filter1 = string /** * Custom metrics defined by this program that will only be activated when the program is live */ export type ProgramUserMetrics = UserMetric[] /** * The URL that will be requested for this program when triggered */ export type WebtaskURL = string /** * When an event with this key is received this program will be triggered. Deprecated in favour of userEventKeys. */ export type EventKey = string /** * A list of events that can trigger this program */ export type EventKeys = EventKey[] /** * When an event with this key is received this program will be triggered */ export type UserEventKey1 = string /** * A list of events that can trigger this program */ export type UserEventKeys = UserEventKey1[] /** * When a custom field with this key is received this program may perform mutations */ export type CustomFieldKey = string /** * A list of custom field keys that this program evaluates on */ export type CustomFieldKeys = CustomFieldKey[] /** * A JSONata script that transforms program rules JSON to be compatible with the most recently published schema version */ export type RulesMigrationScript = string /** * The program goal ID */ export type GoalID = string /** * The human readable name */ export type Name3 = string /** * Template of program goals provided by this program */ export type Goals = { goalId: GoalID name?: Name3 }[] /** * A unique key to identify this widget type. Only numbers and latin characers are allowed. Widget types must be unique within the scope of a program. e.g. `ReferrerWidget` */ export type Key3 = string /** * A human-readable name for the widget type that gets displayed in the SaaSquatch portal during program setup. e.g. `Referrer Widget` */ export type Name4 = string /** * A human-readable description that explains this widget type. Displayed in the SaaSquatch portal during program setup. e.g. `This widget is sent when a new reward is created by this program` */ export type Description4 = string /** * Raw HTML content that can use web components. */ export type HTMLTemplate = string /** * Whether this widget should automatically popup on page load */ export type AutoPopup = boolean /** * Build your program using the magic of magic! */ export interface ProgramTemplateBuilder { id?: ID name?: ProgramName summary?: ProgramSummary longDescription?: ProgramLongDescription installGuide?: ProgramInstallGuide rewards?: Rewards emails?: Emails logo?: LogoURL widgets?: Widgets globallyInstallable?: GloballyInstallable installableByTenants?: InstallableByTenants rules?: BusinessRuleVariables sharing?: Sharing schedule?: RecurringSchedule schedules?: ProgramSchedules settings?: { referrals?: { /** * Whether this program supports referrals */ enabled?: boolean [k: string]: unknown } [k: string]: unknown } rulesUISchema?: RulesUISchema requirements?: ProgramRequirements userMetrics?: ProgramUserMetrics url?: WebtaskURL trigger?: ProgramTriggers rulesMigrationScript?: RulesMigrationScript goals?: Goals } /** * A type of reward that is given by this program. */ export interface RewardType { key?: Key name?: Name description?: Description units?: Units [k: string]: unknown } /** * A type of email that is given by this program. */ export interface EmailType { key?: Key1 name?: Name1 description?: Description1 defaults?: (DefaultTemplateId | SimpleEmailTemplateSchema | HTMLEmailTemplateSchema) [k: string]: unknown } /** * Defines the customization points available in a Simple Email Template. */ export interface SimpleEmailTemplateSchema { meta: Email content: Content } export interface Email { fromName: FromName fromAddress: FromAddress subject: Subject } export interface Content { headerImage?: HeaderImage headerContent?: Header bodyContent: Body cta?: CallToAction footerContent?: Footer } export interface CallToAction { enabled?: DisplayCTAButton text?: Text link?: Link [k: string]: unknown } /** * Defines the customization points available in an HTML body email template. */ export interface HTMLEmailTemplateSchema { meta: Email1 htmlContent: HTMLContent jsonContent?: JSONContent } export interface Email1 { fromName: FromName1 fromAddress: FromAddress1 subject: Subject1 bcc?: BCC } /** * The JSON content for the email editor */ export interface JSONContent { [k: string]: unknown } /** * A type of email that is given by this program. * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "EmailType". */ export interface EmailType1 { key?: Key1 name?: Name1 description?: Description1 defaults?: (DefaultTemplateId | SimpleEmailTemplateSchema | HTMLEmailTemplateSchema) [k: string]: unknown } /** * The business rule variables define a JSON schema of the possible configuration points in the business logic. */ export interface BusinessRuleVariables { [k: string]: unknown } /** * Message links configuration (default share text/content for Open Graph/Twitter/etc) */ export interface LinksConfiguration { defaults?: ProgramMessaging [k: string]: unknown } /** * Defines the configurable share messages provided by this program. */ export interface ProgramMessaging { shareLinkOpenGraph: ShareLinkOpenGraph messageLinkOpenGraph: ShareLinkOpenGraph messages: ShareMessages } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "twitter". */ export interface Twitter { shareMedium?: "TWITTER" config?: X } export interface X { twitterShareBody: XShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "email". */ export interface Email2 { shareMedium?: "EMAIL" config?: Email3 } export interface Email3 { emailShareSubject: EmailShareSubject emailShareBody: EmailShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "linkedin". */ export interface Linkedin { shareMedium?: "LINKEDIN" config?: LinkedIn } export interface LinkedIn { linkedinShareSubject: LinkedInShareSubject linkedinShareBody: LinkedInShareBody linkedinShareImageURL?: LinkedInURLImage } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "sms". */ export interface Sms { shareMedium?: "SMS" config?: SMS } export interface SMS { smsShareBody: SMSShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "whatsapp". */ export interface Whatsapp { shareMedium?: "WHATSAPP" config?: WhatsApp } export interface WhatsApp { whatsAppShareBody: WhatsAppShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "linemessenger". */ export interface Linemessenger { shareMedium?: "LINEMESSENGER" config?: LineMessenger } export interface LineMessenger { lineMessengerShareBody: LineMessengerShareBody } /** * This interface was referenced by `ProgramMessaging`'s JSON-Schema * via the `definition` "pinterest". */ export interface Pinterest { shareMedium?: "PINTEREST" config?: Pinterest1 } export interface Pinterest1 { pinterestImageURL?: PinterestImageURL pinterestShareBody?: PinterestShareBody } /** * This should be a GraphQL-compatible query json object */ export interface UserFilter { [k: string]: unknown } /** * The filter used to determine which users are evaluated when the schedule is run */ export interface Filter { [k: string]: unknown } /** * Defines how the rules will be shown via schema form */ export interface RulesUISchema { [k: string]: unknown } /** * A condition that should be satified to confirm this program is working * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "Requirement". */ export interface ProgramRequirement { key: Key2 name: Name2 description: Description3 longDescription?: LongDescription query?: GraphQLQuery queryVariables?: GraphQLQueryVariables [k: string]: unknown } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldWithWindowingAggregate". */ export interface SingleFieldWithWindowingAggregate { fieldName: FieldName windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowingAggregate". */ export interface WindowingAggregate { windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldAggregate". */ export interface SingleFieldAggregate { fieldName: FieldName } /** * Defines specific triggers for this program */ export interface ProgramTriggers { eventKeys?: EventKeys userEventKeys?: UserEventKeys customFieldKeys?: CustomFieldKeys [k: string]: unknown } /** * A type of widget that is displayed by this program. * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "WidgetType". */ export interface WidgetType { key?: Key3 name?: Name4 description?: Description4 defaults?: HTMLWidgetTemplateSchema [k: string]: unknown } /** * Defines a web-component based widget template that uses vanilla HTML. */ export interface HTMLWidgetTemplateSchema { meta?: TemplateMeta htmlTemplate: HTMLTemplate autoPopup?: AutoPopup brandingConfig?: BrandingConfig } export interface TemplateMeta { /** * A list of NPM resources to load into the widget */ dependencies?: NpmDependency[] /** * A list of component editors used in editing the widget */ plugins?: NpmDependency[] } /** * This interface was referenced by `HTMLWidgetTemplateSchema`'s JSON-Schema * via the `definition` "npmDependency". */ export interface NpmDependency { /** * An NPM package name or scoped package */ package: string /** * An NPM version string, such as Patch releases: 1.0 or 1.0.x or ~1.0.4 Minor releases: 1 or 1.x or ^1.0.4 Major releases: * or x */ version: string /** * The path to a resource in the specified package */ filePath?: string [k: string]: unknown } export interface BrandingConfig { [k: string]: unknown } /** * A type of reward that is given by this program. * * This interface was referenced by `ProgramTemplateBuilder`'s JSON-Schema * via the `definition` "RewardType". */ export interface RewardType1 { key?: Key name?: Name description?: Description units?: Units [k: string]: unknown } } // End of ProgramTemplate // Start of ProgramTransaction declare namespace saasquatch.ProgramTransaction { export type ProgramIdentifier = string /** * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "mutation". */ export type ProgramMutation = (Mutation & Mutation1) export type Mutation = (RewardCreation | ModerateGraphNodes | SendEmail | ExchangeReward | RetractReferralConversion) /** * The program template key used to establish the relationship between this reward and the program */ export type RewardKey = string /** * A unique BSON ObjectID used to identify the reward, if not set this will be auto-generated. Use this to link with emails. */ export type RewardID = (string | null) /** * The referral ID for the event to be marked as a source of this reward */ export type ReferralID = (string | null) /** * This status defines the state the reward will be in when immediately after it is created * * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "initialRewardStatus". */ export type InitialRewardStatus = ("AVAILABLE" | "PENDING" | "CANCELLED") export type RewardSource = ("FRIEND_SIGNUP" | "REFERRED" | "ACTIVATION" | "ACQUISITION" | "RETENTION" | "REACTIVATION" | "AUTOMATED") export type UserID = string export type UserAccountID = string /** * The key of the event to be marked as a source of this reward */ export type EventKey = string /** * The unique identifier of the event to be marked as a source of this reward */ export type EventID = string /** * Defines the reward API data input structure. */ export type IfTheRewardIsMarkedAsDynamicByTheProgramTemplateThesePropertiesWillBeUsedToDynamicallyGenerateTheRewardTODODescribeUserDefinitionPrecedence = (({ type: "PCT_DISCOUNT" discountPercent: DiscountPercent name?: RewardName dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate } | { type: "FUELTANK" fuelTankCode: FuelTankCode unit?: Unit amount: Amount dateExpires?: RewardExpiryDate fuelTankType: FuelTankType cancellable?: Cancellable } | { type: "CREDIT" unit: Unit name?: RewardName assignedCredit: AssignedCredit dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate } | { type: "INTEGRATION" unit: Unit name?: RewardName description?: RewardDescription valueInCents: RewardAmount integrationSettings: IntegrationSettings }) & { type?: RewardType [k: string]: unknown }) /** * The discount associated with this reward */ export type DiscountPercent = number /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardName". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardName". */ export type RewardName = (string | null) /** * The date this reward will expire * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateExpires". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateExpires". */ export type RewardExpiryDate = (number | null) /** * Whether this reward can be cancelled * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardCancellable". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardCancellable". */ export type Cancellable = (boolean | null) /** * If the reward is created in a PENDING state this is the date we will attempt to 'give' it * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateScheduledFor". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateScheduledFor". */ export type ScheduledRewardGivenDate = (number | null) /** * The associated coupon code uploaded via the fuel tank API or portal code manager */ export type FuelTankCode = string /** * The unit of credit associated with this reward (i.e. months or usd) * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardUnit". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardUnit". */ export type Unit = string /** * The amount of credit or discount to be given */ export type Amount = string /** * The type of fuel tank reward being given */ export type FuelTankType = ("PCT_DISCOUNT" | "CREDIT") /** * The initial redeemable credit assigned to be assigned to reward */ export type AssignedCredit = number /** * This text describes the integration reward given in more detail */ export type RewardDescription = string /** * The value in base currency unit (i.e. cents) to be assigned to this reward */ export type RewardAmount = string export type EmailTemplateID = string export type RewardType = ("PCT_DISCOUNT" | "FUELTANK" | "CREDIT" | "INTEGRATION") /** * If the reward is created in a PENDING state this is the date we will attempt to 'give' it */ export type ScheduledRewardGivenDate1 = (number | null) /** * The date this reward is scheduled to expire if the reward is expirable */ export type RewardExpiryDate1 = (number | null) /** * The type of the graph node(s) to be moderated */ export type GraphNodeType = ("REWARD" | "PROGRAM_EMAIL" | "REFERRAL" | "USER_EVENT" | "PAYMENT_ACCOUNT") /** * The moderation action to apply to the filtered graph node(s) */ export type ModerationAction = ("APPROVE" | "DENY" | "NOTHING") /** * The maximum depth of child nodes to be moderated */ export type MaxDepth = number /** * The program template key of the email to send */ export type EmailKey = string /** * The initial email status, if not set this will default to QUEUED */ export type EmailStatus = ("PENDING" | "QUEUED") /** * If included, this defines the reward that will be linked to this email */ export type EmailRewardID = (string | null) /** * If included, this defines the referral that will be linked to this email */ export type EmailReferralID = (string | null) /** * The GraphQL query used to build the context for this email */ export type EmailQuery = string /** * Defines the reward API data input structure. */ export type RewardAPIInput = (({ type: "PCT_DISCOUNT" discountPercent: DiscountPercent name?: RewardName dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate } | { type: "FUELTANK" fuelTankCode: FuelTankCode unit?: Unit amount: Amount dateExpires?: RewardExpiryDate fuelTankType: FuelTankType cancellable?: Cancellable } | { type: "CREDIT" unit: Unit name?: RewardName assignedCredit: AssignedCredit dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate } | { type: "INTEGRATION" unit: Unit name?: RewardName description?: RewardDescription valueInCents: RewardAmount integrationSettings: IntegrationSettings }) & { type?: RewardType [k: string]: unknown }) export type ReferralID1 = string /** * The type of mutation to be performed */ export type MutationType = ("CREATE_REWARD" | "SEND_EMAIL" | "MODERATE_GRAPH_NODES" | "EXCHANGE_REWARD" | "RETRACT_REFERRAL_CONVERSION") /** * These are actions we would like to be performed by the program engine (i.e. creating a reward or sending an email) */ export type Mutations = ProgramMutation[] /** * The type of event to record as an analytic */ export type EventType = ("PROGRAM_EVALUATED" | "PROGRAM_GOAL") /** * Event data - currently just program which only requires the user */ export type EventData = ({ [k: string]: unknown } & { user: MutationUser /** * The type of program (i.e. acquisition, loyalty, retention) */ programType?: ("ACQUISITION" | "RETENTION" | "LOYALTY") /** * The type of analytic recorded (i.e. in program goals this could describe the goal achieved such as 'friendPaid'). It maps directly to the goalId. */ analyticsKey?: string /** * An ID unique in the recording of this analytic that will be used to deduplicate (i.e. with goals this could be the number of times the referrer was rewarded) */ analyticsDedupeId?: (string | null) /** * Whether this analytic will trigger a referral conversion. When analyticsDedupeId exists, the default value is true. When analyticsDedupeId does not exist, the default value is false. */ isConversion?: boolean /** * The date this analytic will be marked as recorded (defaults to current tenant time if not set) */ timestamp?: number }) /** * A list of analytics representing activities performed by the program */ export type Analytics = ProgramAnalytic[] /** * Establishes the transaction interface that programs use apply mutations/generate analytics. */ export interface ProgramTransactionSchema { programId: ProgramIdentifier mutations?: Mutations analytics?: Analytics } /** * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "rewardCreation". */ export interface RewardCreation { type: "CREATE_REWARD" data: RewardData } export interface RewardData { key: RewardKey rewardId?: RewardID referralId?: ReferralID status?: InitialRewardStatus rewardSource?: RewardSource user: MutationUser userEvent?: (({ key: EventKey id: EventID } | (null & { key: EventKey id: EventID })) & { key: EventKey id: EventID }) dynamicProperties?: IfTheRewardIsMarkedAsDynamicByTheProgramTemplateThesePropertiesWillBeUsedToDynamicallyGenerateTheRewardTODODescribeUserDefinitionPrecedence overrideProperties?: RewardOverride } /** * The mutation will be applied to this user * * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "user". */ export interface MutationUser { id: UserID accountId: UserAccountID } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "integrationSettings". * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "integrationSettings". */ export interface IntegrationSettings { templateId?: EmailTemplateID giftId?: string utid?: string [k: string]: unknown } /** * Properties included here will override or be added to properties setup via program reward configuration */ export interface RewardOverride { dateScheduledFor?: ScheduledRewardGivenDate1 dateExpires?: RewardExpiryDate1 } /** * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "moderateGraphNodes". */ export interface ModerateGraphNodes { type: "MODERATE_GRAPH_NODES" data: RewardData1 } export interface RewardData1 { graphNodeType: GraphNodeType filter: ModerationFilter moderationInput: { action: ModerationAction maxDepth: MaxDepth } } /** * A GraphQL filter that defines the node(s) to be moderated. See RewardFilterInput, ProgramEmailTransactionFilterInput, ProgramReferralFilterInput, and UserEventDataFilterInput */ export interface ModerationFilter { [k: string]: unknown } /** * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "sendEmail". */ export interface SendEmail { type: "SEND_EMAIL" data: EmailData } export interface EmailData { key: EmailKey status?: EmailStatus rewardId?: EmailRewardID referralId?: EmailReferralID user: MutationUser query: EmailQuery queryVariables: EmailQueryVariables } /** * This variables object parameterizes the GraphQL Email query */ export interface EmailQueryVariables { [k: string]: unknown } /** * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "exchangeReward". */ export interface ExchangeReward { type?: "EXCHANGE_REWARD" data?: RewardExchangeData [k: string]: unknown } export interface RewardExchangeData { user: MutationUser /** * Defines the amount of credit to redeem for this reward exchange */ redeemCreditInput: { amount: number unit: string } rewardInput?: RewardAPIInput /** * The global reward key for the reward to be given */ globalRewardKey?: string status?: InitialRewardStatus /** * Whether this reward exchange should be performed repeatedly until the user does not have enough redeemable credit. If not set, this will default to false. */ repeat?: boolean } /** * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "retractReferralConversion". */ export interface RetractReferralConversion { type?: "RETRACT_REFERRAL_CONVERSION" data?: RetractReferralConversionData [k: string]: unknown } export interface RetractReferralConversionData { referralId: ReferralID1 } export interface Mutation1 { type?: MutationType [k: string]: unknown } /** * This interface was referenced by `ProgramTransactionSchema`'s JSON-Schema * via the `definition` "analytics". */ export interface ProgramAnalytic { eventType: EventType data: EventData } } // End of ProgramTransaction // Start of ProgramValidationResponse declare namespace saasquatch.ProgramValidationResponse { /** * The key of the requirement associated with the listed validation results */ export type RequirementKey = string /** * A status indicating whether the validation was successful or the severity of the error */ export type ValidationStatus = ("SUCCESS" | "WARN" | "ERROR") /** * A message indicating why the validation was successful or not */ export type Message = string /** * A more detailed description of why the validation was not successful and what can be done to resolve it */ export type LongDescription = string /** * The results associated with the validation requirement key */ export type RequirementValidationResults = RequirementValidationResult[] /** * A list of errors or success messages in response to validating the requirements */ export type ValidationResults = { key: RequirementKey results: RequirementValidationResults }[] /** * Defines the validation results returned by the program when requested for program requirements */ export interface ProgramValidationResponseSchema { validationResults: ValidationResults } /** * A result of validating a requirement * * This interface was referenced by `ProgramValidationResponseSchema`'s JSON-Schema * via the `definition` "validationResult". */ export interface RequirementValidationResult { status: ValidationStatus message: Message longDescription?: LongDescription [k: string]: unknown } } // End of ProgramValidationResponse // Start of PurchaseEventFields declare namespace saasquatch.PurchaseEventFields { /** * The checkout ID associated with this purchase */ export type CheckoutID = string /** * The order or transaction ID associated with this purchase */ export type OrderID = string /** * Store or affiliation from which this transaction occurred (e.g. Google Store) */ export type Affiliation = string /** * Order total after discounts but before taxes and shipping */ export type PurchaseSubtotal = number /** * Revenue with discounts and coupons added in */ export type PurchaseTotal = number /** * Revenue associated with the transaction (excluding shipping and tax). This is the field we use to calculate a customer's LTV. */ export type Revenue = number /** * Shipping cost associated with the transaction */ export type ShippingCost = number /** * Total tax associated with the transaction */ export type TotalTax = number /** * Total discount associated with the transaction */ export type Discount = number /** * Transaction coupon redeemed with the transaction */ export type Coupon = string /** * The ISO currency code used in this purchase */ export type Currency = string /** * Database id of the product being viewed */ export type ProductID = string /** * Sku of the product being viewed */ export type StockKeepingUnit = string /** * Product category being viewed */ export type ProductCategory = string /** * Name of the product being viewed */ export type ProductName = string /** * Brand associated with the product */ export type Brand = string /** * Variant of the product (e.g. Black) */ export type ProductVariant = string /** * Price of the product being viewed */ export type Price = number /** * Quantity of a product */ export type Quantity = number /** * Coupon code associated with a product (e.g MAY_DEALS_3) */ export type Coupon1 = string /** * Position in the product list (ex. 3) */ export type ProductPosition = number /** * URL of the product page */ export type ProductURL = string /** * Image url of the product */ export type ImageURL = string /** * @maxItems 200 */ export type Products = Product[] /** * Defines the event fields our system recognizes as a purchase event */ export interface PaymentEventFieldsSchema { checkout_id?: CheckoutID order_id?: OrderID affiliation?: Affiliation subtotal?: PurchaseSubtotal total?: PurchaseTotal revenue?: Revenue shipping?: ShippingCost tax?: TotalTax discount?: Discount coupon?: Coupon currency?: Currency products?: Products } /** * This interface was referenced by `PaymentEventFieldsSchema`'s JSON-Schema * via the `definition` "product". */ export interface Product { product_id: ProductID sku?: StockKeepingUnit category?: ProductCategory name?: ProductName brand?: Brand variant?: ProductVariant price?: Price quantity?: Quantity coupon?: Coupon1 position?: ProductPosition url?: ProductURL image_url?: ImageURL } } // End of PurchaseEventFields // Start of ReferralCodes declare namespace saasquatch.ReferralCodes { /** * The primary referral code associated with the programId key * * This interface was referenced by `ReferralCodes`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export type ReferralCode = string /** * A map of programs to referral codes. */ export interface ReferralCodes { [k: string]: ReferralCode } } // End of ReferralCodes // Start of RefundEventFields declare namespace saasquatch.RefundEventFields { /** * The order or transaction ID associated with the refunded purchase */ export type RefundedOrderID = string /** * Store or affiliation from which this transaction occurred (e.g. Google Store) */ export type Affiliation = string /** * Revenue with discounts and coupons added in */ export type RefundedTotal = number /** * Revenue associated with the transaction (excluding shipping and tax). This is the field we use to calculate a customer's LTV. */ export type RefundedRevenue = number /** * Shipping cost associated with the transaction */ export type RefundedShipping = number /** * Total tax associated with the transaction */ export type RefundedTax = number /** * The ISO currency code used in this purchase */ export type RefundedCurrency = string /** * Database id of the product being viewed */ export type ProductID = string /** * Sku of the product being viewed */ export type StockKeepingUnit = string /** * Product category being viewed */ export type ProductCategory = string /** * Name of the product being viewed */ export type ProductName = string /** * Brand associated with the product */ export type Brand = string /** * Variant of the product (e.g. Black) */ export type ProductVariant = string /** * Price of the product being viewed */ export type Price = number /** * Quantity of a product */ export type Quantity = number /** * Coupon code associated with a product (e.g MAY_DEALS_3) */ export type Coupon = string /** * Position in the product list (ex. 3) */ export type ProductPosition = number /** * URL of the product page */ export type ProductURL = string /** * Image url of the product */ export type ImageURL = string /** * @maxItems 200 */ export type RefundedProducts = { product_id: ProductID sku?: StockKeepingUnit category?: ProductCategory name?: ProductName brand?: Brand variant?: ProductVariant price?: Price quantity?: Quantity coupon?: Coupon position?: ProductPosition url?: ProductURL image_url?: ImageURL }[] /** * Defines the event fields our system recognizes as a refund event */ export interface RefundEventFieldsSchema { order_id?: RefundedOrderID affiliation?: Affiliation total?: RefundedTotal revenue?: RefundedRevenue shipping?: RefundedShipping tax?: RefundedTax currency?: RefundedCurrency products?: RefundedProducts } } // End of RefundEventFields // Start of RewardApiInput declare namespace saasquatch.RewardApiInput { /** * Defines the reward API data input structure. */ export type RewardAPIInput = (({ type: "PCT_DISCOUNT" discountPercent: DiscountPercent name?: RewardName dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate } | { type: "FUELTANK" fuelTankCode: FuelTankCode unit?: Unit amount: Amount dateExpires?: RewardExpiryDate fuelTankType: FuelTankType cancellable?: Cancellable } | { type: "CREDIT" unit: Unit name?: RewardName assignedCredit: AssignedCredit dateExpires?: RewardExpiryDate cancellable?: Cancellable dateScheduledFor?: ScheduledRewardGivenDate } | { type: "INTEGRATION" unit: Unit name?: RewardName description?: RewardDescription valueInCents: RewardAmount integrationSettings: IntegrationSettings }) & { type?: RewardType [k: string]: unknown }) /** * The discount associated with this reward */ export type DiscountPercent = number /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardName". */ export type RewardName = (string | null) /** * The date this reward will expire * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateExpires". */ export type RewardExpiryDate = (number | null) /** * Whether this reward can be cancelled * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardCancellable". */ export type Cancellable = (boolean | null) /** * If the reward is created in a PENDING state this is the date we will attempt to 'give' it * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardDateScheduledFor". */ export type ScheduledRewardGivenDate = (number | null) /** * The associated coupon code uploaded via the fuel tank API or portal code manager */ export type FuelTankCode = string /** * The unit of credit associated with this reward (i.e. months or usd) * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardUnit". */ export type Unit = string /** * The amount of credit or discount to be given */ export type Amount = string /** * The type of fuel tank reward being given */ export type FuelTankType = ("PCT_DISCOUNT" | "CREDIT") /** * The initial redeemable credit assigned to be assigned to reward */ export type AssignedCredit = number /** * This text describes the integration reward given in more detail */ export type RewardDescription = string /** * The value in base currency unit (i.e. cents) to be assigned to this reward */ export type RewardAmount = string export type EmailTemplateID = string export type RewardType = ("PCT_DISCOUNT" | "FUELTANK" | "CREDIT" | "INTEGRATION") /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "integrationSettings". */ export interface IntegrationSettings { templateId?: EmailTemplateID giftId?: string utid?: string [k: string]: unknown } } // End of RewardApiInput // Start of SimpleEmail declare namespace saasquatch.SimpleEmail { export type FromName = string export type FromAddress = string export type Subject = string export type HeaderImage = string export type Header = string /** * Supports markdown and handlebars expressions. e.g. *bold* _underline_ and [link](https://example.com) */ export type Body = string export type DisplayCTAButton = boolean export type Text = string export type Link = string export type Footer = string /** * Defines the customization points available in a Simple Email Template. */ export interface SimpleEmailTemplateSchema { meta: Email content: Content } export interface Email { fromName: FromName fromAddress: FromAddress subject: Subject } export interface Content { headerImage?: HeaderImage headerContent?: Header bodyContent: Body cta?: CallToAction footerContent?: Footer } export interface CallToAction { enabled?: DisplayCTAButton text?: Text link?: Link [k: string]: unknown } } // End of SimpleEmail // Start of TenantJob declare namespace saasquatch.TenantJob { export type CreateAJob = (({ type?: "QUERY/USER" params?: { programId?: ProgramId fields?: Fields [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/USER_EVENT" params?: { filter?: Filter [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/USER_REFERRAL" params?: { createdSince?: CreatedSince createdBefore?: CreatedBefore updatedSince?: UpdatedSince updatedBefore?: UpdatedBefore createdOrUpdatedSince?: CreatedOrUpdatedSince createdOrUpdatedBefore?: CreatedOrUpdatedBefore [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/USER_REWARD_BALANCE" params?: { createdSince?: CreatedSince1 createdBefore?: CreatedBefore1 [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/REWARD_BALANCE" params?: { createdSince?: CreatedSince2 createdBefore?: CreatedBefore2 [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/REFERRAL" params?: { createdSince?: CreatedSince3 createdBefore?: CreatedBefore3 updatedSince?: UpdatedSince1 updatedBefore?: UpdatedBefore1 createdOrUpdatedSince?: CreatedOrUpdatedSince1 createdOrUpdatedBefore?: CreatedOrUpdatedBefore1 [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/REWARD" params?: { filter?: Filter1 at?: At fields?: Fields1 [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/REFERRAL_PARTICIPANT" params?: { shareMedium?: ShareMedium engagementMedium?: EngagementMedium createdSince?: CreatedSince4 createdBefore?: CreatedBefore4 updatedSince?: UpdatedSince2 updatedBefore?: UpdatedBefore2 createdOrUpdatedSince?: CreatedOrUpdatedSince2 createdOrUpdatedBefore?: CreatedOrUpdatedBefore2 [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/REDEEMABLE_REWARD_BALANCE" params?: { filter?: RedeemableRewardBalanceFilter [k: string]: unknown } [k: string]: unknown } | { type?: "QUERY/US_TAXABLE_VALUE" params?: { [k: string]: unknown } [k: string]: unknown } | { type?: "MUTATION/USER" fileRef: FileToUpload params?: { programId?: ProgramId1 segments?: Segments importEvaluationOptions?: { webhooks?: (WebhooksEnabled | { enabledWebhookTypes: EnabledWebhookTypes }) programs?: (ProgramEvaluationEnabled | { enabledProgramIds: EnabledProgramIds }) analytics?: (AnalyticsTrackingEnabled | { enabledAnalyticsEventCollections: AnalyticsEventCollections }) } [k: string]: unknown } [k: string]: unknown } | { type?: "MUTATION/REDEEMABLE_REWARD_BALANCE" fileRef?: FileToUpload1 [k: string]: unknown } | { type?: "MUTATION/REFERRAL" params?: { importEvaluationOptions?: { webhooks?: (WebhooksEnabled1 | { enabledWebhookTypes: EnabledWebhookTypes1 }) programs?: (ProgramEvaluationEnabled1 | { enabledProgramIds: EnabledProgramIds1 }) analytics?: (AnalyticsTrackingEnabled1 | { enabledAnalyticsEventCollections: AnalyticsEventCollections1 }) } [k: string]: unknown } [k: string]: unknown } | { type?: "MUTATION/USER_EVENT" params?: { importEvaluationOptions?: { webhooks?: (WebhooksEnabled2 | { enabledWebhookTypes: EnabledWebhookTypes2 }) programs?: (ProgramEvaluationEnabled2 | { enabledProgramIds: EnabledProgramIds2 }) analytics?: (AnalyticsTrackingEnabled2 | { enabledAnalyticsEventCollections: AnalyticsEventCollections2 }) } [k: string]: unknown } [k: string]: unknown } | { type?: "MUTATION/DELETE_USER" params?: { preserveEmptyAccounts?: PreserveEmptyAccounts doNotTrack?: DoNotTrack [k: string]: unknown } [k: string]: unknown }) & { type: JobType outputFormat?: OutputFormat name?: JobName mailtoEmail?: NotifyOnJobCompletion requester?: RequestedBy [k: string]: unknown }) export type ProgramId = string export type IncludeUserStatsFields = boolean export type IncludeProgramShareLinksAndReferralCodes = boolean export type IncludeSegments = boolean /** * Filter for a single user event by ID */ export type EventIDEquals = string /** * Filter for user events by event key */ export type EventKeyEquals = string /** * Exclude user events by event key */ export type EventKeyNotEqual = string /** * Filter for user events by multiple event keys */ export type EventKeyIn = string /** * Exclude user events by multiple event keys */ export type EventKeyNotIn = string /** * Filter for user events triggered after or at a certain timestamp */ export type DateTriggeredGreaterThanOrEquals = number /** * Filter for user events triggered before a certain timestamp */ export type DateTriggeredLessThan = number /** * Filter for user events triggered between two dates */ export type DateTriggeredInterval = string /** * Filter for user events triggered with a timeframe */ export type DateTriggeredTimeframe = string /** * Filter for user events received after or at a certain timestamp */ export type DateReceivedGreaterThanOrEquals = number /** * Filter for user events received before a certain timestamp */ export type DateReceivedLessThan = number /** * Filter for user events received between two dates */ export type DateReceivedInterval = string /** * Filter for user events received with a timeframe */ export type DateReceivedTimeframe = string /** * Filter for user events processed after or at a certain timestamp */ export type DateProcessedGreaterThanOrEquals = number /** * Filter for user events processed before a certain timestamp */ export type DateProcessedLessThan = number /** * Filter for user events processed between two dates */ export type DateProcessedInterval = string /** * Filter for user events processed with a timeframe */ export type DateProcessedTimeframe = string /** * Filter for user events by User ID */ export type UserIDEquals = string /** * Filter for user events by Account ID */ export type AccountIDEquals = string export type CreatedSince = number export type CreatedBefore = number export type UpdatedSince = number export type UpdatedBefore = number export type CreatedOrUpdatedSince = number export type CreatedOrUpdatedBefore = number export type CreatedSince1 = number export type CreatedBefore1 = number export type CreatedSince2 = number export type CreatedBefore2 = number export type CreatedSince3 = number export type CreatedBefore3 = number export type UpdatedSince1 = number export type UpdatedBefore1 = number export type CreatedOrUpdatedSince1 = number export type CreatedOrUpdatedBefore1 = number /** * An optional timestamp for exporting the rewards' states at a specific point in time */ export type At = number export type IncludeUserFields = boolean export type IncludeReferralFields = boolean export type ShareMedium = string export type EngagementMedium = string export type CreatedSince4 = number export type CreatedBefore4 = number export type UpdatedSince2 = number export type UpdatedBefore2 = number export type CreatedOrUpdatedSince2 = number export type CreatedOrUpdatedBefore2 = number export type FileToUpload = string export type ProgramId1 = string export type Segments = string[] /** * If true then all triggered webhook types will be sent */ export type WebhooksEnabled = boolean export type EnabledWebhookTypes = ("user.created" | "coupon.created" | "reward.created" | "referral.started" | "referral.converted" | "user.reward.balance.changed" | "email.referred.reward.earned" | "email.referral.started" | "email.referral.paid" | "email.referral.rewardLimitReached" | "referral.automoderation.complete" | "referral.ended" | "theme.publish.finished")[] /** * If true then all applicable active programs will be triggered */ export type ProgramEvaluationEnabled = boolean export type EnabledProgramIds = string[] export type AnalyticsTrackingEnabled = boolean export type CollectionName = ("userCreated" | "userReferralProgramLoaded" | "userReferralProgramEngagement" | "userReferralShareLinkClicked" | "userReferralCreated" | "userApprovedReferralCreated" | "userReferralModerated" | "userReferralConverted" | "userApprovedReferralConverted" | "userReferralEnded" | "rewardCreated" | "rewardRedeemed" | "programEvaluated" | "userActivity" | "programGoal") export type AnalyticsEventCollections = { collectionName?: CollectionName [k: string]: unknown }[] export type FileToUpload1 = string /** * If true then all triggered webhook types will be sent */ export type WebhooksEnabled1 = boolean export type EnabledWebhookTypes1 = ("user.created" | "coupon.created" | "reward.created" | "referral.started" | "referral.converted" | "user.reward.balance.changed" | "email.referred.reward.earned" | "email.referral.started" | "email.referral.paid" | "email.referral.rewardLimitReached" | "referral.automoderation.complete" | "referral.ended" | "theme.publish.finished")[] /** * If true then all applicable active programs will be triggered */ export type ProgramEvaluationEnabled1 = boolean export type EnabledProgramIds1 = string[] export type AnalyticsTrackingEnabled1 = boolean export type CollectionName1 = ("userCreated" | "userReferralProgramLoaded" | "userReferralProgramEngagement" | "userReferralShareLinkClicked" | "userReferralCreated" | "userApprovedReferralCreated" | "userReferralModerated" | "userReferralConverted" | "userApprovedReferralConverted" | "userReferralEnded" | "rewardCreated" | "rewardRedeemed" | "programEvaluated" | "userActivity" | "programGoal") export type AnalyticsEventCollections1 = { collectionName?: CollectionName1 [k: string]: unknown }[] /** * If true then all triggered webhook types will be sent */ export type WebhooksEnabled2 = boolean export type EnabledWebhookTypes2 = ("user.created" | "coupon.created" | "reward.created" | "referral.started" | "referral.converted" | "user.reward.balance.changed" | "email.referred.reward.earned" | "email.referral.started" | "email.referral.paid" | "email.referral.rewardLimitReached" | "referral.automoderation.complete" | "referral.ended" | "theme.publish.finished")[] /** * If true then all applicable active programs will be triggered */ export type ProgramEvaluationEnabled2 = boolean export type EnabledProgramIds2 = string[] export type AnalyticsTrackingEnabled2 = boolean export type CollectionName2 = ("userCreated" | "userReferralProgramLoaded" | "userReferralProgramEngagement" | "userReferralShareLinkClicked" | "userReferralCreated" | "userApprovedReferralCreated" | "userReferralModerated" | "userReferralConverted" | "userApprovedReferralConverted" | "userReferralEnded" | "rewardCreated" | "rewardRedeemed" | "programEvaluated" | "userActivity" | "programGoal") export type AnalyticsEventCollections2 = { collectionName?: CollectionName2 [k: string]: unknown }[] export type PreserveEmptyAccounts = boolean export type DoNotTrack = boolean export type JobType = ("QUERY/USER" | "QUERY/USER_EVENT" | "QUERY/USER_REFERRAL" | "QUERY/USER_REWARD_BALANCE" | "QUERY/REWARD_BALANCE" | "QUERY/REFERRAL" | "QUERY/REWARD" | "QUERY/REFERRAL_PARTICIPANT" | "QUERY/REDEEMABLE_REWARD_BALANCE" | "QUERY/US_TAXABLE_VALUE" | "MUTATION/USER" | "MUTATION/REDEEMABLE_REWARD_BALANCE" | "MUTATION/USER_STATS" | "MUTATION/REFERRAL" | "MUTATION/USER_EVENT" | "MUTATION/DELETE_USER") export type OutputFormat = ("CSV" | "XLSX") export type JobName = string export type NotifyOnJobCompletion = string export type RequestedBy = string export interface Fields { includeUserStatsFields?: IncludeUserStatsFields includeProgramShareLinksAndReferralCodes?: IncludeProgramShareLinksAndReferralCodes includeSegments?: IncludeSegments [k: string]: unknown } /** * A GraphQL filter that defines the user events to be exported. */ export interface Filter { id_eq?: EventIDEquals key_eq?: EventKeyEquals key_ne?: EventKeyNotEqual key_in?: EventKeyIn key_nin?: EventKeyNotIn dateTriggered_gte?: DateTriggeredGreaterThanOrEquals dateTriggered_lt?: DateTriggeredLessThan dateTriggered_interval?: DateTriggeredInterval dateTriggered_timeframe?: DateTriggeredTimeframe dateReceived_gte?: DateReceivedGreaterThanOrEquals dateReceived_lt?: DateReceivedLessThan dateReceived_interval?: DateReceivedInterval dateReceived_timeframe?: DateReceivedTimeframe dateProcessed_gte?: DateProcessedGreaterThanOrEquals dateProcessed_lt?: DateProcessedLessThan dateProcessed_interval?: DateProcessedInterval dateProcessed_timeframe?: DateProcessedTimeframe userId_eq?: UserIDEquals accountId_eq?: AccountIDEquals [k: string]: unknown } /** * A GraphQL filter that defines the rewards to be exported. See RewardFilterInput. */ export interface Filter1 { [k: string]: unknown } export interface Fields1 { includeUserFields?: IncludeUserFields includeReferralFields?: IncludeReferralFields [k: string]: unknown } export interface RedeemableRewardBalanceFilter { type_eq?: ("PCT_DISCOUNT" | "CREDIT" | "FUELTANK" | "INTEGRATION") unit_eq?: string unit_in?: string[] unitType_eq?: string currency_eq?: string [k: string]: unknown } } // End of TenantJob // Start of UnitPrettyValueFormatContext declare namespace saasquatch.UnitPrettyValueFormatContext { /** * The unit of the reward */ export type Unit = string /** * The value of the reward. If the reward is currency based, then this is the value in the currency's fractional unit. */ export type Value = number /** * The name of the reward */ export type Name = string /** * The currency symbol in the rendering locale */ export type CurrencySymbol = string /** * The currency symbol in the currency's native locale */ export type CurrencyLocalizedSymbol = string /** * The ISO 4217 currency code */ export type CurrencyCode = string /** * The ISO 4217 numeric currency code */ export type CurrencyNumericCode = number /** * The display name of the currency in the rendering locale */ export type CurrencyDisplayName = string /** * The display name of the currency in the currency's native locale */ export type CurrencyLocalizedDisplayName = string /** * The fractional unit of the currency, e.g. "Cent". */ export type CurrencyFractionalUnit = string /** * How many the currency subdivision go into the currency, e.g. 100 pence to the pound. */ export type CurrencyNumberToBasic = number /** * The value of the reward in the currency's base unit */ export type ValueInCurrencyBaseUnit = number /** * The context for rendering custom unit prettyValue */ export interface UnitPrettyValueFormatContext { unit: Unit value: Value name?: Name currencySymbol?: CurrencySymbol currencyLocalizedSymbol?: CurrencyLocalizedSymbol currencyCode?: CurrencyCode currencyNumericCode?: CurrencyNumericCode currencyDisplayName?: CurrencyDisplayName currencyLocalizedDisplayName?: CurrencyLocalizedDisplayName currencyFractionalUnit?: CurrencyFractionalUnit currencyNumberToBasic?: CurrencyNumberToBasic valueInCurrencyBaseUnit?: ValueInCurrencyBaseUnit } } // End of UnitPrettyValueFormatContext // Start of UnitSettings declare namespace saasquatch.UnitSettings { /** * A unique identifier generated by combining reward type and unit or unit pattern (e.g. CREDIT/USD) */ export type RewardUnitSettingsId = string /** * Indicates whether rewards of this unit can be cancelled via SaaSquatch API/Portal */ export type IsCancellable = boolean /** * Indicates whether rewards of this unit can be redeemed via SaaSquatch API/Portal */ export type IsRedeemable = boolean /** * Indicates whether expiration is applicable to this reward of this unit */ export type IsExpirable = boolean /** * Whether this unit supports multi-currencies. false by default. */ export type SupportsCurrencies = boolean /** * JSONata expression for calculating the US taxable value */ export type USTaxableValueFormula = string /** * Whether this unit is fulfilled by Impact cash payout. false by default. */ export type IsImpactCashPayout = boolean /** * The name of this reward unit */ export type Name = string /** * The type of this template, "ICU" by default. */ export type TemplateType = "ICU" /** * The template string for reward prettyValue */ export type Template = string /** * Settings that describe the behaviour and formatting of rewards corresponding to the configured unit or unit pattern */ export interface UnitSettings { id: RewardUnitSettingsId config: UnitSettingsConfiguration } /** * Behaviour and formatting supported by this unit setting */ export interface UnitSettingsConfiguration { rewardModifications: RewardModifications supportsCurrencies: SupportsCurrencies usTaxableValueFormula?: USTaxableValueFormula fulfilledByCashPayout?: IsImpactCashPayout translatableConfig?: TranslatableConfiguration } /** * The modifications supported by rewards applicable for this unit setting */ export interface RewardModifications { isCancellable: IsCancellable isRedeemable: IsRedeemable isExpirable: IsExpirable } /** * Locale-specific configuration for rewards of this unit */ export interface TranslatableConfiguration { name?: Name prettyValueFormat?: PrettyValueFormat } /** * Format for prettyValue for rewards of this unit */ export interface PrettyValueFormat { templateType?: TemplateType template: Template } } // End of UnitSettings // Start of DefaultCustomField declare namespace saasquatch.DefaultCustomField { export type DefaultCustomField = (string | boolean | number | null) } // End of DefaultCustomField // Start of FirstPurchaseDate declare namespace saasquatch.FirstPurchaseDate { /** * The date we first recorded a purchase for this user (user.customFields.firstPurchaseDate). */ export type FirstPurchaseDate = number } // End of FirstPurchaseDate // Start of LastPurchaseDate declare namespace saasquatch.LastPurchaseDate { /** * The date we most recently recorded a purchase for this user (user.customFields.lastPurchaseDate). */ export type LastPurchaseDate = number } // End of LastPurchaseDate // Start of LastSeenDate declare namespace saasquatch.LastSeenDate { /** * The date we last observed an upsert for this user (user.customFields.lastSeenDate). */ export type LastSeenDate = number } // End of LastSeenDate // Start of TotalPurchaseCount declare namespace saasquatch.TotalPurchaseCount { /** * A count of the total number of purchases we observed for this user (user.customFields.totalPurchaseCount). */ export type TotalPurchaseCount = number } // End of TotalPurchaseCount // Start of UserAnalyticEvent declare namespace saasquatch.UserAnalyticEvent { /** * Defines the event fields our system recognizes as a purchase event */ export type PaymentEventFieldsSchema = (({ type?: "USER_REFERRAL_PROGRAM_LOADED_EVENT" meta: { engagementMedium: EngagementMedium [k: string]: unknown } [k: string]: unknown } | { type?: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT" meta: { engagementMedium: EngagementMedium shareMedium: ShareMedium [k: string]: unknown } [k: string]: unknown }) & { id: UserID accountId: AccountID programId: ProgramID type: AnalyticType [k: string]: unknown }) /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "engagement". */ export type EngagementMedium = ("NOCONTENT" | "EMBED" | "HOSTED" | "MOBILE" | "POPUP" | "DEMO_EMBED" | "DEMO" | "EMPTY" | "EMAIL" | "PORTAL" | "UNKNOWN") /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "share". */ export type ShareMedium = ("FACEBOOK" | "TWITTER" | "EMAIL" | "DIRECT" | "LINKEDIN" | "SMS" | "FBMESSENGER" | "WHATSAPP" | "LINEMESSENGER" | "PINTEREST" | "REMINDER" | "UNKNOWN") export type UserID = string export type AccountID = string export type ProgramID = string export type AnalyticType = ("USER_REFERRAL_PROGRAM_LOADED_EVENT" | "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT") } // End of UserAnalyticEvent // Start of UserCustomFields declare namespace saasquatch.UserCustomFields { /** * Defines how custom fields can be specified on a user. Allows alphanumeric numbers and underscores. */ 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) } } // End of UserCustomFields // Start of UserIdentifier declare namespace saasquatch.UserIdentifier { /** * This user's unique identifier */ export type UserId = string /** * The unique identifier of the account this user belongs to */ export type AccountId = string /** * The unique identifiers used to distinguish a user. */ export interface UserIdentifierSchema { id: UserId accountId: AccountId } } // End of UserIdentifier // Start of UserMetric declare namespace saasquatch.UserMetric { /** * User metrics establish how aggregate functions can be used to update a custom user field with respect to an event. */ export type UserMetric = (({ aggregateId?: "SUM" aggregateRules?: SingleFieldWithWindowingAggregate [k: string]: unknown } | { aggregateId?: "COUNT" aggregateRules?: WindowingAggregate [k: string]: unknown } | { aggregateId?: "FIRST_SEEN" [k: string]: unknown } | { aggregateId?: "LAST_SEEN" [k: string]: unknown } | { aggregateId?: "FIRST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "LAST_VALUE" aggregateRules?: SingleFieldAggregate [k: string]: unknown } | { aggregateId?: "THROTTLED_LAST_NUMERIC_VALUE" aggregateRules?: { fieldName: FieldName diff?: ThrottleInterval } [k: string]: unknown }) & { customFieldKey: CustomField aggregateId: AggregateIdentifier dateTriggeredWindow?: DateTriggeredWindow userEventKey: UserEventKey filter?: Filter [k: string]: unknown }) /** * The field on which this aggregate will be performed. * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "fieldName". */ export type FieldName = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowing". */ export type Windowing = (Windowing1 & { type: ("FIXED" | "SLIDING") [k: string]: unknown }) export type Windowing1 = ({ type: "FIXED" unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") [k: string]: unknown } | { type: "SLIDING" duration: number unit: ("DAY" | "WEEK" | "MONTH" | "YEAR") maxBucketValue?: number [k: string]: unknown }) /** * The minimum interval time that can elapse between recording the value of field name. Default is milliseconds per hour. */ export type ThrottleInterval = string /** * The name of the custom field associated with this metric. */ export type CustomField = string /** * An unique identifier for the aggregate operation to perform. */ export type AggregateIdentifier = ("SUM" | "COUNT" | "FIRST_SEEN" | "LAST_SEEN" | "FIRST_VALUE" | "LAST_VALUE" | "THROTTLED_LAST_NUMERIC_VALUE") /** * An ISO 8601 interval. The aggregate operation will only be performed between this window. */ export type DateTriggeredWindow = string /** * The event that will be aggregated by this metric. */ export type UserEventKey = string /** * A JSONata expression which will filter out non-matching events */ export type Filter = string /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldWithWindowingAggregate". */ export interface SingleFieldWithWindowingAggregate { fieldName: FieldName windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "windowingAggregate". */ export interface WindowingAggregate { windowing?: Windowing } /** * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "singleFieldAggregate". */ export interface SingleFieldAggregate { fieldName: FieldName } } // End of UserMetric // Start of UserMetricJSONataFilterContext declare namespace saasquatch.UserMetricJSONataFilterContext { export type FirstName = (string | null) export type LastName = (string | null) export type EmailAddress = (string | null) export type Locale = (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 key of the evaluated event (e.g. purchase) */ export type EventKey = string /** * The date this event was created */ export type DateTriggered = number /** * Context provided to a custom user metric JSONata filter expression */ export interface UserMetricJSONataContext { user?: UserData event?: Event [k: string]: unknown } export interface UserData { firstName?: FirstName lastName?: LastName email?: EmailAddress locale?: Locale dateCreated?: DateUserCreated dateBlocked?: DateUserBlocked segments?: Segments fraudFlags?: FraudFlags customFields?: UserCustomFields [k: string]: unknown } export interface FraudFlag { type: FlagType message: FlagDescription } /** * The user's custom fields * * This interface was referenced by `UserMetricJSONataContext`'s JSON-Schema * via the `definition` "customFieldsContext". */ export interface UserCustomFields { [k: string]: unknown } /** * The variables for the event that triggered the metric * * This interface was referenced by `UserMetricJSONataContext`'s JSON-Schema * via the `definition` "eventContext". */ export interface Event { key?: EventKey dateTriggered?: DateTriggered fields?: EventFields [k: string]: unknown } /** * The event's fields * * This interface was referenced by `UserMetricJSONataContext`'s JSON-Schema * via the `definition` "eventFieldsContext". */ export interface EventFields { [k: string]: unknown } } // End of UserMetricJSONataFilterContext // Start of UserTokenClaims declare namespace saasquatch.UserTokenClaims { /** * Defines the claims provided to autenticate a user with a JWT. */ export type UserTokenClaimSchema = ({ authentication?: Authentication sub?: Subject iss?: Issuer user?: TheUserSubject [k: string]: unknown } & { [k: string]: unknown }) /** * Users can either be authenticated or unauthenticated. Authenticated users have had their identity validated. Unauthenticated users have not proved their identity, can still take actions when enabled in SaaSquatch, but are tracked separately. */ export type Authentication = ("authenticated" | "unauthenticated") /** * The user identity to be validated. Of the format: `{ACCOUNTID}:{USERID}@{TENANT}:users` */ export type Subject = string /** * The issuer of the token. When ommitted then the issuer must be a */ export type Issuer = string export type UserID = string export type AccountID = string /** * Identifies the user by identity. */ export interface TheUserSubject { id: UserID accountId: AccountID [k: string]: unknown } } // End of UserTokenClaims // Start of CouponCreatedData declare namespace saasquatch.CouponCreatedData { /** * The code to be shared */ export type Code = string /** * The date this code was created */ export type DateCreated = number /** * The Id of the program this code was created for */ export type ProgramId = (string | null) /** * Sent when a new coupon (referral code) is created, often when the user is created or interacts with a newly activated program */ export interface CouponCreatedWebhookSchema { code: Code dateCreated: DateCreated programId?: ProgramId } } // End of CouponCreatedData // Start of ExportData declare namespace saasquatch.ExportData { /** * The unique identifier for this export */ export type ExportId = string /** * The name of this export (e.g. User Details) */ export type ExportName = (string | null) /** * The person or machine that requested this export */ export type Requester = string /** * The status of this export (e.g. is it running/finished?) */ export type Status = ("PENDING" | "ABORTED" | "COMPLETED") /** * The date this export was created */ export type DateCreated = number /** * The date this export completed */ export type DateCompleted = (number | null) /** * The email address that will receive a download link for this export when it completes */ export type NotificationEmailAddress = (string | null) /** * The date this export expires (e.g. when it will no longer be downloadable) */ export type DateExpires = (number | null) /** * The format this export will be generated in (e.g. CSV or Excel) */ export type OutputFormat = ("XLSX" | "CSV") /** * The type of export generated */ export type ExportType = ("USER" | "REFERRAL" | "REWARD_BALANCE" | "USER_REWARD_BALANCE" | "USER_REFERRAL" | "REFERRAL_PARTICIPANT" | "REDEEMABLE_REWARD_BALANCE") /** * The operation being performed (for exports this is always QUERY) */ export type Operation = string /** * Statistics recorded upon completions of the export */ export type ExportStats = (({ recordsProcessed?: RecordsProcessed errors?: Errors } | (null & { recordsProcessed?: RecordsProcessed errors?: Errors })) & { recordsProcessed?: RecordsProcessed errors?: Errors }) /** * The number of records that were processed to complete this export */ export type RecordsProcessed = number /** * The number of errors that occurred while running this export */ export type Errors = number /** * A link to an uploaded file, if this export was based on an uploaded file (e.g. a list of redemption) */ export type UploadedFileReference = (string | null) /** * Sent whenever a data export activity happens (e.g. export created/completed) */ export interface ExportWebhookSchema { id: ExportId name?: ExportName requester: Requester status: Status dateCreated: DateCreated dateCompleted?: DateCompleted mailtoEmail?: NotificationEmailAddress dateExpires?: DateExpires outputFormat: OutputFormat task: ExportType operation: Operation params?: ExportFilters stats?: ExportStats fileRef?: UploadedFileReference } /** * These parameters are used to filter the export (e.g. by date or program) */ export interface ExportFilters { [k: string]: unknown } } // End of ExportData // Start of ReferralClassic declare namespace saasquatch.ReferralClassic { /** * The unique referral identifier */ export type ReferralId = string /** * This user's unique identifier */ export type UserId = string /** * The unique identifier of the account this user belongs to */ export type AccountId = string /** * The referrers code that was used by the referred for the referral */ export type ReferralCodeUsed = string /** * The sharelink that was used by the referred for the referral */ export type ShareLinkUsed = string /** * The date this referral was created */ export type DateReferralStarted = number /** * The date the referral converted */ export type DateReferralConverted = (number | null) /** * The date this referral was last modified for any reason (e.g. converted, reward added, etc.) */ export type DateReferralModified = (number | null) /** * The date a user was added to or removed from the referral (e.g. removed as a result of user deletion) */ export type DateUserModified = (number | null) /** * The Id of the program this code was created for */ export type ProgramId = (string | null) /** * The userId of the referrer user (Classic-Only) */ export type ReferrerUser1 = string /** * The userId of the referred user (Classic-Only) */ export type ReferredUser1 = string /** * A set of fraud flags generated for the classic referral program (Classic-Only) */ export type FraudSignals = ({ [k: string]: unknown } | null) /** * The referral fraud moderation status for the classic program (Classic-Only) */ export type ModerationStatus = ("PENDING" | "ACTIONED") /** * The referral moderation status for the referrer user classic program (Classic-Only) */ export type ReferrerModerationStatus = ("PENDING" | "APPROVED" | "DENIED") /** * The date the referral was marked as paid (Classic-Only) */ export type DateReferralPaid = (number | null) /** * The date the referral ended (Classic-Only) */ export type DateReferralEnded = (number | null) /** * The moderation status for the referred user in the classic program (Classic-Only) */ export type ReferredModerationStatus = ("PENDING" | "APPROVED" | "DENIED") /** * The date the referral was moderated (Classic-Only) */ export type DateModerated = number /** * The rewardId of the classic program referred user's reward if available (Classic-Only) */ export type ReferredReward = (string | null) /** * The rewardId of the classic program referrer user's reward if available (Classic-Only) */ export type ReferrerReward = (string | null) /** * Sent whenever a classic referral event happens */ export interface ClassicReferralWebhookSchema { id: ReferralId referrer?: ReferrerUser referred?: ReferredUser referralCodeUsed?: ReferralCodeUsed shareLinkUsed?: ShareLinkUsed dateReferralStarted: DateReferralStarted dateConverted?: DateReferralConverted dateModified?: DateReferralModified dateUserModified?: DateUserModified programId?: ProgramId referrerUser: ReferrerUser1 referredUser?: ReferredUser1 fraudSignals?: FraudSignals moderationStatus: ModerationStatus referrerModerationStatus: ReferrerModerationStatus dateReferralPaid?: DateReferralPaid dateReferralEnded?: DateReferralEnded referredModerationStatus: ReferredModerationStatus dateModerated: DateModerated referredReward?: ReferredReward referrerReward?: ReferrerReward } /** * The referrer user in who initiated this referral */ export interface ReferrerUser { id: UserId accountId: AccountId } /** * The referred user who initiated this referral */ export interface ReferredUser { id: UserId accountId: AccountId } } // End of ReferralClassic // Start of ReferralClassicDisabled declare namespace saasquatch.ReferralClassicDisabled { /** * The unique referral identifier */ export type ReferralId = string /** * This user's unique identifier */ export type UserId = string /** * The unique identifier of the account this user belongs to */ export type AccountId = string /** * The referrers code that was used by the referred for the referral */ export type ReferralCodeUsed = string /** * The sharelink that was used by the referred for the referral */ export type ShareLinkUsed = string /** * The date this referral was created */ export type DateReferralStarted = number /** * The date the referral converted */ export type DateReferralConverted = (number | null) /** * The date this referral was last modified for any reason (e.g. converted, reward added, etc.) */ export type DateReferralModified = (number | null) /** * The date a user was added to or removed from the referral (e.g. removed as a result of user deletion) */ export type DateUserModified = (number | null) /** * The Id of the program this code was created for */ export type ProgramId = (string | null) /** * Sent whenever a referral event happens and the classic program is disabled */ export interface ClassicDisabledReferralWebhookSchema { id: ReferralId referrer: ReferrerUser referred: ReferredUser referralCodeUsed?: ReferralCodeUsed shareLinkUsed?: ShareLinkUsed dateReferralStarted: DateReferralStarted dateConverted?: DateReferralConverted dateModified?: DateReferralModified dateUserModified?: DateUserModified programId?: ProgramId } /** * The referrer user in who initiated this referral */ export interface ReferrerUser { id: UserId accountId: AccountId } /** * The referred user who initiated this referral */ export interface ReferredUser { id: UserId accountId: AccountId } } // End of ReferralClassicDisabled // Start of ReferralData declare namespace saasquatch.ReferralData { /** * Sent whenever a referral event happens */ export type ReferralDataWebhookSchema = (ClassicReferralWebhookSchema | ClassicDisabledReferralWebhookSchema) /** * The unique referral identifier */ export type ReferralId = string /** * This user's unique identifier */ export type UserId = string /** * The unique identifier of the account this user belongs to */ export type AccountId = string /** * The referrers code that was used by the referred for the referral */ export type ReferralCodeUsed = string /** * The sharelink that was used by the referred for the referral */ export type ShareLinkUsed = string /** * The date this referral was created */ export type DateReferralStarted = number /** * The date the referral converted */ export type DateReferralConverted = (number | null) /** * The date this referral was last modified for any reason (e.g. converted, reward added, etc.) */ export type DateReferralModified = (number | null) /** * The date a user was added to or removed from the referral (e.g. removed as a result of user deletion) */ export type DateUserModified = (number | null) /** * The Id of the program this code was created for */ export type ProgramId = (string | null) /** * The userId of the referrer user (Classic-Only) */ export type ReferrerUser1 = string /** * The userId of the referred user (Classic-Only) */ export type ReferredUser1 = string /** * A set of fraud flags generated for the classic referral program (Classic-Only) */ export type FraudSignals = ({ [k: string]: unknown } | null) /** * The referral fraud moderation status for the classic program (Classic-Only) */ export type ModerationStatus = ("PENDING" | "ACTIONED") /** * The referral moderation status for the referrer user classic program (Classic-Only) */ export type ReferrerModerationStatus = ("PENDING" | "APPROVED" | "DENIED") /** * The date the referral was marked as paid (Classic-Only) */ export type DateReferralPaid = (number | null) /** * The date the referral ended (Classic-Only) */ export type DateReferralEnded = (number | null) /** * The moderation status for the referred user in the classic program (Classic-Only) */ export type ReferredModerationStatus = ("PENDING" | "APPROVED" | "DENIED") /** * The date the referral was moderated (Classic-Only) */ export type DateModerated = number /** * The rewardId of the classic program referred user's reward if available (Classic-Only) */ export type ReferredReward = (string | null) /** * The rewardId of the classic program referrer user's reward if available (Classic-Only) */ export type ReferrerReward = (string | null) /** * The unique referral identifier */ export type ReferralId1 = string /** * The referrers code that was used by the referred for the referral */ export type ReferralCodeUsed1 = string /** * The sharelink that was used by the referred for the referral */ export type ShareLinkUsed1 = string /** * The date this referral was created */ export type DateReferralStarted1 = number /** * The date the referral converted */ export type DateReferralConverted1 = (number | null) /** * The date this referral was last modified for any reason (e.g. converted, reward added, etc.) */ export type DateReferralModified1 = (number | null) /** * The date a user was added to or removed from the referral (e.g. removed as a result of user deletion) */ export type DateUserModified1 = (number | null) /** * The Id of the program this code was created for */ export type ProgramId1 = (string | null) /** * Sent whenever a classic referral event happens */ export interface ClassicReferralWebhookSchema { id: ReferralId referrer?: ReferrerUser referred?: ReferredUser referralCodeUsed?: ReferralCodeUsed shareLinkUsed?: ShareLinkUsed dateReferralStarted: DateReferralStarted dateConverted?: DateReferralConverted dateModified?: DateReferralModified dateUserModified?: DateUserModified programId?: ProgramId referrerUser: ReferrerUser1 referredUser?: ReferredUser1 fraudSignals?: FraudSignals moderationStatus: ModerationStatus referrerModerationStatus: ReferrerModerationStatus dateReferralPaid?: DateReferralPaid dateReferralEnded?: DateReferralEnded referredModerationStatus: ReferredModerationStatus dateModerated: DateModerated referredReward?: ReferredReward referrerReward?: ReferrerReward } /** * The referrer user in who initiated this referral */ export interface ReferrerUser { id: UserId accountId: AccountId } /** * The referred user who initiated this referral */ export interface ReferredUser { id: UserId accountId: AccountId } /** * Sent whenever a referral event happens and the classic program is disabled */ export interface ClassicDisabledReferralWebhookSchema { id: ReferralId1 referrer: ReferrerUser2 referred: ReferredUser2 referralCodeUsed?: ReferralCodeUsed1 shareLinkUsed?: ShareLinkUsed1 dateReferralStarted: DateReferralStarted1 dateConverted?: DateReferralConverted1 dateModified?: DateReferralModified1 dateUserModified?: DateUserModified1 programId?: ProgramId1 } /** * The referrer user in who initiated this referral */ export interface ReferrerUser2 { id: UserId accountId: AccountId } /** * The referred user who initiated this referral */ export interface ReferredUser2 { id: UserId accountId: AccountId } } // End of ReferralData // Start of RewardCreatedData declare namespace saasquatch.RewardCreatedData { /** * Sent whenever a reward is created (when it becomes available, e.g. not pending). */ export type RewardCreatedWebhookSchema = (({ type?: "PCT_DISCOUNT" discountPercent?: DiscountPercent unit?: RewardUnit name?: RewardName [k: string]: unknown } | { type?: "FUELTANK" fuelTankCode?: RewardCode unit?: RewardUnit1 amount?: RewardAmount fuelTankType?: RewardCodeType [k: string]: unknown } | { type?: "CREDIT" unit?: RewardUnit2 assignedCredit?: AssignedCredit redeemedCredit?: RedeemedCredit name?: RewardName1 redemptions?: RewardRedemptions [k: string]: unknown } | { type?: "INTEGRATION" name?: RewardName2 description?: RewardDescription unit?: RewardUnit3 valueInCents?: RewardValue integrationId?: IntegrationId rewardDetails?: RewardDetails [k: string]: unknown }) & { id: RewardId type: RewardType dateCreated: DateRewardCreated dateScheduledFor?: DateScheduledFor dateGiven?: DateGiven dateExpires?: DateExpires dateCancelled?: DateCancelled accountId: AccountId userId: UserId cancellable: IsCancellable programId?: ProgramId rewardSource: RewardSource [k: string]: unknown }) /** * The percent discount to be given (e.g. 1-100) */ export type DiscountPercent = number /** * The unit of this reward */ export type RewardUnit = "%" /** * The name given to this discount reward (e.g. Referrer Reward) */ export type RewardName = string /** * The code associated with this reward (e.g. used in fulfillment) */ export type RewardCode = string /** * The unit of this reward */ export type RewardUnit1 = string /** * The value associated with this reward (e.g. 10% or $100) */ export type RewardAmount = number /** * The type of the redeemable reward associated with the fuel tank code (e.g. is it a discount or credit) */ export type RewardCodeType = ("PCT_DISCOUNT" | "CREDIT") /** * The unit of this reward (e.g. USD) */ export type RewardUnit2 = string /** * The credit assigned to this reward (e.g. amount that can be redeemed) */ export type AssignedCredit = number /** * The amount of credit that has already been redeemed from this reward */ export type RedeemedCredit = number /** * The name given to this credit reward (e.g. Referrer Reward) */ export type RewardName1 = string /** * The unique identifier of this redemption */ export type RedemptionId = string /** * The date this redemption was made */ export type DateRedeemed = number /** * The amount that was withdrawn from this reward */ export type QuantityRedeemed = string /** * A record of how credit was redeemed from this reward */ export type RewardRedemptions = RewardRedemption[] /** * The name of this reward (e.g. Amazon Gift Card) */ export type RewardName2 = string /** * This describe the reward in more detail */ export type RewardDescription = string /** * The unit of this reward (e.g. USD) */ export type RewardUnit3 = string /** * The monetary value of this reward in its fractional unit (e.g. cents) */ export type RewardValue = number /** * The identifier for the integration that issued this reward */ export type IntegrationId = string /** * The unique identifier associated with this reward */ export type RewardId = string export type RewardType = ("PCT_DISCOUNT" | "FUELTANK" | "CREDIT" | "INTEGRATION") /** * The date this reward was created */ export type DateRewardCreated = number /** * The date this reward is scheduled to be given if it starts in a pending state */ export type DateScheduledFor = (number | null) /** * The date this reward was given (became available for use) */ export type DateGiven = (number | null) /** * The date this reward will expire */ export type DateExpires = (number | null) /** * The date this reward was cancelled */ export type DateCancelled = (number | null) /** * The account Id for the user who received this reward */ export type AccountId = string /** * The user Id for the user who received this reward */ export type UserId = string /** * Whether this reward can be cancelled (e.g. rewards that have already been fulfilled externally cannot be cancelled) */ export type IsCancellable = boolean /** * The program that issued this reward */ export type ProgramId = (string | null) /** * The source of this reward (e.g. insight into why this reward was created) */ export type RewardSource = ("FRIEND_SIGNUP" | "REFERRED" | "MANUAL" | "ACTIVATION" | "ACQUISITION" | "RETENTION" | "REACTIVATION" | "AUTOMATED") /** * An instance of credit being withdrawn from a reward * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardRedemption". */ export interface RewardRedemption { id: RedemptionId dateRedeemed: DateRedeemed quantityRedeemed: QuantityRedeemed } /** * A map of details about this reward provided by the underlying giftcard provider (e.g. Tango's utid) */ export interface RewardDetails { [k: string]: unknown } } // End of RewardCreatedData // Start of UserCreatedClassic declare namespace saasquatch.UserCreatedClassic { /** * The user's unique identifier */ export type UserId = string /** * The user's unique account identifier */ export type AccountId = string /** * The user's email address */ export type Email = (string | null) /** * The user's first name */ export type FirstName = (string | null) /** * The user's last name */ export type LastName = (string | null) /** * The initial of the user's last name */ export type LastInitial = (string | null) /** * The referral code this user will share to refer others */ export type ReferralCode = string /** * The URL to an image of this user */ export type ImageUrl = (string | null) /** * The IP address of this user when they were first seen by SaaSquatch */ export type FirstSeenIP = (string | null) /** * The IP address of this user when they were most recently seen by SaaSquatch */ export type LastSeenIP = (string | null) /** * A timestamp of the date this user was created */ export type DateCreated = number /** * An MD5 has of this user's email address */ export type EmailHash = (string | null) /** * The source of the referral as defined by referral cookie (deprecated) */ export type ReferralSource = (string | null) /** * This user's unique locale */ export type Locale = (string | null) /** * The user's country code */ export type CountryCode = (string | null) /** * The primary referral code associated with the programId key * * This interface was referenced by `ReferralCodes`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export type ReferralCode1 = string /** * The anonymous cookie user identifier associated with this user if applicable (see anonymous users) */ export type AnonymousCookieUserId = (string | null) /** * Unique user identifier for tenants using a v1 payment provider integration (e.g. Stripe/Recurly) */ export type PaymentProviderId = (string | null) /** * True if this user can be referred in a program by other users */ export type Referable = boolean /** * The date the referral was blocked */ export type DateBlocked = (string | null) /** * The share link tracked with DIRECT share medium and UNKNOWN engagement medium */ export type DirectShareLink = string /** * The share link tracked with FACEBOOK share medium and UNKNOWN engagement medium */ export type FacebookShareLink = string /** * The share link tracked with TWITTER share medium and UNKNOWN engagement medium */ export type TwitterShareLink = string /** * The share link tracked with EMAIL share medium and UNKNOWN engagement medium */ export type EmailShareLink = string /** * The share link tracked with LINKEDIN share medium and UNKNOWN engagement medium */ export type LinkedInShareLink = string /** * The share link tracked with DIRECT share medium and MOBILE engagement medium */ export type MobileDirectShareLink = string /** * The share link tracked with FACEBOOK share medium and MOBILE engagement medium */ export type MobileFacebookShareLink = string /** * The share link tracked with TWITTER share medium and MOBILE engagement medium */ export type MobileTwitterShareLink = string /** * The share link tracked with EMAIL share medium and MOBILE engagement medium */ export type MobileEmailShareLink = string /** * The share link tracked with DIRECT share medium */ export type DirectShareLink1 = string /** * The share link tracked with FACEBOOK share medium */ export type FacebookShareLink1 = string /** * The share link tracked with TWITTER share medium */ export type TwitterShareLink1 = string /** * The share link tracked with EMAIL share medium */ export type EmailShareLink1 = string /** * The share link tracked with LINKEDIN share medium */ export type LinkedInShareLink1 = string /** * Any codes used to refer this user */ export type ReferredByCodes = string[] /** * Any segments this user belongs to */ export type UserSegments = string[] /** * If the program's primary link is a vanity link then this will be the unencoded link, if not it is the UNKNOWN engagement medium and UNKOWN share medium link */ export type CleanLinkForGivenProgram = string /** * Share link associated with the DIRECT share medium */ export type DirectShareLink2 = string /** * Sent whenever a new user is created in SaaSquatch program where the classic program is enabled. */ export interface ClassicUserCreatedWebhookSchema { id: UserId accountId: AccountId email?: Email firstName?: FirstName lastName?: LastName lastInitial?: LastInitial referralCode: ReferralCode imageUrl?: ImageUrl firstSeenIP?: FirstSeenIP lastSeenIP?: LastSeenIP dateCreated: DateCreated emailHash?: EmailHash referralSource?: ReferralSource locale?: Locale countryCode?: CountryCode referralCodes: ReferralCodes cookieId?: AnonymousCookieUserId paymentProviderId?: PaymentProviderId referable: Referable dateBlocked?: DateBlocked shareLinks: ShareLinks referredByCodes?: ReferredByCodes customFields?: CustomFields segments?: UserSegments programShareLinks?: ProgramShareLinks } /** * A map of programs to referral codes. */ export interface ReferralCodes { [k: string]: ReferralCode1 } /** * Links this user can share to make referrals * * This interface was referenced by `ClassicUserCreatedWebhookSchema`'s JSON-Schema * via the `definition` "classicShareLinks". */ export interface ShareLinks { shareLink: DirectShareLink facebookShareLink: FacebookShareLink twitterShareLink: TwitterShareLink emailShareLink: EmailShareLink linkedinShareLink: LinkedInShareLink mobileShareLink: MobileDirectShareLink mobileFacebookShareLink: MobileFacebookShareLink mobileTwitterShareLink: MobileTwitterShareLink mobileEmailShareLink: MobileEmailShareLink EMBED: EmbeddedWidgetShareLinks POPUP: PopupWidgetShareLinks HOSTED: HostedWidgetShareLinks MOBILE: MobileWidgetShareLinks EMAIL: EmailWidgetShareLinks } /** * A list of share links associated with the EMBED engagement medium */ export interface EmbeddedWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the POPUP engagement medium */ export interface PopupWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the HOSTED engagement medium */ export interface HostedWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the MOBILE engagement medium */ export interface MobileWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the EMAIL engagement medium */ export interface EmailWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * Any custom fields set for this user */ export interface CustomFields { /** * This interface was referenced by `CustomFields`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". */ [k: string]: (string | boolean | number | null) } /** * Links this user can share to make referrals */ export interface ProgramShareLinks { [k: string]: ProgramShareLink } /** * The primary share links available for this program * * This interface was referenced by `ProgramShareLinks`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export interface ProgramShareLink { cleanShareLink: CleanLinkForGivenProgram MOBILE: MobileShareLinks EMAIL: EmailShareLinks UNKNOWN: ShareLinks1 } /** * Share links tracked with the MOBILE engagement medium */ export interface MobileShareLinks { DIRECT: DirectShareLink2 } /** * Share links tracked with the EMAIL engagement medium */ export interface EmailShareLinks { DIRECT: DirectShareLink2 } /** * Share links tracked with the UNKNOWN engagement medium */ export interface ShareLinks1 { DIRECT: DirectShareLink2 } /** * This interface was referenced by `ClassicUserCreatedWebhookSchema`'s JSON-Schema * via the `definition` "subClassicShareLinks". */ export interface SubClassicShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } } // End of UserCreatedClassic // Start of UserCreatedClassicDisabled declare namespace saasquatch.UserCreatedClassicDisabled { /** * The user's unique identifier */ export type UserId = string /** * The user's unique account identifier */ export type AccountId = string /** * The user's email address */ export type Email = (string | null) /** * The user's first name */ export type FirstName = (string | null) /** * The user's last name */ export type LastName = (string | null) /** * The URL to an image of this user */ export type ImageUrl = (string | null) /** * The IP address of this user when they were first seen by SaaSquatch */ export type FirstSeenIP = (string | null) /** * The IP address of this user when they were most recently seen by SaaSquatch */ export type LastSeenIP = (string | null) /** * A timestamp of the date this user was created */ export type DateCreated = number /** * This user's unique locale */ export type Locale = (string | null) /** * The user's country code */ export type CountryCode = (string | null) /** * The primary referral code associated with the programId key * * This interface was referenced by `ReferralCodes`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export type ReferralCode = string /** * True if this user can be referred in a program by other users */ export type Referable = boolean /** * Any codes used to refer this user */ export type ReferredByCodes = string[] /** * The anonymous cookie user identifier associated with this user if applicable (see anonymous users) */ export type AnonymousCookieUserId = (string | null) /** * The date the referral was blocked */ export type DateBlocked = (string | null) /** * Any segments this user belongs to */ export type UserSegments = string[] /** * If the program's primary link is a vanity link then this will be the unencoded link, if not it is the UNKNOWN engagement medium and UNKOWN share medium link */ export type CleanLinkForGivenProgram = string /** * Share link associated with the DIRECT share medium */ export type DirectShareLink = string /** * Sent whenever a new user is created in SaaSquatch program where the classic program is disabled. */ export interface UserCreatedWebhookSchema { id: UserId accountId: AccountId email?: Email firstName?: FirstName lastName?: LastName imageUrl?: ImageUrl firstSeenIP?: FirstSeenIP lastSeenIP?: LastSeenIP dateCreated: DateCreated locale?: Locale countryCode?: CountryCode referralCodes?: ReferralCodes referable: Referable referredByCodes?: ReferredByCodes cookieId?: AnonymousCookieUserId dateBlocked?: DateBlocked customFields?: CustomFields segments?: UserSegments programShareLinks?: ProgramShareLinks } /** * A map of programs to referral codes. */ export interface ReferralCodes { [k: string]: ReferralCode } /** * Any custom fields set for this user */ export interface CustomFields { /** * This interface was referenced by `CustomFields`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". */ [k: string]: (string | boolean | number | null) } /** * Links this user can share to make referrals */ export interface ProgramShareLinks { [k: string]: ProgramShareLink } /** * The primary share links available for this program * * This interface was referenced by `ProgramShareLinks`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export interface ProgramShareLink { cleanShareLink: CleanLinkForGivenProgram MOBILE: MobileShareLinks EMAIL: EmailShareLinks UNKNOWN: ShareLinks } /** * Share links tracked with the MOBILE engagement medium */ export interface MobileShareLinks { DIRECT: DirectShareLink } /** * Share links tracked with the EMAIL engagement medium */ export interface EmailShareLinks { DIRECT: DirectShareLink } /** * Share links tracked with the UNKNOWN engagement medium */ export interface ShareLinks { DIRECT: DirectShareLink } } // End of UserCreatedClassicDisabled // Start of UserCreatedData declare namespace saasquatch.UserCreatedData { /** * Sent whenever a new user is created in SaaSquatch program where the classic program is enabled. */ export type ClassicUserCreatedWebhookSchema = (ClassicUserCreatedWebhookSchema1 | UserCreatedWebhookSchema) /** * The user's unique identifier */ export type UserId = string /** * The user's unique account identifier */ export type AccountId = string /** * The user's email address */ export type Email = (string | null) /** * The user's first name */ export type FirstName = (string | null) /** * The user's last name */ export type LastName = (string | null) /** * The initial of the user's last name */ export type LastInitial = (string | null) /** * The referral code this user will share to refer others */ export type ReferralCode = string /** * The URL to an image of this user */ export type ImageUrl = (string | null) /** * The IP address of this user when they were first seen by SaaSquatch */ export type FirstSeenIP = (string | null) /** * The IP address of this user when they were most recently seen by SaaSquatch */ export type LastSeenIP = (string | null) /** * A timestamp of the date this user was created */ export type DateCreated = number /** * An MD5 has of this user's email address */ export type EmailHash = (string | null) /** * The source of the referral as defined by referral cookie (deprecated) */ export type ReferralSource = (string | null) /** * This user's unique locale */ export type Locale = (string | null) /** * The user's country code */ export type CountryCode = (string | null) /** * The primary referral code associated with the programId key * * This interface was referenced by `ReferralCodes`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export type ReferralCode1 = string /** * The anonymous cookie user identifier associated with this user if applicable (see anonymous users) */ export type AnonymousCookieUserId = (string | null) /** * Unique user identifier for tenants using a v1 payment provider integration (e.g. Stripe/Recurly) */ export type PaymentProviderId = (string | null) /** * True if this user can be referred in a program by other users */ export type Referable = boolean /** * The date the referral was blocked */ export type DateBlocked = (string | null) /** * The share link tracked with DIRECT share medium and UNKNOWN engagement medium */ export type DirectShareLink = string /** * The share link tracked with FACEBOOK share medium and UNKNOWN engagement medium */ export type FacebookShareLink = string /** * The share link tracked with TWITTER share medium and UNKNOWN engagement medium */ export type TwitterShareLink = string /** * The share link tracked with EMAIL share medium and UNKNOWN engagement medium */ export type EmailShareLink = string /** * The share link tracked with LINKEDIN share medium and UNKNOWN engagement medium */ export type LinkedInShareLink = string /** * The share link tracked with DIRECT share medium and MOBILE engagement medium */ export type MobileDirectShareLink = string /** * The share link tracked with FACEBOOK share medium and MOBILE engagement medium */ export type MobileFacebookShareLink = string /** * The share link tracked with TWITTER share medium and MOBILE engagement medium */ export type MobileTwitterShareLink = string /** * The share link tracked with EMAIL share medium and MOBILE engagement medium */ export type MobileEmailShareLink = string /** * The share link tracked with DIRECT share medium */ export type DirectShareLink1 = string /** * The share link tracked with FACEBOOK share medium */ export type FacebookShareLink1 = string /** * The share link tracked with TWITTER share medium */ export type TwitterShareLink1 = string /** * The share link tracked with EMAIL share medium */ export type EmailShareLink1 = string /** * The share link tracked with LINKEDIN share medium */ export type LinkedInShareLink1 = string /** * Any codes used to refer this user */ export type ReferredByCodes = string[] /** * Any segments this user belongs to */ export type UserSegments = string[] /** * If the program's primary link is a vanity link then this will be the unencoded link, if not it is the UNKNOWN engagement medium and UNKOWN share medium link */ export type CleanLinkForGivenProgram = string /** * Share link associated with the DIRECT share medium */ export type DirectShareLink2 = string /** * The user's unique identifier */ export type UserId1 = string /** * The user's unique account identifier */ export type AccountId1 = string /** * The user's email address */ export type Email1 = (string | null) /** * The user's first name */ export type FirstName1 = (string | null) /** * The user's last name */ export type LastName1 = (string | null) /** * The URL to an image of this user */ export type ImageUrl1 = (string | null) /** * The IP address of this user when they were first seen by SaaSquatch */ export type FirstSeenIP1 = (string | null) /** * The IP address of this user when they were most recently seen by SaaSquatch */ export type LastSeenIP1 = (string | null) /** * A timestamp of the date this user was created */ export type DateCreated1 = number /** * This user's unique locale */ export type Locale1 = (string | null) /** * The user's country code */ export type CountryCode1 = (string | null) /** * True if this user can be referred in a program by other users */ export type Referable1 = boolean /** * Any codes used to refer this user */ export type ReferredByCodes1 = string[] /** * The anonymous cookie user identifier associated with this user if applicable (see anonymous users) */ export type AnonymousCookieUserId1 = (string | null) /** * The date the referral was blocked */ export type DateBlocked1 = (string | null) /** * Any segments this user belongs to */ export type UserSegments1 = string[] /** * Sent whenever a new user is created in SaaSquatch program where the classic program is enabled. */ export interface ClassicUserCreatedWebhookSchema1 { id: UserId accountId: AccountId email?: Email firstName?: FirstName lastName?: LastName lastInitial?: LastInitial referralCode: ReferralCode imageUrl?: ImageUrl firstSeenIP?: FirstSeenIP lastSeenIP?: LastSeenIP dateCreated: DateCreated emailHash?: EmailHash referralSource?: ReferralSource locale?: Locale countryCode?: CountryCode referralCodes: ReferralCodes cookieId?: AnonymousCookieUserId paymentProviderId?: PaymentProviderId referable: Referable dateBlocked?: DateBlocked shareLinks: ShareLinks referredByCodes?: ReferredByCodes customFields?: CustomFields segments?: UserSegments programShareLinks?: ProgramShareLinks } /** * A map of programs to referral codes. */ export interface ReferralCodes { [k: string]: ReferralCode1 } /** * Links this user can share to make referrals * * This interface was referenced by `ClassicUserCreatedWebhookSchema1`'s JSON-Schema * via the `definition` "classicShareLinks". */ export interface ShareLinks { shareLink: DirectShareLink facebookShareLink: FacebookShareLink twitterShareLink: TwitterShareLink emailShareLink: EmailShareLink linkedinShareLink: LinkedInShareLink mobileShareLink: MobileDirectShareLink mobileFacebookShareLink: MobileFacebookShareLink mobileTwitterShareLink: MobileTwitterShareLink mobileEmailShareLink: MobileEmailShareLink EMBED: EmbeddedWidgetShareLinks POPUP: PopupWidgetShareLinks HOSTED: HostedWidgetShareLinks MOBILE: MobileWidgetShareLinks EMAIL: EmailWidgetShareLinks } /** * A list of share links associated with the EMBED engagement medium */ export interface EmbeddedWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the POPUP engagement medium */ export interface PopupWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the HOSTED engagement medium */ export interface HostedWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the MOBILE engagement medium */ export interface MobileWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the EMAIL engagement medium */ export interface EmailWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * Any custom fields set for this user */ export interface CustomFields { /** * This interface was referenced by `CustomFields`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". * * This interface was referenced by `CustomFields1`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". */ [k: string]: (string | boolean | number | null) } /** * Links this user can share to make referrals */ export interface ProgramShareLinks { [k: string]: ProgramShareLink } /** * The primary share links available for this program * * This interface was referenced by `ProgramShareLinks`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export interface ProgramShareLink { cleanShareLink: CleanLinkForGivenProgram MOBILE: MobileShareLinks EMAIL: EmailShareLinks UNKNOWN: ShareLinks1 } /** * Share links tracked with the MOBILE engagement medium */ export interface MobileShareLinks { DIRECT: DirectShareLink2 } /** * Share links tracked with the EMAIL engagement medium */ export interface EmailShareLinks { DIRECT: DirectShareLink2 } /** * Share links tracked with the UNKNOWN engagement medium */ export interface ShareLinks1 { DIRECT: DirectShareLink2 } /** * Sent whenever a new user is created in SaaSquatch program where the classic program is disabled. */ export interface UserCreatedWebhookSchema { id: UserId1 accountId: AccountId1 email?: Email1 firstName?: FirstName1 lastName?: LastName1 imageUrl?: ImageUrl1 firstSeenIP?: FirstSeenIP1 lastSeenIP?: LastSeenIP1 dateCreated: DateCreated1 locale?: Locale1 countryCode?: CountryCode1 referralCodes?: ReferralCodes referable: Referable1 referredByCodes?: ReferredByCodes1 cookieId?: AnonymousCookieUserId1 dateBlocked?: DateBlocked1 customFields?: CustomFields1 segments?: UserSegments1 programShareLinks?: ProgramShareLinks } /** * Any custom fields set for this user */ export interface CustomFields1 { /** * This interface was referenced by `CustomFields`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". * * This interface was referenced by `CustomFields1`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". */ [k: string]: (string | boolean | number | null) } } // End of UserCreatedData // Start of UserRewardBalanceChanged declare namespace saasquatch.UserRewardBalanceChanged { /** * The user's unique identifier */ export type UserId = string /** * The user's unique account identifier */ export type AccountId = string /** * The unit corresponding to this reward balance */ export type RewardBalanceUnit = string /** * The reward balance available to be redeemed */ export type AvailableRewardBalance = number /** * An integer value reflective of when the balance was generated, the greater the value the more recent the balance */ export type ResourceVersion = number /** * Sent whenever something happens to change this user's available reward balance (e.g. rewards given/expired/etc) */ export interface UserRewardBalanceChangedWebhookSchema { userId?: UserId accountId?: AccountId unit?: RewardBalanceUnit availableValue?: AvailableRewardBalance resourceVersion?: ResourceVersion [k: string]: unknown } } // End of UserRewardBalanceChanged // Start of Webhook declare namespace saasquatch.Webhook { /** * The types of webhooks supported by SaaSquatch with their corresponding structures. */ export type WebhookSchema = (({ type?: "user.created" data?: ClassicUserCreatedWebhookSchema [k: string]: unknown } | { type?: "coupon.created" data?: CouponCreatedWebhookSchema [k: string]: unknown } | { type?: "reward.created" data?: RewardCreatedWebhookSchema [k: string]: unknown } | { type?: "referral.started" data?: ReferralDataWebhookSchema [k: string]: unknown } | { type?: "referral.converted" data?: ReferralDataWebhookSchema [k: string]: unknown } | { type?: "export.created" data?: ExportWebhookSchema [k: string]: unknown } | { type?: "export.completed" data?: ExportWebhookSchema [k: string]: unknown } | { type?: "user.reward.balance.changed" data?: UserRewardBalanceChangedWebhookSchema [k: string]: unknown }) & { id: WebhookId type: WebhookType tenantAlias: TenantAlias live: IsLiveTenant created: Created [k: string]: unknown }) /** * Sent whenever a new user is created in SaaSquatch program where the classic program is enabled. */ export type ClassicUserCreatedWebhookSchema = (ClassicUserCreatedWebhookSchema1 | UserCreatedWebhookSchema) /** * The user's unique identifier */ export type UserId = string /** * The user's unique account identifier */ export type AccountId = string /** * The user's email address */ export type Email = (string | null) /** * The user's first name */ export type FirstName = (string | null) /** * The user's last name */ export type LastName = (string | null) /** * The initial of the user's last name */ export type LastInitial = (string | null) /** * The referral code this user will share to refer others */ export type ReferralCode = string /** * The URL to an image of this user */ export type ImageUrl = (string | null) /** * The IP address of this user when they were first seen by SaaSquatch */ export type FirstSeenIP = (string | null) /** * The IP address of this user when they were most recently seen by SaaSquatch */ export type LastSeenIP = (string | null) /** * A timestamp of the date this user was created */ export type DateCreated = number /** * An MD5 has of this user's email address */ export type EmailHash = (string | null) /** * The source of the referral as defined by referral cookie (deprecated) */ export type ReferralSource = (string | null) /** * This user's unique locale */ export type Locale = (string | null) /** * The user's country code */ export type CountryCode = (string | null) /** * The primary referral code associated with the programId key * * This interface was referenced by `ReferralCodes`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export type ReferralCode1 = string /** * The anonymous cookie user identifier associated with this user if applicable (see anonymous users) */ export type AnonymousCookieUserId = (string | null) /** * Unique user identifier for tenants using a v1 payment provider integration (e.g. Stripe/Recurly) */ export type PaymentProviderId = (string | null) /** * True if this user can be referred in a program by other users */ export type Referable = boolean /** * The date the referral was blocked */ export type DateBlocked = (string | null) /** * The share link tracked with DIRECT share medium and UNKNOWN engagement medium */ export type DirectShareLink = string /** * The share link tracked with FACEBOOK share medium and UNKNOWN engagement medium */ export type FacebookShareLink = string /** * The share link tracked with TWITTER share medium and UNKNOWN engagement medium */ export type TwitterShareLink = string /** * The share link tracked with EMAIL share medium and UNKNOWN engagement medium */ export type EmailShareLink = string /** * The share link tracked with LINKEDIN share medium and UNKNOWN engagement medium */ export type LinkedInShareLink = string /** * The share link tracked with DIRECT share medium and MOBILE engagement medium */ export type MobileDirectShareLink = string /** * The share link tracked with FACEBOOK share medium and MOBILE engagement medium */ export type MobileFacebookShareLink = string /** * The share link tracked with TWITTER share medium and MOBILE engagement medium */ export type MobileTwitterShareLink = string /** * The share link tracked with EMAIL share medium and MOBILE engagement medium */ export type MobileEmailShareLink = string /** * The share link tracked with DIRECT share medium */ export type DirectShareLink1 = string /** * The share link tracked with FACEBOOK share medium */ export type FacebookShareLink1 = string /** * The share link tracked with TWITTER share medium */ export type TwitterShareLink1 = string /** * The share link tracked with EMAIL share medium */ export type EmailShareLink1 = string /** * The share link tracked with LINKEDIN share medium */ export type LinkedInShareLink1 = string /** * Any codes used to refer this user */ export type ReferredByCodes = string[] /** * Any segments this user belongs to */ export type UserSegments = string[] /** * If the program's primary link is a vanity link then this will be the unencoded link, if not it is the UNKNOWN engagement medium and UNKOWN share medium link */ export type CleanLinkForGivenProgram = string /** * Share link associated with the DIRECT share medium */ export type DirectShareLink2 = string /** * The user's unique identifier */ export type UserId1 = string /** * The user's unique account identifier */ export type AccountId1 = string /** * The user's email address */ export type Email1 = (string | null) /** * The user's first name */ export type FirstName1 = (string | null) /** * The user's last name */ export type LastName1 = (string | null) /** * The URL to an image of this user */ export type ImageUrl1 = (string | null) /** * The IP address of this user when they were first seen by SaaSquatch */ export type FirstSeenIP1 = (string | null) /** * The IP address of this user when they were most recently seen by SaaSquatch */ export type LastSeenIP1 = (string | null) /** * A timestamp of the date this user was created */ export type DateCreated1 = number /** * This user's unique locale */ export type Locale1 = (string | null) /** * The user's country code */ export type CountryCode1 = (string | null) /** * True if this user can be referred in a program by other users */ export type Referable1 = boolean /** * Any codes used to refer this user */ export type ReferredByCodes1 = string[] /** * The anonymous cookie user identifier associated with this user if applicable (see anonymous users) */ export type AnonymousCookieUserId1 = (string | null) /** * The date the referral was blocked */ export type DateBlocked1 = (string | null) /** * Any segments this user belongs to */ export type UserSegments1 = string[] /** * The code to be shared */ export type Code = string /** * The date this code was created */ export type DateCreated2 = number /** * The Id of the program this code was created for */ export type ProgramId = (string | null) /** * Sent whenever a reward is created (when it becomes available, e.g. not pending). */ export type RewardCreatedWebhookSchema = (({ type?: "PCT_DISCOUNT" discountPercent?: DiscountPercent unit?: RewardUnit name?: RewardName [k: string]: unknown } | { type?: "FUELTANK" fuelTankCode?: RewardCode unit?: RewardUnit1 amount?: RewardAmount fuelTankType?: RewardCodeType [k: string]: unknown } | { type?: "CREDIT" unit?: RewardUnit2 assignedCredit?: AssignedCredit redeemedCredit?: RedeemedCredit name?: RewardName1 redemptions?: RewardRedemptions [k: string]: unknown } | { type?: "INTEGRATION" name?: RewardName2 description?: RewardDescription unit?: RewardUnit3 valueInCents?: RewardValue integrationId?: IntegrationId rewardDetails?: RewardDetails [k: string]: unknown }) & { id: RewardId type: RewardType dateCreated: DateRewardCreated dateScheduledFor?: DateScheduledFor dateGiven?: DateGiven dateExpires?: DateExpires dateCancelled?: DateCancelled accountId: AccountId2 userId: UserId2 cancellable: IsCancellable programId?: ProgramId1 rewardSource: RewardSource [k: string]: unknown }) /** * The percent discount to be given (e.g. 1-100) */ export type DiscountPercent = number /** * The unit of this reward */ export type RewardUnit = "%" /** * The name given to this discount reward (e.g. Referrer Reward) */ export type RewardName = string /** * The code associated with this reward (e.g. used in fulfillment) */ export type RewardCode = string /** * The unit of this reward */ export type RewardUnit1 = string /** * The value associated with this reward (e.g. 10% or $100) */ export type RewardAmount = number /** * The type of the redeemable reward associated with the fuel tank code (e.g. is it a discount or credit) */ export type RewardCodeType = ("PCT_DISCOUNT" | "CREDIT") /** * The unit of this reward (e.g. USD) */ export type RewardUnit2 = string /** * The credit assigned to this reward (e.g. amount that can be redeemed) */ export type AssignedCredit = number /** * The amount of credit that has already been redeemed from this reward */ export type RedeemedCredit = number /** * The name given to this credit reward (e.g. Referrer Reward) */ export type RewardName1 = string /** * The unique identifier of this redemption */ export type RedemptionId = string /** * The date this redemption was made */ export type DateRedeemed = number /** * The amount that was withdrawn from this reward */ export type QuantityRedeemed = string /** * A record of how credit was redeemed from this reward */ export type RewardRedemptions = RewardRedemption[] /** * The name of this reward (e.g. Amazon Gift Card) */ export type RewardName2 = string /** * This describe the reward in more detail */ export type RewardDescription = string /** * The unit of this reward (e.g. USD) */ export type RewardUnit3 = string /** * The monetary value of this reward in its fractional unit (e.g. cents) */ export type RewardValue = number /** * The identifier for the integration that issued this reward */ export type IntegrationId = string /** * The unique identifier associated with this reward */ export type RewardId = string export type RewardType = ("PCT_DISCOUNT" | "FUELTANK" | "CREDIT" | "INTEGRATION") /** * The date this reward was created */ export type DateRewardCreated = number /** * The date this reward is scheduled to be given if it starts in a pending state */ export type DateScheduledFor = (number | null) /** * The date this reward was given (became available for use) */ export type DateGiven = (number | null) /** * The date this reward will expire */ export type DateExpires = (number | null) /** * The date this reward was cancelled */ export type DateCancelled = (number | null) /** * The account Id for the user who received this reward */ export type AccountId2 = string /** * The user Id for the user who received this reward */ export type UserId2 = string /** * Whether this reward can be cancelled (e.g. rewards that have already been fulfilled externally cannot be cancelled) */ export type IsCancellable = boolean /** * The program that issued this reward */ export type ProgramId1 = (string | null) /** * The source of this reward (e.g. insight into why this reward was created) */ export type RewardSource = ("FRIEND_SIGNUP" | "REFERRED" | "MANUAL" | "ACTIVATION" | "ACQUISITION" | "RETENTION" | "REACTIVATION" | "AUTOMATED") /** * Sent whenever a referral event happens */ export type ReferralDataWebhookSchema = (ClassicReferralWebhookSchema | ClassicDisabledReferralWebhookSchema) /** * The unique referral identifier */ export type ReferralId = string /** * This user's unique identifier */ export type UserId3 = string /** * The unique identifier of the account this user belongs to */ export type AccountId3 = string /** * The referrers code that was used by the referred for the referral */ export type ReferralCodeUsed = string /** * The sharelink that was used by the referred for the referral */ export type ShareLinkUsed = string /** * The date this referral was created */ export type DateReferralStarted = number /** * The date the referral converted */ export type DateReferralConverted = (number | null) /** * The date this referral was last modified for any reason (e.g. converted, reward added, etc.) */ export type DateReferralModified = (number | null) /** * The date a user was added to or removed from the referral (e.g. removed as a result of user deletion) */ export type DateUserModified = (number | null) /** * The Id of the program this code was created for */ export type ProgramId2 = (string | null) /** * The userId of the referrer user (Classic-Only) */ export type ReferrerUser1 = string /** * The userId of the referred user (Classic-Only) */ export type ReferredUser1 = string /** * A set of fraud flags generated for the classic referral program (Classic-Only) */ export type FraudSignals = ({ [k: string]: unknown } | null) /** * The referral fraud moderation status for the classic program (Classic-Only) */ export type ModerationStatus = ("PENDING" | "ACTIONED") /** * The referral moderation status for the referrer user classic program (Classic-Only) */ export type ReferrerModerationStatus = ("PENDING" | "APPROVED" | "DENIED") /** * The date the referral was marked as paid (Classic-Only) */ export type DateReferralPaid = (number | null) /** * The date the referral ended (Classic-Only) */ export type DateReferralEnded = (number | null) /** * The moderation status for the referred user in the classic program (Classic-Only) */ export type ReferredModerationStatus = ("PENDING" | "APPROVED" | "DENIED") /** * The date the referral was moderated (Classic-Only) */ export type DateModerated = number /** * The rewardId of the classic program referred user's reward if available (Classic-Only) */ export type ReferredReward = (string | null) /** * The rewardId of the classic program referrer user's reward if available (Classic-Only) */ export type ReferrerReward = (string | null) /** * The unique referral identifier */ export type ReferralId1 = string /** * The referrers code that was used by the referred for the referral */ export type ReferralCodeUsed1 = string /** * The sharelink that was used by the referred for the referral */ export type ShareLinkUsed1 = string /** * The date this referral was created */ export type DateReferralStarted1 = number /** * The date the referral converted */ export type DateReferralConverted1 = (number | null) /** * The date this referral was last modified for any reason (e.g. converted, reward added, etc.) */ export type DateReferralModified1 = (number | null) /** * The date a user was added to or removed from the referral (e.g. removed as a result of user deletion) */ export type DateUserModified1 = (number | null) /** * The Id of the program this code was created for */ export type ProgramId3 = (string | null) /** * The unique identifier for this export */ export type ExportId = string /** * The name of this export (e.g. User Details) */ export type ExportName = (string | null) /** * The person or machine that requested this export */ export type Requester = string /** * The status of this export (e.g. is it running/finished?) */ export type Status = ("PENDING" | "ABORTED" | "COMPLETED") /** * The date this export was created */ export type DateCreated3 = number /** * The date this export completed */ export type DateCompleted = (number | null) /** * The email address that will receive a download link for this export when it completes */ export type NotificationEmailAddress = (string | null) /** * The date this export expires (e.g. when it will no longer be downloadable) */ export type DateExpires1 = (number | null) /** * The format this export will be generated in (e.g. CSV or Excel) */ export type OutputFormat = ("XLSX" | "CSV") /** * The type of export generated */ export type ExportType = ("USER" | "REFERRAL" | "REWARD_BALANCE" | "USER_REWARD_BALANCE" | "USER_REFERRAL" | "REFERRAL_PARTICIPANT" | "REDEEMABLE_REWARD_BALANCE") /** * The operation being performed (for exports this is always QUERY) */ export type Operation = string /** * Statistics recorded upon completions of the export */ export type ExportStats = (({ recordsProcessed?: RecordsProcessed errors?: Errors } | (null & { recordsProcessed?: RecordsProcessed errors?: Errors })) & { recordsProcessed?: RecordsProcessed errors?: Errors }) /** * The number of records that were processed to complete this export */ export type RecordsProcessed = number /** * The number of errors that occurred while running this export */ export type Errors = number /** * A link to an uploaded file, if this export was based on an uploaded file (e.g. a list of redemption) */ export type UploadedFileReference = (string | null) /** * The user's unique identifier */ export type UserId4 = string /** * The user's unique account identifier */ export type AccountId4 = string /** * The unit corresponding to this reward balance */ export type RewardBalanceUnit = string /** * The reward balance available to be redeemed */ export type AvailableRewardBalance = number /** * An integer value reflective of when the balance was generated, the greater the value the more recent the balance */ export type ResourceVersion = number /** * A unique Id associated with this webhook */ export type WebhookId = string /** * The type of this webhook */ export type WebhookType = ("user.created" | "coupon.created" | "reward.created" | "referral.started" | "referral.converted" | "export.created" | "export.completed" | "user.reward.balance.changed") /** * The identifier for the tenant that generated this webhook */ export type TenantAlias = string /** * Indicates whether this is a live or test tenant */ export type IsLiveTenant = boolean /** * The date this webhook was created */ export type Created = number /** * Sent whenever a new user is created in SaaSquatch program where the classic program is enabled. */ export interface ClassicUserCreatedWebhookSchema1 { id: UserId accountId: AccountId email?: Email firstName?: FirstName lastName?: LastName lastInitial?: LastInitial referralCode: ReferralCode imageUrl?: ImageUrl firstSeenIP?: FirstSeenIP lastSeenIP?: LastSeenIP dateCreated: DateCreated emailHash?: EmailHash referralSource?: ReferralSource locale?: Locale countryCode?: CountryCode referralCodes: ReferralCodes cookieId?: AnonymousCookieUserId paymentProviderId?: PaymentProviderId referable: Referable dateBlocked?: DateBlocked shareLinks: ShareLinks referredByCodes?: ReferredByCodes customFields?: CustomFields segments?: UserSegments programShareLinks?: ProgramShareLinks } /** * A map of programs to referral codes. */ export interface ReferralCodes { [k: string]: ReferralCode1 } /** * Links this user can share to make referrals * * This interface was referenced by `ClassicUserCreatedWebhookSchema1`'s JSON-Schema * via the `definition` "classicShareLinks". */ export interface ShareLinks { shareLink: DirectShareLink facebookShareLink: FacebookShareLink twitterShareLink: TwitterShareLink emailShareLink: EmailShareLink linkedinShareLink: LinkedInShareLink mobileShareLink: MobileDirectShareLink mobileFacebookShareLink: MobileFacebookShareLink mobileTwitterShareLink: MobileTwitterShareLink mobileEmailShareLink: MobileEmailShareLink EMBED: EmbeddedWidgetShareLinks POPUP: PopupWidgetShareLinks HOSTED: HostedWidgetShareLinks MOBILE: MobileWidgetShareLinks EMAIL: EmailWidgetShareLinks } /** * A list of share links associated with the EMBED engagement medium */ export interface EmbeddedWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the POPUP engagement medium */ export interface PopupWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the HOSTED engagement medium */ export interface HostedWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the MOBILE engagement medium */ export interface MobileWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * A list of share links associated with the EMAIL engagement medium */ export interface EmailWidgetShareLinks { shareLink: DirectShareLink1 facebookShareLink: FacebookShareLink1 twitterShareLink: TwitterShareLink1 emailShareLink: EmailShareLink1 linkedinShareLink: LinkedInShareLink1 } /** * Any custom fields set for this user */ export interface CustomFields { /** * This interface was referenced by `CustomFields`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". * * This interface was referenced by `CustomFields1`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". */ [k: string]: (string | boolean | number | null) } /** * Links this user can share to make referrals */ export interface ProgramShareLinks { [k: string]: ProgramShareLink } /** * The primary share links available for this program * * This interface was referenced by `ProgramShareLinks`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9-]{1,64}$". */ export interface ProgramShareLink { cleanShareLink: CleanLinkForGivenProgram MOBILE: MobileShareLinks EMAIL: EmailShareLinks UNKNOWN: ShareLinks1 } /** * Share links tracked with the MOBILE engagement medium */ export interface MobileShareLinks { DIRECT: DirectShareLink2 } /** * Share links tracked with the EMAIL engagement medium */ export interface EmailShareLinks { DIRECT: DirectShareLink2 } /** * Share links tracked with the UNKNOWN engagement medium */ export interface ShareLinks1 { DIRECT: DirectShareLink2 } /** * Sent whenever a new user is created in SaaSquatch program where the classic program is disabled. */ export interface UserCreatedWebhookSchema { id: UserId1 accountId: AccountId1 email?: Email1 firstName?: FirstName1 lastName?: LastName1 imageUrl?: ImageUrl1 firstSeenIP?: FirstSeenIP1 lastSeenIP?: LastSeenIP1 dateCreated: DateCreated1 locale?: Locale1 countryCode?: CountryCode1 referralCodes?: ReferralCodes referable: Referable1 referredByCodes?: ReferredByCodes1 cookieId?: AnonymousCookieUserId1 dateBlocked?: DateBlocked1 customFields?: CustomFields1 segments?: UserSegments1 programShareLinks?: ProgramShareLinks } /** * Any custom fields set for this user */ export interface CustomFields1 { /** * This interface was referenced by `CustomFields`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". * * This interface was referenced by `CustomFields1`'s JSON-Schema definition * via the `patternProperty` "^[a-zA-Z0-9_]{1,64}$". */ [k: string]: (string | boolean | number | null) } /** * Sent when a new coupon (referral code) is created, often when the user is created or interacts with a newly activated program */ export interface CouponCreatedWebhookSchema { code: Code dateCreated: DateCreated2 programId?: ProgramId } /** * An instance of credit being withdrawn from a reward * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardRedemption". */ export interface RewardRedemption { id: RedemptionId dateRedeemed: DateRedeemed quantityRedeemed: QuantityRedeemed } /** * A map of details about this reward provided by the underlying giftcard provider (e.g. Tango's utid) */ export interface RewardDetails { [k: string]: unknown } /** * Sent whenever a classic referral event happens */ export interface ClassicReferralWebhookSchema { id: ReferralId referrer?: ReferrerUser referred?: ReferredUser referralCodeUsed?: ReferralCodeUsed shareLinkUsed?: ShareLinkUsed dateReferralStarted: DateReferralStarted dateConverted?: DateReferralConverted dateModified?: DateReferralModified dateUserModified?: DateUserModified programId?: ProgramId2 referrerUser: ReferrerUser1 referredUser?: ReferredUser1 fraudSignals?: FraudSignals moderationStatus: ModerationStatus referrerModerationStatus: ReferrerModerationStatus dateReferralPaid?: DateReferralPaid dateReferralEnded?: DateReferralEnded referredModerationStatus: ReferredModerationStatus dateModerated: DateModerated referredReward?: ReferredReward referrerReward?: ReferrerReward } /** * The referrer user in who initiated this referral */ export interface ReferrerUser { id: UserId3 accountId: AccountId3 } /** * The referred user who initiated this referral */ export interface ReferredUser { id: UserId3 accountId: AccountId3 } /** * Sent whenever a referral event happens and the classic program is disabled */ export interface ClassicDisabledReferralWebhookSchema { id: ReferralId1 referrer: ReferrerUser2 referred: ReferredUser2 referralCodeUsed?: ReferralCodeUsed1 shareLinkUsed?: ShareLinkUsed1 dateReferralStarted: DateReferralStarted1 dateConverted?: DateReferralConverted1 dateModified?: DateReferralModified1 dateUserModified?: DateUserModified1 programId?: ProgramId3 } /** * The referrer user in who initiated this referral */ export interface ReferrerUser2 { id: UserId3 accountId: AccountId3 } /** * The referred user who initiated this referral */ export interface ReferredUser2 { id: UserId3 accountId: AccountId3 } /** * Sent whenever a data export activity happens (e.g. export created/completed) */ export interface ExportWebhookSchema { id: ExportId name?: ExportName requester: Requester status: Status dateCreated: DateCreated3 dateCompleted?: DateCompleted mailtoEmail?: NotificationEmailAddress dateExpires?: DateExpires1 outputFormat: OutputFormat task: ExportType operation: Operation params?: ExportFilters stats?: ExportStats fileRef?: UploadedFileReference } /** * These parameters are used to filter the export (e.g. by date or program) */ export interface ExportFilters { [k: string]: unknown } /** * Sent whenever something happens to change this user's available reward balance (e.g. rewards given/expired/etc) */ export interface UserRewardBalanceChangedWebhookSchema { userId?: UserId4 accountId?: AccountId4 unit?: RewardBalanceUnit availableValue?: AvailableRewardBalance resourceVersion?: ResourceVersion [k: string]: unknown } } // End of Webhook