Skip to content

TransferPlan.sipVerb typed as Record<string, unknown> instead of string enum ("refer" | "bye" | "dial") #42

@CampbellBrett

Description

@CampbellBrett

Package: @vapi-ai/server-sdk
Affected versions: v0.11.0, v1.2.0 (and likely others)
File: dist/cjs/api/types/TransferPlan.d.ts

Description

The field TransferPlan.sipVerb is typed as Record<string, unknown>, but its own JSDoc comment describes it as accepting one of three string literals: "refer", "bye", or "dial". These types are mutually exclusive — a string is not assignable to Record<string, unknown> — so the field cannot be set without an unsafe cast.

Current generated type

/**
 * This specifies the SIP verb to use while transferring the call.
 * - 'refer': Uses SIP REFER to transfer the call (default)
 * - 'bye': Ends current call with SIP BYE
 * - 'dial': Uses SIP DIAL to transfer the call
 */
sipVerb?: Record<string, unknown>;

Expected type

sipVerb?: "refer" | "bye" | "dial";

Issue

import type { Vapi } from "@vapi-ai/server-sdk";

const plan: Vapi.TransferPlan = {
  mode: "blind-transfer",
  sipVerb: "dial", // ❌ Type 'string' is not assignable to type 'Record<string, unknown>'
};

Workaround

sipVerb: "dial" as unknown as Record<string, unknown>,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions