UNPKG

@causalfoundry/js-sdk

Version:

Causal Foundry WEB SDK (JS/TS)

149 lines (131 loc) 2.79 kB
import { GenericMeta } from "../../core/commonTypes"; export enum LoyaltyTypes { Survey = "survey", Reward = "reward", Level = "level", Milestone = "milestone", Promo = "promo", } export enum LoyaltyCatalogSubject { Survey = "survey", Reward = "reward", } export enum PromoAction { Apply = "apply", View = "view", Other = "other", } export enum PromoType { AddToCart = "add_to_cart", Coupon = "coupon", Other = "other", } export enum PromoItemType { Blood = "blood", Book = "book", Clothing = "clothing", Drug = "drug", Grocery = "grocery", Electronics = "electronics", Misc = "misc", Oxygen = "oxygen", Subscription = "subscription", Facility = "facility", Other = "other", } export enum SurveyType { OpenEnded = "open_ended", ClosedEnded = "closed_ended", Nominal = "nominal", LikertScale = "likert_scale", RatingScale = "rating_scale", YesNo = "yes_no", Interview = "interview", Other = "other", } export enum SurveyAction { View = "view", Impression = "impression", Start = "start", Submit = "submit", Other = "other", } export enum RewardAction { View = "view", Add = "add", Redeem = "redeem", Other = "other", } export enum RedeemType { Cash = "cash", Airtime = "airtime", Other = "other", } export interface PromoProperties { promo_id: string; action: PromoAction; items_list: string[]; title: string; type: PromoType; meta?: any; } export interface LevelProperties { prev_level: number; new_level: number; module_id?: string; meta?: any; } export enum MilestoneAction { Achieved = "achieved", Other = "other", } export interface MilestoneProperties { milestone_id: string; action: MilestoneAction; meta?: any; } export interface SurveyProperties { action: SurveyAction; survey_id: string; is_completed: boolean; reward_id: string; type: SurveyType; survey_questions: string[]; response_list: string[]; meta?: any; } export interface RewardProperties { reward_id: string; action: RewardAction; acc_points?: number; total_points: number; redeem_type?: string; redeem_points_withdrawn?: number; redeem_converted_value?: number; redeem_currency?: string; redeem_is_successful?: boolean; meta?: any; } export interface SurveyCatalog { name: string; description?: string; type: string; duration?: number; organization_id?: string; organization_name?: string; questions_list: string[]; reward_id: string; creation_date?: string; expiry_date?: string; meta?: GenericMeta; } export interface RewardCatalog { name: string; description?: string; type: string; required_points: number; creation_date?: string; expiry_date?: string; organization_id?: string; organization_name?: string; }