agentphone 1.0.4 → 1.0.6

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 (137) hide show
  1. package/README.md +10 -10
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +4 -1
  4. package/dist/cjs/Client.js +24 -19
  5. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +50 -0
  6. package/dist/cjs/api/resources/agentSignup/client/Client.js +170 -0
  7. package/dist/cjs/api/resources/agentSignup/client/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/agentSignup/client/index.js +17 -0
  9. package/dist/cjs/api/resources/agentSignup/client/requests/AgentSignUpRequest.d.ts +10 -0
  10. package/dist/cjs/api/resources/agentSignup/client/requests/AgentSignUpRequest.js +3 -0
  11. package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +11 -0
  12. package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.js +3 -0
  13. package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/agentSignup/client/requests/index.js +2 -0
  15. package/dist/cjs/api/resources/agentSignup/index.d.ts +1 -0
  16. package/dist/cjs/api/resources/agentSignup/index.js +17 -0
  17. package/dist/cjs/api/resources/agentWebhooks/client/Client.d.ts +1 -1
  18. package/dist/cjs/api/resources/agentWebhooks/client/Client.js +6 -6
  19. package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
  20. package/dist/cjs/api/resources/agents/client/Client.js +11 -11
  21. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +41 -2
  22. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +30 -0
  23. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +41 -2
  24. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +30 -0
  25. package/dist/cjs/api/resources/agents/client/requests/index.d.ts +2 -2
  26. package/dist/cjs/api/resources/agents/client/requests/index.js +5 -0
  27. package/dist/cjs/api/resources/calls/client/Client.d.ts +27 -1
  28. package/dist/cjs/api/resources/calls/client/Client.js +69 -8
  29. package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
  30. package/dist/cjs/api/resources/calls/client/requests/CreateWebCallRequest.d.ts +2 -0
  31. package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.ts +9 -0
  32. package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.js +3 -0
  33. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
  34. package/dist/cjs/api/resources/contacts/client/Client.d.ts +1 -1
  35. package/dist/cjs/api/resources/contacts/client/Client.js +6 -6
  36. package/dist/cjs/api/resources/conversations/client/Client.d.ts +20 -1
  37. package/dist/cjs/api/resources/conversations/client/Client.js +60 -5
  38. package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.ts +9 -0
  39. package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js +3 -0
  40. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/index.d.ts +2 -0
  42. package/dist/cjs/api/resources/index.js +3 -1
  43. package/dist/cjs/api/resources/messages/client/Client.d.ts +1 -1
  44. package/dist/cjs/api/resources/messages/client/Client.js +3 -3
  45. package/dist/cjs/api/resources/numbers/client/Client.d.ts +1 -1
  46. package/dist/cjs/api/resources/numbers/client/Client.js +5 -5
  47. package/dist/cjs/api/resources/usage/client/Client.d.ts +11 -1
  48. package/dist/cjs/api/resources/usage/client/Client.js +44 -4
  49. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +1 -1
  50. package/dist/cjs/api/resources/webhooks/client/Client.js +8 -8
  51. package/dist/cjs/api/types/AgentResponse.d.ts +41 -2
  52. package/dist/cjs/api/types/AgentResponse.js +30 -0
  53. package/dist/cjs/api/types/MessageInConversation.d.ts +2 -0
  54. package/dist/cjs/api/types/NumberUsageItem.d.ts +10 -0
  55. package/dist/cjs/api/types/NumberUsageItem.js +3 -0
  56. package/dist/cjs/api/types/NumberUsageResponse.d.ts +4 -0
  57. package/dist/cjs/api/types/NumberUsageResponse.js +3 -0
  58. package/dist/cjs/api/types/ReactionInConversation.d.ts +7 -0
  59. package/dist/cjs/api/types/ReactionInConversation.js +3 -0
  60. package/dist/cjs/api/types/SendTypingResponse.d.ts +5 -0
  61. package/dist/cjs/api/types/SendTypingResponse.js +3 -0
  62. package/dist/cjs/api/types/index.d.ts +4 -0
  63. package/dist/cjs/api/types/index.js +4 -0
  64. package/dist/cjs/auth/BearerAuthProvider.d.ts +1 -1
  65. package/dist/cjs/environments.d.ts +2 -2
  66. package/dist/cjs/environments.js +1 -1
  67. package/dist/cjs/version.d.ts +1 -1
  68. package/dist/cjs/version.js +1 -1
  69. package/dist/esm/BaseClient.mjs +2 -2
  70. package/dist/esm/Client.d.mts +4 -1
  71. package/dist/esm/Client.mjs +6 -1
  72. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +50 -0
  73. package/dist/esm/api/resources/agentSignup/client/Client.mjs +133 -0
  74. package/dist/esm/api/resources/agentSignup/client/index.d.mts +1 -0
  75. package/dist/esm/api/resources/agentSignup/client/index.mjs +1 -0
  76. package/dist/esm/api/resources/agentSignup/client/requests/AgentSignUpRequest.d.mts +10 -0
  77. package/dist/esm/api/resources/agentSignup/client/requests/AgentSignUpRequest.mjs +2 -0
  78. package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +11 -0
  79. package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.mjs +2 -0
  80. package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +2 -0
  81. package/dist/esm/api/resources/agentSignup/client/requests/index.mjs +1 -0
  82. package/dist/esm/api/resources/agentSignup/index.d.mts +1 -0
  83. package/dist/esm/api/resources/agentSignup/index.mjs +1 -0
  84. package/dist/esm/api/resources/agentWebhooks/client/Client.d.mts +1 -1
  85. package/dist/esm/api/resources/agentWebhooks/client/Client.mjs +6 -6
  86. package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
  87. package/dist/esm/api/resources/agents/client/Client.mjs +11 -11
  88. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +41 -2
  89. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +29 -1
  90. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +41 -2
  91. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +29 -1
  92. package/dist/esm/api/resources/agents/client/requests/index.d.mts +2 -2
  93. package/dist/esm/api/resources/agents/client/requests/index.mjs +2 -1
  94. package/dist/esm/api/resources/calls/client/Client.d.mts +27 -1
  95. package/dist/esm/api/resources/calls/client/Client.mjs +69 -8
  96. package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
  97. package/dist/esm/api/resources/calls/client/requests/CreateWebCallRequest.d.mts +2 -0
  98. package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.mts +9 -0
  99. package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs +2 -0
  100. package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
  101. package/dist/esm/api/resources/contacts/client/Client.d.mts +1 -1
  102. package/dist/esm/api/resources/contacts/client/Client.mjs +6 -6
  103. package/dist/esm/api/resources/conversations/client/Client.d.mts +20 -1
  104. package/dist/esm/api/resources/conversations/client/Client.mjs +60 -5
  105. package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.mts +9 -0
  106. package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.mjs +2 -0
  107. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +1 -0
  108. package/dist/esm/api/resources/index.d.mts +2 -0
  109. package/dist/esm/api/resources/index.mjs +2 -0
  110. package/dist/esm/api/resources/messages/client/Client.d.mts +1 -1
  111. package/dist/esm/api/resources/messages/client/Client.mjs +3 -3
  112. package/dist/esm/api/resources/numbers/client/Client.d.mts +1 -1
  113. package/dist/esm/api/resources/numbers/client/Client.mjs +5 -5
  114. package/dist/esm/api/resources/usage/client/Client.d.mts +11 -1
  115. package/dist/esm/api/resources/usage/client/Client.mjs +44 -4
  116. package/dist/esm/api/resources/webhooks/client/Client.d.mts +1 -1
  117. package/dist/esm/api/resources/webhooks/client/Client.mjs +8 -8
  118. package/dist/esm/api/types/AgentResponse.d.mts +41 -2
  119. package/dist/esm/api/types/AgentResponse.mjs +29 -1
  120. package/dist/esm/api/types/MessageInConversation.d.mts +2 -0
  121. package/dist/esm/api/types/NumberUsageItem.d.mts +10 -0
  122. package/dist/esm/api/types/NumberUsageItem.mjs +2 -0
  123. package/dist/esm/api/types/NumberUsageResponse.d.mts +4 -0
  124. package/dist/esm/api/types/NumberUsageResponse.mjs +2 -0
  125. package/dist/esm/api/types/ReactionInConversation.d.mts +7 -0
  126. package/dist/esm/api/types/ReactionInConversation.mjs +2 -0
  127. package/dist/esm/api/types/SendTypingResponse.d.mts +5 -0
  128. package/dist/esm/api/types/SendTypingResponse.mjs +2 -0
  129. package/dist/esm/api/types/index.d.mts +4 -0
  130. package/dist/esm/api/types/index.mjs +4 -0
  131. package/dist/esm/auth/BearerAuthProvider.d.mts +1 -1
  132. package/dist/esm/environments.d.mts +2 -2
  133. package/dist/esm/environments.mjs +1 -1
  134. package/dist/esm/version.d.mts +1 -1
  135. package/dist/esm/version.mjs +1 -1
  136. package/package.json +1 -1
  137. package/reference.md +338 -0
