@benshi.ai/js-sdk
Version:
Benshi SDK
268 lines (233 loc) • 6.14 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 NavigationTypes = t.enumtype({
"App": "app",
"Identify": "identify",
"Media": "media",
"NudgeResponse": "nudge_response",
"Page": "page",
"Promo": "promo",
"Rate": "rate",
"Scroll": "scroll",
"Search": "search",
"Track": "track",
});
export const ContentBlock = t.enumtype({
"Core": "core",
"ELearning": "e-learning",
"ECommerce": "e-commerce",
"Social": "social",
"Payment": "payment",
"Loyalty": "loyalty",
});
export const AppAction = t.enumtype({
"Background": "background",
"Close": "close",
"Open": "open",
"Resume": "resume",
});
export const IdentifyAction = t.enumtype({
"Login": "login",
"Logout": "logout",
"Register": "register",
});
export const MediaActionForVideo = t.enumtype({
"Play": "play",
"Pause": "pause",
"Seek": "seek",
"Finish": "finish",
});
export const MediaActionForImage = t.enumtype({
"Play": "play",
});
export const AppProperties = t.iface([], {
"action": "AppAction",
"start_time": "number",
});
export const IdentifyProperties = t.iface([], {
"action": "IdentifyAction",
});
export const UserInfo = t.iface(["IdentifyProperties"], {
"user_props": "UserProperties",
});
export const ImageProperties = t.iface([], {
"contentBlock": t.opt("ContentBlock"),
"type": "ImageType",
"id": "string",
"action": "MediaActionForImage",
"time": "number",
"meta": t.opt("any"),
});
export const ImageType = t.enumtype({
"Image": "image",
});
export const AudioVideoType = t.enumtype({
"Audio": "audio",
"Video": "video",
});
export const AudioVideoProperties = t.iface([], {
"contentBlock": t.opt("ContentBlock"),
"type": "AudioVideoType",
"id": "string",
"action": "MediaActionForVideo",
"time": "number",
"meta": t.opt("any"),
});
export const MediaProperties = t.union("ImageProperties", "AudioVideoProperties");
export const InternalMediaProperties = t.intersection("MediaProperties", t.iface([], {
"id_source": "string",
}));
export const MediaData = t.iface([], {
"name": t.opt("string"),
"length": "string",
"description": t.opt("string"),
"resolution": t.opt("string"),
"language": t.opt("Language"),
});
export const InternalMediaData = t.intersection("MediaData", t.iface([], {
"id_source": "string",
"id": "string",
"type": "AudioVideoType",
}));
export const PageType = t.enumtype({
"View": "view",
"Completed": "completed",
});
export const PageProperties = t.iface([], {
"path": "string",
"title": t.opt("string"),
"duration": t.opt("number"),
"meta": t.opt("any"),
});
export const NudgeAction = t.enumtype({
"Block": "block",
"Discard": "discard",
"Open": "open",
});
export const NudgeResponseType = t.enumtype({
"Push": "push_notification",
"InApp": "in_app_message",
});
export const NudgeResponseProperties = t.iface([], {
"nudge_id": "number",
"type": "NudgeResponseType",
"response": t.iface([], {
"action": "NudgeAction",
}),
"resolved_action": "any",
});
export const SearchProperties = t.iface([], {
"contentBlock": t.opt("ContentBlock"),
"query": "string",
"page": "number",
"results_ids": t.opt(t.array(t.union("string", "TypedItem"))),
"filter": t.opt("SearchFilter"),
"meta": t.opt("any"),
});
export const InternalSearchProperties = t.iface([], {
"id": "string",
"results_list": t.array("TypedItem"),
"contentBlock": t.opt("ContentBlock"),
"query": "string",
"page": "number",
"filter": t.opt("SearchFilter"),
"meta": t.opt("any"),
});
export const EducationLevel = t.enumtype({
"Primary": "primary",
"LowerSecondary": "lower_secondary",
"UpperSecondary": "upper_secondary",
"NonTertiary": "non_tertiary",
"Tertiary": "tertiary",
"Bachelors": "bachelors",
"Masters": "masters",
"Doctorate": "doctorate",
});
export const UserProperties = t.iface([], {
"name": t.opt("string"),
"organization": t.opt("string"),
"experience": t.opt("string"),
"region_state": t.opt("string"),
"city": t.opt("string"),
"workplace": t.opt("string"),
"profession": t.opt("string"),
"zipcode": t.opt("string"),
"timezone": t.opt("string"),
"country": t.opt("Country"),
"language": t.opt("Language"),
"education_level": t.opt("EducationLevel"),
});
export const InternalUserProperties = t.iface(["UserProperties"], {
"id": "string",
"organization_id": t.opt("string"),
"organization_name": t.opt("string"),
});
export const TrackTypes = t.enumtype({
"ReferenceGuide": "reference_guide",
});
export const TrackActions = t.enumtype({
"ViewList": "view_list",
"ViewItem": "view_item",
"ExternalLink": "external_link",
});
export const TrackProperties = t.union(t.iface([], {
"action": t.union(t.enumlit("TrackActions", "ViewList"), t.enumlit("TrackActions", "ExternalLink")),
"meta": t.opt("any"),
}), t.iface([], {
"action": t.enumlit("TrackActions", "ViewItem"),
"item_id": "string",
"meta": t.opt("any"),
}));
export const TrackPropertiesInternal = t.intersection("TrackProperties", t.iface([], {
"type": "TrackTypes",
}));
export const RateType = t.enumtype({
"App": "app",
"Exam": "exam",
"Media": "media",
"Order": "order",
});
export const RateProperties = t.iface([], {
"rate_value": "number",
"type": "RateType",
"subject_id": "string",
});
const exportedTypeSuite: t.ITypeSuite = {
NavigationTypes,
ContentBlock,
AppAction,
IdentifyAction,
MediaActionForVideo,
MediaActionForImage,
AppProperties,
IdentifyProperties,
UserInfo,
ImageProperties,
ImageType,
AudioVideoType,
AudioVideoProperties,
MediaProperties,
InternalMediaProperties,
MediaData,
InternalMediaData,
PageType,
PageProperties,
NudgeAction,
NudgeResponseType,
NudgeResponseProperties,
SearchProperties,
InternalSearchProperties,
EducationLevel,
UserProperties,
InternalUserProperties,
TrackTypes,
TrackActions,
TrackProperties,
TrackPropertiesInternal,
RateType,
RateProperties,
};
export default exportedTypeSuite;