feat: add lists create command#2
Open
12ian34 wants to merge 3 commits into
Open
Conversation
Adds the `attio lists create` subcommand which calls POST /v2/lists. Options: --name (required) Human-readable list name --parent-object (required) Object slug/ID for records in the list --api-slug Override auto-generated snake_case slug --workspace-access Access level for all members (default: full-access) --member-access Grant per-member access (repeatable, member-id:level) Includes 4 new tests covering the request body, custom slug, member access parsing, and the existing list command. Co-authored-by: Cursor <cursoragent@cursor.com>
Fixes 80x-djh#3. Lists with only system attributes (no custom writable attributes) caused `entries create` and `entries assert` to fail with "No values provided" before any API call was made. The root cause was `requireValues()` rejecting an empty values object. For entries, `--record` and `--object` are the only truly required inputs — the API accepts `entry_values: {}`. Removed the `requireValues` gate from `entries create` and `entries assert` while keeping it for `entries update` where values are always needed. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
attio lists createsubcommand that callsPOST /v2/liststo create new lists--name,--parent-object(required), plus optional--api-slug,--workspace-access, and repeatable--member-accessflagsapi_slugfrom the name in snake_case when not explicitly providedentries createandentries assertto proceed with emptyentry_valueswhen the list has no custom writable attributesUsage
Test plan
lists createintests/lists.test.tstests/entries-empty-values.test.tsnpm test)npm run build)