nexarch 0.8.9 → 0.8.10
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.
|
@@ -118,8 +118,30 @@ export async function addRelationship(args) {
|
|
|
118
118
|
const failed = result.summary?.failed ?? 0;
|
|
119
119
|
if (failed > 0) {
|
|
120
120
|
console.error(`Failed to add relationship: ${fromKey} -[${relType}]-> ${toKey}`);
|
|
121
|
+
const missingFrom = new Set();
|
|
122
|
+
const missingTo = new Set();
|
|
121
123
|
for (const err of result.errors ?? []) {
|
|
122
|
-
|
|
124
|
+
const fromEndpoint = err.fromEntityExternalKey ?? fromKey;
|
|
125
|
+
const toEndpoint = err.toEntityExternalKey ?? toKey;
|
|
126
|
+
const message = err.message ?? "(no details returned)";
|
|
127
|
+
if (err.error === "RELATIONSHIP_ENDPOINT_NOT_FOUND") {
|
|
128
|
+
if (err.fromEntityExternalKey)
|
|
129
|
+
missingFrom.add(err.fromEntityExternalKey);
|
|
130
|
+
if (err.toEntityExternalKey)
|
|
131
|
+
missingTo.add(err.toEntityExternalKey);
|
|
132
|
+
console.error(` RELATIONSHIP_ENDPOINT_NOT_FOUND — from=${fromEndpoint} to=${toEndpoint}`);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
console.error(` ${err.error ?? "UNKNOWN_ERROR"} — from=${fromEndpoint} to=${toEndpoint} — ${message}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (missingFrom.size > 0 || missingTo.size > 0) {
|
|
139
|
+
console.error("\nMissing endpoints detected:");
|
|
140
|
+
if (missingFrom.size > 0)
|
|
141
|
+
console.error(` missing from: ${Array.from(missingFrom).join(", ")}`);
|
|
142
|
+
if (missingTo.size > 0)
|
|
143
|
+
console.error(` missing to : ${Array.from(missingTo).join(", ")}`);
|
|
144
|
+
console.error(" Hint: create missing company-scoped entities first with `npx nexarch update-entity ...`, then retry add-relationship.");
|
|
123
145
|
}
|
|
124
146
|
process.exitCode = 1;
|
|
125
147
|
return;
|