agentphone 1.0.9 → 1.0.11

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.
Files changed (134) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +6 -0
  3. package/dist/cjs/Client.js +22 -12
  4. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/agentSignup/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
  7. package/dist/cjs/api/resources/agents/client/Client.js +1 -1
  8. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +8 -0
  9. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +8 -0
  10. package/dist/cjs/api/resources/calls/client/Client.d.ts +20 -0
  11. package/dist/cjs/api/resources/calls/client/Client.js +56 -0
  12. package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.js +3 -0
  14. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/contactCards/client/Client.d.ts +61 -0
  16. package/dist/cjs/api/resources/contactCards/client/Client.js +229 -0
  17. package/dist/cjs/api/resources/contactCards/client/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/contactCards/client/index.js +17 -0
  19. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.ts +16 -0
  20. package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.js +3 -0
  21. package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.ts +9 -0
  22. package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js +3 -0
  23. package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.ts +9 -0
  24. package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.js +3 -0
  25. package/dist/cjs/api/resources/contactCards/client/requests/index.d.ts +3 -0
  26. package/dist/cjs/api/resources/contactCards/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/contactCards/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/contactCards/index.js +17 -0
  29. package/dist/cjs/api/resources/conversations/client/Client.d.ts +39 -0
  30. package/dist/cjs/api/resources/conversations/client/Client.js +114 -0
  31. package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.ts +9 -0
  32. package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.js +3 -0
  33. package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.d.ts +12 -0
  34. package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.js +3 -0
  35. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +2 -0
  36. package/dist/cjs/api/resources/index.d.ts +4 -0
  37. package/dist/cjs/api/resources/index.js +5 -1
  38. package/dist/cjs/api/resources/integrations/client/Client.d.ts +64 -0
  39. package/dist/cjs/api/resources/integrations/client/Client.js +268 -0
  40. package/dist/cjs/api/resources/integrations/client/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/integrations/client/index.js +17 -0
  42. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +9 -0
  43. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js +3 -0
  44. package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/integrations/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/integrations/index.d.ts +1 -0
  47. package/dist/cjs/api/resources/integrations/index.js +17 -0
  48. package/dist/cjs/api/resources/messages/client/Client.d.ts +10 -11
  49. package/dist/cjs/api/resources/messages/client/Client.js +10 -11
  50. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +22 -0
  51. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +19 -0
  52. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +2 -1
  53. package/dist/cjs/api/resources/messages/client/requests/index.d.ts +1 -1
  54. package/dist/cjs/api/resources/messages/client/requests/index.js +3 -0
  55. package/dist/cjs/api/resources/numbers/client/Client.d.ts +4 -4
  56. package/dist/cjs/api/resources/numbers/client/Client.js +4 -4
  57. package/dist/cjs/api/types/AgentResponse.d.ts +7 -0
  58. package/dist/cjs/api/types/ContactCardResponse.d.ts +6 -0
  59. package/dist/cjs/api/types/ContactCardResponse.js +3 -0
  60. package/dist/cjs/api/types/SendMessageResponse.d.ts +2 -0
  61. package/dist/cjs/api/types/SetBackgroundResponse.d.ts +8 -0
  62. package/dist/cjs/api/types/SetBackgroundResponse.js +3 -0
  63. package/dist/cjs/api/types/index.d.ts +2 -0
  64. package/dist/cjs/api/types/index.js +2 -0
  65. package/dist/cjs/version.d.ts +1 -1
  66. package/dist/cjs/version.js +1 -1
  67. package/dist/esm/BaseClient.mjs +2 -2
  68. package/dist/esm/Client.d.mts +6 -0
  69. package/dist/esm/Client.mjs +10 -0
  70. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +1 -1
  71. package/dist/esm/api/resources/agentSignup/client/Client.mjs +1 -1
  72. package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
  73. package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
  74. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +8 -0
  75. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +8 -0
  76. package/dist/esm/api/resources/calls/client/Client.d.mts +20 -0
  77. package/dist/esm/api/resources/calls/client/Client.mjs +56 -0
  78. package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.mts +9 -0
  79. package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.mjs +2 -0
  80. package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
  81. package/dist/esm/api/resources/contactCards/client/Client.d.mts +61 -0
  82. package/dist/esm/api/resources/contactCards/client/Client.mjs +192 -0
  83. package/dist/esm/api/resources/contactCards/client/index.d.mts +1 -0
  84. package/dist/esm/api/resources/contactCards/client/index.mjs +1 -0
  85. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.mts +16 -0
  86. package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.mjs +2 -0
  87. package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.mts +9 -0
  88. package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.mjs +2 -0
  89. package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.mts +9 -0
  90. package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.mjs +2 -0
  91. package/dist/esm/api/resources/contactCards/client/requests/index.d.mts +3 -0
  92. package/dist/esm/api/resources/contactCards/client/requests/index.mjs +1 -0
  93. package/dist/esm/api/resources/contactCards/index.d.mts +1 -0
  94. package/dist/esm/api/resources/contactCards/index.mjs +1 -0
  95. package/dist/esm/api/resources/conversations/client/Client.d.mts +39 -0
  96. package/dist/esm/api/resources/conversations/client/Client.mjs +114 -0
  97. package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.mts +9 -0
  98. package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.mjs +2 -0
  99. package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.d.mts +12 -0
  100. package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.mjs +2 -0
  101. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +2 -0
  102. package/dist/esm/api/resources/index.d.mts +4 -0
  103. package/dist/esm/api/resources/index.mjs +4 -0
  104. package/dist/esm/api/resources/integrations/client/Client.d.mts +64 -0
  105. package/dist/esm/api/resources/integrations/client/Client.mjs +231 -0
  106. package/dist/esm/api/resources/integrations/client/index.d.mts +1 -0
  107. package/dist/esm/api/resources/integrations/client/index.mjs +1 -0
  108. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +9 -0
  109. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs +2 -0
  110. package/dist/esm/api/resources/integrations/client/requests/index.d.mts +1 -0
  111. package/dist/esm/api/resources/integrations/client/requests/index.mjs +1 -0
  112. package/dist/esm/api/resources/integrations/index.d.mts +1 -0
  113. package/dist/esm/api/resources/integrations/index.mjs +1 -0
  114. package/dist/esm/api/resources/messages/client/Client.d.mts +10 -11
  115. package/dist/esm/api/resources/messages/client/Client.mjs +10 -11
  116. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +22 -0
  117. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +18 -1
  118. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +2 -1
  119. package/dist/esm/api/resources/messages/client/requests/index.d.mts +1 -1
  120. package/dist/esm/api/resources/messages/client/requests/index.mjs +1 -1
  121. package/dist/esm/api/resources/numbers/client/Client.d.mts +4 -4
  122. package/dist/esm/api/resources/numbers/client/Client.mjs +4 -4
  123. package/dist/esm/api/types/AgentResponse.d.mts +7 -0
  124. package/dist/esm/api/types/ContactCardResponse.d.mts +6 -0
  125. package/dist/esm/api/types/ContactCardResponse.mjs +2 -0
  126. package/dist/esm/api/types/SendMessageResponse.d.mts +2 -0
  127. package/dist/esm/api/types/SetBackgroundResponse.d.mts +8 -0
  128. package/dist/esm/api/types/SetBackgroundResponse.mjs +2 -0
  129. package/dist/esm/api/types/index.d.mts +2 -0
  130. package/dist/esm/api/types/index.mjs +2 -0
  131. package/dist/esm/version.d.mts +1 -1
  132. package/dist/esm/version.mjs +1 -1
  133. package/package.json +1 -1
  134. package/reference.md +709 -44