@@ -9,7 +9,7 @@ export declare namespace ConversationsClient {
9
9
  }
10
10
  export declare class ConversationsClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<ConversationsClient.Options>;
12
- constructor(options: ConversationsClient.Options);
12
+ constructor(options?: ConversationsClient.Options);
13
13
  /**
14
14
  * List all conversations for this account.
15
15
  *
@@ -79,4 +79,23 @@ export declare class ConversationsClient {
79
79
  */
80
80
  getConversationMessages(request: AgentPhone.GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MessagesListResponse>;
81
81
  private __getConversationMessages;
82
+ /**
83
+ * Show a typing indicator in the conversation (iMessage only).
84
+ *
85
+ * Best-effort: providers may silently drop the indicator if the chat hasn't
86
+ * had recent activity, the recipient isn't on iMessage, or it's a group chat.
87
+ * Indicators auto-expire after a few seconds — no "stop typing" call needed.
88
+ *
89
+ * @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
90
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
91
+ *
92
+ * @throws {@link AgentPhone.UnprocessableEntityError}
93
+ *
94
+ * @example
95
+ * await client.conversations.sendTypingIndicator({
96
+ * conversation_id: "conversation_id"
97
+ * })
98
+ */
99
+ sendTypingIndicator(request: AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendTypingResponse>;
100
+ private __sendTypingIndicator;
82
101
  }
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
63
63
  const errors = __importStar(require("../../../../errors/index.js"));
64
64
  const AgentPhone = __importStar(require("../../../index.js"));
65
65
  class ConversationsClient {
66
- constructor(options) {
66
+ constructor(options = {}) {
67
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
68
  }
69
69
  /**
@@ -93,7 +93,7 @@ class ConversationsClient {
93
93
  const _authRequest = yield this._options.authProvider.getAuthRequest();
94
94
  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);
95
95
  const _response = yield core.fetcher({
96
- 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/conversations"),
96
+ 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/conversations"),
97
97
  method: "GET",
98
98
  headers: _headers,
99
99
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -150,7 +150,7 @@ class ConversationsClient {
150
150
  const _authRequest = yield this._options.authProvider.getAuthRequest();
151
151
  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);
152
152
  const _response = yield core.fetcher({
153
- 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/conversations/${core.url.encodePathParam(conversationId)}`),
153
+ 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/conversations/${core.url.encodePathParam(conversationId)}`),
154
154
  method: "GET",
155
155
  headers: _headers,
156
156
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -208,7 +208,7 @@ class ConversationsClient {
208
208
  const _authRequest = yield this._options.authProvider.getAuthRequest();
209
209
  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);
210
210
  const _response = yield core.fetcher({
211
- 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/conversations/${core.url.encodePathParam(conversationId)}`),
211
+ 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/conversations/${core.url.encodePathParam(conversationId)}`),
212
212
  method: "PATCH",
213
213
  headers: _headers,
214
214
  contentType: "application/json",
@@ -269,7 +269,7 @@ class ConversationsClient {
269
269
  const _authRequest = yield this._options.authProvider.getAuthRequest();
270
270
  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);
271
271
  const _response = yield core.fetcher({
272
- 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/conversations/${core.url.encodePathParam(conversationId)}/messages`),
272
+ 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/conversations/${core.url.encodePathParam(conversationId)}/messages`),
273
273
  method: "GET",
274
274
  headers: _headers,
275
275
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -297,5 +297,60 @@ class ConversationsClient {
297
297
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/conversations/{conversation_id}/messages");
298
298
  });
299
299
  }
300
+ /**
301
+ * Show a typing indicator in the conversation (iMessage only).
302
+ *
303
+ * Best-effort: providers may silently drop the indicator if the chat hasn't
304
+ * had recent activity, the recipient isn't on iMessage, or it's a group chat.
305
+ * Indicators auto-expire after a few seconds — no "stop typing" call needed.
306
+ *
307
+ * @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
308
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
309
+ *
310
+ * @throws {@link AgentPhone.UnprocessableEntityError}
311
+ *
312
+ * @example
313
+ * await client.conversations.sendTypingIndicator({
314
+ * conversation_id: "conversation_id"
315
+ * })
316
+ */
317
+ sendTypingIndicator(request, requestOptions) {
318
+ return core.HttpResponsePromise.fromPromise(this.__sendTypingIndicator(request, requestOptions));
319
+ }
320
+ __sendTypingIndicator(request, requestOptions) {
321
+ return __awaiter(this, void 0, void 0, function* () {
322
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
323
+ const { conversation_id: conversationId } = request;
324
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
325
+ 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);
326
+ const _response = yield core.fetcher({
327
+ 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/conversations/${core.url.encodePathParam(conversationId)}/typing`),
328
+ method: "POST",
329
+ headers: _headers,
330
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
331
+ 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,
332
+ 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,
333
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
334
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
335
+ logging: this._options.logging,
336
+ });
337
+ if (_response.ok) {
338
+ return { data: _response.body, rawResponse: _response.rawResponse };
339
+ }
340
+ if (_response.error.reason === "status-code") {
341
+ switch (_response.error.statusCode) {
342
+ case 422:
343
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
344
+ default:
345
+ throw new errors.AgentPhoneError({
346
+ statusCode: _response.error.statusCode,
347
+ body: _response.error.body,
348
+ rawResponse: _response.rawResponse,
349
+ });
350
+ }
351
+ }
352
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/typing");
353
+ });
354
+ }
300
355
  }
301
356
  exports.ConversationsClient = ConversationsClient;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * conversation_id: "conversation_id"
5
+ * }
6
+ */
7
+ export interface SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest {
8
+ conversation_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 });
@@ -1,4 +1,5 @@
1
1
  export type { GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest } from "./GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest.js";
2
2
  export type { GetConversationV1ConversationsConversationIdGetRequest } from "./GetConversationV1ConversationsConversationIdGetRequest.js";
3
3
  export type { ListConversationsV1ConversationsGetRequest } from "./ListConversationsV1ConversationsGetRequest.js";
4
+ export type { SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest } from "./SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js";
4
5
  export type { UpdateConversationRequest } from "./UpdateConversationRequest.js";
@@ -1,3 +1,5 @@
1
+ export * from "./agentSignup/client/requests/index.js";
2
+ export * as agentSignup from "./agentSignup/index.js";
1
3
  export * from "./agents/client/requests/index.js";
2
4
  export * as agents from "./agents/index.js";
3
5
  export * from "./agentWebhooks/client/requests/index.js";
@@ -36,7 +36,9 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.calls = exports.agentWebhooks = exports.agents = void 0;
39
+ exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
40
+ __exportStar(require("./agentSignup/client/requests/index.js"), exports);
41
+ exports.agentSignup = __importStar(require("./agentSignup/index.js"));
40
42
  __exportStar(require("./agents/client/requests/index.js"), exports);
41
43
  exports.agents = __importStar(require("./agents/index.js"));
42
44
  __exportStar(require("./agentWebhooks/client/requests/index.js"), exports);
@@ -9,7 +9,7 @@ export declare namespace MessagesClient {
9
9
  }
10
10
  export declare class MessagesClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<MessagesClient.Options>;
12
- constructor(options: MessagesClient.Options);
12
+ constructor(options?: MessagesClient.Options);
13
13
  /**
14
14
  * Send an outbound message (SMS or iMessage) via the provider assigned to the number.
15
15
  *
@@ -63,7 +63,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
63
63
  const errors = __importStar(require("../../../../errors/index.js"));
64
64
  const AgentPhone = __importStar(require("../../../index.js"));
65
65
  class MessagesClient {
66
- constructor(options) {
66
+ constructor(options = {}) {
67
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
68
  }
69
69
  /**
@@ -90,7 +90,7 @@ class MessagesClient {
90
90
  const _authRequest = yield this._options.authProvider.getAuthRequest();
91
91
  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);
92
92
  const _response = yield core.fetcher({
93
- 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/messages"),
93
+ 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/messages"),
94
94
  method: "POST",
95
95
  headers: _headers,
96
96
  contentType: "application/json",
@@ -148,7 +148,7 @@ class MessagesClient {
148
148
  const _authRequest = yield this._options.authProvider.getAuthRequest();
149
149
  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);
150
150
  const _response = yield core.fetcher({
151
- 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/messages/${core.url.encodePathParam(messageId)}/reactions`),
151
+ 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/messages/${core.url.encodePathParam(messageId)}/reactions`),
152
152
  method: "POST",
153
153
  headers: _headers,
154
154
  contentType: "application/json",
@@ -9,7 +9,7 @@ export declare namespace NumbersClient {
9
9
  }
10
10
  export declare class NumbersClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<NumbersClient.Options>;
12
- constructor(options: NumbersClient.Options);
12
+ constructor(options?: NumbersClient.Options);
13
13
  /**
14
14
  * List all phone numbers for this account.
15
15
  *
@@ -52,7 +52,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
52
52
  const errors = __importStar(require("../../../../errors/index.js"));
53
53
  const AgentPhone = __importStar(require("../../../index.js"));
54
54
  class NumbersClient {
55
- constructor(options) {
55
+ constructor(options = {}) {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
58
  /**
@@ -80,7 +80,7 @@ class NumbersClient {
80
80
  const _authRequest = yield this._options.authProvider.getAuthRequest();
81
81
  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);
82
82
  const _response = yield core.fetcher({
83
- 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/numbers"),
83
+ 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"),
84
84
  method: "GET",
85
85
  headers: _headers,
86
86
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -134,7 +134,7 @@ class NumbersClient {
134
134
  const _authRequest = yield this._options.authProvider.getAuthRequest();
135
135
  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);
136
136
  const _response = yield core.fetcher({
137
- 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/numbers"),
137
+ 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"),
138
138
  method: "POST",
139
139
  headers: _headers,
140
140
  contentType: "application/json",
@@ -195,7 +195,7 @@ class NumbersClient {
195
195
  const _authRequest = yield this._options.authProvider.getAuthRequest();
196
196
  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);
197
197
  const _response = yield core.fetcher({
198
- 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/numbers/${core.url.encodePathParam(numberId)}/messages`),
198
+ 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)}/messages`),
199
199
  method: "GET",
200
200
  headers: _headers,
201
201
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -253,7 +253,7 @@ class NumbersClient {
253
253
  const _authRequest = yield this._options.authProvider.getAuthRequest();
254
254
  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);
255
255
  const _response = yield core.fetcher({
256
- 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/numbers/${core.url.encodePathParam(numberId)}`),
256
+ 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)}`),
257
257
  method: "DELETE",
258
258
  headers: _headers,
259
259
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -9,7 +9,7 @@ export declare namespace UsageClient {
9
9
  }
10
10
  export declare class UsageClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<UsageClient.Options>;
12
- constructor(options: UsageClient.Options);
12
+ constructor(options?: UsageClient.Options);
13
13
  /**
14
14
  * Get usage statistics for the current account.
15
15
  *
@@ -54,4 +54,14 @@ 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;
57
67
  }
@@ -52,7 +52,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
52
52
  const errors = __importStar(require("../../../../errors/index.js"));
53
53
  const AgentPhone = __importStar(require("../../../index.js"));
54
54
  class UsageClient {
55
- constructor(options) {
55
+ constructor(options = {}) {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
58
  /**
@@ -78,7 +78,7 @@ class UsageClient {
78
78
  const _authRequest = yield this._options.authProvider.getAuthRequest();
79
79
  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);
80
80
  const _response = yield core.fetcher({
81
- 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/usage"),
81
+ 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"),
82
82
  method: "GET",
83
83
  headers: _headers,
84
84
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -126,7 +126,7 @@ class UsageClient {
126
126
  const _authRequest = yield this._options.authProvider.getAuthRequest();
127
127
  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);
128
128
  const _response = yield core.fetcher({
129
- 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/usage/daily"),
129
+ 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/daily"),
130
130
  method: "GET",
131
131
  headers: _headers,
132
132
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -179,7 +179,7 @@ class UsageClient {
179
179
  const _authRequest = yield this._options.authProvider.getAuthRequest();
180
180
  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);
181
181
  const _response = yield core.fetcher({
182
- 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/usage/monthly"),
182
+ 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/monthly"),
183
183
  method: "GET",
184
184
  headers: _headers,
185
185
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -207,5 +207,45 @@ class UsageClient {
207
207
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/usage/monthly");
208
208
  });
209
209
  }
210
+ /**
211
+ * Get usage statistics broken down by phone number, with linked agent info.
212
+ *
213
+ * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration.
214
+ *
215
+ * @example
216
+ * await client.usage.getUsageByNumber()
217
+ */
218
+ getUsageByNumber(requestOptions) {
219
+ return core.HttpResponsePromise.fromPromise(this.__getUsageByNumber(requestOptions));
220
+ }
221
+ __getUsageByNumber(requestOptions) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
224
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
225
+ 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);
226
+ const _response = yield core.fetcher({
227
+ 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"),
228
+ method: "GET",
229
+ headers: _headers,
230
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
231
+ 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,
232
+ 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,
233
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
234
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
235
+ logging: this._options.logging,
236
+ });
237
+ if (_response.ok) {
238
+ return { data: _response.body, rawResponse: _response.rawResponse };
239
+ }
240
+ if (_response.error.reason === "status-code") {
241
+ throw new errors.AgentPhoneError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.body,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/usage/by-number");
248
+ });
249
+ }
210
250
  }
211
251
  exports.UsageClient = UsageClient;
@@ -9,7 +9,7 @@ export declare namespace WebhooksClient {
9
9
  }
10
10
  export declare class WebhooksClient {
11
11
  protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
12
- constructor(options: WebhooksClient.Options);
12
+ constructor(options?: WebhooksClient.Options);
13
13
  /**
14
14
  * Get the master webhook configuration for this account.
15
15
  *
@@ -52,7 +52,7 @@ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatu
52
52
  const errors = __importStar(require("../../../../errors/index.js"));
53
53
  const AgentPhone = __importStar(require("../../../index.js"));
54
54
  class WebhooksClient {
55
- constructor(options) {
55
+ constructor(options = {}) {
56
56
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
58
  /**
@@ -72,7 +72,7 @@ class WebhooksClient {
72
72
  const _authRequest = yield this._options.authProvider.getAuthRequest();
73
73
  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);
74
74
  const _response = yield core.fetcher({
75
- 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/webhooks"),
75
+ 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/webhooks"),
76
76
  method: "GET",
77
77
  headers: _headers,
78
78
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -123,7 +123,7 @@ class WebhooksClient {
123
123
  const _authRequest = yield this._options.authProvider.getAuthRequest();
124
124
  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);
125
125
  const _response = yield core.fetcher({
126
- 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/webhooks"),
126
+ 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/webhooks"),
127
127
  method: "POST",
128
128
  headers: _headers,
129
129
  contentType: "application/json",
@@ -171,7 +171,7 @@ class WebhooksClient {
171
171
  const _authRequest = yield this._options.authProvider.getAuthRequest();
172
172
  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);
173
173
  const _response = yield core.fetcher({
174
- 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/webhooks"),
174
+ 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/webhooks"),
175
175
  method: "DELETE",
176
176
  headers: _headers,
177
177
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -220,7 +220,7 @@ class WebhooksClient {
220
220
  const _authRequest = yield this._options.authProvider.getAuthRequest();
221
221
  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);
222
222
  const _response = yield core.fetcher({
223
- 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/webhooks/deliveries"),
223
+ 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/webhooks/deliveries"),
224
224
  method: "GET",
225
225
  headers: _headers,
226
226
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -275,7 +275,7 @@ class WebhooksClient {
275
275
  const _authRequest = yield this._options.authProvider.getAuthRequest();
276
276
  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);
277
277
  const _response = yield core.fetcher({
278
- 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/webhooks/deliveries/stats"),
278
+ 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/webhooks/deliveries/stats"),
279
279
  method: "GET",
280
280
  headers: _headers,
281
281
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -323,7 +323,7 @@ class WebhooksClient {
323
323
  const _authRequest = yield this._options.authProvider.getAuthRequest();
324
324
  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);
325
325
  const _response = yield core.fetcher({
326
- 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/webhooks/deliveries/all-time"),
326
+ 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/webhooks/deliveries/all-time"),
327
327
  method: "GET",
328
328
  headers: _headers,
329
329
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -374,7 +374,7 @@ class WebhooksClient {
374
374
  const _authRequest = yield this._options.authProvider.getAuthRequest();
375
375
  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);
376
376
  const _response = yield core.fetcher({
377
- 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/webhooks/test"),
377
+ 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/webhooks/test"),
378
378
  method: "POST",
379
379
  headers: _headers,
380
380
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -3,13 +3,52 @@ export interface AgentResponse {
3
3
  id: string;
4
4
  name: string;
5
5
  description: string | null;
6
- voiceMode: string;
7
- modelTier?: string;
6
+ voiceMode: AgentResponse.VoiceMode;
7
+ modelTier?: AgentResponse.ModelTier;
8
8
  systemPrompt?: string | null;
9
9
  beginMessage?: string | null;
10
10
  voice: string;
11
11
  transferNumber?: string | null;
12
12
  voicemailMessage?: string | null;
13
+ /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
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;
13
19
  createdAt: string;
14
20
  numbers?: AgentPhone.AgentNumberResponse[] | null;
15
21
  }
22
+ export declare namespace AgentResponse {
23
+ const VoiceMode: {
24
+ readonly Webhook: "webhook";
25
+ readonly Hosted: "hosted";
26
+ };
27
+ type VoiceMode = (typeof VoiceMode)[keyof typeof VoiceMode];
28
+ const ModelTier: {
29
+ readonly Turbo: "turbo";
30
+ readonly Balanced: "balanced";
31
+ readonly Max: "max";
32
+ };
33
+ type ModelTier = (typeof ModelTier)[keyof typeof ModelTier];
34
+ /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
35
+ const SttMode: {
36
+ readonly Fast: "fast";
37
+ readonly Accurate: "accurate";
38
+ };
39
+ type SttMode = (typeof SttMode)[keyof typeof SttMode];
40
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
41
+ const AmbientSound: {
42
+ readonly None: "none";
43
+ readonly Office: "office";
44
+ readonly CoffeeShop: "coffee-shop";
45
+ readonly Outdoor: "outdoor";
46
+ };
47
+ type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
48
+ /** 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). */
49
+ const DenoisingMode: {
50
+ readonly NoiseCancellation: "noise-cancellation";
51
+ readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
52
+ };
53
+ type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
54
+ }
@@ -1,3 +1,33 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AgentResponse = void 0;
5
+ var AgentResponse;
6
+ (function (AgentResponse) {
7
+ AgentResponse.VoiceMode = {
8
+ Webhook: "webhook",
9
+ Hosted: "hosted",
10
+ };
11
+ AgentResponse.ModelTier = {
12
+ Turbo: "turbo",
13
+ Balanced: "balanced",
14
+ Max: "max",
15
+ };
16
+ /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
17
+ AgentResponse.SttMode = {
18
+ Fast: "fast",
19
+ Accurate: "accurate",
20
+ };
21
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
22
+ AgentResponse.AmbientSound = {
23
+ None: "none",
24
+ Office: "office",
25
+ CoffeeShop: "coffee-shop",
26
+ Outdoor: "outdoor",
27
+ };
28
+ /** 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). */
29
+ AgentResponse.DenoisingMode = {
30
+ NoiseCancellation: "noise-cancellation",
31
+ NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
32
+ };
33
+ })(AgentResponse || (exports.AgentResponse = AgentResponse = {}));
@@ -1,3 +1,4 @@
1
+ import type * as AgentPhone from "../index.js";
1
2
  export interface MessageInConversation {
2
3
  id: string;
3
4
  body: string;
@@ -7,4 +8,5 @@ export interface MessageInConversation {
7
8
  channel?: string | null;
8
9
  mediaUrl?: string | null;
9
10
  receivedAt: string;
11
+ reactions?: AgentPhone.ReactionInConversation[];
10
12
  }
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import type * as AgentPhone from "../index.js";
2
+ export interface NumberUsageResponse {
3
+ data: AgentPhone.NumberUsageItem[];
4
+ }
@@ -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 });
@@ -0,0 +1,7 @@
1
+ export interface ReactionInConversation {
2
+ id: string;
3
+ reactionType: string;
4
+ fromNumber: string;
5
+ direction: string;
6
+ createdAt: string;
7
+ }
@@ -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 });