@adadapted/react-native-sdk 3.1.9 → 3.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
1
  /**
2
2
  * Contains all API request mocks for the Rewards API.
3
3
  */
4
+
4
5
  import { AdActionType } from "./adadaptedApiTypes";
6
+
5
7
  /**
6
8
  * Mocks the API call for initializing a session.
7
9
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
8
10
  */
9
-
10
11
  export function initializeSession() {
11
12
  return new Promise(resolve => {
12
13
  resolve({
@@ -19,11 +20,11 @@ export function initializeSession() {
19
20
  });
20
21
  });
21
22
  }
23
+
22
24
  /**
23
25
  * Mocks the API call for refreshing session data.
24
26
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
25
27
  */
26
-
27
28
  export function refreshSessionData() {
28
29
  return new Promise(resolve => {
29
30
  resolve({
@@ -36,11 +37,11 @@ export function refreshSessionData() {
36
37
  });
37
38
  });
38
39
  }
40
+
39
41
  /**
40
42
  * Mocks the API call for reporting an ad event.
41
43
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
42
44
  */
43
-
44
45
  export function reportAdEvent() {
45
46
  return new Promise(resolve => {
46
47
  resolve({
@@ -55,11 +56,11 @@ export function reportAdEvent() {
55
56
  });
56
57
  });
57
58
  }
59
+
58
60
  /**
59
61
  * Mocks the API call for getting keyword intercepts.
60
62
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
61
63
  */
62
-
63
64
  export function getKeywordIntercepts() {
64
65
  return new Promise(resolve => {
65
66
  resolve({
@@ -72,11 +73,11 @@ export function getKeywordIntercepts() {
72
73
  });
73
74
  });
74
75
  }
76
+
75
77
  /**
76
78
  * Mocks the API call for reporting an ad event.
77
79
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
78
80
  */
79
-
80
81
  export function reportInterceptEvent() {
81
82
  return new Promise(resolve => {
82
83
  resolve({
@@ -91,11 +92,11 @@ export function reportInterceptEvent() {
91
92
  });
92
93
  });
93
94
  }
95
+
94
96
  /**
95
97
  * Mocks the API call for reporting List Manager events.
96
98
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
97
99
  */
98
-
99
100
  export function reportListManagerEvents() {
100
101
  return new Promise(resolve => {
101
102
  resolve({
@@ -108,11 +109,11 @@ export function reportListManagerEvents() {
108
109
  });
109
110
  });
110
111
  }
112
+
111
113
  /**
112
114
  * Mocks the API call for reporting Payload content status.
113
115
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
114
116
  */
115
-
116
117
  export function reportPayloadContentStatus() {
117
118
  return new Promise(resolve => {
118
119
  resolve({
@@ -125,11 +126,11 @@ export function reportPayloadContentStatus() {
125
126
  });
126
127
  });
127
128
  }
129
+
128
130
  /**
129
131
  * Mocks the API call for reporting Payload content status.
130
132
  * @returns a promise of an {@link AxiosResponse} of the mocked data.
131
133
  */
132
-
133
134
  export function retrievePayloadContent() {
134
135
  return new Promise(resolve => {
135
136
  resolve({
@@ -155,10 +156,10 @@ export function retrievePayloadContent() {
155
156
  });
156
157
  });
157
158
  }
159
+
158
160
  /**
159
161
  * Mock data for an {@link AdSession} object.
160
162
  */
161
-
162
163
  const AD_SESSION_DATA = {
163
164
  session_id: "TEST_SESSION_ID",
164
165
  will_serve_ads: true,
@@ -197,10 +198,10 @@ const AD_SESSION_DATA = {
197
198
  }
198
199
  }
199
200
  };
201
+
200
202
  /**
201
203
  * Mock data for an {@link AdSession} object.
202
204
  */
203
-
204
205
  const REFRESHED_AD_SESSION_DATA = {
205
206
  session_id: "TEST_SESSION_ID",
206
207
  will_serve_ads: true,
@@ -239,10 +240,10 @@ const REFRESHED_AD_SESSION_DATA = {
239
240
  }
240
241
  }
241
242
  };
243
+
242
244
  /**
243
245
  * Mock data for an {@link AdSession} object.
244
246
  */
245
-
246
247
  const KEYWORD_INTERCEPT_DATA = {
247
248
  search_id: "test-search-id",
248
249
  min_match_length: 3,
@@ -1 +1 @@
1
- {"version":3,"sources":["adadaptedApiRequests.mock.ts"],"names":["AdActionType","initializeSession","Promise","resolve","data","AD_SESSION_DATA","then","undefined","config","headers","status","statusText","refreshSessionData","REFRESHED_AD_SESSION_DATA","reportAdEvent","results","getKeywordIntercepts","KEYWORD_INTERCEPT_DATA","reportInterceptEvent","reportListManagerEvents","reportPayloadContentStatus","retrievePayloadContent","payloads","payload_id","detailed_list_items","product_title","product_barcode","product_sku","product_image","product_discount","product_brand","product_category","session_id","will_serve_ads","active_campaigns","session_expires_at","polling_interval_ms","zones","id","port_height","port_width","land_height","land_width","ads","ad_id","impression_id","refresh_time","hide_after_interaction","type","creative_url","tracking_html","action_type","CONTENT","action_path","payload","search_id","min_match_length","terms","term_id","term","replacement","priority"],"mappings":"AAAA;AACA;AACA;AAEA,SACIA,YADJ,QAUO,qBAVP;AAYA;AACA;AACA;AACA;;AACA,OAAO,SAASC,iBAAT,GAEL;AACE,SAAO,IAAIC,OAAJ,CAAuDC,OAAD,IAAa;AACtEA,IAAAA,OAAO,CAAC;AACJC,MAAAA,IAAI,EAAEC,eADF;AAEJC,MAAAA,IAAI,EAAEC,SAFF;AAGJC,MAAAA,MAAM,EAAE,EAHJ;AAIJC,MAAAA,OAAO,EAAE,EAJL;AAKJC,MAAAA,MAAM,EAAE,GALJ;AAMJC,MAAAA,UAAU,EAAE;AANR,KAAD,CAAP;AAQH,GATM,CAAP;AAUH;AAED;AACA;AACA;AACA;;AACA,OAAO,SAASC,kBAAT,GAEL;AACE,SAAO,IAAIV,OAAJ,CAAwDC,OAAD,IAAa;AACvEA,IAAAA,OAAO,CAAC;AACJC,MAAAA,IAAI,EAAES,yBADF;AAEJP,MAAAA,IAAI,EAAEC,SAFF;AAGJC,MAAAA,MAAM,EAAE,EAHJ;AAIJC,MAAAA,OAAO,EAAE,EAJL;AAKJC,MAAAA,MAAM,EAAE,GALJ;AAMJC,MAAAA,UAAU,EAAE;AANR,KAAD,CAAP;AAQH,GATM,CAAP;AAUH;AAED;AACA;AACA;AACA;;AACA,OAA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AO,EAAE,gBADb;AAEIC,IAAAA,IAAI,EAAE,MAFV;AAGIC,IAAAA,WAAW,EAAE,eAHjB;AAIIC,IAAAA,QAAQ,EAAE;AAJd,GADG,EAOH;AACIH,IAAAA,OAAO,EAAE,gBADb;AAEIC,IAAAA,IAAI,EAAE,MAFV;AAGIC,IAAAA,WAAW,EAAE,SAHjB;AAIIC,IAAAA,QAAQ,EAAE;AAJd,GAPG,EAaH;AACIH,IAAAA,OAAO,EAAE,gBADb;AAEIC,IAAAA,IAAI,EAAE,QAFV;AAGIC,IAAAA,WAAW,EAAE,eAHjB;AAIIC,IAAAA,QAAQ,EAAE;AAJd,GAbG,EAmBH;AACIH,IAAAA,OAAO,EAAE,gBADb;AAEIC,IAAAA,IAAI,EAAE,QAFV;AAGIC,IAAAA,WAAW,EAAE,wBAHjB;AAIIC,IAAAA,QAAQ,EAAE;AAJd,GAnBG;AAHuC,CAAlD","sourcesContent":["/**\n * Contains all API request mocks for the Rewards API.\n */\nimport { AxiosResponse } from \"axios\";\nimport {\n AdActionType,\n AdSession,\n InitializeSessionResponse,\n KeywordIntercepts,\n KeywordInterceptsResponse,\n RefreshSessionDataResponse,\n ReportAdEventResponse,\n ReportInterceptEventResponse,\n RetrievePayloadItemDataResponse,\n} from \"./adadaptedApiTypes\";\n\n/**\n * Mocks the API call for initializing a session.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function initializeSession(): Promise<\n AxiosResponse<InitializeSessionResponse>\n> {\n return new Promise<AxiosResponse<InitializeSessionResponse>>((resolve) => {\n resolve({\n data: AD_SESSION_DATA,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for refreshing session data.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function refreshSessionData(): Promise<\n AxiosResponse<RefreshSessionDataResponse>\n> {\n return new Promise<AxiosResponse<RefreshSessionDataResponse>>((resolve) => {\n resolve({\n data: REFRESHED_AD_SESSION_DATA,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting an ad event.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportAdEvent(): Promise<AxiosResponse<ReportAdEventResponse>> {\n return new Promise<AxiosResponse<ReportAdEventResponse>>((resolve) => {\n resolve({\n data: {\n results: [\"Ok\"],\n },\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for getting keyword intercepts.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function getKeywordIntercepts(): Promise<\n AxiosResponse<KeywordInterceptsResponse>\n> {\n return new Promise<AxiosResponse<KeywordInterceptsResponse>>((resolve) => {\n resolve({\n data: KEYWORD_INTERCEPT_DATA,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting an ad event.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportInterceptEvent(): Promise<\n AxiosResponse<ReportInterceptEventResponse>\n> {\n return new Promise<AxiosResponse<ReportInterceptEventResponse>>(\n (resolve) => {\n resolve({\n data: {\n results: [\"Ok\"],\n },\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n }\n );\n}\n\n/**\n * Mocks the API call for reporting List Manager events.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportListManagerEvents(): Promise<AxiosResponse<void>> {\n return new Promise<AxiosResponse<void>>((resolve) => {\n resolve({\n data: undefined,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting Payload content status.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportPayloadContentStatus(): Promise<AxiosResponse<void>> {\n return new Promise<AxiosResponse<void>>((resolve) => {\n resolve({\n data: undefined,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting Payload content status.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function retrievePayloadContent(): Promise<\n AxiosResponse<RetrievePayloadItemDataResponse>\n> {\n return new Promise<AxiosResponse<RetrievePayloadItemDataResponse>>(\n (resolve) => {\n resolve({\n data: {\n payloads: [\n {\n payload_id: \"TEST_PAYLOAD_1\",\n detailed_list_items: [\n {\n product_title: \"Test Product 1\",\n product_barcode: \"\",\n product_sku: \"\",\n product_image: \"\",\n product_discount: \"\",\n product_brand: \"\",\n product_category: \"\",\n },\n ],\n },\n ],\n },\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n }\n );\n}\n\n/**\n * Mock data for an {@link AdSession} object.\n */\nconst AD_SESSION_DATA: AdSession = {\n session_id: \"TEST_SESSION_ID\",\n will_serve_ads: true,\n active_campaigns: true,\n session_expires_at: 1587684561,\n polling_interval_ms: 1000,\n zones: {\n 100838: {\n id: \"100838\",\n port_height: 250,\n port_width: 320,\n land_height: 250,\n land_width: 320,\n ads: [\n {\n ad_id: \"1815\",\n impression_id: \"100838::C4D792785EA1EC91\",\n refresh_time: 60,\n hide_after_interaction: false,\n type: \"html\",\n creative_url:\n \"https://testurl.com/a/NTLKNZKYMMI2NTM1;100838;1815?session_id=TEST_SESSION_ID&amp;udid=00000000-0000-0000-0000-000000000000\",\n tracking_html: \"<html></html>\",\n action_type: AdActionType.CONTENT,\n action_path: \"\",\n payload: {\n detailed_list_items: [\n {\n product_barcode: \"0\",\n product_brand: \"Brand\",\n product_category: \"\",\n product_discount: \"\",\n product_image: \"\",\n product_sku: \"\",\n product_title: \"Sample Product\",\n },\n ],\n },\n },\n ],\n },\n },\n};\n\n/**\n * Mock data for an {@link AdSession} object.\n */\nconst REFRESHED_AD_SESSION_DATA: AdSession = {\n session_id: \"TEST_SESSION_ID\",\n will_serve_ads: true,\n active_campaigns: true,\n session_expires_at: 1587684561,\n polling_interval_ms: 1000,\n zones: {\n 100838: {\n id: \"100838\",\n port_height: 250,\n port_width: 320,\n land_height: 250,\n land_width: 320,\n ads: [\n {\n ad_id: \"1816\",\n impression_id: \"100838::C4D792785EA1EC91\",\n refresh_time: 30,\n hide_after_interaction: false,\n type: \"html\",\n creative_url:\n \"https://testurl.com/a/NTLKNZKYMMI2NTM1;100838;1815?session_id=TEST_SESSION_ID&amp;udid=00000000-0000-0000-0000-000000000000\",\n tracking_html: \"<html></html>\",\n action_type: AdActionType.CONTENT,\n action_path: \"\",\n payload: {\n detailed_list_items: [\n {\n product_barcode: \"0\",\n product_brand: \"Brand\",\n product_category: \"\",\n product_discount: \"\",\n product_image: \"\",\n product_sku: \"\",\n product_title: \"Sample Product\",\n },\n ],\n },\n },\n ],\n },\n },\n};\n\n/**\n * Mock data for an {@link AdSession} object.\n */\nconst KEYWORD_INTERCEPT_DATA: KeywordIntercepts = {\n search_id: \"test-search-id\",\n min_match_length: 3,\n terms: [\n {\n term_id: \"test-term-id-1\",\n term: \"Milk\",\n replacement: \"Fairlife Milk\",\n priority: 1,\n },\n {\n term_id: \"test-term-id-2\",\n term: \"milk\",\n replacement: \"A2 Milk\",\n priority: 0,\n },\n {\n term_id: \"test-term-id-3\",\n term: \"CHEESE\",\n replacement: \"Kraft Singles\",\n priority: 0,\n },\n {\n term_id: \"test-term-id-4\",\n term: \"cOfFeE\",\n replacement: \"Folgers Instant Coffee\",\n priority: 0,\n },\n ],\n};\n"]}
1
+ {"version":3,"names":["AdActionType","initializeSession","Promise","resolve","data","AD_SESSION_DATA","then","undefined","config","headers","status","statusText","refreshSessionData","REFRESHED_AD_SESSION_DATA","reportAdEvent","results","getKeywordIntercepts","KEYWORD_INTERCEPT_DATA","reportInterceptEvent","reportListManagerEvents","reportPayloadContentStatus","retrievePayloadContent","payloads","payload_id","detailed_list_items","product_title","product_barcode","product_sku","product_image","product_discount","product_brand","product_category","session_id","will_serve_ads","active_campaigns","session_expires_at","polling_interval_ms","zones","id","port_height","port_width","land_height","land_width","ads","ad_id","impression_id","refresh_time","hide_after_interaction","type","creative_url","tracking_html","action_type","CONTENT","action_path","payload","search_id","min_match_length","terms","term_id","term","replacement","priority"],"sources":["adadaptedApiRequests.mock.ts"],"sourcesContent":["/**\n * Contains all API request mocks for the Rewards API.\n */\nimport { AxiosResponse } from \"axios\";\nimport {\n AdActionType,\n AdSession,\n InitializeSessionResponse,\n KeywordIntercepts,\n KeywordInterceptsResponse,\n RefreshSessionDataResponse,\n ReportAdEventResponse,\n ReportInterceptEventResponse,\n RetrievePayloadItemDataResponse,\n} from \"./adadaptedApiTypes\";\n\n/**\n * Mocks the API call for initializing a session.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function initializeSession(): Promise<\n AxiosResponse<InitializeSessionResponse>\n> {\n return new Promise<AxiosResponse<InitializeSessionResponse>>((resolve) => {\n resolve({\n data: AD_SESSION_DATA,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for refreshing session data.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function refreshSessionData(): Promise<\n AxiosResponse<RefreshSessionDataResponse>\n> {\n return new Promise<AxiosResponse<RefreshSessionDataResponse>>((resolve) => {\n resolve({\n data: REFRESHED_AD_SESSION_DATA,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting an ad event.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportAdEvent(): Promise<AxiosResponse<ReportAdEventResponse>> {\n return new Promise<AxiosResponse<ReportAdEventResponse>>((resolve) => {\n resolve({\n data: {\n results: [\"Ok\"],\n },\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for getting keyword intercepts.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function getKeywordIntercepts(): Promise<\n AxiosResponse<KeywordInterceptsResponse>\n> {\n return new Promise<AxiosResponse<KeywordInterceptsResponse>>((resolve) => {\n resolve({\n data: KEYWORD_INTERCEPT_DATA,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting an ad event.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportInterceptEvent(): Promise<\n AxiosResponse<ReportInterceptEventResponse>\n> {\n return new Promise<AxiosResponse<ReportInterceptEventResponse>>(\n (resolve) => {\n resolve({\n data: {\n results: [\"Ok\"],\n },\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n }\n );\n}\n\n/**\n * Mocks the API call for reporting List Manager events.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportListManagerEvents(): Promise<AxiosResponse<void>> {\n return new Promise<AxiosResponse<void>>((resolve) => {\n resolve({\n data: undefined,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting Payload content status.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function reportPayloadContentStatus(): Promise<AxiosResponse<void>> {\n return new Promise<AxiosResponse<void>>((resolve) => {\n resolve({\n data: undefined,\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n });\n}\n\n/**\n * Mocks the API call for reporting Payload content status.\n * @returns a promise of an {@link AxiosResponse} of the mocked data.\n */\nexport function retrievePayloadContent(): Promise<\n AxiosResponse<RetrievePayloadItemDataResponse>\n> {\n return new Promise<AxiosResponse<RetrievePayloadItemDataResponse>>(\n (resolve) => {\n resolve({\n data: {\n payloads: [\n {\n payload_id: \"TEST_PAYLOAD_1\",\n detailed_list_items: [\n {\n product_title: \"Test Product 1\",\n product_barcode: \"\",\n product_sku: \"\",\n product_image: \"\",\n product_discount: \"\",\n product_brand: \"\",\n product_category: \"\",\n },\n ],\n },\n ],\n },\n then: undefined,\n config: {},\n headers: {},\n status: 200,\n statusText: \"200\",\n });\n }\n );\n}\n\n/**\n * Mock data for an {@link AdSession} object.\n */\nconst AD_SESSION_DATA: AdSession = {\n session_id: \"TEST_SESSION_ID\",\n will_serve_ads: true,\n active_campaigns: true,\n session_expires_at: 1587684561,\n polling_interval_ms: 1000,\n zones: {\n 100838: {\n id: \"100838\",\n port_height: 250,\n port_width: 320,\n land_height: 250,\n land_width: 320,\n ads: [\n {\n ad_id: \"1815\",\n impression_id: \"100838::C4D792785EA1EC91\",\n refresh_time: 60,\n hide_after_interaction: false,\n type: \"html\",\n creative_url:\n \"https://testurl.com/a/NTLKNZKYMMI2NTM1;100838;1815?session_id=TEST_SESSION_ID&amp;udid=00000000-0000-0000-0000-000000000000\",\n tracking_html: \"<html></html>\",\n action_type: AdActionType.CONTENT,\n action_path: \"\",\n payload: {\n detailed_list_items: [\n {\n product_barcode: \"0\",\n product_brand: \"Brand\",\n product_category: \"\",\n product_discount: \"\",\n product_image: \"\",\n product_sku: \"\",\n product_title: \"Sample Product\",\n },\n ],\n },\n },\n ],\n },\n },\n};\n\n/**\n * Mock data for an {@link AdSession} object.\n */\nconst REFRESHED_AD_SESSION_DATA: AdSession = {\n session_id: \"TEST_SESSION_ID\",\n will_serve_ads: true,\n active_campaigns: true,\n session_expires_at: 1587684561,\n polling_interval_ms: 1000,\n zones: {\n 100838: {\n id: \"100838\",\n port_height: 250,\n port_width: 320,\n land_height: 250,\n land_width: 320,\n ads: [\n {\n ad_id: \"1816\",\n impression_id: \"100838::C4D792785EA1EC91\",\n refresh_time: 30,\n hide_after_interaction: false,\n type: \"html\",\n creative_url:\n \"https://testurl.com/a/NTLKNZKYMMI2NTM1;100838;1815?session_id=TEST_SESSION_ID&amp;udid=00000000-0000-0000-0000-000000000000\",\n tracking_html: \"<html></html>\",\n action_type: AdActionType.CONTENT,\n action_path: \"\",\n payload: {\n detailed_list_items: [\n {\n product_barcode: \"0\",\n product_brand: \"Brand\",\n product_category: \"\",\n product_discount: \"\",\n product_image: \"\",\n product_sku: \"\",\n product_title: \"Sample Product\",\n },\n ],\n },\n },\n ],\n },\n },\n};\n\n/**\n * Mock data for an {@link AdSession} object.\n */\nconst KEYWORD_INTERCEPT_DATA: KeywordIntercepts = {\n search_id: \"test-search-id\",\n min_match_length: 3,\n terms: [\n {\n term_id: \"test-term-id-1\",\n term: \"Milk\",\n replacement: \"Fairlife Milk\",\n priority: 1,\n },\n {\n term_id: \"test-term-id-2\",\n term: \"milk\",\n replacement: \"A2 Milk\",\n priority: 0,\n },\n {\n term_id: \"test-term-id-3\",\n term: \"CHEESE\",\n replacement: \"Kraft Singles\",\n priority: 0,\n },\n {\n term_id: \"test-term-id-4\",\n term: \"cOfFeE\",\n replacement: \"Folgers Instant Coffee\",\n priority: 0,\n },\n ],\n};\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SACIA,YAAY,QAST,qBAAqB;;AAE5B;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiB,GAE/B;EACE,OAAO,IAAIC,OAAO,CAA4CC,OAAO,IAAK;IACtEA,OAAO,CAAC;MACJC,IAAI,EAAEC,eAAe;MACrBC,IAAI,EAAEC,SAAS;MACfC,MAAM,EAAE,CAAC,CAAC;MACVC,OAAO,EAAE,CAAC,CAAC;MACXC,MAAM,EAAE,GAAG;MACXC,UAAU,EAAE;IAChB,CAAC,CAAC;EACN,CAAC,CAAC;AACN;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkB,GAEhC;EACE,OAAO,IAAIV,OAAO,CAA6CC,OAAO,IAAK;IACvEA,OAAO,CAAC;MACJC,IAAI,EAAES,yBAAyB;MAC/BP,IAAI,EAAEC,SAAS;MACfC,MAAM,EAAE,CAAC,CAAC;MACVC,OAAO,EAAE,CAAC,CAAC;MACXC,MAAM,EAAE,GAAG;MACXC,UAAU,EAAE;IAChB,CAAC,CAAC;EACN,CAAC,CAAC;AACN;;AAEA;AAC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EAAE,EAAE;QACfC,OAAO,EAAE;UACL9B,mBAAmB,EAAE,CACjB;YACIE,eAAe,EAAE,GAAG;YACpBI,aAAa,EAAE,OAAO;YACtBC,gBAAgB,EAAE,EAAE;YACpBF,gBAAgB,EAAE,EAAE;YACpBD,aAAa,EAAE,EAAE;YACjBD,WAAW,EAAE,EAAE;YACfF,aAAa,EAAE;UACnB,CAAC;QAET;MACJ,CAAC;IAET;EACJ;AACJ,CAAC;;AAED;AACA;AACA;AACA,MAAMR,sBAAyC,GAAG;EAC9CsC,SAAS,EAAE,gBAAgB;EAC3BC,gBAAgB,EAAE,CAAC;EACnBC,KAAK,EAAE,CACH;IACIC,OAAO,EAAE,gBAAgB;IACzBC,IAAI,EAAE,MAAM;IACZC,WAAW,EAAE,eAAe;IAC5BC,QAAQ,EAAE;EACd,CAAC,EACD;IACIH,OAAO,EAAE,gBAAgB;IACzBC,IAAI,EAAE,MAAM;IACZC,WAAW,EAAE,SAAS;IACtBC,QAAQ,EAAE;EACd,CAAC,EACD;IACIH,OAAO,EAAE,gBAAgB;IACzBC,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE,eAAe;IAC5BC,QAAQ,EAAE;EACd,CAAC,EACD;IACIH,OAAO,EAAE,gBAAgB;IACzBC,IAAI,EAAE,QAAQ;IACdC,WAAW,EAAE,wBAAwB;IACrCC,QAAQ,EAAE;EACd,CAAC;AAET,CAAC"}
@@ -1,7 +1,6 @@
1
1
  // =============================================================================
2
2
  // API TYPE MODELS
3
3
  // =============================================================================
4
-
5
4
  /**
6
5
  * The definition of an ad session data object.
7
6
  */
@@ -58,30 +57,28 @@
58
57
  * Enumeration that defines the possible values for a List Manager Event Source.
59
58
  */
60
59
  export let ListManagerEventSource;
60
+
61
61
  /**
62
62
  * Enumeration that defines the possible values for a List Manager Event Name.
63
63
  */
64
-
65
64
  (function (ListManagerEventSource) {
66
65
  ListManagerEventSource["APP"] = "app";
67
66
  })(ListManagerEventSource || (ListManagerEventSource = {}));
68
-
69
67
  export let ListManagerEventName;
68
+
70
69
  /**
71
70
  * Enum defining the available ad action types.
72
71
  */
73
-
74
72
  (function (ListManagerEventName) {
75
73
  ListManagerEventName["ADDED_TO_LIST"] = "user_added_to_list";
76
74
  ListManagerEventName["CROSSED_OFF_LIST"] = "user_crossed_off_list";
77
75
  ListManagerEventName["DELETED_FROM_LIST"] = "user_deleted_from_list";
78
76
  })(ListManagerEventName || (ListManagerEventName = {}));
79
-
80
77
  export let AdActionType;
78
+
81
79
  /**
82
80
  * Enum defining the different types of events that can be reported.
83
81
  */
84
-
85
82
  (function (AdActionType) {
86
83
  AdActionType["CONTENT"] = "c";
87
84
  AdActionType["EXTERNAL"] = "e";
@@ -89,12 +86,11 @@ export let AdActionType;
89
86
  AdActionType["APP"] = "a";
90
87
  AdActionType["NONE"] = "n";
91
88
  })(AdActionType || (AdActionType = {}));
92
-
93
89
  export let ReportedEventType;
90
+
94
91
  /**
95
92
  * Enumeration defining the possible payload acknowledgment status values.
96
93
  */
97
-
98
94
  (function (ReportedEventType) {
99
95
  ReportedEventType["IMPRESSION"] = "impression";
100
96
  ReportedEventType["INTERACTION"] = "interaction";
@@ -103,15 +99,14 @@ export let ReportedEventType;
103
99
  ReportedEventType["PRESENTED"] = "presented";
104
100
  ReportedEventType["SELECTED"] = "selected";
105
101
  })(ReportedEventType || (ReportedEventType = {}));
102
+ export let PayloadStatus;
106
103
 
107
- export let PayloadStatus; // =============================================================================
104
+ // =============================================================================
108
105
  // REQUEST MODELS
109
106
  // =============================================================================
110
-
111
107
  /**
112
108
  * The base request inputs that most requests will use.
113
109
  */
114
-
115
110
  (function (PayloadStatus) {
116
111
  PayloadStatus["DELIVERED"] = "delivered";
117
112
  PayloadStatus["REJECTED"] = "rejected";
@@ -1 +1 @@
1
- {"version":3,"sources":["adadaptedApiTypes.ts"],"names":["ListManagerEventSource","ListManagerEventName","AdActionType","ReportedEventType","PayloadStatus"],"mappings":"AAAA;AACA;AACA;;AACA;AACA;AACA;;AA4BA;AACA;AACA;;AA4BA;AACA;AACA;;AA6CA;AACA;AACA;;AAQA;AACA;AACA;;AAgCA;AACA;AACA;;AAoCA;AACA;AACA;;AAkBA;AACA;AACA;;AAuBA;AACA;AACA;;AAoBA;AACA;AACA;;AA6BA;AACA;AACA;;AAoBA;AACA;AACA;;AAgBA;AACA;AACA;;AAYA;AACA;AACA;AACA,WAAYA,sBAAZ;AAOA;AACA;AACA;;WATYA,sB;AAAAA,EAAAA,sB;GAAAA,sB,KAAAA,sB;;AAUZ,WAAYC,oBAAZ;AAeA;AACA;AACA;;WAjBYA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;GAAAA,oB,KAAAA,oB;;AAkBZ,WAAYC,YAAZ;AAyBA;AACA;AACA;;WA3BYA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;AAAAA,EAAAA,Y;GAAAA,Y,KAAAA,Y;;AA4BZ,WAAYC,iBAAZ;AA4BA;AACA;AACA;;WA9BYA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;AAAAA,EAAAA,iB;GAAAA,iB,KAAAA,iB;;AA+BZ,WAAYC,aAAZ,C,CAWA;AACA;AACA;;AACA;AACA;AACA;;WAhBYA,a;AAAAA,EAAAA,a;AAAAA,EAAAA,a;GAAAA,a,KAAAA,a","sourcesContent":["// =============================================================================\n// API TYPE MODELS\n// =============================================================================\n/**\n * The definition of an ad session data object.\n */\nexport interface AdSession {\n /**\n * The session ID.\n */\n session_id: string;\n /**\n * If true, ads will be served.\n */\n will_serve_ads: boolean;\n /**\n * If true, there are active campaigns.\n */\n active_campaigns: boolean;\n /**\n * How often to refresh session/ad data?\n */\n polling_interval_ms: number;\n /**\n * The time at which the session will expire.\n */\n session_expires_at: number;\n /**\n * All ad zones.\n */\n zones: { [key: number]: Zone };\n}\n\n/**\n * The definition of a zone.\n */\nexport interface Zone {\n /**\n * The zone ID.\n */\n id: string;\n /**\n * ?\n */\n land_height: number;\n /**\n * ?\n */\n land_width: number;\n /**\n * ?\n */\n port_height: number;\n /**\n * ?\n */\n port_width: number;\n /**\n * The available ads.\n */\n ads: Ad[];\n}\n\n/**\n * The definition of an Ad.\n */\nexport interface Ad {\n /**\n * The ad ID.\n */\n ad_id: string;\n /**\n * The impression ID.\n */\n impression_id: string;\n /**\n * The type of ad this is.\n */\n type: string;\n /**\n * How often the ad refreshes? Swaps out for another?\n * Length of time in seconds.\n */\n refresh_time: number;\n /**\n * The URL for the ad image to display.\n */\n creative_url: string;\n /**\n * The tracking pixel to include in the zone view for this ad?\n */\n tracking_html: string;\n /**\n * ?\n */\n action_path: string;\n /**\n * ?\n */\n action_type: AdActionType;\n /**\n * If true, the ad will be hidden after interaction.\n */\n hide_after_interaction: boolean;\n /**\n * ?\n */\n payload: AdPayload;\n}\n\n/**\n * The definition of an Ad Payload.\n */\nexport interface AdPayload {\n /**\n * The array of list items.\n */\n detailed_list_items: DetailedListItem[];\n}\n\n/**\n * The definition of an \"out of app\" data payload.\n */\nexport interface OutOfAppDataPayload {\n /**\n * The payload ID associated to the provided list items.\n */\n payload_id: string;\n /**\n * The payload message.\n */\n payload_message?: string;\n /**\n * The payload image.\n */\n payload_image?: string;\n /**\n * The campaign ID.\n */\n campaign_id?: string;\n /**\n * The app ID.\n */\n app_id?: string;\n /**\n * Expiration time in seconds.\n */\n expire_seconds?: number;\n /**\n * The array of list items.\n */\n detailed_list_items: DetailedListItem[];\n}\n\n/**\n * The definition of a Detailed List Item.\n */\nexport interface DetailedListItem {\n /**\n * The barcode of the product.\n */\n product_barcode: string;\n /**\n * The brand of the product.\n */\n product_brand: string;\n /**\n * The category of the product.\n */\n product_category: string;\n /**\n * The discount given for the product.\n */\n product_discount: string;\n /**\n * The image used for display of the product.\n */\n product_image: string;\n /**\n * The SKU of the product.\n */\n product_sku: string;\n /**\n * The name/title of the product.\n */\n product_title: string;\n /**\n * The tracking ID.\n */\n tracking_id?: string;\n}\n\n/**\n * The definition of a Keyword Intercepts object.\n */\nexport interface KeywordIntercepts {\n /**\n * The search ID.\n * Automatically assigned by the API.\n */\n search_id: string;\n /**\n * The minimum number of characters required to perform\n * a search against all available search terms.\n */\n min_match_length: number;\n /**\n * All available search terms.\n */\n terms: KeywordSearchTerm[];\n}\n\n/**\n * The definition of a Keyword Search Term.\n */\nexport interface KeywordSearchTerm {\n /**\n * The search term ID.\n */\n term_id: string;\n /**\n * The search term to validate a search string against.\n */\n term: string;\n /**\n * The display string a client can use to display in a list.\n */\n replacement: string;\n /**\n * The display priority of this item.\n * Compare this to other {@link KeywordSearchTerm} items to determine\n * the final priority order during display.\n * The lower the number, the higher the priority.\n */\n priority: number;\n}\n\n/**\n * The definition of a Reported Ad Event.\n */\nexport interface ReportedAdEvent {\n /**\n * The add ID.\n */\n ad_id: string;\n /**\n * The impression ID.\n */\n impression_id: string;\n /**\n * The event type to report\n */\n event_type: ReportedEventType;\n /**\n * The timestamp at which the event occurred.\n */\n created_at: number;\n}\n\n/**\n * The definition of a Reported Intercept Event.\n */\nexport interface ReportedInterceptEvent {\n /**\n * The intercept search ID.\n */\n search_id: string;\n /**\n * The term ID.\n */\n term_id: string;\n /**\n * The term.\n */\n term: string;\n /**\n * The user input provided that ultimately\n * resulted in the event triggering.\n */\n user_input: string;\n /**\n * The event type to report\n */\n event_type: ReportedEventType;\n /**\n * The timestamp at which the event occurred.\n */\n created_at: number;\n}\n\n/**\n * Interface defining the structure of an event to send when using List Manager.\n */\nexport interface ListManagerEvent {\n /**\n * The source of the list manager event.\n */\n event_source: ListManagerEventSource;\n /**\n * The timestamp this event occurred (unix time).\n */\n event_timestamp: number;\n /**\n * The event name.\n */\n event_name: ListManagerEventName;\n /**\n * The parameter the event is triggered for.\n */\n event_params: ListManagerEventParam;\n}\n\n/**\n * Interface defining the structure of a payload tracking event.\n */\nexport interface PayloadTrackingEvent {\n /**\n * The source of the list manager event.\n */\n payload_id: string;\n /**\n * The status to report.\n */\n status: PayloadStatus;\n /**\n * The timestamp this event occurred (unix time).\n */\n event_timestamp: number;\n}\n\n/**\n * Interface defining the structure of an Event Param for List Manager.\n */\nexport interface ListManagerEventParam {\n /**\n * The item name being reported.\n */\n item_name: string;\n /**\n * The list name being reported.\n */\n list_name?: string;\n}\n\n/**\n * Enumeration that defines the possible values for a List Manager Event Source.\n */\nexport enum ListManagerEventSource {\n /**\n * The event was triggered from the app.\n */\n APP = \"app\",\n}\n\n/**\n * Enumeration that defines the possible values for a List Manager Event Name.\n */\nexport enum ListManagerEventName {\n /**\n * The user added an item to their list.\n */\n ADDED_TO_LIST = \"user_added_to_list\",\n /**\n * The user crossed off an item from their list.\n */\n CROSSED_OFF_LIST = \"user_crossed_off_list\",\n /**\n * The user deleted an item from their list.\n */\n DELETED_FROM_LIST = \"user_deleted_from_list\",\n}\n\n/**\n * Enum defining the available ad action types.\n */\nexport enum AdActionType {\n /**\n * Used for Add To List.\n */\n CONTENT = \"c\",\n /**\n * Used for opening URLs in an external browser.\n */\n EXTERNAL = \"e\",\n /**\n * Used for opening URLs in a web view within the app.\n * NOTE: This one should probably be deprecated with the new\n * platform redesign, since its not as obvious what it does.\n */\n LINK = \"l\",\n /**\n * Used for opening app store URLs in the app store.\n */\n APP = \"a\",\n /**\n * ?\n */\n NONE = \"n\",\n}\n\n/**\n * Enum defining the different types of events that can be reported.\n */\nexport enum ReportedEventType {\n /**\n * Occurs when an ad is displayed to the user.\n */\n IMPRESSION = \"impression\",\n /**\n * Occurs when the user interacts with an ad.\n */\n INTERACTION = \"interaction\",\n /**\n * Occurs when the user's search term did not\n * match an available keyword intercept term.\n */\n NOT_MATCHED = \"not_matched\",\n /**\n * Occurs when the user's search term has matched a keyword intercept term.\n */\n MATCHED = \"matched\",\n /**\n * Occurs when the user was presented a keyword intercept term.\n */\n PRESENTED = \"presented\",\n /**\n * Occurs when the user has selected a keyword intercept term.\n */\n SELECTED = \"selected\",\n}\n\n/**\n * Enumeration defining the possible payload acknowledgment status values.\n */\nexport enum PayloadStatus {\n /**\n * The delivered status.\n */\n DELIVERED = \"delivered\",\n /**\n * The rejected status.\n */\n REJECTED = \"rejected\",\n}\n\n// =============================================================================\n// REQUEST MODELS\n// =============================================================================\n/**\n * The base request inputs that most requests will use.\n */\nexport interface BaseRequestInputs {\n /**\n * The app ID provided by the client using the API.\n */\n app_id: string;\n /**\n * The unique device ID.\n */\n udid: string;\n /**\n * The current session ID.\n */\n session_id: string;\n}\n\n/**\n * Interface for the request of the Initialize Session API call.\n */\nexport interface InitializeSessionRequest {\n /**\n * The app ID provided by the client using the API.\n */\n app_id: string;\n /**\n * The unique device ID of the users device.\n */\n udid: string;\n /**\n * The bundle ID.\n */\n bundle_id?: string;\n /**\n * The bundle version.\n */\n bundle_version?: string;\n /**\n * The name of the device.\n */\n device_name?: string;\n /**\n * The unique device ID of the users device.\n */\n device_udid?: string;\n /**\n * The OS of the device.\n */\n device_os?: string;\n /**\n * The OS version of the device.\n */\n device_osv?: string;\n /**\n * The locale the device is currently set for.\n */\n device_locale?: string;\n /**\n * The timezone the device is currently set for.\n */\n device_timezone?: string;\n /**\n * The device carrier name.\n */\n device_carrier?: string;\n /**\n * The height of the devices screen in pixels.\n */\n device_height?: number;\n /**\n * The width of the devices screen in pixels.\n */\n device_width?: number;\n /**\n * The density of the devices screen.\n */\n device_density?: string;\n /**\n * If true, the device allows for ad retargeting.\n */\n allow_retargeting?: boolean;\n /**\n * ?\n */\n created_at?: number;\n /**\n * The AdAdapted SDK version number.\n */\n sdk_version?: string;\n /**\n * ?\n */\n params?: { [key: string]: string };\n}\n\n/**\n * Interface for the request of the Refresh Session Data API call.\n */\nexport interface RefreshSessionDataRequest {\n /**\n * The app ID provided by the client using the API.\n */\n aid: string;\n /**\n * The unique device ID.\n */\n uid: string;\n /**\n * The current session ID.\n */\n sid: string;\n}\n\n/**\n * Interface for the request that reports an ad event.\n */\nexport interface ReportAdEventRequest extends BaseRequestInputs {\n /**\n * Events to report.\n */\n events: ReportedAdEvent[];\n}\n\n/**\n * Interface for the request of the Refresh Session Data API call.\n */\nexport interface KeywordInterceptsRequest {\n /**\n * The app ID provided by the client using the API.\n */\n aid: string;\n /**\n * The unique device ID.\n */\n uid: string;\n /**\n * The current session ID.\n */\n sid: string;\n}\n\n/**\n * Interface for the request that reports an intercept event.\n */\nexport interface ReportInterceptEventRequest extends BaseRequestInputs {\n /**\n * Events to report.\n */\n events: ReportedInterceptEvent[];\n}\n\n/**\n * Interface for the request that reports List Manager data.\n */\nexport interface ReportListManagerDataRequest extends BaseRequestInputs {\n /**\n * The events to report.\n */\n events: ListManagerEvent[];\n}\n\n/**\n * Interface for the request that reports Payload tracking data.\n */\nexport interface ReportPayloadDataRequest extends BaseRequestInputs {\n /**\n * The payload tracking events.\n */\n tracking: PayloadTrackingEvent[];\n}\n\n/**\n * Interface for the request that gets Payload server data.\n */\nexport interface RetrievePayloadItemDataRequest extends BaseRequestInputs {}\n\n// =============================================================================\n// RESPONSE MODELS\n// =============================================================================\n/**\n * Interface for the response of the Campaign API request.\n */\nexport interface InitializeSessionResponse extends AdSession {}\n\n/**\n * Interface for the response of the Campaign API request.\n */\nexport interface RefreshSessionDataResponse extends AdSession {}\n\n/**\n * Interface for the response of the Report Ad Event API request.\n */\nexport interface ReportAdEventResponse {\n /**\n * Array that contains response strings of \"Ok\" or \"Failed\" based\n * on the same order of the events sent to the request.\n */\n results: string[];\n}\n\n/**\n * Interface for the response of the Keyword Intercepts API request.\n */\nexport interface KeywordInterceptsResponse extends KeywordIntercepts {}\n\n/**\n * Interface for the response of the Report Intercept Event API request.\n */\nexport interface ReportInterceptEventResponse {\n /**\n * Array that contains response strings of \"Ok\" or \"Failed\" based\n * on the same order of the events sent to the request.\n */\n results: string[];\n}\n\n/**\n * Interface for the response of the Retrieve Payload Item Data API request.\n */\nexport interface RetrievePayloadItemDataResponse {\n /**\n * Array containing all current payloads for the provided user.\n */\n payloads: OutOfAppDataPayload[];\n}\n"]}
1
+ {"version":3,"names":["ListManagerEventSource","ListManagerEventName","AdActionType","ReportedEventType","PayloadStatus"],"sources":["adadaptedApiTypes.ts"],"sourcesContent":["// =============================================================================\n// API TYPE MODELS\n// =============================================================================\n/**\n * The definition of an ad session data object.\n */\nexport interface AdSession {\n /**\n * The session ID.\n */\n session_id: string;\n /**\n * If true, ads will be served.\n */\n will_serve_ads: boolean;\n /**\n * If true, there are active campaigns.\n */\n active_campaigns: boolean;\n /**\n * How often to refresh session/ad data?\n */\n polling_interval_ms: number;\n /**\n * The time at which the session will expire.\n */\n session_expires_at: number;\n /**\n * All ad zones.\n */\n zones: { [key: number]: Zone };\n}\n\n/**\n * The definition of a zone.\n */\nexport interface Zone {\n /**\n * The zone ID.\n */\n id: string;\n /**\n * ?\n */\n land_height: number;\n /**\n * ?\n */\n land_width: number;\n /**\n * ?\n */\n port_height: number;\n /**\n * ?\n */\n port_width: number;\n /**\n * The available ads.\n */\n ads: Ad[];\n}\n\n/**\n * The definition of an Ad.\n */\nexport interface Ad {\n /**\n * The ad ID.\n */\n ad_id: string;\n /**\n * The impression ID.\n */\n impression_id: string;\n /**\n * The type of ad this is.\n */\n type: string;\n /**\n * How often the ad refreshes? Swaps out for another?\n * Length of time in seconds.\n */\n refresh_time: number;\n /**\n * The URL for the ad image to display.\n */\n creative_url: string;\n /**\n * The tracking pixel to include in the zone view for this ad?\n */\n tracking_html: string;\n /**\n * ?\n */\n action_path: string;\n /**\n * ?\n */\n action_type: AdActionType;\n /**\n * If true, the ad will be hidden after interaction.\n */\n hide_after_interaction: boolean;\n /**\n * ?\n */\n payload: AdPayload;\n}\n\n/**\n * The definition of an Ad Payload.\n */\nexport interface AdPayload {\n /**\n * The array of list items.\n */\n detailed_list_items: DetailedListItem[];\n}\n\n/**\n * The definition of an \"out of app\" data payload.\n */\nexport interface OutOfAppDataPayload {\n /**\n * The payload ID associated to the provided list items.\n */\n payload_id: string;\n /**\n * The payload message.\n */\n payload_message?: string;\n /**\n * The payload image.\n */\n payload_image?: string;\n /**\n * The campaign ID.\n */\n campaign_id?: string;\n /**\n * The app ID.\n */\n app_id?: string;\n /**\n * Expiration time in seconds.\n */\n expire_seconds?: number;\n /**\n * The array of list items.\n */\n detailed_list_items: DetailedListItem[];\n}\n\n/**\n * The definition of a Detailed List Item.\n */\nexport interface DetailedListItem {\n /**\n * The barcode of the product.\n */\n product_barcode: string;\n /**\n * The brand of the product.\n */\n product_brand: string;\n /**\n * The category of the product.\n */\n product_category: string;\n /**\n * The discount given for the product.\n */\n product_discount: string;\n /**\n * The image used for display of the product.\n */\n product_image: string;\n /**\n * The SKU of the product.\n */\n product_sku: string;\n /**\n * The name/title of the product.\n */\n product_title: string;\n /**\n * The tracking ID.\n */\n tracking_id?: string;\n}\n\n/**\n * The definition of a Keyword Intercepts object.\n */\nexport interface KeywordIntercepts {\n /**\n * The search ID.\n * Automatically assigned by the API.\n */\n search_id: string;\n /**\n * The minimum number of characters required to perform\n * a search against all available search terms.\n */\n min_match_length: number;\n /**\n * All available search terms.\n */\n terms: KeywordSearchTerm[];\n}\n\n/**\n * The definition of a Keyword Search Term.\n */\nexport interface KeywordSearchTerm {\n /**\n * The search term ID.\n */\n term_id: string;\n /**\n * The search term to validate a search string against.\n */\n term: string;\n /**\n * The display string a client can use to display in a list.\n */\n replacement: string;\n /**\n * The display priority of this item.\n * Compare this to other {@link KeywordSearchTerm} items to determine\n * the final priority order during display.\n * The lower the number, the higher the priority.\n */\n priority: number;\n}\n\n/**\n * The definition of a Reported Ad Event.\n */\nexport interface ReportedAdEvent {\n /**\n * The add ID.\n */\n ad_id: string;\n /**\n * The impression ID.\n */\n impression_id: string;\n /**\n * The event type to report\n */\n event_type: ReportedEventType;\n /**\n * The timestamp at which the event occurred.\n */\n created_at: number;\n}\n\n/**\n * The definition of a Reported Intercept Event.\n */\nexport interface ReportedInterceptEvent {\n /**\n * The intercept search ID.\n */\n search_id: string;\n /**\n * The term ID.\n */\n term_id: string;\n /**\n * The term.\n */\n term: string;\n /**\n * The user input provided that ultimately\n * resulted in the event triggering.\n */\n user_input: string;\n /**\n * The event type to report\n */\n event_type: ReportedEventType;\n /**\n * The timestamp at which the event occurred.\n */\n created_at: number;\n}\n\n/**\n * Interface defining the structure of an event to send when using List Manager.\n */\nexport interface ListManagerEvent {\n /**\n * The source of the list manager event.\n */\n event_source: ListManagerEventSource;\n /**\n * The timestamp this event occurred (unix time).\n */\n event_timestamp: number;\n /**\n * The event name.\n */\n event_name: ListManagerEventName;\n /**\n * The parameter the event is triggered for.\n */\n event_params: ListManagerEventParam;\n}\n\n/**\n * Interface defining the structure of a payload tracking event.\n */\nexport interface PayloadTrackingEvent {\n /**\n * The source of the list manager event.\n */\n payload_id: string;\n /**\n * The status to report.\n */\n status: PayloadStatus;\n /**\n * The timestamp this event occurred (unix time).\n */\n event_timestamp: number;\n}\n\n/**\n * Interface defining the structure of an Event Param for List Manager.\n */\nexport interface ListManagerEventParam {\n /**\n * The item name being reported.\n */\n item_name: string;\n /**\n * The list name being reported.\n */\n list_name?: string;\n}\n\n/**\n * Enumeration that defines the possible values for a List Manager Event Source.\n */\nexport enum ListManagerEventSource {\n /**\n * The event was triggered from the app.\n */\n APP = \"app\",\n}\n\n/**\n * Enumeration that defines the possible values for a List Manager Event Name.\n */\nexport enum ListManagerEventName {\n /**\n * The user added an item to their list.\n */\n ADDED_TO_LIST = \"user_added_to_list\",\n /**\n * The user crossed off an item from their list.\n */\n CROSSED_OFF_LIST = \"user_crossed_off_list\",\n /**\n * The user deleted an item from their list.\n */\n DELETED_FROM_LIST = \"user_deleted_from_list\",\n}\n\n/**\n * Enum defining the available ad action types.\n */\nexport enum AdActionType {\n /**\n * Used for Add To List.\n */\n CONTENT = \"c\",\n /**\n * Used for opening URLs in an external browser.\n */\n EXTERNAL = \"e\",\n /**\n * Used for opening URLs in a web view within the app.\n * NOTE: This one should probably be deprecated with the new\n * platform redesign, since its not as obvious what it does.\n */\n LINK = \"l\",\n /**\n * Used for opening app store URLs in the app store.\n */\n APP = \"a\",\n /**\n * ?\n */\n NONE = \"n\",\n}\n\n/**\n * Enum defining the different types of events that can be reported.\n */\nexport enum ReportedEventType {\n /**\n * Occurs when an ad is displayed to the user.\n */\n IMPRESSION = \"impression\",\n /**\n * Occurs when the user interacts with an ad.\n */\n INTERACTION = \"interaction\",\n /**\n * Occurs when the user's search term did not\n * match an available keyword intercept term.\n */\n NOT_MATCHED = \"not_matched\",\n /**\n * Occurs when the user's search term has matched a keyword intercept term.\n */\n MATCHED = \"matched\",\n /**\n * Occurs when the user was presented a keyword intercept term.\n */\n PRESENTED = \"presented\",\n /**\n * Occurs when the user has selected a keyword intercept term.\n */\n SELECTED = \"selected\",\n}\n\n/**\n * Enumeration defining the possible payload acknowledgment status values.\n */\nexport enum PayloadStatus {\n /**\n * The delivered status.\n */\n DELIVERED = \"delivered\",\n /**\n * The rejected status.\n */\n REJECTED = \"rejected\",\n}\n\n// =============================================================================\n// REQUEST MODELS\n// =============================================================================\n/**\n * The base request inputs that most requests will use.\n */\nexport interface BaseRequestInputs {\n /**\n * The app ID provided by the client using the API.\n */\n app_id: string;\n /**\n * The unique device ID.\n */\n udid: string;\n /**\n * The current session ID.\n */\n session_id: string;\n}\n\n/**\n * Interface for the request of the Initialize Session API call.\n */\nexport interface InitializeSessionRequest {\n /**\n * The app ID provided by the client using the API.\n */\n app_id: string;\n /**\n * The unique device ID of the users device.\n */\n udid: string;\n /**\n * The bundle ID.\n */\n bundle_id?: string;\n /**\n * The bundle version.\n */\n bundle_version?: string;\n /**\n * The name of the device.\n */\n device_name?: string;\n /**\n * The unique device ID of the users device.\n */\n device_udid?: string;\n /**\n * The OS of the device.\n */\n device_os?: string;\n /**\n * The OS version of the device.\n */\n device_osv?: string;\n /**\n * The locale the device is currently set for.\n */\n device_locale?: string;\n /**\n * The timezone the device is currently set for.\n */\n device_timezone?: string;\n /**\n * The device carrier name.\n */\n device_carrier?: string;\n /**\n * The height of the devices screen in pixels.\n */\n device_height?: number;\n /**\n * The width of the devices screen in pixels.\n */\n device_width?: number;\n /**\n * The density of the devices screen.\n */\n device_density?: string;\n /**\n * If true, the device allows for ad retargeting.\n */\n allow_retargeting?: boolean;\n /**\n * ?\n */\n created_at?: number;\n /**\n * The AdAdapted SDK version number.\n */\n sdk_version?: string;\n /**\n * ?\n */\n params?: { [key: string]: string };\n}\n\n/**\n * Interface for the request of the Refresh Session Data API call.\n */\nexport interface RefreshSessionDataRequest {\n /**\n * The app ID provided by the client using the API.\n */\n aid: string;\n /**\n * The unique device ID.\n */\n uid: string;\n /**\n * The current session ID.\n */\n sid: string;\n}\n\n/**\n * Interface for the request that reports an ad event.\n */\nexport interface ReportAdEventRequest extends BaseRequestInputs {\n /**\n * Events to report.\n */\n events: ReportedAdEvent[];\n}\n\n/**\n * Interface for the request of the Refresh Session Data API call.\n */\nexport interface KeywordInterceptsRequest {\n /**\n * The app ID provided by the client using the API.\n */\n aid: string;\n /**\n * The unique device ID.\n */\n uid: string;\n /**\n * The current session ID.\n */\n sid: string;\n}\n\n/**\n * Interface for the request that reports an intercept event.\n */\nexport interface ReportInterceptEventRequest extends BaseRequestInputs {\n /**\n * Events to report.\n */\n events: ReportedInterceptEvent[];\n}\n\n/**\n * Interface for the request that reports List Manager data.\n */\nexport interface ReportListManagerDataRequest extends BaseRequestInputs {\n /**\n * The events to report.\n */\n events: ListManagerEvent[];\n}\n\n/**\n * Interface for the request that reports Payload tracking data.\n */\nexport interface ReportPayloadDataRequest extends BaseRequestInputs {\n /**\n * The payload tracking events.\n */\n tracking: PayloadTrackingEvent[];\n}\n\n/**\n * Interface for the request that gets Payload server data.\n */\nexport interface RetrievePayloadItemDataRequest extends BaseRequestInputs {}\n\n// =============================================================================\n// RESPONSE MODELS\n// =============================================================================\n/**\n * Interface for the response of the Campaign API request.\n */\nexport interface InitializeSessionResponse extends AdSession {}\n\n/**\n * Interface for the response of the Campaign API request.\n */\nexport interface RefreshSessionDataResponse extends AdSession {}\n\n/**\n * Interface for the response of the Report Ad Event API request.\n */\nexport interface ReportAdEventResponse {\n /**\n * Array that contains response strings of \"Ok\" or \"Failed\" based\n * on the same order of the events sent to the request.\n */\n results: string[];\n}\n\n/**\n * Interface for the response of the Keyword Intercepts API request.\n */\nexport interface KeywordInterceptsResponse extends KeywordIntercepts {}\n\n/**\n * Interface for the response of the Report Intercept Event API request.\n */\nexport interface ReportInterceptEventResponse {\n /**\n * Array that contains response strings of \"Ok\" or \"Failed\" based\n * on the same order of the events sent to the request.\n */\n results: string[];\n}\n\n/**\n * Interface for the response of the Retrieve Payload Item Data API request.\n */\nexport interface RetrievePayloadItemDataResponse {\n /**\n * Array containing all current payloads for the provided user.\n */\n payloads: OutOfAppDataPayload[];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AA4BA;AACA;AACA;;AA4BA;AACA;AACA;;AA6CA;AACA;AACA;;AAQA;AACA;AACA;;AAgCA;AACA;AACA;;AAoCA;AACA;AACA;;AAkBA;AACA;AACA;;AAuBA;AACA;AACA;;AAoBA;AACA;AACA;;AA6BA;AACA;AACA;;AAoBA;AACA;AACA;;AAgBA;AACA;AACA;;AAYA;AACA;AACA;AACA,WAAYA,sBAAsB;;AAOlC;AACA;AACA;AAFA,WAPYA,sBAAsB;EAAtBA,sBAAsB;AAAA,GAAtBA,sBAAsB,KAAtBA,sBAAsB;AAUlC,WAAYC,oBAAoB;;AAehC;AACA;AACA;AAFA,WAfYA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;AAAA,GAApBA,oBAAoB,KAApBA,oBAAoB;AAkBhC,WAAYC,YAAY;;AAyBxB;AACA;AACA;AAFA,WAzBYA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AA4BxB,WAAYC,iBAAiB;;AA4B7B;AACA;AACA;AAFA,WA5BYA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;AAAA,GAAjBA,iBAAiB,KAAjBA,iBAAiB;AA+B7B,WAAYC,aAAa;;AAWzB;AACA;AACA;AACA;AACA;AACA;AAFA,WAdYA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa"}
@@ -1,5 +1,4 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  /**
4
3
  * Component for creating an {@link AdZone}.
5
4
  * @module
@@ -10,6 +9,7 @@ import * as adadaptedApiRequests from "../api/adadaptedApiRequests";
10
9
  import { AdActionType, ReportedEventType } from "../api/adadaptedApiTypes";
11
10
  import { WebView } from "react-native-webview";
12
11
  import { safeInvoke } from "../util";
12
+
13
13
  /**
14
14
  * Props interface for {@link AdZone}.
15
15
  */
@@ -27,52 +27,47 @@ export class AdZone extends React.Component {
27
27
  * @inheritDoc
28
28
  */
29
29
  constructor(props, context) {
30
- super(props, context); // Generates a random number between 0 and (number of available ads - 1).
30
+ super(props, context);
31
31
 
32
+ // Generates a random number between 0 and (number of available ads - 1).
32
33
  _defineProperty(this, "cycleAdTimer", void 0);
33
-
34
34
  const startingAdIndex = Math.floor(Math.random() * this.props.adZoneData.ads.length);
35
35
  this.state = {
36
36
  adIndexShown: startingAdIndex,
37
37
  touchStartCoords: undefined
38
38
  };
39
39
  }
40
+
40
41
  /**
41
42
  * @inheritDoc
42
43
  */
43
-
44
-
45
44
  componentDidMount() {
46
45
  this.initializeAd();
47
46
  }
47
+
48
48
  /**
49
49
  * @inheritDoc
50
50
  */
51
-
52
-
53
51
  componentWillUnmount() {
54
52
  if (this.cycleAdTimer) {
55
53
  clearTimeout(this.cycleAdTimer);
56
54
  }
57
55
  }
56
+
58
57
  /**
59
58
  * @inheritDoc
60
59
  */
61
-
62
-
63
60
  render() {
64
61
  // Generate the styles each render in case the ad is updated with
65
62
  // new settings that need to be reflected in the styles of the view.
66
63
  const styles = this.generateStyles();
67
64
  const currentAd = this.props.adZoneData.ads[this.state.adIndexShown] || undefined;
68
65
  const finalMainViewStyle = styles.mainView;
69
-
70
66
  if (!currentAd || !currentAd.creative_url) {
71
67
  // If there is no ad to display, make the view take up no space.
72
68
  finalMainViewStyle.width = 0;
73
69
  finalMainViewStyle.height = 0;
74
70
  }
75
-
76
71
  return /*#__PURE__*/React.createElement(View, {
77
72
  style: finalMainViewStyle
78
73
  }, currentAd && currentAd.creative_url ? /*#__PURE__*/React.createElement(WebView, {
@@ -96,12 +91,11 @@ export class AdZone extends React.Component {
96
91
  x: e.nativeEvent.pageX,
97
92
  y: e.nativeEvent.pageY
98
93
  };
99
-
100
94
  if (Math.abs(this.state.touchStartCoords.x - touchEndCoords.x) < this.props.xyDragDistanceAllowed && Math.abs(this.state.touchStartCoords.y - touchEndCoords.y) < this.props.xyDragDistanceAllowed) {
101
95
  this.onAdZoneSelected(currentAd);
102
- } // Make sure to reset the start coords
103
-
96
+ }
104
97
 
98
+ // Make sure to reset the start coords
105
99
  this.setState({
106
100
  touchStartCoords: undefined
107
101
  });
@@ -109,12 +103,11 @@ export class AdZone extends React.Component {
109
103
  }
110
104
  }) : undefined);
111
105
  }
106
+
112
107
  /**
113
108
  * Triggers when the user selects the ad zone.
114
109
  * @param currentAd - The ad currently displayed.
115
110
  */
116
-
117
-
118
111
  onAdZoneSelected(currentAd) {
119
112
  // Determine the "action type" and perform that specific action.
120
113
  if (currentAd.action_type === AdActionType.EXTERNAL && currentAd.action_path) {
@@ -123,26 +116,23 @@ export class AdZone extends React.Component {
123
116
  } else if (currentAd.action_type === AdActionType.CONTENT && currentAd.payload && currentAd.payload.detailed_list_items) {
124
117
  safeInvoke(this.props.onAddToListTriggered, currentAd.payload.detailed_list_items);
125
118
  }
126
-
127
119
  this.triggerReportAdEvent(currentAd, ReportedEventType.INTERACTION);
128
-
129
120
  if (this.cycleAdTimer) {
130
121
  clearTimeout(this.cycleAdTimer);
131
122
  }
132
-
133
123
  this.cycleDisplayedAd();
134
124
  }
125
+
135
126
  /**
136
127
  * Triggered when we need to report an ad event to the API.
137
128
  * @param currentAd - The ad to send an event for.
138
129
  * @param eventType - The event type for the reported event.
139
130
  */
140
-
141
-
142
131
  triggerReportAdEvent(currentAd, eventType) {
143
132
  // The event timestamp has to be sent as a unix timestamp.
144
- const currentTs = Math.round(new Date().getTime() / 1000); // Log the taken action/event with the API.
133
+ const currentTs = Math.round(new Date().getTime() / 1000);
145
134
 
135
+ // Log the taken action/event with the API.
146
136
  adadaptedApiRequests.reportAdEvent({
147
137
  app_id: this.props.appId,
148
138
  session_id: this.props.sessionId,
@@ -153,16 +143,16 @@ export class AdZone extends React.Component {
153
143
  event_type: eventType,
154
144
  created_at: currentTs
155
145
  }]
156
- }, this.props.deviceOs, this.props.apiEnv).then(() => {// Do nothing with the response for now...
146
+ }, this.props.deviceOs, this.props.apiEnv).then(() => {
147
+ // Do nothing with the response for now...
157
148
  });
158
149
  }
150
+
159
151
  /**
160
152
  * Generates a new timer for cycling to the next ad.
161
153
  * @param timerLength - The length of time(in milliseconds) to initialize
162
154
  * the timer with.
163
155
  */
164
-
165
-
166
156
  createAdTimer(timerLength) {
167
157
  if (this.props.adZoneData.ads.length > 0) {
168
158
  this.cycleAdTimer = setTimeout(() => {
@@ -170,42 +160,38 @@ export class AdZone extends React.Component {
170
160
  }, timerLength);
171
161
  }
172
162
  }
163
+
173
164
  /**
174
165
  * Cycles to the next ad to display in the current available sequence of ads.
175
166
  */
176
-
177
-
178
167
  cycleDisplayedAd() {
179
168
  // Start by determining the next ad index to display.
180
169
  let nextAdIndex = 0;
181
-
182
170
  if (this.state.adIndexShown < this.props.adZoneData.ads.length - 1) {
183
171
  nextAdIndex = this.state.adIndexShown + 1;
184
172
  }
185
-
186
173
  this.setState({
187
174
  adIndexShown: nextAdIndex
188
175
  }, () => {
189
176
  this.initializeAd();
190
177
  });
191
178
  }
179
+
192
180
  /**
193
181
  * Performs all ad initialization tasks when a new ad is being displayed.
194
182
  */
195
-
196
-
197
183
  initializeAd() {
198
184
  // Create the new timer based on the new ad index.
199
- this.createAdTimer(this.props.adZoneData.ads[this.state.adIndexShown].refresh_time * 1000); // Trigger an impression event for the ad.
185
+ this.createAdTimer(this.props.adZoneData.ads[this.state.adIndexShown].refresh_time * 1000);
200
186
 
187
+ // Trigger an impression event for the ad.
201
188
  this.triggerReportAdEvent(this.props.adZoneData.ads[this.state.adIndexShown], ReportedEventType.IMPRESSION);
202
189
  }
190
+
203
191
  /**
204
192
  * Generates all component related styles.
205
193
  * @returns the styles needed for the component.
206
194
  */
207
-
208
-
209
195
  generateStyles() {
210
196
  return StyleSheet.create({
211
197
  mainView: {
@@ -218,6 +204,5 @@ export class AdZone extends React.Component {
218
204
  }
219
205
  });
220
206
  }
221
-
222
207
  }
223
208
  //# sourceMappingURL=AdZone.js.map