crisp-im / crisp-im/node-crisp-api

Website operator response type uses userID but REST API returns user_id

Open Beginner friendly
#76 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
112
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Summary

The WebsiteOperator TypeScript type does not match the payload returned by the Crisp REST API for listWebsiteOperators.

Environment

  • crisp-api: 10.10.6
  • Endpoint: GET /v1/website/{website_id}/operators/list

Actual REST response

{
  "type": "operator",
  "details": {
    "user_id": "operator-user-id",
    "email": "operator@example.com"
  }
}

This also matches the official REST API documentation, which documents details.user_id.

Current type

export interface WebsiteOperator {
  userID?: string;
  email?: string;
}

Impact

listWebsiteOperators() is typed as returning WebsiteOperatorListOne[], so TypeScript consumers read details.userID, but the runtime value is undefined. The SDK request implementation returns response.body.data without converting snake_case keys.

Expected behavior

Please either:

  1. change the affected operator response types to use the REST field name user_id; or
  2. explicitly transform the API response to camelCase before returning it, and document that behavior.

The current declaration should not claim userID unless the SDK performs that transformation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WebsiteOperator and related operator response types, then inspect listWebsiteOperators where response.body.data is returned. Confirm the REST payload uses details.user_id and choose whether the declarations should expose that field or the SDK should document and perform a camelCase transformation. Done means the type and runtime value agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.