agentphone 1.0.11 → 1.0.12

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 (92) hide show
  1. package/README.md +10 -10
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +3 -6
  4. package/dist/cjs/Client.js +25 -30
  5. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +69 -0
  6. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +66 -0
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +69 -0
  8. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +66 -0
  9. package/dist/cjs/api/resources/index.d.ts +2 -4
  10. package/dist/cjs/api/resources/index.js +3 -5
  11. package/dist/cjs/api/resources/registration/client/Client.d.ts +61 -0
  12. package/dist/cjs/api/resources/{agentSignup → registration}/client/Client.js +44 -69
  13. package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.d.ts +61 -0
  14. package/dist/cjs/api/resources/registration/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/types/AgentResponse.d.ts +2 -0
  16. package/dist/cjs/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.ts +0 -6
  17. package/dist/cjs/api/types/AgentVerifyRequest.d.ts +4 -0
  18. package/dist/cjs/api/types/FieldWarning.d.ts +6 -0
  19. package/dist/cjs/api/types/FieldWarning.js +3 -0
  20. package/dist/cjs/api/types/RegistrationResponse.d.ts +8 -0
  21. package/dist/cjs/api/types/RegistrationResponse.js +3 -0
  22. package/dist/cjs/api/types/index.d.ts +4 -0
  23. package/dist/cjs/api/types/index.js +4 -0
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/BaseClient.mjs +2 -2
  27. package/dist/esm/Client.d.mts +3 -6
  28. package/dist/esm/Client.mjs +5 -10
  29. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +69 -0
  30. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +66 -0
  31. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +69 -0
  32. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +66 -0
  33. package/dist/esm/api/resources/index.d.mts +2 -4
  34. package/dist/esm/api/resources/index.mjs +2 -4
  35. package/dist/esm/api/resources/registration/client/Client.d.mts +61 -0
  36. package/dist/esm/api/resources/registration/client/Client.mjs +108 -0
  37. package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.d.mts +61 -0
  38. package/dist/esm/api/resources/registration/client/requests/index.d.mts +1 -0
  39. package/dist/esm/api/types/AgentResponse.d.mts +2 -0
  40. package/dist/esm/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.mts +0 -6
  41. package/dist/esm/api/types/AgentVerifyRequest.d.mts +4 -0
  42. package/dist/esm/api/types/FieldWarning.d.mts +6 -0
  43. package/dist/esm/api/types/FieldWarning.mjs +2 -0
  44. package/dist/esm/api/types/RegistrationResponse.d.mts +8 -0
  45. package/dist/esm/api/types/RegistrationResponse.mjs +2 -0
  46. package/dist/esm/api/types/index.d.mts +4 -0
  47. package/dist/esm/api/types/index.mjs +4 -0
  48. package/dist/esm/version.d.mts +1 -1
  49. package/dist/esm/version.mjs +1 -1
  50. package/package.json +1 -1
  51. package/reference.md +83 -380
  52. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +0 -50
  53. package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +0 -11
  54. package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +0 -2
  55. package/dist/cjs/api/resources/integrations/client/Client.d.ts +0 -64
  56. package/dist/cjs/api/resources/integrations/client/Client.js +0 -268
  57. package/dist/cjs/api/resources/integrations/client/index.d.ts +0 -1
  58. package/dist/cjs/api/resources/integrations/client/index.js +0 -17
  59. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +0 -9
  60. package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +0 -1
  61. package/dist/cjs/api/resources/integrations/client/requests/index.js +0 -2
  62. package/dist/cjs/api/resources/integrations/index.d.ts +0 -1
  63. package/dist/cjs/api/resources/integrations/index.js +0 -17
  64. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +0 -50
  65. package/dist/esm/api/resources/agentSignup/client/Client.mjs +0 -133
  66. package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +0 -11
  67. package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +0 -2
  68. package/dist/esm/api/resources/integrations/client/Client.d.mts +0 -64
  69. package/dist/esm/api/resources/integrations/client/Client.mjs +0 -231
  70. package/dist/esm/api/resources/integrations/client/index.d.mts +0 -1
  71. package/dist/esm/api/resources/integrations/client/index.mjs +0 -1
  72. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +0 -9
  73. package/dist/esm/api/resources/integrations/client/requests/index.d.mts +0 -1
  74. package/dist/esm/api/resources/integrations/client/requests/index.mjs +0 -1
  75. package/dist/esm/api/resources/integrations/index.d.mts +0 -1
  76. package/dist/esm/api/resources/integrations/index.mjs +0 -1
  77. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.d.ts +0 -0
  78. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.js +0 -0
  79. /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentSignUpRequest.js → registration/client/requests/RegistrationRequest.js} +0 -0
  80. /package/dist/cjs/api/resources/{agentSignup → registration}/client/requests/index.js +0 -0
  81. /package/dist/cjs/api/resources/{agentSignup → registration}/index.d.ts +0 -0
  82. /package/dist/cjs/api/resources/{agentSignup → registration}/index.js +0 -0
  83. /package/dist/cjs/api/{resources/agentSignup/client/requests/AgentVerifyRequest.js → types/AgentSignUpRequest.js} +0 -0
  84. /package/dist/cjs/api/{resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js → types/AgentVerifyRequest.js} +0 -0
  85. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.d.mts +0 -0
  86. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.mjs +0 -0
  87. /package/dist/esm/api/resources/{agentSignup/client/requests/AgentSignUpRequest.mjs → registration/client/requests/RegistrationRequest.mjs} +0 -0
  88. /package/dist/esm/api/resources/{agentSignup → registration}/client/requests/index.mjs +0 -0
  89. /package/dist/esm/api/resources/{agentSignup → registration}/index.d.mts +0 -0
  90. /package/dist/esm/api/resources/{agentSignup → registration}/index.mjs +0 -0
  91. /package/dist/esm/api/{resources/agentSignup/client/requests/AgentVerifyRequest.mjs → types/AgentSignUpRequest.mjs} +0 -0
  92. /package/dist/esm/api/{resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs → types/AgentVerifyRequest.mjs} +0 -0
