agentphone 1.0.14 → 1.0.16

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 (116) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +5 -0
  3. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +5 -0
  4. package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +4 -0
  5. package/dist/cjs/api/resources/contacts/client/Client.d.ts +20 -0
  6. package/dist/cjs/api/resources/contacts/client/Client.js +62 -0
  7. package/dist/cjs/api/resources/contacts/client/requests/GetContactCapabilitiesV1ContactsCapabilitiesGetRequest.d.ts +10 -0
  8. package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/conversations/client/Client.d.ts +8 -6
  10. package/dist/cjs/api/resources/conversations/client/Client.js +8 -6
  11. package/dist/cjs/api/resources/conversations/client/requests/UpdateConversationRequest.d.ts +2 -0
  12. package/dist/cjs/api/resources/messages/client/Client.d.ts +0 -1
  13. package/dist/cjs/api/resources/messages/client/Client.js +0 -1
  14. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +4 -2
  15. package/dist/cjs/api/resources/registration/client/Client.d.ts +36 -9
  16. package/dist/cjs/api/resources/registration/client/Client.js +67 -9
  17. package/dist/cjs/api/resources/registration/client/requests/GetRegistrationStatusV1RegisterStatusGetRequest.d.ts +8 -0
  18. package/dist/cjs/api/resources/registration/client/requests/GetRegistrationStatusV1RegisterStatusGetRequest.js +3 -0
  19. package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.d.ts +52 -30
  20. package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.js +9 -0
  21. package/dist/cjs/api/resources/registration/client/requests/index.d.ts +2 -1
  22. package/dist/cjs/api/resources/registration/client/requests/index.js +3 -0
  23. package/dist/cjs/api/resources/subAccounts/client/Client.d.ts +4 -1
  24. package/dist/cjs/api/resources/subAccounts/client/Client.js +23 -10
  25. package/dist/cjs/api/resources/subAccounts/client/requests/ListSubAccountsV1SubAccountsGetRequest.d.ts +8 -0
  26. package/dist/cjs/api/resources/subAccounts/client/requests/ListSubAccountsV1SubAccountsGetRequest.js +3 -0
  27. package/dist/cjs/api/resources/subAccounts/client/requests/index.d.ts +1 -0
  28. package/dist/cjs/api/types/AgentResponse.d.ts +3 -0
  29. package/dist/cjs/api/types/CampaignInclude.d.ts +7 -0
  30. package/dist/cjs/api/types/CampaignInclude.js +10 -0
  31. package/dist/cjs/api/types/CampaignStatusResponse.d.ts +4 -0
  32. package/dist/cjs/api/types/CampaignStatusResponse.js +3 -0
  33. package/dist/cjs/api/types/ContactCapabilitiesResponse.d.ts +6 -0
  34. package/dist/cjs/api/types/ContactCapabilitiesResponse.js +3 -0
  35. package/dist/cjs/api/types/ContactCapabilityFlags.d.ts +4 -0
  36. package/dist/cjs/api/types/ContactCapabilityFlags.js +3 -0
  37. package/dist/cjs/api/types/ContactTitle.d.ts +11 -0
  38. package/dist/cjs/api/types/ContactTitle.js +14 -0
  39. package/dist/cjs/api/types/CustomToolParam.d.ts +28 -0
  40. package/dist/cjs/api/types/CustomToolParam.js +12 -0
  41. package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
  42. package/dist/cjs/api/types/OrganizationType.d.ts +11 -0
  43. package/dist/cjs/api/types/OrganizationType.js +14 -0
  44. package/dist/cjs/api/types/RegistrationResponse.d.ts +2 -3
  45. package/dist/cjs/api/types/ReplyToInConversation.d.ts +5 -0
  46. package/dist/cjs/api/types/ReplyToInConversation.js +3 -0
  47. package/dist/cjs/api/types/SendMessageResponse.d.ts +1 -0
  48. package/dist/cjs/api/types/UseCase.d.ts +13 -0
  49. package/dist/cjs/api/types/UseCase.js +16 -0
  50. package/dist/cjs/api/types/Volume.d.ts +5 -0
  51. package/dist/cjs/api/types/Volume.js +8 -0
  52. package/dist/cjs/api/types/index.d.ts +10 -1
  53. package/dist/cjs/api/types/index.js +10 -1
  54. package/dist/cjs/version.d.ts +1 -1
  55. package/dist/cjs/version.js +1 -1
  56. package/dist/esm/BaseClient.mjs +2 -2
  57. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +5 -0
  58. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +5 -0
  59. package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +4 -0
  60. package/dist/esm/api/resources/contacts/client/Client.d.mts +20 -0
  61. package/dist/esm/api/resources/contacts/client/Client.mjs +62 -0
  62. package/dist/esm/api/resources/contacts/client/requests/GetContactCapabilitiesV1ContactsCapabilitiesGetRequest.d.mts +10 -0
  63. package/dist/esm/api/resources/contacts/client/requests/index.d.mts +1 -0
  64. package/dist/esm/api/resources/conversations/client/Client.d.mts +8 -6
  65. package/dist/esm/api/resources/conversations/client/Client.mjs +8 -6
  66. package/dist/esm/api/resources/conversations/client/requests/UpdateConversationRequest.d.mts +2 -0
  67. package/dist/esm/api/resources/messages/client/Client.d.mts +0 -1
  68. package/dist/esm/api/resources/messages/client/Client.mjs +0 -1
  69. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +4 -2
  70. package/dist/esm/api/resources/registration/client/Client.d.mts +36 -9
  71. package/dist/esm/api/resources/registration/client/Client.mjs +68 -10
  72. package/dist/esm/api/resources/registration/client/requests/GetRegistrationStatusV1RegisterStatusGetRequest.d.mts +8 -0
  73. package/dist/esm/api/resources/registration/client/requests/GetRegistrationStatusV1RegisterStatusGetRequest.mjs +2 -0
  74. package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.d.mts +52 -30
  75. package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.mjs +8 -1
  76. package/dist/esm/api/resources/registration/client/requests/index.d.mts +2 -1
  77. package/dist/esm/api/resources/registration/client/requests/index.mjs +1 -1
  78. package/dist/esm/api/resources/subAccounts/client/Client.d.mts +4 -1
  79. package/dist/esm/api/resources/subAccounts/client/Client.mjs +23 -10
  80. package/dist/esm/api/resources/subAccounts/client/requests/ListSubAccountsV1SubAccountsGetRequest.d.mts +8 -0
  81. package/dist/esm/api/resources/subAccounts/client/requests/ListSubAccountsV1SubAccountsGetRequest.mjs +2 -0
  82. package/dist/esm/api/resources/subAccounts/client/requests/index.d.mts +1 -0
  83. package/dist/esm/api/types/AgentResponse.d.mts +3 -0
  84. package/dist/esm/api/types/CampaignInclude.d.mts +7 -0
  85. package/dist/esm/api/types/CampaignInclude.mjs +7 -0
  86. package/dist/esm/api/types/CampaignStatusResponse.d.mts +4 -0
  87. package/dist/esm/api/types/CampaignStatusResponse.mjs +2 -0
  88. package/dist/esm/api/types/ContactCapabilitiesResponse.d.mts +6 -0
  89. package/dist/esm/api/types/ContactCapabilitiesResponse.mjs +2 -0
  90. package/dist/esm/api/types/ContactCapabilityFlags.d.mts +4 -0
  91. package/dist/esm/api/types/ContactCapabilityFlags.mjs +2 -0
  92. package/dist/esm/api/types/ContactTitle.d.mts +11 -0
  93. package/dist/esm/api/types/ContactTitle.mjs +11 -0
  94. package/dist/esm/api/types/CustomToolParam.d.mts +28 -0
  95. package/dist/esm/api/types/CustomToolParam.mjs +9 -0
  96. package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
  97. package/dist/esm/api/types/OrganizationType.d.mts +11 -0
  98. package/dist/esm/api/types/OrganizationType.mjs +11 -0
  99. package/dist/esm/api/types/RegistrationResponse.d.mts +2 -3
  100. package/dist/esm/api/types/ReplyToInConversation.d.mts +5 -0
  101. package/dist/esm/api/types/ReplyToInConversation.mjs +2 -0
  102. package/dist/esm/api/types/SendMessageResponse.d.mts +1 -0
  103. package/dist/esm/api/types/UseCase.d.mts +13 -0
  104. package/dist/esm/api/types/UseCase.mjs +13 -0
  105. package/dist/esm/api/types/Volume.d.mts +5 -0
  106. package/dist/esm/api/types/Volume.mjs +5 -0
  107. package/dist/esm/api/types/index.d.mts +10 -1
  108. package/dist/esm/api/types/index.mjs +10 -1
  109. package/dist/esm/version.d.mts +1 -1
  110. package/dist/esm/version.mjs +1 -1
  111. package/package.json +1 -1
  112. package/reference.md +175 -17
  113. package/dist/cjs/api/types/FieldWarning.d.ts +0 -6
  114. package/dist/esm/api/types/FieldWarning.d.mts +0 -6
  115. /package/dist/cjs/api/{types/FieldWarning.js → resources/contacts/client/requests/GetContactCapabilitiesV1ContactsCapabilitiesGetRequest.js} +0 -0
  116. /package/dist/esm/api/{types/FieldWarning.mjs → resources/contacts/client/requests/GetContactCapabilitiesV1ContactsCapabilitiesGetRequest.mjs} +0 -0
