agentphone 1.0.2 → 1.0.3

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 (158) 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 +18 -8
  4. package/dist/cjs/api/resources/agentWebhooks/client/Client.d.ts +1 -1
  5. package/dist/cjs/api/resources/agentWebhooks/client/Client.js +1 -1
  6. package/dist/cjs/api/resources/agents/client/Client.d.ts +20 -2
  7. package/dist/cjs/api/resources/agents/client/Client.js +56 -2
  8. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +1 -0
  9. package/dist/cjs/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.d.ts +11 -0
  10. package/dist/cjs/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.js +3 -0
  11. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +1 -0
  12. package/dist/cjs/api/resources/agents/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/calls/client/Client.d.ts +27 -3
  14. package/dist/cjs/api/resources/calls/client/Client.js +68 -4
  15. package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +8 -0
  16. package/dist/cjs/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.d.ts +9 -0
  17. package/dist/cjs/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.js +3 -0
  18. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/contacts/client/Client.d.ts +94 -0
  20. package/dist/cjs/api/resources/contacts/client/Client.js +341 -0
  21. package/dist/cjs/api/resources/contacts/client/index.d.ts +1 -0
  22. package/dist/cjs/api/resources/contacts/client/index.js +17 -0
  23. package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +13 -0
  24. package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.js +3 -0
  25. package/dist/cjs/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.d.ts +9 -0
  26. package/dist/cjs/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.js +3 -0
  27. package/dist/cjs/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.d.ts +9 -0
  28. package/dist/cjs/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.js +3 -0
  29. package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +9 -0
  30. package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.js +3 -0
  31. package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.d.ts +13 -0
  32. package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.js +3 -0
  33. package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +5 -0
  34. package/dist/cjs/api/resources/contacts/client/requests/index.js +2 -0
  35. package/dist/cjs/api/resources/contacts/index.d.ts +1 -0
  36. package/dist/cjs/api/resources/contacts/index.js +17 -0
  37. package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -1
  38. package/dist/cjs/api/resources/conversations/client/Client.js +1 -1
  39. package/dist/cjs/api/resources/index.d.ts +4 -0
  40. package/dist/cjs/api/resources/index.js +5 -1
  41. package/dist/cjs/api/resources/messages/client/Client.d.ts +49 -0
  42. package/dist/cjs/api/resources/messages/client/Client.js +183 -0
  43. package/dist/cjs/api/resources/messages/client/index.d.ts +1 -0
  44. package/dist/cjs/api/resources/messages/client/index.js +17 -0
  45. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +15 -0
  46. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +3 -0
  47. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +11 -0
  48. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +3 -0
  49. package/dist/cjs/api/resources/messages/client/requests/index.d.ts +2 -0
  50. package/dist/cjs/api/resources/messages/client/requests/index.js +2 -0
  51. package/dist/cjs/api/resources/messages/index.d.ts +1 -0
  52. package/dist/cjs/api/resources/messages/index.js +17 -0
  53. package/dist/cjs/api/resources/numbers/client/Client.d.ts +1 -1
  54. package/dist/cjs/api/resources/numbers/client/Client.js +1 -1
  55. package/dist/cjs/api/resources/usage/client/Client.d.ts +1 -1
  56. package/dist/cjs/api/resources/usage/client/Client.js +1 -1
  57. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +6 -6
  58. package/dist/cjs/api/resources/webhooks/client/Client.js +6 -6
  59. package/dist/cjs/api/types/AgentNumberResponse.d.ts +1 -0
  60. package/dist/cjs/api/types/AgentResponse.d.ts +1 -0
  61. package/dist/cjs/api/types/CallSummary.d.ts +1 -1
  62. package/dist/cjs/api/types/ContactListResponse.d.ts +6 -0
  63. package/dist/cjs/api/types/ContactListResponse.js +3 -0
  64. package/dist/cjs/api/types/ContactResponse.d.ts +9 -0
  65. package/dist/cjs/api/types/ContactResponse.js +3 -0
  66. package/dist/cjs/api/types/MessageInConversation.d.ts +2 -0
  67. package/dist/cjs/api/types/MessageResponse.d.ts +2 -0
  68. package/dist/cjs/api/types/PhoneNumberResponse.d.ts +1 -0
  69. package/dist/cjs/api/types/SendMessageResponse.d.ts +7 -0
  70. package/dist/cjs/api/types/SendMessageResponse.js +3 -0
  71. package/dist/cjs/api/types/SendReactionResponse.d.ts +6 -0
  72. package/dist/cjs/api/types/SendReactionResponse.js +3 -0
  73. package/dist/cjs/api/types/WebhookCreateRequest.d.ts +1 -0
  74. package/dist/cjs/api/types/WebhookResponse.d.ts +1 -0
  75. package/dist/cjs/api/types/index.d.ts +4 -0
  76. package/dist/cjs/api/types/index.js +4 -0
  77. package/dist/cjs/version.d.ts +1 -1
  78. package/dist/cjs/version.js +1 -1
  79. package/dist/esm/BaseClient.mjs +2 -2
  80. package/dist/esm/Client.d.mts +6 -0
  81. package/dist/esm/Client.mjs +10 -0
  82. package/dist/esm/api/resources/agentWebhooks/client/Client.d.mts +1 -1
  83. package/dist/esm/api/resources/agentWebhooks/client/Client.mjs +1 -1
  84. package/dist/esm/api/resources/agents/client/Client.d.mts +20 -2
  85. package/dist/esm/api/resources/agents/client/Client.mjs +56 -2
  86. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +1 -0
  87. package/dist/esm/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.d.mts +11 -0
  88. package/dist/esm/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.mjs +2 -0
  89. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +1 -0
  90. package/dist/esm/api/resources/agents/client/requests/index.d.mts +1 -0
  91. package/dist/esm/api/resources/calls/client/Client.d.mts +27 -3
  92. package/dist/esm/api/resources/calls/client/Client.mjs +68 -4
  93. package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +8 -0
  94. package/dist/esm/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.d.mts +9 -0
  95. package/dist/esm/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.mjs +2 -0
  96. package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
  97. package/dist/esm/api/resources/contacts/client/Client.d.mts +94 -0
  98. package/dist/esm/api/resources/contacts/client/Client.mjs +304 -0
  99. package/dist/esm/api/resources/contacts/client/index.d.mts +1 -0
  100. package/dist/esm/api/resources/contacts/client/index.mjs +1 -0
  101. package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +13 -0
  102. package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.mjs +2 -0
  103. package/dist/esm/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.d.mts +9 -0
  104. package/dist/esm/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.mjs +2 -0
  105. package/dist/esm/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.d.mts +9 -0
  106. package/dist/esm/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.mjs +2 -0
  107. package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +9 -0
  108. package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.mjs +2 -0
  109. package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.d.mts +13 -0
  110. package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.mjs +2 -0
  111. package/dist/esm/api/resources/contacts/client/requests/index.d.mts +5 -0
  112. package/dist/esm/api/resources/contacts/client/requests/index.mjs +1 -0
  113. package/dist/esm/api/resources/contacts/index.d.mts +1 -0
  114. package/dist/esm/api/resources/contacts/index.mjs +1 -0
  115. package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -1
  116. package/dist/esm/api/resources/conversations/client/Client.mjs +1 -1
  117. package/dist/esm/api/resources/index.d.mts +4 -0
  118. package/dist/esm/api/resources/index.mjs +4 -0
  119. package/dist/esm/api/resources/messages/client/Client.d.mts +49 -0
  120. package/dist/esm/api/resources/messages/client/Client.mjs +146 -0
  121. package/dist/esm/api/resources/messages/client/index.d.mts +1 -0
  122. package/dist/esm/api/resources/messages/client/index.mjs +1 -0
  123. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +15 -0
  124. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +2 -0
  125. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +11 -0
  126. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +2 -0
  127. package/dist/esm/api/resources/messages/client/requests/index.d.mts +2 -0
  128. package/dist/esm/api/resources/messages/client/requests/index.mjs +1 -0
  129. package/dist/esm/api/resources/messages/index.d.mts +1 -0
  130. package/dist/esm/api/resources/messages/index.mjs +1 -0
  131. package/dist/esm/api/resources/numbers/client/Client.d.mts +1 -1
  132. package/dist/esm/api/resources/numbers/client/Client.mjs +1 -1
  133. package/dist/esm/api/resources/usage/client/Client.d.mts +1 -1
  134. package/dist/esm/api/resources/usage/client/Client.mjs +1 -1
  135. package/dist/esm/api/resources/webhooks/client/Client.d.mts +6 -6
  136. package/dist/esm/api/resources/webhooks/client/Client.mjs +6 -6
  137. package/dist/esm/api/types/AgentNumberResponse.d.mts +1 -0
  138. package/dist/esm/api/types/AgentResponse.d.mts +1 -0
  139. package/dist/esm/api/types/CallSummary.d.mts +1 -1
  140. package/dist/esm/api/types/ContactListResponse.d.mts +6 -0
  141. package/dist/esm/api/types/ContactListResponse.mjs +2 -0
  142. package/dist/esm/api/types/ContactResponse.d.mts +9 -0
  143. package/dist/esm/api/types/ContactResponse.mjs +2 -0
  144. package/dist/esm/api/types/MessageInConversation.d.mts +2 -0
  145. package/dist/esm/api/types/MessageResponse.d.mts +2 -0
  146. package/dist/esm/api/types/PhoneNumberResponse.d.mts +1 -0
  147. package/dist/esm/api/types/SendMessageResponse.d.mts +7 -0
  148. package/dist/esm/api/types/SendMessageResponse.mjs +2 -0
  149. package/dist/esm/api/types/SendReactionResponse.d.mts +6 -0
  150. package/dist/esm/api/types/SendReactionResponse.mjs +2 -0
  151. package/dist/esm/api/types/WebhookCreateRequest.d.mts +1 -0
  152. package/dist/esm/api/types/WebhookResponse.d.mts +1 -0
  153. package/dist/esm/api/types/index.d.mts +4 -0
  154. package/dist/esm/api/types/index.mjs +4 -0
  155. package/dist/esm/version.d.mts +1 -1
  156. package/dist/esm/version.mjs +1 -1
  157. package/package.json +1 -1
  158. package/reference.md +737 -126
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "agentphone",
46
- "X-Fern-SDK-Version": "1.0.1",
47
- "User-Agent": "agentphone/1.0.1",
46
+ "X-Fern-SDK-Version": "1.0.3",
47
+ "User-Agent": "agentphone/1.0.3",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,7 +1,9 @@
1
1
  import { AgentsClient } from "./api/resources/agents/client/Client.js";
