|
| 1 | +/* [name, argv, expectedMethod, expectedPath, expectOk] */ |
| 2 | +module.exports = [ |
| 3 | + ["whoami", ["whoami"], "GET", "/api/accounts/id", true], |
| 4 | + ["accounts get", ["accounts", "get", "--account", "acc_test"], "GET", "/api/accounts/acc_test", true], |
| 5 | + ["accounts credits", ["accounts", "credits", "--account", "acc_test"], "GET", "/api/accounts/acc_test/credits", true], |
| 6 | + ["accounts subscription", ["accounts", "subscription", "--account", "acc_test"], "GET", "/api/accounts/acc_test/subscription", true], |
| 7 | + ["accounts update", ["accounts", "update", "--name", "New"], "PATCH", "/api/accounts", true], |
| 8 | + ["artists list", ["artists", "list"], "GET", "/api/artists", true], |
| 9 | + ["artists create", ["artists", "create", "--name", "Daft Punk"], "POST", "/api/artists", true], |
| 10 | + ["artists update", ["artists", "update", "a1", "--label", "Columbia", "--pinned"], "PATCH", "/api/artists/a1", true], |
| 11 | + ["artists delete", ["artists", "delete", "a1"], "DELETE", "/api/artists/a1", true], |
| 12 | + ["artists fans", ["artists", "fans", "a1", "--limit", "5"], "GET", "/api/artists/a1/fans", true], |
| 13 | + ["artists scrape", ["artists", "scrape", "--artist", "a1"], "POST", "/api/artist/socials/scrape", true], |
| 14 | + ["chats list", ["chats", "list", "--artist", "a1"], "GET", "/api/chats", true], |
| 15 | + ["chats create", ["chats", "create", "--name", "T"], "POST", "/api/chats", true], |
| 16 | + ["chats update", ["chats", "update", "--chat", "c1", "--topic", "New topic"], "PATCH", "/api/chats", true], |
| 17 | + ["chats delete", ["chats", "delete", "--chat", "c1"], "DELETE", "/api/chats", true], |
| 18 | + ["chats messages", ["chats", "messages", "--chat", "c1"], "GET", "/api/chats/c1/messages", true], |
| 19 | + ["chats artist", ["chats", "artist", "--chat", "c1"], "GET", "/api/chats/c1/artist", true], |
| 20 | + ["chats compact", ["chats", "compact", "--chat", "c1", "--chat", "c2"], "POST", "/api/chats/compact", true], |
| 21 | + ["generate", ["generate", "--prompt", "hi", "--artist", "a1"], "POST", "/api/chat/generate", true], |
| 22 | + ["tasks list", ["tasks", "list"], "GET", "/api/tasks", true], |
| 23 | + ["tasks create", ["tasks", "create", "--title", "Daily", "--prompt", "x", "--schedule", "0 9 * * *", "--artist", "a1"], "POST", "/api/tasks", true], |
| 24 | + ["tasks update", ["tasks", "update", "--id", "t1", "--enabled", "false"], "PATCH", "/api/tasks", true], |
| 25 | + ["tasks delete", ["tasks", "delete", "--id", "t1"], "DELETE", "/api/tasks", true], |
| 26 | + ["tasks runs", ["tasks", "runs", "--limit", "5"], "GET", "/api/tasks/runs", true], |
| 27 | + ["tasks status", ["tasks", "status", "--run", "run_1"], "GET", "/api/tasks/runs", true], |
| 28 | + ["pulses list", ["pulses", "list"], "GET", "/api/pulses", true], |
| 29 | + ["pulses set", ["pulses", "set", "--active", "true"], "PATCH", "/api/pulses", true], |
| 30 | + ["connectors list", ["connectors", "list"], "GET", "/api/connectors", true], |
| 31 | + ["connectors connect", ["connectors", "connect", "--connector", "googlesheets"], "POST", "/api/connectors", true], |
| 32 | + ["connectors actions", ["connectors", "actions"], "GET", "/api/connectors/actions", true], |
| 33 | + ["connectors run", ["connectors", "run", "--action", "GMAIL_FETCH_EMAILS", "--params", '{"max_results":1}'], "POST", "/api/connectors/actions", true], |
| 34 | + ["connectors disconnect", ["connectors", "disconnect", "--id", "ca1"], "DELETE", "/api/connectors", true], |
| 35 | + ["research search", ["research", "search", "--q", "Daft Punk", "--type", "artists"], "GET", "/api/research", true], |
| 36 | + ["research profile", ["research", "profile", "--artist", "Daft Punk"], "GET", "/api/research/profile", true], |
| 37 | + ["research audience", ["research", "audience", "--artist", "x"], "GET", "/api/research/audience", true], |
| 38 | + ["research metrics", ["research", "metrics", "--artist", "x", "--source", "spotify"], "GET", "/api/research/metrics", true], |
| 39 | + ["research similar", ["research", "similar", "--artist", "x", "--genre", "high"], "GET", "/api/research/similar", true], |
| 40 | + ["research deep", ["research", "deep", "--query", "q"], "POST", "/api/research/deep", true], |
| 41 | + ["research web", ["research", "web", "--query", "news", "--max-results", "5"], "POST", "/api/research/web", true], |
| 42 | + ["research enrich", ["research", "enrich", "--input", "https://x", "--schema", '{"type":"object"}'], "POST", "/api/research/enrich", true], |
| 43 | + ["research extract", ["research", "extract", "--url", "https://x"], "POST", "/api/research/extract", true], |
| 44 | + ["research track-stats", ["research", "track-stats", "--isrc", "US1", "--source", "spotify"], "GET", "/api/research/track/stats", true], |
| 45 | + ["research track-measurements", ["research", "track-measurements", "--track", "tk1", "--window", "30d"], "GET", "/api/research/tracks/tk1/measurements", true], |
| 46 | + ["research snapshots", ["research", "snapshots", "--isrcs", "US1,US2"], "POST", "/api/research/snapshots", true], |
| 47 | + ["spotify search", ["spotify", "search", "--q", "x", "--type", "artist"], "GET", "/api/spotify/search", true], |
| 48 | + ["spotify top-tracks", ["spotify", "top-tracks", "--id", "z", "--market", "US"], "GET", "/api/spotify/artist/topTracks", true], |
| 49 | + ["spotify album", ["spotify", "album", "--id", "al1"], "GET", "/api/spotify/album", true], |
| 50 | + ["songs list", ["songs", "list", "--artist", "a1"], "GET", "/api/songs", true], |
| 51 | + ["songs presets", ["songs", "presets"], "GET", "/api/songs/analyze/presets", true], |
| 52 | + ["catalogs create", ["catalogs", "create", "--name", "2024"], "POST", "/api/catalogs", true], |
| 53 | + ["catalogs songs", ["catalogs", "songs", "--catalog", "cat1"], "GET", "/api/catalogs/songs", true], |
| 54 | + ["catalogs add-songs", ["catalogs", "add-songs", "--catalog", "cat1", "--songs", '[{"isrc":"US1"}]'], "POST", "/api/catalogs/songs", true], |
| 55 | + ["catalogs remove-songs", ["catalogs", "remove-songs", "--catalog", "cat1", "--isrc", "US1"], "DELETE", "/api/catalogs/songs", true], |
| 56 | + ["models list", ["models", "list"], "GET", "/api/ai/models", true], |
| 57 | + ["orgs list", ["orgs", "list"], "GET", "/api/organizations", true], |
| 58 | + ["orgs create", ["orgs", "create", "--name", "Label", "--account", "acc_test"], "POST", "/api/organizations", true], |
| 59 | + ["orgs add-artist", ["orgs", "add-artist", "--artist", "a1", "--org", "o1"], "POST", "/api/organizations/artists", true], |
| 60 | + ["workspaces create", ["workspaces", "create", "--name", "Q1"], "POST", "/api/workspaces", true], |
| 61 | + ["templates list", ["templates", "list"], "GET", "/api/agents/templates", true], |
| 62 | + ["templates create", ["templates", "create", "--title", "Recap", "--description", "Weekly recap of streams", "--prompt", "Produce a weekly streaming recap report", "--tags", "a,b"], "POST", "/api/agents/templates", true], |
| 63 | + ["templates favorite", ["templates", "favorite", "tpl1"], "PUT", "/api/agents/templates/tpl1/favorite", true], |
| 64 | + ["templates delete", ["templates", "delete", "tpl1"], "DELETE", "/api/agents/templates/tpl1", true], |
| 65 | + ["sessions create", ["sessions", "create", "--title", "Build"], "POST", "/api/sessions", true], |
| 66 | + ["sessions get", ["sessions", "get", "s1"], "GET", "/api/sessions/s1", true], |
| 67 | + ["sessions update", ["sessions", "update", "s1", "--status", "completed"], "PATCH", "/api/sessions/s1", true], |
| 68 | + ["sandboxes list", ["sandboxes", "list"], "GET", "/api/sandboxes", true], |
| 69 | + ["sandboxes file", ["sandboxes", "file", "--path", "README.md"], "GET", "/api/sandboxes/file", true], |
| 70 | + ["sandboxes setup", ["sandboxes", "setup"], "POST", "/api/sandboxes/setup", true], |
| 71 | + ["content templates", ["content", "templates"], "GET", "/api/content/templates", true], |
| 72 | + ["content template", ["content", "template", "tpl"], "GET", "/api/content/templates/tpl", true], |
| 73 | + ["content caption", ["content", "caption", "--topic", "tour"], "POST", "/api/content/caption", true], |
| 74 | + ["content image", ["content", "image", "--prompt", "art", "--num", "2"], "POST", "/api/content/image", true], |
| 75 | + ["content transcribe", ["content", "transcribe", "--audio", "https://a.mp3"], "POST", "/api/content/transcribe", true], |
| 76 | + ["content edit", ["content", "edit", "--video", "https://v.mp4", "--template", "cut"], "PATCH", "/api/content", true], |
| 77 | + ["notifications", ["notifications", "--subject", "Hi", "--text", "Body"], "POST", "/api/notifications", true], |
| 78 | + // Fast-fail validation cases (must exit non-zero with Error:, no network call) |
| 79 | + ["ERR generate no prompt", ["generate"], null, null, false], |
| 80 | + ["ERR track-stats no id", ["research", "track-stats", "--source", "spotify"], null, null, false], |
| 81 | + ["ERR accounts update empty", ["accounts", "update"], null, null, false], |
| 82 | + ["ERR catalogs create empty", ["catalogs", "create"], null, null, false], |
| 83 | + ["ERR tasks create missing req", ["tasks", "create", "--title", "x"], null, null, false], |
| 84 | + ["ERR research lookup no args", ["research", "lookup"], null, null, false], |
| 85 | + ["ERR research snapshots no scope", ["research", "snapshots"], null, null, false], |
| 86 | +]; |
0 commit comments