agentphone 1.0.5 → 1.0.7

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 (108) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
  3. package/dist/cjs/api/resources/agents/client/Client.js +1 -1
  4. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +20 -0
  5. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +12 -0
  6. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +20 -0
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +12 -0
  8. package/dist/cjs/api/resources/calls/client/Client.d.ts +26 -0
  9. package/dist/cjs/api/resources/calls/client/Client.js +61 -0
  10. package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
  11. package/dist/cjs/api/resources/calls/client/requests/CreateWebCallRequest.d.ts +2 -0
  12. package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.js +3 -0
  14. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/conversations/client/Client.d.ts +19 -0
  16. package/dist/cjs/api/resources/conversations/client/Client.js +55 -0
  17. package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.ts +9 -0
  18. package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js +3 -0
  19. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/index.d.ts +1 -0
  21. package/dist/cjs/api/resources/index.js +1 -0
  22. package/dist/cjs/api/resources/messages/client/Client.d.ts +18 -0
  23. package/dist/cjs/api/resources/messages/client/Client.js +18 -0
  24. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +1 -0
  25. package/dist/cjs/api/resources/usage/client/Client.d.ts +27 -0
  26. package/dist/cjs/api/resources/usage/client/Client.js +97 -0
  27. package/dist/cjs/api/resources/usage/client/requests/GetUsageByAgentV1UsageByAgentGetRequest.d.ts +12 -0
  28. package/dist/cjs/api/resources/usage/client/requests/GetUsageByAgentV1UsageByAgentGetRequest.js +3 -0
  29. package/dist/cjs/api/resources/usage/client/requests/index.d.ts +1 -0
  30. package/dist/cjs/api/resources/usage/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/usage/index.js +1 -0
  32. package/dist/cjs/api/resources/usage/types/GetUsageByAgentV1UsageByAgentGetRequestPeriod.d.ts +6 -0
  33. package/dist/cjs/api/resources/usage/types/GetUsageByAgentV1UsageByAgentGetRequestPeriod.js +9 -0
  34. package/dist/cjs/api/resources/usage/types/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/usage/types/index.js +17 -0
  36. package/dist/cjs/api/types/AgentResponse.d.ts +20 -0
  37. package/dist/cjs/api/types/AgentResponse.js +12 -0
  38. package/dist/cjs/api/types/AgentUsageItem.d.ts +8 -0
  39. package/dist/cjs/api/types/AgentUsageItem.js +3 -0
  40. package/dist/cjs/api/types/AgentUsageResponse.d.ts +7 -0
  41. package/dist/cjs/api/types/AgentUsageResponse.js +3 -0
  42. package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
  43. package/dist/cjs/api/types/NumberUsageItem.d.ts +10 -0
  44. package/dist/cjs/api/types/NumberUsageItem.js +3 -0
  45. package/dist/cjs/api/types/NumberUsageResponse.d.ts +4 -0
  46. package/dist/cjs/api/types/NumberUsageResponse.js +3 -0
  47. package/dist/cjs/api/types/SendMessageResponse.d.ts +1 -0
  48. package/dist/cjs/api/types/SendTypingResponse.d.ts +5 -0
  49. package/dist/cjs/api/types/SendTypingResponse.js +3 -0
  50. package/dist/cjs/api/types/index.d.ts +5 -0
  51. package/dist/cjs/api/types/index.js +5 -0
  52. package/dist/cjs/version.d.ts +1 -1
  53. package/dist/cjs/version.js +1 -1
  54. package/dist/esm/BaseClient.mjs +2 -2
  55. package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
  56. package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
  57. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +20 -0
  58. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +12 -0
  59. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +20 -0
  60. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +12 -0
  61. package/dist/esm/api/resources/calls/client/Client.d.mts +26 -0
  62. package/dist/esm/api/resources/calls/client/Client.mjs +61 -0
  63. package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
  64. package/dist/esm/api/resources/calls/client/requests/CreateWebCallRequest.d.mts +2 -0
  65. package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.mts +9 -0
  66. package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs +2 -0
  67. package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
  68. package/dist/esm/api/resources/conversations/client/Client.d.mts +19 -0
  69. package/dist/esm/api/resources/conversations/client/Client.mjs +55 -0
  70. package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.mts +9 -0
  71. package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.mjs +2 -0
  72. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +1 -0
  73. package/dist/esm/api/resources/index.d.mts +1 -0
  74. package/dist/esm/api/resources/index.mjs +1 -0
  75. package/dist/esm/api/resources/messages/client/Client.d.mts +18 -0
  76. package/dist/esm/api/resources/messages/client/Client.mjs +18 -0
  77. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +1 -0
  78. package/dist/esm/api/resources/usage/client/Client.d.mts +27 -0
  79. package/dist/esm/api/resources/usage/client/Client.mjs +97 -0
  80. package/dist/esm/api/resources/usage/client/requests/GetUsageByAgentV1UsageByAgentGetRequest.d.mts +12 -0
  81. package/dist/esm/api/resources/usage/client/requests/GetUsageByAgentV1UsageByAgentGetRequest.mjs +2 -0
  82. package/dist/esm/api/resources/usage/client/requests/index.d.mts +1 -0
  83. package/dist/esm/api/resources/usage/index.d.mts +1 -0
  84. package/dist/esm/api/resources/usage/index.mjs +1 -0
  85. package/dist/esm/api/resources/usage/types/GetUsageByAgentV1UsageByAgentGetRequestPeriod.d.mts +6 -0
  86. package/dist/esm/api/resources/usage/types/GetUsageByAgentV1UsageByAgentGetRequestPeriod.mjs +6 -0
  87. package/dist/esm/api/resources/usage/types/index.d.mts +1 -0
  88. package/dist/esm/api/resources/usage/types/index.mjs +1 -0
  89. package/dist/esm/api/types/AgentResponse.d.mts +20 -0
  90. package/dist/esm/api/types/AgentResponse.mjs +12 -0
  91. package/dist/esm/api/types/AgentUsageItem.d.mts +8 -0
  92. package/dist/esm/api/types/AgentUsageItem.mjs +2 -0
  93. package/dist/esm/api/types/AgentUsageResponse.d.mts +7 -0
  94. package/dist/esm/api/types/AgentUsageResponse.mjs +2 -0
  95. package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
  96. package/dist/esm/api/types/NumberUsageItem.d.mts +10 -0
  97. package/dist/esm/api/types/NumberUsageItem.mjs +2 -0
  98. package/dist/esm/api/types/NumberUsageResponse.d.mts +4 -0
  99. package/dist/esm/api/types/NumberUsageResponse.mjs +2 -0
  100. package/dist/esm/api/types/SendMessageResponse.d.mts +1 -0
  101. package/dist/esm/api/types/SendTypingResponse.d.mts +5 -0
  102. package/dist/esm/api/types/SendTypingResponse.mjs +2 -0
  103. package/dist/esm/api/types/index.d.mts +5 -0
  104. package/dist/esm/api/types/index.mjs +5 -0
  105. package/dist/esm/version.d.mts +1 -1
  106. package/dist/esm/version.mjs +1 -1
  107. package/package.json +1 -1
  108. package/reference.md +286 -1