@@ -31,6 +31,8 @@ export interface UpdateAgentRequest {
31
31
  interruptionSensitivity?: number | null;
32
32
  /** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Set false to keep the agent silent while the caller is speaking. */
33
33
  enableBackchannel?: boolean | null;
34
+ /** BCP-47 locale that drives the agent's speech recognition and pronunciation. See the enum for the full set of supported codes. */
35
+ language?: UpdateAgentRequest.Language;
34
36
  }
35
37
  export declare namespace UpdateAgentRequest {
36
38
  const VoiceMode: {
@@ -64,4 +66,71 @@ export declare namespace UpdateAgentRequest {
64
66
  readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
65
67
  };
66
68
  type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
69
+ /** BCP-47 locale that drives the agent's speech recognition and pronunciation. See the enum for the full set of supported codes. */
70
+ const Language: {
71
+ readonly AfZa: "af-ZA";
72
+ readonly ArSa: "ar-SA";
73
+ readonly AzAz: "az-AZ";
74
+ readonly BgBg: "bg-BG";
75
+ readonly BsBa: "bs-BA";
76
+ readonly CaEs: "ca-ES";
77
+ readonly CsCz: "cs-CZ";
78
+ readonly CyGb: "cy-GB";
79
+ readonly DaDk: "da-DK";
80
+ readonly DeDe: "de-DE";
81
+ readonly ElGr: "el-GR";
82
+ readonly EnAu: "en-AU";
83
+ readonly EnGb: "en-GB";
84
+ readonly EnIn: "en-IN";
85
+ readonly EnNz: "en-NZ";
86
+ readonly EnUs: "en-US";
87
+ readonly Es419: "es-419";
88
+ readonly EsEs: "es-ES";
89
+ readonly FaIr: "fa-IR";
90
+ readonly FiFi: "fi-FI";
91
+ readonly FilPh: "fil-PH";
92
+ readonly FrCa: "fr-CA";
93
+ readonly FrFr: "fr-FR";
94
+ readonly GlEs: "gl-ES";
95
+ readonly HeIl: "he-IL";
96
+ readonly HiIn: "hi-IN";
97
+ readonly HrHr: "hr-HR";
98
+ readonly HuHu: "hu-HU";
99
+ readonly HyAm: "hy-AM";
100
+ readonly IdId: "id-ID";
101
+ readonly IsIs: "is-IS";
102
+ readonly ItIt: "it-IT";
103
+ readonly JaJp: "ja-JP";
104
+ readonly KkKz: "kk-KZ";
105
+ readonly KnIn: "kn-IN";
106
+ readonly KoKr: "ko-KR";
107
+ readonly LtLt: "lt-LT";
108
+ readonly LvLv: "lv-LV";
109
+ readonly MkMk: "mk-MK";
110
+ readonly MrIn: "mr-IN";
111
+ readonly MsMy: "ms-MY";
112
+ readonly NeNp: "ne-NP";
113
+ readonly NlBe: "nl-BE";
114
+ readonly NlNl: "nl-NL";
115
+ readonly NoNo: "no-NO";
116
+ readonly PlPl: "pl-PL";
117
+ readonly PtBr: "pt-BR";
118
+ readonly PtPt: "pt-PT";
119
+ readonly RoRo: "ro-RO";
120
+ readonly RuRu: "ru-RU";
121
+ readonly SkSk: "sk-SK";
122
+ readonly SlSi: "sl-SI";
123
+ readonly SrRs: "sr-RS";
124
+ readonly SvSe: "sv-SE";
125
+ readonly SwKe: "sw-KE";
126
+ readonly TaIn: "ta-IN";
127
+ readonly ThTh: "th-TH";
128
+ readonly TrTr: "tr-TR";
129
+ readonly UkUa: "uk-UA";
130
+ readonly UrIn: "ur-IN";
131
+ readonly ViVn: "vi-VN";
132
+ readonly YueCn: "yue-CN";
133
+ readonly ZhCn: "zh-CN";
134
+ };
135
+ type Language = (typeof Language)[keyof typeof Language];
67
136
  }
@@ -27,4 +27,70 @@ export var UpdateAgentRequest;
27
27
  NoiseCancellation: "noise-cancellation",
28
28
  NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
29
29
  };
