@causalfoundry/js-sdk
Version:
Causal Foundry WEB SDK (JS/TS)
370 lines (324 loc) • 9.2 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 ECommerceTypes = t.enumtype({
"CancelCheckout": "cancel_checkout",
"Cart": "cart",
"Checkout": "checkout",
"Delivery": "delivery",
"Item": "item",
"ItemReport": "item_report",
"ItemRequest": "item_request",
"ItemVerification": "item_verification",
});
export const ItemAction = t.enumtype({
"View": "view",
"Detail": "detail",
"Impression": "impression",
"TopUp": "top_up",
"Cancel": "cancel",
"Update": "update",
"Remove": "remove",
"Add": "add",
"Select": "select",
"AddFavorite": "add_favorite",
"RemoveFavorite": "remove_favorite",
"AddReminder": "add_reminder",
"RemoveReminder": "remove_reminder",
"RemoveReminderAuto": "remove_reminder_auto",
"Other": "other",
});
export const ItemType = t.enumtype({
"Blood": "blood",
"Book": "book",
"Clothing": "clothing",
"Drug": "drug",
"Grocery": "grocery",
"Subscription": "subscription",
"Facility": "facility",
"Electronics": "electronics",
"MedicalEquipment": "medical_equipment",
"Misc": "misc",
"Oxygen": "oxygen",
"ItemVerification": "item_verification",
"ItemReport": "item_report",
"Reward": "reward",
"Survey": "survey",
"Other": "other",
});
export const StockStatus = t.enumtype({
"InStock": "in_stock",
"LowStock": "low_stock",
"OutOfStock": "out_of_stock",
});
export const SubscriptionStatus = t.enumtype({
"Active": "active",
"Inactive": "inactive",
"Paused": "paused",
"Other": "other",
});
export const SubscriptionType = t.enumtype({
"PayAsYouSell": "pay_as_you_sell",
"PayAsYouGo": "pay_as_you_go",
"Other": "other",
});
export const ItemMinObject = t.iface([], {
"id": "string",
"type": "ItemType",
});
export const ItemInfoObject = t.iface([], {
"id": "string",
"type": "ItemType",
"batch_id": t.opt("string"),
"reward_id": t.opt("string"),
"survey_id": t.opt("string"),
"is_featured": t.opt("boolean"),
"expiry_date": t.opt("number"),
"production_date": t.opt("number"),
});
export const BaseItemDetail = t.iface([], {
"id": "string",
"quantity": "number",
"price": "number",
"currency": "CurrencyCode",
"stock_status": t.opt("StockStatus"),
"promo_id": t.opt("string"),
"facility_id": t.opt("string"),
"discount": t.opt("number"),
});
export const SubscriptionItemDetail = t.iface([], {
"status": "SubscriptionStatus",
"type": "SubscriptionType",
"subscription_items": t.array("ItemMinObject"),
});
export const MetaBloodItemDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "Blood"),
"meta": "BloodMeta",
}));
export const MetaOxygenItemDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "Oxygen"),
"meta": "OxygenMeta",
}));
export const DrugItemDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "Drug"),
}));
export const GroceryItemDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "Grocery"),
}));
export const BloodItemDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "Blood"),
}));
export const OxygenItemDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "Oxygen"),
}));
export const MedicalEquipmentDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "MedicalEquipment"),
}));
export const SubscriptionDetail = t.intersection("BaseItemDetail", t.iface([], {
"type": t.enumlit("ItemType", "Subscription"),
"subscription": "SubscriptionItemDetail",
}));
export const MetaItemObject = t.union("MetaBloodItemDetail", "MetaOxygenItemDetail", "DrugItemDetail", "MedicalEquipmentDetail", "GroceryItemDetail", "SubscriptionDetail");
export const ItemObject = t.union("BloodItemDetail", "OxygenItemDetail", "DrugItemDetail", "MedicalEquipmentDetail", "GroceryItemDetail", "SubscriptionDetail");
export const ItemProperties = t.iface([], {
"action": "ItemAction",
"item": "ItemObject",
"search_id": t.opt("string"),
"meta": t.opt("any"),
});
export const ReportObject = t.iface([], {
"id": "string",
"remarks": "string",
"short_desc": t.opt("string"),
});
export const StoreObject = t.iface([], {
"id": "string",
"lat": t.opt("number"),
"lon": t.opt("number"),
});
export const CartAction = t.enumtype({
"AddItem": "add_item",
"RemoveItem": "remove_item",
});
export const CartProperties = t.iface([], {
"id": "string",
"action": "CartAction",
"item": "ItemObject",
"cart_price": "number",
"currency": "CurrencyCode",
"meta": t.opt("any"),
});
export const ScanChannel = t.enumtype({
"App": "app",
"Ussd": "ussd",
});
export const ScanType = t.enumtype({
"Pin": "pin",
"QrCode": "qr_code",
});
export const ListAction = t.enumtype({
"Add": "add_item",
"Discard": "discard",
"Edit": "edit_item",
"Remove": "remove_item",
"View": "view",
"Expired": "expired",
});
export const ListType = t.enumtype({
"Cart": "cart",
"Favourite": "favourite",
"Order": "order",
"Reminder": "reminder",
});
export const ShopMode = t.enumtype({
"Delivery": "delivery",
"Pickup": "pickup",
});
export const CheckoutProperties = t.iface([], {
"id": "string",
"is_successful": "boolean",
"cart_price": "number",
"currency": "CurrencyCode",
"items": t.array("MetaItemObject"),
"cart_id": "string",
"shop_mode": t.opt("ShopMode"),
"meta": t.opt("any"),
});
export const DeliveryAction = t.enumtype({
"Schedule": "schedule",
"Update": "update",
"Dispatch": "dispatch",
"Delivered": "delivered",
});
export const DeliveryProperties = t.iface([], {
"id": "string",
"order_id": "string",
"is_urgent": "boolean",
"action": "DeliveryAction",
"est_delivery_ts": t.opt(t.union("Date", "string")),
"delivery_coordinates": t.opt("CoordinatesObject"),
"dispatch_coordinates": t.opt("CoordinatesObject"),
"meta": t.opt("any"),
});
export const DrugProperties = t.iface([], {
"market_id": "string",
"name": "string",
"description": t.opt("string"),
"supplier_id": "string",
"supplier_name": "string",
"producer": t.opt("string"),
"packaging": t.opt("string"),
"active_ingredients": t.array("string"),
"drug_form": t.opt("string"),
"drug_strength": t.opt("string"),
"atc_anatomical_group": t.opt("string"),
"otc_or_ethical": t.opt("string"),
});
export const InternalDrugProperties = t.iface(["DrugProperties"], {
"id": "string",
});
export const GroceryProperties = t.iface([], {
"name": "string",
"description": t.opt("string"),
"category": t.opt("string"),
"active_ingredients": t.opt(t.array("string")),
"market_id": t.opt("string"),
"packaging": t.opt("string"),
"packaging_size": t.opt("number"),
"packaging_units": t.opt("string"),
"producer": t.opt("string"),
"supplier_id": t.opt("string"),
"supplier_name": t.opt("string"),
});
export const InternalGroceryProperties = t.iface(["GroceryProperties"], {
"id": "string",
});
export const FacilityProperties = t.iface([], {
"name": "string",
"type": t.opt("string"),
"country": t.opt("string"),
"region_state": t.opt("string"),
"city": t.opt("string"),
"is_active": t.opt("boolean"),
"has_delivery": t.opt("boolean"),
"is_sponsored": t.opt("boolean"),
});
export const InternalFacilityProperties = t.iface(["FacilityProperties"], {
"id": "string",
});
export const CancelType = t.enumtype({
"Cart": "cart",
"Order": "order",
});
export const CancelCheckoutProperties = t.iface([], {
"id": "string",
"type": "CancelType",
"items": t.array("ItemMinObject"),
"reason": "string",
"meta": t.opt("any"),
});
export const ItemReportProperties = t.iface([], {
"item": "ItemMinObject",
"report_info": "ReportObject",
"store_info": "StoreObject",
});
export const ItemRequestProperties = t.iface([], {
"id": "string",
"item_name": "string",
"manufacturer": "string",
});
export const ItemVerificationProperties = t.iface([], {
"scan_channel": "ScanChannel",
"scan_type": "ScanType",
"is_successful": "boolean",
"item_info": "ItemInfoObject",
});
const exportedTypeSuite: t.ITypeSuite = {
ECommerceTypes,
ItemAction,
ItemType,
StockStatus,
SubscriptionStatus,
SubscriptionType,
ItemMinObject,
ItemInfoObject,
BaseItemDetail,
SubscriptionItemDetail,
MetaBloodItemDetail,
MetaOxygenItemDetail,
DrugItemDetail,
GroceryItemDetail,
BloodItemDetail,
OxygenItemDetail,
MedicalEquipmentDetail,
SubscriptionDetail,
MetaItemObject,
ItemObject,
ItemProperties,
ReportObject,
StoreObject,
CartAction,
CartProperties,
ScanChannel,
ScanType,
ListAction,
ListType,
ShopMode,
CheckoutProperties,
DeliveryAction,
DeliveryProperties,
DrugProperties,
InternalDrugProperties,
GroceryProperties,
InternalGroceryProperties,
FacilityProperties,
InternalFacilityProperties,
CancelType,
CancelCheckoutProperties,
ItemReportProperties,
ItemRequestProperties,
ItemVerificationProperties,
};
export default exportedTypeSuite;