Skip to content

VAPI-2755 Update documentation and models for various API endpoints#104

Open
smoghe-bw wants to merge 17 commits intomainfrom
brtc-sdks
Open

VAPI-2755 Update documentation and models for various API endpoints#104
smoghe-bw wants to merge 17 commits intomainfrom
brtc-sdks

Conversation

@smoghe-bw
Copy link

  • Modified LookupResult.md to correct field names and descriptions.
  • Updated MachineDetectionConfiguration.md to improve clarity in descriptions.
  • Revised MessageRequest.md for consistency in formatting.
  • Added new Page.md documentation for pagination support.
  • Adjusted RbmOpenUrlEnum.md and RbmWebViewEnum.md for better readability.
  • Introduced new SipConnectionMetadata.md and SipCredentials.md models.
  • Enhanced StatusCallback.md to clarify the carrierName field description.
  • Created new models for endpoint management including CreateEndpointRequestBase, CreateEndpointResponse, and related types.
  • Added device-related models including Device, DeviceStatusEnum, and Endpoint management types.
  • Implemented error handling models such as ErrorResponse and updated InboundCallback types.
  • Added list-endpoints response model for better API response handling.

- Modified LookupResult.md to correct field names and descriptions.
- Updated MachineDetectionConfiguration.md to improve clarity in descriptions.
- Revised MessageRequest.md for consistency in formatting.
- Added new Page.md documentation for pagination support.
- Adjusted RbmOpenUrlEnum.md and RbmWebViewEnum.md for better readability.
- Introduced new SipConnectionMetadata.md and SipCredentials.md models.
- Enhanced StatusCallback.md to clarify the carrierName field description.
- Created new models for endpoint management including CreateEndpointRequestBase, CreateEndpointResponse, and related types.
- Added device-related models including Device, DeviceStatusEnum, and Endpoint management types.
- Implemented error handling models such as ErrorResponse and updated InboundCallback types.
- Added list-endpoints response model for better API response handling.
@bwappsec
Copy link

bwappsec commented Feb 18, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@smoghe-bw smoghe-bw changed the title Update documentation and models for various API endpoints VAPI-2755 Update documentation and models for various API endpoints Feb 19, 2026
@smoghe-bw smoghe-bw marked this pull request as ready for review February 19, 2026 16:16
@smoghe-bw smoghe-bw requested review from a team as code owners February 19, 2026 16:16
import { Link } from '../../../models/link';
import { ModelError } from '../../../models/model-error';

describe('CreateEndpointResponse', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

i like the fact that its trying to create these tests, but I think if we're going to do that, we should fully test the model in 1 test, aka, we can have one test where it fills our every possible field in the model and runs assertions for all of that, essentially combining what's going on in the 2 tests here

Comment on lines +7 to +10
expect(Object.values(DeviceStatusEnum)).toEqual([
'CONNECTED',
'DISCONNECTED'
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

tbh we should probably add this to all of the other enum tests to catch when they're updated, nice

expect(device.deviceId).toBe('dev-1234');
expect(device.deviceName).toBe('Mobile App');
expect(device.status).toBe(DeviceStatusEnum.Connected);
expect(new Date(device.creationTimestamp).toString()).not.toBe('Invalid Date');
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like there's probably a better way to test this, can we make sure the date it makes matches like the year or time we expect instead?

test('should define the expected values', () => {
expect(EndpointDirectionEnum.Inbound).toBe('INBOUND');
expect(EndpointDirectionEnum.Outbound).toBe('OUTBOUND');
expect(EndpointDirectionEnum.Bidirectional).toBe('BIDIRECTIONAL');
Copy link
Contributor

Choose a reason for hiding this comment

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

can add that values assertion i called out earlier

describe('EndpointEventTypeEnum', () => {
test('should define the expected values', () => {
expect(EndpointEventTypeEnum.DeviceConnected).toBe('DEVICE_CONNECTED');
expect(EndpointEventTypeEnum.DeviceDisconnected).toBe('DEVICE_DISCONNECTED');
Copy link
Contributor

Choose a reason for hiding this comment

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

values test here and for the rest of the enum tests

expect(data.errors).toBeInstanceOf(Array);
expect(data.errors).toHaveLength(0);
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

where is the delete endpoint test?

Comment on lines +64 to +73
test('should list endpoints filtered by type', async () => {
const { status, data } = await endpointsApi.listEndpoints(BW_ACCOUNT_ID, EndpointTypeEnum.Webrtc);

expect(status).toEqual(200);
expect(data.data).toBeInstanceOf(Array);
expect(data.errors).toBeInstanceOf(Array);
if (data.data.length > 0) {
expect(data.data.every((item) => item.type === EndpointTypeEnum.Webrtc)).toEqual(true);
}
});
Copy link
Contributor

Choose a reason for hiding this comment

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

can remove

endpointId = data.data.endpointId;
});

test('should list endpoints for the account', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
test('should list endpoints for the account', async () => {
test('should list endpoints, async () => {

let endpointId: string;

describe('endpoint lifecycle', () => {
test('should create a new endpoint', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
test('should create a new endpoint', async () => {
test('should create endpoint', async () => {

}
});

test('should retrieve details of a specific endpoint', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
test('should retrieve details of a specific endpoint', async () => {
test('should get endpoint', async () => {

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