@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.
- package/android/.project +1 -1
- package/android/.settings/org.eclipse.buildship.core.prefs +2 -2
- package/lib/commonjs/api/adadaptedApiRequests.js +10 -24
- package/lib/commonjs/api/adadaptedApiRequests.js.map +1 -1
- package/lib/commonjs/api/adadaptedApiRequests.mock.js +11 -21
- package/lib/commonjs/api/adadaptedApiRequests.mock.js.map +1 -1
- package/lib/commonjs/api/adadaptedApiTypes.js +1 -30
- package/lib/commonjs/api/adadaptedApiTypes.js.map +1 -1
- package/lib/commonjs/components/AdZone.js +21 -47
- package/lib/commonjs/components/AdZone.js.map +1 -1
- package/lib/commonjs/index.js +127 -182
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/util.js +4 -2
- package/lib/commonjs/util.js.map +1 -1
- package/lib/module/api/adadaptedApiRequests.js +9 -8
- package/lib/module/api/adadaptedApiRequests.js.map +1 -1
- package/lib/module/api/adadaptedApiRequests.mock.js +12 -11
- package/lib/module/api/adadaptedApiRequests.mock.js.map +1 -1
- package/lib/module/api/adadaptedApiTypes.js +6 -11
- package/lib/module/api/adadaptedApiTypes.js.map +1 -1
- package/lib/module/components/AdZone.js +20 -35
- package/lib/module/components/AdZone.js.map +1 -1
- package/lib/module/index.js +130 -159
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/util.js +4 -1
- package/lib/module/util.js.map +1 -1
- package/lib/typescript/src/index.d.ts +8 -0
- package/package.json +5 -5
- package/src/index.tsx +26 -5
package/android/.project
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
arguments=--init-script /var/folders/vw/1yz06gyj201f5y15zm_xv9gr0000gn/T/d146c9752a26f79b52047fb6dc6ed385d064e120494f96f08ca63a317c41f94c.gradle --init-script /var/folders/vw/1yz06gyj201f5y15zm_xv9gr0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
|
|
2
|
-
auto.sync=
|
|
2
|
+
auto.sync=true
|
|
3
3
|
build.scans.enabled=false
|
|
4
4
|
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.4.2))
|
|
5
|
-
connection.project.dir
|
|
5
|
+
connection.project.dir=
|
|
6
6
|
eclipse.preferences.version=1
|
|
7
7
|
gradle.user.home=
|
|
8
8
|
java.home=/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home
|
|
@@ -3,27 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getKeywordIntercepts = getKeywordIntercepts;
|
|
6
7
|
exports.initializeSession = initializeSession;
|
|
7
8
|
exports.refreshSessionData = refreshSessionData;
|
|
8
9
|
exports.reportAdEvent = reportAdEvent;
|
|
9
|
-
exports.getKeywordIntercepts = getKeywordIntercepts;
|
|
10
10
|
exports.reportInterceptEvent = reportInterceptEvent;
|
|
11
11
|
exports.reportListManagerEvents = reportListManagerEvents;
|
|
12
12
|
exports.reportPayloadContentStatus = reportPayloadContentStatus;
|
|
13
13
|
exports.retrievePayloadContent = retrievePayloadContent;
|
|
14
|
-
|
|
15
14
|
var _axios = _interopRequireDefault(require("axios"));
|
|
16
|
-
|
|
17
15
|
var adadaptedApiRequestMocks = _interopRequireWildcard(require("./adadaptedApiRequests.mock"));
|
|
18
|
-
|
|
19
16
|
var _index = require("../index");
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
|
-
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
20
|
/**
|
|
28
21
|
* API requests focused around Settings.
|
|
29
22
|
*/
|
|
@@ -44,6 +37,7 @@ function initializeSession(requestData, deviceOS, apiEnv) {
|
|
|
44
37
|
}
|
|
45
38
|
});
|
|
46
39
|
}
|
|
40
|
+
|
|
47
41
|
/**
|
|
48
42
|
* Makes an API request to refresh the session data.
|
|
49
43
|
* A valid session is required for this API endpoint to respond successfully.
|
|
@@ -52,8 +46,6 @@ function initializeSession(requestData, deviceOS, apiEnv) {
|
|
|
52
46
|
* @param apiEnv - The API environment to use when making the API request.
|
|
53
47
|
* @returns a promise containing the response data.
|
|
54
48
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
49
|
function refreshSessionData(requestData, deviceOS, apiEnv) {
|
|
58
50
|
return apiEnv === _index.ApiEnv.Mock ? adadaptedApiRequestMocks.refreshSessionData() : (0, _axios.default)(`${apiEnv}/v/0.9.5/${deviceOS}/ads/retrieve?aid=${requestData.aid}&sid=${requestData.sid}&uid=${requestData.uid}`, {
|
|
59
51
|
method: "GET",
|
|
@@ -62,6 +54,7 @@ function refreshSessionData(requestData, deviceOS, apiEnv) {
|
|
|
62
54
|
}
|
|
63
55
|
});
|
|
64
56
|
}
|
|
57
|
+
|
|
65
58
|
/**
|
|
66
59
|
* Makes an API request to report an ad event that has occurred.
|
|
67
60
|
* A valid session is required for this API endpoint to respond successfully.
|
|
@@ -70,8 +63,6 @@ function refreshSessionData(requestData, deviceOS, apiEnv) {
|
|
|
70
63
|
* @param apiEnv - The API environment to use when making the API request.
|
|
71
64
|
* @returns a promise containing the response data.
|
|
72
65
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
75
66
|
function reportAdEvent(requestData, deviceOS, apiEnv) {
|
|
76
67
|
return apiEnv === _index.ApiEnv.Mock ? adadaptedApiRequestMocks.reportAdEvent() : (0, _axios.default)(`${apiEnv}/v/0.9.5/${deviceOS}/ads/events`, {
|
|
77
68
|
method: "POST",
|
|
@@ -81,6 +72,7 @@ function reportAdEvent(requestData, deviceOS, apiEnv) {
|
|
|
81
72
|
}
|
|
82
73
|
});
|
|
83
74
|
}
|
|
75
|
+
|
|
84
76
|
/**
|
|
85
77
|
* Makes an API request to get all possible keyword intercepts for the session.
|
|
86
78
|
* A valid session is required for this API endpoint to respond successfully.
|
|
@@ -89,8 +81,6 @@ function reportAdEvent(requestData, deviceOS, apiEnv) {
|
|
|
89
81
|
* @param apiEnv - The API environment to use when making the API request.
|
|
90
82
|
* @returns a promise containing the response data.
|
|
91
83
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
84
|
function getKeywordIntercepts(requestData, deviceOS, apiEnv) {
|
|
95
85
|
return apiEnv === _index.ApiEnv.Mock ? adadaptedApiRequestMocks.getKeywordIntercepts() : (0, _axios.default)(`${apiEnv}/v/0.9.5/${deviceOS}/intercepts/retrieve?aid=${requestData.aid}&sid=${requestData.sid}&uid=${requestData.uid}`, {
|
|
96
86
|
method: "GET",
|
|
@@ -99,6 +89,7 @@ function getKeywordIntercepts(requestData, deviceOS, apiEnv) {
|
|
|
99
89
|
}
|
|
100
90
|
});
|
|
101
91
|
}
|
|
92
|
+
|
|
102
93
|
/**
|
|
103
94
|
* Makes an API request to report an intercept event that has occurred.
|
|
104
95
|
* A valid session is required for this API endpoint to respond successfully.
|
|
@@ -107,8 +98,6 @@ function getKeywordIntercepts(requestData, deviceOS, apiEnv) {
|
|
|
107
98
|
* @param apiEnv - The API environment to use when making the API request.
|
|
108
99
|
* @returns a promise containing the response data.
|
|
109
100
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
101
|
function reportInterceptEvent(requestData, deviceOS, apiEnv) {
|
|
113
102
|
return apiEnv === _index.ApiEnv.Mock ? adadaptedApiRequestMocks.reportInterceptEvent() : (0, _axios.default)(`${apiEnv}/v/0.9.5/${deviceOS}/intercepts/events`, {
|
|
114
103
|
method: "POST",
|
|
@@ -118,6 +107,7 @@ function reportInterceptEvent(requestData, deviceOS, apiEnv) {
|
|
|
118
107
|
}
|
|
119
108
|
});
|
|
120
109
|
}
|
|
110
|
+
|
|
121
111
|
/**
|
|
122
112
|
* Makes an API request to report List Manager events.
|
|
123
113
|
* A valid session is required for this API endpoint to respond successfully.
|
|
@@ -126,8 +116,6 @@ function reportInterceptEvent(requestData, deviceOS, apiEnv) {
|
|
|
126
116
|
* @param apiEnv - The API environment to use when making the API request.
|
|
127
117
|
* @returns a promise containing the response data.
|
|
128
118
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
119
|
function reportListManagerEvents(requestData, deviceOS, apiEnv) {
|
|
132
120
|
return apiEnv === _index.ListManagerApiEnv.Mock ? adadaptedApiRequestMocks.reportListManagerEvents() : (0, _axios.default)(`${apiEnv}/v/1/${deviceOS}/events`, {
|
|
133
121
|
method: "POST",
|
|
@@ -137,6 +125,7 @@ function reportListManagerEvents(requestData, deviceOS, apiEnv) {
|
|
|
137
125
|
}
|
|
138
126
|
});
|
|
139
127
|
}
|
|
128
|
+
|
|
140
129
|
/**
|
|
141
130
|
* Makes an API request to report the results of the
|
|
142
131
|
* "out of app" add to list payload received.
|
|
@@ -145,8 +134,6 @@ function reportListManagerEvents(requestData, deviceOS, apiEnv) {
|
|
|
145
134
|
* @param apiEnv - The API environment to use when making the API request.
|
|
146
135
|
* @returns a promise containing the response data.
|
|
147
136
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
137
|
function reportPayloadContentStatus(requestData, apiEnv) {
|
|
151
138
|
return apiEnv === _index.PayloadApiEnv.Mock ? adadaptedApiRequestMocks.reportPayloadContentStatus() : (0, _axios.default)(`${apiEnv}/v/1/tracking`, {
|
|
152
139
|
method: "POST",
|
|
@@ -156,6 +143,7 @@ function reportPayloadContentStatus(requestData, apiEnv) {
|
|
|
156
143
|
}
|
|
157
144
|
});
|
|
158
145
|
}
|
|
146
|
+
|
|
159
147
|
/**
|
|
160
148
|
* Makes an API request to get all outstanding add to list payloads for a given user.
|
|
161
149
|
* A valid session is required for this API endpoint to respond successfully.
|
|
@@ -163,8 +151,6 @@ function reportPayloadContentStatus(requestData, apiEnv) {
|
|
|
163
151
|
* @param apiEnv - The API environment to use when making the API request.
|
|
164
152
|
* @returns a promise containing the response data.
|
|
165
153
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
168
154
|
function retrievePayloadContent(requestData, apiEnv) {
|
|
169
155
|
return apiEnv === _index.PayloadApiEnv.Mock ? adadaptedApiRequestMocks.retrievePayloadContent() : (0, _axios.default)(`${apiEnv}/v/1/pickup`, {
|
|
170
156
|
method: "POST",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["adadaptedApiRequests.ts"],"names":["initializeSession","requestData","deviceOS","apiEnv","ApiEnv","Mock","adadaptedApiRequestMocks","method","data","headers","accept","refreshSessionData","aid","sid","uid","reportAdEvent","getKeywordIntercepts","reportInterceptEvent","reportListManagerEvents","ListManagerApiEnv","reportPayloadContentStatus","PayloadApiEnv","retrievePayloadContent"],"mappings":";;;;;;;;;;;;;;AAmBA;;AACA;;AACA;;;;;;;;AArBA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAT,CACHC,WADG,EAEHC,QAFG,EAGHC,MAHG,EAI8C;AACjD,SAAOA,MAAM,KAAKC,cAAOC,IAAlB,GACDC,wBAAwB,CAACN,iBAAzB,EADC,GAED,oBAAO,GAAEG,MAAO,YAAWD,QAAS,sBAApC,EAA2D;AACvDK,IAAAA,MAAM,EAAE,MAD+C;AAEvDC,IAAAA,IAAI,EAAEP,WAFiD;AAGvDQ,IAAAA,OAAO,EAAE;AACLC,MAAAA,MAAM,EAAE;AADH;AAH8C,GAA3D,CAFN;AASH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,kBAAT,CACHV,WADG,EAEHC,QAFG,EAGHC,MAHG,EAI+C;AAClD,SAAOA,MAAM,KAAKC,cAAOC,IAAlB,GACDC,wBAAwB,CAACK,kBAAzB,EADC,GAED,oBACK,GAAER,MAAO,YAAWD,QAAS,qBAAoBD,WAAW,CAACW,GAAI,QAAOX,WAAW,CAACY,GAAI,QAAOZ,WAAW,CAACa,GAAI,EADpH,EAEI;AACIP,IAAAA,MAAM,EAAE,KADZ;AAEIE,IAAAA,OAAO,EAAE;AACLC,MAAAA,MAAM,EAAE;AADH;AAFb,GAFJ,CAFN;AAWH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASK,aAAT,CACHd,WADG,EAEHC,QAFG,EAGHC,MAHG,EAI0C;AAC7C,SAAOA,MAAM,KAAKC,cA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AAzB,EADC,GAED,oBAAO,GAAEf,MAAO,QAAOD,QAAS,SAAhC,EAA0C;AACtCK,IAAAA,MAAM,EAAE,MAD8B;AAEtCC,IAAAA,IAAI,EAAEP,WAFgC;AAGtCQ,IAAAA,OAAO,EAAE;AACLC,MAAAA,MAAM,EAAE;AADH;AAH6B,GAA1C,CAFN;AASH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASU,0BAAT,CACHnB,WADG,EAEHE,MAFG,EAGyB;AAC5B,SAAOA,MAAM,KAAKkB,qBAAchB,IAAzB,GACDC,wBAAwB,CAACc,0BAAzB,EADC,GAED,oBAAO,GAAEjB,MAAO,eAAhB,EAAgC;AAC5BI,IAAAA,MAAM,EAAE,MADoB;AAE5BC,IAAAA,IAAI,EAAEP,WAFsB;AAG5BQ,IAAAA,OAAO,EAAE;AACLC,MAAAA,MAAM,EAAE;AADH;AAHmB,GAAhC,CAFN;AASH;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASY,sBAAT,CACHrB,WADG,EAEHE,MAFG,EAGoD;AACvD,SAAOA,MAAM,KAAKkB,qBAAchB,IAAzB,GACDC,wBAAwB,CAACgB,sBAAzB,EADC,GAED,oBAAO,GAAEnB,MAAO,aAAhB,EAA8B;AAC1BI,IAAAA,MAAM,EAAE,MADkB;AAE1BC,IAAAA,IAAI,EAAEP,WAFoB;AAG1BQ,IAAAA,OAAO,EAAE;AACLC,MAAAA,MAAM,EAAE;AADH;AAHiB,GAA9B,CAFN;AASH","sourcesContent":["/**\n * API requests focused around Settings.\n */\nimport {\n InitializeSessionRequest,\n InitializeSessionResponse,\n KeywordInterceptsRequest,\n KeywordInterceptsResponse,\n RefreshSessionDataRequest,\n RefreshSessionDataResponse,\n ReportAdEventRequest,\n ReportAdEventResponse,\n ReportInterceptEventRequest,\n ReportInterceptEventResponse,\n ReportListManagerDataRequest,\n ReportPayloadDataRequest,\n RetrievePayloadItemDataRequest,\n RetrievePayloadItemDataResponse,\n} from \"./adadaptedApiTypes\";\nimport axios, { AxiosResponse } from \"axios\";\nimport * as adadaptedApiRequestMocks from \"./adadaptedApiRequests.mock\";\nimport { ApiEnv, DeviceOS, ListManagerApiEnv, PayloadApiEnv } from \"../index\";\n\n/**\n * Makes an API request to initialize the session for the AdAdapted API.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function initializeSession(\n requestData: InitializeSessionRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<InitializeSessionResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.initializeSession()\n : axios(`${apiEnv}/v/0.9.5/${deviceOS}/sessions/initialize`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to refresh the session data.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function refreshSessionData(\n requestData: RefreshSessionDataRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<RefreshSessionDataResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.refreshSessionData()\n : axios(\n `${apiEnv}/v/0.9.5/${deviceOS}/ads/retrieve?aid=${requestData.aid}&sid=${requestData.sid}&uid=${requestData.uid}`,\n {\n method: \"GET\",\n headers: {\n accept: \"application/json\",\n },\n }\n );\n}\n\n/**\n * Makes an API request to report an ad event that has occurred.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportAdEvent(\n requestData: ReportAdEventRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<ReportAdEventResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.reportAdEvent()\n : axios(`${apiEnv}/v/0.9.5/${deviceOS}/ads/events`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to get all possible keyword intercepts for the session.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function getKeywordIntercepts(\n requestData: KeywordInterceptsRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<KeywordInterceptsResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.getKeywordIntercepts()\n : axios(\n `${apiEnv}/v/0.9.5/${deviceOS}/intercepts/retrieve?aid=${requestData.aid}&sid=${requestData.sid}&uid=${requestData.uid}`,\n {\n method: \"GET\",\n headers: {\n accept: \"application/json\",\n },\n }\n );\n}\n\n/**\n * Makes an API request to report an intercept event that has occurred.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportInterceptEvent(\n requestData: ReportInterceptEventRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<ReportInterceptEventResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.reportInterceptEvent()\n : axios(`${apiEnv}/v/0.9.5/${deviceOS}/intercepts/events`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to report List Manager events.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportListManagerEvents(\n requestData: ReportListManagerDataRequest,\n deviceOS: DeviceOS,\n apiEnv: ListManagerApiEnv\n): Promise<AxiosResponse<void>> {\n return apiEnv === ListManagerApiEnv.Mock\n ? adadaptedApiRequestMocks.reportListManagerEvents()\n : axios(`${apiEnv}/v/1/${deviceOS}/events`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to report the results of the\n * \"out of app\" add to list payload received.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportPayloadContentStatus(\n requestData: ReportPayloadDataRequest,\n apiEnv: PayloadApiEnv\n): Promise<AxiosResponse<void>> {\n return apiEnv === PayloadApiEnv.Mock\n ? adadaptedApiRequestMocks.reportPayloadContentStatus()\n : axios(`${apiEnv}/v/1/tracking`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to get all outstanding add to list payloads for a given user.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function retrievePayloadContent(\n requestData: RetrievePayloadItemDataRequest,\n apiEnv: PayloadApiEnv\n): Promise<AxiosResponse<RetrievePayloadItemDataResponse>> {\n return apiEnv === PayloadApiEnv.Mock\n ? adadaptedApiRequestMocks.retrievePayloadContent()\n : axios(`${apiEnv}/v/1/pickup`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n"]}
|
|
1
|
+
{"version":3,"names":["initializeSession","requestData","deviceOS","apiEnv","ApiEnv","Mock","adadaptedApiRequestMocks","axios","method","data","headers","accept","refreshSessionData","aid","sid","uid","reportAdEvent","getKeywordIntercepts","reportInterceptEvent","reportListManagerEvents","ListManagerApiEnv","reportPayloadContentStatus","PayloadApiEnv","retrievePayloadContent"],"sources":["adadaptedApiRequests.ts"],"sourcesContent":["/**\n * API requests focused around Settings.\n */\nimport {\n InitializeSessionRequest,\n InitializeSessionResponse,\n KeywordInterceptsRequest,\n KeywordInterceptsResponse,\n RefreshSessionDataRequest,\n RefreshSessionDataResponse,\n ReportAdEventRequest,\n ReportAdEventResponse,\n ReportInterceptEventRequest,\n ReportInterceptEventResponse,\n ReportListManagerDataRequest,\n ReportPayloadDataRequest,\n RetrievePayloadItemDataRequest,\n RetrievePayloadItemDataResponse,\n} from \"./adadaptedApiTypes\";\nimport axios, { AxiosResponse } from \"axios\";\nimport * as adadaptedApiRequestMocks from \"./adadaptedApiRequests.mock\";\nimport { ApiEnv, DeviceOS, ListManagerApiEnv, PayloadApiEnv } from \"../index\";\n\n/**\n * Makes an API request to initialize the session for the AdAdapted API.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function initializeSession(\n requestData: InitializeSessionRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<InitializeSessionResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.initializeSession()\n : axios(`${apiEnv}/v/0.9.5/${deviceOS}/sessions/initialize`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to refresh the session data.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function refreshSessionData(\n requestData: RefreshSessionDataRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<RefreshSessionDataResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.refreshSessionData()\n : axios(\n `${apiEnv}/v/0.9.5/${deviceOS}/ads/retrieve?aid=${requestData.aid}&sid=${requestData.sid}&uid=${requestData.uid}`,\n {\n method: \"GET\",\n headers: {\n accept: \"application/json\",\n },\n }\n );\n}\n\n/**\n * Makes an API request to report an ad event that has occurred.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportAdEvent(\n requestData: ReportAdEventRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<ReportAdEventResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.reportAdEvent()\n : axios(`${apiEnv}/v/0.9.5/${deviceOS}/ads/events`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to get all possible keyword intercepts for the session.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function getKeywordIntercepts(\n requestData: KeywordInterceptsRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<KeywordInterceptsResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.getKeywordIntercepts()\n : axios(\n `${apiEnv}/v/0.9.5/${deviceOS}/intercepts/retrieve?aid=${requestData.aid}&sid=${requestData.sid}&uid=${requestData.uid}`,\n {\n method: \"GET\",\n headers: {\n accept: \"application/json\",\n },\n }\n );\n}\n\n/**\n * Makes an API request to report an intercept event that has occurred.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportInterceptEvent(\n requestData: ReportInterceptEventRequest,\n deviceOS: DeviceOS,\n apiEnv: ApiEnv\n): Promise<AxiosResponse<ReportInterceptEventResponse>> {\n return apiEnv === ApiEnv.Mock\n ? adadaptedApiRequestMocks.reportInterceptEvent()\n : axios(`${apiEnv}/v/0.9.5/${deviceOS}/intercepts/events`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to report List Manager events.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param deviceOS - The operating system being ran on the device.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportListManagerEvents(\n requestData: ReportListManagerDataRequest,\n deviceOS: DeviceOS,\n apiEnv: ListManagerApiEnv\n): Promise<AxiosResponse<void>> {\n return apiEnv === ListManagerApiEnv.Mock\n ? adadaptedApiRequestMocks.reportListManagerEvents()\n : axios(`${apiEnv}/v/1/${deviceOS}/events`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to report the results of the\n * \"out of app\" add to list payload received.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function reportPayloadContentStatus(\n requestData: ReportPayloadDataRequest,\n apiEnv: PayloadApiEnv\n): Promise<AxiosResponse<void>> {\n return apiEnv === PayloadApiEnv.Mock\n ? adadaptedApiRequestMocks.reportPayloadContentStatus()\n : axios(`${apiEnv}/v/1/tracking`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n\n/**\n * Makes an API request to get all outstanding add to list payloads for a given user.\n * A valid session is required for this API endpoint to respond successfully.\n * @param requestData - The data to be sent with the request.\n * @param apiEnv - The API environment to use when making the API request.\n * @returns a promise containing the response data.\n */\nexport function retrievePayloadContent(\n requestData: RetrievePayloadItemDataRequest,\n apiEnv: PayloadApiEnv\n): Promise<AxiosResponse<RetrievePayloadItemDataResponse>> {\n return apiEnv === PayloadApiEnv.Mock\n ? adadaptedApiRequestMocks.retrievePayloadContent()\n : axios(`${apiEnv}/v/1/pickup`, {\n method: \"POST\",\n data: requestData,\n headers: {\n accept: \"application/json\",\n },\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA;AACA;AACA;AAA8E;AAAA;AAAA;AArB9E;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAiB,CAC7BC,WAAqC,EACrCC,QAAkB,EAClBC,MAAc,EACmC;EACjD,OAAOA,MAAM,KAAKC,aAAM,CAACC,IAAI,GACvBC,wBAAwB,CAACN,iBAAiB,EAAE,GAC5C,IAAAO,cAAK,EAAE,GAAEJ,MAAO,YAAWD,QAAS,sBAAqB,EAAE;IACvDM,MAAM,EAAE,MAAM;IACdC,IAAI,EAAER,WAAW;IACjBS,OAAO,EAAE;MACLC,MAAM,EAAE;IACZ;EACJ,CAAC,CAAC;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkB,CAC9BX,WAAsC,EACtCC,QAAkB,EAClBC,MAAc,EACoC;EAClD,OAAOA,MAAM,KAAKC,aAAM,CAACC,IAAI,GACvBC,wBAAwB,CAACM,kBAAkB,EAAE,GAC7C,IAAAL,cAAK,EACA,GAAEJ,MAAO,YAAWD,QAAS,qBAAoBD,WAAW,CAACY,GAAI,QAAOZ,WAAW,CAACa,GAAI,QAAOb,WAAW,CAACc,GAAI,EAAC,EACjH;IACIP,MAAM,EAAE,KAAK;IACbE,OAAO,EAAE;MACLC,MAAM,EAAE;IACZ;EACJ,CAAC,CACJ;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,aAAa,CACzBf,WAAiC,EACjCC,QAAkB,EAClBC,MAAc,EAC+B;EAC7C,OAAOA,MAAM,KAAKC,aAAM,CAACC,IAAI,GACvBC,wBAAwB,CAACU,aAAa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AAS,SAAQ,EAAE;IACtCM,MAAM,EAAE,MAAM;IACdC,IAAI,EAAER,WAAW;IACjBS,OAAO,EAAE;MACLC,MAAM,EAAE;IACZ;EACJ,CAAC,CAAC;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,0BAA0B,CACtCpB,WAAqC,EACrCE,MAAqB,EACO;EAC5B,OAAOA,MAAM,KAAKmB,oBAAa,CAACjB,IAAI,GAC9BC,wBAAwB,CAACe,0BAA0B,EAAE,GACrD,IAAAd,cAAK,EAAE,GAAEJ,MAAO,eAAc,EAAE;IAC5BK,MAAM,EAAE,MAAM;IACdC,IAAI,EAAER,WAAW;IACjBS,OAAO,EAAE;MACLC,MAAM,EAAE;IACZ;EACJ,CAAC,CAAC;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASY,sBAAsB,CAClCtB,WAA2C,EAC3CE,MAAqB,EACkC;EACvD,OAAOA,MAAM,KAAKmB,oBAAa,CAACjB,IAAI,GAC9BC,wBAAwB,CAACiB,sBAAsB,EAAE,GACjD,IAAAhB,cAAK,EAAE,GAAEJ,MAAO,aAAY,EAAE;IAC1BK,MAAM,EAAE,MAAM;IACdC,IAAI,EAAER,WAAW;IACjBS,OAAO,EAAE;MACLC,MAAM,EAAE;IACZ;EACJ,CAAC,CAAC;AACZ"}
|
|
@@ -3,17 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getKeywordIntercepts = getKeywordIntercepts;
|
|
6
7
|
exports.initializeSession = initializeSession;
|
|
7
8
|
exports.refreshSessionData = refreshSessionData;
|
|
8
9
|
exports.reportAdEvent = reportAdEvent;
|
|
9
|
-
exports.getKeywordIntercepts = getKeywordIntercepts;
|
|
10
10
|
exports.reportInterceptEvent = reportInterceptEvent;
|
|
11
11
|
exports.reportListManagerEvents = reportListManagerEvents;
|
|
12
12
|
exports.reportPayloadContentStatus = reportPayloadContentStatus;
|
|
13
13
|
exports.retrievePayloadContent = retrievePayloadContent;
|
|
14
|
-
|
|
15
14
|
var _adadaptedApiTypes = require("./adadaptedApiTypes");
|
|
16
|
-
|
|
17
15
|
/**
|
|
18
16
|
* Contains all API request mocks for the Rewards API.
|
|
19
17
|
*/
|
|
@@ -34,12 +32,11 @@ function initializeSession() {
|
|
|
34
32
|
});
|
|
35
33
|
});
|
|
36
34
|
}
|
|
35
|
+
|
|
37
36
|
/**
|
|
38
37
|
* Mocks the API call for refreshing session data.
|
|
39
38
|
* @returns a promise of an {@link AxiosResponse} of the mocked data.
|
|
40
39
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
40
|
function refreshSessionData() {
|
|
44
41
|
return new Promise(resolve => {
|
|
45
42
|
resolve({
|
|
@@ -52,12 +49,11 @@ function refreshSessionData() {
|
|
|
52
49
|
});
|
|
53
50
|
});
|
|
54
51
|
}
|
|
52
|
+
|
|
55
53
|
/**
|
|
56
54
|
* Mocks the API call for reporting an ad event.
|
|
57
55
|
* @returns a promise of an {@link AxiosResponse} of the mocked data.
|
|
58
56
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
57
|
function reportAdEvent() {
|
|
62
58
|
return new Promise(resolve => {
|
|
63
59
|
resolve({
|
|
@@ -72,12 +68,11 @@ function reportAdEvent() {
|
|
|
72
68
|
});
|
|
73
69
|
});
|
|
74
70
|
}
|
|
71
|
+
|
|
75
72
|
/**
|
|
76
73
|
* Mocks the API call for getting keyword intercepts.
|
|
77
74
|
* @returns a promise of an {@link AxiosResponse} of the mocked data.
|
|
78
75
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
76
|
function getKeywordIntercepts() {
|
|
82
77
|
return new Promise(resolve => {
|
|
83
78
|
resolve({
|
|
@@ -90,12 +85,11 @@ function getKeywordIntercepts() {
|
|
|
90
85
|
});
|
|
91
86
|
});
|
|
92
87
|
}
|
|
88
|
+
|
|
93
89
|
/**
|
|
94
90
|
* Mocks the API call for reporting an ad event.
|
|
95
91
|
* @returns a promise of an {@link AxiosResponse} of the mocked data.
|
|
96
92
|
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
93
|
function reportInterceptEvent() {
|
|
100
94
|
return new Promise(resolve => {
|
|
101
95
|
resolve({
|
|
@@ -110,12 +104,11 @@ function reportInterceptEvent() {
|
|
|
110
104
|
});
|
|
111
105
|
});
|
|
112
106
|
}
|
|
107
|
+
|
|
113
108
|
/**
|
|
114
109
|
* Mocks the API call for reporting List Manager events.
|
|
115
110
|
* @returns a promise of an {@link AxiosResponse} of the mocked data.
|
|
116
111
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
112
|
function reportListManagerEvents() {
|
|
120
113
|
return new Promise(resolve => {
|
|
121
114
|
resolve({
|
|
@@ -128,12 +121,11 @@ function reportListManagerEvents() {
|
|
|
128
121
|
});
|
|
129
122
|
});
|
|
130
123
|
}
|
|
124
|
+
|
|
131
125
|
/**
|
|
132
126
|
* Mocks the API call for reporting Payload content status.
|
|
133
127
|
* @returns a promise of an {@link AxiosResponse} of the mocked data.
|
|
134
128
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
129
|
function reportPayloadContentStatus() {
|
|
138
130
|
return new Promise(resolve => {
|
|
139
131
|
resolve({
|
|
@@ -146,12 +138,11 @@ function reportPayloadContentStatus() {
|
|
|
146
138
|
});
|
|
147
139
|
});
|
|
148
140
|
}
|
|
141
|
+
|
|
149
142
|
/**
|
|
150
143
|
* Mocks the API call for reporting Payload content status.
|
|
151
144
|
* @returns a promise of an {@link AxiosResponse} of the mocked data.
|
|
152
145
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
146
|
function retrievePayloadContent() {
|
|
156
147
|
return new Promise(resolve => {
|
|
157
148
|
resolve({
|
|
@@ -177,11 +168,10 @@ function retrievePayloadContent() {
|
|
|
177
168
|
});
|
|
178
169
|
});
|
|
179
170
|
}
|
|
171
|
+
|
|
180
172
|
/**
|
|
181
173
|
* Mock data for an {@link AdSession} object.
|
|
182
174
|
*/
|
|
183
|
-
|
|
184
|
-
|
|
185
175
|
const AD_SESSION_DATA = {
|
|
186
176
|
session_id: "TEST_SESSION_ID",
|
|
187
177
|
will_serve_ads: true,
|
|
@@ -220,10 +210,10 @@ const AD_SESSION_DATA = {
|
|
|
220
210
|
}
|
|
221
211
|
}
|
|
222
212
|
};
|
|
213
|
+
|
|
223
214
|
/**
|
|
224
215
|
* Mock data for an {@link AdSession} object.
|
|
225
216
|
*/
|
|
226
|
-
|
|
227
217
|
const REFRESHED_AD_SESSION_DATA = {
|
|
228
218
|
session_id: "TEST_SESSION_ID",
|
|
229
219
|
will_serve_ads: true,
|
|
@@ -262,10 +252,10 @@ const REFRESHED_AD_SESSION_DATA = {
|
|
|
262
252
|
}
|
|
263
253
|
}
|
|
264
254
|
};
|
|
255
|
+
|
|
265
256
|
/**
|
|
266
257
|
* Mock data for an {@link AdSession} object.
|
|
267
258
|
*/
|
|
268
|
-
|
|
269
259
|
const KEYWORD_INTERCEPT_DATA = {
|
|
270
260
|
search_id: "test-search-id",
|
|
271
261
|
min_match_length: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["adadaptedApiRequests.mock.ts"],"names":["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","AdActionType","CONTENT","action_path","payload","search_id","min_match_length","terms","term_id","term","replacement","priority"],"mappings":";;;;;;;;;;;;;;AAIA;;AAJA;AACA;AACA;;AAcA;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AHuC,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&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&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":["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","AdActionType","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&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&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":";;;;;;;;;;;;;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C,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"}
|
|
@@ -3,63 +3,49 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ReportedEventType = exports.PayloadStatus = exports.ListManagerEventSource = exports.ListManagerEventName = exports.AdActionType = void 0;
|
|
7
7
|
// =============================================================================
|
|
8
8
|
// API TYPE MODELS
|
|
9
9
|
// =============================================================================
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* The definition of an ad session data object.
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* The definition of a zone.
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
16
|
/**
|
|
20
17
|
* The definition of an Ad.
|
|
21
18
|
*/
|
|
22
|
-
|
|
23
19
|
/**
|
|
24
20
|
* The definition of an Ad Payload.
|
|
25
21
|
*/
|
|
26
|
-
|
|
27
22
|
/**
|
|
28
23
|
* The definition of an "out of app" data payload.
|
|
29
24
|
*/
|
|
30
|
-
|
|
31
25
|
/**
|
|
32
26
|
* The definition of a Detailed List Item.
|
|
33
27
|
*/
|
|
34
|
-
|
|
35
28
|
/**
|
|
36
29
|
* The definition of a Keyword Intercepts object.
|
|
37
30
|
*/
|
|
38
|
-
|
|
39
31
|
/**
|
|
40
32
|
* The definition of a Keyword Search Term.
|
|
41
33
|
*/
|
|
42
|
-
|
|
43
34
|
/**
|
|
44
35
|
* The definition of a Reported Ad Event.
|
|
45
36
|
*/
|
|
46
|
-
|
|
47
37
|
/**
|
|
48
38
|
* The definition of a Reported Intercept Event.
|
|
49
39
|
*/
|
|
50
|
-
|
|
51
40
|
/**
|
|
52
41
|
* Interface defining the structure of an event to send when using List Manager.
|
|
53
42
|
*/
|
|
54
|
-
|
|
55
43
|
/**
|
|
56
44
|
* Interface defining the structure of a payload tracking event.
|
|
57
45
|
*/
|
|
58
|
-
|
|
59
46
|
/**
|
|
60
47
|
* Interface defining the structure of an Event Param for List Manager.
|
|
61
48
|
*/
|
|
62
|
-
|
|
63
49
|
/**
|
|
64
50
|
* Enumeration that defines the possible values for a List Manager Event Source.
|
|
65
51
|
*/
|
|
@@ -67,33 +53,25 @@ let ListManagerEventSource;
|
|
|
67
53
|
/**
|
|
68
54
|
* Enumeration that defines the possible values for a List Manager Event Name.
|
|
69
55
|
*/
|
|
70
|
-
|
|
71
56
|
exports.ListManagerEventSource = ListManagerEventSource;
|
|
72
|
-
|
|
73
57
|
(function (ListManagerEventSource) {
|
|
74
58
|
ListManagerEventSource["APP"] = "app";
|
|
75
59
|
})(ListManagerEventSource || (exports.ListManagerEventSource = ListManagerEventSource = {}));
|
|
76
|
-
|
|
77
60
|
let ListManagerEventName;
|
|
78
61
|
/**
|
|
79
62
|
* Enum defining the available ad action types.
|
|
80
63
|
*/
|
|
81
|
-
|
|
82
64
|
exports.ListManagerEventName = ListManagerEventName;
|
|
83
|
-
|
|
84
65
|
(function (ListManagerEventName) {
|
|
85
66
|
ListManagerEventName["ADDED_TO_LIST"] = "user_added_to_list";
|
|
86
67
|
ListManagerEventName["CROSSED_OFF_LIST"] = "user_crossed_off_list";
|
|
87
68
|
ListManagerEventName["DELETED_FROM_LIST"] = "user_deleted_from_list";
|
|
88
69
|
})(ListManagerEventName || (exports.ListManagerEventName = ListManagerEventName = {}));
|
|
89
|
-
|
|
90
70
|
let AdActionType;
|
|
91
71
|
/**
|
|
92
72
|
* Enum defining the different types of events that can be reported.
|
|
93
73
|
*/
|
|
94
|
-
|
|
95
74
|
exports.AdActionType = AdActionType;
|
|
96
|
-
|
|
97
75
|
(function (AdActionType) {
|
|
98
76
|
AdActionType["CONTENT"] = "c";
|
|
99
77
|
AdActionType["EXTERNAL"] = "e";
|
|
@@ -101,14 +79,11 @@ exports.AdActionType = AdActionType;
|
|
|
101
79
|
AdActionType["APP"] = "a";
|
|
102
80
|
AdActionType["NONE"] = "n";
|
|
103
81
|
})(AdActionType || (exports.AdActionType = AdActionType = {}));
|
|
104
|
-
|
|
105
82
|
let ReportedEventType;
|
|
106
83
|
/**
|
|
107
84
|
* Enumeration defining the possible payload acknowledgment status values.
|
|
108
85
|
*/
|
|
109
|
-
|
|
110
86
|
exports.ReportedEventType = ReportedEventType;
|
|
111
|
-
|
|
112
87
|
(function (ReportedEventType) {
|
|
113
88
|
ReportedEventType["IMPRESSION"] = "impression";
|
|
114
89
|
ReportedEventType["INTERACTION"] = "interaction";
|
|
@@ -117,17 +92,13 @@ exports.ReportedEventType = ReportedEventType;
|
|
|
117
92
|
ReportedEventType["PRESENTED"] = "presented";
|
|
118
93
|
ReportedEventType["SELECTED"] = "selected";
|
|
119
94
|
})(ReportedEventType || (exports.ReportedEventType = ReportedEventType = {}));
|
|
120
|
-
|
|
121
95
|
let PayloadStatus; // =============================================================================
|
|
122
96
|
// REQUEST MODELS
|
|
123
97
|
// =============================================================================
|
|
124
|
-
|
|
125
98
|
/**
|
|
126
99
|
* The base request inputs that most requests will use.
|
|
127
100
|
*/
|
|
128
|
-
|
|
129
101
|
exports.PayloadStatus = PayloadStatus;
|
|
130
|
-
|
|
131
102
|
(function (PayloadStatus) {
|
|
132
103
|
PayloadStatus["DELIVERED"] = "delivered";
|
|
133
104
|
PayloadStatus["REJECTED"] = "rejected";
|