@adadapted/react-native-sdk 3.1.12 → 3.2.0

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 +1 @@
1
- {"version":3,"names":["DeviceOS","ApiEnv","ListManagerApiEnv","PayloadApiEnv","AdadaptedReactNativeSdk","getSessionId","sessionId","getDeviceInfo","deviceInfo","getAdZones","adZones","constructor","apiEnv","Prod","listManagerApiEnv","payloadApiEnv","onAdZonesRefreshed","onAddToListTriggered","onOutOfAppPayloadAvailable","keywordInterceptSearchValue","initialize","bind","unmount","handleAppStateChange","handleDeepLink","getDeviceInformation","Promise","resolve","NativeModules","then","response","generateAdZones","adZoneInfoList","adZoneId","Object","prototype","hasOwnProperty","call","push","zoneId","id","adZone","appId","udid","deviceOs","xyAdZoneDragDistanceAllowed","items","safeInvoke","onRefreshAdZones","timerMs","sessionInfo","polling_interval_ms","refreshAdZonesTimer","setTimeout","adadaptedApiRequests","refreshSessionData","aid","sid","uid","data","zones","catch","err","console","error","getKeywordIntercepts","keywordIntercepts","performKeywordSearch","getKeywordInterceptTerm","termId","term","termObj","terms","term_id","getCurrentUnixTimestamp","Math","round","Date","getTime","getListManagerApiRequestData","eventSource","eventName","itemNames","listName","eventList","itemName","event_source","event_name","event_timestamp","event_params","item_name","list_name","session_id","app_id","events","event","searchStr","dataIndex","indexOf","encodedData","url","substr","length","payloadData","JSON","parse","base64","decode","payloadId","itemDataList","finalItemList","itemData","payload_id","detailed_list_items","product_title","product_brand","product_category","product_barcode","product_discount","product_image","product_sku","state","getPayloadItemData","retrievePayloadContent","payload","payloads","props","Dev","xyDragDistanceAllowed","reject","deviceInfoObj","systemName","IOS","ANDROID","Platform","OS","advertiserId","undefined","initializeSession","device_udid","sdk_version","packageJson","version","device_width","parseInt","deviceWidth","device_height","deviceHeight","device_density","deviceScreenDensity","device_carrier","deviceCarrier","device_name","deviceName","device_os","device_osv","systemVersion","device_locale","deviceLocale","device_timezone","deviceTimezone","bundle_id","bundleId","bundle_version","bundleVersion","allow_retargeting","isAdTrackingEnabled","storeCurrentSessionId","Linking","getInitialURL","deepLinkOnEventListener","addEventListener","AppStateOnEventListener","AppState","searchTerm","finalResultListStartsWith","finalResultListContains","trim","min_match_length","finalEventsList","currentTs","toLowerCase","startsWith","search_id","user_input","event_type","ReportedEventType","MATCHED","created_at","sort","a","b","priority","NOT_MATCHED","reportInterceptEvent","concat","reportKeywordInterceptTermSelected","SELECTED","reportKeywordInterceptTermsPresented","termIds","termObjs","termEvents","PRESENTED","reportItemsAddedToList","requestData","ListManagerEventSource","APP","ListManagerEventName","ADDED_TO_LIST","reportListManagerEvents","reportItemsCrossedOffList","CROSSED_OFF_LIST","reportItemsDeletedFromList","DELETED_FROM_LIST","markPayloadContentAcknowledged","reportPayloadContentStatus","tracking","status","PayloadStatus","DELIVERED","markPayloadContentRejected","REJECTED","clearTimeout","remove"],"sources":["index.tsx"],"sourcesContent":["/**\n * The AdadaptedReactNativeSdk package/module definition.\n */\nimport * as React from \"react\";\nimport {\n AppState,\n EmitterSubscription,\n Linking,\n NativeModules,\n Platform,\n} from \"react-native\";\nimport * as adadaptedApiRequests from \"./api/adadaptedApiRequests\";\nimport {\n AdSession,\n DetailedListItem,\n KeywordIntercepts,\n KeywordSearchTerm,\n ListManagerEvent,\n ListManagerEventName,\n ListManagerEventSource,\n OutOfAppDataPayload,\n PayloadStatus,\n ReportedEventType,\n ReportedInterceptEvent,\n ReportListManagerDataRequest,\n Zone,\n} from \"./api/adadaptedApiTypes\";\nimport { AdZone } from \"./components/AdZone\";\nimport { safeInvoke } from \"./util\";\nimport packageJson from \"../package.json\";\nimport base64 from \"react-native-base64\";\n\n/**\n * Enum representing possible device operating systems.\n */\nexport enum DeviceOS {\n /**\n * Represents the Android operating system.\n */\n ANDROID = \"android\",\n /**\n * Represents the iOS operating system.\n */\n IOS = \"ios\",\n}\n\n/**\n * Enum defining the different API environments.\n */\nexport enum ApiEnv {\n /**\n * The production API environment.\n */\n Prod = \"https://ads.adadapted.com\",\n /**\n * The development API environment.\n */\n Dev = \"https://sandbox.adadapted.com\",\n /**\n * Used only for unit testing/mock data.\n */\n Mock = \"MOCK_DATA\",\n}\n\n/**\n * Enum defining the different API environments for List Manager.\n */\nexport enum ListManagerApiEnv {\n /**\n * The production API environment.\n */\n Prod = \"https://ec.adadapted.com\",\n /**\n * The development API environment.\n */\n Dev = \"https://sandec.adadapted.com\",\n /**\n * Used only for unit testing/mocking data.\n */\n Mock = \"MOCK_DATA\",\n}\n\n/**\n * Enum defining the different API environments for the Payload Server.\n */\nexport enum PayloadApiEnv {\n /**\n * The production API environment.\n */\n Prod = \"https://payload.adadapted.com\",\n /**\n * The development API environment.\n */\n Dev = \"https://sandpayload.adadapted.com\",\n /**\n * Used only for unit testing/mocking data.\n */\n Mock = \"MOCK_DATA\",\n}\n\n/**\n * Interface defining inputs to the {@link Sdk.initialize} method.\n */\nexport interface InitializeProps {\n /**\n * The app ID provided by the client.\n */\n appId: string;\n /**\n * The API environment.\n * If undefined, defaults to production.\n */\n apiEnv?: ApiEnv;\n /**\n * Optional custom advertiserId to replace IDFA - ios only.\n */\n advertiserId?: string;\n /**\n * The touch sensitivity of the Ad Zone in both the X and Y directions.\n * This is used to determine the click/press sensitivity when the\n * Ad Zone is being touched by the user as a regular touch or while\n * scrolling the view. If the amount of touch \"drag\" distance in either\n * X or Y direction is less than this value, we will treat the action as\n * a click/press on the Ad Zone.\n */\n xyDragDistanceAllowed?: number;\n /**\n * Callback that gets triggered when the session/zones/ads data\n * gets refreshed and is now available for reference.\n */\n onAdZonesRefreshed?(): void;\n /**\n * Callback that gets triggered when an \"add to list\" item/items are clicked.\n * @param items - The array of items to \"add to list\".\n */\n onAddToListTriggered?(items: DetailedListItem[]): void;\n /**\n * Callback that gets triggered when an \"add to list\"\n * occurs by means of an \"out of app\" data payload.\n * @param payloads - All payloads the client must go through.\n */\n onOutOfAppPayloadAvailable?(payloads: OutOfAppDataPayload[]): void;\n}\n\n/**\n * Interface defining properties of a user's Device.\n */\nexport interface DeviceInfo {\n /**\n * The unique device ID.\n */\n udid: string;\n /**\n * The device name.\n */\n deviceName: string;\n /**\n * The operating system name.\n */\n systemName: string;\n /**\n * The operating system version.\n */\n systemVersion: string;\n /**\n * The device model.\n */\n deviceModel: string;\n /**\n * The device screen width.\n */\n deviceWidth: string;\n /**\n * The device screen height.\n */\n deviceHeight: string;\n /**\n * The device screen density.\n */\n deviceScreenDensity: string;\n /**\n * The current device local.\n */\n deviceLocale: string;\n /**\n * The device carrier name.\n */\n deviceCarrier: string;\n /**\n * The bundle ID.\n */\n bundleId: string;\n /**\n * The bundle version.\n */\n bundleVersion: string;\n /**\n * The current device timezone.\n */\n deviceTimezone: string;\n /**\n * If true, ad tracking is enabled for the device.\n */\n isAdTrackingEnabled: boolean;\n}\n\n/**\n * Interface defining a wrapper for an {@link AdZone}.\n */\nexport interface AdZoneInfo {\n /**\n * The ad zone ID.\n */\n zoneId: string;\n /**\n * The ad zone component.\n */\n adZone: JSX.Element;\n}\n\n/**\n * Interface defining a keyword search result.\n * This is primarily used to export an interface directly from\n * {@link AdadaptedReactNativeSdk} so the interaction with the SDK all be\n * done through this namespace.\n */\nexport interface KeywordSearchResult extends KeywordSearchTerm {}\n\n/**\n * Class that acts as the AdAdapted SDK for react-native.\n */\nexport class AdadaptedReactNativeSdk {\n /**\n * The client app ID used to send to API endpoints.\n */\n private appId: string = \"\";\n /**\n * The API environment to use when making API calls.\n */\n private apiEnv: ApiEnv;\n /**\n * The API environment to use when making API calls for List Manager.\n */\n private listManagerApiEnv: ListManagerApiEnv;\n /**\n * The API environment to use when making API calls for the Payload server.\n */\n private payloadApiEnv: PayloadApiEnv;\n /**\n * The device operating system.\n */\n private deviceOs: DeviceOS | undefined;\n /**\n * The session ID used for the API to properly identify a user.\n */\n private sessionId: string | undefined;\n /**\n * All device data gathered when \"initialize\" is called.\n */\n private deviceInfo: DeviceInfo | undefined;\n /**\n * All current Session/Ad info.\n * This info can be refreshed based on the set interval.\n */\n private sessionInfo: AdSession | undefined;\n /**\n * The available ad zones.\n */\n private adZones: AdZoneInfo[] | undefined;\n /**\n * The touch sensitivity of the Ad Zone in both the X and Y directions.\n * This is used to determine the click/press sensitivity when the\n * Ad Zone is being touched by the user as a regular touch or while\n * scrolling the view. If the amount of touch \"drag\" distance in either\n * X or Y direction is less than this value, we will treat the action as\n * a click/press on the Ad Zone.\n */\n private xyAdZoneDragDistanceAllowed: number | undefined;\n /**\n * If provided, triggers when the overall session/zones/ads data is\n * refreshed and available for reference.\n */\n private onAdZonesRefreshed: () => void | undefined;\n /**\n * The current active \"setTimeout\" reference. This is needed so we\n * can reference this variable and clean up the timer when its no\n * longer needed so memory leaks do not occur.\n */\n private refreshAdZonesTimer: ReturnType<typeof setTimeout> | undefined;\n /**\n * The user input string provided by the client and used to return a\n * result of keyword intercept terms. This will always be the last\n * provided value.\n */\n private keywordInterceptSearchValue: string;\n /**\n * The current available keyword intercepts that can\n * be used when a search is provided by the user.\n */\n private keywordIntercepts: KeywordIntercepts | undefined;\n /**\n * If provided, triggers when an \"add to list\" item is\n * clicked in an ad zone.\n * @param items - The array of items to \"add to list\".\n * @param isExternalPayload - If true, the items are from an external payload.\n */\n private onAddToListTriggered: (\n items: DetailedListItem[],\n isExternalPayload?: boolean\n ) => void | undefined;\n /**\n * If provided, triggers when an \"add to list\"\n * occurs by means of an \"out of app\" data payload.\n * @param payloads - All payloads the client must go through.\n */\n private onOutOfAppPayloadAvailable: (\n payloads: OutOfAppDataPayload[]\n ) => void | undefined;\n /**\n * Deeplink event listener.\n */\n private deepLinkOnEventListener: EmitterSubscription | undefined;\n /**\n * AppState event listener.\n */\n private AppStateOnEventListener: EmitterSubscription | undefined;\n /**\n * Gets the Session ID.\n * @returns the Session ID.\n */\n public getSessionId(): string | undefined {\n return this.sessionId;\n }\n\n /**\n * Gets the Device Info object.\n * @returns the Device Info object.\n */\n public getDeviceInfo(): DeviceInfo | undefined {\n return this.deviceInfo;\n }\n\n /**\n * Gets the list of available Ad Zones.\n * @returns all available ad zones.\n */\n public getAdZones(): AdZoneInfo[] | undefined {\n return this.adZones;\n }\n\n /**\n * @inheritDoc\n */\n constructor() {\n this.apiEnv = ApiEnv.Prod;\n this.listManagerApiEnv = ListManagerApiEnv.Prod;\n this.payloadApiEnv = PayloadApiEnv.Prod;\n this.onAdZonesRefreshed = () => {\n // Defaulting to empty method.\n };\n this.onAddToListTriggered = () => {\n // Defaulting to empty method.\n };\n this.onOutOfAppPayloadAvailable = () => {\n // Defaulting to empty method.\n };\n this.keywordInterceptSearchValue = \"\";\n\n this.initialize = this.initialize.bind(this);\n this.unmount = this.unmount.bind(this);\n this.handleAppStateChange = this.handleAppStateChange.bind(this);\n this.handleDeepLink = this.handleDeepLink.bind(this);\n }\n\n /**\n * Gets the users device info.\n * @returns a Promise of void.\n */\n private getDeviceInformation(): Promise<string> {\n return new Promise<string>((resolve) => {\n NativeModules.AdadaptedReactNativeSdk.getDeviceInfo().then(\n (response: string) => {\n resolve(response);\n }\n );\n });\n }\n\n /**\n * Creates all Ad Zone Info objects based on provided Ad Zones.\n * @param adZones - The object of available zones.\n * @returns the array of Ad Zone Info objects.\n */\n private generateAdZones(adZones: { [key: number]: Zone }): AdZoneInfo[] {\n const adZoneInfoList: AdZoneInfo[] = [];\n\n for (const adZoneId in adZones) {\n if (Object.prototype.hasOwnProperty.call(adZones, adZoneId)) {\n adZoneInfoList.push({\n zoneId: adZones[adZoneId].id,\n adZone: (\n <AdZone\n key={adZoneId}\n appId={this.appId}\n sessionId={this.sessionId!}\n udid={this.deviceInfo!.udid}\n deviceOs={this.deviceOs!}\n apiEnv={this.apiEnv}\n xyDragDistanceAllowed={\n this.xyAdZoneDragDistanceAllowed || 25\n }\n adZoneData={adZones[adZoneId]}\n onAddToListTriggered={(items) => {\n safeInvoke(this.onAddToListTriggered, items);\n }}\n />\n ),\n });\n }\n }\n\n return adZoneInfoList;\n }\n\n /**\n * Triggered when session data is initialized or refreshed. Creates\n * a timer based on the session data refresh value.\n */\n private onRefreshAdZones(): void {\n // Get the amount of time we will wait until a refresh occurs.\n // We are setting a minimum refresh time of 5 minutes, so if a\n // value provided by the API is lower, we don't refresh too often.\n const timerMs =\n this.sessionInfo!.polling_interval_ms >= 300000\n ? this.sessionInfo!.polling_interval_ms\n : 300000;\n\n this.refreshAdZonesTimer = setTimeout(() => {\n adadaptedApiRequests\n .refreshSessionData(\n {\n aid: this.appId,\n sid: this.sessionId!,\n uid: this.deviceInfo!.udid,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then((response) => {\n this.sessionInfo = response.data;\n this.adZones = this.generateAdZones(response.data.zones);\n\n // Call the user defined callback indicating\n // the session data has been refreshed.\n this.onAdZonesRefreshed();\n\n // Start the timer again based on the new session data.\n this.onRefreshAdZones();\n })\n .catch((err) => {\n console.error(err);\n\n // Start the timer again so we can make another\n // attempt to refresh the session data.\n this.onRefreshAdZones();\n });\n }, timerMs);\n }\n\n /**\n * Trigger an API request to get all possible\n * keyword intercepts for the session.\n */\n private getKeywordIntercepts(): void {\n adadaptedApiRequests\n .getKeywordIntercepts(\n {\n aid: this.appId,\n sid: this.sessionId!,\n uid: this.deviceInfo!.udid,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then((response) => {\n this.keywordIntercepts = response.data;\n\n this.performKeywordSearch(\"mil\");\n });\n }\n\n /**\n * Gets the Keyword Intercept Term based on the provided term ID.\n * @param termId - The term ID to get the term object for.\n * @returns the term if it was found based on the provided term ID.\n */\n private getKeywordInterceptTerm(\n termId: string\n ): KeywordSearchTerm | undefined {\n let term: KeywordSearchTerm | undefined;\n\n if (this.keywordIntercepts && termId) {\n for (const termObj of this.keywordIntercepts.terms) {\n if (termObj.term_id === termId) {\n term = termObj;\n }\n }\n }\n\n return term;\n }\n\n /**\n * Gets the current unix timestamp.\n * @returns the current unix timestamp.\n */\n private getCurrentUnixTimestamp(): number {\n return Math.round(new Date().getTime() / 1000);\n }\n\n /**\n * Gets all data needed to make a List Manager API request.\n * @param eventSource - The event source.\n * @param eventName - The event name.\n * @param itemNames - The items to report.\n * @param listName - The list associated to the items, if any.\n * @returns the data required for the request.\n */\n private getListManagerApiRequestData(\n eventSource: ListManagerEventSource,\n eventName: ListManagerEventName,\n itemNames: string[],\n listName?: string\n ): ReportListManagerDataRequest {\n const eventList: ListManagerEvent[] = [];\n\n for (const itemName of itemNames) {\n eventList.push({\n event_source: eventSource,\n event_name: eventName,\n event_timestamp: this.getCurrentUnixTimestamp(),\n event_params: {\n item_name: itemName,\n list_name: listName,\n },\n });\n }\n\n return {\n session_id: this.sessionId!,\n app_id: this.appId,\n udid: this.deviceInfo!.udid,\n events: eventList,\n };\n }\n\n /**\n * Takes the deep link URL and extracts out the payload items data to\n * send to the client for adding to a user's list.\n * @param event - The event containing URL related info.\n */\n private handleDeepLink(event: any): void {\n const searchStr = \"data=\";\n const dataIndex: number = event[\"url\"].indexOf(searchStr);\n\n if (dataIndex !== -1) {\n const encodedData = event.url.substr(dataIndex + searchStr.length);\n const payloadData = JSON.parse(base64.decode(encodedData));\n const payloadId = payloadData[\"payload_id\"];\n const itemDataList = payloadData[\"detailed_list_items\"];\n\n if (itemDataList && itemDataList.length > 0) {\n const finalItemList: OutOfAppDataPayload[] = [];\n\n for (const itemData of itemDataList) {\n finalItemList.push({\n payload_id: payloadId,\n detailed_list_items: [\n {\n product_title: itemData[\"product_title\"],\n product_brand: itemData[\"product_brand\"],\n product_category: itemData[\"product_category\"],\n product_barcode: itemData[\"product_barcode\"],\n product_discount: itemData[\"product_discount\"],\n product_image: itemData[\"product_image\"],\n product_sku: itemData[\"product_sku\"],\n },\n ],\n });\n }\n\n // Send the items to the client, so they can add them to the list.\n safeInvoke(this.onOutOfAppPayloadAvailable, finalItemList);\n }\n }\n }\n\n /**\n * Triggered when the state of the app changes.\n * @param state - The current state of the app.\n */\n private handleAppStateChange(state: string): void {\n if (state === \"active\") {\n this.getPayloadItemData();\n }\n }\n\n /**\n * Gets all available Payload server item data for the user.\n */\n private getPayloadItemData(): void {\n adadaptedApiRequests\n .retrievePayloadContent(\n {\n app_id: this.appId,\n session_id: this.sessionId!,\n udid: this.deviceInfo!.udid,\n },\n this.payloadApiEnv\n )\n .then((response) => {\n const finalItemList: OutOfAppDataPayload[] = [];\n\n for (const payload of response.data.payloads) {\n for (const itemData of payload.detailed_list_items) {\n finalItemList.push({\n payload_id: payload.payload_id,\n detailed_list_items: [\n {\n product_title: itemData[\"product_title\"],\n product_brand: itemData[\"product_brand\"],\n product_category:\n itemData[\"product_category\"],\n product_barcode:\n itemData[\"product_barcode\"],\n product_discount:\n itemData[\"product_discount\"],\n product_image: itemData[\"product_image\"],\n product_sku: itemData[\"product_sku\"],\n },\n ],\n });\n }\n }\n\n // Send the items to the client, so they can add them to the list.\n safeInvoke(this.onOutOfAppPayloadAvailable, finalItemList);\n })\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Initializes the session for the AdAdapted API and sets up the SDK.\n * @param props - The props used to initialize the SDK.\n * @returns a Promise of void.\n */\n public initialize(props: InitializeProps): Promise<void> {\n // Set the app ID.\n this.appId = props.appId;\n\n // Set the API environment based on the provided override value.\n // If the apiEnv value is not provided, production will be used as default.\n if (props.apiEnv) {\n this.apiEnv = props.apiEnv;\n } else {\n this.apiEnv = ApiEnv.Prod;\n }\n\n // Base the List Manager API environment off what\n // the user provides for the props.apiEnv value.\n if (props.apiEnv) {\n if (props.apiEnv === ApiEnv.Prod) {\n this.listManagerApiEnv = ListManagerApiEnv.Prod;\n } else {\n this.listManagerApiEnv = ListManagerApiEnv.Dev;\n }\n } else {\n this.listManagerApiEnv = ListManagerApiEnv.Prod;\n }\n\n // The ad zone touch drag sensitivity setting.\n if (props.xyDragDistanceAllowed) {\n this.xyAdZoneDragDistanceAllowed = props.xyDragDistanceAllowed;\n }\n\n // If the callback for onAdZonesRefreshed was provided, set it\n // globally for use when the method needs to be triggered.\n if (props.onAdZonesRefreshed) {\n this.onAdZonesRefreshed = props.onAdZonesRefreshed;\n }\n\n // If the callback for onAddToListTriggered was provided, set it\n // globally for use when the method needs to be triggered.\n if (props.onAddToListTriggered) {\n this.onAddToListTriggered = props.onAddToListTriggered;\n }\n\n // If the callback for onOutOfAppPayloadAvailable was provided, set it\n // globally for use when the method needs to be triggered.\n if (props.onOutOfAppPayloadAvailable) {\n this.onOutOfAppPayloadAvailable = props.onOutOfAppPayloadAvailable;\n }\n\n return new Promise<void>((resolve, reject) => {\n this.getDeviceInformation()\n .then((deviceInfoObj) => {\n const deviceInfo = JSON.parse(deviceInfoObj) as DeviceInfo;\n this.deviceInfo = deviceInfo;\n this.deviceOs =\n deviceInfo.systemName === \"ios\"\n ? DeviceOS.IOS\n : DeviceOS.ANDROID;\n // Pass custom advertiserId - ios only\n if (Platform.OS === \"ios\") {\n if (!(props.advertiserId === undefined)) {\n deviceInfo.udid = props.advertiserId;\n }\n }\n // Pass device info along with API call\n adadaptedApiRequests\n .initializeSession(\n {\n app_id: this.appId,\n udid: deviceInfo.udid,\n device_udid: deviceInfo.udid,\n sdk_version: packageJson.version,\n device_width: parseInt(\n deviceInfo.deviceWidth,\n 10\n ),\n device_height: parseInt(\n deviceInfo.deviceHeight,\n 10\n ),\n device_density: deviceInfo.deviceScreenDensity,\n device_carrier: deviceInfo.deviceCarrier,\n device_name: deviceInfo.deviceName,\n device_os: deviceInfo.systemName,\n device_osv: deviceInfo.systemVersion,\n device_locale: deviceInfo.deviceLocale,\n device_timezone: deviceInfo.deviceTimezone,\n bundle_id: deviceInfo.bundleId,\n bundle_version: deviceInfo.bundleVersion,\n allow_retargeting:\n deviceInfo.isAdTrackingEnabled,\n },\n this.deviceOs,\n this.apiEnv\n )\n .then((response) => {\n NativeModules.AdadaptedReactNativeSdk.storeCurrentSessionId(\n response.data.session_id\n );\n this.sessionId = response.data.session_id;\n this.sessionInfo = response.data;\n this.adZones = this.generateAdZones(\n response.data.zones\n );\n\n // Start the session data refresh timer.\n this.onRefreshAdZones();\n\n // Get all possible keyword intercept values.\n // We don't need to wait for this to complete\n // prior to resolving initialization of the SDK.\n this.getKeywordIntercepts();\n\n // Intercept an initial deep link here, if needed.\n Linking.getInitialURL().then((url) => {\n if (url) {\n // Pass in as an object so it mimics the \"url\"\n // property of the Linking.addEventListener(\"url\") method.\n this.handleDeepLink({\n url,\n });\n }\n });\n\n // Make the initial call to the Payload data server to see if\n // the user has any outstanding items to be added to list.\n this.getPayloadItemData();\n\n // Initialize an event listener to intercept deep links while the app is running.\n\n this.deepLinkOnEventListener = Linking.addEventListener(\n \"url\",\n this.handleDeepLink\n );\n\n // Initialize an event listener to intercept App state changes.\n\n this.AppStateOnEventListener = AppState.addEventListener(\n \"change\",\n this.handleAppStateChange\n );\n\n resolve();\n })\n .catch((err) => {\n reject(err);\n });\n })\n .catch((err) => {\n reject(err);\n });\n });\n }\n\n /**\n * Searches through available ad keywords based on provided search term.\n * @param searchTerm - The search term used to match against\n * available keyword intercepts.\n * @returns all keyword intercept terms that matched the search term.\n */\n public performKeywordSearch(searchTerm: string): KeywordSearchResult[] {\n const finalResultListStartsWith: KeywordSearchResult[] = [];\n const finalResultListContains: KeywordSearchResult[] = [];\n\n this.keywordInterceptSearchValue = searchTerm;\n\n if (!this.deviceInfo || !this.sessionId) {\n console.error(\"AdAdapted SDK has not been initialized.\");\n } else if (!this.keywordIntercepts) {\n console.error(\"No available keyword intercepts.\");\n } else if (\n searchTerm &&\n searchTerm.trim() &&\n searchTerm.trim().length >= this.keywordIntercepts.min_match_length\n ) {\n searchTerm = searchTerm.trim();\n\n const finalEventsList: ReportedInterceptEvent[] = [];\n const currentTs = this.getCurrentUnixTimestamp();\n\n // Search for matching terms.\n for (const termObj of this.keywordIntercepts.terms) {\n if (\n termObj.term\n .toLowerCase()\n .startsWith(searchTerm.toLowerCase())\n ) {\n // If the term starts with the search term,\n // add it to the finalResultListStartsWith list.\n finalResultListStartsWith.push(termObj);\n\n finalEventsList.push({\n term_id: termObj.term_id,\n search_id: this.keywordIntercepts.search_id,\n user_input: this.keywordInterceptSearchValue,\n term: termObj.term,\n event_type: ReportedEventType.MATCHED,\n created_at: currentTs,\n });\n }\n }\n\n // Sort the final results by priority.\n finalResultListStartsWith.sort((a, b) =>\n a.priority > b.priority ? 1 : -1\n );\n finalResultListContains.sort((a, b) =>\n a.priority > b.priority ? 1 : -1\n );\n\n // If there are no events to report at this point,\n // we need to report the \"not_matched\" event.\n if (finalEventsList.length === 0) {\n finalEventsList.push({\n term_id: \"\",\n search_id: \"NA\",\n user_input: this.keywordInterceptSearchValue,\n term: \"NA\",\n event_type: ReportedEventType.NOT_MATCHED,\n created_at: currentTs,\n });\n }\n\n // Send up the \"matched\" event for the keyword search for\n // all terms that matched the users search.\n adadaptedApiRequests\n .reportInterceptEvent(\n {\n app_id: this.appId,\n udid: this.deviceInfo.udid,\n session_id: this.sessionId,\n events: finalEventsList,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then(() => {\n // Do nothing with the response for now...\n });\n }\n\n // The returned list will keep all terms found by matching the\n // beginning of the term string at the beginning of the list. All\n // terms found that didn't match the beginning of the string, but\n // still contained the search term will be concatenated to the end\n // of the list.\n return finalResultListStartsWith.concat(finalResultListContains);\n }\n\n /**\n * Client must trigger this method when a Keyword Intercept Term has\n * been \"selected\" by the user.\n * This will ensure that the event is properly recorded and enable\n * accuracy in client reports.\n * @param termId - The term ID to trigger the event for.\n */\n public reportKeywordInterceptTermSelected(termId: string): void {\n const termObj = this.getKeywordInterceptTerm(termId);\n\n if (!this.deviceInfo || !this.sessionId) {\n console.error(\"AdAdapted SDK has not been initialized.\");\n } else if (!this.keywordIntercepts) {\n console.error(\"No available keyword intercepts.\");\n } else if (!termId || !termObj) {\n console.error(\"Invalid term ID provided.\");\n } else {\n adadaptedApiRequests\n .reportInterceptEvent(\n {\n app_id: this.appId,\n udid: this.deviceInfo.udid,\n session_id: this.sessionId,\n events: [\n {\n term_id: termObj.term_id,\n search_id: this.keywordIntercepts.search_id,\n user_input: this.keywordInterceptSearchValue,\n term: termObj.term,\n event_type: ReportedEventType.SELECTED,\n created_at: this.getCurrentUnixTimestamp(),\n },\n ],\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then(() => {\n // Do nothing with the response for now...\n });\n }\n }\n\n /**\n * Client must trigger this method when a Keyword Intercept Term has\n * been \"presented\" to the user. All terms that satisfy a search don't\n * have to be presented, so only provide term IDs for the terms that\n * ultimately get presented to the user.\n * This will ensure that the event is properly recorded and enable\n * accuracy in client reports.\n * @param termIds - The term IDs list to trigger the event for.\n */\n public reportKeywordInterceptTermsPresented(termIds: string[]): void {\n const termObjs: KeywordSearchTerm[] = [];\n\n for (const termId of termIds) {\n const termObj = this.getKeywordInterceptTerm(termId);\n\n if (termObj) {\n termObjs.push(termObj);\n }\n }\n\n if (!this.deviceInfo || !this.sessionId) {\n console.error(\"AdAdapted SDK has not been initialized.\");\n } else if (!this.keywordIntercepts) {\n console.error(\"No available keyword intercepts.\");\n } else if (!termIds || termIds.length === 0 || termObjs.length === 0) {\n console.error(\"Invalid or empty terms ID list provided.\");\n } else {\n const termEvents: ReportedInterceptEvent[] = [];\n const currentTs = this.getCurrentUnixTimestamp();\n\n for (const termObj of termObjs) {\n termEvents.push({\n term_id: termObj.term_id,\n search_id: this.keywordIntercepts.search_id,\n user_input: this.keywordInterceptSearchValue,\n term: termObj.term,\n event_type: ReportedEventType.PRESENTED,\n created_at: currentTs,\n });\n }\n\n adadaptedApiRequests\n .reportInterceptEvent(\n {\n app_id: this.appId,\n udid: this.deviceInfo.udid,\n session_id: this.sessionId,\n events: termEvents,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then(() => {\n // Do nothing with the response for now...\n });\n }\n }\n\n /**\n * Client must trigger this method when any items\n * are added to a list for reports we provide to the client.\n * @param itemNames - The items to report.\n * @param listName - The list to associate the items with, if any.\n */\n public reportItemsAddedToList(\n itemNames: string[],\n listName?: string\n ): void {\n const requestData = this.getListManagerApiRequestData(\n ListManagerEventSource.APP,\n ListManagerEventName.ADDED_TO_LIST,\n itemNames,\n listName\n );\n\n adadaptedApiRequests\n .reportListManagerEvents(\n requestData,\n this.deviceOs!,\n this.listManagerApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are crossed off a list for reports we provide to the client.\n * @param itemNames - The items to report.\n * @param listName - The list the items are associated with, if any.\n */\n public reportItemsCrossedOffList(\n itemNames: string[],\n listName?: string\n ): void {\n const requestData = this.getListManagerApiRequestData(\n ListManagerEventSource.APP,\n ListManagerEventName.CROSSED_OFF_LIST,\n itemNames,\n listName\n );\n\n adadaptedApiRequests\n .reportListManagerEvents(\n requestData,\n this.deviceOs!,\n this.listManagerApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are deleted from a list for reports we provide to the client.\n * @param itemNames - The items to report.\n * @param listName - The list the items are associated with, if any.\n */\n public reportItemsDeletedFromList(\n itemNames: string[],\n listName?: string\n ): void {\n const requestData = this.getListManagerApiRequestData(\n ListManagerEventSource.APP,\n ListManagerEventName.DELETED_FROM_LIST,\n itemNames,\n listName\n );\n\n adadaptedApiRequests\n .reportListManagerEvents(\n requestData,\n this.deviceOs!,\n this.listManagerApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are deleted from a list for reports we provide to the client.\n * @param payloadId - The payload ID that we want to acknowledge.\n */\n public markPayloadContentAcknowledged(payloadId: string): void {\n adadaptedApiRequests\n .reportPayloadContentStatus(\n {\n app_id: this.appId,\n session_id: this.sessionId!,\n udid: this.deviceInfo!.udid,\n tracking: [\n {\n payload_id: payloadId,\n status: PayloadStatus.DELIVERED,\n event_timestamp: this.getCurrentUnixTimestamp(),\n },\n ],\n },\n this.payloadApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are deleted from a list for reports we provide to the client.\n * @param payloadId - The payload ID that we want to acknowledge.\n */\n public markPayloadContentRejected(payloadId: string): void {\n adadaptedApiRequests\n .reportPayloadContentStatus(\n {\n app_id: this.appId,\n session_id: this.sessionId!,\n udid: this.deviceInfo!.udid,\n tracking: [\n {\n payload_id: payloadId,\n status: PayloadStatus.REJECTED,\n event_timestamp: this.getCurrentUnixTimestamp(),\n },\n ],\n },\n this.payloadApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Performs all clean up tasks for the SDK. Call this method when\n * the component that references this SDK will \"unmount\", otherwise you\n * can experience memory leaks.\n */\n public unmount(): void {\n if (this.refreshAdZonesTimer) {\n clearTimeout(this.refreshAdZonesTimer);\n }\n\n if (this.deepLinkOnEventListener) {\n this.deepLinkOnEventListener.remove();\n }\n\n if (this.AppStateOnEventListener) {\n this.AppStateOnEventListener.remove();\n }\n }\n}\n"],"mappings":";;;;;;AAGA;AACA;AAOA;AACA;AAeA;AACA;AACA;AACA;AAAyC;AAAA;AAAA;AAAA;AAEzC;AACA;AACA;AAFA,IAGYA,QAAQ;AAWpB;AACA;AACA;AAFA;AAAA,WAXYA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ;AAAA,IAcRC,MAAM;AAelB;AACA;AACA;AAFA;AAAA,WAfYA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;AAAA,GAANA,MAAM,sBAANA,MAAM;AAAA,IAkBNC,iBAAiB;AAe7B;AACA;AACA;AAFA;AAAA,WAfYA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;AAAA,GAAjBA,iBAAiB,iCAAjBA,iBAAiB;AAAA,IAkBjBC,aAAa;AAezB;AACA;AACA;AAFA;AAAA,WAfYA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,6BAAbA,aAAa;AA+IzB;AACA;AACA;AACO,MAAMC,uBAAuB,CAAC;EACjC;AACJ;AACA;;EAEI;AACJ;A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eSdk","getSessionId","sessionId","getDeviceInfo","deviceInfo","getAdZones","adZones","constructor","apiEnv","Prod","listManagerApiEnv","payloadApiEnv","onAdZonesRefreshed","onAddToListTriggered","onOutOfAppPayloadAvailable","keywordInterceptSearchValue","initialize","bind","unmount","handleAppStateChange","handleDeepLink","getDeviceInformation","Promise","resolve","NativeModules","then","response","generateAdZones","adZoneInfoList","adZoneId","Object","prototype","hasOwnProperty","call","push","zoneId","id","adZone","appId","udid","deviceOs","xyAdZoneDragDistanceAllowed","items","safeInvoke","onAdZoneVisibilityChanged","defaultAdZoneVisibility","onRefreshAdZones","timerMs","sessionInfo","polling_interval_ms","refreshAdZonesTimer","setTimeout","adadaptedApiRequests","refreshSessionData","aid","sid","uid","data","zones","catch","err","console","error","getKeywordIntercepts","keywordIntercepts","getKeywordInterceptTerm","termId","term","termObj","terms","term_id","getCurrentUnixTimestamp","Math","round","Date","getTime","getListManagerApiRequestData","eventSource","eventName","itemNames","listName","eventList","itemName","event_source","event_name","event_timestamp","event_params","item_name","list_name","session_id","app_id","events","event","searchStr","dataIndex","indexOf","encodedData","url","substr","length","payloadData","JSON","parse","base64","decode","payloadId","itemDataList","finalItemList","itemData","payload_id","detailed_list_items","product_title","product_brand","product_category","product_barcode","product_discount","product_image","product_sku","state","getPayloadItemData","retrievePayloadContent","payload","payloads","isVisible","isAdZoneVisible","DeviceEventEmitter","emit","acknowledge","props","Dev","xyDragDistanceAllowed","defaultToInvisibleAdZone","reject","deviceInfoObj","systemName","IOS","ANDROID","Platform","OS","advertiserId","undefined","initializeSession","device_udid","sdk_version","packageJson","version","device_width","parseInt","deviceWidth","device_height","deviceHeight","device_density","deviceScreenDensity","device_carrier","deviceCarrier","device_name","deviceName","device_os","device_osv","systemVersion","device_locale","deviceLocale","device_timezone","deviceTimezone","bundle_id","bundleId","bundle_version","bundleVersion","allow_retargeting","isAdTrackingEnabled","storeCurrentSessionId","Linking","getInitialURL","deepLinkOnEventListener","addEventListener","AppStateOnEventListener","AppState","performKeywordSearch","searchTerm","finalResultListStartsWith","finalResultListContains","trim","min_match_length","finalEventsList","currentTs","toLowerCase","startsWith","search_id","user_input","event_type","ReportedEventType","MATCHED","created_at","sort","a","b","priority","NOT_MATCHED","reportInterceptEvent","concat","reportKeywordInterceptTermSelected","SELECTED","reportKeywordInterceptTermsPresented","termIds","termObjs","termEvents","PRESENTED","reportItemsAddedToList","requestData","ListManagerEventSource","APP","ListManagerEventName","ADDED_TO_LIST","reportListManagerEvents","reportItemsCrossedOffList","CROSSED_OFF_LIST","reportItemsDeletedFromList","DELETED_FROM_LIST","markPayloadContentAcknowledged","reportPayloadContentStatus","tracking","status","PayloadStatus","DELIVERED","markPayloadContentRejected","REJECTED","clearTimeout","remove"],"sources":["index.tsx"],"sourcesContent":["/**\n * The AdadaptedReactNativeSdk package/module definition.\n */\nimport * as React from \"react\";\nimport {\n AppState,\n DeviceEventEmitter,\n EmitterSubscription,\n Linking,\n NativeModules,\n Platform,\n} from \"react-native\";\nimport * as adadaptedApiRequests from \"./api/adadaptedApiRequests\";\nimport {\n AdSession,\n DetailedListItem,\n KeywordIntercepts,\n KeywordSearchTerm,\n ListManagerEvent,\n ListManagerEventName,\n ListManagerEventSource,\n OutOfAppDataPayload,\n PayloadStatus,\n ReportedEventType,\n ReportedInterceptEvent,\n ReportListManagerDataRequest,\n Zone,\n} from \"./api/adadaptedApiTypes\";\nimport { AdZone } from \"./components/AdZone\";\nimport { safeInvoke } from \"./util\";\nimport packageJson from \"../package.json\";\nimport base64 from \"react-native-base64\";\n\n/**\n * Enum representing possible device operating systems.\n */\nexport enum DeviceOS {\n /**\n * Represents the Android operating system.\n */\n ANDROID = \"android\",\n /**\n * Represents the iOS operating system.\n */\n IOS = \"ios\",\n}\n\n/**\n * Enum defining the different API environments.\n */\nexport enum ApiEnv {\n /**\n * The production API environment.\n */\n Prod = \"https://ads.adadapted.com\",\n /**\n * The development API environment.\n */\n Dev = \"https://sandbox.adadapted.com\",\n /**\n * Used only for unit testing/mock data.\n */\n Mock = \"MOCK_DATA\",\n}\n\n/**\n * Enum defining the different API environments for List Manager.\n */\nexport enum ListManagerApiEnv {\n /**\n * The production API environment.\n */\n Prod = \"https://ec.adadapted.com\",\n /**\n * The development API environment.\n */\n Dev = \"https://sandec.adadapted.com\",\n /**\n * Used only for unit testing/mocking data.\n */\n Mock = \"MOCK_DATA\",\n}\n\n/**\n * Enum defining the different API environments for the Payload Server.\n */\nexport enum PayloadApiEnv {\n /**\n * The production API environment.\n */\n Prod = \"https://payload.adadapted.com\",\n /**\n * The development API environment.\n */\n Dev = \"https://sandpayload.adadapted.com\",\n /**\n * Used only for unit testing/mocking data.\n */\n Mock = \"MOCK_DATA\",\n}\n\n/**\n * Interface defining inputs to the {@link Sdk.initialize} method.\n */\nexport interface InitializeProps {\n /**\n * The app ID provided by the client.\n */\n appId: string;\n /**\n * The API environment.\n * If undefined, defaults to production.\n */\n apiEnv?: ApiEnv;\n /**\n * Optional custom advertiserId to replace IDFA - ios only.\n */\n advertiserId?: string;\n /**\n * The touch sensitivity of the Ad Zone in both the X and Y directions.\n * This is used to determine the click/press sensitivity when the\n * Ad Zone is being touched by the user as a regular touch or while\n * scrolling the view. If the amount of touch \"drag\" distance in either\n * X or Y direction is less than this value, we will treat the action as\n * a click/press on the Ad Zone.\n */\n xyDragDistanceAllowed?: number;\n /**\n * Callback that gets triggered when the session/zones/ads data\n * gets refreshed and is now available for reference.\n */\n onAdZonesRefreshed?(): void;\n /**\n * Callback that gets triggered when an \"add to list\" item/items are clicked.\n * @param items - The array of items to \"add to list\".\n */\n onAddToListTriggered?(items: DetailedListItem[]): void;\n /**\n * Callback that gets triggered when an \"add to list\"\n * occurs by means of an \"out of app\" data payload.\n * @param payloads - All payloads the client must go through.\n */\n onOutOfAppPayloadAvailable?(payloads: OutOfAppDataPayload[]): void;\n /**\n * Change the optional ad zone visibility default setting.\n */\n defaultToInvisibleAdZone?: boolean;\n}\n\n/**\n * Interface defining properties of a user's Device.\n */\nexport interface DeviceInfo {\n /**\n * The unique device ID.\n */\n udid: string;\n /**\n * The device name.\n */\n deviceName: string;\n /**\n * The operating system name.\n */\n systemName: string;\n /**\n * The operating system version.\n */\n systemVersion: string;\n /**\n * The device model.\n */\n deviceModel: string;\n /**\n * The device screen width.\n */\n deviceWidth: string;\n /**\n * The device screen height.\n */\n deviceHeight: string;\n /**\n * The device screen density.\n */\n deviceScreenDensity: string;\n /**\n * The current device local.\n */\n deviceLocale: string;\n /**\n * The device carrier name.\n */\n deviceCarrier: string;\n /**\n * The bundle ID.\n */\n bundleId: string;\n /**\n * The bundle version.\n */\n bundleVersion: string;\n /**\n * The current device timezone.\n */\n deviceTimezone: string;\n /**\n * If true, ad tracking is enabled for the device.\n */\n isAdTrackingEnabled: boolean;\n}\n\n/**\n * Interface defining a wrapper for an {@link AdZone}.\n */\nexport interface AdZoneInfo {\n /**\n * The ad zone ID.\n */\n zoneId: string;\n /**\n * The ad zone component.\n */\n adZone: JSX.Element;\n}\n\n/**\n * Interface defining a keyword search result.\n * This is primarily used to export an interface directly from\n * {@link AdadaptedReactNativeSdk} so the interaction with the SDK all be\n * done through this namespace.\n */\nexport interface KeywordSearchResult extends KeywordSearchTerm {}\n\n/**\n * Class that acts as the AdAdapted SDK for react-native.\n */\nexport class AdadaptedReactNativeSdk {\n /**\n * The client app ID used to send to API endpoints.\n */\n private appId: string = \"\";\n /**\n * The API environment to use when making API calls.\n */\n private apiEnv: ApiEnv;\n /**\n * The API environment to use when making API calls for List Manager.\n */\n private listManagerApiEnv: ListManagerApiEnv;\n /**\n * The API environment to use when making API calls for the Payload server.\n */\n private payloadApiEnv: PayloadApiEnv;\n /**\n * The device operating system.\n */\n private deviceOs: DeviceOS | undefined;\n /**\n * The session ID used for the API to properly identify a user.\n */\n private sessionId: string | undefined;\n /**\n * All device data gathered when \"initialize\" is called.\n */\n private deviceInfo: DeviceInfo | undefined;\n /**\n * All current Session/Ad info.\n * This info can be refreshed based on the set interval.\n */\n private sessionInfo: AdSession | undefined;\n /**\n * The available ad zones.\n */\n private adZones: AdZoneInfo[] | undefined;\n /**\n * The touch sensitivity of the Ad Zone in both the X and Y directions.\n * This is used to determine the click/press sensitivity when the\n * Ad Zone is being touched by the user as a regular touch or while\n * scrolling the view. If the amount of touch \"drag\" distance in either\n * X or Y direction is less than this value, we will treat the action as\n * a click/press on the Ad Zone.\n */\n private xyAdZoneDragDistanceAllowed: number | undefined;\n /**\n * If provided, triggers when the overall session/zones/ads data is\n * refreshed and available for reference.\n */\n private onAdZonesRefreshed: () => void | undefined;\n /**\n * The current active \"setTimeout\" reference. This is needed so we\n * can reference this variable and clean up the timer when its no\n * longer needed so memory leaks do not occur.\n */\n private refreshAdZonesTimer: ReturnType<typeof setTimeout> | undefined;\n /**\n * The user input string provided by the client and used to return a\n * result of keyword intercept terms. This will always be the last\n * provided value.\n */\n private keywordInterceptSearchValue: string;\n /**\n * The current available keyword intercepts that can\n * be used when a search is provided by the user.\n */\n private keywordIntercepts: KeywordIntercepts | undefined;\n /**\n * If provided, triggers when an \"add to list\" item is\n * clicked in an ad zone.\n * @param items - The array of items to \"add to list\".\n * @param isExternalPayload - If true, the items are from an external payload.\n */\n private onAddToListTriggered: (\n items: DetailedListItem[],\n isExternalPayload?: boolean\n ) => void | undefined;\n /**\n * If provided, triggers when an \"add to list\"\n * occurs by means of an \"out of app\" data payload.\n * @param payloads - All payloads the client must go through.\n */\n private onOutOfAppPayloadAvailable: (\n payloads: OutOfAppDataPayload[]\n ) => void | undefined;\n /**\n * Deeplink event listener.\n */\n private deepLinkOnEventListener: EmitterSubscription | undefined;\n /**\n * AppState event listener.\n */\n private AppStateOnEventListener: EmitterSubscription | undefined;\n /**\n * Track ad zone visibility for off-screen ads.\n */\n private isAdZoneVisible: boolean = true;\n /**\n * Optional default ad zone visibility for off-screen ads.\n */\n private defaultAdZoneVisibility: boolean | undefined;\n /**\n * Gets the Session ID.\n * @returns the Session ID.\n */\n public getSessionId(): string | undefined {\n return this.sessionId;\n }\n\n /**\n * Gets the Device Info object.\n * @returns the Device Info object.\n */\n public getDeviceInfo(): DeviceInfo | undefined {\n return this.deviceInfo;\n }\n\n /**\n * Gets the list of available Ad Zones.\n * @returns all available ad zones.\n */\n public getAdZones(): AdZoneInfo[] | undefined {\n return this.adZones;\n }\n\n /**\n * @inheritDoc\n */\n constructor() {\n this.apiEnv = ApiEnv.Prod;\n this.listManagerApiEnv = ListManagerApiEnv.Prod;\n this.payloadApiEnv = PayloadApiEnv.Prod;\n this.onAdZonesRefreshed = () => {\n // Defaulting to empty method.\n };\n this.onAddToListTriggered = () => {\n // Defaulting to empty method.\n };\n this.onOutOfAppPayloadAvailable = () => {\n // Defaulting to empty method.\n };\n this.keywordInterceptSearchValue = \"\";\n\n this.initialize = this.initialize.bind(this);\n this.unmount = this.unmount.bind(this);\n this.handleAppStateChange = this.handleAppStateChange.bind(this);\n this.handleDeepLink = this.handleDeepLink.bind(this);\n }\n\n /**\n * Gets the users device info.\n * @returns a Promise of void.\n */\n private getDeviceInformation(): Promise<string> {\n return new Promise<string>((resolve) => {\n NativeModules.AdadaptedReactNativeSdk.getDeviceInfo().then(\n (response: string) => {\n resolve(response);\n }\n );\n });\n }\n\n /**\n * Creates all Ad Zone Info objects based on provided Ad Zones.\n * @param adZones - The object of available zones.\n * @returns the array of Ad Zone Info objects.\n */\n private generateAdZones(adZones: { [key: number]: Zone }): AdZoneInfo[] {\n const adZoneInfoList: AdZoneInfo[] = [];\n\n for (const adZoneId in adZones) {\n if (Object.prototype.hasOwnProperty.call(adZones, adZoneId)) {\n adZoneInfoList.push({\n zoneId: adZones[adZoneId].id,\n adZone: (\n <AdZone\n key={adZoneId}\n appId={this.appId}\n sessionId={this.sessionId!}\n udid={this.deviceInfo!.udid}\n deviceOs={this.deviceOs!}\n apiEnv={this.apiEnv}\n xyDragDistanceAllowed={\n this.xyAdZoneDragDistanceAllowed || 25\n }\n adZoneData={adZones[adZoneId]}\n onAddToListTriggered={(items) => {\n safeInvoke(this.onAddToListTriggered, items);\n }}\n isAdZoneVisible={!this.onAdZoneVisibilityChanged}\n defaultToInvisibleAdZone={\n this.defaultAdZoneVisibility\n }\n />\n ),\n });\n }\n }\n\n return adZoneInfoList;\n }\n\n /**\n * Triggered when session data is initialized or refreshed. Creates\n * a timer based on the session data refresh value.\n */\n private onRefreshAdZones(): void {\n // Get the amount of time we will wait until a refresh occurs.\n // We are setting a minimum refresh time of 5 minutes, so if a\n // value provided by the API is lower, we don't refresh too often.\n const timerMs =\n this.sessionInfo!.polling_interval_ms >= 300000\n ? this.sessionInfo!.polling_interval_ms\n : 300000;\n\n this.refreshAdZonesTimer = setTimeout(() => {\n adadaptedApiRequests\n .refreshSessionData(\n {\n aid: this.appId,\n sid: this.sessionId!,\n uid: this.deviceInfo!.udid,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then((response) => {\n this.sessionInfo = response.data;\n this.adZones = this.generateAdZones(response.data.zones);\n\n // Call the user defined callback indicating\n // the session data has been refreshed.\n this.onAdZonesRefreshed();\n\n // Start the timer again based on the new session data.\n this.onRefreshAdZones();\n })\n .catch((err) => {\n console.error(err);\n\n // Start the timer again so we can make another\n // attempt to refresh the session data.\n this.onRefreshAdZones();\n });\n }, timerMs);\n }\n\n /**\n * Trigger an API request to get all possible\n * keyword intercepts for the session.\n */\n private getKeywordIntercepts(): void {\n adadaptedApiRequests\n .getKeywordIntercepts(\n {\n aid: this.appId,\n sid: this.sessionId!,\n uid: this.deviceInfo!.udid,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then((response) => {\n this.keywordIntercepts = response.data;\n });\n }\n\n /**\n * Gets the Keyword Intercept Term based on the provided term ID.\n * @param termId - The term ID to get the term object for.\n * @returns the term if it was found based on the provided term ID.\n */\n private getKeywordInterceptTerm(\n termId: string\n ): KeywordSearchTerm | undefined {\n let term: KeywordSearchTerm | undefined;\n\n if (this.keywordIntercepts && termId) {\n for (const termObj of this.keywordIntercepts.terms) {\n if (termObj.term_id === termId) {\n term = termObj;\n }\n }\n }\n\n return term;\n }\n\n /**\n * Gets the current unix timestamp.\n * @returns the current unix timestamp.\n */\n private getCurrentUnixTimestamp(): number {\n return Math.round(new Date().getTime() / 1000);\n }\n\n /**\n * Gets all data needed to make a List Manager API request.\n * @param eventSource - The event source.\n * @param eventName - The event name.\n * @param itemNames - The items to report.\n * @param listName - The list associated to the items, if any.\n * @returns the data required for the request.\n */\n private getListManagerApiRequestData(\n eventSource: ListManagerEventSource,\n eventName: ListManagerEventName,\n itemNames: string[],\n listName?: string\n ): ReportListManagerDataRequest {\n const eventList: ListManagerEvent[] = [];\n\n for (const itemName of itemNames) {\n eventList.push({\n event_source: eventSource,\n event_name: eventName,\n event_timestamp: this.getCurrentUnixTimestamp(),\n event_params: {\n item_name: itemName,\n list_name: listName,\n },\n });\n }\n\n return {\n session_id: this.sessionId!,\n app_id: this.appId,\n udid: this.deviceInfo!.udid,\n events: eventList,\n };\n }\n\n /**\n * Takes the deep link URL and extracts out the payload items data to\n * send to the client for adding to a user's list.\n * @param event - The event containing URL related info.\n */\n private handleDeepLink(event: any): void {\n const searchStr = \"data=\";\n const dataIndex: number = event[\"url\"].indexOf(searchStr);\n\n if (dataIndex !== -1) {\n const encodedData = event.url.substr(dataIndex + searchStr.length);\n const payloadData = JSON.parse(base64.decode(encodedData));\n const payloadId = payloadData[\"payload_id\"];\n const itemDataList = payloadData[\"detailed_list_items\"];\n\n if (itemDataList && itemDataList.length > 0) {\n const finalItemList: OutOfAppDataPayload[] = [];\n\n for (const itemData of itemDataList) {\n finalItemList.push({\n payload_id: payloadId,\n detailed_list_items: [\n {\n product_title: itemData[\"product_title\"],\n product_brand: itemData[\"product_brand\"],\n product_category: itemData[\"product_category\"],\n product_barcode: itemData[\"product_barcode\"],\n product_discount: itemData[\"product_discount\"],\n product_image: itemData[\"product_image\"],\n product_sku: itemData[\"product_sku\"],\n },\n ],\n });\n }\n\n // Send the items to the client, so they can add them to the list.\n safeInvoke(this.onOutOfAppPayloadAvailable, finalItemList);\n }\n }\n }\n\n /**\n * Triggered when the state of the app changes.\n * @param state - The current state of the app.\n */\n private handleAppStateChange(state: string): void {\n if (state === \"active\") {\n this.getPayloadItemData();\n }\n }\n\n /**\n * Gets all available Payload server item data for the user.\n */\n private getPayloadItemData(): void {\n adadaptedApiRequests\n .retrievePayloadContent(\n {\n app_id: this.appId,\n session_id: this.sessionId!,\n udid: this.deviceInfo!.udid,\n },\n this.payloadApiEnv\n )\n .then((response) => {\n const finalItemList: OutOfAppDataPayload[] = [];\n\n for (const payload of response.data.payloads) {\n for (const itemData of payload.detailed_list_items) {\n finalItemList.push({\n payload_id: payload.payload_id,\n detailed_list_items: [\n {\n product_title: itemData[\"product_title\"],\n product_brand: itemData[\"product_brand\"],\n product_category:\n itemData[\"product_category\"],\n product_barcode:\n itemData[\"product_barcode\"],\n product_discount:\n itemData[\"product_discount\"],\n product_image: itemData[\"product_image\"],\n product_sku: itemData[\"product_sku\"],\n },\n ],\n });\n }\n }\n\n // Send the items to the client, so they can add them to the list.\n safeInvoke(this.onOutOfAppPayloadAvailable, finalItemList);\n })\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Notify the ad zone of visibility status change for off-screen ads.\n */\n public onAdZoneVisibilityChanged(): void {\n const isVisible = !this.isAdZoneVisible;\n this.isAdZoneVisible = isVisible;\n DeviceEventEmitter.emit(\"visibility-event\", isVisible);\n }\n\n /**\n * Notify the adZone to send ad interaction report.\n * @param itemName - Detailed list item title from ad that was clicked.\n */\n public acknowledge(itemName: string): void {\n DeviceEventEmitter.emit(\"acknowledge\", itemName);\n }\n\n /**\n * Initializes the session for the AdAdapted API and sets up the SDK.\n * @param props - The props used to initialize the SDK.\n * @returns a Promise of void.\n */\n public initialize(props: InitializeProps): Promise<void> {\n // Set the app ID.\n this.appId = props.appId;\n\n // Set the API environment based on the provided override value.\n // If the apiEnv value is not provided, production will be used as default.\n if (props.apiEnv) {\n this.apiEnv = props.apiEnv;\n } else {\n this.apiEnv = ApiEnv.Prod;\n }\n\n // Base the List Manager API environment off what\n // the user provides for the props.apiEnv value.\n if (props.apiEnv) {\n if (props.apiEnv === ApiEnv.Prod) {\n this.listManagerApiEnv = ListManagerApiEnv.Prod;\n } else {\n this.listManagerApiEnv = ListManagerApiEnv.Dev;\n }\n } else {\n this.listManagerApiEnv = ListManagerApiEnv.Prod;\n }\n\n // The ad zone touch drag sensitivity setting.\n if (props.xyDragDistanceAllowed) {\n this.xyAdZoneDragDistanceAllowed = props.xyDragDistanceAllowed;\n }\n\n // If the callback for onAdZonesRefreshed was provided, set it\n // globally for use when the method needs to be triggered.\n if (props.onAdZonesRefreshed) {\n this.onAdZonesRefreshed = props.onAdZonesRefreshed;\n }\n\n // If the callback for onAddToListTriggered was provided, set it\n // globally for use when the method needs to be triggered.\n if (props.onAddToListTriggered) {\n this.onAddToListTriggered = props.onAddToListTriggered;\n }\n\n // If the callback for onOutOfAppPayloadAvailable was provided, set it\n // globally for use when the method needs to be triggered.\n if (props.onOutOfAppPayloadAvailable) {\n this.onOutOfAppPayloadAvailable = props.onOutOfAppPayloadAvailable;\n }\n\n // If provided for off-screen ads, set the ad zone visibility for ad tracking.\n if (props.defaultToInvisibleAdZone) {\n this.defaultAdZoneVisibility = props.defaultToInvisibleAdZone;\n this.onAdZoneVisibilityChanged();\n }\n\n return new Promise<void>((resolve, reject) => {\n this.getDeviceInformation()\n .then((deviceInfoObj) => {\n const deviceInfo = JSON.parse(deviceInfoObj) as DeviceInfo;\n this.deviceInfo = deviceInfo;\n this.deviceOs =\n deviceInfo.systemName === \"ios\"\n ? DeviceOS.IOS\n : DeviceOS.ANDROID;\n // Pass custom advertiserId - ios only\n if (Platform.OS === \"ios\") {\n if (!(props.advertiserId === undefined)) {\n deviceInfo.udid = props.advertiserId;\n }\n }\n // Pass device info along with API call\n adadaptedApiRequests\n .initializeSession(\n {\n app_id: this.appId,\n udid: deviceInfo.udid,\n device_udid: deviceInfo.udid,\n sdk_version: packageJson.version,\n device_width: parseInt(\n deviceInfo.deviceWidth,\n 10\n ),\n device_height: parseInt(\n deviceInfo.deviceHeight,\n 10\n ),\n device_density: deviceInfo.deviceScreenDensity,\n device_carrier: deviceInfo.deviceCarrier,\n device_name: deviceInfo.deviceName,\n device_os: deviceInfo.systemName,\n device_osv: deviceInfo.systemVersion,\n device_locale: deviceInfo.deviceLocale,\n device_timezone: deviceInfo.deviceTimezone,\n bundle_id: deviceInfo.bundleId,\n bundle_version: deviceInfo.bundleVersion,\n allow_retargeting:\n deviceInfo.isAdTrackingEnabled,\n },\n this.deviceOs,\n this.apiEnv\n )\n .then((response) => {\n NativeModules.AdadaptedReactNativeSdk.storeCurrentSessionId(\n response.data.session_id\n );\n this.sessionId = response.data.session_id;\n this.sessionInfo = response.data;\n this.adZones = this.generateAdZones(\n response.data.zones\n );\n\n // Start the session data refresh timer.\n this.onRefreshAdZones();\n\n // Get all possible keyword intercept values.\n // We don't need to wait for this to complete\n // prior to resolving initialization of the SDK.\n this.getKeywordIntercepts();\n\n // Intercept an initial deep link here, if needed.\n Linking.getInitialURL().then((url) => {\n if (url) {\n // Pass in as an object so it mimics the \"url\"\n // property of the Linking.addEventListener(\"url\") method.\n this.handleDeepLink({\n url,\n });\n }\n });\n\n // Make the initial call to the Payload data server to see if\n // the user has any outstanding items to be added to list.\n this.getPayloadItemData();\n\n // Initialize an event listener to intercept deep links while the app is running.\n\n this.deepLinkOnEventListener = Linking.addEventListener(\n \"url\",\n this.handleDeepLink\n );\n\n // Initialize an event listener to intercept App state changes.\n\n this.AppStateOnEventListener = AppState.addEventListener(\n \"change\",\n this.handleAppStateChange\n );\n\n resolve();\n })\n .catch((err) => {\n reject(err);\n });\n })\n .catch((err) => {\n reject(err);\n });\n });\n }\n\n /**\n * Searches through available ad keywords based on provided search term.\n * @param searchTerm - The search term used to match against\n * available keyword intercepts.\n * @returns all keyword intercept terms that matched the search term.\n */\n public performKeywordSearch(searchTerm: string): KeywordSearchResult[] {\n const finalResultListStartsWith: KeywordSearchResult[] = [];\n const finalResultListContains: KeywordSearchResult[] = [];\n\n this.keywordInterceptSearchValue = searchTerm;\n\n if (!this.deviceInfo || !this.sessionId) {\n console.error(\"AdAdapted SDK has not been initialized.\");\n } else if (!this.keywordIntercepts) {\n console.error(\"No available keyword intercepts.\");\n } else if (\n searchTerm &&\n searchTerm.trim() &&\n searchTerm.trim().length >= this.keywordIntercepts.min_match_length\n ) {\n searchTerm = searchTerm.trim();\n\n const finalEventsList: ReportedInterceptEvent[] = [];\n const currentTs = this.getCurrentUnixTimestamp();\n\n // Search for matching terms.\n for (const termObj of this.keywordIntercepts.terms) {\n if (\n termObj.term\n .toLowerCase()\n .startsWith(searchTerm.toLowerCase())\n ) {\n // If the term starts with the search term,\n // add it to the finalResultListStartsWith list.\n finalResultListStartsWith.push(termObj);\n\n finalEventsList.push({\n term_id: termObj.term_id,\n search_id: this.keywordIntercepts.search_id,\n user_input: this.keywordInterceptSearchValue,\n term: termObj.term,\n event_type: ReportedEventType.MATCHED,\n created_at: currentTs,\n });\n }\n }\n\n // Sort the final results by priority.\n finalResultListStartsWith.sort((a, b) =>\n a.priority > b.priority ? 1 : -1\n );\n finalResultListContains.sort((a, b) =>\n a.priority > b.priority ? 1 : -1\n );\n\n // If there are no events to report at this point,\n // we need to report the \"not_matched\" event.\n if (finalEventsList.length === 0) {\n finalEventsList.push({\n term_id: \"\",\n search_id: \"NA\",\n user_input: this.keywordInterceptSearchValue,\n term: \"NA\",\n event_type: ReportedEventType.NOT_MATCHED,\n created_at: currentTs,\n });\n }\n\n // Send up the \"matched\" event for the keyword search for\n // all terms that matched the users search.\n adadaptedApiRequests\n .reportInterceptEvent(\n {\n app_id: this.appId,\n udid: this.deviceInfo.udid,\n session_id: this.sessionId,\n events: finalEventsList,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then(() => {\n // Do nothing with the response for now...\n });\n }\n\n // The returned list will keep all terms found by matching the\n // beginning of the term string at the beginning of the list. All\n // terms found that didn't match the beginning of the string, but\n // still contained the search term will be concatenated to the end\n // of the list.\n return finalResultListStartsWith.concat(finalResultListContains);\n }\n\n /**\n * Client must trigger this method when a Keyword Intercept Term has\n * been \"selected\" by the user.\n * This will ensure that the event is properly recorded and enable\n * accuracy in client reports.\n * @param termId - The term ID to trigger the event for.\n */\n public reportKeywordInterceptTermSelected(termId: string): void {\n const termObj = this.getKeywordInterceptTerm(termId);\n\n if (!this.deviceInfo || !this.sessionId) {\n console.error(\"AdAdapted SDK has not been initialized.\");\n } else if (!this.keywordIntercepts) {\n console.error(\"No available keyword intercepts.\");\n } else if (!termId || !termObj) {\n console.error(\"Invalid term ID provided.\");\n } else {\n adadaptedApiRequests\n .reportInterceptEvent(\n {\n app_id: this.appId,\n udid: this.deviceInfo.udid,\n session_id: this.sessionId,\n events: [\n {\n term_id: termObj.term_id,\n search_id: this.keywordIntercepts.search_id,\n user_input: this.keywordInterceptSearchValue,\n term: termObj.term,\n event_type: ReportedEventType.SELECTED,\n created_at: this.getCurrentUnixTimestamp(),\n },\n ],\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then(() => {\n // Do nothing with the response for now...\n });\n }\n }\n\n /**\n * Client must trigger this method when a Keyword Intercept Term has\n * been \"presented\" to the user. All terms that satisfy a search don't\n * have to be presented, so only provide term IDs for the terms that\n * ultimately get presented to the user.\n * This will ensure that the event is properly recorded and enable\n * accuracy in client reports.\n * @param termIds - The term IDs list to trigger the event for.\n */\n public reportKeywordInterceptTermsPresented(termIds: string[]): void {\n const termObjs: KeywordSearchTerm[] = [];\n\n for (const termId of termIds) {\n const termObj = this.getKeywordInterceptTerm(termId);\n\n if (termObj) {\n termObjs.push(termObj);\n }\n }\n\n if (!this.deviceInfo || !this.sessionId) {\n console.error(\"AdAdapted SDK has not been initialized.\");\n } else if (!this.keywordIntercepts) {\n console.error(\"No available keyword intercepts.\");\n } else if (!termIds || termIds.length === 0 || termObjs.length === 0) {\n console.error(\"Invalid or empty terms ID list provided.\");\n } else {\n const termEvents: ReportedInterceptEvent[] = [];\n const currentTs = this.getCurrentUnixTimestamp();\n\n for (const termObj of termObjs) {\n termEvents.push({\n term_id: termObj.term_id,\n search_id: this.keywordIntercepts.search_id,\n user_input: this.keywordInterceptSearchValue,\n term: termObj.term,\n event_type: ReportedEventType.PRESENTED,\n created_at: currentTs,\n });\n }\n\n adadaptedApiRequests\n .reportInterceptEvent(\n {\n app_id: this.appId,\n udid: this.deviceInfo.udid,\n session_id: this.sessionId,\n events: termEvents,\n },\n this.deviceOs!,\n this.apiEnv\n )\n .then(() => {\n // Do nothing with the response for now...\n });\n }\n }\n\n /**\n * Client must trigger this method when any items\n * are added to a list for reports we provide to the client.\n * @param itemNames - The items to report.\n * @param listName - The list to associate the items with, if any.\n */\n public reportItemsAddedToList(\n itemNames: string[],\n listName?: string\n ): void {\n const requestData = this.getListManagerApiRequestData(\n ListManagerEventSource.APP,\n ListManagerEventName.ADDED_TO_LIST,\n itemNames,\n listName\n );\n\n adadaptedApiRequests\n .reportListManagerEvents(\n requestData,\n this.deviceOs!,\n this.listManagerApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are crossed off a list for reports we provide to the client.\n * @param itemNames - The items to report.\n * @param listName - The list the items are associated with, if any.\n */\n public reportItemsCrossedOffList(\n itemNames: string[],\n listName?: string\n ): void {\n const requestData = this.getListManagerApiRequestData(\n ListManagerEventSource.APP,\n ListManagerEventName.CROSSED_OFF_LIST,\n itemNames,\n listName\n );\n\n adadaptedApiRequests\n .reportListManagerEvents(\n requestData,\n this.deviceOs!,\n this.listManagerApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are deleted from a list for reports we provide to the client.\n * @param itemNames - The items to report.\n * @param listName - The list the items are associated with, if any.\n */\n public reportItemsDeletedFromList(\n itemNames: string[],\n listName?: string\n ): void {\n const requestData = this.getListManagerApiRequestData(\n ListManagerEventSource.APP,\n ListManagerEventName.DELETED_FROM_LIST,\n itemNames,\n listName\n );\n\n adadaptedApiRequests\n .reportListManagerEvents(\n requestData,\n this.deviceOs!,\n this.listManagerApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are deleted from a list for reports we provide to the client.\n * @param payloadId - The payload ID that we want to acknowledge.\n */\n public markPayloadContentAcknowledged(payloadId: string): void {\n adadaptedApiRequests\n .reportPayloadContentStatus(\n {\n app_id: this.appId,\n session_id: this.sessionId!,\n udid: this.deviceInfo!.udid,\n tracking: [\n {\n payload_id: payloadId,\n status: PayloadStatus.DELIVERED,\n event_timestamp: this.getCurrentUnixTimestamp(),\n },\n ],\n },\n this.payloadApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Client must trigger this method when any items\n * are deleted from a list for reports we provide to the client.\n * @param payloadId - The payload ID that we want to acknowledge.\n */\n public markPayloadContentRejected(payloadId: string): void {\n adadaptedApiRequests\n .reportPayloadContentStatus(\n {\n app_id: this.appId,\n session_id: this.sessionId!,\n udid: this.deviceInfo!.udid,\n tracking: [\n {\n payload_id: payloadId,\n status: PayloadStatus.REJECTED,\n event_timestamp: this.getCurrentUnixTimestamp(),\n },\n ],\n },\n this.payloadApiEnv\n )\n .then()\n .catch(() => {\n // Do nothing.\n });\n }\n\n /**\n * Performs all clean up tasks for the SDK. Call this method when\n * the component that references this SDK will \"unmount\", otherwise you\n * can experience memory leaks.\n */\n public unmount(): void {\n if (this.refreshAdZonesTimer) {\n clearTimeout(this.refreshAdZonesTimer);\n }\n\n if (this.deepLinkOnEventListener) {\n this.deepLinkOnEventListener.remove();\n }\n\n if (this.AppStateOnEventListener) {\n this.AppStateOnEventListener.remove();\n }\n }\n}\n"],"mappings":";;;;;;AAGA;AACA;AAQA;AACA;AAeA;AACA;AACA;AACA;AAAyC;AAAA;AAAA;AAAA;AAEzC;AACA;AACA;AAFA,IAGYA,QAAQ;AAWpB;AACA;AACA;AAFA;AAAA,WAXYA,QAAQ;EAARA,QAAQ;EA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,CAACC,SAAS;QAC/B1I,eAAe,EAAE,IAAI,CAACd,uBAAuB;MACjD,CAAC;IAET,CAAC,EACD,IAAI,CAAC5D,aAAa,CACrB,CACAc,IAAI,EAAE,CACNkC,KAAK,CAAC,MAAM;MACT;IAAA,CACH,CAAC;EACV;;EAEA;AACJ;AACA;AACA;AACA;EACWqK,0BAA0B,CAACvH,SAAiB,EAAQ;IACvDrD,oBAAoB,CACfuK,0BAA0B,CACvB;MACIjI,MAAM,EAAE,IAAI,CAACpD,KAAK;MAClBmD,UAAU,EAAE,IAAI,CAACvF,SAAU;MAC3BqC,IAAI,EAAE,IAAI,CAACnC,UAAU,CAAEmC,IAAI;MAC3BqL,QAAQ,EAAE,CACN;QACI/G,UAAU,EAAEJ,SAAS;QACrBoH,MAAM,EAAEC,gCAAa,CAACG,QAAQ;QAC9B5I,eAAe,EAAE,IAAI,CAACd,uBAAuB;MACjD,CAAC;IAET,CAAC,EACD,IAAI,CAAC5D,aAAa,CACrB,CACAc,IAAI,EAAE,CACNkC,KAAK,CAAC,MAAM;MACT;IAAA,CACH,CAAC;EACV;;EAEA;AACJ;AACA;AACA;AACA;EACWzC,OAAO,GAAS;IACnB,IAAI,IAAI,CAACgC,mBAAmB,EAAE;MAC1BgL,YAAY,CAAC,IAAI,CAAChL,mBAAmB,CAAC;IAC1C;IAEA,IAAI,IAAI,CAAC2H,uBAAuB,EAAE;MAC9B,IAAI,CAACA,uBAAuB,CAACsD,MAAM,EAAE;IACzC;IAEA,IAAI,IAAI,CAACpD,uBAAuB,EAAE;MAC9B,IAAI,CAACA,uBAAuB,CAACoD,MAAM,EAAE;IACzC;EACJ;AACJ;AAAC"}
@@ -93,6 +93,7 @@ export let ReportedEventType;
93
93
  */
94
94
  (function (ReportedEventType) {
95
95
  ReportedEventType["IMPRESSION"] = "impression";
96
+ ReportedEventType["INVISIBLE_IMPRESSION"] = "invisible_impression";
96
97
  ReportedEventType["INTERACTION"] = "interaction";
97
98
  ReportedEventType["NOT_MATCHED"] = "not_matched";
98
99
  ReportedEventType["MATCHED"] = "matched";
@@ -1 +1 @@
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
+ {"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 * Track impression status.\n */\n impression_tracked?: boolean;\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 an ad is not viewable before timimg out.\n */\n INVISIBLE_IMPRESSION = \"invisible_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;;AAiDA;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;;AAgC7B;AACA;AACA;AAFA,WAhCYA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;AAAA,GAAjBA,iBAAiB,KAAjBA,iBAAiB;AAmC7B,WAAYC,aAAa;;AAWzB;AACA;AACA;AACA;AACA;AACA;AAFA,WAdYA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa"}