@@ -16,5 +16,6 @@ export * from "./numbers/client/requests/index.mjs";
16
16
  export * as numbers from "./numbers/index.mjs";
17
17
  export * from "./usage/client/requests/index.mjs";
18
18
  export * as usage from "./usage/index.mjs";
19
+ export * from "./usage/types/index.mjs";
19
20
  export * from "./webhooks/client/requests/index.mjs";
20
21
  export * as webhooks from "./webhooks/index.mjs";
@@ -16,5 +16,6 @@ export * from "./numbers/client/requests/index.mjs";
16
16
  export * as numbers from "./numbers/index.mjs";
17
17
  export * from "./usage/client/requests/index.mjs";
18
18
  export * as usage from "./usage/index.mjs";
19
+ export * from "./usage/types/index.mjs";
19
20
  export * from "./webhooks/client/requests/index.mjs";
20
21
  export * as webhooks from "./webhooks/index.mjs";
@@ -13,6 +13,24 @@ export declare class MessagesClient {
13
13
  /**
14
14
  * Send an outbound message (SMS or iMessage) via the provider assigned to the number.
15
15
  *
16
+ * Supports single attachments via `media_url` or multiple attachments via `media_urls`. You may use one or the other, but not both.
17
+ *
18
+ * ### Carousel / multi-image (iMessage)
19
+ *
20
+ * To send a carousel of images on iMessage, pass 2-20 URLs in `media_urls`. Requirements:
21
+ * - Each URL must be a **publicly accessible HTTPS link** to an image (JPEG, PNG, GIF, etc.)
22
+ * - Minimum 2 URLs, maximum 20
23
+ * - `body` must be omitted or empty (text cannot be sent alongside a carousel)
24
+ * - Only supported on iMessage-capable lines
25
+ *
26
+ * ### Single attachment
27
+ *
28
+ * Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
29
+ *
30
+ * ### Multi-attachment (iMessage)
31
+ *
32
+ * Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
33
+ *
16
34
  * @param {AgentPhone.SendMessageRequest} request
17
35
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
18
36
  *
@@ -33,6 +33,24 @@ export class MessagesClient {
33
33
  /**
34
34
  * Send an outbound message (SMS or iMessage) via the provider assigned to the number.
35
35
  *
36
+ * Supports single attachments via `media_url` or multiple attachments via `media_urls`. You may use one or the other, but not both.
37
+ *
38
+ * ### Carousel / multi-image (iMessage)
39
+ *
40
+ * To send a carousel of images on iMessage, pass 2-20 URLs in `media_urls`. Requirements:
41
+ * - Each URL must be a **publicly accessible HTTPS link** to an image (JPEG, PNG, GIF, etc.)
42
+ * - Minimum 2 URLs, maximum 20
43
+ * - `body` must be omitted or empty (text cannot be sent alongside a carousel)
44
+ * - Only supported on iMessage-capable lines
45
+ *
46
+ * ### Single attachment
47
+ *
48
+ * Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
49
+ *
50
+ * ### Multi-attachment (iMessage)
51
+ *
52
+ * Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
53
+ *
36
54
  * @param {AgentPhone.SendMessageRequest} request
37
55
  * @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
38
56
  *
@@ -11,5 +11,6 @@ export interface SendMessageRequest {
11
11
  to_number: string;
12
12
  body: string;
13
13
  media_url?: string | null;
14
+ media_urls?: string[] | null;
14
15
  number_id?: string | null;
15
16
  }
@@ -54,4 +54,31 @@ export declare class UsageClient {
54
54
  */
55
55
  getMonthlyUsage(request?: AgentPhone.GetMonthlyUsageV1UsageMonthlyGetRequest, requestOptions?: UsageClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MonthlyUsageResponse>;
56
56
  private __getMonthlyUsage;
57
+ /**
58
+ * Get usage statistics broken down by phone number, with linked agent info.
59
+ *
60
+ * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @example
63
+ * await client.usage.getUsageByNumber()
64
+ */
65
+ getUsageByNumber(requestOptions?: UsageClient.RequestOptions): core.HttpResponsePromise<AgentPhone.NumberUsageResponse>;
66
+ private __getUsageByNumber;
67
+ /**
68
+ * Get usage broken down by agent for the current calendar week, month, or year.
69
+ * Includes message count, completed call count, and total call seconds per agent.
70
+ * Calls/messages with no agent attached are bucketed as "Unassigned".
71
+ *
72
+ * @param {AgentPhone.GetUsageByAgentV1UsageByAgentGetRequest} request
73
+ * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link AgentPhone.UnprocessableEntityError}
76
+ *
77
+ * @example
78
+ * await client.usage.getUsageByAgent({
79
+ * period: "week"
80
+ * })
81
+ */
82
+ getUsageByAgent(request: AgentPhone.GetUsageByAgentV1UsageByAgentGetRequest, requestOptions?: UsageClient.RequestOptions): core.HttpResponsePromise<AgentPhone.AgentUsageResponse>;
83
+ private __getUsageByAgent;
57
84
  }
@@ -171,4 +171,101 @@ export class UsageClient {
171
171
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage/monthly");
172
172
  });