2
2
  import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.js";
3
3
  import { CallsClient } from "./api/resources/calls/client/Client.js";
4
+ import { ContactsClient } from "./api/resources/contacts/client/Client.js";
4
5
  import { ConversationsClient } from "./api/resources/conversations/client/Client.js";
6
+ import { MessagesClient } from "./api/resources/messages/client/Client.js";
5
7
  import { NumbersClient } from "./api/resources/numbers/client/Client.js";
6
8
  import { UsageClient } from "./api/resources/usage/client/Client.js";
7
9
  import { WebhooksClient } from "./api/resources/webhooks/client/Client.js";
@@ -18,15 +20,19 @@ export declare class AgentPhoneClient {
18
20
  protected _numbers: NumbersClient | undefined;
19
21
  protected _webhooks: WebhooksClient | undefined;
20
22
  protected _agentWebhooks: AgentWebhooksClient | undefined;
23
+ protected _contacts: ContactsClient | undefined;
21
24
  protected _conversations: ConversationsClient | undefined;
22
25
  protected _calls: CallsClient | undefined;
23
26
  protected _usage: UsageClient | undefined;
27
+ protected _messages: MessagesClient | undefined;
24
28
  constructor(options: AgentPhoneClient.Options);
25
29
  get agents(): AgentsClient;
26
30
  get numbers(): NumbersClient;
27
31
  get webhooks(): WebhooksClient;
28
32
  get agentWebhooks(): AgentWebhooksClient;
33
+ get contacts(): ContactsClient;
29
34
  get conversations(): ConversationsClient;
30
35
  get calls(): CallsClient;
31
36
  get usage(): UsageClient;
37
+ get messages(): MessagesClient;
32
38
  }
