Skip to content

feat: add respondent attributes to SignInFieldAttributes - #120

Merged
bheddens merged 3 commits into
masterfrom
feat/sign-in-field-respondent-attributes
Aug 31, 2026
Merged

bheddens merged 3 commits into
masterfrom
feat/sign-in-field-respondent-attributes

Conversation

@bheddens

@bheddens bheddens commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds two attributes to SignInFieldAttributes:

'allow-visitor-respondents'?: boolean;
'allow-employee-respondents'?: boolean;

These back the Field options → Respondents controls in the dashboard. Both are writable on the v3 sign-in-fields resource (app/resources/api/v3/sign_in_field_resource.rb declares them, and only created_at/updated_at are readonly there), and both default to true in the database:

sign_in_fields.allow_visitor_respondents   boolean DEFAULT true NOT NULL
sign_in_fields.allow_employee_respondents  boolean DEFAULT true NOT NULL

Why

An integration that creates a sign-in field holding a value only an admin can supply, a badge or card number read off the credential, has no way to say so through this type. Because the columns default to true, the field is silently offered to visitors and to employees, neither of whom can know the number.

pacs-integration-service #327 fixes that for the Card ID field, but has to cast past this interface to do it:

export const CARD_ID_RESPONDENT_DEFAULTS = {
  'allow-visitor-respondents': false,
  'allow-employee-respondents': false,
} as Partial<EnvoySignInFieldConfig>;

With this merged and released, that cast comes out.

Optional, not required

Marked optional to match 'store-response'?: boolean, even though the columns are NOT NULL and a read always returns them. Required would be a breaking change for anyone building an attributes literal, and it buys nothing: the internal SDK's creation model already makes everything except name and kind partial, so optionality here does not weaken creation payloads.

Verification

tsc --noEmit, eslint, and prettier clean. Test suite green: 5 suites, 72 tests. Type-only change, so no new tests.

Version bumped to 2.5.3 in package.json and package-lock.json, matching how #115 handled a comparable additive change to the payload types (2.5.1 -> 2.5.2). Publishing itself still happens on release creation, so this only stages the version.

`allow-visitor-respondents` and `allow-employee-respondents` back the Field
options -> Respondents controls in the dashboard. Both are writable on the v3
sign-in-fields resource and both default to true server-side, so a field created
without them is offered to visitors and to employees.

Optional rather than required, matching `store-response`, so this cannot break
an existing consumer.

Needed so integrations can create an admin-only field (a badge or card number
read off the credential) without casting past this type.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds respondent-scoping attributes to the Node SDK’s SignInFieldAttributes type so integrations can control whether visitors and/or employees are allowed to answer a sign-in field, matching the v3 API and database defaults.

Changes:

  • Extend SignInFieldAttributes with 'allow-visitor-respondents'?: boolean and 'allow-employee-respondents'?: boolean.
  • Add inline JSDoc explaining semantics and server-side default behavior for these new attributes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/resources/SignInFieldResource.ts Outdated
Addresses review on #120. The hyphens mean the TS property name is
'allow-visitor-respondents', so the unquoted form in the doc was not the actual
key and would not copy/paste.
@bheddens
bheddens requested a review from a team August 28, 2026 21:09
@ryanflynndev

Copy link
Copy Markdown
Contributor

Please update the version

@bheddens
bheddens merged commit f4ff21c into master Aug 31, 2026
4 checks passed
@bheddens
bheddens deleted the feat/sign-in-field-respondent-attributes branch August 31, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants