faces-cli 1.6.3 → 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
- const tagResp = await client.put(`/v1/iam/${args.face_id}/tags`, { body: { tags: flags.tag } });
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
- // Add tags to response if we set them
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
@@ -5780,5 +5780,5 @@
5780
5780
  ]
5781
5781
  }
5782
5782
  },
5783
- "version": "1.6.3"
5783
+ "version": "1.6.5"
5784
5784
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "faces-cli",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "description": "CLI for the Faces AI platform",
5
5
  "type": "module",
6
6
  "author": "sybileak <sybileak@proton.me>",