@@ -5,10 +5,12 @@ exports.AgentPhoneClient = void 0;
5
5
  const Client_js_1 = require("./api/resources/agents/client/Client.js");
6
6
  const Client_js_2 = require("./api/resources/agentWebhooks/client/Client.js");
7
7
  const Client_js_3 = require("./api/resources/calls/client/Client.js");
8
- const Client_js_4 = require("./api/resources/conversations/client/Client.js");
9
- const Client_js_5 = require("./api/resources/numbers/client/Client.js");
10
- const Client_js_6 = require("./api/resources/usage/client/Client.js");
11
- const Client_js_7 = require("./api/resources/webhooks/client/Client.js");
8
+ const Client_js_4 = require("./api/resources/contacts/client/Client.js");
9
+ const Client_js_5 = require("./api/resources/conversations/client/Client.js");
10
+ const Client_js_6 = require("./api/resources/messages/client/Client.js");
11
+ const Client_js_7 = require("./api/resources/numbers/client/Client.js");
12
+ const Client_js_8 = require("./api/resources/usage/client/Client.js");
13
+ const Client_js_9 = require("./api/resources/webhooks/client/Client.js");
12
14
  const BaseClient_js_1 = require("./BaseClient.js");
13
15
  class AgentPhoneClient {
14
16
  constructor(options) {
@@ -20,19 +22,23 @@ class AgentPhoneClient {
20
22
  }
21
23
  get numbers() {
22
24
  var _a;
23
- return ((_a = this._numbers) !== null && _a !== void 0 ? _a : (this._numbers = new Client_js_5.NumbersClient(this._options)));
25
+ return ((_a = this._numbers) !== null && _a !== void 0 ? _a : (this._numbers = new Client_js_7.NumbersClient(this._options)));
24
26
  }
25
27
  get webhooks() {
26
28
  var _a;
27
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_7.WebhooksClient(this._options)));
29
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_js_9.WebhooksClient(this._options)));
28
30
  }