173
173
  }
174
+ /**
175
+ * Get usage statistics broken down by phone number, with linked agent info.
176
+ *
177
+ * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration.
178
+ *
179
+ * @example
180
+ * await client.usage.getUsageByNumber()
181
+ */
182
+ getUsageByNumber(requestOptions) {
183
+ return core.HttpResponsePromise.fromPromise(this.__getUsageByNumber(requestOptions));
184
+ }
185
+ __getUsageByNumber(requestOptions) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
188
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
189
+ 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);
190
+ const _response = yield core.fetcher({
191
+ 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/usage/by-number"),
192
+ method: "GET",
193
+ headers: _headers,
194
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
195
+ 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,
196
+ 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,
197
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
198
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
199
+ logging: this._options.logging,
200
+ });
201
+ if (_response.ok) {
202
+ return { data: _response.body, rawResponse: _response.rawResponse };
203
+ }
204
+ if (_response.error.reason === "status-code") {
205
+ throw new errors.AgentPhoneError({
206
+ statusCode: _response.error.statusCode,
207
+ body: _response.error.body,
208
+ rawResponse: _response.rawResponse,
209
+ });
210
+ }
211
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage/by-number");
212
+ });
213
+ }
214
+ /**
215
+ * Get usage broken down by agent for the current calendar week, month, or year.
216
+ * Includes message count, completed call count, and total call seconds per agent.
217
+ * Calls/messages with no agent attached are bucketed as "Unassigned".
218
+ *
219
+ * @param {AgentPhone.GetUsageByAgentV1UsageByAgentGetRequest} request
220
+ * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration.
221
+ *
222
+ * @throws {@link AgentPhone.UnprocessableEntityError}
223
+ *
224
+ * @example
225
+ * await client.usage.getUsageByAgent({
226
+ * period: "week"
227
+ * })
228
+ */
229
+ getUsageByAgent(request, requestOptions) {
230
+ return core.HttpResponsePromise.fromPromise(this.__getUsageByAgent(request, requestOptions));
231
+ }
232
+ __getUsageByAgent(request, requestOptions) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
235
+ const { period, tz } = request;
236
+ const _queryParams = {
237
+ period,
238
+ tz,
239
+ };
240
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
241
+ 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);
242
+ const _response = yield core.fetcher({
243
+ 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/usage/by-agent"),
244
+ method: "GET",
245
+ headers: _headers,
246
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
247
+ 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,
248
+ 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,
249
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
250
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
251
+ logging: this._options.logging,
252
+ });
253
+ if (_response.ok) {
254
+ return { data: _response.body, rawResponse: _response.rawResponse };
255
+ }
256
+ if (_response.error.reason === "status-code") {
257
+ switch (_response.error.statusCode) {
258
+ case 422:
259
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
260
+ default:
261
+ throw new errors.AgentPhoneError({
262
+ statusCode: _response.error.statusCode,
263
+ body: _response.error.body,
264
+ rawResponse: _response.rawResponse,
265
+ });
266
+ }
267
+ }
268
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/usage/by-agent");
269
+ });
270
+ }
174
271
  }
