@adshift/react-native-plugin 1.0.0 → 2.0.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.
Files changed (180) hide show
  1. package/AdShiftReactNativePlugin.podspec +11 -7
  2. package/CHANGELOG.md +122 -0
  3. package/README.md +506 -542
  4. package/android/build.gradle +17 -3
  5. package/android/consumer-rules.pro +21 -0
  6. package/android/src/main/java/com/adshift/reactnativeplugin/AdShiftReactNativePluginModule.kt +786 -229
  7. package/android/src/test/java/com/adshift/reactnativeplugin/ConsentSnapshotTest.kt +180 -0
  8. package/android/src/test/java/com/adshift/reactnativeplugin/DeepLinkDeliveryTest.kt +146 -0
  9. package/android/src/test/java/com/adshift/reactnativeplugin/InitializeOrderingTest.kt +111 -0
  10. package/android/src/test/java/com/adshift/reactnativeplugin/IntentLinkDedupTest.kt +168 -0
  11. package/android/src/test/java/com/adshift/reactnativeplugin/LaunchIntentForwardingTest.kt +106 -0
  12. package/android/src/test/java/com/adshift/reactnativeplugin/ModuleTestSupport.kt +167 -0
  13. package/android/src/test/java/com/adshift/reactnativeplugin/StartVerdictTest.kt +164 -0
  14. package/ios/AdShiftReactNativePlugin.h +7 -7
  15. package/ios/AdShiftReactNativePlugin.mm +200 -181
  16. package/ios/AdShiftReactNativePluginHelper.swift +584 -286
  17. package/ios/Core/BridgeRules.swift +82 -0
  18. package/lib/commonjs/Adshift.js +1135 -0
  19. package/lib/commonjs/Adshift.js.map +1 -0
  20. package/lib/commonjs/NativeAdShiftReactNativePlugin.js +22 -0
  21. package/lib/commonjs/NativeAdShiftReactNativePlugin.js.map +1 -0
  22. package/lib/commonjs/index.js +94 -0
  23. package/lib/commonjs/index.js.map +1 -0
  24. package/lib/commonjs/jest/index.js +164 -0
  25. package/lib/commonjs/jest/index.js.map +1 -0
  26. package/lib/commonjs/nativeSdkVersions.js +17 -0
  27. package/lib/commonjs/nativeSdkVersions.js.map +1 -0
  28. package/lib/commonjs/package.json +1 -0
  29. package/lib/commonjs/types/AdshiftAdRevenue.js +47 -0
  30. package/lib/commonjs/types/AdshiftAdRevenue.js.map +1 -0
  31. package/lib/commonjs/types/AdshiftConfig.js +45 -0
  32. package/lib/commonjs/types/AdshiftConfig.js.map +1 -0
  33. package/lib/commonjs/types/AdshiftConsent.js +113 -0
  34. package/lib/commonjs/types/AdshiftConsent.js.map +1 -0
  35. package/lib/commonjs/types/AdshiftConsentSnapshot.js +69 -0
  36. package/lib/commonjs/types/AdshiftConsentSnapshot.js.map +1 -0
  37. package/lib/commonjs/types/AdshiftDeepLink.js +154 -0
  38. package/lib/commonjs/types/AdshiftDeepLink.js.map +1 -0
  39. package/lib/commonjs/types/AdshiftError.js +91 -0
  40. package/lib/commonjs/types/AdshiftError.js.map +1 -0
  41. package/lib/commonjs/types/AdshiftEventParam.js +140 -0
  42. package/lib/commonjs/types/AdshiftEventParam.js.map +1 -0
  43. package/lib/commonjs/types/AdshiftEventType.js +88 -0
  44. package/lib/commonjs/types/AdshiftEventType.js.map +1 -0
  45. package/lib/commonjs/types/AdshiftThirdPartySharing.js +70 -0
  46. package/lib/commonjs/types/AdshiftThirdPartySharing.js.map +1 -0
  47. package/lib/commonjs/types/index.js +123 -0
  48. package/lib/commonjs/types/index.js.map +1 -0
  49. package/lib/commonjs/version.js +9 -0
  50. package/lib/commonjs/version.js.map +1 -0
  51. package/lib/module/Adshift.js +959 -296
  52. package/lib/module/Adshift.js.map +1 -1
  53. package/lib/module/NativeAdShiftReactNativePlugin.js +10 -7
  54. package/lib/module/NativeAdShiftReactNativePlugin.js.map +1 -1
  55. package/lib/module/index.js +26 -25
  56. package/lib/module/index.js.map +1 -1
  57. package/lib/module/jest/index.js +144 -0
  58. package/lib/module/jest/index.js.map +1 -0
  59. package/lib/module/nativeSdkVersions.js +13 -0
  60. package/lib/module/nativeSdkVersions.js.map +1 -0
  61. package/lib/module/types/AdshiftAdRevenue.js +43 -0
  62. package/lib/module/types/AdshiftAdRevenue.js.map +1 -0
  63. package/lib/module/types/AdshiftConfig.js +23 -26
  64. package/lib/module/types/AdshiftConfig.js.map +1 -1
  65. package/lib/module/types/AdshiftConsent.js +57 -50
  66. package/lib/module/types/AdshiftConsent.js.map +1 -1
  67. package/lib/module/types/AdshiftConsentSnapshot.js +65 -0
  68. package/lib/module/types/AdshiftConsentSnapshot.js.map +1 -0
  69. package/lib/module/types/AdshiftDeepLink.js +97 -67
  70. package/lib/module/types/AdshiftDeepLink.js.map +1 -1
  71. package/lib/module/types/AdshiftError.js +87 -0
  72. package/lib/module/types/AdshiftError.js.map +1 -0
  73. package/lib/module/types/AdshiftEventParam.js +135 -0
  74. package/lib/module/types/AdshiftEventParam.js.map +1 -0
  75. package/lib/module/types/AdshiftEventType.js +11 -36
  76. package/lib/module/types/AdshiftEventType.js.map +1 -1
  77. package/lib/module/types/AdshiftThirdPartySharing.js +65 -0
  78. package/lib/module/types/AdshiftThirdPartySharing.js.map +1 -0
  79. package/lib/module/types/index.js +9 -7
  80. package/lib/module/types/index.js.map +1 -1
  81. package/lib/module/version.js +5 -0
  82. package/lib/module/version.js.map +1 -0
  83. package/lib/typescript/commonjs/package.json +1 -0
  84. package/lib/typescript/commonjs/src/Adshift.d.ts +311 -0
  85. package/lib/typescript/commonjs/src/Adshift.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
  87. package/lib/typescript/commonjs/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/src/index.d.ts +51 -0
  89. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/src/jest/index.d.ts +103 -0
  91. package/lib/typescript/commonjs/src/jest/index.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts +11 -0
  93. package/lib/typescript/commonjs/src/nativeSdkVersions.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts +56 -0
  95. package/lib/typescript/commonjs/src/types/AdshiftAdRevenue.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts +104 -0
  97. package/lib/typescript/commonjs/src/types/AdshiftConfig.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts +76 -0
  99. package/lib/typescript/commonjs/src/types/AdshiftConsent.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts +56 -0
  101. package/lib/typescript/commonjs/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts +89 -0
  103. package/lib/typescript/commonjs/src/types/AdshiftDeepLink.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts +57 -0
  105. package/lib/typescript/commonjs/src/types/AdshiftError.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts +111 -0
  107. package/lib/typescript/commonjs/src/types/AdshiftEventParam.d.ts.map +1 -0
  108. package/lib/typescript/{src → commonjs/src}/types/AdshiftEventType.d.ts +12 -35
  109. package/lib/typescript/commonjs/src/types/AdshiftEventType.d.ts.map +1 -0
  110. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts +53 -0
  111. package/lib/typescript/commonjs/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/src/types/index.d.ts +17 -0
  113. package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/src/version.d.ts +2 -0
  115. package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
  116. package/lib/typescript/module/src/Adshift.d.ts +311 -0
  117. package/lib/typescript/module/src/Adshift.d.ts.map +1 -0
  118. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts +102 -0
  119. package/lib/typescript/module/src/NativeAdShiftReactNativePlugin.d.ts.map +1 -0
  120. package/lib/typescript/module/src/index.d.ts +51 -0
  121. package/lib/typescript/module/src/index.d.ts.map +1 -0
  122. package/lib/typescript/module/src/jest/index.d.ts +103 -0
  123. package/lib/typescript/module/src/jest/index.d.ts.map +1 -0
  124. package/lib/typescript/module/src/nativeSdkVersions.d.ts +11 -0
  125. package/lib/typescript/module/src/nativeSdkVersions.d.ts.map +1 -0
  126. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts +56 -0
  127. package/lib/typescript/module/src/types/AdshiftAdRevenue.d.ts.map +1 -0
  128. package/lib/typescript/module/src/types/AdshiftConfig.d.ts +104 -0
  129. package/lib/typescript/module/src/types/AdshiftConfig.d.ts.map +1 -0
  130. package/lib/typescript/module/src/types/AdshiftConsent.d.ts +76 -0
  131. package/lib/typescript/module/src/types/AdshiftConsent.d.ts.map +1 -0
  132. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts +56 -0
  133. package/lib/typescript/module/src/types/AdshiftConsentSnapshot.d.ts.map +1 -0
  134. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts +89 -0
  135. package/lib/typescript/module/src/types/AdshiftDeepLink.d.ts.map +1 -0
  136. package/lib/typescript/module/src/types/AdshiftError.d.ts +57 -0
  137. package/lib/typescript/module/src/types/AdshiftError.d.ts.map +1 -0
  138. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts +111 -0
  139. package/lib/typescript/module/src/types/AdshiftEventParam.d.ts.map +1 -0
  140. package/lib/typescript/module/src/types/AdshiftEventType.d.ts +64 -0
  141. package/lib/typescript/module/src/types/AdshiftEventType.d.ts.map +1 -0
  142. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts +53 -0
  143. package/lib/typescript/module/src/types/AdshiftThirdPartySharing.d.ts.map +1 -0
  144. package/lib/typescript/module/src/types/index.d.ts +17 -0
  145. package/lib/typescript/module/src/types/index.d.ts.map +1 -0
  146. package/lib/typescript/module/src/version.d.ts +2 -0
  147. package/lib/typescript/module/src/version.d.ts.map +1 -0
  148. package/package.json +49 -10
  149. package/src/Adshift.ts +1273 -342
  150. package/src/NativeAdShiftReactNativePlugin.ts +81 -115
  151. package/src/index.tsx +40 -25
  152. package/src/jest/index.ts +224 -0
  153. package/src/nativeSdkVersions.ts +10 -0
  154. package/src/types/AdshiftAdRevenue.ts +58 -0
  155. package/src/types/AdshiftConfig.ts +101 -53
  156. package/src/types/AdshiftConsent.ts +75 -72
  157. package/src/types/AdshiftConsentSnapshot.ts +103 -0
  158. package/src/types/AdshiftDeepLink.ts +123 -102
  159. package/src/types/AdshiftError.ts +107 -0
  160. package/src/types/AdshiftEventParam.ts +216 -0
  161. package/src/types/AdshiftEventType.ts +13 -35
  162. package/src/types/AdshiftThirdPartySharing.ts +63 -0
  163. package/src/types/index.ts +38 -6
  164. package/src/version.ts +2 -0
  165. package/lib/typescript/src/Adshift.d.ts +0 -335
  166. package/lib/typescript/src/Adshift.d.ts.map +0 -1
  167. package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts +0 -143
  168. package/lib/typescript/src/NativeAdShiftReactNativePlugin.d.ts.map +0 -1
  169. package/lib/typescript/src/index.d.ts +0 -47
  170. package/lib/typescript/src/index.d.ts.map +0 -1
  171. package/lib/typescript/src/types/AdshiftConfig.d.ts +0 -74
  172. package/lib/typescript/src/types/AdshiftConfig.d.ts.map +0 -1
  173. package/lib/typescript/src/types/AdshiftConsent.d.ts +0 -88
  174. package/lib/typescript/src/types/AdshiftConsent.d.ts.map +0 -1
  175. package/lib/typescript/src/types/AdshiftDeepLink.d.ts +0 -93
  176. package/lib/typescript/src/types/AdshiftDeepLink.d.ts.map +0 -1
  177. package/lib/typescript/src/types/AdshiftEventType.d.ts.map +0 -1
  178. package/lib/typescript/src/types/index.d.ts +0 -5
  179. package/lib/typescript/src/types/index.d.ts.map +0 -1
  180. /package/lib/typescript/{package.json → module/package.json} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftAdRevenue.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftAdRevenue.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;CAe1B,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,4BAA4B,GACtC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,gBAAgB,EAAE,4BAA4B,CAAC;IAC/C,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAClE"}