29
31
  get agentWebhooks() {
30
32
  var _a;
31
33
  return ((_a = this._agentWebhooks) !== null && _a !== void 0 ? _a : (this._agentWebhooks = new Client_js_2.AgentWebhooksClient(this._options)));
32
34
  }
35
+ get contacts() {
36
+ var _a;
37
+ return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Client_js_4.ContactsClient(this._options)));
38
+ }
33
39
  get conversations() {
34
40
  var _a;
35
- return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Client_js_4.ConversationsClient(this._options)));
41
+ return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new Client_js_5.ConversationsClient(this._options)));
36
42
  }
37
43
  get calls() {
38
44
  var _a;
@@ -40,7 +46,11 @@ class AgentPhoneClient {
40
46
  }
41
47
  get usage() {
42
48
  var _a;
43
- return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Client_js_6.UsageClient(this._options)));
49
+ return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Client_js_8.UsageClient(this._options)));
50
+ }
51
+ get messages() {
52
+ var _a;
53
+ return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new Client_js_6.MessagesClient(this._options)));
44
54
  }
45
55
  }
46
56
  exports.AgentPhoneClient = AgentPhoneClient;
@@ -28,7 +28,7 @@ export declare class AgentWebhooksClient {
28
28
  /**
29
29
  * Register or update a webhook URL for a specific agent.
30
30
  *
31
- * When set, this agent's events are delivered here instead of the project default webhook.
31
+ * When set, this agent's events are delivered here instead of the account default webhook.
32
32
  *
33
33
  * @param {AgentPhone.CreateOrUpdateAgentWebhookV1AgentsAgentIdWebhookPostRequest} request
34
34
  * @param {AgentWebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -109,7 +109,7 @@ class AgentWebhooksClient {
109
109
  /**
110
110
  * Register or update a webhook URL for a specific agent.
111
111
  *
112
- * When set, this agent's events are delivered here instead of the project default webhook.
112
+ * When set, this agent's events are delivered here instead of the account default webhook.
113
113
  *
114
114
  * @param {AgentPhone.CreateOrUpdateAgentWebhookV1AgentsAgentIdWebhookPostRequest} request
115
115
  * @param {AgentWebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -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
- * List all agents for this project.
14
+ * List all agents for this account.
15
15
  *
16
16
  * @param {AgentPhone.ListAgentsV1AgentsGetRequest} request
17
17
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -98,7 +98,7 @@ export declare class AgentsClient {
98
98
  /**
99
99
  * Attach an existing phone number to an agent.
100
100
  *
101
- * The number must belong to the same project and not be released.
101
+ * The number must belong to the same account and not be released.
102
102
  *
103
103
  * @param {AgentPhone.AttachNumberRequest} request
104
104
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -113,6 +113,24 @@ export declare class AgentsClient {
113
113
  */
114
114
  attachNumberToAgent(request: AgentPhone.AttachNumberRequest, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.AttachNumberResponse>;
115
115
  private __attachNumberToAgent;
116
+ /**
117
+ * Detach a phone number from an agent (sets agentId to null).
118
+ *
119
+ * The number remains active and can be re-attached to any agent.
120
+ *
121
+ * @param {AgentPhone.DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest} request
122
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
123
+ *
124
+ * @throws {@link AgentPhone.UnprocessableEntityError}
125
+ *
126
+ * @example
127
+ * await client.agents.detachNumberFromAgent({
128
+ * agent_id: "agent_id",
129
+ * number_id: "number_id"
130
+ * })
131
+ */
132
+ detachNumberFromAgent(request: AgentPhone.DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<unknown>;
133
+ private __detachNumberFromAgent;
116
134
  /**
117
135
  * List all conversations for an agent.
118
136
  *
@@ -67,7 +67,7 @@ class AgentsClient {
67
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
68
  }
69
69
  /**
70
- * List all agents for this project.
70
+ * List all agents for this account.
71
71
  *
72
72
  * @param {AgentPhone.ListAgentsV1AgentsGetRequest} request
73
73
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -343,7 +343,7 @@ class AgentsClient {
343
343
  /**
344
344
  * Attach an existing phone number to an agent.
345
345
  *
346
- * The number must belong to the same project and not be released.
346
+ * The number must belong to the same account and not be released.
347
347
  *
348
348
  * @param {AgentPhone.AttachNumberRequest} request
349
349
  * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -397,6 +397,60 @@ class AgentsClient {
397
397
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/agents/{agent_id}/numbers");
398
398
  });
399
399
  }
400
+ /**
401
+ * Detach a phone number from an agent (sets agentId to null).
402
+ *
403
+ * The number remains active and can be re-attached to any agent.
404
+ *
405
+ * @param {AgentPhone.DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest} request
406
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
407
+ *
408
+ * @throws {@link AgentPhone.UnprocessableEntityError}
409
+ *
410
+ * @example
411
+ * await client.agents.detachNumberFromAgent({
412
+ * agent_id: "agent_id",
413
+ * number_id: "number_id"
414
+ * })
415
+ */
416
+ detachNumberFromAgent(request, requestOptions) {
417
+ return core.HttpResponsePromise.fromPromise(this.__detachNumberFromAgent(request, requestOptions));
418
+ }
419
+ __detachNumberFromAgent(request, requestOptions) {
420
+ return __awaiter(this, void 0, void 0, function* () {
421
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
422
+ const { agent_id: agentId, number_id: numberId } = request;
423
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
424
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
425
+ const _response = yield core.fetcher({
426
+ 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.Default, `v1/agents/${core.url.encodePathParam(agentId)}/numbers/${core.url.encodePathParam(numberId)}`),
427
+ method: "DELETE",
428
+ headers: _headers,
429
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
430
+ 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,
431
+ 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,
432
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
433
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
434
+ logging: this._options.logging,
435
+ });
436
+ if (_response.ok) {
437
+ return { data: _response.body, rawResponse: _response.rawResponse };
438
+ }
439
+ if (_response.error.reason === "status-code") {
440
+ switch (_response.error.statusCode) {
441
+ case 422:
442
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
443
+ default:
444
+ throw new errors.AgentPhoneError({
445
+ statusCode: _response.error.statusCode,
446
+ body: _response.error.body,
447
+ rawResponse: _response.rawResponse,
448
+ });
449
+ }
450
+ }
451
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/agents/{agent_id}/numbers/{number_id}");
452
+ });
453
+ }
400
454
  /**
401
455
  * List all conversations for an agent.
402
456
  *
@@ -12,4 +12,5 @@ export interface CreateAgentRequest {
12
12
  beginMessage?: string | null;
13
13
  voice?: string | null;
14
14
  transferNumber?: string | null;
15
+ voicemailMessage?: string | null;
15
16
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * agent_id: "agent_id",
5
+ * number_id: "number_id"
6
+ * }
7
+ */
8
+ export interface DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest {
9
+ agent_id: string;
10
+ number_id: string;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -13,4 +13,5 @@ export interface UpdateAgentRequest {
13
13
  beginMessage?: string | null;
14
14
  voice?: string | null;
15
15
  transferNumber?: string | null;
16
+ voicemailMessage?: string | null;
16
17
  }
@@ -1,6 +1,7 @@
1
1
  export type { AttachNumberRequest } from "./AttachNumberRequest.js";
2
2
  export type { CreateAgentRequest } from "./CreateAgentRequest.js";
3
3
  export type { DeleteAgentV1AgentsAgentIdDeleteRequest } from "./DeleteAgentV1AgentsAgentIdDeleteRequest.js";
4
+ export type { DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest } from "./DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.js";
4
5
  export type { GetAgentV1AgentsAgentIdGetRequest } from "./GetAgentV1AgentsAgentIdGetRequest.js";
5
6
  export type { ListAgentCallsV1AgentsAgentIdCallsGetRequest } from "./ListAgentCallsV1AgentsAgentIdCallsGetRequest.js";
6
7
  export type { ListAgentConversationsV1AgentsAgentIdConversationsGetRequest } from "./ListAgentConversationsV1AgentsAgentIdConversationsGetRequest.js";
@@ -11,7 +11,7 @@ export declare class CallsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<CallsClient.Options>;
12
12
  constructor(options: CallsClient.Options);
13
13
  /**
14
- * List all calls for this project.
14
+ * List all calls for this account.
15
15
  *
16
16
  * @param {AgentPhone.ListCallsV1CallsGetRequest} request
17
17
  * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -31,7 +31,7 @@ export declare class CallsClient {
31
31
  * to use as caller ID; if omitted, the first assigned number is used.
32
32
  *
33
33
  * Flow:
34
- * 1. Validates the agent belongs to your project and has a phone number
34
+ * 1. Validates the agent belongs to your account and has a phone number
35
35
  * 2. Initiates a call from the agent's number to the destination
36
36
  * 3. When recipient answers, speaks the initial greeting (if provided)
37
37
  * 4. Listens for recipient's speech and sends to your webhook
@@ -58,7 +58,7 @@ export declare class CallsClient {
58
58
  * expires 30 seconds after creation.
59
59
  *
60
60
  * Flow:
61
- * 1. Validates the agent belongs to your project
61
+ * 1. Validates the agent belongs to your account
62
62
  * 2. Creates a web call and returns an access token
63
63
  * 3. Your client calls `webClient.startCall({ accessToken })` to connect
64
64
  * 4. Call lifecycle (transcripts, webhooks) works the same as phone calls
@@ -109,6 +109,30 @@ export declare class CallsClient {
109
109
  */
110
110
  getCallTranscript(request: AgentPhone.GetCallTranscriptV1CallsCallIdTranscriptGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
111
111
  private __getCallTranscript;
112
+ /**
113
+ * Stream a call's transcript via Server-Sent Events.
114
+ *
115
+ * On connect the server replays all existing transcript turns from the
116
+ * database, then streams new turns in real time as they arrive from the
117
+ * voice provider. A ``: heartbeat`` comment is sent every 15 s to keep
118
+ * proxies alive. The stream closes after sending an ``ended`` event
119
+ * when the call completes (or immediately after replay if the call has
120
+ * already ended).
121
+ *
122
+ * Works for both live and completed calls — same URL either way.
123
+ *
124
+ * @param {AgentPhone.StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest} request
125
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
126
+ *
127
+ * @throws {@link AgentPhone.UnprocessableEntityError}
128
+ *
129
+ * @example
130
+ * await client.calls.streamCallTranscript({
131
+ * call_id: "call_id"
132
+ * })
133
+ */
134
+ streamCallTranscript(request: AgentPhone.StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
135
+ private __streamCallTranscript;
112
136
  /**
113
137
  * List all calls for a specific phone number.
114
138
  *
@@ -56,7 +56,7 @@ class CallsClient {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
58
  /**
59
- * List all calls for this project.
59
+ * List all calls for this account.
60
60
  *
61
61
  * @param {AgentPhone.ListCallsV1CallsGetRequest} request
62
62
  * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -72,10 +72,14 @@ class CallsClient {
72
72
  __listCalls() {
73
73
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
74
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
- const { limit, offset } = request;
75
+ const { limit, offset, status, direction, type: type_, search } = request;
76
76
  const _queryParams = {
77
77
  limit,
78
78
  offset,
79
+ status,
80
+ direction,
81
+ type: type_,
82
+ search,
79
83
  };
80
84
  const _authRequest = yield this._options.authProvider.getAuthRequest();
81
85
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
@@ -116,7 +120,7 @@ class CallsClient {
116
120
  * to use as caller ID; if omitted, the first assigned number is used.
117
121
  *
118
122
  * Flow:
119
- * 1. Validates the agent belongs to your project and has a phone number
123
+ * 1. Validates the agent belongs to your account and has a phone number
120
124
  * 2. Initiates a call from the agent's number to the destination
121
125
  * 3. When recipient answers, speaks the initial greeting (if provided)
122
126
  * 4. Listens for recipient's speech and sends to your webhook
@@ -181,7 +185,7 @@ class CallsClient {
181
185
  * expires 30 seconds after creation.
182
186
  *
183
187
  * Flow:
184
- * 1. Validates the agent belongs to your project
188
+ * 1. Validates the agent belongs to your account
185
189
  * 2. Creates a web call and returns an access token
186
190
  * 3. Your client calls `webClient.startCall({ accessToken })` to connect
187
191
  * 4. Call lifecycle (transcripts, webhooks) works the same as phone calls
@@ -342,6 +346,66 @@ class CallsClient {
342
346
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}/transcript");
343
347
  });
344
348
  }
349
+ /**
350
+ * Stream a call's transcript via Server-Sent Events.
351
+ *
352
+ * On connect the server replays all existing transcript turns from the
353
+ * database, then streams new turns in real time as they arrive from the
354
+ * voice provider. A ``: heartbeat`` comment is sent every 15 s to keep
355
+ * proxies alive. The stream closes after sending an ``ended`` event
356
+ * when the call completes (or immediately after replay if the call has
357
+ * already ended).
358
+ *
359
+ * Works for both live and completed calls — same URL either way.
360
+ *
361
+ * @param {AgentPhone.StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest} request
362
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
363
+ *
364
+ * @throws {@link AgentPhone.UnprocessableEntityError}
365
+ *
366
+ * @example
367
+ * await client.calls.streamCallTranscript({
368
+ * call_id: "call_id"
369
+ * })
370
+ */
371
+ streamCallTranscript(request, requestOptions) {
372
+ return core.HttpResponsePromise.fromPromise(this.__streamCallTranscript(request, requestOptions));
373
+ }
374
+ __streamCallTranscript(request, requestOptions) {
375
+ return __awaiter(this, void 0, void 0, function* () {
376
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
377
+ const { call_id: callId } = request;
378
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
379
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
380
+ const _response = yield core.fetcher({
381
+ 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.Default, `v1/calls/${core.url.encodePathParam(callId)}/transcript/stream`),
382
+ method: "GET",
383
+ headers: _headers,
384
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
385
+ 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,
386
+ 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,
387
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
388
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
389
+ logging: this._options.logging,
390
+ });
391
+ if (_response.ok) {
392
+ return { data: _response.body, rawResponse: _response.rawResponse };
393
+ }
394
+ if (_response.error.reason === "status-code") {
395
+ switch (_response.error.statusCode) {
396
+ case 422:
397
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
398
+ default:
399
+ throw new errors.AgentPhoneError({
400
+ statusCode: _response.error.statusCode,
401
+ body: _response.error.body,
402
+ rawResponse: _response.rawResponse,
403
+ });
404
+ }
405
+ }
406
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}/transcript/stream");
407
+ });
408
+ }
345
409
  /**
346
410
  * List all calls for a specific phone number.
347
411
  *
@@ -5,4 +5,12 @@
5
5
  export interface ListCallsV1CallsGetRequest {
6
6
  limit?: number;
7
7
  offset?: number;
8
+ /** Filter by status: completed, in-progress, failed */
9
+ status?: string | null;
10
+ /** Filter by direction: inbound, outbound */
11
+ direction?: string | null;
12
+ /** Filter by type: pstn, web */
13
+ type?: string | null;
14
+ /** Search fromNumber or toNumber (contains) */
15
+ search?: string | null;
8
16
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * call_id: "call_id"
5
+ * }
6
+ */
7
+ export interface StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest {
8
+ call_id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,3 +4,4 @@ export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCa
4
4
  export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.js";
5
5
  export type { ListCallsForNumberV1NumbersNumberIdCallsGetRequest } from "./ListCallsForNumberV1NumbersNumberIdCallsGetRequest.js";
6
6
  export type { ListCallsV1CallsGetRequest } from "./ListCallsV1CallsGetRequest.js";
7
+ export type { StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest } from "./StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.js";
@@ -0,0 +1,94 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as AgentPhone from "../../../index.js";
5
+ export declare namespace ContactsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class ContactsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ContactsClient.Options>;
12
+ constructor(options: ContactsClient.Options);
13
+ /**
14
+ * List all contacts for this account.
15
+ *
16
+ * Optional `search` query filters by name or phone number (case-insensitive contains).
17
+ *
18
+ * @param {AgentPhone.ListContactsV1ContactsGetRequest} request
19
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link AgentPhone.UnprocessableEntityError}
22
+ *
23
+ * @example
24
+ * await client.contacts.listContacts()
25
+ */
26
+ listContacts(request?: AgentPhone.ListContactsV1ContactsGetRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactListResponse>;
27
+ private __listContacts;
28
+ /**
29
+ * Create a new contact.
30
+ *
31
+ * Phone number is normalized to E.164 format. Returns 409 if a contact
32
+ * with this phone number already exists for the project.
33
+ *
34
+ * @param {AgentPhone.CreateContactRequest} request
35
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link AgentPhone.UnprocessableEntityError}
38
+ *
39
+ * @example
40
+ * await client.contacts.createContact({
41
+ * phoneNumber: "phoneNumber",
42
+ * name: "name"
43
+ * })
44
+ */
45
+ createContact(request: AgentPhone.CreateContactRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactResponse>;
46
+ private __createContact;
47
+ /**
48
+ * Get a single contact by ID.
49
+ *
50
+ * @param {AgentPhone.GetContactV1ContactsContactIdGetRequest} request
51
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
52
+ *
53
+ * @throws {@link AgentPhone.UnprocessableEntityError}
54
+ *
55
+ * @example
56
+ * await client.contacts.getContact({
57
+ * contact_id: "contact_id"
58
+ * })
59
+ */
60
+ getContact(request: AgentPhone.GetContactV1ContactsContactIdGetRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactResponse>;
61
+ private __getContact;
62
+ /**
63
+ * Delete a contact.
64
+ *
65
+ * @param {AgentPhone.DeleteContactV1ContactsContactIdDeleteRequest} request
66
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
67
+ *
68
+ * @throws {@link AgentPhone.UnprocessableEntityError}
69
+ *
70
+ * @example
71
+ * await client.contacts.deleteContact({
72
+ * contact_id: "contact_id"
73
+ * })
74
+ */
75
+ deleteContact(request: AgentPhone.DeleteContactV1ContactsContactIdDeleteRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<void>;
76
+ private __deleteContact;
77
+ /**
78
+ * Update a contact's fields.
79
+ *
80
+ * If phoneNumber is updated, it's re-normalized and checked for uniqueness (409 on conflict).
81
+ *
82
+ * @param {AgentPhone.UpdateContactRequest} request
83
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
84
+ *
85
+ * @throws {@link AgentPhone.UnprocessableEntityError}
86
+ *
87
+ * @example
88
+ * await client.contacts.updateContact({
89
+ * contact_id: "contact_id"
90
+ * })
91
+ */
92
+ updateContact(request: AgentPhone.UpdateContactRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactResponse>;
93
+ private __updateContact;
94
+ }