react-native-test-adx 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +367 -243
- package/lib/module/AdaxonSdk.js +51 -44
- package/lib/module/components/AdaxonProvider.js +13 -3
- package/lib/module/components/InterstitialAd.js +279 -0
- package/lib/module/config/ApiConstants.js +3 -1
- package/lib/module/core/AdaxonClient.js +1 -5
- package/lib/module/hooks/useAdaxon.js +1 -3
- package/lib/module/platform/app.js +44 -3
- package/lib/module/platform/reactNative.js +11 -9
- package/lib/module/services/event/EventBuilder.js +0 -6
- package/lib/module/services/event/EventService.js +7 -5
- package/lib/module/types/AdaxonConfig.js +1 -3
- package/lib/typescript/src/AdaxonSdk.d.ts +7 -7
- package/lib/typescript/src/components/InterstitialAd.d.ts +10 -0
- package/lib/typescript/src/config/ApiConstants.d.ts +2 -1
- package/lib/typescript/src/core/AdaxonClient.d.ts +0 -1
- package/lib/typescript/src/hooks/useAdaxon.d.ts +1 -3
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/platform/app.d.ts +2 -10
- package/lib/typescript/src/platform/reactNative.d.ts +1 -0
- package/lib/typescript/src/services/event/EventBuilder.d.ts +0 -3
- package/lib/typescript/src/types/AdaxonConfig.d.ts +0 -10
- package/lib/typescript/src/types/EventTypes.d.ts +0 -4
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RecommendationOffer } from '../types/ApiTypes.js';
|
|
2
|
+
interface InterstitialAdSession {
|
|
3
|
+
offer: RecommendationOffer;
|
|
4
|
+
interact: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function presentInterstitial(session: InterstitialAdSession): boolean;
|
|
7
|
+
export declare function dismissInterstitial(): void;
|
|
8
|
+
export declare function InterstitialAd(): import("react").JSX.Element | null;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=InterstitialAd.d.ts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export declare const SDK_VERSION
|
|
1
|
+
export declare const SDK_VERSION: string;
|
|
2
2
|
export declare const MEDIATION_PROVIDER = "mts";
|
|
3
3
|
export declare const BASE_URL = "http://localhost:3002";
|
|
4
4
|
export declare const EVENT_TRACKING_PATH = "/event/tracking";
|
|
5
5
|
export declare const RECOMMENDATIONS_PATH = "/api/mts/recommendations";
|
|
6
6
|
export declare const CLICK_TRACKING_PATH = "/click/tracking";
|
|
7
7
|
export declare const OFFER_OPENED_EVENT = "offer_opened";
|
|
8
|
+
export declare const RECOMMENDATION_VIEW_EVENT = "recommendation_view";
|
|
8
9
|
export declare const DEFAULT_TIMEOUT_MS = 10000;
|
|
9
10
|
export declare const PUBLIC_IP_LOOKUP_URL = "https://api.ipify.org?format=json";
|
|
10
11
|
export declare const PUBLIC_IP_LOOKUP_TIMEOUT_MS = 2000;
|
|
@@ -28,7 +28,6 @@ export declare class AdaxonClient {
|
|
|
28
28
|
processPendingEvents(): Promise<BatchProcessResult>;
|
|
29
29
|
getRecommendations(input: TrackEventInput): Promise<RecommendationResponse>;
|
|
30
30
|
createClickUrl(attribution: ClickAttribution): string;
|
|
31
|
-
setExternalUserId(externalUserId?: string): void;
|
|
32
31
|
private toQueryString;
|
|
33
32
|
}
|
|
34
33
|
export {};
|
|
@@ -11,9 +11,7 @@ export interface UseAdaxonResult {
|
|
|
11
11
|
trackAddToCart: AdaxonSdk['trackAddToCart'];
|
|
12
12
|
trackLogin: AdaxonSdk['trackLogin'];
|
|
13
13
|
trackCompleteRegistration: AdaxonSdk['trackCompleteRegistration'];
|
|
14
|
-
|
|
15
|
-
showOffer: AdaxonSdk['showOffer'];
|
|
16
|
-
setExternalUserId: AdaxonSdk['setExternalUserId'];
|
|
14
|
+
showAd: AdaxonSdk['showAd'];
|
|
17
15
|
}
|
|
18
16
|
export declare function useAdaxon(): UseAdaxonResult;
|
|
19
17
|
//# sourceMappingURL=useAdaxon.d.ts.map
|
|
@@ -9,9 +9,9 @@ export type { AdaxonSdkErrorCode } from './errors/AdaxonSdkError.js';
|
|
|
9
9
|
export { AdxEvent, AdxParam } from './services/event/predefined.js';
|
|
10
10
|
export type { AdxEventName, AdxParamName } from './services/event/predefined.js';
|
|
11
11
|
export type { TrackAddToCartParams, TrackCompleteRegistrationParams, TrackLoginParams, TrackPurchaseParams, } from './services/event/normalizeProperties.js';
|
|
12
|
-
export type { AdaxonInitializationConfiguration, AdaxonInitializationErrorCode, AdaxonInitializationListener,
|
|
12
|
+
export type { AdaxonInitializationConfiguration, AdaxonInitializationErrorCode, AdaxonInitializationListener, AdaxonSdkConfig, AdaxonStorageAdapter, } from './types/AdaxonConfig.js';
|
|
13
13
|
export type { ClickAttribution, EventProperties, EventPropertyValue, AdaxonPlatform, TrackEventInput, TrackEventOptions, } from './types/EventTypes.js';
|
|
14
|
-
export type { EventIngestionResponse
|
|
14
|
+
export type { EventIngestionResponse } from './types/ApiTypes.js';
|
|
15
15
|
export type { BatchProcessResult } from './types/QueuedEvent.js';
|
|
16
16
|
export type { AppInfoReader, DeviceInfoReader } from './platform/types.js';
|
|
17
17
|
export declare const Adaxon: AdaxonSdk;
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import type { AdaxonAppContext } from '../types/EventTypes.js';
|
|
2
|
-
export interface NativeAppConstants {
|
|
3
|
-
applicationId?: string | null;
|
|
4
|
-
androidPackage?: string | null;
|
|
5
|
-
iosBundleIdentifier?: string | null;
|
|
6
|
-
bundleId?: string | null;
|
|
7
|
-
nativeApplicationVersion?: string | null;
|
|
8
|
-
nativeAppVersion?: string | null;
|
|
9
|
-
appVersion?: string | null;
|
|
10
|
-
}
|
|
11
2
|
type NativeAppFields = Pick<AdaxonAppContext, 'package_name' | 'app_version'>;
|
|
12
|
-
|
|
3
|
+
type NativeSource = object | null | undefined;
|
|
4
|
+
export declare function appFieldsFromNative(...sources: NativeSource[]): NativeAppFields;
|
|
13
5
|
export {};
|
|
14
6
|
//# sourceMappingURL=app.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { BackHandler, Dimensions, Image, Modal, Platform, Pressable, SafeAreaView, StatusBar, StyleSheet, Text, View, } from 'react-native';
|
|
1
2
|
import type { AdaxonPlatform } from '../types/EventTypes.js';
|
|
2
3
|
import type { AppInfoReader, DeviceInfoReader, NetworkInfoReader, NetworkStatusReader, UrlOpener } from './types.js';
|
|
3
4
|
export declare function detectReactNativePlatform(): AdaxonPlatform;
|
|
@@ -9,14 +9,11 @@ interface EventBuilderConfig {
|
|
|
9
9
|
appInfo: AppInfoService;
|
|
10
10
|
networkInfo: NetworkInfoService;
|
|
11
11
|
validator: EventValidator;
|
|
12
|
-
externalUserId?: string;
|
|
13
12
|
}
|
|
14
13
|
export declare class EventBuilder {
|
|
15
14
|
private readonly config;
|
|
16
15
|
private readonly sessionId;
|
|
17
|
-
private externalUserId?;
|
|
18
16
|
constructor(config: EventBuilderConfig);
|
|
19
|
-
setExternalUserId(externalUserId?: string): void;
|
|
20
17
|
build(input: TrackEventInput): Promise<EventPayload>;
|
|
21
18
|
}
|
|
22
19
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { RecommendationOffer } from './ApiTypes.js';
|
|
2
1
|
export interface AdaxonStorageAdapter {
|
|
3
2
|
getItem(key: string): Promise<string | null>;
|
|
4
3
|
setItem(key: string, value: string): Promise<void>;
|
|
@@ -7,7 +6,6 @@ export interface AdaxonStorageAdapter {
|
|
|
7
6
|
export interface AdaxonSdkConfig {
|
|
8
7
|
appId: string;
|
|
9
8
|
sdkKey: string;
|
|
10
|
-
externalUserId?: string;
|
|
11
9
|
storage?: AdaxonStorageAdapter;
|
|
12
10
|
timeoutMs?: number;
|
|
13
11
|
fetch?: typeof globalThis.fetch;
|
|
@@ -19,12 +17,4 @@ export interface AdaxonInitializationListener {
|
|
|
19
17
|
onInitializationComplete(): void;
|
|
20
18
|
onInitializationFailed(error: AdaxonInitializationErrorCode, message: string): void;
|
|
21
19
|
}
|
|
22
|
-
export interface AdaxonRecommendationLoadListener {
|
|
23
|
-
onRecommendationsLoaded(offers: RecommendationOffer[]): void;
|
|
24
|
-
onRecommendationsFailedToLoad(message: string, code?: string): void;
|
|
25
|
-
}
|
|
26
|
-
export interface AdaxonOfferShowListener {
|
|
27
|
-
onOfferOpened(offer: RecommendationOffer): void;
|
|
28
|
-
onOfferFailedToOpen(offer: RecommendationOffer, message: string): void;
|
|
29
|
-
}
|
|
30
20
|
//# sourceMappingURL=AdaxonConfig.d.ts.map
|
|
@@ -2,7 +2,6 @@ export type AdaxonPlatform = 'android' | 'ios' | 'web';
|
|
|
2
2
|
export type EventPropertyValue = string | number | boolean | null;
|
|
3
3
|
export type EventProperties = Record<string, EventPropertyValue>;
|
|
4
4
|
export interface AdaxonUserContext {
|
|
5
|
-
external_user_id?: string;
|
|
6
5
|
anonymous_id: string;
|
|
7
6
|
}
|
|
8
7
|
export interface AdaxonDeviceContext {
|
|
@@ -47,9 +46,6 @@ export interface EventPayload {
|
|
|
47
46
|
session: AdaxonSessionContext;
|
|
48
47
|
network: AdaxonNetworkContext;
|
|
49
48
|
}
|
|
50
|
-
export interface RecommendationPayload extends EventPayload {
|
|
51
|
-
event_type: 'recommendation';
|
|
52
|
-
}
|
|
53
49
|
export interface ClickAttribution {
|
|
54
50
|
offerId: number;
|
|
55
51
|
affiliateId: number;
|
package/package.json
CHANGED