bdy 1.12.3-dev → 1.12.4-dev
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/distTs/package.json
CHANGED
|
@@ -10,7 +10,7 @@ const utils_1 = require("../utils");
|
|
|
10
10
|
const node_fs_1 = require("node:fs");
|
|
11
11
|
const undici_1 = require("undici");
|
|
12
12
|
const token = process.env.BUDDY_UT_TOKEN || '';
|
|
13
|
-
const customServiceUrl = process.env.
|
|
13
|
+
const customServiceUrl = process.env.BUDDY_UT_SERVICE_URL;
|
|
14
14
|
function getServiceUrl() {
|
|
15
15
|
if (customServiceUrl) {
|
|
16
16
|
return customServiceUrl;
|
|
@@ -19,11 +19,20 @@ const node_fs_1 = require("node:fs");
|
|
|
19
19
|
const output_1 = __importDefault(require("../output"));
|
|
20
20
|
const texts_1 = require("../texts");
|
|
21
21
|
const eventsource_1 = require("eventsource");
|
|
22
|
-
const customServiceUrl = process.env.
|
|
22
|
+
const customServiceUrl = process.env.BUDDY_VT_SERVICE_URL;
|
|
23
23
|
function getServiceUrl() {
|
|
24
24
|
if (customServiceUrl) {
|
|
25
25
|
return customServiceUrl;
|
|
26
26
|
}
|
|
27
|
+
const tokenParts = context_1.token.split('_');
|
|
28
|
+
const isDevToken = tokenParts.length === 5;
|
|
29
|
+
const devServiceUrl = Buffer.from(tokenParts[3], 'base64url').toString('utf-8');
|
|
30
|
+
if (isDevToken) {
|
|
31
|
+
if (devServiceUrl.includes('local.io')) {
|
|
32
|
+
throw new Error('Use BUDDY_VT_SERVICE_URL to set the service URL in this environment');
|
|
33
|
+
}
|
|
34
|
+
return devServiceUrl;
|
|
35
|
+
}
|
|
27
36
|
if (context_1.token.startsWith('bud_vt_eu')) {
|
|
28
37
|
return 'https://vt.eu.buddy.works';
|
|
29
38
|
}
|