@@ -0,0 +1,12 @@
1
+ import type * as AgentPhone from "../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * period: "week"
6
+ * }
7
+ */
8
+ export interface GetUsageByAgentV1UsageByAgentGetRequest {
9
+ period: AgentPhone.GetUsageByAgentV1UsageByAgentGetRequestPeriod;
10
+ /** IANA timezone, e.g. America/New_York */
11
+ tz?: string | null;
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,2 +1,3 @@
1
1
  export type { GetDailyUsageV1UsageDailyGetRequest } from "./GetDailyUsageV1UsageDailyGetRequest.mjs";
2
2
  export type { GetMonthlyUsageV1UsageMonthlyGetRequest } from "./GetMonthlyUsageV1UsageMonthlyGetRequest.mjs";
3
+ export type { GetUsageByAgentV1UsageByAgentGetRequest } from "./GetUsageByAgentV1UsageByAgentGetRequest.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -1 +1,2 @@
1
1
  export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,6 @@
1
+ export declare const GetUsageByAgentV1UsageByAgentGetRequestPeriod: {
2
+ readonly Week: "week";
3
+ readonly Month: "month";
4
+ readonly Year: "year";
5
+ };
6
+ export type GetUsageByAgentV1UsageByAgentGetRequestPeriod = (typeof GetUsageByAgentV1UsageByAgentGetRequestPeriod)[keyof typeof GetUsageByAgentV1UsageByAgentGetRequestPeriod];
@@ -0,0 +1,6 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const GetUsageByAgentV1UsageByAgentGetRequestPeriod = {
3
+ Week: "week",
4
+ Month: "month",
5
+ Year: "year",
6
+ };
@@ -0,0 +1 @@
1
+ export * from "./GetUsageByAgentV1UsageByAgentGetRequestPeriod.mjs";
@@ -0,0 +1 @@
1
+ export * from "./GetUsageByAgentV1UsageByAgentGetRequestPeriod.mjs";
@@ -12,6 +12,12 @@ export interface AgentResponse {
12
12
  voicemailMessage?: string | null;
13
13
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
14
14
  sttMode?: AgentResponse.SttMode;
15
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
16
+ ambientSound?: AgentResponse.AmbientSound;
17
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
18
+ denoisingMode?: AgentResponse.DenoisingMode;
19
+ /** Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min). */
20
+ maxSilenceMs?: number;
15
21
  createdAt: string;
16
22
  numbers?: AgentPhone.AgentNumberResponse[] | null;
17
23
  }
@@ -33,4 +39,18 @@ export declare namespace AgentResponse {
33
39
  readonly Accurate: "accurate";
34
40
  };
35
41
  type SttMode = (typeof SttMode)[keyof typeof SttMode];
42
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
43
+ const AmbientSound: {
44
+ readonly None: "none";
45
+ readonly Office: "office";
46
+ readonly CoffeeShop: "coffee-shop";
47
+ readonly Outdoor: "outdoor";
48
+ };
49
+ type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
50
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
51
+ const DenoisingMode: {
52
+ readonly NoiseCancellation: "noise-cancellation";
53
+ readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
54
+ };
55
+ type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
36
56
  }
