faces-cli 1.6.4 → 1.6.5
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.
|
@@ -67,25 +67,28 @@ export default class FaceUpdate extends BaseCommand {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
// Replace tags if provided
|
|
70
|
-
let currentTags;
|
|
71
70
|
if (hasTags) {
|
|
72
71
|
try {
|
|
73
|
-
|
|
74
|
-
currentTags = tagResp.tags ?? flags.tag;
|
|
72
|
+
await client.put(`/v1/iam/${args.face_id}/tags`, { body: { tags: flags.tag } });
|
|
75
73
|
}
|
|
76
74
|
catch (err) {
|
|
77
75
|
if (err instanceof FacesAPIError)
|
|
78
76
|
this.warn(`Tags failed (${err.statusCode}): ${err.message}`);
|
|
79
77
|
}
|
|
80
78
|
}
|
|
79
|
+
// Always fetch current tags so the catalog stays in sync
|
|
80
|
+
let currentTags = [];
|
|
81
|
+
try {
|
|
82
|
+
const tagResp = await client.get(`/v1/iam/${args.face_id}/tags`);
|
|
83
|
+
currentTags = tagResp.tags ?? [];
|
|
84
|
+
}
|
|
85
|
+
catch { /* proceed without tags */ }
|
|
81
86
|
const face = data;
|
|
82
87
|
if (Array.isArray(face.warnings) && face.warnings.length > 0) {
|
|
83
88
|
for (const w of face.warnings)
|
|
84
89
|
this.warn(w);
|
|
85
90
|
}
|
|
86
|
-
|
|
87
|
-
if (currentTags)
|
|
88
|
-
face.tags = currentTags;
|
|
91
|
+
face.tags = currentTags;
|
|
89
92
|
// Rename basic_facts → attributes
|
|
90
93
|
renameFaceFields(face);
|
|
91
94
|
// Write to local catalog
|
package/oclif.manifest.json
CHANGED