faces-cli 1.4.1 → 1.4.2
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/commands/face/upload.d.ts +2 -0
- package/dist/commands/face/upload.js +15 -2
- package/oclif.manifest.json +693 -674
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@ export default class FaceUpload extends BaseCommand {
|
|
|
4
4
|
static flags: {
|
|
5
5
|
file: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
kind: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
perspective: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'face-speaker': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
9
|
'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
10
|
token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
11
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -13,6 +13,14 @@ export default class FaceUpload extends BaseCommand {
|
|
|
13
13
|
options: ['document', 'thread'],
|
|
14
14
|
default: 'document',
|
|
15
15
|
}),
|
|
16
|
+
perspective: Flags.string({
|
|
17
|
+
description: 'Perspective (document only)',
|
|
18
|
+
options: ['first-person', 'third-person'],
|
|
19
|
+
default: 'third-person',
|
|
20
|
+
}),
|
|
21
|
+
'face-speaker': Flags.string({
|
|
22
|
+
description: 'Speaker name to map to the face (thread only). If omitted, first speaker is used.',
|
|
23
|
+
}),
|
|
16
24
|
};
|
|
17
25
|
static args = {
|
|
18
26
|
face_id: Args.string({ description: 'Face ID or username', required: true }),
|
|
@@ -26,10 +34,15 @@ export default class FaceUpload extends BaseCommand {
|
|
|
26
34
|
const fileBlob = new Blob([fs.readFileSync(flags.file)], { type: 'application/octet-stream' });
|
|
27
35
|
const form = new FormData();
|
|
28
36
|
form.append('file', fileBlob, filename);
|
|
29
|
-
|
|
37
|
+
// type, perspective, face_speaker are query params (not form fields)
|
|
38
|
+
const params = new URLSearchParams();
|
|
39
|
+
params.set('type', flags.kind);
|
|
40
|
+
params.set('perspective', flags.perspective);
|
|
41
|
+
if (flags['face-speaker'])
|
|
42
|
+
params.set('face_speaker', flags['face-speaker']);
|
|
30
43
|
let data;
|
|
31
44
|
try {
|
|
32
|
-
data = await client.postForm(`/v1/faces/${args.face_id}/upload`, form);
|
|
45
|
+
data = await client.postForm(`/v1/faces/${args.face_id}/upload?${params}`, form);
|
|
33
46
|
}
|
|
34
47
|
catch (err) {
|
|
35
48
|
if (err instanceof FacesAPIError)
|