feat(contact-properties): implement contact-properties namespace#1
Merged
Conversation
Adds create, get, list, update, delete subcommands under `resend contact-properties`. Registered in src/cli.ts. SDK field is `key` (not `name`); types are `string|number` only; update only accepts fallbackValue — cannot rename or retype after creation. Separate --clear-fallback-value flag handles null-setting. 33 tests across 5 files; all 288 suite tests passing.
'braille' is already the default in createSpinner — passing it explicitly across 19 command files was pure noise.
After the if(error){outputError(...)} guard, data is always non-null.
Using data! multiple times in a block is noisy — extract const d/list = data!
and reference it cleanly. Also drops the redundant 'braille' spinner arg
from these files.
Affected: domains/get, domains/create, domains/list, broadcasts/list,
contacts/list, contacts/segments, contacts/topics, api-keys/create, api-keys/list.
cf28557 to
df9f6b3
Compare
dielduarte
added a commit
that referenced
this pull request
Jun 25, 2026
Felipe review (#1): getJwtExp cast the decoded payload without guards, so a malformed access token would throw a cryptic error or store NaN/undefined as the expiry, leaving the credential in an inconsistent state. Validate segment count, JSON payload, and numeric exp, throwing a clear re-login message.
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
resend contact-propertiestop-level command with five subcommands:create,get,list,update,deletekeynotname; allowed types arestring|numberonly;updateonly acceptsfallbackValue(cannot rename or retype after creation)'braille'default arg from everycreateSpinnercall (34 files) and extracts repeateddata!dereferences to named locals in list/get commandscreate.ts:p.selecttakes one type argument, not twoCLAUDE.mdwith learned conventions and SDK gotchasTest Plan
bun test— 288 tests across 42 files, all passingbun run build— compiles todist/resendwith no type errorsbunx tsc --noEmit— zero TypeScript errorsresend contact-properties --help— shows all subcommands with full help textresend contact-properties create --key company_name --type string --json— creates a property, returns{"object":"contact_property","id":"..."}resend contact-properties list --json— returns{"object":"list","has_more":false,"data":[...]}resend contact-properties update <id> --fallback-value "Acme" --json— returns{"object":"contact_property","id":"..."}resend contact-properties update <id> --clear-fallback-value --json— sets fallback to nullresend contact-properties delete <id> --yes --json— returns{"object":"contact_property","id":"...","deleted":true}--keyor--typein a pipe exits with code 1 and{"error":{"code":"missing_key"}}/{"error":{"code":"missing_type"}}Notes
updateintentionally exposes only--fallback-value/--clear-fallback-value. The SDK'sUpdateContactPropertyOptionsdoes not support renaming or retyping a property — the spec doc was incorrect on this point. Renaming would silently break any broadcasts referencing the old key name.