@@ -27,6 +27,7 @@ __exportStar(require("./AppRoutesConversationsConversationSummary.js"), exports)
27
27
  __exportStar(require("./AttachNumberResponse.js"), exports);
28
28
  __exportStar(require("./CallListResponse.js"), exports);
29
29
  __exportStar(require("./CallSummary.js"), exports);
30
+ __exportStar(require("./ContactCardResponse.js"), exports);
30
31
  __exportStar(require("./ContactListResponse.js"), exports);
31
32
  __exportStar(require("./ContactResponse.js"), exports);
32
33
  __exportStar(require("./ConversationDetail.js"), exports);
@@ -52,6 +53,7 @@ __exportStar(require("./ReactionInConversation.js"), exports);
52
53
  __exportStar(require("./SendMessageResponse.js"), exports);
53
54
  __exportStar(require("./SendReactionResponse.js"), exports);
54
55
  __exportStar(require("./SendTypingResponse.js"), exports);
56
+ __exportStar(require("./SetBackgroundResponse.js"), exports);
55
57
  __exportStar(require("./UsageResponse.js"), exports);
56
58
  __exportStar(require("./UsageStats.js"), exports);
57
59
  __exportStar(require("./ValidationError.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.7";
1
+ export declare const SDK_VERSION = "1.0.11";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.7";
4
+ exports.SDK_VERSION = "1.0.11";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentphone",
9
- "X-Fern-SDK-Version": "1.0.7",
10
- "User-Agent": "agentphone/1.0.7",
9
+ "X-Fern-SDK-Version": "1.0.11",
10
+ "User-Agent": "agentphone/1.0.11",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -2,8 +2,10 @@ import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs
2
2
  import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
3
3
  import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
4
4
  import { CallsClient } from "./api/resources/calls/client/Client.mjs";
5
+ import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
5
6
  import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
6
7
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
8
+ import { IntegrationsClient } from "./api/resources/integrations/client/Client.mjs";
7
9
  import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
8
10
  import { NumbersClient } from "./api/resources/numbers/client/Client.mjs";
9
11
  import { UsageClient } from "./api/resources/usage/client/Client.mjs";
@@ -26,7 +28,9 @@ export declare class AgentPhoneClient {
26
28
  protected _conversations: ConversationsClient | undefined;
27
29
  protected _calls: CallsClient | undefined;
28
30
  protected _usage: UsageClient | undefined;
31
+ protected _integrations: IntegrationsClient | undefined;
29
32
  protected _messages: MessagesClient | undefined;
33
+ protected _contactCards: ContactCardsClient | undefined;
30
34
  constructor(options?: AgentPhoneClient.Options);
31
35
  get agentSignup(): AgentSignupClient;
32
36
  get agents(): AgentsClient;
@@ -37,5 +41,7 @@ export declare class AgentPhoneClient {
37
41
  get conversations(): ConversationsClient;
38
42
  get calls(): CallsClient;
39
43
  get usage(): UsageClient;
44
+ get integrations(): IntegrationsClient;
40
45
  get messages(): MessagesClient;
46
+ get contactCards(): ContactCardsClient;
41
47
  }
@@ -3,8 +3,10 @@ import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs
3
3
  import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
4
4
  import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
5
5
  import { CallsClient } from "./api/resources/calls/client/Client.mjs";
6
+ import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
6
7
  import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
7
8
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
9
+ import { IntegrationsClient } from "./api/resources/integrations/client/Client.mjs";
8
10
  import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
9
11
  import { NumbersClient } from "./api/resources/numbers/client/Client.mjs";
10
12
  import { UsageClient } from "./api/resources/usage/client/Client.mjs";
@@ -50,8 +52,16 @@ export class AgentPhoneClient {
50
52
  var _a;
51
53
  return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new UsageClient(this._options)));
52
54
  }
55
+ get integrations() {
56
+ var _a;
57
+ return ((_a = this._integrations) !== null && _a !== void 0 ? _a : (this._integrations = new IntegrationsClient(this._options)));
58
+ }
53
59
  get messages() {
54
60
  var _a;
55
61
  return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new MessagesClient(this._options)));
