core-outline 1.0.0 → 1.0.1
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/config/components/app.js +3 -0
- package/config/components/tracking.js +10 -0
- package/config/index.js +8 -0
- package/lib/axios/app.js +0 -0
- package/lib/index.js +5 -0
- package/lib/react-router/app.js +0 -0
- package/package.json +7 -3
- package/services/index.js +7 -0
- package/services/page/update-page.js +22 -0
- package/services/session/end-session.js +20 -0
- package/services/session/start-session.js +24 -0
- package/services/target/update-target.js +20 -0
- package/workers/trackPageChanges/index.js +0 -0
package/config/index.js
ADDED
package/lib/axios/app.js
ADDED
|
File without changes
|
package/lib/index.js
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core-outline",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Connect your
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Connect your React JS application to Core&Outline",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -19,5 +19,9 @@
|
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/TomiTsuma/core-outline-npm/issues"
|
|
21
21
|
},
|
|
22
|
-
"homepage": "https://github.com/TomiTsuma/core-outline-npm#readme"
|
|
22
|
+
"homepage": "https://github.com/TomiTsuma/core-outline-npm#readme",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"axios": "^1.6.7",
|
|
25
|
+
"react-router-dom": "^6.22.1"
|
|
26
|
+
}
|
|
23
27
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const updatePage = require('./page/update-page.js')
|
|
2
|
+
const startSession = require('./session/start-session.js')
|
|
3
|
+
const endSession = require('./session/end-session.js')
|
|
4
|
+
const targetReached = require('./target/update-target.js')
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module.exports = {updatePage, startSession, endSession, targetReached}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const request = reqire('../../lib/index.js')
|
|
2
|
+
const { trackingConfigs, appConfigs } = require('../../config/index.js')
|
|
3
|
+
|
|
4
|
+
const updatePage = async(time_in, session_id, time_out) =>{
|
|
5
|
+
const res = await(
|
|
6
|
+
request({
|
|
7
|
+
url: appConfigs.BASE_URL,
|
|
8
|
+
service: trackingConfigs.UPDATE_PAGE,
|
|
9
|
+
body: {
|
|
10
|
+
'session_id':session_id,
|
|
11
|
+
'time_in':time_in,
|
|
12
|
+
'time_out':time_out
|
|
13
|
+
},
|
|
14
|
+
method:'POST',
|
|
15
|
+
params:{
|
|
16
|
+
Authorization: `Bearer ${token}`
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = updatePage
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const request = reqire('../../lib/index.js')
|
|
2
|
+
const { trackingConfigs, appConfigs } = require('../../config/index.js')
|
|
3
|
+
|
|
4
|
+
const endSession = async(session_id) =>{
|
|
5
|
+
const res = await(
|
|
6
|
+
request({
|
|
7
|
+
url: appConfigs.BASE_URL,
|
|
8
|
+
service: trackingConfigs.END_SESSION,
|
|
9
|
+
body: {
|
|
10
|
+
'session_id':session_id
|
|
11
|
+
},
|
|
12
|
+
method:'POST',
|
|
13
|
+
params:{
|
|
14
|
+
Authorization: `Bearer ${token}`
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = endSession
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const request = reqire('../../lib/index.js')
|
|
2
|
+
const { trackingConfigs } = require('../../config/index.js')
|
|
3
|
+
|
|
4
|
+
const startSession = async(device, browser, latitude, longitude) =>{
|
|
5
|
+
const res = await(
|
|
6
|
+
request({
|
|
7
|
+
url:`https://api.coreoutline.com`,
|
|
8
|
+
service: trackingConfigs.START_SESSION,
|
|
9
|
+
body: {
|
|
10
|
+
'device':device,
|
|
11
|
+
'browser':browser,
|
|
12
|
+
'latitude':latitude,
|
|
13
|
+
'longitude':longitude
|
|
14
|
+
},
|
|
15
|
+
method:'POST',
|
|
16
|
+
params:{
|
|
17
|
+
Authorization: `Bearer ${token}`
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
module.exports = startSession
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const request = reqire('../../lib/index.js')
|
|
2
|
+
const { trackingConfigs, appConfigs } = require('../../config/index.js')
|
|
3
|
+
|
|
4
|
+
const targetReached = async(session_id) =>{
|
|
5
|
+
const res = await(
|
|
6
|
+
request({
|
|
7
|
+
url: appConfigs.BASE_URL,
|
|
8
|
+
service: trackingConfigs.TARGET_REACHED,
|
|
9
|
+
body: {
|
|
10
|
+
'session_id':session_id
|
|
11
|
+
},
|
|
12
|
+
method:'POST',
|
|
13
|
+
params:{
|
|
14
|
+
Authorization: `Bearer ${token}`
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = targetReached
|
|
File without changes
|