diff --git a/.gitignore b/.gitignore index b8ac46b..81a8f51 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /coverage +/dist /node_modules /.rpt2_cache -.idea \ No newline at end of file +.idea diff --git a/src/model.ts b/src/model.ts new file mode 100644 index 0000000..dd35d33 --- /dev/null +++ b/src/model.ts @@ -0,0 +1,28 @@ +export interface TealiumEventData { + page_env?: string; + page_brand?: string; + page_app_name?: string; + page_doc_type?: string; + page_cms_id?: string; + page_cms_path?: string; + page_platform?: string; + page_layout_breakpoint_class?: string; + page_mode?: string; + page_template_variant_abc?: string; + page_template_variant_xyz?: string; + page_abtest_id?: string; + page_abtest_variant?: string; + product_id_array?: string[]; + product_title_array?: string[]; + product_value_array?: string[]; + user_is_loggedin?: string; + user_sso_id?: string; + user_c1_tracking_id?: string; +} + +export interface TealiumData { + event_name?: string; + event_action?: string; + event_label?: string; + event_data?: TealiumEventData; +} diff --git a/src/ps-web-apis.ts b/src/ps-web-apis.ts index 8218e27..5c4eaf2 100644 --- a/src/ps-web-apis.ts +++ b/src/ps-web-apis.ts @@ -1,3 +1,5 @@ +import { TealiumData } from "./model"; + function requireApi(name: string): Promise { // -- START -- static loader const unresolvedPackages = {} as any; @@ -93,3 +95,11 @@ export interface WhoamiV1 { export function whoamiV1(): Promise { return requireApi("whoami:v1"); } + +export interface RosettaV1 { + trackEvent(event: TealiumData): void; +} + +export function rosettaV1(): Promise { + return requireApi("rosetta:v1"); +}