generate-ui-cli 2.1.5 → 2.1.6
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/dist/runtime/config.js +2 -2
- package/dist/telemetry.js +13 -5
- package/package.json +1 -1
package/dist/runtime/config.js
CHANGED
|
@@ -11,8 +11,8 @@ function getCliVersion() {
|
|
|
11
11
|
return package_json_1.default.version || '0.0.0';
|
|
12
12
|
}
|
|
13
13
|
function getApiBaseUrl() {
|
|
14
|
-
return ('https://generateuibackend-production.up.railway.app
|
|
14
|
+
return ('https://generateuibackend-production.up.railway.app');
|
|
15
15
|
}
|
|
16
16
|
function getWebAuthUrl() {
|
|
17
|
-
return ('https://generateuibackend-production.up.railway.app
|
|
17
|
+
return ('https://generateuibackend-production.up.railway.app');
|
|
18
18
|
}
|
package/dist/telemetry.js
CHANGED
|
@@ -12,6 +12,12 @@ const TELEMETRY_TIMEOUT_MS = 1000;
|
|
|
12
12
|
function getOsName() {
|
|
13
13
|
return process.platform;
|
|
14
14
|
}
|
|
15
|
+
function normalizeEmail(email) {
|
|
16
|
+
if (!email)
|
|
17
|
+
return null;
|
|
18
|
+
const trimmed = email.trim();
|
|
19
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
20
|
+
}
|
|
15
21
|
function loadOrCreateConfig() {
|
|
16
22
|
let config = (0, user_config_1.loadUserConfig)();
|
|
17
23
|
let isNew = false;
|
|
@@ -70,9 +76,7 @@ async function sendEvent(payload) {
|
|
|
70
76
|
method: 'POST',
|
|
71
77
|
headers: {
|
|
72
78
|
'Content-Type': 'application/json',
|
|
73
|
-
...(token
|
|
74
|
-
? { Authorization: `Bearer ${token.accessToken}` }
|
|
75
|
-
: {})
|
|
79
|
+
...(token ? { Authorization: `Bearer ${token.accessToken}` } : {})
|
|
76
80
|
},
|
|
77
81
|
body: JSON.stringify(payload),
|
|
78
82
|
signal: controller.signal
|
|
@@ -91,6 +95,8 @@ async function trackCommand(command, cliEnabled) {
|
|
|
91
95
|
if (!enabled)
|
|
92
96
|
return;
|
|
93
97
|
const device = (0, device_1.loadDeviceIdentity)();
|
|
98
|
+
if (!device?.deviceId)
|
|
99
|
+
return;
|
|
94
100
|
if (isNew) {
|
|
95
101
|
await sendEvent({
|
|
96
102
|
event: 'first_run',
|
|
@@ -108,7 +114,7 @@ async function trackCommand(command, cliEnabled) {
|
|
|
108
114
|
event: command,
|
|
109
115
|
installationId: config.installationId,
|
|
110
116
|
deviceId: device.deviceId,
|
|
111
|
-
email: config.lastLoginEmail
|
|
117
|
+
email: normalizeEmail(config.lastLoginEmail),
|
|
112
118
|
cliVersion: (0, config_1.getCliVersion)()
|
|
113
119
|
});
|
|
114
120
|
}
|
|
@@ -118,11 +124,13 @@ async function trackLogin(email, cliEnabled) {
|
|
|
118
124
|
if (!enabled)
|
|
119
125
|
return;
|
|
120
126
|
const device = (0, device_1.loadDeviceIdentity)();
|
|
127
|
+
if (!device?.deviceId)
|
|
128
|
+
return;
|
|
121
129
|
await sendEvent({
|
|
122
130
|
event: 'login',
|
|
123
131
|
installationId: config.installationId,
|
|
124
132
|
deviceId: device.deviceId,
|
|
125
|
-
email: email
|
|
133
|
+
email: normalizeEmail(email),
|
|
126
134
|
cliVersion: (0, config_1.getCliVersion)()
|
|
127
135
|
});
|
|
128
136
|
}
|