@appmetrica/react-native-analytics 3.0.0 → 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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/io/appmetrica/analytics/reactnative/AppMetricaModule.java +16 -1
- package/android/src/main/java/io/appmetrica/analytics/reactnative/UserProfileSerializer.java +257 -0
- package/android/src/main/java/io/appmetrica/analytics/reactnative/Utils.java +18 -0
- package/appmetrica-react-native-analytics.podspec +1 -1
- package/ios/AMARNAppMetrica.m +11 -0
- package/ios/AMARNAppMetricaUtils.h +2 -0
- package/ios/AMARNAppMetricaUtils.m +26 -12
- package/ios/AMARNUserProfileSerializer.h +6 -0
- package/ios/AMARNUserProfileSerializer.m +182 -0
- package/lib/commonjs/ecommerce.js +10 -9
- package/lib/commonjs/ecommerce.js.map +1 -1
- package/lib/commonjs/index.js +20 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/userProfile.js +283 -0
- package/lib/commonjs/userProfile.js.map +1 -0
- package/lib/commonjs/utils.js +72 -0
- package/lib/commonjs/utils.js.map +1 -0
- package/lib/module/ecommerce.js +10 -9
- package/lib/module/ecommerce.js.map +1 -1
- package/lib/module/index.js +9 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/userProfile.js +267 -0
- package/lib/module/userProfile.js.map +1 -0
- package/lib/module/utils.js +61 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/typescript/src/ecommerce.d.ts +3 -3
- package/lib/typescript/src/ecommerce.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +7 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/revenue.d.ts +1 -1
- package/lib/typescript/src/revenue.d.ts.map +1 -1
- package/lib/typescript/src/userProfile.d.ts +84 -0
- package/lib/typescript/src/userProfile.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +9 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/ecommerce.ts +20 -12
- package/src/index.ts +16 -2
- package/src/revenue.ts +1 -1
- package/src/userProfile.ts +362 -0
- package/src/utils.ts +71 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
|
|
2
|
+
#import "AMARNUserProfileSerializer.h"
|
|
3
|
+
|
|
4
|
+
AMAUserProfileUpdate *amarn_birthDateAttributeFromDictionary(NSDictionary *dictionary)
|
|
5
|
+
{
|
|
6
|
+
NSString *type = dictionary[@"type"];
|
|
7
|
+
if ([type isEqualToString:@"BirthDateWithAge"]) {
|
|
8
|
+
return [[AMAProfileAttribute birthDate] withAge:[dictionary[@"age"] unsignedIntegerValue]];
|
|
9
|
+
}
|
|
10
|
+
if ([type isEqualToString:@"BirthDateWithYear"]) {
|
|
11
|
+
return [[AMAProfileAttribute birthDate] withYear:[dictionary[@"year"] unsignedIntegerValue]];
|
|
12
|
+
}
|
|
13
|
+
if ([type isEqualToString:@"BirthDateWithMonth"]) {
|
|
14
|
+
return [[AMAProfileAttribute birthDate] withYear:[dictionary[@"year"] unsignedIntegerValue]
|
|
15
|
+
month:[dictionary[@"month"] unsignedIntegerValue]];
|
|
16
|
+
}
|
|
17
|
+
if ([type isEqualToString:@"BirthDateWithDay"]) {
|
|
18
|
+
return [[AMAProfileAttribute birthDate] withYear:[dictionary[@"year"] unsignedIntegerValue]
|
|
19
|
+
month:[dictionary[@"month"] unsignedIntegerValue]
|
|
20
|
+
day:[dictionary[@"day"] unsignedIntegerValue]];
|
|
21
|
+
}
|
|
22
|
+
if ([type isEqualToString:@"BirthDateValueReset"]) {
|
|
23
|
+
return [[AMAProfileAttribute birthDate] withValueReset];
|
|
24
|
+
}
|
|
25
|
+
return nil;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
AMAUserProfileUpdate *amarn_customBoolAttributeUpdateFromDictionary(NSDictionary *dictionary)
|
|
29
|
+
{
|
|
30
|
+
NSString *type = dictionary[@"type"];
|
|
31
|
+
if ([type isEqualToString:@"BooleanValue"]) {
|
|
32
|
+
NSString *key = dictionary[@"key"];
|
|
33
|
+
bool value = [dictionary[@"value"] boolValue];
|
|
34
|
+
if ([dictionary[@"ifUndefined"] boolValue]) {
|
|
35
|
+
return [[AMAProfileAttribute customBool:key] withValueIfUndefined:value];
|
|
36
|
+
}
|
|
37
|
+
return [[AMAProfileAttribute customBool:key] withValue:value];
|
|
38
|
+
}
|
|
39
|
+
if ([type isEqualToString:@"BooleanValueReset"]) {
|
|
40
|
+
NSString *key = dictionary[@"key"];
|
|
41
|
+
return [[AMAProfileAttribute customBool:key] withValueReset];
|
|
42
|
+
}
|
|
43
|
+
return nil;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
AMAUserProfileUpdate *amarn_customCounterAttributeUpdateFromDictionary(NSDictionary *dictionary)
|
|
47
|
+
{
|
|
48
|
+
NSString *type = dictionary[@"type"];
|
|
49
|
+
if ([type isEqualToString:@"Counter"]) {
|
|
50
|
+
NSString *key = dictionary[@"key"];
|
|
51
|
+
double value = [dictionary[@"delta"] doubleValue];
|
|
52
|
+
return [[AMAProfileAttribute customCounter:key] withDelta:value];
|
|
53
|
+
}
|
|
54
|
+
return nil;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
AMAGenderType amarn_genderTypeForString(NSString *genderStr)
|
|
58
|
+
{
|
|
59
|
+
if ([genderStr isEqualToString:@"male"]) {
|
|
60
|
+
return AMAGenderTypeMale;
|
|
61
|
+
}
|
|
62
|
+
if ([genderStr isEqualToString:@"female"]) {
|
|
63
|
+
return AMAGenderTypeFemale;
|
|
64
|
+
}
|
|
65
|
+
return AMAGenderTypeOther;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
AMAUserProfileUpdate *amarn_genderAttributeFromDictionary(NSDictionary *dictionary)
|
|
69
|
+
{
|
|
70
|
+
NSString *type = dictionary[@"type"];
|
|
71
|
+
if ([type isEqualToString:@"GenderValue"]) {
|
|
72
|
+
AMAGenderType value = amarn_genderTypeForString(dictionary[@"value"]);
|
|
73
|
+
return [[AMAProfileAttribute gender] withValue:value];
|
|
74
|
+
}
|
|
75
|
+
if ([type isEqualToString:@"GenderValueReset"]) {
|
|
76
|
+
return [[AMAProfileAttribute gender] withValueReset];
|
|
77
|
+
}
|
|
78
|
+
return nil;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
AMAUserProfileUpdate *amarn_nameAttributeFromDictionary(NSDictionary *dictionary)
|
|
82
|
+
{
|
|
83
|
+
NSString *type = dictionary[@"type"];
|
|
84
|
+
if ([type isEqualToString:@"NameValue"]) {
|
|
85
|
+
NSString *value = dictionary[@"value"];
|
|
86
|
+
return [[AMAProfileAttribute name] withValue:value];
|
|
87
|
+
}
|
|
88
|
+
if ([type isEqualToString:@"NameValueReset"]) {
|
|
89
|
+
return [[AMAProfileAttribute name] withValueReset];
|
|
90
|
+
}
|
|
91
|
+
return nil;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
AMAUserProfileUpdate *amarn_notificationEnabledAttributeFromDictionary(NSDictionary *dictionary)
|
|
95
|
+
{
|
|
96
|
+
NSString *type = dictionary[@"type"];
|
|
97
|
+
if ([type isEqualToString:@"NotificationsEnabledValue"]) {
|
|
98
|
+
bool value = [dictionary[@"value"] boolValue];
|
|
99
|
+
return [[AMAProfileAttribute notificationsEnabled] withValue:value];
|
|
100
|
+
}
|
|
101
|
+
if ([type isEqualToString:@"NotificationsEnabledValueReset"]) {
|
|
102
|
+
return [[AMAProfileAttribute notificationsEnabled] withValueReset];
|
|
103
|
+
}
|
|
104
|
+
return nil;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
AMAUserProfileUpdate *amarn_customNumberAttributeUpdateFromDictionary(NSDictionary *dictionary)
|
|
108
|
+
{
|
|
109
|
+
NSString *type = dictionary[@"type"];
|
|
110
|
+
if ([type isEqualToString:@"NumberValue"]) {
|
|
111
|
+
NSString *key = dictionary[@"key"];
|
|
112
|
+
double value = [dictionary[@"value"] doubleValue];
|
|
113
|
+
if ([dictionary[@"ifUndefined"] boolValue]) {
|
|
114
|
+
return [[AMAProfileAttribute customNumber:key] withValueIfUndefined:value];
|
|
115
|
+
}
|
|
116
|
+
return [[AMAProfileAttribute customNumber:key] withValue:value];
|
|
117
|
+
}
|
|
118
|
+
if ([type isEqualToString:@"NumberValueReset"]) {
|
|
119
|
+
NSString *key = dictionary[@"key"];
|
|
120
|
+
return [[AMAProfileAttribute customNumber:key] withValueReset];
|
|
121
|
+
}
|
|
122
|
+
return nil;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
AMAUserProfileUpdate *amarn_customStringAttributeUpdateFromDictionary(NSDictionary *dictionary)
|
|
126
|
+
{
|
|
127
|
+
NSString *type = dictionary[@"type"];
|
|
128
|
+
if ([type isEqualToString:@"StringValue"]) {
|
|
129
|
+
NSString *key = dictionary[@"key"];
|
|
130
|
+
NSString *value = dictionary[@"value"];
|
|
131
|
+
if ([dictionary[@"ifUndefined"] boolValue]) {
|
|
132
|
+
return [[AMAProfileAttribute customString:key] withValueIfUndefined:value];
|
|
133
|
+
}
|
|
134
|
+
return [[AMAProfileAttribute customString:key] withValue:value];
|
|
135
|
+
}
|
|
136
|
+
if ([type isEqualToString:@"StringValueReset"]) {
|
|
137
|
+
NSString *key = dictionary[@"key"];
|
|
138
|
+
return [[AMAProfileAttribute customString:key] withValueReset];
|
|
139
|
+
}
|
|
140
|
+
return nil;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
AMAUserProfileUpdate *amarn_userProfileUpdateFromDictionary(NSDictionary *dictionary)
|
|
144
|
+
{
|
|
145
|
+
return amarn_birthDateAttributeFromDictionary(dictionary)
|
|
146
|
+
?: amarn_customBoolAttributeUpdateFromDictionary(dictionary)
|
|
147
|
+
?: amarn_customCounterAttributeUpdateFromDictionary(dictionary)
|
|
148
|
+
?: amarn_genderAttributeFromDictionary(dictionary)
|
|
149
|
+
?: amarn_nameAttributeFromDictionary(dictionary)
|
|
150
|
+
?: amarn_notificationEnabledAttributeFromDictionary(dictionary)
|
|
151
|
+
?: amarn_customNumberAttributeUpdateFromDictionary(dictionary)
|
|
152
|
+
?: amarn_customStringAttributeUpdateFromDictionary(dictionary);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
AMAUserProfile *amarn_deserializeUserProfile(NSDictionary *dictionary) {
|
|
156
|
+
|
|
157
|
+
if (!dictionary) {
|
|
158
|
+
return nil;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
NSArray *attributes = dictionary[@"attributes"];
|
|
162
|
+
|
|
163
|
+
if (!attributes && attributes.count == 0) {
|
|
164
|
+
return nil;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
AMAMutableUserProfile *userProfile = [[AMAMutableUserProfile alloc] init];
|
|
168
|
+
|
|
169
|
+
for (NSDictionary* attribute in attributes) {
|
|
170
|
+
|
|
171
|
+
AMAUserProfileUpdate *update = amarn_userProfileUpdateFromDictionary(attribute);
|
|
172
|
+
|
|
173
|
+
if (!update) {
|
|
174
|
+
return nil;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
[userProfile apply:update];
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
return userProfile;
|
|
182
|
+
}
|
|
@@ -4,49 +4,50 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ECommerce = void 0;
|
|
7
|
+
var _utils = require("./utils");
|
|
7
8
|
class ECommerce {
|
|
8
9
|
static showScreenEvent(screen) {
|
|
9
10
|
return {
|
|
10
11
|
ecommerceEvent: 'showSceenEvent',
|
|
11
|
-
ecommerceScreen: screen
|
|
12
|
+
ecommerceScreen: (0, _utils.normalizeECommerceScreen)(screen)
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
static showProductCardEvent(product, screen) {
|
|
15
16
|
return {
|
|
16
17
|
ecommerceEvent: 'showProductCardEvent',
|
|
17
|
-
ecommerceScreen: screen,
|
|
18
|
-
product: product
|
|
18
|
+
ecommerceScreen: (0, _utils.normalizeECommerceScreen)(screen),
|
|
19
|
+
product: (0, _utils.normalizeECommerceProduct)(product)
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
static showProductDetailsEvent(product, referrer) {
|
|
22
23
|
return {
|
|
23
24
|
ecommerceEvent: 'showProductDetailsEvent',
|
|
24
|
-
product: product,
|
|
25
|
-
referrer: referrer
|
|
25
|
+
product: (0, _utils.normalizeECommerceProduct)(product),
|
|
26
|
+
referrer: (0, _utils.normalizeECommerceReferrer)(referrer)
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
static addCartItemEvent(item) {
|
|
29
30
|
return {
|
|
30
31
|
ecommerceEvent: 'addCartItemEvent',
|
|
31
|
-
cartItem: item
|
|
32
|
+
cartItem: (0, _utils.normalizeECommerceCartItem)(item)
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
static removeCartItemEvent(item) {
|
|
35
36
|
return {
|
|
36
37
|
ecommerceEvent: 'removeCartItemEvent',
|
|
37
|
-
cartItem: item
|
|
38
|
+
cartItem: (0, _utils.normalizeECommerceCartItem)(item)
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
static beginCheckoutEvent(order) {
|
|
41
42
|
return {
|
|
42
43
|
ecommerceEvent: 'beginCheckoutEvent',
|
|
43
|
-
order: order
|
|
44
|
+
order: (0, _utils.normalizeECommerceOrder)(order)
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
47
|
static purchaseEvent(order) {
|
|
47
48
|
return {
|
|
48
49
|
ecommerceEvent: 'purchaseEvent',
|
|
49
|
-
order: order
|
|
50
|
+
order: (0, _utils.normalizeECommerceOrder)(order)
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ECommerce","showScreenEvent","screen","ecommerceEvent","ecommerceScreen","showProductCardEvent","product","showProductDetailsEvent","referrer","addCartItemEvent","item","cartItem","removeCartItemEvent","beginCheckoutEvent","order","purchaseEvent","exports"],"sourceRoot":"../../src","sources":["ecommerce.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_utils","require","ECommerce","showScreenEvent","screen","ecommerceEvent","ecommerceScreen","normalizeECommerceScreen","showProductCardEvent","product","normalizeECommerceProduct","showProductDetailsEvent","referrer","normalizeECommerceReferrer","addCartItemEvent","item","cartItem","normalizeECommerceCartItem","removeCartItemEvent","beginCheckoutEvent","order","normalizeECommerceOrder","purchaseEvent","exports"],"sourceRoot":"../../src","sources":["ecommerce.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAwEO,MAAMC,SAAS,CAAC;EACrB,OAAOC,eAAeA,CAACC,MAAuB,EAAkB;IAC9D,OAAO;MACLC,cAAc,EAAE,gBAAgB;MAChCC,eAAe,EAAE,IAAAC,+BAAwB,EAACH,MAAM;IAClD,CAAC;EACH;EAEA,OAAOI,oBAAoBA,CACzBC,OAAyB,EACzBL,MAAuB,EACP;IAChB,OAAO;MACLC,cAAc,EAAE,sBAAsB;MACtCC,eAAe,EAAE,IAAAC,+BAAwB,EAACH,MAAM,CAAC;MACjDK,OAAO,EAAE,IAAAC,gCAAyB,EAACD,OAAO;IAC5C,CAAC;EACH;EAEA,OAAOE,uBAAuBA,CAC5BF,OAAyB,EACzBG,QAA4B,EACZ;IAChB,OAAO;MACLP,cAAc,EAAE,yBAAyB;MACzCI,OAAO,EAAE,IAAAC,gCAAyB,EAACD,OAAO,CAAC;MAC3CG,QAAQ,EAAE,IAAAC,iCAA0B,EAACD,QAAQ;IAC/C,CAAC;EACH;EAEA,OAAOE,gBAAgBA,CAACC,IAAuB,EAAkB;IAC/D,OAAO;MACLV,cAAc,EAAE,kBAAkB;MAClCW,QAAQ,EAAE,IAAAC,iCAA0B,EAACF,IAAI;IAC3C,CAAC;EACH;EAEA,OAAOG,mBAAmBA,CAACH,IAAuB,EAAkB;IAClE,OAAO;MACLV,cAAc,EAAE,qBAAqB;MACrCW,QAAQ,EAAE,IAAAC,iCAA0B,EAACF,IAAI;IAC3C,CAAC;EACH;EAEA,OAAOI,kBAAkBA,CAACC,KAAqB,EAAkB;IAC/D,OAAO;MACLf,cAAc,EAAE,oBAAoB;MACpCe,KAAK,EAAE,IAAAC,8BAAuB,EAACD,KAAK;IACtC,CAAC;EACH;EAEA,OAAOE,aAAaA,CAACF,KAAqB,EAAkB;IAC1D,OAAO;MACLf,cAAc,EAAE,eAAe;MAC/Be,KAAK,EAAE,IAAAC,8BAAuB,EAACD,KAAK;IACtC,CAAC;EACH;AACF;AAACG,OAAA,CAAArB,SAAA,GAAAA,SAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var _exportNames = {
|
|
|
10
10
|
};
|
|
11
11
|
exports.default = exports.UUID_KEY = exports.DEVICE_ID_KEY = exports.DEVICE_ID_HASH_KEY = void 0;
|
|
12
12
|
var _reactNative = require("react-native");
|
|
13
|
+
var _utils = require("./utils");
|
|
13
14
|
var _ecommerce = require("./ecommerce");
|
|
14
15
|
Object.keys(_ecommerce).forEach(function (key) {
|
|
15
16
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -34,6 +35,18 @@ Object.keys(_revenue).forEach(function (key) {
|
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
});
|
|
38
|
+
var _userProfile = require("./userProfile");
|
|
39
|
+
Object.keys(_userProfile).forEach(function (key) {
|
|
40
|
+
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
|
+
if (key in exports && exports[key] === _userProfile[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _userProfile[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
37
50
|
const LINKING_ERROR = `The package '@appmetrica/react-native-analytics' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
38
51
|
ios: "- You have run 'pod install'\n",
|
|
39
52
|
default: ''
|
|
@@ -118,7 +131,13 @@ class AppMetrica {
|
|
|
118
131
|
AppMetricaNative.reportRevenue(revenue);
|
|
119
132
|
}
|
|
120
133
|
static reportAdRevenue(adRevenue) {
|
|
121
|
-
AppMetricaNative.reportAdRevenue(adRevenue);
|
|
134
|
+
AppMetricaNative.reportAdRevenue((0, _utils.normalizeAdRevenue)(adRevenue));
|
|
135
|
+
}
|
|
136
|
+
static reportUserProfile(userProfile) {
|
|
137
|
+
AppMetricaNative.reportUserProfile(userProfile);
|
|
138
|
+
}
|
|
139
|
+
static putErrorEnvironmentValue(key, value) {
|
|
140
|
+
AppMetricaNative.putErrorEnvironmentValue(key, value);
|
|
122
141
|
}
|
|
123
142
|
}
|
|
124
143
|
exports.default = AppMetrica;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_ecommerce","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_revenue","LINKING_ERROR","Platform","select","ios","default","AppMetricaNative","NativeModules","AppMetrica","Proxy","Error","activated","appOpenTracking","getUrlAsync","initialUrl","Linking","getInitialURL","reportAppOpen","callback","event","url","addEventListener","DEVICE_ID_HASH_KEY","DEVICE_ID_KEY","UUID_KEY","activate","config","appOpenTrackingEnabled","getLibraryApiLevel","getLibraryVersion","pauseSession","deeplink","reportError","identifier","message","_reason","reportEvent","eventName","attributes","requestStartupParams","listener","identifiers","resumeSession","sendEventsBuffer","setLocation","location","setLocationTracking","enabled","setDataSendingEnabled","setUserProfileID","userProfileID","reportECommerce","reportRevenue","revenue","reportAdRevenue","adRevenue"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_utils","_ecommerce","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_revenue","_userProfile","LINKING_ERROR","Platform","select","ios","default","AppMetricaNative","NativeModules","AppMetrica","Proxy","Error","activated","appOpenTracking","getUrlAsync","initialUrl","Linking","getInitialURL","reportAppOpen","callback","event","url","addEventListener","DEVICE_ID_HASH_KEY","DEVICE_ID_KEY","UUID_KEY","activate","config","appOpenTrackingEnabled","getLibraryApiLevel","getLibraryVersion","pauseSession","deeplink","reportError","identifier","message","_reason","reportEvent","eventName","attributes","requestStartupParams","listener","identifiers","resumeSession","sendEventsBuffer","setLocation","location","setLocationTracking","enabled","setDataSendingEnabled","setUserProfileID","userProfileID","reportECommerce","reportRevenue","revenue","reportAdRevenue","adRevenue","normalizeAdRevenue","reportUserProfile","userProfile","putErrorEnvironmentValue","value"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAwFA,IAAAE,UAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,UAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,UAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,UAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAf,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,I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,EAAE;IACjDpD,gBAAgB,CAACmD,iBAAiB,CAACC,WAAW,CAAC;EACjD;EAEA,OAAOC,wBAAwBA,CAACrE,GAAW,EAAEsE,KAAc,EAAE;IAC3DtD,gBAAgB,CAACqD,wBAAwB,CAACrE,GAAG,EAAEsE,KAAK,CAAC;EACvD;AACF;AAACjE,OAAA,CAAAU,OAAA,GAAAG,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UserProfile = exports.StringAttribute = exports.NumberAttribute = exports.NotificationsEnabledAttribute = exports.NameAttribute = exports.GenderAttribute = exports.CounterAttribute = exports.BooleanAttribute = exports.BirthDateAttribute = exports.Attributes = void 0;
|
|
7
|
+
class UserProfile {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.attributes = [];
|
|
10
|
+
}
|
|
11
|
+
apply(attribute) {
|
|
12
|
+
this.attributes.push(attribute);
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.UserProfile = UserProfile;
|
|
17
|
+
class Attributes {
|
|
18
|
+
static birthDate() {
|
|
19
|
+
return new BirthDateAttribute();
|
|
20
|
+
}
|
|
21
|
+
static customBoolean(key) {
|
|
22
|
+
return new BooleanAttribute(key);
|
|
23
|
+
}
|
|
24
|
+
static customCounter(key) {
|
|
25
|
+
return new CounterAttribute(key);
|
|
26
|
+
}
|
|
27
|
+
static customNumber(key) {
|
|
28
|
+
return new NumberAttribute(key);
|
|
29
|
+
}
|
|
30
|
+
static customString(key) {
|
|
31
|
+
return new StringAttribute(key);
|
|
32
|
+
}
|
|
33
|
+
static gender() {
|
|
34
|
+
return new GenderAttribute();
|
|
35
|
+
}
|
|
36
|
+
static userName() {
|
|
37
|
+
return new NameAttribute();
|
|
38
|
+
}
|
|
39
|
+
static notificationsEnabled() {
|
|
40
|
+
return new NotificationsEnabledAttribute();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.Attributes = Attributes;
|
|
44
|
+
class BirthDateAttribute {
|
|
45
|
+
withAge(age) {
|
|
46
|
+
return {
|
|
47
|
+
type: 'BirthDateWithAge',
|
|
48
|
+
age: age,
|
|
49
|
+
ifUndefined: false
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
withAgeIfUndefined(age) {
|
|
53
|
+
return {
|
|
54
|
+
type: 'BirthDateWithAge',
|
|
55
|
+
age: age,
|
|
56
|
+
ifUndefined: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
withYear(year) {
|
|
60
|
+
return {
|
|
61
|
+
type: 'BirthDateWithYear',
|
|
62
|
+
year: year,
|
|
63
|
+
ifUndefined: false
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
withYearIfUndefined(year) {
|
|
67
|
+
return {
|
|
68
|
+
type: 'BirthDateWithYear',
|
|
69
|
+
year: year,
|
|
70
|
+
ifUndefined: true
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
withMonth(year, month) {
|
|
74
|
+
return {
|
|
75
|
+
type: 'BirthDateWithMonth',
|
|
76
|
+
year: year,
|
|
77
|
+
month: month,
|
|
78
|
+
ifUndefined: false
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
withMonthIfUndefined(year, month) {
|
|
82
|
+
return {
|
|
83
|
+
type: 'BirthDateWithMonth',
|
|
84
|
+
year: year,
|
|
85
|
+
month: month,
|
|
86
|
+
ifUndefined: true
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
withDay(year, month, day) {
|
|
90
|
+
return {
|
|
91
|
+
type: 'BirthDateWithDay',
|
|
92
|
+
year: year,
|
|
93
|
+
month: month,
|
|
94
|
+
day: day,
|
|
95
|
+
ifUndefined: false
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
withDayIfUndefined(year, month, day) {
|
|
99
|
+
return {
|
|
100
|
+
type: 'BirthDateWithDay',
|
|
101
|
+
year: year,
|
|
102
|
+
month: month,
|
|
103
|
+
day: day,
|
|
104
|
+
ifUndefined: true
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
withDate(date) {
|
|
108
|
+
return this.withDay(date.getFullYear(), date.getMonth(), date.getDate());
|
|
109
|
+
}
|
|
110
|
+
withDateIfUndefined(date) {
|
|
111
|
+
return this.withDayIfUndefined(date.getFullYear(), date.getMonth(), date.getDate());
|
|
112
|
+
}
|
|
113
|
+
withValueReset() {
|
|
114
|
+
return {
|
|
115
|
+
type: 'BirthDateValueReset'
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.BirthDateAttribute = BirthDateAttribute;
|
|
120
|
+
class BooleanAttribute {
|
|
121
|
+
constructor(key) {
|
|
122
|
+
this.key = key;
|
|
123
|
+
}
|
|
124
|
+
withValue(value) {
|
|
125
|
+
return {
|
|
126
|
+
type: 'BooleanValue',
|
|
127
|
+
key: this.key,
|
|
128
|
+
value: value,
|
|
129
|
+
ifUndefined: false
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
withValueIfUndefined(value) {
|
|
133
|
+
return {
|
|
134
|
+
type: 'BooleanValue',
|
|
135
|
+
key: this.key,
|
|
136
|
+
value: value,
|
|
137
|
+
ifUndefined: true
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
withValueReset() {
|
|
141
|
+
return {
|
|
142
|
+
type: 'BooleanValueReset',
|
|
143
|
+
key: this.key
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
exports.BooleanAttribute = BooleanAttribute;
|
|
148
|
+
class CounterAttribute {
|
|
149
|
+
constructor(key) {
|
|
150
|
+
this.key = key;
|
|
151
|
+
}
|
|
152
|
+
withDelta(delta) {
|
|
153
|
+
return {
|
|
154
|
+
type: 'Counter',
|
|
155
|
+
key: this.key,
|
|
156
|
+
delta: delta
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.CounterAttribute = CounterAttribute;
|
|
161
|
+
class GenderAttribute {
|
|
162
|
+
withValue(gender) {
|
|
163
|
+
return {
|
|
164
|
+
type: 'GenderValue',
|
|
165
|
+
value: gender,
|
|
166
|
+
ifUndefined: false
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
withValueIfUndefined(gender) {
|
|
170
|
+
return {
|
|
171
|
+
type: 'GenderValue',
|
|
172
|
+
value: gender,
|
|
173
|
+
ifUndefined: true
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
withValueReset() {
|
|
177
|
+
return {
|
|
178
|
+
type: 'GenderValueReset'
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
exports.GenderAttribute = GenderAttribute;
|
|
183
|
+
class NameAttribute {
|
|
184
|
+
withValue(value) {
|
|
185
|
+
return {
|
|
186
|
+
type: 'NameValue',
|
|
187
|
+
value: value,
|
|
188
|
+
ifUndefined: false
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
withValueIfUndefined(value) {
|
|
192
|
+
return {
|
|
193
|
+
type: 'NameValue',
|
|
194
|
+
value: value,
|
|
195
|
+
ifUndefined: true
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
withValueReset() {
|
|
199
|
+
return {
|
|
200
|
+
type: 'NameValueReset'
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.NameAttribute = NameAttribute;
|
|
205
|
+
class NotificationsEnabledAttribute {
|
|
206
|
+
withValue(value) {
|
|
207
|
+
return {
|
|
208
|
+
type: 'NotificationsEnabledValue',
|
|
209
|
+
value: value,
|
|
210
|
+
ifUndefined: false
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
withValueIfUndefined(value) {
|
|
214
|
+
return {
|
|
215
|
+
type: 'NotificationsEnabledValue',
|
|
216
|
+
value: value,
|
|
217
|
+
ifUndefined: true
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
withValueReset() {
|
|
221
|
+
return {
|
|
222
|
+
type: 'NotificationsEnabledValueReset'
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
exports.NotificationsEnabledAttribute = NotificationsEnabledAttribute;
|
|
227
|
+
class NumberAttribute {
|
|
228
|
+
constructor(key) {
|
|
229
|
+
this.key = key;
|
|
230
|
+
}
|
|
231
|
+
withValue(value) {
|
|
232
|
+
return {
|
|
233
|
+
type: 'NumberValue',
|
|
234
|
+
key: this.key,
|
|
235
|
+
value: value,
|
|
236
|
+
ifUndefined: false
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
withValueIfUndefined(value) {
|
|
240
|
+
return {
|
|
241
|
+
type: 'NumberValue',
|
|
242
|
+
key: this.key,
|
|
243
|
+
value: value,
|
|
244
|
+
ifUndefined: true
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
withValueReset() {
|
|
248
|
+
return {
|
|
249
|
+
type: 'NumberValueReset',
|
|
250
|
+
key: this.key
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
exports.NumberAttribute = NumberAttribute;
|
|
255
|
+
class StringAttribute {
|
|
256
|
+
constructor(key) {
|
|
257
|
+
this.key = key;
|
|
258
|
+
}
|
|
259
|
+
withValue(value) {
|
|
260
|
+
return {
|
|
261
|
+
type: 'StringValue',
|
|
262
|
+
key: this.key,
|
|
263
|
+
value: value,
|
|
264
|
+
ifUndefined: false
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
withValueIfUndefined(value) {
|
|
268
|
+
return {
|
|
269
|
+
type: 'StringValue',
|
|
270
|
+
key: this.key,
|
|
271
|
+
value: value,
|
|
272
|
+
ifUndefined: true
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
withValueReset() {
|
|
276
|
+
return {
|
|
277
|
+
type: 'StringValueReset',
|
|
278
|
+
key: this.key
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
exports.StringAttribute = StringAttribute;
|
|
283
|
+
//# sourceMappingURL=userProfile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UserProfile","constructor","attributes","apply","attribute","push","exports","Attributes","birthDate","BirthDateAttribute","customBoolean","key","BooleanAttribute","customCounter","CounterAttribute","customNumber","NumberAttribute","customString","StringAttribute","gender","GenderAttribute","userName","NameAttribute","notificationsEnabled","NotificationsEnabledAttribute","withAge","age","type","ifUndefined","withAgeIfUndefined","withYear","year","withYearIfUndefined","withMonth","month","withMonthIfUndefined","withDay","day","withDayIfUndefined","withDate","date","getFullYear","getMonth","getDate","withDateIfUndefined","withValueReset","withValue","value","withValueIfUndefined","withDelta","delta"],"sourceRoot":"../../src","sources":["userProfile.ts"],"mappings":";;;;;;AAAO,MAAMA,WAAW,CAAC;EAGvBC,WAAWA,CAAA,EAAG;IACZ,IAAI,CAACC,UAAU,GAAG,EAAE;EACtB;EAEAC,KAAKA,CAACC,SAA4B,EAAe;IAC/C,IAAI,CAACF,UAAU,CAACG,IAAI,CAACD,SAAS,CAAC;IAE/B,OAAO,IAAI;EACb;AACF;AAACE,OAAA,CAAAN,WAAA,GAAAA,WAAA;AAoCM,MAAMO,UAAU,CAAC;EACtB,OAAOC,SAASA,CAAA,EAAG;IACjB,OAAO,IAAIC,kBAAkB,CAAC,CAAC;EACjC;EAEA,OAAOC,aAAaA,CAACC,GAAW,EAAE;IAChC,OAAO,IAAIC,gBAAgB,CAACD,GAAG,CAAC;EAClC;EAEA,OAAOE,aAAaA,CAACF,GAAW,EAAE;IAChC,OAAO,IAAIG,gBAAgB,CAACH,GAAG,CAAC;EAClC;EAEA,OAAOI,YAAYA,CAACJ,GAAW,EAAE;IAC/B,OAAO,IAAIK,eAAe,CAACL,GAAG,CAAC;EACjC;EAEA,OAAOM,YAAYA,CAACN,GAAW,EAAE;IAC/B,OAAO,IAAIO,eAAe,CAACP,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M,MAAME,eAAe,CAAC;EAG3BjB,WAAWA,CAACU,GAAW,EAAE;IACvB,IAAI,CAACA,GAAG,GAAGA,GAAG;EAChB;EAEAmC,SAASA,CAACC,KAAa,EAAqB;IAC1C,OAAO;MACLpB,IAAI,EAAE,aAAa;MACnBhB,GAAG,EAAE,IAAI,CAACA,GAAG;MACboC,KAAK,EAAEA,KAAK;MACZnB,WAAW,EAAE;IACf,CAAC;EACH;EAEAoB,oBAAoBA,CAACD,KAAa,EAAqB;IACrD,OAAO;MACLpB,IAAI,EAAE,aAAa;MACnBhB,GAAG,EAAE,IAAI,CAACA,GAAG;MACboC,KAAK,EAAEA,KAAK;MACZnB,WAAW,EAAE;IACf,CAAC;EACH;EAEAiB,cAAcA,CAAA,EAAsB;IAClC,OAAO;MACLlB,IAAI,EAAE,kBAAkB;MACxBhB,GAAG,EAAE,IAAI,CAACA;IACZ,CAAC;EACH;AACF;AAACL,OAAA,CAAAY,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.normalizeAdRevenue = normalizeAdRevenue;
|
|
7
|
+
exports.normalizeECommerceCartItem = normalizeECommerceCartItem;
|
|
8
|
+
exports.normalizeECommerceOrder = normalizeECommerceOrder;
|
|
9
|
+
exports.normalizeECommerceProduct = normalizeECommerceProduct;
|
|
10
|
+
exports.normalizeECommerceReferrer = normalizeECommerceReferrer;
|
|
11
|
+
exports.normalizeECommerceScreen = normalizeECommerceScreen;
|
|
12
|
+
function convertMap(map) {
|
|
13
|
+
return map !== undefined ? Object.fromEntries(map) : undefined;
|
|
14
|
+
}
|
|
15
|
+
function normalizeECommerceOrder(order) {
|
|
16
|
+
const newOrder = {
|
|
17
|
+
...order
|
|
18
|
+
};
|
|
19
|
+
if (order.payload instanceof Map) {
|
|
20
|
+
newOrder.payload = convertMap(order.payload);
|
|
21
|
+
}
|
|
22
|
+
newOrder.products = order.products.map(normalizeECommerceCartItem);
|
|
23
|
+
return newOrder;
|
|
24
|
+
}
|
|
25
|
+
function normalizeECommerceCartItem(item) {
|
|
26
|
+
const newItem = {
|
|
27
|
+
...item
|
|
28
|
+
};
|
|
29
|
+
newItem.product = normalizeECommerceProduct(item.product);
|
|
30
|
+
newItem.referrer = normalizeECommerceReferrer(item.referrer);
|
|
31
|
+
return newItem;
|
|
32
|
+
}
|
|
33
|
+
function normalizeECommerceProduct(product) {
|
|
34
|
+
const newProduct = {
|
|
35
|
+
...product
|
|
36
|
+
};
|
|
37
|
+
if (product.payload instanceof Map) {
|
|
38
|
+
newProduct.payload = convertMap(product.payload);
|
|
39
|
+
}
|
|
40
|
+
return newProduct;
|
|
41
|
+
}
|
|
42
|
+
function normalizeECommerceReferrer(referrer) {
|
|
43
|
+
if (referrer === undefined) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const newReferrer = {
|
|
47
|
+
...referrer
|
|
48
|
+
};
|
|
49
|
+
if (referrer.screen != undefined) {
|
|
50
|
+
newReferrer.screen = normalizeECommerceScreen(referrer.screen);
|
|
51
|
+
}
|
|
52
|
+
return newReferrer;
|
|
53
|
+
}
|
|
54
|
+
function normalizeECommerceScreen(screen) {
|
|
55
|
+
const newScreen = {
|
|
56
|
+
...screen
|
|
57
|
+
};
|
|
58
|
+
if (screen.payload instanceof Map) {
|
|
59
|
+
newScreen.payload = convertMap(screen.payload);
|
|
60
|
+
}
|
|
61
|
+
return newScreen;
|
|
62
|
+
}
|
|
63
|
+
function normalizeAdRevenue(adRevenue) {
|
|
64
|
+
const newAdRevenue = {
|
|
65
|
+
...adRevenue
|
|
66
|
+
};
|
|
67
|
+
if (adRevenue.payload instanceof Map) {
|
|
68
|
+
newAdRevenue.payload = convertMap(adRevenue.payload);
|
|
69
|
+
}
|
|
70
|
+
return newAdRevenue;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=utils.js.map
|