ardent-cli 0.0.12 → 0.0.14
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/index.js +29 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -975,7 +975,20 @@ async function createAction2(type, url, options) {
|
|
|
975
975
|
}
|
|
976
976
|
} else {
|
|
977
977
|
console.log("Discovering schema...");
|
|
978
|
-
await api.post(
|
|
978
|
+
const discoverResult = await api.post(
|
|
979
|
+
`/v1/connectors/${connectorId}/discover`,
|
|
980
|
+
{}
|
|
981
|
+
);
|
|
982
|
+
const discoveryWarnings = discoverResult?.source_metadata?.warnings ?? [];
|
|
983
|
+
if (discoveryWarnings.length > 0) {
|
|
984
|
+
const yellow2 = "\x1B[33m";
|
|
985
|
+
const reset3 = "\x1B[0m";
|
|
986
|
+
console.log("");
|
|
987
|
+
for (const warning of discoveryWarnings) {
|
|
988
|
+
console.log(`${yellow2}\u26A0 ${warning}${reset3}`);
|
|
989
|
+
}
|
|
990
|
+
console.log("");
|
|
991
|
+
}
|
|
979
992
|
console.log("Setting selection...");
|
|
980
993
|
await api.post(`/v1/connectors/${connectorId}/selection`, {
|
|
981
994
|
selected_paths: ["*"]
|
|
@@ -1026,8 +1039,13 @@ async function listAction2() {
|
|
|
1026
1039
|
let cacheTime = "";
|
|
1027
1040
|
try {
|
|
1028
1041
|
const currentProjectId = getConfig("currentProjectId");
|
|
1029
|
-
|
|
1030
|
-
|
|
1042
|
+
if (!currentProjectId) {
|
|
1043
|
+
console.error("\u2717 No current project set. Switch to a project first:");
|
|
1044
|
+
console.error(" ardent project list");
|
|
1045
|
+
console.error(" ardent project switch <name>");
|
|
1046
|
+
process.exit(1);
|
|
1047
|
+
}
|
|
1048
|
+
const result = await api.get(`/v1/cli/connectors?project_id=${currentProjectId}`);
|
|
1031
1049
|
if (!result.connectors) {
|
|
1032
1050
|
throw new Error("API returned invalid response: missing connectors array");
|
|
1033
1051
|
}
|
|
@@ -1064,18 +1082,24 @@ async function listAction2() {
|
|
|
1064
1082
|
const currentConnectorId = getConfig("currentConnectorId");
|
|
1065
1083
|
const green3 = "\x1B[32m";
|
|
1066
1084
|
const dim3 = "\x1B[2m";
|
|
1085
|
+
const yellow2 = "\x1B[33m";
|
|
1067
1086
|
const reset3 = "\x1B[0m";
|
|
1068
1087
|
console.log("Connectors:\n");
|
|
1069
1088
|
for (const connector of connectors) {
|
|
1070
1089
|
const isCurrent = connector.id === currentConnectorId;
|
|
1071
1090
|
const icon = connector.status === "healthy" ? "\u25CF" : "\u25CB";
|
|
1091
|
+
const warnings = connector.warnings ?? [];
|
|
1092
|
+
const warningSuffix = warnings.length > 0 ? ` ${yellow2}\u26A0 ${warnings.length}${reset3}` : "";
|
|
1072
1093
|
if (isCurrent) {
|
|
1073
|
-
console.log(`${green3}* ${icon} ${connector.name}${reset3}`);
|
|
1094
|
+
console.log(`${green3}* ${icon} ${connector.name}${reset3}${warningSuffix}`);
|
|
1074
1095
|
console.log(`${green3} ${connector.service_name}${reset3}`);
|
|
1075
1096
|
} else {
|
|
1076
|
-
console.log(` ${icon} ${connector.name}`);
|
|
1097
|
+
console.log(` ${icon} ${connector.name}${warningSuffix}`);
|
|
1077
1098
|
console.log(`${dim3} ${connector.service_name}${reset3}`);
|
|
1078
1099
|
}
|
|
1100
|
+
for (const warning of warnings) {
|
|
1101
|
+
console.log(`${yellow2} \u26A0 ${warning}${reset3}`);
|
|
1102
|
+
}
|
|
1079
1103
|
console.log();
|
|
1080
1104
|
}
|
|
1081
1105
|
}
|