30
+ /** BCP-47 locale that drives the agent's speech recognition and pronunciation. See the enum for the full set of supported codes. */
31
+ UpdateAgentRequest.Language = {
32
+ AfZa: "af-ZA",
33
+ ArSa: "ar-SA",
34
+ AzAz: "az-AZ",
35
+ BgBg: "bg-BG",
36
+ BsBa: "bs-BA",
37
+ CaEs: "ca-ES",
38
+ CsCz: "cs-CZ",
39
+ CyGb: "cy-GB",
40
+ DaDk: "da-DK",
41
+ DeDe: "de-DE",
42
+ ElGr: "el-GR",
43
+ EnAu: "en-AU",
44
+ EnGb: "en-GB",
45
+ EnIn: "en-IN",
46
+ EnNz: "en-NZ",
47
+ EnUs: "en-US",
48
+ Es419: "es-419",
49
+ EsEs: "es-ES",
50
+ FaIr: "fa-IR",
51
+ FiFi: "fi-FI",
52
+ FilPh: "fil-PH",
53
+ FrCa: "fr-CA",
54
+ FrFr: "fr-FR",
55
+ GlEs: "gl-ES",
56
+ HeIl: "he-IL",
57
+ HiIn: "hi-IN",
58
+ HrHr: "hr-HR",
59
+ HuHu: "hu-HU",
60
+ HyAm: "hy-AM",
61
+ IdId: "id-ID",
62
+ IsIs: "is-IS",
63
+ ItIt: "it-IT",
64
+ JaJp: "ja-JP",
65
+ KkKz: "kk-KZ",
66
+ KnIn: "kn-IN",
67
+ KoKr: "ko-KR",
68
+ LtLt: "lt-LT",
69
+ LvLv: "lv-LV",
70
+ MkMk: "mk-MK",
71
+ MrIn: "mr-IN",
72
+ MsMy: "ms-MY",
73
+ NeNp: "ne-NP",
74
+ NlBe: "nl-BE",
75
+ NlNl: "nl-NL",
76
+ NoNo: "no-NO",
77
+ PlPl: "pl-PL",
78
+ PtBr: "pt-BR",
79
+ PtPt: "pt-PT",
80
+ RoRo: "ro-RO",
81
+ RuRu: "ru-RU",
82
+ SkSk: "sk-SK",
83
+ SlSi: "sl-SI",
84
+ SrRs: "sr-RS",
85
+ SvSe: "sv-SE",
86
+ SwKe: "sw-KE",
87
+ TaIn: "ta-IN",
88
+ ThTh: "th-TH",
89
+ TrTr: "tr-TR",
90
+ UkUa: "uk-UA",
91
+ UrIn: "ur-IN",
92
+ ViVn: "vi-VN",
93
+ YueCn: "yue-CN",
94
+ ZhCn: "zh-CN",
95
+ };
30
96
  })(UpdateAgentRequest || (UpdateAgentRequest = {}));
