You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* tests, id type and request t added
* changelog entry
* linting
* more linting
* some timing issue fix
* update
* wording changes
* changelog and split up the init id assign functions
* some comments
* ID type ifs
* tests, comments and linting
* timing for tests
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,10 @@
1
+
## 22.02.0
2
+
- !! Major breaking change !! Device ID provided during the init will be ignored if a device ID was provided previously
3
+
- Added a new init time flag which erases the previously stored device ID. This allows to set new device ID during init
4
+
- Added a call to get the device ID type of the user
5
+
- Added a call to get the device ID of the user
6
+
- Now it appends the device ID type with each request
7
+
1
8
## 21.11.0
2
9
- !! Major breaking change !! Changing device ID without merging will now clear the current consent. Consent has to be given again after performing this action.
3
10
- ! Minor breaking change ! Multiple values now have a default limit adjustable at initialization:
Copy file name to clipboardExpand all lines: lib/countly-common.js
+45-29Lines changed: 45 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -8,30 +8,38 @@ var cc = {
8
8
debugBulk: false,
9
9
debugBulkUser: false,
10
10
/**
11
-
*
12
-
*log level Enums:
13
-
*Error - this is a issues that needs attention right now.
14
-
*Warning - this is something that is potentially a issue. Maybe a deprecated usage of something, maybe consent is enabled but consent is not given.
15
-
*Info - All publicly exposed functions should log a call at this level to indicate that they were called. These calls should include the function name.
16
-
*Debug - this should contain logs from the internal workings of the SDK and it's important calls. This should include things like the SDK configuration options, success or fail of the current network request, "request queue is full" and the oldest request get's dropped, etc.
17
-
*Verbose - this should give a even deeper look into the SDK's inner working and should contain things that are more noisy and happen often.
18
-
*/
11
+
* log level Enums:
12
+
* Error - this is a issues that needs attention right now.
13
+
* Warning - this is something that is potentially a issue. Maybe a deprecated usage of something, maybe consent is enabled but consent is not given.
14
+
* Info - All publicly exposed functions should log a call at this level to indicate that they were called. These calls should include the function name.
15
+
* Debug - this should contain logs from the internal workings of the SDK and it's important calls. This should include things like the SDK configuration options, success or fail of the current network request, "request queue is full" and the oldest request get's dropped, etc.
16
+
* Verbose - this should give a even deeper look into the SDK's inner working and should contain things that are more noisy and happen often.
17
+
*/
19
18
logLevelEnums: {
20
19
ERROR: '[ERROR] ',
21
20
WARNING: '[WARNING] ',
22
21
INFO: '[INFO] ',
23
22
DEBUG: '[DEBUG] ',
24
23
VERBOSE: '[VERBOSE] ',
25
24
},
25
+
/**
26
+
* device ID type:
27
+
* 0 - device ID was set by the developer during init
28
+
* 1 - device ID was auto generated by Countly
29
+
*/
30
+
deviceIdTypeEnums: {
31
+
DEVELOPER_SUPPLIED: 0,
32
+
SDK_GENERATED: 1,
33
+
},
26
34
/**
27
35
* At the current moment there are following internal events and their respective required consent:
28
-
[CLY]_nps - "feedback" consent
29
-
[CLY]_survey - "feedback" consent
30
-
[CLY]_star_rating - "star_rating" consent
31
-
[CLY]_view - "view" consent
32
-
[CLY]_orientation - "users" consent
33
-
[CLY]_push_action - "push" consent
34
-
[CLY]_action - "clicks" or "scroll" consent
36
+
* [CLY]_nps - "feedback" consent
37
+
* [CLY]_survey - "feedback" consent
38
+
* [CLY]_star_rating - "star_rating" consent
39
+
* [CLY]_view - "view" consent
40
+
* [CLY]_orientation - "users" consent
41
+
* [CLY]_push_action - "push" consent
42
+
* [CLY]_action - "clicks" or "scroll" consent
35
43
*/
36
44
internalEventKeyEnums: {
37
45
NPS: '[CLY]_nps',
@@ -106,11 +114,11 @@ var cc = {
106
114
returnnewStr;
107
115
},
108
116
/**
109
-
* Retrieve only specific properties from object
110
-
* @param {Object} orig - object from which to get properties
111
-
* @param {Array} props - list of properties to get
112
-
* @returns {Object} Object with requested properties
113
-
*/
117
+
* Retrieve only specific properties from object
118
+
* @param {Object} orig - object from which to get properties
119
+
* @param {Array} props - list of properties to get
120
+
* @returns {Object} Object with requested properties
121
+
*/
114
122
getProperties: functiongetProperties(orig,props){
115
123
varob={};
116
124
varprop;
@@ -123,21 +131,21 @@ var cc = {
123
131
returnob;
124
132
},
125
133
/**
126
-
* Removing trailing slashes
127
-
* @memberof Countly._internals
128
-
* @param {String} str - string from which to remove traling slash
129
-
* @returns {String} modified string
130
-
*/
134
+
* Removing trailing slashes
135
+
* @memberof Countly._internals
136
+
* @param {String} str - string from which to remove traling slash
Copy file name to clipboardExpand all lines: lib/countly.js
+67-10Lines changed: 67 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ Countly.Bulk = Bulk;
72
72
varmaxStackTraceLinesPerThread=30;
73
73
varmaxStackTraceLineLength=200;
74
74
var__data={};
75
+
vardeviceIdType=null;
75
76
76
77
/**
77
78
* Array with list of available features that you can require consent for
@@ -101,6 +102,8 @@ Countly.Bulk = Bulk;
101
102
* @param {number} [conf.session_update=60] - how often in seconds should session be extended
102
103
* @param {number} [conf.max_events=100] - maximum amount of events to send in one batch
103
104
* @param {boolean} [conf.force_post=false] - force using post method for all requests
105
+
* @param {boolean} [conf.clear_stored_device_id=false] - set it to true if you want to erase the stored device ID
106
+
* @param {boolean} [conf.test_mode=false] - set it to true if you want to initiate test_mode
104
107
* @param {string} [conf.storage_path="../data/"] - where SDK would store data, including id, queues, etc
105
108
* @param {boolean} [conf.require_consent=false] - pass true if you are implementing GDPR compatible consent management. It would prevent running any functionality without proper consent
106
109
* @param {boolean|function} [conf.remote_config=false] - Enable automatic remote config fetching, provide callback function to be notified when fetching done
0 commit comments