@@ -15,4 +15,16 @@ export var AgentResponse;
15
15
  Fast: "fast",
16
16
  Accurate: "accurate",
17
17
  };
18
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
19
+ AgentResponse.AmbientSound = {
20
+ None: "none",
21
+ Office: "office",
22
+ CoffeeShop: "coffee-shop",
23
+ Outdoor: "outdoor",
24
+ };
25
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
26
+ AgentResponse.DenoisingMode = {
27
+ NoiseCancellation: "noise-cancellation",
28
+ NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
29
+ };
18
30
  })(AgentResponse || (AgentResponse = {}));
@@ -0,0 +1,8 @@
1
+ export interface AgentUsageItem {
2
+ agentId: string | null;
3
+ agentName: string;
4
+ messages: number;
5
+ calls: number;
6
+ totalSeconds: number;
7
+ isOrphan?: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type * as AgentPhone from "../index.mjs";
2
+ export interface AgentUsageResponse {
3
+ data: AgentPhone.AgentUsageItem[];
4
+ period: string;
5
+ periodStart: string;
6
+ periodEnd: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -7,6 +7,7 @@ export interface MessageInConversation {
7
7
  direction: string;
8
8
  channel?: string | null;
9
9
  mediaUrl?: string | null;
10
+ mediaUrls?: string[];
10
11
  receivedAt: string;
11
12
  reactions?: AgentPhone.ReactionInConversation[];
12
13
  }
@@ -0,0 +1,10 @@
1
+ export interface NumberUsageItem {
2
+ numberId: string;
3
+ phoneNumber: string;
4
+ country: string;
5
+ status: string;
6
+ agentId?: string | null;
7
+ agentName?: string | null;
8
+ messages: number;
9
+ calls: number;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ import type * as AgentPhone from "../index.mjs";
2
+ export interface NumberUsageResponse {
3
+ data: AgentPhone.NumberUsageItem[];
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -4,4 +4,5 @@ export interface SendMessageResponse {
4
4
  channel: string;
5
5
  from_number: string;
6
6
  to_number: string;
7
+ media_urls?: string[];
7
8
  }
@@ -0,0 +1,5 @@
1
+ export interface SendTypingResponse {
2
+ conversationId: string;
3
+ channel: string;
4
+ status: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,6 +1,8 @@
1
1
  export * from "./AgentListResponse.mjs";
2
2
  export * from "./AgentNumberResponse.mjs";
3
3
  export * from "./AgentResponse.mjs";
4
+ export * from "./AgentUsageItem.mjs";
5
+ export * from "./AgentUsageResponse.mjs";
4
6
  export * from "./AllTimeStatsResponse.mjs";
5
7
  export * from "./AppRoutesAgentsConversationListResponse.mjs";
6
8
  export * from "./AppRoutesAgentsConversationSummary.mjs";
@@ -23,6 +25,8 @@ export * from "./MessagesListResponse.mjs";
23
25
  export * from "./MonthlyUsagePoint.mjs";
24
26
  export * from "./MonthlyUsageResponse.mjs";
25
27
  export * from "./NumberLimits.mjs";
28
+ export * from "./NumberUsageItem.mjs";
29
+ export * from "./NumberUsageResponse.mjs";
26
30
  export * from "./PaginatedDeliveriesResponse.mjs";
27
31
  export * from "./PhoneNumberListResponse.mjs";
28
32
  export * from "./PhoneNumberResponse.mjs";
@@ -31,6 +35,7 @@ export * from "./PlanLimits.mjs";
31
35
  export * from "./ReactionInConversation.mjs";
32
36
  export * from "./SendMessageResponse.mjs";
33
37
  export * from "./SendReactionResponse.mjs";
38
+ export * from "./SendTypingResponse.mjs";
34
39
  export * from "./UsageResponse.mjs";
35
40
  export * from "./UsageStats.mjs";
36
41
  export * from "./ValidationError.mjs";
@@ -1,6 +1,8 @@
1
1
  export * from "./AgentListResponse.mjs";
2
2
  export * from "./AgentNumberResponse.mjs";
3
3
  export * from "./AgentResponse.mjs";
4
+ export * from "./AgentUsageItem.mjs";
5
+ export * from "./AgentUsageResponse.mjs";
4
6
  export * from "./AllTimeStatsResponse.mjs";
5
7
  export * from "./AppRoutesAgentsConversationListResponse.mjs";
6
8
  export * from "./AppRoutesAgentsConversationSummary.mjs";
@@ -23,6 +25,8 @@ export * from "./MessagesListResponse.mjs";
23
25
  export * from "./MonthlyUsagePoint.mjs";
24
26
  export * from "./MonthlyUsageResponse.mjs";
25
27
  export * from "./NumberLimits.mjs";
28
+ export * from "./NumberUsageItem.mjs";
29
+ export * from "./NumberUsageResponse.mjs";
26
30
  export * from "./PaginatedDeliveriesResponse.mjs";
27
31
  export * from "./PhoneNumberListResponse.mjs";
28
32
  export * from "./PhoneNumberResponse.mjs";
@@ -31,6 +35,7 @@ export * from "./PlanLimits.mjs";
31
35
  export * from "./ReactionInConversation.mjs";
32
36
  export * from "./SendMessageResponse.mjs";
33
37
  export * from "./SendReactionResponse.mjs";
38
+ export * from "./SendTypingResponse.mjs";
34
39
  export * from "./UsageResponse.mjs";
35
40
  export * from "./UsageStats.mjs";
36
41
  export * from "./ValidationError.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.5";
1
+ export declare const SDK_VERSION = "1.0.7";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.5";
1
+ export const SDK_VERSION = "1.0.7";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentphone",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",