@@ -1,5 +1,3 @@
1
- export * from "./agentSignup/client/requests/index.mjs";
2
- export * as agentSignup from "./agentSignup/index.mjs";
3
1
  export * from "./agents/client/requests/index.mjs";
4
2
  export * as agents from "./agents/index.mjs";
5
3
  export * from "./agentWebhooks/client/requests/index.mjs";
@@ -12,12 +10,12 @@ export * from "./contacts/client/requests/index.mjs";
12
10
  export * as contacts from "./contacts/index.mjs";
13
11
  export * from "./conversations/client/requests/index.mjs";
14
12
  export * as conversations from "./conversations/index.mjs";
15
- export * from "./integrations/client/requests/index.mjs";
16
- export * as integrations from "./integrations/index.mjs";
17
13
  export * from "./messages/client/requests/index.mjs";
18
14
  export * as messages from "./messages/index.mjs";
19
15
  export * from "./numbers/client/requests/index.mjs";
20
16
  export * as numbers from "./numbers/index.mjs";
17
+ export * from "./registration/client/requests/index.mjs";
18
+ export * as registration from "./registration/index.mjs";
21
19
  export * from "./usage/client/requests/index.mjs";
22
20
  export * as usage from "./usage/index.mjs";
23
21
  export * from "./usage/types/index.mjs";
@@ -1,5 +1,3 @@
1
- export * from "./agentSignup/client/requests/index.mjs";
2
- export * as agentSignup from "./agentSignup/index.mjs";
3
1
  export * from "./agents/client/requests/index.mjs";
4
2
  export * as agents from "./agents/index.mjs";
5
3
  export * from "./agentWebhooks/client/requests/index.mjs";
@@ -12,12 +10,12 @@ export * from "./contacts/client/requests/index.mjs";
12
10
  export * as contacts from "./contacts/index.mjs";
13
11
  export * from "./conversations/client/requests/index.mjs";
14
12
  export * as conversations from "./conversations/index.mjs";
15
- export * from "./integrations/client/requests/index.mjs";
16
- export * as integrations from "./integrations/index.mjs";
17
13
  export * from "./messages/client/requests/index.mjs";
18
14
  export * as messages from "./messages/index.mjs";
19
15
  export * from "./numbers/client/requests/index.mjs";
20
16
  export * as numbers from "./numbers/index.mjs";
17
+ export * from "./registration/client/requests/index.mjs";
18
+ export * as registration from "./registration/index.mjs";
21
19
  export * from "./usage/client/requests/index.mjs";
22
20
  export * as usage from "./usage/index.mjs";
23
21
  export * from "./usage/types/index.mjs";
