Skip to content

Commit

Permalink
Merge pull request #23 from spring-media/SPR-10621
Browse files Browse the repository at this point in the history
SPR-10621: add new temp api for rosetta
  • Loading branch information
Tooobi authored Oct 8, 2020
2 parents 49ceacd + bc953f4 commit 2e110e1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/coverage
/dist
/node_modules
/.rpt2_cache

.idea
.idea
28 changes: 28 additions & 0 deletions src/model.ts
Original file line number Diff line number Diff line change
@@ -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;
}
10 changes: 10 additions & 0 deletions src/ps-web-apis.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { TealiumData } from "./model";

function requireApi<T>(name: string): Promise<T> {
// -- START -- static loader
const unresolvedPackages = {} as any;
Expand Down Expand Up @@ -93,3 +95,11 @@ export interface WhoamiV1 {
export function whoamiV1(): Promise<WhoamiV1> {
return requireApi("whoami:v1");
}

export interface RosettaV1 {
trackEvent(event: TealiumData): void;
}

export function rosettaV1(): Promise<RosettaV1> {
return requireApi("rosetta:v1");
}

0 comments on commit 2e110e1

Please sign in to comment.