@dialgem/sdk 0.1.0-beta.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/index.cjs +16 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -2
- package/dist/index.d.ts +65 -2
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -733,6 +733,18 @@ interface components {
|
|
|
733
733
|
call_summary?: components["schemas"]["BuiltinAnalysisField"] | null;
|
|
734
734
|
user_sentiment?: components["schemas"]["BuiltinAnalysisField"] | null;
|
|
735
735
|
};
|
|
736
|
+
/** BuyNumberRequest */
|
|
737
|
+
BuyNumberRequest: {
|
|
738
|
+
/** Nickname */
|
|
739
|
+
nickname?: string | null;
|
|
740
|
+
/** Phone Number */
|
|
741
|
+
phone_number: string;
|
|
742
|
+
/**
|
|
743
|
+
* Type
|
|
744
|
+
* @default local
|
|
745
|
+
*/
|
|
746
|
+
type?: string;
|
|
747
|
+
};
|
|
736
748
|
/** CallPatch */
|
|
737
749
|
CallPatch: {
|
|
738
750
|
/** Amd Result */
|
|
@@ -743,6 +755,8 @@ interface components {
|
|
|
743
755
|
call_sid?: string | null;
|
|
744
756
|
/** Disconnection Reason */
|
|
745
757
|
disconnection_reason?: string | null;
|
|
758
|
+
/** Disconnection Reason Default */
|
|
759
|
+
disconnection_reason_default?: string | null;
|
|
746
760
|
/** Duration S */
|
|
747
761
|
duration_s?: number | null;
|
|
748
762
|
/** Ended At */
|
|
@@ -2281,6 +2295,20 @@ type MCPServerUpdateParams = RequestBody<Schemas$5["MCPServerUpdate"]>;
|
|
|
2281
2295
|
type PhoneNumberCreateParams = RequestBody<Schemas$5["PhoneNumberCreate"]>;
|
|
2282
2296
|
type PhoneNumberUpdateParams = RequestBody<Schemas$5["PhoneNumberUpdate"]>;
|
|
2283
2297
|
type PhoneNumberAssignParams = RequestBody<Schemas$5["PhoneNumberAssign"]>;
|
|
2298
|
+
type PhoneNumberBuyParams = RequestBody<Schemas$5["BuyNumberRequest"]>;
|
|
2299
|
+
/** Filters for `phoneNumbers.search`. */
|
|
2300
|
+
interface PhoneNumberSearchParams {
|
|
2301
|
+
/** Two-letter country code. Default `"US"`. */
|
|
2302
|
+
country?: string;
|
|
2303
|
+
/** `"local"` (default) or `"toll_free"`. */
|
|
2304
|
+
type?: string;
|
|
2305
|
+
/** Three digits. Local numbers only. */
|
|
2306
|
+
area_code?: string;
|
|
2307
|
+
/** Digits (and `*`) the number must contain. */
|
|
2308
|
+
contains?: string;
|
|
2309
|
+
/** 1 to 50. Default 20. */
|
|
2310
|
+
limit?: number;
|
|
2311
|
+
}
|
|
2284
2312
|
/**
|
|
2285
2313
|
* `from_`, with the trailing underscore, is the wire name (`from` is a Python
|
|
2286
2314
|
* keyword on the server). It must be a number registered on your organization.
|
|
@@ -3776,6 +3804,30 @@ interface PhoneNumber {
|
|
|
3776
3804
|
/** The full signing secret. Present **only** in the response that created or rotated it, never again. */
|
|
3777
3805
|
inbound_webhook_secret?: string;
|
|
3778
3806
|
}
|
|
3807
|
+
/** A number that can be bought, from `phoneNumbers.search`. */
|
|
3808
|
+
interface AvailablePhoneNumber {
|
|
3809
|
+
/** E.164. Pass it to `phoneNumbers.buy`. */
|
|
3810
|
+
phone_number: string;
|
|
3811
|
+
friendly_name: string;
|
|
3812
|
+
type: string;
|
|
3813
|
+
locality: string | null;
|
|
3814
|
+
region: string | null;
|
|
3815
|
+
country: string;
|
|
3816
|
+
voice: boolean;
|
|
3817
|
+
sms: boolean;
|
|
3818
|
+
mms: boolean;
|
|
3819
|
+
}
|
|
3820
|
+
interface AvailablePhoneNumbers {
|
|
3821
|
+
numbers: AvailablePhoneNumber[];
|
|
3822
|
+
/** The monthly rental, in 0.0001-dollar units (`monthly_price_usd * 10000`). */
|
|
3823
|
+
monthly_price_units: number;
|
|
3824
|
+
monthly_price_usd: number;
|
|
3825
|
+
}
|
|
3826
|
+
/** What `phoneNumbers.buy` returns: the new number, plus its monthly price. */
|
|
3827
|
+
type PurchasedPhoneNumber = PhoneNumber & {
|
|
3828
|
+
monthly_price_units: number;
|
|
3829
|
+
monthly_price_usd: number;
|
|
3830
|
+
};
|
|
3779
3831
|
/** What `phoneNumbers.testInboundWebhook` reports. */
|
|
3780
3832
|
interface InboundWebhookTestResult {
|
|
3781
3833
|
/** Your endpoint answered with a 2xx. */
|
|
@@ -3814,6 +3866,17 @@ interface SipOutboundTrunkConfig {
|
|
|
3814
3866
|
declare class PhoneNumbers extends APIResource {
|
|
3815
3867
|
/** Register a number you own (`phone_number` in E.164) with Dialgem. */
|
|
3816
3868
|
create(body: PhoneNumberCreateParams, options?: RequestOptions): Promise<PhoneNumber>;
|
|
3869
|
+
/**
|
|
3870
|
+
* Numbers that can be bought, with the monthly price. Throws `NotFoundError` (`number_purchase_disabled`) when the
|
|
3871
|
+
* deployment has not switched buying on.
|
|
3872
|
+
*/
|
|
3873
|
+
search(params?: PhoneNumberSearchParams, options?: RequestOptions): Promise<AvailablePhoneNumbers>;
|
|
3874
|
+
/**
|
|
3875
|
+
* Buy one of the numbers `search` returned. **Spends the organization's credit**: the first month is debited now and
|
|
3876
|
+
* the rental renews monthly until the number is released. Throws on insufficient credit, or if the carrier no longer
|
|
3877
|
+
* has the number; nothing is charged in either case.
|
|
3878
|
+
*/
|
|
3879
|
+
buy(body: PhoneNumberBuyParams, options?: RequestOptions): Promise<PurchasedPhoneNumber>;
|
|
3817
3880
|
/** Every active (not released) number in the organization, newest first. */
|
|
3818
3881
|
list(options?: RequestOptions): Promise<PhoneNumber[]>;
|
|
3819
3882
|
/**
|
|
@@ -4341,6 +4404,6 @@ declare class Dialgem {
|
|
|
4341
4404
|
constructor(options?: ClientOptions);
|
|
4342
4405
|
}
|
|
4343
4406
|
|
|
4344
|
-
declare const VERSION = "
|
|
4407
|
+
declare const VERSION = "1.0.0";
|
|
4345
4408
|
|
|
4346
|
-
export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentFunction, AgentFunctions, AgentKnowledge, AgentMCPServers, type AgentSession, type AgentSessionList, type AgentSessionReleaseResult, type AgentSessionSayParams, type AgentSessionSayResult, type AgentSessionUpdateParams, type AgentSessionUpdateResult, type AgentType, type AgentUpdateParams, type AgentVersion, type AgentVersionConfig, type AgentVersionListParams, type AgentVersionListResponse, type AgentVersionMCPServer, type AgentVersionPublishParams, type AgentVersionRef, type AgentVersionSummary, AgentVersions, type AgentWeight, Agents, ApiKey, type ApiKeyDetails, type ApiKeyInfo, AuthenticationError, BASE_URL, BadRequestError, type Call, type CallAnalysis, type CallAnalyzedEvent, type CallCost, type CallCreatePhoneCallParams, type CallDeleteResponse, type CallEndedEvent, type CallLatency, type CallListParams, type CallRegisterParams, type CallRegisterResponse, type CallSessionStatus, type CallStartedEvent, type CallStatus, type CallStopResponse, type CallUpdateParams, Calls, type Chat, type ChatAnalyzedEvent, type ChatCreateParams, type ChatDeleteResponse, type ChatEndedEvent, type ChatListParams, type ChatMessage, type ChatReply, type ChatStartedEvent, type ChatUpdateParams, Chats, type ClientOptions, ConflictError, type Contact, type ContactCallList, type ContactCallSummary, type ContactCreateParams, type ContactCsvInspection, type ContactDeleteResponse, type ContactImport, type ContactImportCreateParams, type ContactImportErrorRow, type ContactImportErrors, type ContactImportList, type ContactImportStatus, ContactImports, type ContactListCreateParams, type ContactListDeleteResponse, type ContactListMemberRemoveResponse, type ContactListMembersAddResponse, type ContactListParams, type ContactListRecord, type ContactListUpdateParams, ContactLists, type ContactUpdateParams, Contacts, DEFAULT_SIGNATURE_TOLERANCE_MS, Dialgem, DialgemError, type DisconnectionReason, type ErrorBody, type ErrorIssue, type ExtractionModel, type ExtractionModelList, ExtractionModels, type Fetch, type FetchInit, type FetchResponse, type Flow, type FlowConfig, type FlowCreateParams, type FlowDeleteResponse, type FlowListParams, type FlowTemplate, type FlowTemplateSummary, FlowTemplates, type FlowUpdateParams, Flows, type FunctionCallContext, type FunctionCallRequest, type FunctionCreateParams, type FunctionKind, type FunctionReorderParams, type FunctionUpdateParams, type HeadersLike, type InboundWebhookTestResult, InternalServerError, type KeyValuePair, type KnowledgeDocument, type KnowledgeDocumentCreateParams, type LLM, type LLMCreateParams, type LLMDeleteResponse, type LLMListParams, type LLMUpdateParams, LLMs, type LatencyStats, type MCPServer, type MCPServerCreateParams, type MCPServerTestResult, type MCPServerUpdateParams, type MCPTool, type MCPToolList, NotFoundError, Page, type PageData, PagePromise, PermissionDeniedError, type PhoneCallCreateResponse, type PhoneNumber, type PhoneNumberAgentWeight, type PhoneNumberAssignParams, type PhoneNumberCreateParams, type PhoneNumberUpdateParams, PhoneNumbers, type PostCallAnalysisVariable, type PostCallBuiltinFields, type PromptState, type PromptTemplate, type PromptTemplateSummary, PromptTemplates, RateLimitError, type RequestBody, type RequestOptions, Sessions, type SignatureHeader, type SimulationCaller, type SimulationCase, type SimulationCaseInput, type SimulationCheck, type SimulationCheckResult, type SimulationPublishGate, type SimulationResult, type SimulationResultStatus, type SimulationRun, type SimulationRunCreateParams, type SimulationRunDetail, type SimulationRunList, type SimulationRunStatus, type SimulationSuite, type SimulationSuiteCreateParams, type SimulationSuiteDetail, type SimulationSuiteList, type SimulationSuiteUpdateParams, Simulations, type SipOutboundTrunkConfig, type TemplateListParams, type TranscriptTurn, UnprocessableEntityError, VERSION, type VerifyOptions, type Voice, type VoiceCloneFile, type VoiceCloneParams, type VoiceDeleteResponse, type VoiceListParams, Voices, WEBHOOK_DELIVERY_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_PREVIOUS_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebCall, type WebCallCreateParams, type WebCallSettings, type WebCallSettingsUpdateParams, WebCalls, type WebhookEvent, type WebhookEventType, type WebhookPayload, WebhookVerificationError, Webhooks, webhooks };
|
|
4409
|
+
export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentFunction, AgentFunctions, AgentKnowledge, AgentMCPServers, type AgentSession, type AgentSessionList, type AgentSessionReleaseResult, type AgentSessionSayParams, type AgentSessionSayResult, type AgentSessionUpdateParams, type AgentSessionUpdateResult, type AgentType, type AgentUpdateParams, type AgentVersion, type AgentVersionConfig, type AgentVersionListParams, type AgentVersionListResponse, type AgentVersionMCPServer, type AgentVersionPublishParams, type AgentVersionRef, type AgentVersionSummary, AgentVersions, type AgentWeight, Agents, ApiKey, type ApiKeyDetails, type ApiKeyInfo, AuthenticationError, type AvailablePhoneNumber, type AvailablePhoneNumbers, BASE_URL, BadRequestError, type Call, type CallAnalysis, type CallAnalyzedEvent, type CallCost, type CallCreatePhoneCallParams, type CallDeleteResponse, type CallEndedEvent, type CallLatency, type CallListParams, type CallRegisterParams, type CallRegisterResponse, type CallSessionStatus, type CallStartedEvent, type CallStatus, type CallStopResponse, type CallUpdateParams, Calls, type Chat, type ChatAnalyzedEvent, type ChatCreateParams, type ChatDeleteResponse, type ChatEndedEvent, type ChatListParams, type ChatMessage, type ChatReply, type ChatStartedEvent, type ChatUpdateParams, Chats, type ClientOptions, ConflictError, type Contact, type ContactCallList, type ContactCallSummary, type ContactCreateParams, type ContactCsvInspection, type ContactDeleteResponse, type ContactImport, type ContactImportCreateParams, type ContactImportErrorRow, type ContactImportErrors, type ContactImportList, type ContactImportStatus, ContactImports, type ContactListCreateParams, type ContactListDeleteResponse, type ContactListMemberRemoveResponse, type ContactListMembersAddResponse, type ContactListParams, type ContactListRecord, type ContactListUpdateParams, ContactLists, type ContactUpdateParams, Contacts, DEFAULT_SIGNATURE_TOLERANCE_MS, Dialgem, DialgemError, type DisconnectionReason, type ErrorBody, type ErrorIssue, type ExtractionModel, type ExtractionModelList, ExtractionModels, type Fetch, type FetchInit, type FetchResponse, type Flow, type FlowConfig, type FlowCreateParams, type FlowDeleteResponse, type FlowListParams, type FlowTemplate, type FlowTemplateSummary, FlowTemplates, type FlowUpdateParams, Flows, type FunctionCallContext, type FunctionCallRequest, type FunctionCreateParams, type FunctionKind, type FunctionReorderParams, type FunctionUpdateParams, type HeadersLike, type InboundWebhookTestResult, InternalServerError, type KeyValuePair, type KnowledgeDocument, type KnowledgeDocumentCreateParams, type LLM, type LLMCreateParams, type LLMDeleteResponse, type LLMListParams, type LLMUpdateParams, LLMs, type LatencyStats, type MCPServer, type MCPServerCreateParams, type MCPServerTestResult, type MCPServerUpdateParams, type MCPTool, type MCPToolList, NotFoundError, Page, type PageData, PagePromise, PermissionDeniedError, type PhoneCallCreateResponse, type PhoneNumber, type PhoneNumberAgentWeight, type PhoneNumberAssignParams, type PhoneNumberBuyParams, type PhoneNumberCreateParams, type PhoneNumberSearchParams, type PhoneNumberUpdateParams, PhoneNumbers, type PostCallAnalysisVariable, type PostCallBuiltinFields, type PromptState, type PromptTemplate, type PromptTemplateSummary, PromptTemplates, type PurchasedPhoneNumber, RateLimitError, type RequestBody, type RequestOptions, Sessions, type SignatureHeader, type SimulationCaller, type SimulationCase, type SimulationCaseInput, type SimulationCheck, type SimulationCheckResult, type SimulationPublishGate, type SimulationResult, type SimulationResultStatus, type SimulationRun, type SimulationRunCreateParams, type SimulationRunDetail, type SimulationRunList, type SimulationRunStatus, type SimulationSuite, type SimulationSuiteCreateParams, type SimulationSuiteDetail, type SimulationSuiteList, type SimulationSuiteUpdateParams, Simulations, type SipOutboundTrunkConfig, type TemplateListParams, type TranscriptTurn, UnprocessableEntityError, VERSION, type VerifyOptions, type Voice, type VoiceCloneFile, type VoiceCloneParams, type VoiceDeleteResponse, type VoiceListParams, Voices, WEBHOOK_DELIVERY_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_PREVIOUS_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebCall, type WebCallCreateParams, type WebCallSettings, type WebCallSettingsUpdateParams, WebCalls, type WebhookEvent, type WebhookEventType, type WebhookPayload, WebhookVerificationError, Webhooks, webhooks };
|
package/dist/index.d.ts
CHANGED
|
@@ -733,6 +733,18 @@ interface components {
|
|
|
733
733
|
call_summary?: components["schemas"]["BuiltinAnalysisField"] | null;
|
|
734
734
|
user_sentiment?: components["schemas"]["BuiltinAnalysisField"] | null;
|
|
735
735
|
};
|
|
736
|
+
/** BuyNumberRequest */
|
|
737
|
+
BuyNumberRequest: {
|
|
738
|
+
/** Nickname */
|
|
739
|
+
nickname?: string | null;
|
|
740
|
+
/** Phone Number */
|
|
741
|
+
phone_number: string;
|
|
742
|
+
/**
|
|
743
|
+
* Type
|
|
744
|
+
* @default local
|
|
745
|
+
*/
|
|
746
|
+
type?: string;
|
|
747
|
+
};
|
|
736
748
|
/** CallPatch */
|
|
737
749
|
CallPatch: {
|
|
738
750
|
/** Amd Result */
|
|
@@ -743,6 +755,8 @@ interface components {
|
|
|
743
755
|
call_sid?: string | null;
|
|
744
756
|
/** Disconnection Reason */
|
|
745
757
|
disconnection_reason?: string | null;
|
|
758
|
+
/** Disconnection Reason Default */
|
|
759
|
+
disconnection_reason_default?: string | null;
|
|
746
760
|
/** Duration S */
|
|
747
761
|
duration_s?: number | null;
|
|
748
762
|
/** Ended At */
|
|
@@ -2281,6 +2295,20 @@ type MCPServerUpdateParams = RequestBody<Schemas$5["MCPServerUpdate"]>;
|
|
|
2281
2295
|
type PhoneNumberCreateParams = RequestBody<Schemas$5["PhoneNumberCreate"]>;
|
|
2282
2296
|
type PhoneNumberUpdateParams = RequestBody<Schemas$5["PhoneNumberUpdate"]>;
|
|
2283
2297
|
type PhoneNumberAssignParams = RequestBody<Schemas$5["PhoneNumberAssign"]>;
|
|
2298
|
+
type PhoneNumberBuyParams = RequestBody<Schemas$5["BuyNumberRequest"]>;
|
|
2299
|
+
/** Filters for `phoneNumbers.search`. */
|
|
2300
|
+
interface PhoneNumberSearchParams {
|
|
2301
|
+
/** Two-letter country code. Default `"US"`. */
|
|
2302
|
+
country?: string;
|
|
2303
|
+
/** `"local"` (default) or `"toll_free"`. */
|
|
2304
|
+
type?: string;
|
|
2305
|
+
/** Three digits. Local numbers only. */
|
|
2306
|
+
area_code?: string;
|
|
2307
|
+
/** Digits (and `*`) the number must contain. */
|
|
2308
|
+
contains?: string;
|
|
2309
|
+
/** 1 to 50. Default 20. */
|
|
2310
|
+
limit?: number;
|
|
2311
|
+
}
|
|
2284
2312
|
/**
|
|
2285
2313
|
* `from_`, with the trailing underscore, is the wire name (`from` is a Python
|
|
2286
2314
|
* keyword on the server). It must be a number registered on your organization.
|
|
@@ -3776,6 +3804,30 @@ interface PhoneNumber {
|
|
|
3776
3804
|
/** The full signing secret. Present **only** in the response that created or rotated it, never again. */
|
|
3777
3805
|
inbound_webhook_secret?: string;
|
|
3778
3806
|
}
|
|
3807
|
+
/** A number that can be bought, from `phoneNumbers.search`. */
|
|
3808
|
+
interface AvailablePhoneNumber {
|
|
3809
|
+
/** E.164. Pass it to `phoneNumbers.buy`. */
|
|
3810
|
+
phone_number: string;
|
|
3811
|
+
friendly_name: string;
|
|
3812
|
+
type: string;
|
|
3813
|
+
locality: string | null;
|
|
3814
|
+
region: string | null;
|
|
3815
|
+
country: string;
|
|
3816
|
+
voice: boolean;
|
|
3817
|
+
sms: boolean;
|
|
3818
|
+
mms: boolean;
|
|
3819
|
+
}
|
|
3820
|
+
interface AvailablePhoneNumbers {
|
|
3821
|
+
numbers: AvailablePhoneNumber[];
|
|
3822
|
+
/** The monthly rental, in 0.0001-dollar units (`monthly_price_usd * 10000`). */
|
|
3823
|
+
monthly_price_units: number;
|
|
3824
|
+
monthly_price_usd: number;
|
|
3825
|
+
}
|
|
3826
|
+
/** What `phoneNumbers.buy` returns: the new number, plus its monthly price. */
|
|
3827
|
+
type PurchasedPhoneNumber = PhoneNumber & {
|
|
3828
|
+
monthly_price_units: number;
|
|
3829
|
+
monthly_price_usd: number;
|
|
3830
|
+
};
|
|
3779
3831
|
/** What `phoneNumbers.testInboundWebhook` reports. */
|
|
3780
3832
|
interface InboundWebhookTestResult {
|
|
3781
3833
|
/** Your endpoint answered with a 2xx. */
|
|
@@ -3814,6 +3866,17 @@ interface SipOutboundTrunkConfig {
|
|
|
3814
3866
|
declare class PhoneNumbers extends APIResource {
|
|
3815
3867
|
/** Register a number you own (`phone_number` in E.164) with Dialgem. */
|
|
3816
3868
|
create(body: PhoneNumberCreateParams, options?: RequestOptions): Promise<PhoneNumber>;
|
|
3869
|
+
/**
|
|
3870
|
+
* Numbers that can be bought, with the monthly price. Throws `NotFoundError` (`number_purchase_disabled`) when the
|
|
3871
|
+
* deployment has not switched buying on.
|
|
3872
|
+
*/
|
|
3873
|
+
search(params?: PhoneNumberSearchParams, options?: RequestOptions): Promise<AvailablePhoneNumbers>;
|
|
3874
|
+
/**
|
|
3875
|
+
* Buy one of the numbers `search` returned. **Spends the organization's credit**: the first month is debited now and
|
|
3876
|
+
* the rental renews monthly until the number is released. Throws on insufficient credit, or if the carrier no longer
|
|
3877
|
+
* has the number; nothing is charged in either case.
|
|
3878
|
+
*/
|
|
3879
|
+
buy(body: PhoneNumberBuyParams, options?: RequestOptions): Promise<PurchasedPhoneNumber>;
|
|
3817
3880
|
/** Every active (not released) number in the organization, newest first. */
|
|
3818
3881
|
list(options?: RequestOptions): Promise<PhoneNumber[]>;
|
|
3819
3882
|
/**
|
|
@@ -4341,6 +4404,6 @@ declare class Dialgem {
|
|
|
4341
4404
|
constructor(options?: ClientOptions);
|
|
4342
4405
|
}
|
|
4343
4406
|
|
|
4344
|
-
declare const VERSION = "
|
|
4407
|
+
declare const VERSION = "1.0.0";
|
|
4345
4408
|
|
|
4346
|
-
export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentFunction, AgentFunctions, AgentKnowledge, AgentMCPServers, type AgentSession, type AgentSessionList, type AgentSessionReleaseResult, type AgentSessionSayParams, type AgentSessionSayResult, type AgentSessionUpdateParams, type AgentSessionUpdateResult, type AgentType, type AgentUpdateParams, type AgentVersion, type AgentVersionConfig, type AgentVersionListParams, type AgentVersionListResponse, type AgentVersionMCPServer, type AgentVersionPublishParams, type AgentVersionRef, type AgentVersionSummary, AgentVersions, type AgentWeight, Agents, ApiKey, type ApiKeyDetails, type ApiKeyInfo, AuthenticationError, BASE_URL, BadRequestError, type Call, type CallAnalysis, type CallAnalyzedEvent, type CallCost, type CallCreatePhoneCallParams, type CallDeleteResponse, type CallEndedEvent, type CallLatency, type CallListParams, type CallRegisterParams, type CallRegisterResponse, type CallSessionStatus, type CallStartedEvent, type CallStatus, type CallStopResponse, type CallUpdateParams, Calls, type Chat, type ChatAnalyzedEvent, type ChatCreateParams, type ChatDeleteResponse, type ChatEndedEvent, type ChatListParams, type ChatMessage, type ChatReply, type ChatStartedEvent, type ChatUpdateParams, Chats, type ClientOptions, ConflictError, type Contact, type ContactCallList, type ContactCallSummary, type ContactCreateParams, type ContactCsvInspection, type ContactDeleteResponse, type ContactImport, type ContactImportCreateParams, type ContactImportErrorRow, type ContactImportErrors, type ContactImportList, type ContactImportStatus, ContactImports, type ContactListCreateParams, type ContactListDeleteResponse, type ContactListMemberRemoveResponse, type ContactListMembersAddResponse, type ContactListParams, type ContactListRecord, type ContactListUpdateParams, ContactLists, type ContactUpdateParams, Contacts, DEFAULT_SIGNATURE_TOLERANCE_MS, Dialgem, DialgemError, type DisconnectionReason, type ErrorBody, type ErrorIssue, type ExtractionModel, type ExtractionModelList, ExtractionModels, type Fetch, type FetchInit, type FetchResponse, type Flow, type FlowConfig, type FlowCreateParams, type FlowDeleteResponse, type FlowListParams, type FlowTemplate, type FlowTemplateSummary, FlowTemplates, type FlowUpdateParams, Flows, type FunctionCallContext, type FunctionCallRequest, type FunctionCreateParams, type FunctionKind, type FunctionReorderParams, type FunctionUpdateParams, type HeadersLike, type InboundWebhookTestResult, InternalServerError, type KeyValuePair, type KnowledgeDocument, type KnowledgeDocumentCreateParams, type LLM, type LLMCreateParams, type LLMDeleteResponse, type LLMListParams, type LLMUpdateParams, LLMs, type LatencyStats, type MCPServer, type MCPServerCreateParams, type MCPServerTestResult, type MCPServerUpdateParams, type MCPTool, type MCPToolList, NotFoundError, Page, type PageData, PagePromise, PermissionDeniedError, type PhoneCallCreateResponse, type PhoneNumber, type PhoneNumberAgentWeight, type PhoneNumberAssignParams, type PhoneNumberCreateParams, type PhoneNumberUpdateParams, PhoneNumbers, type PostCallAnalysisVariable, type PostCallBuiltinFields, type PromptState, type PromptTemplate, type PromptTemplateSummary, PromptTemplates, RateLimitError, type RequestBody, type RequestOptions, Sessions, type SignatureHeader, type SimulationCaller, type SimulationCase, type SimulationCaseInput, type SimulationCheck, type SimulationCheckResult, type SimulationPublishGate, type SimulationResult, type SimulationResultStatus, type SimulationRun, type SimulationRunCreateParams, type SimulationRunDetail, type SimulationRunList, type SimulationRunStatus, type SimulationSuite, type SimulationSuiteCreateParams, type SimulationSuiteDetail, type SimulationSuiteList, type SimulationSuiteUpdateParams, Simulations, type SipOutboundTrunkConfig, type TemplateListParams, type TranscriptTurn, UnprocessableEntityError, VERSION, type VerifyOptions, type Voice, type VoiceCloneFile, type VoiceCloneParams, type VoiceDeleteResponse, type VoiceListParams, Voices, WEBHOOK_DELIVERY_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_PREVIOUS_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebCall, type WebCallCreateParams, type WebCallSettings, type WebCallSettingsUpdateParams, WebCalls, type WebhookEvent, type WebhookEventType, type WebhookPayload, WebhookVerificationError, Webhooks, webhooks };
|
|
4409
|
+
export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, type Agent, type AgentCreateParams, type AgentDeleteResponse, type AgentFunction, AgentFunctions, AgentKnowledge, AgentMCPServers, type AgentSession, type AgentSessionList, type AgentSessionReleaseResult, type AgentSessionSayParams, type AgentSessionSayResult, type AgentSessionUpdateParams, type AgentSessionUpdateResult, type AgentType, type AgentUpdateParams, type AgentVersion, type AgentVersionConfig, type AgentVersionListParams, type AgentVersionListResponse, type AgentVersionMCPServer, type AgentVersionPublishParams, type AgentVersionRef, type AgentVersionSummary, AgentVersions, type AgentWeight, Agents, ApiKey, type ApiKeyDetails, type ApiKeyInfo, AuthenticationError, type AvailablePhoneNumber, type AvailablePhoneNumbers, BASE_URL, BadRequestError, type Call, type CallAnalysis, type CallAnalyzedEvent, type CallCost, type CallCreatePhoneCallParams, type CallDeleteResponse, type CallEndedEvent, type CallLatency, type CallListParams, type CallRegisterParams, type CallRegisterResponse, type CallSessionStatus, type CallStartedEvent, type CallStatus, type CallStopResponse, type CallUpdateParams, Calls, type Chat, type ChatAnalyzedEvent, type ChatCreateParams, type ChatDeleteResponse, type ChatEndedEvent, type ChatListParams, type ChatMessage, type ChatReply, type ChatStartedEvent, type ChatUpdateParams, Chats, type ClientOptions, ConflictError, type Contact, type ContactCallList, type ContactCallSummary, type ContactCreateParams, type ContactCsvInspection, type ContactDeleteResponse, type ContactImport, type ContactImportCreateParams, type ContactImportErrorRow, type ContactImportErrors, type ContactImportList, type ContactImportStatus, ContactImports, type ContactListCreateParams, type ContactListDeleteResponse, type ContactListMemberRemoveResponse, type ContactListMembersAddResponse, type ContactListParams, type ContactListRecord, type ContactListUpdateParams, ContactLists, type ContactUpdateParams, Contacts, DEFAULT_SIGNATURE_TOLERANCE_MS, Dialgem, DialgemError, type DisconnectionReason, type ErrorBody, type ErrorIssue, type ExtractionModel, type ExtractionModelList, ExtractionModels, type Fetch, type FetchInit, type FetchResponse, type Flow, type FlowConfig, type FlowCreateParams, type FlowDeleteResponse, type FlowListParams, type FlowTemplate, type FlowTemplateSummary, FlowTemplates, type FlowUpdateParams, Flows, type FunctionCallContext, type FunctionCallRequest, type FunctionCreateParams, type FunctionKind, type FunctionReorderParams, type FunctionUpdateParams, type HeadersLike, type InboundWebhookTestResult, InternalServerError, type KeyValuePair, type KnowledgeDocument, type KnowledgeDocumentCreateParams, type LLM, type LLMCreateParams, type LLMDeleteResponse, type LLMListParams, type LLMUpdateParams, LLMs, type LatencyStats, type MCPServer, type MCPServerCreateParams, type MCPServerTestResult, type MCPServerUpdateParams, type MCPTool, type MCPToolList, NotFoundError, Page, type PageData, PagePromise, PermissionDeniedError, type PhoneCallCreateResponse, type PhoneNumber, type PhoneNumberAgentWeight, type PhoneNumberAssignParams, type PhoneNumberBuyParams, type PhoneNumberCreateParams, type PhoneNumberSearchParams, type PhoneNumberUpdateParams, PhoneNumbers, type PostCallAnalysisVariable, type PostCallBuiltinFields, type PromptState, type PromptTemplate, type PromptTemplateSummary, PromptTemplates, type PurchasedPhoneNumber, RateLimitError, type RequestBody, type RequestOptions, Sessions, type SignatureHeader, type SimulationCaller, type SimulationCase, type SimulationCaseInput, type SimulationCheck, type SimulationCheckResult, type SimulationPublishGate, type SimulationResult, type SimulationResultStatus, type SimulationRun, type SimulationRunCreateParams, type SimulationRunDetail, type SimulationRunList, type SimulationRunStatus, type SimulationSuite, type SimulationSuiteCreateParams, type SimulationSuiteDetail, type SimulationSuiteList, type SimulationSuiteUpdateParams, Simulations, type SipOutboundTrunkConfig, type TemplateListParams, type TranscriptTurn, UnprocessableEntityError, VERSION, type VerifyOptions, type Voice, type VoiceCloneFile, type VoiceCloneParams, type VoiceDeleteResponse, type VoiceListParams, Voices, WEBHOOK_DELIVERY_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_PREVIOUS_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_HEADER, type WebCall, type WebCallCreateParams, type WebCallSettings, type WebCallSettingsUpdateParams, WebCalls, type WebhookEvent, type WebhookEventType, type WebhookPayload, WebhookVerificationError, Webhooks, webhooks };
|
package/dist/index.js
CHANGED
|
@@ -104,7 +104,7 @@ function isErrorBody(body) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/version.ts
|
|
107
|
-
var VERSION = "
|
|
107
|
+
var VERSION = "1.0.0";
|
|
108
108
|
|
|
109
109
|
// src/core/http.ts
|
|
110
110
|
var RETRYABLE_METHODS = /* @__PURE__ */ new Set(["GET", "PUT", "PATCH", "DELETE"]);
|
|
@@ -965,6 +965,21 @@ var PhoneNumbers = class extends APIResource {
|
|
|
965
965
|
create(body, options) {
|
|
966
966
|
return this._client.post("/v1/phone-numbers", body, options);
|
|
967
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* Numbers that can be bought, with the monthly price. Throws `NotFoundError` (`number_purchase_disabled`) when the
|
|
970
|
+
* deployment has not switched buying on.
|
|
971
|
+
*/
|
|
972
|
+
search(params, options) {
|
|
973
|
+
return this._client.get("/v1/phone-numbers/available", { ...params }, options);
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Buy one of the numbers `search` returned. **Spends the organization's credit**: the first month is debited now and
|
|
977
|
+
* the rental renews monthly until the number is released. Throws on insufficient credit, or if the carrier no longer
|
|
978
|
+
* has the number; nothing is charged in either case.
|
|
979
|
+
*/
|
|
980
|
+
buy(body, options) {
|
|
981
|
+
return this._client.post("/v1/phone-numbers/buy", body, options);
|
|
982
|
+
}
|
|
968
983
|
/** Every active (not released) number in the organization, newest first. */
|
|
969
984
|
list(options) {
|
|
970
985
|
return this._client.get("/v1/phone-numbers", void 0, options);
|