@@ -0,0 +1,104 @@
1
+ import type { AdshiftError } from './AdshiftError';
2
+ /**
3
+ * Configuration for initializing the AdShift SDK.
4
+ *
5
+ * Every option other than `apiKey` is optional; omitted options keep the
6
+ * native SDK defaults. All options must be set before `Adshift.start()`.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * Adshift.initialize({
11
+ * apiKey: 'your-api-key',
12
+ * isDebug: __DEV__,
13
+ * brandedDomains: ['links.example.com'],
14
+ * });
15
+ * ```
16
+ */
17
+ export interface AdshiftConfig {
18
+ /**
19
+ * API key from the AdShift dashboard. Required.
20
+ */
21
+ apiKey: string;
22
+ /**
23
+ * Enable verbose SDK logging.
24
+ * @default false
25
+ */
26
+ isDebug?: boolean;
27
+ /**
28
+ * Debounce interval for automatic `app_open` events, in milliseconds.
29
+ * @default 10000
30
+ */
31
+ appOpenDebounceMs?: number;
32
+ /**
33
+ * Branded (custom) attribution domains, e.g. `links.example.com`.
34
+ * Links on these hosts are treated as attribution links.
35
+ */
36
+ brandedDomains?: string[];
37
+ /**
38
+ * Meta app id used to parse Meta App Links.
39
+ * @platform android
40
+ */
41
+ metaAppId?: string;
42
+ /**
43
+ * Key paths inside a push notification payload that carry an AdShift deep
44
+ * link, e.g. `[['data', 'as_push_link']]`. Registering your own paths takes
45
+ * over from the top-level `as_push_link` the SDK reads on its own, so list
46
+ * that key too if your payloads also use it.
47
+ */
48
+ pushDeepLinkPaths?: string[][];
49
+ /**
50
+ * Forward every URL that opens the app to the SDK automatically.
51
+ *
52
+ * Android: the plugin reads the launch Intent and every new Intent.
53
+ * iOS: the plugin uses `Linking` (`getInitialURL` and the `url` event).
54
+ * Set to `false` to call `Adshift.handleDeepLink()` yourself.
55
+ * @default true
56
+ */
57
+ autoHandleDeepLinks?: boolean;
58
+ /**
59
+ * Disable SKAdNetwork integration.
60
+ * @default false
61
+ * @platform ios
62
+ */
63
+ disableSKAN?: boolean;
64
+ /**
65
+ * Wait for the App Tracking Transparency decision before the first
66
+ * install/open event. Only useful when the app requests ATT itself.
67
+ * @default false
68
+ * @platform ios
69
+ */
70
+ waitForATTBeforeStart?: boolean;
71
+ /**
72
+ * Maximum time to wait for the ATT decision, in milliseconds. The SDK
73
+ * clamps the value to 5000 – 120000 instead of rejecting it.
74
+ * @default 30000
75
+ * @platform ios
76
+ */
77
+ attTimeoutMs?: number;
78
+ /**
79
+ * Enable OAID collection on devices without Google Play services.
80
+ * @default true
81
+ * @platform android
82
+ */
83
+ collectOaid?: boolean;
84
+ /**
85
+ * Called when the SDK declines a call it cannot make: an invalid argument,
86
+ * an unusable config, or an API key the backend rejected.
87
+ *
88
+ * Methods that return nothing cannot answer the caller, and the SDK never
89
+ * raises into your code, so this is how those failures become visible. In
90
+ * development they are also written to the console. Wire it to your own
91
+ * reporting to catch integration mistakes in release builds.
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * Adshift.initialize({
96
+ * apiKey: 'your-api-key',
97
+ * onError: (error) => Sentry.captureMessage(`AdShift: ${error.code}`),
98
+ * });
99
+ * ```
100
+ */
101
+ onError?: (error: AdshiftError) => void;
102
+ }
103
+ export declare function configToMap(config: AdshiftConfig): Record<string, unknown>;
104
+ //# sourceMappingURL=AdshiftConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftConfig.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IAE/B;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAI9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAItB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACzC;AA2BD,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAS1E"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * A single consent decision.
3
+ *
4
+ * `true` = granted, `false` = denied, `null` = not decided yet.
5
+ * Undecided flags are not sent to the backend.
6
+ */
7
+ export type ConsentFlag = boolean | null;
8
+ /**
9
+ * User consent data for GDPR/DMA compliance.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // GDPR user who accepted everything
14
+ * Adshift.setConsentData(
15
+ * AdshiftConsent.forGDPRUser({
16
+ * hasConsentForDataUsage: true,
17
+ * hasConsentForAdsPersonalization: true,
18
+ * hasConsentForAdStorage: true,
19
+ * })
20
+ * );
21
+ *
22
+ * // Non-GDPR user
23
+ * Adshift.setConsentData(AdshiftConsent.forNonGDPRUser());
24
+ * ```
25
+ */
26
+ export interface AdshiftConsent {
27
+ /** Whether the user is subject to GDPR. */
28
+ isUserSubjectToGDPR: boolean;
29
+ /** Consent to data usage. Ignored when `isUserSubjectToGDPR` is false. */
30
+ hasConsentForDataUsage?: ConsentFlag;
31
+ /** Consent to ads personalization. Ignored when `isUserSubjectToGDPR` is false. */
32
+ hasConsentForAdsPersonalization?: ConsentFlag;
33
+ /** Consent to ad storage. Ignored when `isUserSubjectToGDPR` is false. */
34
+ hasConsentForAdStorage?: ConsentFlag;
35
+ }
36
+ /**
37
+ * Helper functions for creating `AdshiftConsent` objects.
38
+ */
39
+ export declare const AdshiftConsent: {
40
+ /**
41
+ * Creates consent for a user subject to GDPR.
42
+ *
43
+ * Flags that are omitted or `null` are treated as not decided.
44
+ */
45
+ forGDPRUser(options: {
46
+ hasConsentForDataUsage?: ConsentFlag;
47
+ hasConsentForAdsPersonalization?: ConsentFlag;
48
+ hasConsentForAdStorage?: ConsentFlag;
49
+ }): AdshiftConsent;
50
+ /**
51
+ * Creates consent for a user NOT subject to GDPR.
52
+ *
53
+ * All processing is treated as permitted; individual flags are not sent.
54
+ */
55
+ forNonGDPRUser(): AdshiftConsent;
56
+ /**
57
+ * Whether consent is granted for tracking, following the SDK rule:
58
+ * non-GDPR users are always granted; GDPR users need explicit consent to
59
+ * both data usage and ad storage.
60
+ */
61
+ isConsentGranted(consent: AdshiftConsent): boolean;
62
+ /**
63
+ * Creates consent from a plain object.
64
+ *
65
+ * @internal
66
+ */
67
+ fromMap(map: Record<string, unknown>): AdshiftConsent;
68
+ };
69
+ /**
70
+ * Converts `AdshiftConsent` to a plain object for the native bridge.
71
+ * Undecided flags are sent as `null`.
72
+ *
73
+ * @internal
74
+ */
75
+ export declare function consentToMap(consent: AdshiftConsent): Record<string, boolean | null>;
76
+ //# sourceMappingURL=AdshiftConsent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftConsent.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftConsent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,IAAI,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,mBAAmB,EAAE,OAAO,CAAC;IAE7B,0EAA0E;IAC1E,sBAAsB,CAAC,EAAE,WAAW,CAAC;IAErC,mFAAmF;IACnF,+BAA+B,CAAC,EAAE,WAAW,CAAC;IAE9C,0EAA0E;IAC1E,sBAAsB,CAAC,EAAE,WAAW,CAAC;CACtC;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;IACzB;;;;OAIG;yBACkB;QACnB,sBAAsB,CAAC,EAAE,WAAW,CAAC;QACrC,+BAA+B,CAAC,EAAE,WAAW,CAAC;QAC9C,sBAAsB,CAAC,EAAE,WAAW,CAAC;KACtC,GAAG,cAAc;IAUlB;;;;OAIG;sBACe,cAAc;IAIhC;;;;OAIG;8BACuB,cAAc,GAAG,OAAO;IAQlD;;;;OAIG;iBACU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc;CActD,CAAC;AAMF;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,cAAc,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,CAWhC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Where the current consent state comes from.
3
+ *
4
+ * - `manual`: set through `Adshift.setConsentData()`
5
+ * - `tcf`: read from an IAB TCF v2.2 CMP
6
+ * - `gpp`: read from an IAB GPP string written by the CMP
7
+ * - `none`: no consent information available
8
+ */
9
+ export type ConsentSource = 'manual' | 'tcf' | 'gpp' | 'none';
10
+ /**
11
+ * Consent state as seen by the SDK, returned by `Adshift.refreshConsent()`.
12
+ */
13
+ export interface ConsentSnapshot {
14
+ source: ConsentSource;
15
+ /** IAB `gdprApplies` value when known (0 or 1). */
16
+ gdprApplies?: number;
17
+ /** Whether a TCF consent string is present on the device. */
18
+ tcStringPresent: boolean;
19
+ /** Whether a GPP string is present on the device. */
20
+ gppPresent?: boolean;
21
+ /**
22
+ * Whether a CMP has run on this device, judged by the keys a CMP writes when
23
+ * it starts rather than by a consent payload being readable.
24
+ *
25
+ * This is the field that separates the two cases the flags above cannot: a CMP
26
+ * installed but not yet answered looks identical to no CMP at all, and the two
27
+ * are fixed by opposite actions. `false` while you expect a CMP means it never
28
+ * ran or was never wired up; `true` with `source: 'none'` means it ran and the
29
+ * user has not answered yet, which resolves itself once they do.
30
+ */
31
+ cmpDetected: boolean;
32
+ /** Ad user data flag, when decided. */
33
+ adUserDataEnabled?: boolean;
34
+ /** Ad personalization flag, when decided. */
35
+ adPersonalizationEnabled?: boolean;
36
+ /** Ad storage flag, when decided. */
37
+ adStorageEnabled?: boolean;
38
+ /** When the snapshot was applied, in milliseconds since epoch. */
39
+ appliedAtMillis: number;
40
+ /**
41
+ * Whether consent lets the SDK attach the platform advertising identifier
42
+ * (GAID or OAID on Android, IDFA on iOS) to what it reports. The
43
+ * `adshift_device_id` is never affected.
44
+ *
45
+ * Each platform answers with the rule it applies to the flags above, and
46
+ * those rules differ, so read this instead of comparing the flags yourself.
47
+ */
48
+ adIdentifiersAllowed: boolean;
49
+ }
50
+ /**
51
+ * Builds a `ConsentSnapshot` from a native bridge object.
52
+ *
53
+ * @internal
54
+ */
55
+ export declare function consentSnapshotFromMap(map: Record<string, unknown>): ConsentSnapshot;
56
+ //# sourceMappingURL=AdshiftConsentSnapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftConsentSnapshot.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftConsentSnapshot.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,eAAe,EAAE,OAAO,CAAC;IACzB,qDAAqD;IACrD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;OASG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,6CAA6C;IAC7C,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kEAAkE;IAClE,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAkBD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,eAAe,CA4BjB"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Status of a deep link result.
3
+ */
4
+ export declare enum AdshiftDeepLinkStatus {
5
+ /** The link was processed and delivered. */
6
+ Found = "found",
7
+ /** No deep link was found (e.g. organic install, deferred lookup empty). */
8
+ NotFound = "notFound",
9
+ /** An error occurred while resolving the deep link. */
10
+ Error = "error"
11
+ }
12
+ /**
13
+ * Deep link delivered through `Adshift.onDeepLink()`.
14
+ *
15
+ * Every link that enters the app and reaches the SDK produces a result with
16
+ * `status: 'found'`. Route on `deepLinkValue`, `params` or the URL itself.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * Adshift.onDeepLink((deepLink) => {
21
+ * if (deepLink.status === AdshiftDeepLinkStatus.Found) {
22
+ * const productId = deepLink.params?.product_id;
23
+ * }
24
+ * });
25
+ * ```
26
+ */
27
+ export interface AdshiftDeepLink {
28
+ deepLink?: string;
29
+ /** Standardized routing value (`deep_link_value`). */
30
+ deepLinkValue?: string;
31
+ /**
32
+ * Query parameters of the link. On Android `deep_link_sub1` … `sub5` also
33
+ * appear here; on iOS they are only available as the `deepLinkSubN` fields
34
+ * below, which both platforms fill.
35
+ */
36
+ params?: Record<string, string>;
37
+ /** Whether this result comes from deferred deep linking (first launch). */
38
+ isDeferred: boolean;
39
+ status: AdshiftDeepLinkStatus;
40
+ /** Error message when `status` is `error`. */
41
+ errorMessage?: string;
42
+ /**
43
+ * Whether the result belongs to the first session after install. Android
44
+ * reports it for every result, deferred or not; undefined on iOS.
45
+ */
46
+ isFirstSession?: boolean;
47
+ /** Custom sub-parameter 1 (`deep_link_sub1`). */
48
+ deepLinkSub1?: string;
49
+ /** Custom sub-parameter 2 (`deep_link_sub2`). */
50
+ deepLinkSub2?: string;
51
+ /** Custom sub-parameter 3 (`deep_link_sub3`). */
52
+ deepLinkSub3?: string;
53
+ /** Custom sub-parameter 4 (`deep_link_sub4`). */
54
+ deepLinkSub4?: string;
55
+ /** Custom sub-parameter 5 (`deep_link_sub5`). */
56
+ deepLinkSub5?: string;
57
+ }
58
+ /**
59
+ * Helper functions for creating `AdshiftDeepLink` objects.
60
+ */
61
+ export declare const AdshiftDeepLink: {
62
+ found(options: {
63
+ deepLink: string;
64
+ deepLinkValue?: string;
65
+ params?: Record<string, string>;
66
+ isDeferred?: boolean;
67
+ isFirstSession?: boolean;
68
+ deepLinkSub1?: string;
69
+ deepLinkSub2?: string;
70
+ deepLinkSub3?: string;
71
+ deepLinkSub4?: string;
72
+ deepLinkSub5?: string;
73
+ }): AdshiftDeepLink;
74
+ notFound(): AdshiftDeepLink;
75
+ error(message: string): AdshiftDeepLink;
76
+ /**
77
+ * Creates a deep link from a native bridge object.
78
+ *
79
+ * @internal
80
+ */
81
+ fromMap(map: Record<string, unknown>): AdshiftDeepLink;
82
+ };
83
+ /**
84
+ * Converts `AdshiftDeepLink` to a plain object.
85
+ *
86
+ * @internal
87
+ */
88
+ export declare function deepLinkToMap(deepLink: AdshiftDeepLink): Record<string, unknown>;
89
+ //# sourceMappingURL=AdshiftDeepLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftDeepLink.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftDeepLink.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,qBAAqB;IAC/B,4CAA4C;IAC5C,KAAK,UAAU;IAEf,4EAA4E;IAC5E,QAAQ,aAAa;IAErB,uDAAuD;IACvD,KAAK,UAAU;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC,2EAA2E;IAC3E,UAAU,EAAE,OAAO,CAAC;IAEpB,MAAM,EAAE,qBAAqB,CAAC;IAE9B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAUD;;GAEG;AACH,eAAO,MAAM,eAAe;mBACX;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChC,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,eAAe;gBAwBP,eAAe;mBAOZ,MAAM,GAAG,eAAe;IAQvC;;;;OAIG;iBACU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,eAAe;CA8BvD,CAAC;AA2BF;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzB"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Platform-neutral error codes used by every rejected promise and by
3
+ * `StartResult.errorCode`.
4
+ */
5
+ export declare enum AdshiftErrorCode {
6
+ /** `Adshift.initialize()` has not been called. */
7
+ NotInitialized = "NOT_INITIALIZED",
8
+ /** The SDK is stopped; call `Adshift.start()` first. */
9
+ NotStarted = "NOT_STARTED",
10
+ /** The API key was rejected by the AdShift backend. */
11
+ InvalidApiKey = "INVALID_API_KEY",
12
+ /** Tracking is disabled for this app on the AdShift side. */
13
+ OptedOut = "OPTED_OUT",
14
+ /** The event queue is full; the call was not accepted. */
15
+ QueueFull = "QUEUE_FULL",
16
+ /** A parameter failed validation. */
17
+ InvalidArgument = "INVALID_ARGUMENT",
18
+ /** Any other failure. See `userInfo.nativeCode` for the platform code. */
19
+ Unknown = "UNKNOWN"
20
+ }
21
+ /**
22
+ * Platform-specific details attached to an `AdshiftError`.
23
+ */
24
+ export interface AdshiftErrorInfo {
25
+ /** Raw code reported by the native SDK, when available. */
26
+ nativeCode?: number | string;
27
+ /** Error domain on iOS, when available. */
28
+ nativeDomain?: string;
29
+ }
30
+ /**
31
+ * Error thrown or rejected by the AdShift plugin.
32
+ *
33
+ * `code` is always one of `AdshiftErrorCode`; the original native code, when
34
+ * there is one, is available in `userInfo.nativeCode`.
35
+ */
36
+ export interface AdshiftError extends Error {
37
+ code: AdshiftErrorCode;
38
+ userInfo: AdshiftErrorInfo;
39
+ }
40
+ /**
41
+ * Type guard for errors produced by the plugin.
42
+ */
43
+ export declare function isAdshiftError(error: unknown): error is AdshiftError;
44
+ /**
45
+ * Builds an `AdshiftError` from a code and message.
46
+ *
47
+ * @internal
48
+ */
49
+ export declare function createAdshiftError(code: AdshiftErrorCode, message: string, userInfo?: AdshiftErrorInfo): AdshiftError;
50
+ /**
51
+ * Normalises a promise rejection coming from the native module into an
52
+ * `AdshiftError`. Native modules reject with `{ code, message, userInfo }`.
53
+ *
54
+ * @internal
55
+ */
56
+ export declare function toAdshiftError(error: unknown): AdshiftError;
57
+ //# sourceMappingURL=AdshiftError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftError.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,gBAAgB;IAC1B,kDAAkD;IAClD,cAAc,oBAAoB;IAClC,wDAAwD;IACxD,UAAU,gBAAgB;IAC1B,uDAAuD;IACvD,aAAa,oBAAoB;IACjC,6DAA6D;IAC7D,QAAQ,cAAc;IACtB,0DAA0D;IAC1D,SAAS,eAAe;IACxB,qCAAqC;IACrC,eAAe,qBAAqB;IACpC,0EAA0E;IAC1E,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAOpE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,gBAAqB,GAC9B,YAAY,CAMd;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CA2B3D"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Standard parameter names for the `values` passed to `Adshift.trackEvent()`.
3
+ *
4
+ * Reports aggregate these names. Any other key is kept with the event as a
5
+ * custom parameter, so a misspelled or invented name is stored but never
6
+ * counted — use the constants for anything a report has to add up, revenue
7
+ * above all.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * await Adshift.trackEvent(AdshiftEventType.Purchase, {
12
+ * [AdshiftEventParam.Revenue]: 9.99,
13
+ * [AdshiftEventParam.Currency]: 'USD',
14
+ * [AdshiftEventParam.ContentId]: 'SKU123',
15
+ * size: 'XL', // custom parameters are fine alongside them
16
+ * });
17
+ * ```
18
+ */
19
+ export declare const AdshiftEventParam: {
20
+ readonly Price: "as_price";
21
+ /** The number reports read as revenue. Always pair it with `Currency`. */
22
+ readonly Revenue: "as_revenue";
23
+ /** Revenue you expect rather than money already taken. */
24
+ readonly ProjectedRevenue: "as_projected_revenue";
25
+ /** ISO 4217 code, e.g. `USD`. */
26
+ readonly Currency: "as_currency";
27
+ readonly Quantity: "as_quantity";
28
+ readonly ReceiptId: "as_receipt_id";
29
+ /** Your own order identifier, for matching purchases with your records. */
30
+ readonly OrderId: "as_order_id";
31
+ readonly CouponCode: "as_coupon_code";
32
+ readonly PaymentInfoAvailable: "as_payment_info_available";
33
+ readonly Validated: "as_validated";
34
+ readonly ContentType: "as_content_type";
35
+ readonly ContentId: "as_content_id";
36
+ readonly ContentList: "as_content_list";
37
+ readonly Content: "as_content";
38
+ readonly Class: "as_class";
39
+ readonly Description: "as_description";
40
+ readonly SearchString: "as_search_string";
41
+ readonly RatingValue: "as_rating_value";
42
+ readonly MaxRatingValue: "as_max_rating_value";
43
+ readonly ReviewText: "as_review_text";
44
+ readonly CustomerUserId: "as_customer_user_id";
45
+ readonly RegistrationMethod: "as_registration_method";
46
+ readonly Level: "as_level";
47
+ readonly Score: "as_score";
48
+ readonly Success: "as_success";
49
+ readonly TutorialId: "as_tutorial_id";
50
+ readonly AchievementId: "as_achievement_id";
51
+ readonly VirtualCurrencyName: "as_virtual_currency_name";
52
+ readonly DeepLink: "as_deep_link";
53
+ readonly OldVersion: "as_old_version";
54
+ readonly NewVersion: "as_new_version";
55
+ readonly Channel: "as_channel";
56
+ readonly TouchObj: "as_touch_obj";
57
+ readonly DateA: "as_date_a";
58
+ readonly DateB: "as_date_b";
59
+ readonly EventStart: "as_event_start";
60
+ readonly EventEnd: "as_event_end";
61
+ readonly Latitude: "as_lat";
62
+ readonly Longitude: "as_long";
63
+ readonly City: "as_city";
64
+ readonly Region: "as_region";
65
+ readonly Country: "as_country";
66
+ readonly DestinationA: "as_destination_a";
67
+ readonly DestinationB: "as_destination_b";
68
+ readonly DestinationList: "as_destination_list";
69
+ readonly DepartingDepartureDate: "as_departing_departure_date";
70
+ readonly ReturningDepartureDate: "as_returning_departure_date";
71
+ readonly DepartingArrivalDate: "as_departing_arrival_date";
72
+ readonly ReturningArrivalDate: "as_returning_arrival_date";
73
+ readonly TravelStart: "as_travel_start";
74
+ readonly TravelEnd: "as_travel_end";
75
+ readonly SuggestedDestinations: "as_suggested_destinations";
76
+ readonly SuggestedHotels: "as_suggested_hotels";
77
+ readonly NumAdults: "as_num_adults";
78
+ readonly NumChildren: "as_num_children";
79
+ readonly NumInfants: "as_num_infants";
80
+ readonly UserScore: "as_user_score";
81
+ readonly HotelScore: "as_hotel_score";
82
+ readonly PurchaseCurrency: "as_purchase_currency";
83
+ readonly PreferredStarRatings: "as_preferred_star_ratings";
84
+ readonly PreferredPriceRange: "as_preferred_price_range";
85
+ readonly PreferredNeighborhoods: "as_preferred_neighborhoods";
86
+ readonly PreferredNumStops: "as_preferred_num_stops";
87
+ readonly Param1: "as_param_1";
88
+ readonly Param2: "as_param_2";
89
+ readonly Param3: "as_param_3";
90
+ readonly Param4: "as_param_4";
91
+ readonly Param5: "as_param_5";
92
+ readonly Param6: "as_param_6";
93
+ readonly Param7: "as_param_7";
94
+ readonly Param8: "as_param_8";
95
+ readonly Param9: "as_param_9";
96
+ readonly Param10: "as_param_10";
97
+ readonly AdRevenueSource: "as_adrev_source";
98
+ readonly AdRevenueNetworkName: "as_adrev_network_name";
99
+ readonly AdRevenueMediatedNetworkName: "as_adrev_mediated_network_name";
100
+ readonly AdRevenueAdType: "as_adrev_ad_type";
101
+ readonly AdRevenueAdSize: "as_adrev_ad_size";
102
+ readonly AdRevenuePlacementId: "as_adrev_placement_id";
103
+ readonly AdRevenueAdUnitId: "as_adrev_ad_unit_id";
104
+ readonly AdRevenuePrecision: "as_adrev_precision";
105
+ };
106
+ export type AdshiftEventParamValue = (typeof AdshiftEventParam)[keyof typeof AdshiftEventParam];
107
+ /**
108
+ * Returns all standard parameter names as an array.
109
+ */
110
+ export declare function getAllEventParams(): AdshiftEventParamValue[];
111
+ //# sourceMappingURL=AdshiftEventParam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftEventParam.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftEventParam.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB;;IAK5B,0EAA0E;;IAG1E,0DAA0D;;IAG1D,iCAAiC;;;;IAOjC,2EAA2E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyKnE,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,sBAAsB,EAAE,CAE5D"}
@@ -3,11 +3,13 @@
3
3
  *
4
4
  * Use these constants for consistent event naming across your app.
5
5
  *
6
+ * Pair them with `AdshiftEventParam` for the values.
7
+ *
6
8
  * @example
7
9
  * ```typescript
