@koda-sl/baker-cli 0.4.1 → 0.5.0
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/README.md +92 -2
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/videos/delete.d.ts +19 -0
- package/dist/commands/videos/delete.d.ts.map +1 -0
- package/dist/commands/videos/delete.js +58 -0
- package/dist/commands/videos/delete.js.map +1 -0
- package/dist/commands/videos/get.d.ts +30 -0
- package/dist/commands/videos/get.d.ts.map +1 -0
- package/dist/commands/videos/get.js +42 -0
- package/dist/commands/videos/get.js.map +1 -0
- package/dist/commands/videos/index.d.ts +2 -0
- package/dist/commands/videos/index.d.ts.map +1 -0
- package/dist/commands/videos/index.js +25 -0
- package/dist/commands/videos/index.js.map +1 -0
- package/dist/commands/videos/search.d.ts +35 -0
- package/dist/commands/videos/search.d.ts.map +1 -0
- package/dist/commands/videos/search.js +54 -0
- package/dist/commands/videos/search.js.map +1 -0
- package/dist/commands/videos/upload.d.ts +19 -0
- package/dist/commands/videos/upload.d.ts.map +1 -0
- package/dist/commands/videos/upload.js +92 -0
- package/dist/commands/videos/upload.js.map +1 -0
- package/dist/output.d.ts +3 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +36 -7
- package/dist/output.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @koda-sl/baker-cli
|
|
2
2
|
|
|
3
|
-
AI-agent-first CLI for interacting with Baker. Designed for programmatic use by AI agents with structured JSON output, schema introspection, and input hardening.
|
|
3
|
+
AI-agent-first CLI for interacting with Baker. Designed for programmatic use by AI agents with structured JSON output, schema introspection, and input hardening. Supports images and videos.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -157,6 +157,87 @@ baker images delete j571abc123def
|
|
|
157
157
|
| `--image-id` | Image ID (alternative to positional arg) |
|
|
158
158
|
| `--dry-run` | Preview the operation without executing |
|
|
159
159
|
|
|
160
|
+
### `baker videos search <query>`
|
|
161
|
+
|
|
162
|
+
Semantic search videos using hybrid BM25 + vector + reranking.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Basic search
|
|
166
|
+
baker videos search "product demo"
|
|
167
|
+
|
|
168
|
+
# Filter by tags and limit results
|
|
169
|
+
baker videos search "tutorial" --tags explainer,ugc --limit 5
|
|
170
|
+
|
|
171
|
+
# Full metadata with markdown output
|
|
172
|
+
baker videos search "testimonial" --full --output md
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Flags:**
|
|
176
|
+
|
|
177
|
+
| Flag | Description |
|
|
178
|
+
|------------|------------------------------------------|
|
|
179
|
+
| `--limit` | Max results (default 20) |
|
|
180
|
+
| `--tags` | Comma-separated tags to filter by |
|
|
181
|
+
| `--output` | Output format: `json` \| `files` \| `md` |
|
|
182
|
+
| `--fields` | Comma-separated field names to include |
|
|
183
|
+
| `--full` | Include full metadata |
|
|
184
|
+
|
|
185
|
+
### `baker videos get <id>`
|
|
186
|
+
|
|
187
|
+
Get a single video by ID.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
baker videos get j571abc123def
|
|
191
|
+
|
|
192
|
+
# With full metadata
|
|
193
|
+
baker videos get j571abc123def --full
|
|
194
|
+
|
|
195
|
+
# Alternative flag syntax
|
|
196
|
+
baker videos get --video-id j571abc123def
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### `baker videos upload <file>`
|
|
200
|
+
|
|
201
|
+
Upload a video file via Mux direct upload. Content type is auto-detected from the file extension.
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Upload with auto-detected content type
|
|
205
|
+
baker videos upload ./demo.mp4
|
|
206
|
+
|
|
207
|
+
# Override content type
|
|
208
|
+
baker videos upload ./video.bin --content-type video/mp4
|
|
209
|
+
|
|
210
|
+
# Preview what would happen without uploading
|
|
211
|
+
baker videos upload ./demo.mp4 --dry-run
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Flags:**
|
|
215
|
+
|
|
216
|
+
| Flag | Description |
|
|
217
|
+
|------------------|------------------------------------------------|
|
|
218
|
+
| `--content-type` | MIME type (auto-detected from extension) |
|
|
219
|
+
| `--dry-run` | Preview the operation without executing |
|
|
220
|
+
|
|
221
|
+
Supported extensions: `.mp4`, `.mov`, `.webm`, `.avi`, `.mkv`
|
|
222
|
+
|
|
223
|
+
### `baker videos delete <id>`
|
|
224
|
+
|
|
225
|
+
Delete a video by ID.
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Preview deletion
|
|
229
|
+
baker videos delete j571abc123def --dry-run
|
|
230
|
+
|
|
231
|
+
# Execute deletion
|
|
232
|
+
baker videos delete j571abc123def
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Flags:**
|
|
236
|
+
|
|
237
|
+
| Flag | Description |
|
|
238
|
+
|-------------|------------------------------------------|
|
|
239
|
+
| `--dry-run` | Preview the operation without executing |
|
|
240
|
+
|
|
160
241
|
### `baker schema [command]`
|
|
161
242
|
|
|
162
243
|
Inspect command argument schemas for AI agent introspection.
|
|
@@ -173,13 +254,22 @@ baker schema images.search
|
|
|
173
254
|
|
|
174
255
|
## Compact vs Full Output
|
|
175
256
|
|
|
176
|
-
By default,
|
|
257
|
+
By default, responses include only essential fields to minimize token usage:
|
|
258
|
+
|
|
259
|
+
**Images:**
|
|
177
260
|
|
|
178
261
|
| Mode | Fields |
|
|
179
262
|
|-----------|------------------------------------------------------------|
|
|
180
263
|
| Default | `_id`, `name`, `imageUrl`, `description`, `tags` |
|
|
181
264
|
| `--full` | All fields: width, height, aspectRatio, dominantColor, imagePalette, source, createdAt |
|
|
182
265
|
|
|
266
|
+
**Videos:**
|
|
267
|
+
|
|
268
|
+
| Mode | Fields |
|
|
269
|
+
|-----------|-------------------------------------------|
|
|
270
|
+
| Default | `_id`, `name`, `thumbnailUrl`, `description`, `tags`, `status` |
|
|
271
|
+
| `--full` | All fields: duration, muxPlaybackId, source, timestamps |
|
|
272
|
+
|
|
183
273
|
## Error Codes
|
|
184
274
|
|
|
185
275
|
| Code | Description |
|
package/dist/cli.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { defineCommand, runMain } from "citty";
|
|
3
3
|
import { imagesCommand } from "./commands/images/index.js";
|
|
4
4
|
import { schemaCommand } from "./commands/schema.js";
|
|
5
|
+
import { videosCommand } from "./commands/videos/index.js";
|
|
5
6
|
const main = defineCommand({
|
|
6
7
|
meta: {
|
|
7
8
|
name: "baker",
|
|
8
|
-
version: "0.
|
|
9
|
-
description: `AI-agent CLI for finding and managing images in Baker.
|
|
9
|
+
version: "0.5.0",
|
|
10
|
+
description: `AI-agent CLI for finding and managing images and videos in Baker.
|
|
10
11
|
|
|
11
12
|
Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
|
|
12
13
|
Output: All commands return JSON envelopes: { ok: true, data: ... } or { ok: false, error: { code, message } }.
|
|
@@ -15,6 +16,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`,
|
|
|
15
16
|
},
|
|
16
17
|
subCommands: {
|
|
17
18
|
images: imagesCommand,
|
|
19
|
+
videos: videosCommand,
|
|
18
20
|
schema: schemaCommand,
|
|
19
21
|
},
|
|
20
22
|
});
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,IAAI,GAAG,aAAa,CAAC;IACzB,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE;;;;;yEAKwD;KACtE;IACD,WAAW,EAAE;QACX,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;KACtB;CACF,CAAC,CAAC;AAEH,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const deleteCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Video ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "video-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Video ID (alternative to positional)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly "dry-run": {
|
|
13
|
+
readonly type: "boolean";
|
|
14
|
+
readonly description: "Preview without executing";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
readonly default: false;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/commands/videos/delete.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;EAyCxB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { ApiError, apiPost, validateConvexId } from "../../client.js";
|
|
3
|
+
import { writeJson } from "../../output.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
registerSchema({
|
|
6
|
+
command: "videos.delete",
|
|
7
|
+
description: "Delete a video by ID",
|
|
8
|
+
args: {
|
|
9
|
+
id: { type: "string", description: "Video ID", required: true },
|
|
10
|
+
"dry-run": {
|
|
11
|
+
type: "boolean",
|
|
12
|
+
description: "Preview the operation without executing",
|
|
13
|
+
required: false,
|
|
14
|
+
default: false,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
export const deleteCommand = defineCommand({
|
|
19
|
+
meta: {
|
|
20
|
+
name: "delete",
|
|
21
|
+
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run",
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
id: { type: "positional", description: "Video ID", required: false },
|
|
25
|
+
"video-id": { type: "string", description: "Video ID (alternative to positional)", required: false },
|
|
26
|
+
"dry-run": { type: "boolean", description: "Preview without executing", required: false, default: false },
|
|
27
|
+
},
|
|
28
|
+
run: async ({ args }) => {
|
|
29
|
+
try {
|
|
30
|
+
const id = args.id || args["video-id"];
|
|
31
|
+
if (!id) {
|
|
32
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Video ID is required" } });
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
validateConvexId(id);
|
|
36
|
+
if (args["dry-run"]) {
|
|
37
|
+
writeJson({
|
|
38
|
+
ok: true,
|
|
39
|
+
dryRun: true,
|
|
40
|
+
operation: "videos.delete",
|
|
41
|
+
params: { id },
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const data = await apiPost("/api/videos/delete", { id });
|
|
46
|
+
writeJson({ ok: true, data });
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
if (err instanceof ApiError) {
|
|
50
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/videos/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,CAAC;IACb,OAAO,EAAE,eAAe;IACxB,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/D,SAAS,EAAE;YACT,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mGAAmG;KACjH;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE;QACpE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE,QAAQ,EAAE,KAAK,EAAE;QACpG,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,2BAA2B,EAA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AAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const getCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly id: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Video ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "video-id": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Video ID (alternative to positional)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly output: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Output format: json|files|md";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
readonly default: "json";
|
|
17
|
+
};
|
|
18
|
+
readonly fields: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "Comma-separated field names to include";
|
|
21
|
+
readonly required: false;
|
|
22
|
+
};
|
|
23
|
+
readonly full: {
|
|
24
|
+
readonly type: "boolean";
|
|
25
|
+
readonly description: "Include full metadata";
|
|
26
|
+
readonly required: false;
|
|
27
|
+
readonly default: false;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../src/commands/videos/get.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCrB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { ApiError, apiGet, validateConvexId } from "../../client.js";
|
|
3
|
+
import { videoNormalizer, writeJson, writeOutput } from "../../output.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
registerSchema({
|
|
6
|
+
command: "videos.get",
|
|
7
|
+
description: "Get a single video by ID",
|
|
8
|
+
args: {
|
|
9
|
+
id: { type: "string", description: "Video ID", required: true },
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
export const getCommand = defineCommand({
|
|
13
|
+
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
14
|
+
args: {
|
|
15
|
+
id: { type: "positional", description: "Video ID", required: false },
|
|
16
|
+
"video-id": { type: "string", description: "Video ID (alternative to positional)", required: false },
|
|
17
|
+
output: { type: "string", description: "Output format: json|files|md", required: false, default: "json" },
|
|
18
|
+
fields: { type: "string", description: "Comma-separated field names to include", required: false },
|
|
19
|
+
full: { type: "boolean", description: "Include full metadata", required: false, default: false },
|
|
20
|
+
},
|
|
21
|
+
run: async ({ args }) => {
|
|
22
|
+
try {
|
|
23
|
+
const id = args.id || args["video-id"];
|
|
24
|
+
if (!id) {
|
|
25
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Video ID is required" } });
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
validateConvexId(id);
|
|
29
|
+
const data = await apiGet("/api/videos/get", { id });
|
|
30
|
+
writeOutput({ ok: true, data }, args.output || "json", args.fields ? args.fields.split(",") : undefined, args.full, videoNormalizer);
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
if (err instanceof ApiError) {
|
|
34
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../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C;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/videos/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,qDAkBxB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { deleteCommand } from "./delete.js";
|
|
3
|
+
import { getCommand } from "./get.js";
|
|
4
|
+
import { searchCommand } from "./search.js";
|
|
5
|
+
import { uploadCommand } from "./upload.js";
|
|
6
|
+
export const videosCommand = defineCommand({
|
|
7
|
+
meta: {
|
|
8
|
+
name: "videos",
|
|
9
|
+
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete.
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
baker videos search "product demo" --limit 5
|
|
13
|
+
baker videos search "tutorial" --tags explainer
|
|
14
|
+
baker videos get <video-id>
|
|
15
|
+
baker videos upload ./demo.mp4
|
|
16
|
+
baker videos delete <video-id> --dry-run`,
|
|
17
|
+
},
|
|
18
|
+
subCommands: {
|
|
19
|
+
get: getCommand,
|
|
20
|
+
search: searchCommand,
|
|
21
|
+
upload: uploadCommand,
|
|
22
|
+
delete: deleteCommand,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/videos/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;;;;;;;2CAO0B;KACxC;IACD,WAAW,EAAE;QACX,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;KACtB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const searchCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly query: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Search query text";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly limit: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "Max results (default 20)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly tags: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Comma-separated tags to filter by";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
readonly output: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly description: "Output format: json|files|md";
|
|
20
|
+
readonly required: false;
|
|
21
|
+
readonly default: "json";
|
|
22
|
+
};
|
|
23
|
+
readonly fields: {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly description: "Comma-separated field names to include";
|
|
26
|
+
readonly required: false;
|
|
27
|
+
};
|
|
28
|
+
readonly full: {
|
|
29
|
+
readonly type: "boolean";
|
|
30
|
+
readonly description: "Include full metadata";
|
|
31
|
+
readonly required: false;
|
|
32
|
+
readonly default: false;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/commands/videos/search.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CxB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { ApiError, apiPost } from "../../client.js";
|
|
3
|
+
import { videoNormalizer, writeJson, writeOutput } from "../../output.js";
|
|
4
|
+
import { registerSchema } from "../../schemas.js";
|
|
5
|
+
registerSchema({
|
|
6
|
+
command: "videos.search",
|
|
7
|
+
description: "Search videos by text query. Only returns ready videos.",
|
|
8
|
+
args: {
|
|
9
|
+
query: { type: "string", description: "Search query text", required: true },
|
|
10
|
+
limit: { type: "number", description: "Maximum results to return", required: false, default: 20 },
|
|
11
|
+
tags: { type: "string", description: "Comma-separated tags to filter by", required: false },
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const searchCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "search",
|
|
17
|
+
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial",
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
query: { type: "positional", description: "Search query text", required: false },
|
|
21
|
+
limit: { type: "string", description: "Max results (default 20)", required: false },
|
|
22
|
+
tags: { type: "string", description: "Comma-separated tags to filter by", required: false },
|
|
23
|
+
output: { type: "string", description: "Output format: json|files|md", required: false, default: "json" },
|
|
24
|
+
fields: { type: "string", description: "Comma-separated field names to include", required: false },
|
|
25
|
+
full: { type: "boolean", description: "Include full metadata", required: false, default: false },
|
|
26
|
+
},
|
|
27
|
+
run: async ({ args }) => {
|
|
28
|
+
try {
|
|
29
|
+
const query = args.query;
|
|
30
|
+
if (!query) {
|
|
31
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "Search query is required" } });
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
const body = { query };
|
|
35
|
+
if (args.limit) {
|
|
36
|
+
body.limit = Number(args.limit);
|
|
37
|
+
}
|
|
38
|
+
if (args.tags) {
|
|
39
|
+
body.tags = args.tags.split(",").filter(Boolean);
|
|
40
|
+
}
|
|
41
|
+
const data = await apiPost("/api/videos/search", body);
|
|
42
|
+
writeOutput({ ok: true, data }, args.output || "json", args.fields ? args.fields.split(",") : undefined, args.full, videoNormalizer);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
if (err instanceof ApiError) {
|
|
46
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/videos/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAqB,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,cAAc,CAAC;IACb,OAAO,EAAE,eAAe;IACxB,WAAW,EAAE,yDAAyD;IACtE,IAAI,EAAE;QACJ,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3E,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;QACjG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC5F;CAC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file: {
|
|
3
|
+
readonly type: "positional";
|
|
4
|
+
readonly description: "Path to the video file";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "content-type": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "MIME type (auto-detected if omitted)";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly "dry-run": {
|
|
13
|
+
readonly type: "boolean";
|
|
14
|
+
readonly description: "Preview without executing";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
readonly default: false;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/commands/videos/upload.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;EA4DxB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { extname } from "node:path";
|
|
3
|
+
import { defineCommand } from "citty";
|
|
4
|
+
import { ApiError, apiPost } from "../../client.js";
|
|
5
|
+
import { writeJson } from "../../output.js";
|
|
6
|
+
import { registerSchema } from "../../schemas.js";
|
|
7
|
+
const MIME_MAP = {
|
|
8
|
+
".mp4": "video/mp4",
|
|
9
|
+
".mov": "video/quicktime",
|
|
10
|
+
".webm": "video/webm",
|
|
11
|
+
".avi": "video/x-msvideo",
|
|
12
|
+
".mkv": "video/x-matroska",
|
|
13
|
+
};
|
|
14
|
+
registerSchema({
|
|
15
|
+
command: "videos.upload",
|
|
16
|
+
description: "Upload a video file to Baker (via Mux direct upload)",
|
|
17
|
+
args: {
|
|
18
|
+
file: { type: "string", description: "Path to the video file", required: true },
|
|
19
|
+
"content-type": {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "MIME type (auto-detected from extension if omitted)",
|
|
22
|
+
required: false,
|
|
23
|
+
},
|
|
24
|
+
"dry-run": {
|
|
25
|
+
type: "boolean",
|
|
26
|
+
description: "Preview the operation without executing",
|
|
27
|
+
required: false,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
function detectContentType(filePath) {
|
|
33
|
+
const ext = extname(filePath).toLowerCase();
|
|
34
|
+
const mime = MIME_MAP[ext];
|
|
35
|
+
if (!mime) {
|
|
36
|
+
throw new ApiError("VALIDATION_ERROR", `Cannot detect content type for extension "${ext}". Use --content-type.`);
|
|
37
|
+
}
|
|
38
|
+
return mime;
|
|
39
|
+
}
|
|
40
|
+
export const uploadCommand = defineCommand({
|
|
41
|
+
meta: {
|
|
42
|
+
name: "upload",
|
|
43
|
+
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4",
|
|
44
|
+
},
|
|
45
|
+
args: {
|
|
46
|
+
file: { type: "positional", description: "Path to the video file", required: false },
|
|
47
|
+
"content-type": { type: "string", description: "MIME type (auto-detected if omitted)", required: false },
|
|
48
|
+
"dry-run": { type: "boolean", description: "Preview without executing", required: false, default: false },
|
|
49
|
+
},
|
|
50
|
+
run: async ({ args }) => {
|
|
51
|
+
try {
|
|
52
|
+
const filePath = args.file;
|
|
53
|
+
if (!filePath) {
|
|
54
|
+
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message: "File path is required" } });
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
const contentType = args["content-type"] || detectContentType(filePath);
|
|
58
|
+
if (args["dry-run"]) {
|
|
59
|
+
const fileStats = await stat(filePath);
|
|
60
|
+
writeJson({
|
|
61
|
+
ok: true,
|
|
62
|
+
dryRun: true,
|
|
63
|
+
operation: "videos.upload",
|
|
64
|
+
params: { file: filePath, contentType, sizeBytes: fileStats.size },
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
// Step 1: Get a Mux direct upload URL from backend
|
|
69
|
+
const { uploadUrl, videoId } = await apiPost("/api/videos/upload", {});
|
|
70
|
+
// Step 2: PUT the file directly to Mux
|
|
71
|
+
const fileBuffer = await readFile(filePath);
|
|
72
|
+
const uploadResponse = await fetch(uploadUrl, {
|
|
73
|
+
method: "PUT",
|
|
74
|
+
headers: { "Content-Type": contentType },
|
|
75
|
+
body: fileBuffer,
|
|
76
|
+
});
|
|
77
|
+
if (!uploadResponse.ok) {
|
|
78
|
+
throw new ApiError("INTERNAL_ERROR", `Mux upload failed: HTTP ${uploadResponse.status} ${uploadResponse.statusText}`);
|
|
79
|
+
}
|
|
80
|
+
writeJson({ ok: true, data: { videoId } });
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
if (err instanceof ApiError) {
|
|
84
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=upload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../src/commands/videos/upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,QAAQ,GAA2B;IACvC,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,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AI,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC;gBACvB,MAAM,IAAI,QAAQ,CAChB,gBAAgB,EAChB,2BAA2B,cAAc,CAAC,MAAM,IAAI,cAAc,CAAC,UAAU,EAAE,CAChF,CAAC;YACJ,CAAC;YAED,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBAC1E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
package/dist/output.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ interface DryRunEnvelope {
|
|
|
22
22
|
params: Record<string, unknown>;
|
|
23
23
|
}
|
|
24
24
|
type Envelope<T> = SuccessEnvelope<T> | ErrorEnvelope | DryRunEnvelope;
|
|
25
|
+
type Normalizer = (record: Record<string, unknown>, full: boolean) => Record<string, unknown>;
|
|
25
26
|
export declare function formatAspectRatio(ratio: number | undefined): string | null;
|
|
26
27
|
interface ImageCompact {
|
|
27
28
|
_id: string;
|
|
@@ -32,8 +33,9 @@ interface ImageCompact {
|
|
|
32
33
|
}
|
|
33
34
|
export declare function compactImage(image: Record<string, unknown>): ImageCompact;
|
|
34
35
|
export declare function fullImage(image: Record<string, unknown>): Record<string, unknown>;
|
|
36
|
+
export declare function videoNormalizer(record: Record<string, unknown>, full: boolean): Record<string, unknown>;
|
|
35
37
|
export declare function applyFieldMask<T extends Record<string, unknown>>(data: T, fields: string[]): Partial<T>;
|
|
36
38
|
export declare function writeJson<T>(envelope: Envelope<T>): void;
|
|
37
|
-
export declare function writeOutput<T>(envelope: Envelope<T>, format: OutputFormat, fields?: string[], full?: boolean): void;
|
|
39
|
+
export declare function writeOutput<T>(envelope: Envelope<T>, format: OutputFormat, fields?: string[], full?: boolean, normalizer?: Normalizer): void;
|
|
38
40
|
export {};
|
|
39
41
|
//# sourceMappingURL=output.d.ts.map
|
package/dist/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAEnD,UAAU,eAAe,CAAC,CAAC;IACzB,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/D;AAED,UAAU,aAAa;IACrB,EAAE,EAAE,KAAK,CAAC;IACV,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C;AAED,UAAU,cAAc;IACtB,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,KAAK,QAAQ,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG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B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,CAQzE;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYjF;AAwCD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKvG;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAQvG;AAMD,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAExD;AAyCD,wBAAgB,WAAW,CAAC,CAAC,EAC3B,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,MAAM,EAAE,YAAY,EACpB,MAAM,CAAC,EAAE,MAAM,EAAE,EACjB,IAAI,CAAC,EAAE,OAAO,EACd,UAAU,CAAC,EAAE,UAAU,GACtB,IAAI,CAuBN"}
|
package/dist/output.js
CHANGED
|
@@ -44,6 +44,38 @@ export function fullImage(image) {
|
|
|
44
44
|
createdAt: image.createdAt ?? null,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
function imageNormalizer(record, full) {
|
|
48
|
+
if (full) {
|
|
49
|
+
return fullImage(record);
|
|
50
|
+
}
|
|
51
|
+
return compactImage(record);
|
|
52
|
+
}
|
|
53
|
+
function compactVideo(video) {
|
|
54
|
+
return {
|
|
55
|
+
_id: String(video._id ?? ""),
|
|
56
|
+
name: String(video.name ?? ""),
|
|
57
|
+
thumbnailUrl: String(video.thumbnailUrl ?? ""),
|
|
58
|
+
description: String(video.description ?? ""),
|
|
59
|
+
tags: Array.isArray(video.tags) ? video.tags : [],
|
|
60
|
+
status: String(video.status ?? ""),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function fullVideo(video) {
|
|
64
|
+
const compact = compactVideo(video);
|
|
65
|
+
return {
|
|
66
|
+
...compact,
|
|
67
|
+
duration: video.duration ?? null,
|
|
68
|
+
muxPlaybackId: String(video.muxPlaybackId ?? ""),
|
|
69
|
+
source: String(video.source ?? ""),
|
|
70
|
+
createdAt: video.createdAt ?? null,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export function videoNormalizer(record, full) {
|
|
74
|
+
if (full) {
|
|
75
|
+
return fullVideo(record);
|
|
76
|
+
}
|
|
77
|
+
return compactVideo(record);
|
|
78
|
+
}
|
|
47
79
|
export function applyFieldMask(data, fields) {
|
|
48
80
|
const result = {};
|
|
49
81
|
for (const field of fields) {
|
|
@@ -78,21 +110,18 @@ function writeMd(data, fields) {
|
|
|
78
110
|
write(`| ${values.join(" | ")} |\n`);
|
|
79
111
|
}
|
|
80
112
|
}
|
|
81
|
-
function normalizeData(envelope, fields, full) {
|
|
113
|
+
function normalizeData(envelope, fields, full, normalizer) {
|
|
82
114
|
const raw = Array.isArray(envelope.data) ? envelope.data : [envelope.data];
|
|
83
115
|
const items = raw.map((item) => {
|
|
84
116
|
const record = item;
|
|
85
|
-
|
|
86
|
-
return fullImage(record);
|
|
87
|
-
}
|
|
88
|
-
return compactImage(record);
|
|
117
|
+
return normalizer(record, full);
|
|
89
118
|
});
|
|
90
119
|
if (fields) {
|
|
91
120
|
return items.map((item) => applyFieldMask(item, fields));
|
|
92
121
|
}
|
|
93
122
|
return items;
|
|
94
123
|
}
|
|
95
|
-
export function writeOutput(envelope, format, fields, full) {
|
|
124
|
+
export function writeOutput(envelope, format, fields, full, normalizer) {
|
|
96
125
|
// Errors and dry runs always output JSON
|
|
97
126
|
if (!envelope.ok || "dryRun" in envelope) {
|
|
98
127
|
writeJson(envelope);
|
|
@@ -102,7 +131,7 @@ export function writeOutput(envelope, format, fields, full) {
|
|
|
102
131
|
writeJson(envelope);
|
|
103
132
|
return;
|
|
104
133
|
}
|
|
105
|
-
const items = normalizeData(envelope, fields, full ?? false);
|
|
134
|
+
const items = normalizeData(envelope, fields, full ?? false, normalizer ?? imageNormalizer);
|
|
106
135
|
const displayFields = fields ?? Object.keys(items[0] ?? {});
|
|
107
136
|
if (format === "files") {
|
|
108
137
|
writeFiles(items, displayFields);
|
package/dist/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAwBA,MAAM,gBAAgB,GAA2B;IAC/C,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE,GAAG,CAAC;IACd,MAAM,EAAE,CAAC,GAAG,EAAE;IACd,KAAK,EAAE,CAAC,GAAG,CAAC;IACZ,KAAK,EAAE,CAAC,GAAG,CAAC;IACZ,KAAK,EAAE,CAAC,GAAG,CAAC;IACZ,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC,GAAG,CAAC;IACZ,KAAK,EAAE,CAAC,GAAG,CAAC;IACZ,KAAK,EAAE,CAAC,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,MAAM,UAAU,iBAAiB,CAAC,KAAyB;IACzD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9D,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,sB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