agentphone 1.0.2 → 1.0.4
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +18 -8
- package/dist/cjs/api/resources/agentWebhooks/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agentWebhooks/client/Client.js +1 -1
- package/dist/cjs/api/resources/agents/client/Client.d.ts +30 -2
- package/dist/cjs/api/resources/agents/client/Client.js +96 -2
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.d.ts +11 -0
- package/dist/cjs/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/calls/client/Client.d.ts +27 -3
- package/dist/cjs/api/resources/calls/client/Client.js +68 -4
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -2
- package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +8 -0
- package/dist/cjs/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.js +3 -0
- package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +94 -0
- package/dist/cjs/api/resources/contacts/client/Client.js +341 -0
- package/dist/cjs/api/resources/contacts/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/contacts/client/index.js +17 -0
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +13 -0
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.d.ts +13 -0
- package/dist/cjs/api/resources/contacts/client/requests/UpdateContactRequest.js +3 -0
- package/dist/cjs/api/resources/contacts/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/contacts/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/contacts/index.d.ts +1 -0
- package/dist/cjs/api/resources/contacts/index.js +17 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/index.js +5 -1
- package/dist/cjs/api/resources/messages/client/Client.d.ts +49 -0
- package/dist/cjs/api/resources/messages/client/Client.js +183 -0
- package/dist/cjs/api/resources/messages/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/client/index.js +17 -0
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +15 -0
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +3 -0
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +11 -0
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +3 -0
- package/dist/cjs/api/resources/messages/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/messages/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/messages/index.d.ts +1 -0
- package/dist/cjs/api/resources/messages/index.js +17 -0
- package/dist/cjs/api/resources/numbers/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/numbers/client/Client.js +1 -1
- package/dist/cjs/api/resources/usage/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/usage/client/Client.js +1 -1
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/webhooks/client/Client.js +6 -6
- package/dist/cjs/api/types/AgentNumberResponse.d.ts +1 -0
- package/dist/cjs/api/types/AgentResponse.d.ts +2 -0
- package/dist/cjs/api/types/CallSummary.d.ts +1 -1
- package/dist/cjs/api/types/ContactListResponse.d.ts +6 -0
- package/dist/cjs/api/types/ContactListResponse.js +3 -0
- package/dist/cjs/api/types/ContactResponse.d.ts +9 -0
- package/dist/cjs/api/types/ContactResponse.js +3 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +2 -0
- package/dist/cjs/api/types/MessageResponse.d.ts +2 -0
- package/dist/cjs/api/types/PhoneNumberResponse.d.ts +1 -0
- package/dist/cjs/api/types/SendMessageResponse.d.ts +7 -0
- package/dist/cjs/api/types/SendMessageResponse.js +3 -0
- package/dist/cjs/api/types/SendReactionResponse.d.ts +6 -0
- package/dist/cjs/api/types/SendReactionResponse.js +3 -0
- package/dist/cjs/api/types/WebhookCreateRequest.d.ts +1 -0
- package/dist/cjs/api/types/WebhookResponse.d.ts +1 -0
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -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 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/agentWebhooks/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agentWebhooks/client/Client.mjs +1 -1
- package/dist/esm/api/resources/agents/client/Client.d.mts +30 -2
- package/dist/esm/api/resources/agents/client/Client.mjs +96 -2
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.d.mts +11 -0
- package/dist/esm/api/resources/agents/client/requests/DetachNumberFromAgentV1AgentsAgentIdNumbersNumberIdDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/calls/client/Client.d.mts +27 -3
- package/dist/esm/api/resources/calls/client/Client.mjs +68 -4
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -2
- package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +8 -0
- package/dist/esm/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/calls/client/requests/StreamCallTranscriptV1CallsCallIdTranscriptStreamGetRequest.mjs +2 -0
- package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/contacts/client/Client.d.mts +94 -0
- package/dist/esm/api/resources/contacts/client/Client.mjs +304 -0
- package/dist/esm/api/resources/contacts/client/index.d.mts +1 -0
- package/dist/esm/api/resources/contacts/client/index.mjs +1 -0
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +13 -0
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/DeleteContactV1ContactsContactIdDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/GetContactV1ContactsContactIdGetRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.d.mts +13 -0
- package/dist/esm/api/resources/contacts/client/requests/UpdateContactRequest.mjs +2 -0
- package/dist/esm/api/resources/contacts/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/contacts/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/contacts/index.d.mts +1 -0
- package/dist/esm/api/resources/contacts/index.mjs +1 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/index.mjs +4 -0
- package/dist/esm/api/resources/messages/client/Client.d.mts +49 -0
- package/dist/esm/api/resources/messages/client/Client.mjs +146 -0
- package/dist/esm/api/resources/messages/client/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/client/index.mjs +1 -0
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +15 -0
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +2 -0
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +11 -0
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +2 -0
- package/dist/esm/api/resources/messages/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/messages/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/messages/index.d.mts +1 -0
- package/dist/esm/api/resources/messages/index.mjs +1 -0
- package/dist/esm/api/resources/numbers/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/numbers/client/Client.mjs +1 -1
- package/dist/esm/api/resources/usage/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/usage/client/Client.mjs +1 -1
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/webhooks/client/Client.mjs +6 -6
- package/dist/esm/api/types/AgentNumberResponse.d.mts +1 -0
- package/dist/esm/api/types/AgentResponse.d.mts +2 -0
- package/dist/esm/api/types/CallSummary.d.mts +1 -1
- package/dist/esm/api/types/ContactListResponse.d.mts +6 -0
- package/dist/esm/api/types/ContactListResponse.mjs +2 -0
- package/dist/esm/api/types/ContactResponse.d.mts +9 -0
- package/dist/esm/api/types/ContactResponse.mjs +2 -0
- package/dist/esm/api/types/MessageInConversation.d.mts +2 -0
- package/dist/esm/api/types/MessageResponse.d.mts +2 -0
- package/dist/esm/api/types/PhoneNumberResponse.d.mts +1 -0
- package/dist/esm/api/types/SendMessageResponse.d.mts +7 -0
- package/dist/esm/api/types/SendMessageResponse.mjs +2 -0
- package/dist/esm/api/types/SendReactionResponse.d.mts +6 -0
- package/dist/esm/api/types/SendReactionResponse.mjs +2 -0
- package/dist/esm/api/types/WebhookCreateRequest.d.mts +1 -0
- package/dist/esm/api/types/WebhookResponse.d.mts +1 -0
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +780 -114
|
@@ -0,0 +1,146 @@
|
|
|
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
|
+
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
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
28
|
+
import * as AgentPhone from "../../../index.mjs";
|
|
29
|
+
export class MessagesClient {
|
|
30
|
+
constructor(options) {
|
|
31
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Send an outbound message (SMS or iMessage) via the provider assigned to the number.
|
|
35
|
+
*
|
|
36
|
+
* @param {AgentPhone.SendMessageRequest} request
|
|
37
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.messages.sendMessage({
|
|
43
|
+
* agent_id: "agent_id",
|
|
44
|
+
* to_number: "to_number",
|
|
45
|
+
* body: "body"
|
|
46
|
+
* })
|
|
47
|
+
*/
|
|
48
|
+
sendMessage(request, requestOptions) {
|
|
49
|
+
return core.HttpResponsePromise.fromPromise(this.__sendMessage(request, requestOptions));
|
|
50
|
+
}
|
|
51
|
+
__sendMessage(request, requestOptions) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
54
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
55
|
+
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);
|
|
56
|
+
const _response = yield core.fetcher({
|
|
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.Default, "v1/messages"),
|
|
58
|
+
method: "POST",
|
|
59
|
+
headers: _headers,
|
|
60
|
+
contentType: "application/json",
|
|
61
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
62
|
+
requestType: "json",
|
|
63
|
+
body: request,
|
|
64
|
+
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,
|
|
65
|
+
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,
|
|
66
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
67
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
68
|
+
logging: this._options.logging,
|
|
69
|
+
});
|
|
70
|
+
if (_response.ok) {
|
|
71
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
72
|
+
}
|
|
73
|
+
if (_response.error.reason === "status-code") {
|
|
74
|
+
switch (_response.error.statusCode) {
|
|
75
|
+
case 422:
|
|
76
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
77
|
+
default:
|
|
78
|
+
throw new errors.AgentPhoneError({
|
|
79
|
+
statusCode: _response.error.statusCode,
|
|
80
|
+
body: _response.error.body,
|
|
81
|
+
rawResponse: _response.rawResponse,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/messages");
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Send a tapback reaction to a message (iMessage only).
|
|
90
|
+
*
|
|
91
|
+
* Reactions are an iMessage feature. Attempting to react to a message
|
|
92
|
+
* sent via an SMS/Twilio number will return a clear error.
|
|
93
|
+
*
|
|
94
|
+
* @param {AgentPhone.SendReactionRequest} request
|
|
95
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
96
|
+
*
|
|
97
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* await client.messages.sendReaction({
|
|
101
|
+
* message_id: "message_id",
|
|
102
|
+
* reaction: "reaction"
|
|
103
|
+
* })
|
|
104
|
+
*/
|
|
105
|
+
sendReaction(request, requestOptions) {
|
|
106
|
+
return core.HttpResponsePromise.fromPromise(this.__sendReaction(request, requestOptions));
|
|
107
|
+
}
|
|
108
|
+
__sendReaction(request, requestOptions) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
111
|
+
const { message_id: messageId } = request, _body = __rest(request, ["message_id"]);
|
|
112
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
113
|
+
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);
|
|
114
|
+
const _response = yield core.fetcher({
|
|
115
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Default, `v1/messages/${core.url.encodePathParam(messageId)}/reactions`),
|
|
116
|
+
method: "POST",
|
|
117
|
+
headers: _headers,
|
|
118
|
+
contentType: "application/json",
|
|
119
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
120
|
+
requestType: "json",
|
|
121
|
+
body: _body,
|
|
122
|
+
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,
|
|
123
|
+
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,
|
|
124
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
125
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
126
|
+
logging: this._options.logging,
|
|
127
|
+
});
|
|
128
|
+
if (_response.ok) {
|
|
129
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
130
|
+
}
|
|
131
|
+
if (_response.error.reason === "status-code") {
|
|
132
|
+
switch (_response.error.statusCode) {
|
|
133
|
+
case 422:
|
|
134
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
135
|
+
default:
|
|
136
|
+
throw new errors.AgentPhoneError({
|
|
137
|
+
statusCode: _response.error.statusCode,
|
|
138
|
+
body: _response.error.body,
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/messages/{message_id}/reactions");
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* agent_id: "agent_id",
|
|
5
|
+
* to_number: "to_number",
|
|
6
|
+
* body: "body"
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface SendMessageRequest {
|
|
10
|
+
agent_id: string;
|
|
11
|
+
to_number: string;
|
|
12
|
+
body: string;
|
|
13
|
+
media_url?: string | null;
|
|
14
|
+
number_id?: string | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -11,7 +11,7 @@ export declare class NumbersClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<NumbersClient.Options>;
|
|
12
12
|
constructor(options: NumbersClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* List all phone numbers for this
|
|
14
|
+
* List all phone numbers for this account.
|
|
15
15
|
*
|
|
16
16
|
* @param {AgentPhone.ListNumbersV1NumbersGetRequest} request
|
|
17
17
|
* @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -20,7 +20,7 @@ export class NumbersClient {
|
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* List all phone numbers for this
|
|
23
|
+
* List all phone numbers for this account.
|
|
24
24
|
*
|
|
25
25
|
* @param {AgentPhone.ListNumbersV1NumbersGetRequest} request
|
|
26
26
|
* @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -11,7 +11,7 @@ export declare class UsageClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<UsageClient.Options>;
|
|
12
12
|
constructor(options: UsageClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Get usage statistics for the current
|
|
14
|
+
* Get usage statistics for the current account.
|
|
15
15
|
*
|
|
16
16
|
* Returns:
|
|
17
17
|
* - Phone number limits (used/limit/remaining)
|
|
@@ -20,7 +20,7 @@ export class UsageClient {
|
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Get usage statistics for the current
|
|
23
|
+
* Get usage statistics for the current account.
|
|
24
24
|
*
|
|
25
25
|
* Returns:
|
|
26
26
|
* - Phone number limits (used/limit/remaining)
|
|
@@ -11,7 +11,7 @@ export declare class WebhooksClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
|
|
12
12
|
constructor(options: WebhooksClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Get the master webhook configuration for this
|
|
14
|
+
* Get the master webhook configuration for this account.
|
|
15
15
|
*
|
|
16
16
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
17
|
*
|
|
@@ -21,7 +21,7 @@ export declare class WebhooksClient {
|
|
|
21
21
|
getWebhook(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentPhone.WebhookResponse | null>;
|
|
22
22
|
private __getWebhook;
|
|
23
23
|
/**
|
|
24
|
-
* Register or update the webhook URL for this
|
|
24
|
+
* Register or update the webhook URL for this account.
|
|
25
25
|
*
|
|
26
26
|
* If a webhook already exists, it will be updated.
|
|
27
27
|
* A new secret is generated each time.
|
|
@@ -42,7 +42,7 @@ export declare class WebhooksClient {
|
|
|
42
42
|
createOrUpdateWebhook(request: AgentPhone.WebhookCreateRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentPhone.WebhookResponse>;
|
|
43
43
|
private __createOrUpdateWebhook;
|
|
44
44
|
/**
|
|
45
|
-
* Remove the master webhook for this
|
|
45
|
+
* Remove the master webhook for this account.
|
|
46
46
|
*
|
|
47
47
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
48
|
*
|
|
@@ -52,7 +52,7 @@ export declare class WebhooksClient {
|
|
|
52
52
|
deleteWebhook(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
53
53
|
private __deleteWebhook;
|
|
54
54
|
/**
|
|
55
|
-
* Get paginated webhook delivery attempts for all
|
|
55
|
+
* Get paginated webhook delivery attempts for all account webhooks.
|
|
56
56
|
*
|
|
57
57
|
* @param {AgentPhone.ListDeliveriesV1WebhooksDeliveriesGetRequest} request
|
|
58
58
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -65,7 +65,7 @@ export declare class WebhooksClient {
|
|
|
65
65
|
listDeliveries(request?: AgentPhone.ListDeliveriesV1WebhooksDeliveriesGetRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentPhone.PaginatedDeliveriesResponse>;
|
|
66
66
|
private __listDeliveries;
|
|
67
67
|
/**
|
|
68
|
-
* Aggregated delivery stats for the
|
|
68
|
+
* Aggregated delivery stats for the account's webhooks over the last N hours.
|
|
69
69
|
*
|
|
70
70
|
* @param {AgentPhone.DeliveryStatsV1WebhooksDeliveriesStatsGetRequest} request
|
|
71
71
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -92,7 +92,7 @@ export declare class WebhooksClient {
|
|
|
92
92
|
*
|
|
93
93
|
* Sends a fake message payload to the configured URL.
|
|
94
94
|
* Pass ?agentId=... to control which agent appears in the payload;
|
|
95
|
-
* otherwise the first agent in the
|
|
95
|
+
* otherwise the first agent in the account is used.
|
|
96
96
|
*
|
|
97
97
|
* @param {AgentPhone.TestWebhookV1WebhooksTestPostRequest} request
|
|
98
98
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -20,7 +20,7 @@ export class WebhooksClient {
|
|
|
20
20
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Get the master webhook configuration for this
|
|
23
|
+
* Get the master webhook configuration for this account.
|
|
24
24
|
*
|
|
25
25
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
26
|
*
|
|
@@ -60,7 +60,7 @@ export class WebhooksClient {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Register or update the webhook URL for this
|
|
63
|
+
* Register or update the webhook URL for this account.
|
|
64
64
|
*
|
|
65
65
|
* If a webhook already exists, it will be updated.
|
|
66
66
|
* A new secret is generated each time.
|
|
@@ -119,7 +119,7 @@ export class WebhooksClient {
|
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
|
-
* Remove the master webhook for this
|
|
122
|
+
* Remove the master webhook for this account.
|
|
123
123
|
*
|
|
124
124
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
125
125
|
*
|
|
@@ -159,7 +159,7 @@ export class WebhooksClient {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
162
|
-
* Get paginated webhook delivery attempts for all
|
|
162
|
+
* Get paginated webhook delivery attempts for all account webhooks.
|
|
163
163
|
*
|
|
164
164
|
* @param {AgentPhone.ListDeliveriesV1WebhooksDeliveriesGetRequest} request
|
|
165
165
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -216,7 +216,7 @@ export class WebhooksClient {
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
* Aggregated delivery stats for the
|
|
219
|
+
* Aggregated delivery stats for the account's webhooks over the last N hours.
|
|
220
220
|
*
|
|
221
221
|
* @param {AgentPhone.DeliveryStatsV1WebhooksDeliveriesStatsGetRequest} request
|
|
222
222
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -315,7 +315,7 @@ export class WebhooksClient {
|
|
|
315
315
|
*
|
|
316
316
|
* Sends a fake message payload to the configured URL.
|
|
317
317
|
* Pass ?agentId=... to control which agent appears in the payload;
|
|
318
|
-
* otherwise the first agent in the
|
|
318
|
+
* otherwise the first agent in the account is used.
|
|
319
319
|
*
|
|
320
320
|
* @param {AgentPhone.TestWebhookV1WebhooksTestPostRequest} request
|
|
321
321
|
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -4,10 +4,12 @@ export interface AgentResponse {
|
|
|
4
4
|
name: string;
|
|
5
5
|
description: string | null;
|
|
6
6
|
voiceMode: string;
|
|
7
|
+
modelTier?: string;
|
|
7
8
|
systemPrompt?: string | null;
|
|
8
9
|
beginMessage?: string | null;
|
|
9
10
|
voice: string;
|
|
10
11
|
transferNumber?: string | null;
|
|
12
|
+
voicemailMessage?: string | null;
|
|
11
13
|
createdAt: string;
|
|
12
14
|
numbers?: AgentPhone.AgentNumberResponse[] | null;
|
|
13
15
|
}
|
|
@@ -9,6 +9,8 @@ export * from "./AppRoutesConversationsConversationSummary.mjs";
|
|
|
9
9
|
export * from "./AttachNumberResponse.mjs";
|
|
10
10
|
export * from "./CallListResponse.mjs";
|
|
11
11
|
export * from "./CallSummary.mjs";
|
|
12
|
+
export * from "./ContactListResponse.mjs";
|
|
13
|
+
export * from "./ContactResponse.mjs";
|
|
12
14
|
export * from "./ConversationDetail.mjs";
|
|
13
15
|
export * from "./DailyUsagePoint.mjs";
|
|
14
16
|
export * from "./DailyUsageResponse.mjs";
|
|
@@ -26,6 +28,8 @@ export * from "./PhoneNumberListResponse.mjs";
|
|
|
26
28
|
export * from "./PhoneNumberResponse.mjs";
|
|
27
29
|
export * from "./PlanInfo.mjs";
|
|
28
30
|
export * from "./PlanLimits.mjs";
|
|
31
|
+
export * from "./SendMessageResponse.mjs";
|
|
32
|
+
export * from "./SendReactionResponse.mjs";
|
|
29
33
|
export * from "./UsageResponse.mjs";
|
|
30
34
|
export * from "./UsageStats.mjs";
|
|
31
35
|
export * from "./ValidationError.mjs";
|
|
@@ -9,6 +9,8 @@ export * from "./AppRoutesConversationsConversationSummary.mjs";
|
|
|
9
9
|
export * from "./AttachNumberResponse.mjs";
|
|
10
10
|
export * from "./CallListResponse.mjs";
|
|
11
11
|
export * from "./CallSummary.mjs";
|
|
12
|
+
export * from "./ContactListResponse.mjs";
|
|
13
|
+
export * from "./ContactResponse.mjs";
|
|
12
14
|
export * from "./ConversationDetail.mjs";
|
|
13
15
|
export * from "./DailyUsagePoint.mjs";
|
|
14
16
|
export * from "./DailyUsageResponse.mjs";
|
|
@@ -26,6 +28,8 @@ export * from "./PhoneNumberListResponse.mjs";
|
|
|
26
28
|
export * from "./PhoneNumberResponse.mjs";
|
|
27
29
|
export * from "./PlanInfo.mjs";
|
|
28
30
|
export * from "./PlanLimits.mjs";
|
|
31
|
+
export * from "./SendMessageResponse.mjs";
|
|
32
|
+
export * from "./SendReactionResponse.mjs";
|
|
29
33
|
export * from "./UsageResponse.mjs";
|
|
30
34
|
export * from "./UsageStats.mjs";
|
|
31
35
|
export * from "./ValidationError.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.4";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.4";
|