ardent-cli 0.0.13 → 0.0.15
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 +23 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ function clearConfig() {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
function getApiUrl() {
|
|
55
|
-
return getConfig("apiUrl") || process.env.ARDENT_API_URL || "https://
|
|
55
|
+
return getConfig("apiUrl") || process.env.ARDENT_API_URL || "https://api.tryardent.com";
|
|
56
56
|
}
|
|
57
57
|
function getToken() {
|
|
58
58
|
return getConfig("token") || process.env.ARDENT_TOKEN;
|
|
@@ -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: ["*"]
|
|
@@ -1069,18 +1082,24 @@ async function listAction2() {
|
|
|
1069
1082
|
const currentConnectorId = getConfig("currentConnectorId");
|
|
1070
1083
|
const green3 = "\x1B[32m";
|
|
1071
1084
|
const dim3 = "\x1B[2m";
|
|
1085
|
+
const yellow2 = "\x1B[33m";
|
|
1072
1086
|
const reset3 = "\x1B[0m";
|
|
1073
1087
|
console.log("Connectors:\n");
|
|
1074
1088
|
for (const connector of connectors) {
|
|
1075
1089
|
const isCurrent = connector.id === currentConnectorId;
|
|
1076
1090
|
const icon = connector.status === "healthy" ? "\u25CF" : "\u25CB";
|
|
1091
|
+
const warnings = connector.warnings ?? [];
|
|
1092
|
+
const warningSuffix = warnings.length > 0 ? ` ${yellow2}\u26A0 ${warnings.length}${reset3}` : "";
|
|
1077
1093
|
if (isCurrent) {
|
|
1078
|
-
console.log(`${green3}* ${icon} ${connector.name}${reset3}`);
|
|
1094
|
+
console.log(`${green3}* ${icon} ${connector.name}${reset3}${warningSuffix}`);
|
|
1079
1095
|
console.log(`${green3} ${connector.service_name}${reset3}`);
|
|
1080
1096
|
} else {
|
|
1081
|
-
console.log(` ${icon} ${connector.name}`);
|
|
1097
|
+
console.log(` ${icon} ${connector.name}${warningSuffix}`);
|
|
1082
1098
|
console.log(`${dim3} ${connector.service_name}${reset3}`);
|
|
1083
1099
|
}
|
|
1100
|
+
for (const warning of warnings) {
|
|
1101
|
+
console.log(`${yellow2} \u26A0 ${warning}${reset3}`);
|
|
1102
|
+
}
|
|
1084
1103
|
console.log();
|
|
1085
1104
|
}
|
|
1086
1105
|
}
|