#2608
fix(versions): list valid --type values and name the missing resource in links errors
Summary
asc versions links failed for most installs because the --type errors never said what the accepted values were, and a 404 said nothing about which resource was missing.
- Both
--typeusage errors now enumerate the ten accepted relationship types:Error: --type is required; must be one of: ...andError: --type "nope" is not a valid relationship type; must be one of: ...(exit 2, stderr, no prompts). - Flag help marks
--typerequired and keeps the same value list;--version-idnow says it takes an App Store version ID, not an app ID. - A 404 names the resource: an unknown version ID reports
app store version "X" was not found; --version-id expects an App Store version ID, not an app ID (list them with: asc versions list --app "APP_ID"), a 404 whose detail names the relationship reports that relationship as missing, and a 404 from a--next/automatic pagination request is attributed to the page URL rather than to--version-id. Any other 404 keeps Apple's message. The original*asc.APIErrorstays in the chain, so the not-found exit code, HTTP status, and telemetry classification are unchanged.
No default for --type
--type stays required. Telemetry never records flag values (internal/telemetry/event.go, and commands/telemetry.mdx promises sanitized flag names only), so there is no evidence that one relationship type dominates usage. The ten types also split across to-one and to-many semantics with different --limit/--next/--paginate rules, so a silent default would fetch a resource the caller did not ask for.
Verification
- Live read-only probes against the disposable app confirmed the 404 shapes: an unknown version ID returns
There is no resource of type 'appStoreVersions' with id '...', while unconfigured to-one relationships return 200 with null data (so a 404 is almost always a wrong version ID). - New cmdtests cover the missing-
--typeand invalid---typevalue lists, the version-not-found message, a relationship-named 404, an unclassified 404 keeping Apple's message, and the--nextattribution; the existing versions diagnostics table was updated. - Gates:
make generate-command-docs(no change todocs/COMMANDS.md),make build,make format,make check-docs,make lint,ASC_BYPASS_KEYCHAIN=1 make testall pass.codex exec reviewis clean on both--uncommittedand--base origin/main.
Closes #2596
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you.