@causalfoundry/js-sdk
Version:
Causal Foundry WEB SDK (JS/TS)
200 lines (176 loc) • 4.36 kB
text/typescript
/**
* This module was automatically generated by `ts-interface-builder`
*/
import * as t from "ts-interface-checker";
// tslint:disable:object-literal-key-quotes
export const LoyaltyTypes = t.enumtype({
"Survey": "survey",
"Reward": "reward",
"Level": "level",
"Milestone": "milestone",
"Promo": "promo",
});
export const PromoAction = t.enumtype({
"Apply": "apply",
"View": "view",
"Other": "other",
});
export const PromoType = t.enumtype({
"AddToCart": "add_to_cart",
"Coupon": "coupon",
"Other": "other",
});
export const PromoItemType = t.enumtype({
"Blood": "blood",
"Book": "book",
"Clothing": "clothing",
"Drug": "drug",
"Grocery": "grocery",
"Electronics": "electronics",
"Misc": "misc",
"Oxygen": "oxygen",
"Subscription": "subscription",
"Facility": "facility",
"Other": "other",
});
export const SurveyType = t.enumtype({
"OpenEnded": "open_ended",
"ClosedEnded": "closed_ended",
"Nominal": "nominal",
"LikertScale": "likert_scale",
"RatingScale": "rating_scale",
"YesNo": "yes_no",
"Interview": "interview",
"Other": "other",
});
export const SurveyAction = t.enumtype({
"View": "view",
"Impression": "impression",
"Start": "start",
"Submit": "submit",
"Other": "other",
});
export const RewardAction = t.enumtype({
"View": "view",
"Add": "add",
"Redeem": "redeem",
"Other": "other",
});
export const RedeemType = t.enumtype({
"Cash": "cash",
"Airtime": "airtime",
"Other": "other",
});
export const PromoItem = t.iface([], {
"id": "string",
"type": "PromoItemType",
});
export const SurveyObject = t.iface([], {
"id": "string",
"type": "SurveyType",
"is_completed": "boolean",
"reward_id": t.opt("string"),
});
export const ResponseObject = t.iface([], {
"id": "string",
"type": "SurveyType",
"question": "string",
"response": t.opt("string"),
});
export const RedeemObject = t.iface([], {
"type": "RedeemType",
"is_successful": "boolean",
"points_withdrawn": "number",
"converted_value": "number",
"currency": t.opt("CurrencyCode"),
});
export const PromoProperties = t.iface([], {
"id": "string",
"action": "PromoAction",
"items": t.array("PromoItem"),
"title": "string",
"type": "PromoType",
"meta": t.opt("any"),
});
export const LevelProperties = t.iface([], {
"prev_level": "number",
"new_level": "number",
"module_id": t.opt("string"),
"meta": t.opt("any"),
});
export const MilestoneAction = t.enumtype({
"Achieved": "achieved",
"Other": "other",
});
export const MilestoneProperties = t.iface([], {
"id": "string",
"action": "MilestoneAction",
"meta": t.opt("any"),
});
export const SurveyProperties = t.iface([], {
"action": "SurveyAction",
"survey": "SurveyObject",
"response": t.array("ResponseObject"),
"meta": t.opt("any"),
});
export const RewardProperties = t.iface([], {
"id": "string",
"action": "RewardAction",
"acc_points": t.opt("number"),
"total_points": "number",
"redeem": t.opt("RedeemObject"),
"meta": t.opt("any"),
});
export const SurveyCatalog = t.iface([], {
"name": "string",
"description": t.opt("string"),
"type": "string",
"duration": t.opt("number"),
"organization_id": t.opt("string"),
"organization_name": t.opt("string"),
"questions_list": t.array("string"),
"reward_id": "string",
"creation_date": t.opt("string"),
"expiry_date": t.opt("string"),
});
export const InternalSurveyCatalog = t.iface(["SurveyCatalog"], {
"id": "string",
});
export const RewardCatalog = t.iface([], {
"name": "string",
"description": t.opt("string"),
"type": "string",
"required_points": "number",
"creation_date": t.opt("string"),
"expiry_date": t.opt("string"),
"organization_id": t.opt("string"),
"organization_name": t.opt("string"),
});
export const InternalRewardCatalog = t.iface(["RewardCatalog"], {
"id": "string",
});
const exportedTypeSuite: t.ITypeSuite = {
LoyaltyTypes,
PromoAction,
PromoType,
PromoItemType,
SurveyType,
SurveyAction,
RewardAction,
RedeemType,
PromoItem,
SurveyObject,
ResponseObject,
RedeemObject,
PromoProperties,
LevelProperties,
MilestoneAction,
MilestoneProperties,
SurveyProperties,
RewardProperties,
SurveyCatalog,
InternalSurveyCatalog,
RewardCatalog,
InternalRewardCatalog,
};
export default exportedTypeSuite;