Skip to content

VAPI-3165 Add Refer BXML verb support - #118

Open
s-aher wants to merge 12 commits into
mainfrom
VAPI-3165
Open

VAPI-3165 Add Refer BXML verb support#118
s-aher wants to merge 12 commits into
mainfrom
VAPI-3165

Conversation

@s-aher

@s-aher s-aher commented May 25, 2026

Copy link
Copy Markdown

Adds the <Refer> BXML verb.

  • models/bxml/verbs/Refer.ts: new Refer verb (referCompleteUrl, referCompleteMethod, tag attributes, one required SipUri child).
  • Reuses the existing SipUri type for the child element instead of a separate ReferSipUri - no runtime validation restricting which SipUri attributes are legal per verb (matches csharp-sdk#201, which dropped this as over-engineering).
  • ReferCompleteCallback model is out of scope here - lands separately once VAPI-3440 merges. Deleted the orphaned generated models/refer-call-status.ts/docs/ReferCallStatus.md and the corresponding bandwidth.yml schemas, which had no remaining consumer once that callback work was descoped.
  • common.ts: fixed a pre-existing TS2527 build error (unrelated to Refer, also present on main) that was failing npm run build on every CI matrix job - annotated createRequestFunction's return type to avoid emitting an axios-internal type that isn't portable to a .d.ts.
  • Tests in tests/unit/models/bxml/verbs/Refer.test.ts.

Tests: npm run build and npx jest - full suite passes (257/257 test files).

VAPI-3439

@bwappsec

bwappsec commented May 25, 2026

Copy link
Copy Markdown

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.

@s-aher
s-aher marked this pull request as ready for review June 22, 2026 07:08
@s-aher
s-aher requested review from a team as code owners June 22, 2026 07:08

@stampercasey stampercasey 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.

Review from Claude Code — see inline comments for individual findings. One blocker (regen job); the verb implementation is otherwise sound.

Regen job has not runmodels/refer-complete-callback.ts is absent and bandwidth.yml was not updated. The PR description lists this as a follow-up pending api-specs#2142, which has now merged (June 12). The regen needs to run and ReferCompleteCallback + the four scenario tests need to land before this is ready to merge.

Comment thread models/bxml/verbs/Refer.ts Outdated
Comment thread models/bxml/verbs/Refer.ts
Comment thread models/bxml/verbs/Refer.ts
Comment thread tests/unit/models/bxml/verbs/Refer.test.ts Outdated
stampercasey
stampercasey previously approved these changes Jun 23, 2026
s-aher and others added 2 commits June 24, 2026 12:55
… in Refer

ReferCompleteCallback will land later via a separate api-specs-driven PR
once VAPI-3440 merges. Refer now takes the existing Transfer-flavored
SipUri instead of a duplicate ReferSipUri type, matching the reviewed
csharp-sdk reference implementation (no runtime validation, no builder
bloat).
models/refer-call-status.ts had no consumer once ReferSipUri/ReferCompleteCallback
were removed from this PR's scope. bandwidth.yml still carried the full
referCompleteCallback/referCallStatus/referSipResponseCode/notifySipResponseCode
schemas and a referComplete addition to the shared eventType enum description.
Also cleaned up the corresponding .openapi-generator/FILES entries.
…return type

tsc (with declaration:true) failed on common.ts:110 - 'The inferred type of
createRequestFunction references an inaccessible unique symbol type' -
because axios 1.19's request<T,R>() return type involves an internal
branded type not portable to a .d.ts. This broke npm run build (invoked
via yarn's prepare hook) on every OS/Node matrix job in CI, on main as
well as this PR. Annotating the returned function's return type as
Promise<R> sidesteps emitting the unexported internal type.
Comment thread common.ts
Comment on lines -111 to +113
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
return function <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> {
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs);
return axios.request<T, R>(axiosRequestArgs) as Promise<R>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix for CI error unrelated to PR change. Actions aren't required so can remove this if wanted

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