Skip to content

[api-sync] Align the Node.js client with the public API - #22

Merged
twindebank merged 3 commits into
mainfrom
api-sync/full-93c928210899
Nov 27, 2026
Merged

twindebank merged 3 commits into
mainfrom
api-sync/full-93c928210899

Conversation

@twindebank

@twindebank twindebank commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Syncs @gradientlabs/client with the current public API, version 3e9c6fa0a27454d8d5300c42e4215c475c3954b085dae9901f429d0c531e50f3 (recorded in PUBLIC_API_VERSION). Replaces #13, which this PR carries in full.

Breaking changes (0.x, so a minor bump)

  • Removed StartConversationParams.metadata. The API has no such field and ignored it.

  • Fields the API can omit are now optional in the response types: Note.body/url, Procedure.max_daily_conversations, Topic.Description/ParentExternalID/PublicURL, Attachment.url, AgentMetadata.*, Conversation.latest_intent/latest_handoff_target, Attribute.description/is_root, Schema.raw, SourceConfig.cache. Code that reads them as always present needs a check.

  • HandOffTarget has a new required ref.

  • Conversation.status, FinishConversationParams.reason_code and TrafficGroupTarget.target_type are now typed (ConversationStatus, ConversationFinishReasonCode, TrafficGroupTargetType). They are open unions, so any string still compiles.

  • Tool creation accepts HTTP, webhook, async or draft settings on a branch. The server assigns the tool ID. Resource requests arrive as action.execute events.

  • Article and topic upserts accept their documented optional fields. An internal note requires a body. Arbitrary JSON values are supported in memory, task and tool payloads.

  • Procedure reads omit the author. Add-message responses omit the subject and conversation token. Use the timeout setting to configure secret refresh requests.

  • A conversation’s intent and hand-off details are available when reading it after creation.

Added

  • client.customers: listMemories, batchCreateMemoriesV2 and the deprecated batchCreateMemories (from [api-sync 2026-07-22] gradientlabs-nodejs: sync to OpenAPI spec #13). custom_type is required on the deprecated call, as the API requires ([api-sync 2026-07-22] gradientlabs-nodejs: sync to OpenAPI spec #13 had it optional).
  • client.files: beginUpload, create, list, listAll.
  • client.knowledgeBases: list, create, get, update.
  • client.notes.list, listAll, get, plus attributes and knowledge_base_ids on notes.
  • The conversation.start webhook event.
  • Fields: knowledge_base_ids on articles, ref on hand-off target upsert, live_handoff_url on voice call context, retry on HTTP tool definitions, transfer_mode on tool parameters, branch_id/branch_name on tool, resource source and resource type creation, managed on resource sources.
  • Enum values: kustomer, salesforce_contact_email, salesforce_supplied_email, and the json and attachment parameter types.
  • examples/customers, and a conversation.start webhook case in examples/webhooks.

How it was checked

  • Compared every operation, request and response field, enum and webhook payload with the API reference.
  • test/operations.test.ts holds a hand-kept map from each implemented API operation id to its method and fails if a method is missing. GET /spec.json is not exposed.
  • New tests for each new method and for the conversation.start payload.
  • npm ci && npm run build && npm test && npm run lint all pass, as do typecheck and prettier --check.

Version

0.1.3 to 0.2.0, in its own commit (package.json, lockfile, User-Agent constant, CHANGELOG). No tag is created.

Adds customer memories, files, knowledge bases, notes list and read, and the conversation.start webhook. Brings model fields and enums in line with the API, and adds an operation-list test.
@twindebank twindebank changed the title [api-sync full] gradientlabs-nodejs: sync to the public API contract [api-sync] Align the Node.js client with the public API Nov 27, 2026
@twindebank
twindebank marked this pull request as ready for review November 27, 2026 11:21
@twindebank
twindebank requested review from a team as code owners November 27, 2026 11:21
@twindebank
twindebank merged commit 0cdd30d into main Nov 27, 2026
2 checks passed
@twindebank
twindebank deleted the api-sync/full-93c928210899 branch November 27, 2026 11:27
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.

2 participants