crisp-im / crisp-im/node-crisp-api
Website operator response type uses userID but REST API returns user_id
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:
- change the affected operator response types to use the REST field name
user_id; or - 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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