8
10
  * await Adshift.trackEvent(AdshiftEventType.AddToCart, {
9
- * product_id: 'SKU123',
10
- * price: 29.99,
11
+ * [AdshiftEventParam.ContentId]: 'SKU123',
12
+ * [AdshiftEventParam.Price]: 29.99,
11
13
  * });
12
14
  * ```
13
15
  *
@@ -17,71 +19,46 @@
17
19
  * ```
18
20
  */
19
21
  export declare const AdshiftEventType: {
20
- /** User added item to cart. */
21
22
  readonly AddToCart: "as_add_to_cart";
22
- /** User added item to wishlist. */
23
23
  readonly AddToWishList: "as_add_to_wishlist";
24
- /** User added payment info. */
25
24
  readonly AddPaymentInfo: "as_add_payment_info";
26
- /** User initiated checkout. */
27
25
  readonly InitiatedCheckout: "as_initiated_checkout";
28
- /** User completed a purchase. */
29
26
  readonly Purchase: "as_purchase";
30
- /** User viewed content/product. */
31
27
  readonly ContentView: "as_content_view";
32
- /** User viewed a list of items. */
33
28
  readonly ListView: "as_list_view";
34
- /** User searched. */
35
29
  readonly Search: "as_search";
36
- /** User completed registration. */
37
30
  readonly CompleteRegistration: "as_complete_registration";
38
- /** User logged in. */
39
31
  readonly Login: "as_login";
40
- /** User completed tutorial. */
41
32
  readonly TutorialCompletion: "as_tutorial_completion";
42
- /** User subscribed. */
43
33
  readonly Subscribe: "as_subscribe";
44
- /** User started a trial. */
45
34
  readonly StartTrial: "as_start_trial";
46
- /** User achieved a level. */
47
35
  readonly LevelAchieved: "as_level_achieved";
48
- /** User unlocked an achievement. */
49
36
  readonly AchievementUnlocked: "as_achievement_unlocked";
50
- /** User spent credits/currency. */
37
+ /** Note the plural in the value; the key is singular for compatibility. */
51
38
  readonly SpentCredit: "as_spent_credits";
52
- /** User rated the app/content. */
53
39
  readonly Rate: "as_rate";
54
- /** User shared content. */
55
40
  readonly Share: "as_share";
56
- /** User invited others. */
57
41
  readonly Invite: "as_invite";
58
- /** User re-engaged with the app. */
59
42
  readonly ReEngage: "as_re_engage";
60
- /** User updated the app. */
61
43
  readonly Update: "as_update";
62
- /** User opened from push notification. */
63
44
  readonly OpenedFromPushNotification: "as_opened_from_push_notification";
64
- /** User made a travel booking. */
65
45
  readonly TravelBooking: "as_travel_booking";
66
- /** User clicked an ad. */
67
46
  readonly AdClick: "as_ad_click";
68
- /** User viewed an ad. */
69
47
  readonly AdView: "as_ad_view";
70
- /** User location changed. */
48
+ /** Ad revenue impression. Prefer `Adshift.logAdRevenue()`. */
49
+ readonly AdRevenue: "as_ad_revenue";
50
+ /** Region or place the user moved to, as your own values. */
71
51
  readonly LocationChanged: "as_location_changed";
72
- /** User location coordinates updated. */
52
+ /** Latitude and longitude. Send only what your privacy notice covers. */
73
53
  readonly LocationCoordinates: "as_location_coordinates";
74
- /** Order ID event. */
54
+ /** Your order identifier, for matching purchases with your own records. */
75
55
  readonly OrderId: "as_order_id";
76
- /** Customer segment event. */
56
+ /** Segment the user belongs to, for audience reporting. */
77
57
  readonly CustomerSegment: "as_customer_segment";
78
58
  };
79
- /**
80
- * Type representing all predefined event type values.
81
- */
82
59
  export type AdshiftEventTypeValue = (typeof AdshiftEventType)[keyof typeof AdshiftEventType];
83
60
  /**
84
61
  * Returns all predefined event types as an array.
85
62
  */
86
- export declare function getAllEventTypes(): string[];
63
+ export declare function getAllEventTypes(): AdshiftEventTypeValue[];
87
64
  //# sourceMappingURL=AdshiftEventType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AdshiftEventType.d.ts","sourceRoot":"","sources":["../../../../../src/types/AdshiftEventType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;IAqC3B,2EAA2E;;;;;;;;;;;IA2B3E,8DAA8D;;IAK9D,6DAA6D;;IAG7D,yEAAyE;;IAKzE,2EAA2E;;IAG3E,2DAA2D;;CAEnD,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,EAAE,CAE1D"}