@@ -0,0 +1,61 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as AgentPhone from "../../../index.mjs";
5
+ export declare namespace RegistrationClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class RegistrationClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<RegistrationClient.Options>;
12
+ constructor(options?: RegistrationClient.Options);
13
+ /**
14
+ * Submit an A2P 10DLC registration to enable outbound SMS on your account.
15
+ *
16
+ * US carriers require 10DLC registration before your AI agent can send text messages. This endpoint accepts both `sole_proprietor` and `standard_brand` registration types.
17
+ *
18
+ * ### How it works
19
+ *
20
+ * 1. Submit your registration details via this endpoint
21
+ * 2. We validate your submission and flag any issues (RED = blocked, YELLOW = warning)
22
+ * 3. On success, you receive a Stripe payment URL to pay the one-time registration fee
23
+ * 4. After payment, we submit your registration to the carriers on your behalf
24
+ * 5. Carrier approval typically takes 7-10 business days
25
+ *
26
+ * ### Registration types
27
+ *
28
+ * - **`sole_proprietor`** — For individuals or small businesses. Simpler requirements, fewer fields.
29
+ * - **`standard_brand`** — For established businesses. Requires `business_name`, `privacy_policy_url`, `terms_of_service_url`, `sample_message_1`, and `sample_message_2`.
30
+ *
31
+ * ### Opt-in image
32
+ *
33
+ * `opt_in_image_url` must be a publicly accessible HTTPS URL to a screenshot showing how users opt in to receive messages from you (e.g. a consent checkbox on your signup form). Supports PNG, JPG, WEBP, and GIF up to 2MB. Google Drive links (`drive.google.com/file/d/.../view`) are automatically converted if the file is shared publicly.
34
+ *
35
+ * ### Re-submitting
36
+ *
37
+ * If you've already submitted but haven't completed payment, calling this endpoint again returns the payment URL without re-sending the registration email.
38
+ *
39
+ * @param {AgentPhone.RegistrationRequest} request
40
+ * @param {RegistrationClient.RequestOptions} requestOptions - Request-specific configuration.
41
+ *
42
+ * @throws {@link AgentPhone.UnprocessableEntityError}
43
+ *
44
+ * @example
45
+ * await client.registration.registerA2P({
46
+ * registration_type: "registration_type",
47
+ * first_name: "first_name",
48
+ * last_name: "last_name",
49
+ * email: "email",
50
+ * phone_number: "phone_number",
51
+ * street_address: "street_address",
52
+ * city: "city",
53
+ * state: "state",
54
+ * zip_code: "zip_code",
55
+ * use_case_description: "use_case_description",
56
+ * opt_in_image_url: "opt_in_image_url"
57
+ * })
58
+ */
59
+ registerA2P(request: AgentPhone.RegistrationRequest, requestOptions?: RegistrationClient.RequestOptions): core.HttpResponsePromise<AgentPhone.RegistrationResponse>;
60
+ private __registerA2P;
61
+ }
@@ -0,0 +1,108 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as AgentPhone from "../../../index.mjs";
18
+ export class RegistrationClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Submit an A2P 10DLC registration to enable outbound SMS on your account.
24
+ *
25
+ * US carriers require 10DLC registration before your AI agent can send text messages. This endpoint accepts both `sole_proprietor` and `standard_brand` registration types.
26
+ *
27
+ * ### How it works
28
+ *
29
+ * 1. Submit your registration details via this endpoint
30
+ * 2. We validate your submission and flag any issues (RED = blocked, YELLOW = warning)
31
+ * 3. On success, you receive a Stripe payment URL to pay the one-time registration fee
32
+ * 4. After payment, we submit your registration to the carriers on your behalf
33
+ * 5. Carrier approval typically takes 7-10 business days
34
+ *
35
+ * ### Registration types
36
+ *
37
+ * - **`sole_proprietor`** — For individuals or small businesses. Simpler requirements, fewer fields.
38
+ * - **`standard_brand`** — For established businesses. Requires `business_name`, `privacy_policy_url`, `terms_of_service_url`, `sample_message_1`, and `sample_message_2`.
39
+ *
40
+ * ### Opt-in image
41
+ *
42
+ * `opt_in_image_url` must be a publicly accessible HTTPS URL to a screenshot showing how users opt in to receive messages from you (e.g. a consent checkbox on your signup form). Supports PNG, JPG, WEBP, and GIF up to 2MB. Google Drive links (`drive.google.com/file/d/.../view`) are automatically converted if the file is shared publicly.
43
+ *
44
+ * ### Re-submitting
45
+ *
46
+ * If you've already submitted but haven't completed payment, calling this endpoint again returns the payment URL without re-sending the registration email.
47
+ *
48
+ * @param {AgentPhone.RegistrationRequest} request
49
+ * @param {RegistrationClient.RequestOptions} requestOptions - Request-specific configuration.
50
+ *
51
+ * @throws {@link AgentPhone.UnprocessableEntityError}
52
+ *
53
+ * @example
54
+ * await client.registration.registerA2P({
55
+ * registration_type: "registration_type",
56
+ * first_name: "first_name",
57
+ * last_name: "last_name",
58
+ * email: "email",
59
+ * phone_number: "phone_number",
60
+ * street_address: "street_address",
61
+ * city: "city",
62
+ * state: "state",
63
+ * zip_code: "zip_code",
64
+ * use_case_description: "use_case_description",
65
+ * opt_in_image_url: "opt_in_image_url"
66
+ * })
67
+ */
68
+ registerA2P(request, requestOptions) {
69
+ return core.HttpResponsePromise.fromPromise(this.__registerA2P(request, requestOptions));
70
+ }
71
+ __registerA2P(request, requestOptions) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
74
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
75
+ 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);
76
+ const _response = yield core.fetcher({
77
+ 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/register"),
78
+ method: "POST",
79
+ headers: _headers,
80
+ contentType: "application/json",
81
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
82
+ requestType: "json",
83
+ body: request,
84
+ 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,
85
+ 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,
86
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
88
+ logging: this._options.logging,
89
+ });
90
+ if (_response.ok) {
91
+ return { data: _response.body, rawResponse: _response.rawResponse };
92
+ }
93
+ if (_response.error.reason === "status-code") {
94
+ switch (_response.error.statusCode) {
95
+ case 422:
96
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
97
+ default:
98
+ throw new errors.AgentPhoneError({
99
+ statusCode: _response.error.statusCode,
100
+ body: _response.error.body,
101
+ rawResponse: _response.rawResponse,
102
+ });
103
+ }
104
+ }
105
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/register");
106
+ });
107
+ }
108
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * registration_type: "registration_type",
5
+ * first_name: "first_name",
6
+ * last_name: "last_name",
7
+ * email: "email",
8
+ * phone_number: "phone_number",
9
+ * street_address: "street_address",
10
+ * city: "city",
11
+ * state: "state",
12
+ * zip_code: "zip_code",
13
+ * use_case_description: "use_case_description",
14
+ * opt_in_image_url: "opt_in_image_url"
15
+ * }
16
+ */
17
+ export interface RegistrationRequest {
18
+ /** 'sole_proprietor' or 'standard_brand' */
19
+ registration_type: string;
20
+ /** Required for standard_brand */
21
+ business_name?: string | null;
22
+ first_name: string;
23
+ last_name: string;
24
+ email: string;
25
+ /** E.164 format, e.g. +15551234567 */
26
+ phone_number: string;
27
+ /** Number of phone numbers you plan to use */
28
+ planned_numbers?: number;
29
+ street_address: string;
30
+ city: string;
31
+ state: string;
32
+ zip_code: string;
33
+ country?: string;
34
+ business_type?: string | null;
35
+ business_industry?: string | null;
36
+ position_in_company?: string | null;
37
+ /** EIN / Tax ID (standard_brand only) */
38
+ ein?: string | null;
39
+ registration_id_type?: string | null;
40
+ company_type?: string | null;
41
+ website_url?: string | null;
42
+ social_media_url?: string | null;
43
+ business_regions?: string | null;
44
+ /** Required for standard_brand */
45
+ privacy_policy_url?: string | null;
46
+ /** Required for standard_brand */
47
+ terms_of_service_url?: string | null;
48
+ use_case?: string | null;
49
+ /** Who you message, why, and how. Minimum 40 characters. */
50
+ use_case_description: string;
51
+ /** Required for standard_brand. Min 20 chars, include brand name. */
52
+ sample_message_1?: string | null;
53
+ /** Required for standard_brand. Min 20 chars, include brand name. */
54
+ sample_message_2?: string | null;
55
+ /** How users opt in to receive messages */
56
+ message_flow?: string | null;
57
+ /** Publicly accessible URL to a screenshot of your opt-in flow (PNG, JPG, WEBP, or GIF, max 2MB) */
58
+ opt_in_image_url: string;
59
+ has_embedded_links?: boolean;
60
+ has_embedded_phone?: boolean;
61
+ }
@@ -0,0 +1 @@
1
+ export type { RegistrationRequest } from "./RegistrationRequest.mjs";
@@ -25,6 +25,8 @@ export interface AgentResponse {
25
25
  interruptionSensitivity?: number;
26
26
  /** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true. */
27
27
  enableBackchannel?: boolean;
28
+ /** BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. */
29
+ language?: string;
28
30
  createdAt: string;
29
31
  numbers?: AgentPhone.AgentNumberResponse[] | null;
30
32
  }
