Skip to content

Commit a1f2283

Browse files
committed
refactor: use --artist for account ID, remove slug references
1 parent 5448d3a commit a1f2283

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

__tests__/commands/content.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ describe("content command", () => {
4242
it("validates an artist", async () => {
4343
vi.mocked(get).mockResolvedValue({
4444
status: "success",
45-
artist_slug: "gatsby-grace",
45+
artist_account_id: "550e8400-e29b-41d4-a716-446655440000",
4646
ready: true,
4747
missing: [],
4848
});
4949

50-
await contentCommand.parseAsync(["validate", "--artist", "gatsby-grace"], { from: "user" });
50+
await contentCommand.parseAsync(["validate", "--artist", "550e8400-e29b-41d4-a716-446655440000"], { from: "user" });
5151

5252
expect(get).toHaveBeenCalledWith("/api/content/validate", {
53-
artist_slug: "gatsby-grace",
53+
artist_account_id: "550e8400-e29b-41d4-a716-446655440000",
5454
});
55-
expect(logSpy).toHaveBeenCalledWith("Artist: gatsby-grace");
55+
expect(logSpy).toHaveBeenCalledWith("Ready: yes");
5656
});
5757

5858
it("estimates content cost", async () => {
@@ -79,12 +79,12 @@ describe("content command", () => {
7979
});
8080

8181
await contentCommand.parseAsync(
82-
["create", "--artist", "gatsby-grace", "--template", "artist-caption-bedroom"],
82+
["create", "--artist", "550e8400-e29b-41d4-a716-446655440000", "--template", "artist-caption-bedroom"],
8383
{ from: "user" },
8484
);
8585

8686
expect(post).toHaveBeenCalledWith("/api/content/create", {
87-
artist_slug: "gatsby-grace",
87+
artist_account_id: "550e8400-e29b-41d4-a716-446655440000",
8888
template: "artist-caption-bedroom",
8989
lipsync: false,
9090
caption_length: "short",
@@ -106,7 +106,7 @@ describe("content command", () => {
106106
);
107107

108108
expect(post).toHaveBeenCalledWith("/api/content/create", {
109-
artist_slug: "test-artist",
109+
artist_account_id: "test-artist",
110110
template: "artist-caption-bedroom",
111111
lipsync: false,
112112
caption_length: "long",

src/commands/content.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,19 @@ const templatesCommand = new Command("templates")
3232

3333
const validateCommand = new Command("validate")
3434
.description("Validate whether an artist is ready for content creation")
35-
.requiredOption("--artist <slug>", "Artist slug")
35+
.requiredOption("--artist <id>", "Artist account ID")
3636
.option("--json", "Output as JSON")
3737
.action(async opts => {
3838
try {
3939
const data = await get("/api/content/validate", {
40-
artist_slug: opts.artist,
40+
artist_account_id: opts.artist,
4141
});
4242

4343
if (opts.json) {
4444
printJson(data);
4545
return;
4646
}
4747

48-
console.log(`Artist: ${data.artist_slug}`);
4948
console.log(`Ready: ${data.ready ? "yes" : "no"}`);
5049
if (Array.isArray(data.missing) && data.missing.length > 0) {
5150
console.log("Missing:");
@@ -86,7 +85,7 @@ const estimateCommand = new Command("estimate")
8685

8786
const createCommand = new Command("create")
8887
.description("Trigger content creation pipeline")
89-
.requiredOption("--artist <slug>", "Artist slug")
88+
.requiredOption("--artist <id>", "Artist account ID")
9089
.option("--template <name>", "Template name", "artist-caption-bedroom")
9190
.option("--lipsync", "Enable lipsync mode")
9291
.option("--caption-length <length>", "Caption length: short, medium, long", "short")
@@ -96,7 +95,7 @@ const createCommand = new Command("create")
9695
.action(async opts => {
9796
try {
9897
const data = await post("/api/content/create", {
99-
artist_slug: opts.artist,
98+
artist_account_id: opts.artist,
10099
template: opts.template,
101100
lipsync: !!opts.lipsync,
102101
caption_length: opts.captionLength,

0 commit comments

Comments
 (0)