agentphone 1.0.11 → 1.0.13
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.
- package/README.md +10 -10
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -6
- package/dist/cjs/Client.js +26 -26
- package/dist/cjs/api/resources/agents/client/Client.js +11 -11
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +71 -0
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +66 -0
- package/dist/cjs/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +71 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +66 -0
- package/dist/cjs/api/resources/calls/client/Client.js +16 -5
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/contacts/client/Client.js +2 -3
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/conversations/client/Client.js +7 -6
- package/dist/cjs/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/index.d.ts +4 -4
- package/dist/cjs/api/resources/index.js +5 -5
- package/dist/cjs/api/resources/numbers/client/Client.js +18 -7
- package/dist/cjs/api/resources/numbers/client/requests/CreateNumberRequest.d.ts +2 -0
- package/dist/cjs/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.ts +2 -0
- package/dist/cjs/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/registration/client/Client.d.ts +61 -0
- package/dist/cjs/api/resources/{agentSignup → registration}/client/Client.js +44 -69
- package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.d.ts +61 -0
- package/dist/cjs/api/resources/registration/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/subAccounts/client/Client.d.ts +61 -0
- package/dist/cjs/api/resources/{integrations → subAccounts}/client/Client.js +99 -106
- package/dist/cjs/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.ts +9 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.ts +11 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.js +3 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +7 -4
- package/dist/cjs/api/resources/webhooks/client/Client.js +14 -9
- package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.ts +14 -0
- package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.ts +8 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/types/AgentResponse.d.ts +2 -0
- package/dist/cjs/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.ts +0 -6
- package/dist/cjs/api/types/AgentSignUpRequest.js +3 -0
- package/dist/cjs/api/types/AgentVerifyRequest.d.ts +4 -0
- package/dist/cjs/api/types/AgentVerifyRequest.js +3 -0
- package/dist/cjs/api/types/AppRoutesConversationsConversationSummary.d.ts +6 -0
- package/dist/cjs/api/types/ConversationDetail.d.ts +5 -0
- package/dist/cjs/api/types/FieldWarning.d.ts +6 -0
- package/dist/cjs/api/types/FieldWarning.js +3 -0
- package/dist/cjs/api/types/GroupParticipant.d.ts +7 -0
- package/dist/cjs/api/types/GroupParticipant.js +3 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
- package/dist/cjs/api/types/RegistrationResponse.d.ts +8 -0
- package/dist/cjs/api/types/RegistrationResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +5 -0
- package/dist/cjs/api/types/index.js +5 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +6 -6
- package/dist/esm/Client.mjs +10 -10
- package/dist/esm/api/resources/agents/client/Client.mjs +12 -12
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +71 -0
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +66 -0
- package/dist/esm/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +71 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +66 -0
- package/dist/esm/api/resources/calls/client/Client.mjs +17 -6
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/contacts/client/Client.mjs +3 -4
- package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/conversations/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/conversations/client/Client.mjs +8 -7
- package/dist/esm/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/index.d.mts +4 -4
- package/dist/esm/api/resources/index.mjs +4 -4
- package/dist/esm/api/resources/numbers/client/Client.mjs +19 -8
- package/dist/esm/api/resources/numbers/client/requests/CreateNumberRequest.d.mts +2 -0
- package/dist/esm/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.mts +2 -0
- package/dist/esm/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/registration/client/Client.d.mts +61 -0
- package/dist/esm/api/resources/registration/client/Client.mjs +108 -0
- package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.d.mts +61 -0
- package/dist/esm/api/resources/registration/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/subAccounts/client/Client.d.mts +61 -0
- package/dist/esm/api/resources/{integrations → subAccounts}/client/Client.mjs +97 -104
- package/dist/esm/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.mts +9 -0
- package/dist/esm/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.mts +11 -0
- package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/subAccounts/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +7 -4
- package/dist/esm/api/resources/webhooks/client/Client.mjs +15 -10
- package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.mts +14 -0
- package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.mts +8 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
- package/dist/esm/api/types/AgentResponse.d.mts +2 -0
- package/dist/esm/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.mts +0 -6
- package/dist/esm/api/types/AgentSignUpRequest.mjs +2 -0
- package/dist/esm/api/types/AgentVerifyRequest.d.mts +4 -0
- package/dist/esm/api/types/AgentVerifyRequest.mjs +2 -0
- package/dist/esm/api/types/AppRoutesConversationsConversationSummary.d.mts +6 -0
- package/dist/esm/api/types/ConversationDetail.d.mts +5 -0
- package/dist/esm/api/types/FieldWarning.d.mts +6 -0
- package/dist/esm/api/types/FieldWarning.mjs +2 -0
- package/dist/esm/api/types/GroupParticipant.d.mts +7 -0
- package/dist/esm/api/types/GroupParticipant.mjs +2 -0
- package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
- package/dist/esm/api/types/RegistrationResponse.d.mts +8 -0
- package/dist/esm/api/types/RegistrationResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +5 -0
- package/dist/esm/api/types/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +188 -277
- package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +0 -50
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +0 -11
- package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/integrations/client/Client.d.ts +0 -64
- package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +0 -9
- package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +0 -1
- package/dist/esm/api/resources/agentSignup/client/Client.d.mts +0 -50
- package/dist/esm/api/resources/agentSignup/client/Client.mjs +0 -133
- package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +0 -11
- package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/integrations/client/Client.d.mts +0 -64
- package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +0 -9
- package/dist/esm/api/resources/integrations/client/requests/index.d.mts +0 -1
- /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentSignUpRequest.js → registration/client/requests/RegistrationRequest.js} +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/index.js +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentVerifyRequest.js → subAccounts/client/requests/CreateSubAccountRequest.js} +0 -0
- /package/dist/cjs/api/resources/{integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js → subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.js} +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/index.js +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{agentSignup/client/requests/AgentSignUpRequest.mjs → registration/client/requests/RegistrationRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/index.mjs +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{agentSignup/client/requests/AgentVerifyRequest.mjs → subAccounts/client/requests/CreateSubAccountRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs → subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/index.mjs +0 -0
|
@@ -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 = {}));
|
|
@@ -8,8 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
24
|
import * as core from "../../../../core/index.mjs";
|
|
14
25
|
import * as environments from "../../../../environments.mjs";
|
|
15
26
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
@@ -36,9 +47,8 @@ export class CallsClient {
|
|
|
36
47
|
__listCalls() {
|
|
37
48
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
38
49
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
-
const {
|
|
50
|
+
const { offset, status, direction, type: type_, search, "X-Sub-Account-Id": subAccountId } = request;
|
|
40
51
|
const _queryParams = {
|
|
41
|
-
limit,
|
|
42
52
|
offset,
|
|
43
53
|
status,
|
|
44
54
|
direction,
|
|
@@ -46,7 +56,7 @@ export class CallsClient {
|
|
|
46
56
|
search,
|
|
47
57
|
};
|
|
48
58
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
49
|
-
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);
|
|
59
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
50
60
|
const _response = yield core.fetcher({
|
|
51
61
|
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/calls"),
|
|
52
62
|
method: "GET",
|
|
@@ -107,8 +117,9 @@ export class CallsClient {
|
|
|
107
117
|
__createOutboundCall(request, requestOptions) {
|
|
108
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
119
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
120
|
+
const { "X-Sub-Account-Id": subAccountId } = request, _body = __rest(request, ["X-Sub-Account-Id"]);
|
|
110
121
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
111
|
-
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);
|
|
122
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
112
123
|
const _response = yield core.fetcher({
|
|
113
124
|
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/calls"),
|
|
114
125
|
method: "POST",
|
|
@@ -116,7 +127,7 @@ export class CallsClient {
|
|
|
116
127
|
contentType: "application/json",
|
|
117
128
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
118
129
|
requestType: "json",
|
|
119
|
-
body:
|
|
130
|
+
body: _body,
|
|
120
131
|
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,
|
|
121
132
|
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,
|
|
122
133
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface CreateOutboundCallRequest {
|
|
9
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
10
|
+
"X-Sub-Account-Id"?: string;
|
|
9
11
|
/** Agent ID to make the call from */
|
|
10
12
|
agentId: string;
|
|
11
13
|
/** Phone number to call (E.164 format) */
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* {}
|
|
4
4
|
*/
|
|
5
5
|
export interface ListCallsV1CallsGetRequest {
|
|
6
|
-
limit?: number;
|
|
7
6
|
offset?: number;
|
|
8
7
|
/** Filter by status: completed, in-progress, failed */
|
|
9
8
|
status?: string | null;
|
|
@@ -13,4 +12,6 @@ export interface ListCallsV1CallsGetRequest {
|
|
|
13
12
|
type?: string | null;
|
|
14
13
|
/** Search fromNumber or toNumber (contains) */
|
|
15
14
|
search?: string | null;
|
|
15
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
16
|
+
"X-Sub-Account-Id"?: string;
|
|
16
17
|
}
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import * as environments from "../../../../environments.mjs";
|
|
26
26
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
@@ -49,14 +49,13 @@ export class ContactsClient {
|
|
|
49
49
|
__listContacts() {
|
|
50
50
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
51
51
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
52
|
-
const {
|
|
52
|
+
const { limit, offset, "X-Sub-Account-Id": subAccountId } = request;
|
|
53
53
|
const _queryParams = {
|
|
54
|
-
search,
|
|
55
54
|
limit,
|
|
56
55
|
offset,
|
|
57
56
|
};
|
|
58
57
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
59
|
-
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);
|
|
58
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
60
59
|
const _response = yield core.fetcher({
|
|
61
60
|
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"),
|
|
62
61
|
method: "GET",
|
package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* {}
|
|
4
4
|
*/
|
|
5
5
|
export interface ListContactsV1ContactsGetRequest {
|
|
6
|
-
search?: string | null;
|
|
7
6
|
limit?: number;
|
|
8
7
|
offset?: number;
|
|
8
|
+
/** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
|
|
9
|
+
"X-Sub-Account-Id"?: string;
|
|
9
10
|
}
|
|
@@ -83,9 +83,11 @@ export declare class ConversationsClient {
|
|
|
83
83
|
/**
|
|
84
84
|
* Show a typing indicator in the conversation (iMessage only).
|
|
85
85
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
* Works for both 1:1 and group chats: a group id is itself a valid typing
|
|
87
|
+
* target, so every participant sees the indicator. Best-effort: the
|
|
88
|
+
* indicator may be silently dropped if the chat has no recent activity, the
|
|
89
|
+
* recipient isn't on iMessage, or it's RCS-routed (RCS carries no composing
|
|
90
|
+
* state). Auto-expires after a few seconds; no "stop typing" call needed.
|
|
89
91
|
*
|
|
90
92
|
* @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
|
|
91
93
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -20,7 +20,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import * as environments from "../../../../environments.mjs";
|
|
26
26
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
@@ -50,13 +50,12 @@ export class ConversationsClient {
|
|
|
50
50
|
__listConversations() {
|
|
51
51
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
52
52
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53
|
-
const {
|
|
53
|
+
const { offset, "X-Sub-Account-Id": subAccountId } = request;
|
|
54
54
|
const _queryParams = {
|
|
55
|
-
limit,
|
|
56
55
|
offset,
|
|
57
56
|
};
|
|
58
57
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
59
|
-
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);
|
|
58
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
60
59
|
const _response = yield core.fetcher({
|
|
61
60
|
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"),
|
|
62
61
|
method: "GET",
|
|
@@ -265,9 +264,11 @@ export class ConversationsClient {
|
|
|
265
264
|
/**
|
|
266
265
|
* Show a typing indicator in the conversation (iMessage only).
|
|
267
266
|
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
267
|
+
* Works for both 1:1 and group chats: a group id is itself a valid typing
|
|
268
|
+
* target, so every participant sees the indicator. Best-effort: the
|
|
269
|
+
* indicator may be silently dropped if the chat has no recent activity, the
|
|
270
|
+
* recipient isn't on iMessage, or it's RCS-routed (RCS carries no composing
|
|
271
|
+
* state). Auto-expires after a few seconds; no "stop typing" call needed.
|
|
271
272
|
*
|
|
272
273
|
* @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
|
|
273
274
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -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,14 @@ 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";
|
|
19
|
+
export * from "./subAccounts/client/requests/index.mjs";
|
|
20
|
+
export * as subAccounts from "./subAccounts/index.mjs";
|
|
21
21
|
export * from "./usage/client/requests/index.mjs";
|
|
22
22
|
export * as usage from "./usage/index.mjs";
|
|
23
23
|
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,14 @@ 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";
|
|
19
|
+
export * from "./subAccounts/client/requests/index.mjs";
|
|
20
|
+
export * as subAccounts from "./subAccounts/index.mjs";
|
|
21
21
|
export * from "./usage/client/requests/index.mjs";
|
|
22
22
|
export * as usage from "./usage/index.mjs";
|
|
23
23
|
export * from "./usage/types/index.mjs";
|
|
@@ -8,8 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
23
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
24
|
import * as core from "../../../../core/index.mjs";
|
|
14
25
|
import * as environments from "../../../../environments.mjs";
|
|
15
26
|
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
@@ -36,13 +47,12 @@ export class NumbersClient {
|
|
|
36
47
|
__listNumbers() {
|
|
37
48
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
38
49
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
|
-
const {
|
|
50
|
+
const { offset, "X-Sub-Account-Id": subAccountId } = request;
|
|
40
51
|
const _queryParams = {
|
|
41
|
-
limit,
|
|
42
52
|
offset,
|
|
43
53
|
};
|
|
44
54
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
45
|
-
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);
|
|
55
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
46
56
|
const _response = yield core.fetcher({
|
|
47
57
|
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"),
|
|
48
58
|
method: "GET",
|
|
@@ -95,8 +105,9 @@ export class NumbersClient {
|
|
|
95
105
|
__createNumber() {
|
|
96
106
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
97
107
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
108
|
+
const { "X-Sub-Account-Id": subAccountId } = request, _body = __rest(request, ["X-Sub-Account-Id"]);
|
|
98
109
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
99
|
-
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);
|
|
110
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
100
111
|
const _response = yield core.fetcher({
|
|
101
112
|
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"),
|
|
102
113
|
method: "POST",
|
|
@@ -104,7 +115,7 @@ export class NumbersClient {
|
|
|
104
115
|
contentType: "application/json",
|
|
105
116
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
106
117
|
requestType: "json",
|
|
107
|
-
body:
|
|
118
|
+
body: _body,
|
|
108
119
|
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,
|
|
109
120
|
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,
|
|
110
121
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -213,9 +224,9 @@ export class NumbersClient {
|
|
|
213
224
|
__deleteNumber(request, requestOptions) {
|
|
214
225
|
return __awaiter(this, void 0, void 0, function* () {
|
|
215
226
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
216
|
-
const { number_id: numberId } = request;
|
|
227
|
+
const { number_id: numberId, "X-Sub-Account-Id": subAccountId } = request;
|
|
217
228
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
218
|
-
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);
|
|
229
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
219
230
|
const _response = yield core.fetcher({
|
|
220
231
|
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)}`),
|
|
221
232
|
method: "DELETE",
|
|
@@ -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
|
+
}
|