@@ -1,9 +1,3 @@
1
- /**
2
- * @example
3
- * {
4
- * human_email: "human_email"
5
- * }
6
- */
7
1
  export interface AgentSignUpRequest {
8
2
  human_email: string;
9
3
  agent_name?: string | null;
@@ -0,0 +1,4 @@
1
+ export interface AgentVerifyRequest {
2
+ verification_id: string;
3
+ otp_code: string;
4
+ }
@@ -0,0 +1,6 @@
1
+ export interface FieldWarning {
2
+ field: string;
3
+ tier: string;
4
+ message: string;
5
+ suggestion: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,8 @@
1
+ import type * as AgentPhone from "../index.mjs";
2
+ export interface RegistrationResponse {
3
+ ok: boolean;
4
+ message: string;
5
+ payment_url: string;
6
+ campaign_status: string;
7
+ warnings?: AgentPhone.FieldWarning[];
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,8 +1,10 @@
1
1
  export * from "./AgentListResponse.mjs";
2
2
  export * from "./AgentNumberResponse.mjs";
3
3
  export * from "./AgentResponse.mjs";
4
+ export * from "./AgentSignUpRequest.mjs";
4
5
  export * from "./AgentUsageItem.mjs";
5
6
  export * from "./AgentUsageResponse.mjs";
7
+ export * from "./AgentVerifyRequest.mjs";
6
8
  export * from "./AllTimeStatsResponse.mjs";
7
9
  export * from "./AppRoutesAgentsConversationListResponse.mjs";
8
10
  export * from "./AppRoutesAgentsConversationSummary.mjs";
@@ -18,6 +20,7 @@ export * from "./ConversationDetail.mjs";
18
20
  export * from "./DailyUsagePoint.mjs";
19
21
  export * from "./DailyUsageResponse.mjs";
20
22
  export * from "./DeleteAgentResponse.mjs";
23
+ export * from "./FieldWarning.mjs";
21
24
  export * from "./HttpValidationError.mjs";
22
25
  export * from "./MessageInConversation.mjs";
23
26
  export * from "./MessageListResponse.mjs";
@@ -34,6 +37,7 @@ export * from "./PhoneNumberResponse.mjs";
34
37
  export * from "./PlanInfo.mjs";
35
38
  export * from "./PlanLimits.mjs";
36
39
  export * from "./ReactionInConversation.mjs";
40
+ export * from "./RegistrationResponse.mjs";
37
41
  export * from "./SendMessageResponse.mjs";
38
42
  export * from "./SendReactionResponse.mjs";
39
43
  export * from "./SendTypingResponse.mjs";
@@ -1,8 +1,10 @@
1
1
  export * from "./AgentListResponse.mjs";
2
2
  export * from "./AgentNumberResponse.mjs";
3
3
  export * from "./AgentResponse.mjs";
4
+ export * from "./AgentSignUpRequest.mjs";
4
5
  export * from "./AgentUsageItem.mjs";
5
6
  export * from "./AgentUsageResponse.mjs";
7
+ export * from "./AgentVerifyRequest.mjs";
6
8
  export * from "./AllTimeStatsResponse.mjs";
7
9
  export * from "./AppRoutesAgentsConversationListResponse.mjs";
8
10
  export * from "./AppRoutesAgentsConversationSummary.mjs";
@@ -18,6 +20,7 @@ export * from "./ConversationDetail.mjs";
18
20
  export * from "./DailyUsagePoint.mjs";
19
21
  export * from "./DailyUsageResponse.mjs";
20
22
  export * from "./DeleteAgentResponse.mjs";
23
+ export * from "./FieldWarning.mjs";
21
24
  export * from "./HttpValidationError.mjs";
22
25
  export * from "./MessageInConversation.mjs";
23
26
  export * from "./MessageListResponse.mjs";
@@ -34,6 +37,7 @@ export * from "./PhoneNumberResponse.mjs";
34
37
  export * from "./PlanInfo.mjs";
35
38
  export * from "./PlanLimits.mjs";
36
39
  export * from "./ReactionInConversation.mjs";
40
+ export * from "./RegistrationResponse.mjs";
37
41
  export * from "./SendMessageResponse.mjs";
38
42
  export * from "./SendReactionResponse.mjs";
39
43
  export * from "./SendTypingResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.11";
1
+ export declare const SDK_VERSION = "1.0.12";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.11";
1
+ export const SDK_VERSION = "1.0.12";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentphone",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",