@@ -67,24 +67,32 @@ class SubAccountsClient {
67
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
68
68
  }
69
69
  /**
70
+ * @param {AgentPhone.ListSubAccountsV1SubAccountsGetRequest} request
70
71
  * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
71
72
  *
73
+ * @throws {@link AgentPhone.UnprocessableEntityError}
74
+ *
72
75
  * @example
73
76
  * await client.subAccounts.listSubAccounts()
74
77
  */
75
- listSubAccounts(requestOptions) {
76
- return core.HttpResponsePromise.fromPromise(this.__listSubAccounts(requestOptions));
78
+ listSubAccounts(request = {}, requestOptions) {
79
+ return core.HttpResponsePromise.fromPromise(this.__listSubAccounts(request, requestOptions));
77
80
  }
78
- __listSubAccounts(requestOptions) {
79
- return __awaiter(this, void 0, void 0, function* () {
81
+ __listSubAccounts() {
82
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
80
83
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
84
+ const { limit, offset } = request;
85
+ const _queryParams = {
86
+ limit,
87
+ offset,
88
+ };
81
89
  const _authRequest = yield this._options.authProvider.getAuthRequest();
82
90
  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);
83
91
  const _response = yield core.fetcher({
84
92
  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/sub-accounts"),
85
93
  method: "GET",
86
94
  headers: _headers,
87
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
95
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
88
96
  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,
89
97
  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,
90
98
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -95,11 +103,16 @@ class SubAccountsClient {
95
103
  return { data: _response.body, rawResponse: _response.rawResponse };
96
104
  }
97
105
  if (_response.error.reason === "status-code") {
98
- throw new errors.AgentPhoneError({
99
- statusCode: _response.error.statusCode,
100
- body: _response.error.body,
101
- rawResponse: _response.rawResponse,
102
- });
106
+ switch (_response.error.statusCode) {
107
+ case 422:
108
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
109
+ default:
110
+ throw new errors.AgentPhoneError({
111
+ statusCode: _response.error.statusCode,
112
+ body: _response.error.body,
113
+ rawResponse: _response.rawResponse,
114
+ });
115
+ }
103
116
  }
104
117
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/sub-accounts");
105
118
  });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface ListSubAccountsV1SubAccountsGetRequest {
6
+ limit?: number | null;
7
+ offset?: number;
8
+ }
@@ -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,3 +1,4 @@
1
1
  export type { CreateSubAccountRequest } from "./CreateSubAccountRequest.js";
2
2
  export type { DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest } from "./DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.js";
3
+ export type { ListSubAccountsV1SubAccountsGetRequest } from "./ListSubAccountsV1SubAccountsGetRequest.js";
3
4
  export type { UpdateSubAccountRequest } from "./UpdateSubAccountRequest.js";
@@ -10,7 +10,10 @@ export interface AgentResponse {
10
10
  beginMessage?: string | null;
11
11
  voice: string;
12
12
  transferNumber?: string | null;
13
+ customTools?: Record<string, unknown>[] | null;
13
14
  voicemailMessage?: string | null;
15
+ callScreeningIdentity?: string | null;
16
+ callScreeningPurpose?: string | null;
14
17
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
15
18
  sttMode?: AgentResponse.SttMode;
16
19
  /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
@@ -0,0 +1,7 @@
1
+ export declare const CampaignInclude: {
2
+ readonly Links: "links";
3
+ readonly PhoneNumbers: "phone_numbers";
4
+ readonly AgeGated: "age_gated";
5
+ readonly DirectLending: "direct_lending";
6
+ };
7
+ export type CampaignInclude = (typeof CampaignInclude)[keyof typeof CampaignInclude];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CampaignInclude = void 0;
5
+ exports.CampaignInclude = {
6
+ Links: "links",
7
+ PhoneNumbers: "phone_numbers",
8
+ AgeGated: "age_gated",
9
+ DirectLending: "direct_lending",
10
+ };
@@ -0,0 +1,4 @@
1
+ export interface CampaignStatusResponse {
2
+ campaign_status: string;
3
+ message: string;
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,6 @@
1
+ import type * as AgentPhone from "../index.js";
2
+ export interface ContactCapabilitiesResponse {
3
+ phoneNumber: string;
4
+ capabilities: AgentPhone.ContactCapabilityFlags;
5
+ checkedAt: string;
6
+ }
@@ -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
+ export interface ContactCapabilityFlags {
2
+ imessage: boolean;
3
+ sms: boolean;
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,11 @@
1
+ export declare const ContactTitle: {
2
+ readonly Ceo: "ceo";
3
+ readonly Cfo: "cfo";
4
+ readonly Cto: "cto";
5
+ readonly Coo: "coo";
6
+ readonly Vp: "vp";
7
+ readonly Gm: "gm";
8
+ readonly Director: "director";
9
+ readonly Other: "other";
10
+ };
11
+ export type ContactTitle = (typeof ContactTitle)[keyof typeof ContactTitle];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ContactTitle = void 0;
5
+ exports.ContactTitle = {
6
+ Ceo: "ceo",
7
+ Cfo: "cfo",
8
+ Cto: "cto",
9
+ Coo: "coo",
10
+ Vp: "vp",
11
+ Gm: "gm",
12
+ Director: "director",
13
+ Other: "other",
14
+ };
@@ -0,0 +1,28 @@
1
+ export interface CustomToolParam {
2
+ /** Function name the agent calls. Letters, numbers, underscores, hyphens; max 64 chars. Must be unique and not a reserved built-in name. */
3
+ name: string;
4
+ /** What the tool does and when to use it. The agent relies on this to decide when to call it. */
5
+ description: string;
6
+ /** HTTPS endpoint the voice provider calls when the agent invokes this tool. */
7
+ url: string;
8
+ /** HTTP method. Defaults to POST. */
9
+ method?: CustomToolParam.Method;
10
+ /** Optional HTTP headers sent with the request (e.g. an Authorization token for your endpoint). */
11
+ headers?: Record<string, string | null> | null;
12
+ /** JSON Schema object describing the arguments the agent fills in. Omit for a no-argument tool. */
13
+ parameters?: Record<string, unknown> | null;
14
+ /** How long to wait for your endpoint before giving up. Range 1000-120000 ms. */
15
+ timeoutMs?: number | null;
16
+ /** When true, the agent speaks executionMessage while the tool runs. */
17
+ speakDuringExecution?: boolean | null;
18
+ /** What the agent says while the tool runs (used when speakDuringExecution is true). */
19
+ executionMessage?: string | null;
20
+ }
21
+ export declare namespace CustomToolParam {
22
+ /** HTTP method. Defaults to POST. */
23
+ const Method: {
24
+ readonly Get: "GET";
25
+ readonly Post: "POST";
26
+ };
27
+ type Method = (typeof Method)[keyof typeof Method];
28
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CustomToolParam = void 0;
5
+ var CustomToolParam;
6
+ (function (CustomToolParam) {
7
+ /** HTTP method. Defaults to POST. */
8
+ CustomToolParam.Method = {
9
+ Get: "GET",
10
+ Post: "POST",
11
+ };
12
+ })(CustomToolParam || (exports.CustomToolParam = CustomToolParam = {}));
@@ -11,4 +11,5 @@ export interface MessageInConversation {
11
11
  mediaUrls?: string[];
12
12
  receivedAt: string;
13
13
  reactions?: AgentPhone.ReactionInConversation[];
14
+ replyTo?: AgentPhone.ReplyToInConversation | null;
14
15
  }
@@ -0,0 +1,11 @@
1
+ export declare const OrganizationType: {
2
+ readonly SoleProprietor: "sole_proprietor";
3
+ readonly PrivateCorporation: "private_corporation";
4
+ readonly PublicCorporation: "public_corporation";
5
+ readonly Llc: "llc";
6
+ readonly Partnership: "partnership";
7
+ readonly NonProfit: "non_profit";
8
+ readonly CoOp: "co_op";
9
+ readonly Government: "government";
10
+ };
11
+ export type OrganizationType = (typeof OrganizationType)[keyof typeof OrganizationType];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.OrganizationType = void 0;
5
+ exports.OrganizationType = {
6
+ SoleProprietor: "sole_proprietor",
7
+ PrivateCorporation: "private_corporation",
8
+ PublicCorporation: "public_corporation",
9
+ Llc: "llc",
10
+ Partnership: "partnership",
11
+ NonProfit: "non_profit",
12
+ CoOp: "co_op",
13
+ Government: "government",
14
+ };
@@ -1,8 +1,7 @@
1
- import type * as AgentPhone from "../index.js";
2
1
  export interface RegistrationResponse {
3
2
  ok: boolean;
4
3
  message: string;
5
- payment_url: string;
6
4
  campaign_status: string;
7
- warnings?: AgentPhone.FieldWarning[];
5
+ sub_account_id?: string | null;
6
+ fee_cents?: number;
8
7
  }
@@ -0,0 +1,5 @@
1
+ export interface ReplyToInConversation {
2
+ messageId: string;
3
+ message: string;
4
+ mediaUrls?: string[];
5
+ }
@@ -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,6 +4,7 @@ export interface SendMessageResponse {
4
4
  channel: string;
5
5
  from_number: string;
6
6
  to_number: string;
7
+ conversation_id?: string | null;
7
8
  media_urls?: string[];
8
9
  reply_to_message_id?: string | null;
9
10
  reply_parent_unresolved?: boolean | null;
@@ -0,0 +1,13 @@
1
+ export declare const UseCase: {
2
+ readonly AccountNotification: "account_notification";
3
+ readonly CustomerCare: "customer_care";
4
+ readonly DeliveryNotification: "delivery_notification";
5
+ readonly FraudAlert: "fraud_alert";
6
+ readonly HigherEducation: "higher_education";
7
+ readonly Marketing: "marketing";
8
+ readonly PollingVoting: "polling_voting";
9
+ readonly PublicServiceAnnouncement: "public_service_announcement";
10
+ readonly SecurityAlert: "security_alert";
11
+ readonly TwoFactorAuthentication: "two_factor_authentication";
12
+ };
13
+ export type UseCase = (typeof UseCase)[keyof typeof UseCase];
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.UseCase = void 0;
5
+ exports.UseCase = {
6
+ AccountNotification: "account_notification",
7
+ CustomerCare: "customer_care",
8
+ DeliveryNotification: "delivery_notification",
9
+ FraudAlert: "fraud_alert",
10
+ HigherEducation: "higher_education",
11
+ Marketing: "marketing",
12
+ PollingVoting: "polling_voting",
13
+ PublicServiceAnnouncement: "public_service_announcement",
14
+ SecurityAlert: "security_alert",
15
+ TwoFactorAuthentication: "two_factor_authentication",
16
+ };
@@ -0,0 +1,5 @@
1
+ export declare const Volume: {
2
+ readonly Low: "low";
3
+ readonly High: "high";
4
+ };
5
+ export type Volume = (typeof Volume)[keyof typeof Volume];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Volume = void 0;
5
+ exports.Volume = {
6
+ Low: "low",
7
+ High: "high",
8
+ };
@@ -13,14 +13,19 @@ export * from "./AppRoutesConversationsConversationSummary.js";
13
13
  export * from "./AttachNumberResponse.js";
14
14
  export * from "./CallListResponse.js";
15
15
  export * from "./CallSummary.js";
16
+ export * from "./CampaignInclude.js";
17
+ export * from "./CampaignStatusResponse.js";
18
+ export * from "./ContactCapabilitiesResponse.js";
19
+ export * from "./ContactCapabilityFlags.js";
16
20
  export * from "./ContactCardResponse.js";
17
21
  export * from "./ContactListResponse.js";
18
22
  export * from "./ContactResponse.js";
23
+ export * from "./ContactTitle.js";
19
24
  export * from "./ConversationDetail.js";
25
+ export * from "./CustomToolParam.js";
20
26
  export * from "./DailyUsagePoint.js";
21
27
  export * from "./DailyUsageResponse.js";
22
28
  export * from "./DeleteAgentResponse.js";
23
- export * from "./FieldWarning.js";
24
29
  export * from "./GroupParticipant.js";
25
30
  export * from "./HttpValidationError.js";
26
31
  export * from "./LocationRefreshResponse.js";
@@ -34,6 +39,7 @@ export * from "./MonthlyUsageResponse.js";
34
39
  export * from "./NumberLimits.js";
35
40
  export * from "./NumberUsageItem.js";
36
41
  export * from "./NumberUsageResponse.js";
42
+ export * from "./OrganizationType.js";
37
43
  export * from "./PaginatedDeliveriesResponse.js";
38
44
  export * from "./PhoneNumberListResponse.js";
39
45
  export * from "./PhoneNumberResponse.js";
@@ -41,13 +47,16 @@ export * from "./PlanInfo.js";
41
47
  export * from "./PlanLimits.js";
42
48
  export * from "./ReactionInConversation.js";
43
49
  export * from "./RegistrationResponse.js";
50
+ export * from "./ReplyToInConversation.js";
44
51
  export * from "./SendMessageResponse.js";
45
52
  export * from "./SendReactionResponse.js";
46
53
  export * from "./SendTypingResponse.js";
47
54
  export * from "./SetBackgroundResponse.js";
48
55
  export * from "./UsageResponse.js";
49
56
  export * from "./UsageStats.js";
57
+ export * from "./UseCase.js";
50
58
  export * from "./ValidationError.js";
59
+ export * from "./Volume.js";
51
60
  export * from "./WebhookCreateRequest.js";
52
61
  export * from "./WebhookDeliveryResponse.js";
53
62
  export * from "./WebhookDeliveryStatsResponse.js";
@@ -29,14 +29,19 @@ __exportStar(require("./AppRoutesConversationsConversationSummary.js"), exports)
29
29
  __exportStar(require("./AttachNumberResponse.js"), exports);
30
30
  __exportStar(require("./CallListResponse.js"), exports);
31
31
  __exportStar(require("./CallSummary.js"), exports);
32
+ __exportStar(require("./CampaignInclude.js"), exports);
33
+ __exportStar(require("./CampaignStatusResponse.js"), exports);
34
+ __exportStar(require("./ContactCapabilitiesResponse.js"), exports);
35
+ __exportStar(require("./ContactCapabilityFlags.js"), exports);
32
36
  __exportStar(require("./ContactCardResponse.js"), exports);
33
37
  __exportStar(require("./ContactListResponse.js"), exports);
34
38
  __exportStar(require("./ContactResponse.js"), exports);
39
+ __exportStar(require("./ContactTitle.js"), exports);
35
40
  __exportStar(require("./ConversationDetail.js"), exports);
41
+ __exportStar(require("./CustomToolParam.js"), exports);
36
42
  __exportStar(require("./DailyUsagePoint.js"), exports);
37
43
  __exportStar(require("./DailyUsageResponse.js"), exports);
38
44
  __exportStar(require("./DeleteAgentResponse.js"), exports);
39
- __exportStar(require("./FieldWarning.js"), exports);
40
45
  __exportStar(require("./GroupParticipant.js"), exports);
41
46
  __exportStar(require("./HttpValidationError.js"), exports);
42
47
  __exportStar(require("./LocationRefreshResponse.js"), exports);
@@ -50,6 +55,7 @@ __exportStar(require("./MonthlyUsageResponse.js"), exports);
50
55
  __exportStar(require("./NumberLimits.js"), exports);
51
56
  __exportStar(require("./NumberUsageItem.js"), exports);
52
57
  __exportStar(require("./NumberUsageResponse.js"), exports);
58
+ __exportStar(require("./OrganizationType.js"), exports);
53
59
  __exportStar(require("./PaginatedDeliveriesResponse.js"), exports);
54
60
  __exportStar(require("./PhoneNumberListResponse.js"), exports);
55
61
  __exportStar(require("./PhoneNumberResponse.js"), exports);
@@ -57,13 +63,16 @@ __exportStar(require("./PlanInfo.js"), exports);
57
63
  __exportStar(require("./PlanLimits.js"), exports);
58
64
  __exportStar(require("./ReactionInConversation.js"), exports);
59
65
  __exportStar(require("./RegistrationResponse.js"), exports);
66
+ __exportStar(require("./ReplyToInConversation.js"), exports);
60
67
  __exportStar(require("./SendMessageResponse.js"), exports);
61
68
  __exportStar(require("./SendReactionResponse.js"), exports);
62
69
  __exportStar(require("./SendTypingResponse.js"), exports);
63
70
  __exportStar(require("./SetBackgroundResponse.js"), exports);
64
71
  __exportStar(require("./UsageResponse.js"), exports);
65
72
  __exportStar(require("./UsageStats.js"), exports);
73
+ __exportStar(require("./UseCase.js"), exports);
66
74
  __exportStar(require("./ValidationError.js"), exports);
75
+ __exportStar(require("./Volume.js"), exports);
67
76
  __exportStar(require("./WebhookCreateRequest.js"), exports);
68
77
  __exportStar(require("./WebhookDeliveryResponse.js"), exports);
69
78
  __exportStar(require("./WebhookDeliveryStatsResponse.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.14";
1
+ export declare const SDK_VERSION = "1.0.16";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.14";
4
+ exports.SDK_VERSION = "1.0.16";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentphone",
9
- "X-Fern-SDK-Version": "1.0.14",
10
- "User-Agent": "agentphone/1.0.14",
9
+ "X-Fern-SDK-Version": "1.0.16",
10
+ "User-Agent": "agentphone/1.0.16",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,3 +1,4 @@
1
+ import type * as AgentPhone from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -17,7 +18,11 @@ export interface CreateAgentRequest {
17
18
  beginMessage?: string | null;
18
19
  voice?: string | null;
19
20
  transferNumber?: string | null;
21
+ /** Hosted-mode only. User-defined function tools the agent can call during a call (look up a record, save call notes, etc.). Each points at your HTTPS endpoint; the voice provider invokes it and feeds the JSON response back to the agent. Ignored in webhook mode. Maximum 20 tools. */
22
+ customTools?: AgentPhone.CustomToolParam[] | null;
20
23
  voicemailMessage?: string | null;
24
+ callScreeningIdentity?: string | null;
25
+ callScreeningPurpose?: string | null;
21
26
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
22
27
  sttMode?: CreateAgentRequest.SttMode;
23
28
  /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
@@ -1,3 +1,4 @@
1
+ import type * as AgentPhone from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -18,7 +19,11 @@ export interface UpdateAgentRequest {
18
19
  beginMessage?: string | null;
19
20
  voice?: string | null;
20
21
  transferNumber?: string | null;
22
+ /** Hosted-mode only. User-defined function tools the agent can call during a call. Replaces the full set on each update; send [] to clear all tools, or omit to leave unchanged. Ignored in webhook mode. Maximum 20 tools. */
23
+ customTools?: AgentPhone.CustomToolParam[] | null;
21
24
  voicemailMessage?: string | null;
25
+ callScreeningIdentity?: string | null;
26
+ callScreeningPurpose?: string | null;
22
27
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
23
28
  sttMode?: UpdateAgentRequest.SttMode;
24
29
  /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
@@ -22,4 +22,8 @@ export interface CreateOutboundCallRequest {
22
22
  systemPrompt?: string | null;
23
23
  /** Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and initial greeting at call time. Requires either ``systemPrompt`` or a hosted-mode agent. */
24
24
  variables?: Record<string, string | null> | null;
25
+ /** For outbound calls that hit an automated call screener (e.g. iOS 26 Call Screening or Android Call Screen): the identity the agent gives when asked who is calling. Overrides the agent's stored default for this call. Both identity and purpose are required to enable screening; if only a purpose is set, the agent's name is used. */
26
+ callScreeningIdentity?: string | null;
27
+ /** For outbound calls that hit an automated call screener: the purpose the agent gives when asked why it is calling. Overrides the agent's stored default for this call. */
28
+ callScreeningPurpose?: string | null;
25
29
  }
@@ -44,6 +44,26 @@ export declare class ContactsClient {
44
44
  */
45
45
  createContact(request: AgentPhone.CreateContactRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactResponse>;
46
46
  private __createContact;
47
+ /**
48
+ * Check which messaging channels a phone number supports, without sending
49
+ * a message.
50
+ *
51
+ * Runs a live check (typically 1-2 seconds), so the result reflects the
52
+ * number right now. Capabilities can still change by the time you send.
53
+ * Requires at least one active iMessage-capable number on the account.
54
+ *
55
+ * @param {AgentPhone.GetContactCapabilitiesV1ContactsCapabilitiesGetRequest} request
56
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link AgentPhone.UnprocessableEntityError}
59
+ *
60
+ * @example
61
+ * await client.contacts.getContactCapabilities({
62
+ * phone_number: "phone_number"
63
+ * })
64
+ */
65
+ getContactCapabilities(request: AgentPhone.GetContactCapabilitiesV1ContactsCapabilitiesGetRequest, requestOptions?: ContactsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ContactCapabilitiesResponse>;
66
+ private __getContactCapabilities;
47
67
  /**
48
68
  * Get a single contact by ID.
49
69
  *
@@ -142,6 +142,68 @@ export class ContactsClient {
142
142
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/contacts");
143
143
  });
144
144
  }
145
+ /**
146
+ * Check which messaging channels a phone number supports, without sending
147
+ * a message.
148
+ *
149
+ * Runs a live check (typically 1-2 seconds), so the result reflects the
150
+ * number right now. Capabilities can still change by the time you send.
151
+ * Requires at least one active iMessage-capable number on the account.
152
+ *
153
+ * @param {AgentPhone.GetContactCapabilitiesV1ContactsCapabilitiesGetRequest} request
154
+ * @param {ContactsClient.RequestOptions} requestOptions - Request-specific configuration.
155
+ *
156
+ * @throws {@link AgentPhone.UnprocessableEntityError}
157
+ *
158
+ * @example
159
+ * await client.contacts.getContactCapabilities({
160
+ * phone_number: "phone_number"
161
+ * })
162
+ */
163
+ getContactCapabilities(request, requestOptions) {
164
+ return core.HttpResponsePromise.fromPromise(this.__getContactCapabilities(request, requestOptions));
165
+ }
166
+ __getContactCapabilities(request, requestOptions) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
169
+ const { phone_number: phoneNumber } = request;
170
+ const _queryParams = {
171
+ phone_number: phoneNumber,
172
+ };
173
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
174
+ 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);
175
+ const _response = yield core.fetcher({
176
+ 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/contacts/capabilities"),
177
+ method: "GET",
178
+ headers: _headers,
179
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
180
+ 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,
181
+ 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,
182
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
183
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
184
+ logging: this._options.logging,
185
+ });
186
+ if (_response.ok) {
187
+ return {
188
+ data: _response.body,
189
+ rawResponse: _response.rawResponse,
190
+ };
191
+ }
192
+ if (_response.error.reason === "status-code") {
193
+ switch (_response.error.statusCode) {
194
+ case 422:
195
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
196
+ default:
197
+ throw new errors.AgentPhoneError({
198
+ statusCode: _response.error.statusCode,
199
+ body: _response.error.body,
200
+ rawResponse: _response.rawResponse,
201
+ });
202
+ }
203
+ }
204
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/contacts/capabilities");
205
+ });
206
+ }
145
207
  /**
146
208
  * Get a single contact by ID.
147
209
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * phone_number: "phone_number"
5
+ * }
6
+ */
7
+ export interface GetContactCapabilitiesV1ContactsCapabilitiesGetRequest {
8
+ /** Phone number to check (E.164 preferred; URL-encode + as %2B) */
9
+ phone_number: string;
10
+ }
@@ -1,5 +1,6 @@
1
1
  export type { CreateContactRequest } from "./CreateContactRequest.mjs";
2
2
  export type { DeleteContactV1ContactsContactIdDeleteRequest } from "./DeleteContactV1ContactsContactIdDeleteRequest.mjs";
3
+ export type { GetContactCapabilitiesV1ContactsCapabilitiesGetRequest } from "./GetContactCapabilitiesV1ContactsCapabilitiesGetRequest.mjs";
3
4
  export type { GetContactV1ContactsContactIdGetRequest } from "./GetContactV1ContactsContactIdGetRequest.mjs";
4
5
  export type { ListContactsV1ContactsGetRequest } from "./ListContactsV1ContactsGetRequest.mjs";
5
6
  export type { UpdateContactRequest } from "./UpdateContactRequest.mjs";