Skip to content

Commit ddbd4c5

Browse files
committed
chore: updating analytics API endpoint
1 parent 90b498c commit ddbd4c5

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

package-lock.json

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
"electron-log": "^3.0.8",
8484
"electron-prompt": "^1.3.1",
8585
"electron-updater": "4.1.2",
86-
"form-data": "^2.5.1",
8786
"fs-extra": "^8.1.0",
8887
"jexl": "^1.1.4",
8988
"jsonlint": "^1.6.3",

scripts/main/arc-session-recorder.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const { ArcMeta } = require('../packages/arc-preferences/main');
2-
const _FormData = require('form-data');
32
const _fetch = require('node-fetch');
43
const log = require('./logger');
54
/**
@@ -16,7 +15,7 @@ class ArcSessionRecorder {
1615
*/
1716
constructor() {
1817
this.meta = new ArcMeta();
19-
this.endpoint = 'https://app.advancedrestclient.com/analytics/record';
18+
this.endpoint = 'https://api.advancedrestclient.com/v1/analytics/record';
2019
}
2120
/**
2221
* Pings the server to record the session.
@@ -33,17 +32,18 @@ class ArcSessionRecorder {
3332
/**
3433
* Posts session data to the analytics server.
3534
*
36-
* @param {String} id Anonymous app id.
35+
* @param {String} aid Anonymous app id.
3736
* @return {Promise}
3837
*/
39-
async _postSession(id) {
40-
const data = new _FormData();
38+
async _postSession(aid) {
4139
const d = new Date();
42-
data.append('aid', id); // anonymousId
43-
data.append('tz', d.getTimezoneOffset()); // timezone
40+
const data = {
41+
aid,
42+
tz: d.getTimezoneOffset()
43+
};
4444
return await _fetch(this.endpoint, {
4545
method: 'POST',
46-
body: data
46+
body: JSON.stringify(data)
4747
});
4848
}
4949
}

0 commit comments

Comments
 (0)