56
62
  }
63
+ get contactCards() {
64
+ var _a;
65
+ return ((_a = this._contactCards) !== null && _a !== void 0 ? _a : (this._contactCards = new ContactCardsClient(this._options)));
66
+ }
57
67
  }
@@ -31,7 +31,7 @@ export declare class AgentSignupClient {
31
31
  /**
32
32
  * Verify the OTP and atomically provision everything.
33
33
  *
34
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + Twilio number
34
+ * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
35
35
  * + first-month charge + API key. Returns the key once — agents must save it.
36
36
  *
37
37
  * @param {AgentPhone.AgentVerifyRequest} request
@@ -77,7 +77,7 @@ export class AgentSignupClient {
77
77
  /**
78
78
  * Verify the OTP and atomically provision everything.
79
79
  *
80
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + Twilio number
80
+ * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
81
81
  * + first-month charge + API key. Returns the key once — agents must save it.
82
82
  *
83
83
  * @param {AgentPhone.AgentVerifyRequest} request
@@ -11,7 +11,7 @@ export declare class AgentsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
12
12
  constructor(options?: AgentsClient.Options);
13
13
  /**
14
- * Return available voices for voice calls.
14
+ * Return available voices from the configured voice provider.
15
15
  *
16
16
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
17
17
  *
@@ -31,7 +31,7 @@ export class AgentsClient {
31
31
  this._options = normalizeClientOptionsWithAuth(options);
32
32
  }
33
33
  /**
34
- * Return available voices for voice calls.
34
+ * Return available voices from the configured voice provider.
35
35
  *
36
36
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
37
37
  *
@@ -8,6 +8,8 @@ export interface CreateAgentRequest {
8
8
  name: string;
9
9
  description?: string | null;
10
10
  voiceMode?: CreateAgentRequest.VoiceMode;
11
+ /** When true, hosted-mode agents can send and read SMS/iMessage during calls. Defaults to true. */
12
+ enableMessaging?: boolean | null;
11
13
  modelTier?: CreateAgentRequest.ModelTier;
12
14
  systemPrompt?: string | null;
13
15
  beginMessage?: string | null;
@@ -22,6 +24,12 @@ export interface CreateAgentRequest {
22
24
  denoisingMode?: CreateAgentRequest.DenoisingMode;
23
25
  /** Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour). */
24
26
  maxSilenceMs?: number | null;
27
+ /** Voice speed multiplier. 1.0 is normal pace; lower values slow speech (0.5 is half speed), higher values speed it up (2.0 is double). Range 0.5 to 2.0. */
28
+ voiceSpeed?: number | null;
29
+ /** How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0. */
30
+ interruptionSensitivity?: number | null;
31
+ /** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. Defaults to true. */
32
+ enableBackchannel?: boolean | null;
25
33
  }
26
34
  export declare namespace CreateAgentRequest {
27
35
  const VoiceMode: {
@@ -9,6 +9,8 @@ export interface UpdateAgentRequest {
9
9
  name?: string | null;
10
10
  description?: string | null;
11
11
  voiceMode?: UpdateAgentRequest.VoiceMode;
12
+ /** When true, hosted-mode agents can send and read SMS/iMessage during calls. */
13
+ enableMessaging?: boolean | null;
12
14
  modelTier?: UpdateAgentRequest.ModelTier;
13
15
  systemPrompt?: string | null;
14
16
  beginMessage?: string | null;
@@ -23,6 +25,12 @@ export interface UpdateAgentRequest {
23
25
  denoisingMode?: UpdateAgentRequest.DenoisingMode;
24
26
  /** Hang up the call after this many milliseconds of caller silence. Default 600000 (10 min). Raise for IVR/hold-music workflows; lower to fail fast on dead lines. Range 10000 (10s) to 3600000 (1 hour). */
25
27
  maxSilenceMs?: number | null;
28
+ /** Voice speed multiplier. 1.0 is normal pace; lower slows speech (0.5 is half speed), higher speeds it up (2.0 is double). Range 0.5 to 2.0. */
29
+ voiceSpeed?: number | null;
30
+ /** How easily callers can interrupt the agent. 0 means the agent is never interrupted, 1 means the agent stops at the first sound. Default 0.8. Range 0.0 to 1.0. */
31
+ interruptionSensitivity?: number | null;
32
+ /** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. */
33
+ enableBackchannel?: boolean | null;
26
34
  }
27
35
  export declare namespace UpdateAgentRequest {
28
36
  const VoiceMode: {
@@ -90,6 +90,26 @@ export declare class CallsClient {
90
90
  */
91
91
  getCall(request: AgentPhone.GetCallV1CallsCallIdGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
92
92
  private __getCall;
93
+ /**
94
+ * Terminate an ongoing call.
95
+ *
96
+ * Works for both hosted-mode and webhook-mode calls. The call_ended
97
+ * webhook from the voice provider updates status/endedAt asynchronously,
98
+ * so this endpoint returns the current call as soon as the stop request
99
+ * is accepted upstream.
100
+ *
101
+ * @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
102
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
103
+ *
104
+ * @throws {@link AgentPhone.UnprocessableEntityError}
105
+ *
106
+ * @example
107
+ * await client.calls.endCall({
108
+ * call_id: "call_id"
109
+ * })
110
+ */
111
+ endCall(request: AgentPhone.EndCallV1CallsCallIdEndPostRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
112
+ private __endCall;
93
113
  /**
94
114
  * Returns the audio file (WAV format) for a completed call.
95
115
  *
@@ -255,6 +255,62 @@ export class CallsClient {
255
255
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}");
256
256
  });
257
257
  }
258
+ /**
259
+ * Terminate an ongoing call.
260
+ *
261
+ * Works for both hosted-mode and webhook-mode calls. The call_ended
262
+ * webhook from the voice provider updates status/endedAt asynchronously,
263
+ * so this endpoint returns the current call as soon as the stop request
264
+ * is accepted upstream.
265
+ *
266
+ * @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
267
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
268
+ *
269
+ * @throws {@link AgentPhone.UnprocessableEntityError}
270
+ *
271
+ * @example
272
+ * await client.calls.endCall({
273
+ * call_id: "call_id"
274
+ * })
275
+ */
276
+ endCall(request, requestOptions) {
277
+ return core.HttpResponsePromise.fromPromise(this.__endCall(request, requestOptions));
278
+ }
279
+ __endCall(request, requestOptions) {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
282
+ const { call_id: callId } = request;
283
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
284
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
+ const _response = yield core.fetcher({
286
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/calls/${core.url.encodePathParam(callId)}/end`),
287
+ method: "POST",
288
+ headers: _headers,
289
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
290
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
291
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
292
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
293
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
294
+ logging: this._options.logging,
295
+ });
296
+ if (_response.ok) {
297
+ return { data: _response.body, rawResponse: _response.rawResponse };
298
+ }
299
+ if (_response.error.reason === "status-code") {
300
+ switch (_response.error.statusCode) {
301
+ case 422:
302
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
303
+ default:
304
+ throw new errors.AgentPhoneError({
305
+ statusCode: _response.error.statusCode,
306
+ body: _response.error.body,
307
+ rawResponse: _response.rawResponse,
308
+ });
309
+ }
310
+ }
311
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/calls/{call_id}/end");
312
+ });
313
+ }
258
314
  /**
259
315
  * Returns the audio file (WAV format) for a completed call.
260
316
  *
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * call_id: "call_id"
5
+ * }
6
+ */
7
+ export interface EndCallV1CallsCallIdEndPostRequest {
8
+ call_id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,5 +1,6 @@
1
1
  export type { CreateOutboundCallRequest } from "./CreateOutboundCallRequest.mjs";
2
2
  export type { CreateWebCallRequest } from "./CreateWebCallRequest.mjs";
3
+ export type { EndCallV1CallsCallIdEndPostRequest } from "./EndCallV1CallsCallIdEndPostRequest.mjs";
3
4
  export type { GetCallRecordingV1CallsCallIdRecordingGetRequest } from "./GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs";
4
5
  export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCallTranscriptV1CallsCallIdTranscriptGetRequest.mjs";
5
6
  export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.mjs";
@@ -0,0 +1,61 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as AgentPhone from "../../../index.mjs";
5
+ export declare namespace ContactCardsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class ContactCardsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ContactCardsClient.Options>;
12
+ constructor(options?: ContactCardsClient.Options);
13
+ /**
14
+ * Fetch the iMessage contact card set on this number.
15
+ *
16
+ * @param {AgentPhone.GetContactCardV1NumbersNumberIdContactCardGetRequest} request
17
+ * @param {ContactCardsClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link AgentPhone.UnprocessableEntityError}
20
+ *
21
+ * @example
22
+ * await client.contactCards.getContactCard({
23
+ * number_id: "number_id"
24
+ * })
25
+ */
26
+ getContactCard(request: AgentPhone.GetContactCardV1NumbersNumberIdContactCardGetRequest, requestOptions?: ContactCardsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactCardResponse>;
27
+ private __getContactCard;
28
+ /**
29
+ * Create or replace the iMessage contact card on this number.
30
+ *
31
+ * @param {AgentPhone.ContactCardWriteRequest} request
32
+ * @param {ContactCardsClient.RequestOptions} requestOptions - Request-specific configuration.
33
+ *
34
+ * @throws {@link AgentPhone.UnprocessableEntityError}
35
+ *
36
+ * @example
37
+ * await client.contactCards.putContactCard({
38
+ * number_id: "number_id",
39
+ * firstName: "firstName",
40
+ * lastName: "lastName",
41
+ * avatarUrl: "avatarUrl"
42
+ * })
43
+ */
44
+ putContactCard(request: AgentPhone.ContactCardWriteRequest, requestOptions?: ContactCardsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactCardResponse>;
45
+ private __putContactCard;
46
+ /**
47
+ * Remove the iMessage contact card from this number.
48
+ *
49
+ * @param {AgentPhone.DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest} request
50
+ * @param {ContactCardsClient.RequestOptions} requestOptions - Request-specific configuration.
51
+ *
52
+ * @throws {@link AgentPhone.UnprocessableEntityError}
53
+ *
54
+ * @example
55
+ * await client.contactCards.deleteContactCard({
56
+ * number_id: "number_id"
57
+ * })
58
+ */
59
+ deleteContactCard(request: AgentPhone.DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest, requestOptions?: ContactCardsClient.RequestOptions): core.HttpResponsePromise<void>;
60
+ private __deleteContactCard;
61
+ }
@@ -0,0 +1,192 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __rest = (this && this.__rest) || function (s, e) {
12
+ var t = {};
13
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
14
+ t[p] = s[p];
15
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
16
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
17
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
18
+ t[p[i]] = s[p[i]];
19
+ }
20
+ return t;
21
+ };
22
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
23
+ import { mergeHeaders } from "../../../../core/headers.mjs";
24
+ import * as core from "../../../../core/index.mjs";
25
+ import * as environments from "../../../../environments.mjs";
26
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
27
+ import * as errors from "../../../../errors/index.mjs";
28
+ import * as AgentPhone from "../../../index.mjs";
29
+ export class ContactCardsClient {
30
+ constructor(options = {}) {
31
+ this._options = normalizeClientOptionsWithAuth(options);
32
+ }
33
+ /**
34
+ * Fetch the iMessage contact card set on this number.
35
+ *
36
+ * @param {AgentPhone.GetContactCardV1NumbersNumberIdContactCardGetRequest} request
37
+ * @param {ContactCardsClient.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link AgentPhone.UnprocessableEntityError}
40
+ *
41
+ * @example
42
+ * await client.contactCards.getContactCard({
43
+ * number_id: "number_id"
44
+ * })
45
+ */
46
+ getContactCard(request, requestOptions) {
47
+ return core.HttpResponsePromise.fromPromise(this.__getContactCard(request, requestOptions));
48
+ }
49
+ __getContactCard(request, requestOptions) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
52
+ const { number_id: numberId } = request;
53
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
54
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
55
+ const _response = yield core.fetcher({
56
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}/contact-card`),
57
+ method: "GET",
58
+ headers: _headers,
59
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
60
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
61
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
62
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
63
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
64
+ logging: this._options.logging,
65
+ });
66
+ if (_response.ok) {
67
+ return { data: _response.body, rawResponse: _response.rawResponse };
68
+ }
69
+ if (_response.error.reason === "status-code") {
70
+ switch (_response.error.statusCode) {
71
+ case 422:
72
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
73
+ default:
74
+ throw new errors.AgentPhoneError({
75
+ statusCode: _response.error.statusCode,
76
+ body: _response.error.body,
77
+ rawResponse: _response.rawResponse,
78
+ });
79
+ }
80
+ }
81
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/numbers/{number_id}/contact-card");
82
+ });
83
+ }
84
+ /**
85
+ * Create or replace the iMessage contact card on this number.
86
+ *
87
+ * @param {AgentPhone.ContactCardWriteRequest} request
88
+ * @param {ContactCardsClient.RequestOptions} requestOptions - Request-specific configuration.
89
+ *
90
+ * @throws {@link AgentPhone.UnprocessableEntityError}
91
+ *
92
+ * @example
93
+ * await client.contactCards.putContactCard({
94
+ * number_id: "number_id",
95
+ * firstName: "firstName",
96
+ * lastName: "lastName",
97
+ * avatarUrl: "avatarUrl"
98
+ * })
99
+ */
100
+ putContactCard(request, requestOptions) {
101
+ return core.HttpResponsePromise.fromPromise(this.__putContactCard(request, requestOptions));
102
+ }
103
+ __putContactCard(request, requestOptions) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
106
+ const { number_id: numberId } = request, _body = __rest(request, ["number_id"]);
107
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
108
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
109
+ const _response = yield core.fetcher({
110
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}/contact-card`),
111
+ method: "PUT",
112
+ headers: _headers,
113
+ contentType: "application/json",
114
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
115
+ requestType: "json",
116
+ body: _body,
117
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
118
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
119
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
120
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
121
+ logging: this._options.logging,
122
+ });
123
+ if (_response.ok) {
124
+ return { data: _response.body, rawResponse: _response.rawResponse };
125
+ }
126
+ if (_response.error.reason === "status-code") {
127
+ switch (_response.error.statusCode) {
128
+ case 422:
129
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
130
+ default:
131
+ throw new errors.AgentPhoneError({
132
+ statusCode: _response.error.statusCode,
133
+ body: _response.error.body,
134
+ rawResponse: _response.rawResponse,
135
+ });
136
+ }
137
+ }
138
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/numbers/{number_id}/contact-card");
139
+ });
140
+ }
141
+ /**
142
+ * Remove the iMessage contact card from this number.
143
+ *
144
+ * @param {AgentPhone.DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest} request
145
+ * @param {ContactCardsClient.RequestOptions} requestOptions - Request-specific configuration.
146
+ *
147
+ * @throws {@link AgentPhone.UnprocessableEntityError}
148
+ *
149
+ * @example
150
+ * await client.contactCards.deleteContactCard({
151
+ * number_id: "number_id"
152
+ * })
153
+ */
154
+ deleteContactCard(request, requestOptions) {
155
+ return core.HttpResponsePromise.fromPromise(this.__deleteContactCard(request, requestOptions));
156
+ }
157
+ __deleteContactCard(request, requestOptions) {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
160
+ const { number_id: numberId } = request;
161
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
162
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
163
+ const _response = yield core.fetcher({
164
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, `v1/numbers/${core.url.encodePathParam(numberId)}/contact-card`),
165
+ method: "DELETE",
166
+ headers: _headers,
167
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
168
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
169
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
170
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
171
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
172
+ logging: this._options.logging,
173
+ });
174
+ if (_response.ok) {
175
+ return { data: undefined, rawResponse: _response.rawResponse };
176
+ }
177
+ if (_response.error.reason === "status-code") {
178
+ switch (_response.error.statusCode) {
179
+ case 422:
180
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
181
+ default:
182
+ throw new errors.AgentPhoneError({
183
+ statusCode: _response.error.statusCode,
184
+ body: _response.error.body,
185
+ rawResponse: _response.rawResponse,
186
+ });
187
+ }
188
+ }
189
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/numbers/{number_id}/contact-card");
190
+ });
191
+ }
192
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * number_id: "number_id",
5
+ * firstName: "firstName",
6
+ * lastName: "lastName",
7
+ * avatarUrl: "avatarUrl"
8
+ * }
9
+ */
10
+ export interface ContactCardWriteRequest {
11
+ number_id: string;
12
+ firstName: string;
13
+ lastName: string;
14
+ displayName?: string | null;
15
+ avatarUrl: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * number_id: "number_id"
5
+ * }
6
+ */
7
+ export interface DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest {
8
+ number_id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * number_id: "number_id"
5
+ * }
6
+ */
7
+ export interface GetContactCardV1NumbersNumberIdContactCardGetRequest {
8
+ number_id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { ContactCardWriteRequest } from "./ContactCardWriteRequest.mjs";
2
+ export type { DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest } from "./DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.mjs";
3
+ export type { GetContactCardV1NumbersNumberIdContactCardGetRequest } from "./GetContactCardV1NumbersNumberIdContactCardGetRequest.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";