@oussema_mili/test-pkg-123 1.1.22 → 1.1.24
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.
Potentially problematic release.
This version of @oussema_mili/test-pkg-123 might be problematic. Click here for more details.
- package/docker-actions/apps.js +29 -18
- package/package.json +1 -1
package/docker-actions/apps.js
CHANGED
|
@@ -26,9 +26,11 @@ import setupTasks from "./setup-tasks.js";
|
|
|
26
26
|
const __filename = fileURLToPath(import.meta.url);
|
|
27
27
|
const __dirname = dirname(__filename);
|
|
28
28
|
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
const
|
|
29
|
+
// Helper to get current backend URL (loaded fresh each time to pick up config changes)
|
|
30
|
+
function getBackendUrl() {
|
|
31
|
+
const config = loadConfig();
|
|
32
|
+
return config.backendUrl;
|
|
33
|
+
}
|
|
32
34
|
|
|
33
35
|
// Fenwave workspace configuration paths
|
|
34
36
|
const FENWAVE_CONFIG_DIR = path.join(os.homedir(), ".fenwave", "config");
|
|
@@ -397,8 +399,10 @@ async function acknowledgeEvent(eventId, changeId) {
|
|
|
397
399
|
return false;
|
|
398
400
|
}
|
|
399
401
|
|
|
402
|
+
const backendUrl = getBackendUrl();
|
|
403
|
+
|
|
400
404
|
const response = await axios.post(
|
|
401
|
-
`${
|
|
405
|
+
`${backendUrl}/api/agent-cli/acknowledge-event`,
|
|
402
406
|
{
|
|
403
407
|
token: session.token,
|
|
404
408
|
eventId,
|
|
@@ -526,7 +530,8 @@ async function handleFetchLogContent(ws, payload) {
|
|
|
526
530
|
|
|
527
531
|
// Fetch published applications from Fenwave app-builder
|
|
528
532
|
async function fetchFenwaveApps(userEntityRef) {
|
|
529
|
-
|
|
533
|
+
const backendUrl = getBackendUrl();
|
|
534
|
+
if (!backendUrl) {
|
|
530
535
|
console.warn("Backend URL not configured, skipping Fenwave apps");
|
|
531
536
|
return [];
|
|
532
537
|
}
|
|
@@ -541,7 +546,8 @@ async function fetchFenwaveApps(userEntityRef) {
|
|
|
541
546
|
return [];
|
|
542
547
|
}
|
|
543
548
|
|
|
544
|
-
const url = `${
|
|
549
|
+
const url = `${backendUrl}/api/app-builder/applications`;
|
|
550
|
+
console.log('### fetchFenwaveApps URL: ', url);
|
|
545
551
|
|
|
546
552
|
// Fetch both published apps and user's drafts
|
|
547
553
|
const [publishedResponse, draftResponse] = await Promise.all([
|
|
@@ -626,10 +632,11 @@ async function transformFenwaveApp(fenwaveApp) {
|
|
|
626
632
|
const session = loadSession();
|
|
627
633
|
let allVersions = [];
|
|
628
634
|
|
|
629
|
-
|
|
635
|
+
const backendUrl = getBackendUrl();
|
|
636
|
+
if (session && session.token && backendUrl) {
|
|
630
637
|
try {
|
|
631
638
|
const versionsResponse = await axios.get(
|
|
632
|
-
`${
|
|
639
|
+
`${backendUrl}/api/app-builder/applications/${fenwaveApp.id}/versions`,
|
|
633
640
|
{
|
|
634
641
|
headers: {
|
|
635
642
|
"Content-Type": "application/json",
|
|
@@ -1022,7 +1029,8 @@ async function handleFetchAppVersions(ws, payload) {
|
|
|
1022
1029
|
throw new Error("fwId is required");
|
|
1023
1030
|
}
|
|
1024
1031
|
|
|
1025
|
-
|
|
1032
|
+
const backendUrl = getBackendUrl();
|
|
1033
|
+
if (!backendUrl) {
|
|
1026
1034
|
throw new Error("Backend URL not configured");
|
|
1027
1035
|
}
|
|
1028
1036
|
|
|
@@ -1033,7 +1041,7 @@ async function handleFetchAppVersions(ws, payload) {
|
|
|
1033
1041
|
}
|
|
1034
1042
|
|
|
1035
1043
|
// Fetch app info to get the name for container matching
|
|
1036
|
-
const appUrl = `${
|
|
1044
|
+
const appUrl = `${backendUrl}/api/app-builder/applications/${fwId}`;
|
|
1037
1045
|
const appResponse = await axios.get(appUrl, {
|
|
1038
1046
|
headers: {
|
|
1039
1047
|
"Content-Type": "application/json",
|
|
@@ -1064,7 +1072,7 @@ async function handleFetchAppVersions(ws, payload) {
|
|
|
1064
1072
|
console.warn("Error checking containers:", err.message);
|
|
1065
1073
|
}
|
|
1066
1074
|
|
|
1067
|
-
const url = `${
|
|
1075
|
+
const url = `${backendUrl}/api/app-builder/applications/${fwId}/versions`;
|
|
1068
1076
|
const response = await axios.get(url, {
|
|
1069
1077
|
headers: {
|
|
1070
1078
|
"Content-Type": "application/json",
|
|
@@ -1594,8 +1602,8 @@ async function handleDeleteApp(ws, payload) {
|
|
|
1594
1602
|
);
|
|
1595
1603
|
throw new Error("No active session. Please login first.");
|
|
1596
1604
|
}
|
|
1597
|
-
|
|
1598
|
-
const deleteUrl = `${
|
|
1605
|
+
const backendUrl = getBackendUrl();
|
|
1606
|
+
const deleteUrl = `${backendUrl}/api/app-builder/applications/${app.fwId}`;
|
|
1599
1607
|
|
|
1600
1608
|
try {
|
|
1601
1609
|
await axios.delete(deleteUrl, {
|
|
@@ -1967,7 +1975,8 @@ async function handleDeleteAppVersions(ws, payload) {
|
|
|
1967
1975
|
async function handleCreateApp(ws, payload) {
|
|
1968
1976
|
try {
|
|
1969
1977
|
const { templateName, yamlContent, requestId } = payload;
|
|
1970
|
-
const
|
|
1978
|
+
const backendUrl = getBackendUrl();
|
|
1979
|
+
const url = `${backendUrl}/api/app-builder/import-template`;
|
|
1971
1980
|
try {
|
|
1972
1981
|
await axios.post(
|
|
1973
1982
|
url,
|
|
@@ -3442,7 +3451,8 @@ async function handleSyncApp(ws, payload = {}) {
|
|
|
3442
3451
|
}
|
|
3443
3452
|
|
|
3444
3453
|
// Fetch app metadata first to get the app name
|
|
3445
|
-
const
|
|
3454
|
+
const backendUrl = getBackendUrl();
|
|
3455
|
+
const appUrl = `${backendUrl}/api/app-builder/applications/${actualFwId}`;
|
|
3446
3456
|
const appResponse = await axios.get(appUrl, {
|
|
3447
3457
|
headers: {
|
|
3448
3458
|
"Content-Type": "application/json",
|
|
@@ -3481,7 +3491,7 @@ async function handleSyncApp(ws, payload = {}) {
|
|
|
3481
3491
|
let allVersions = [];
|
|
3482
3492
|
if (versionToFetch) {
|
|
3483
3493
|
try {
|
|
3484
|
-
const versionsUrl = `${
|
|
3494
|
+
const versionsUrl = `${backendUrl}/api/app-builder/applications/${actualFwId}/versions`;
|
|
3485
3495
|
const versionsResponse = await axios.get(versionsUrl, {
|
|
3486
3496
|
headers: {
|
|
3487
3497
|
"Content-Type": "application/json",
|
|
@@ -3781,7 +3791,8 @@ async function handleChangeVersion(ws, payload = {}) {
|
|
|
3781
3791
|
}
|
|
3782
3792
|
|
|
3783
3793
|
// Fetch app metadata
|
|
3784
|
-
const
|
|
3794
|
+
const backendUrl = getBackendUrl();
|
|
3795
|
+
const appUrl = `${backendUrl}/api/app-builder/applications/${actualFwId}`;
|
|
3785
3796
|
const appResponse = await axios.get(appUrl, {
|
|
3786
3797
|
headers: {
|
|
3787
3798
|
"Content-Type": "application/json",
|
|
@@ -3802,7 +3813,7 @@ async function handleChangeVersion(ws, payload = {}) {
|
|
|
3802
3813
|
}),
|
|
3803
3814
|
);
|
|
3804
3815
|
|
|
3805
|
-
const versionsUrl = `${
|
|
3816
|
+
const versionsUrl = `${backendUrl}/api/app-builder/applications/${actualFwId}/versions`;
|
|
3806
3817
|
const versionsResponse = await axios.get(versionsUrl, {
|
|
3807
3818
|
headers: {
|
|
3808
3819
|
"Content-Type": "application/json",
|