agentphone 1.0.9 → 1.0.10
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 +3 -0
- package/dist/cjs/Client.js +17 -12
- package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agentSignup/client/Client.js +1 -1
- package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/Client.js +1 -1
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/calls/client/Client.js +56 -0
- package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.ts +9 -0
- package/dist/cjs/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.js +3 -0
- package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/contactCards/client/Client.d.ts +61 -0
- package/dist/cjs/api/resources/contactCards/client/Client.js +229 -0
- package/dist/cjs/api/resources/contactCards/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/contactCards/client/index.js +17 -0
- package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.ts +16 -0
- package/dist/cjs/api/resources/contactCards/client/requests/ContactCardWriteRequest.js +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.ts +9 -0
- package/dist/cjs/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.js +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/contactCards/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/contactCards/index.d.ts +1 -0
- package/dist/cjs/api/resources/contactCards/index.js +17 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/client/Client.js +1 -0
- package/dist/cjs/api/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.js +3 -1
- package/dist/cjs/api/resources/messages/client/Client.d.ts +10 -11
- package/dist/cjs/api/resources/messages/client/Client.js +10 -11
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +20 -0
- package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.js +19 -0
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +15 -2
- package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +13 -0
- package/dist/cjs/api/resources/messages/client/requests/index.d.ts +2 -2
- package/dist/cjs/api/resources/messages/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/numbers/client/Client.d.ts +4 -4
- package/dist/cjs/api/resources/numbers/client/Client.js +4 -4
- package/dist/cjs/api/types/AgentResponse.d.ts +1 -0
- package/dist/cjs/api/types/ContactCardResponse.d.ts +6 -0
- package/dist/cjs/api/types/ContactCardResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -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 +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/agentSignup/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agentSignup/client/Client.mjs +1 -1
- package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/calls/client/Client.mjs +56 -0
- package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.d.mts +9 -0
- package/dist/esm/api/resources/calls/client/requests/EndCallV1CallsCallIdEndPostRequest.mjs +2 -0
- package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/contactCards/client/Client.d.mts +61 -0
- package/dist/esm/api/resources/contactCards/client/Client.mjs +192 -0
- package/dist/esm/api/resources/contactCards/client/index.d.mts +1 -0
- package/dist/esm/api/resources/contactCards/client/index.mjs +1 -0
- package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.d.mts +16 -0
- package/dist/esm/api/resources/contactCards/client/requests/ContactCardWriteRequest.mjs +2 -0
- package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/contactCards/client/requests/DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.d.mts +9 -0
- package/dist/esm/api/resources/contactCards/client/requests/GetContactCardV1NumbersNumberIdContactCardGetRequest.mjs +2 -0
- package/dist/esm/api/resources/contactCards/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/contactCards/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/contactCards/index.d.mts +1 -0
- package/dist/esm/api/resources/contactCards/index.mjs +1 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/conversations/client/Client.mjs +1 -0
- package/dist/esm/api/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/index.mjs +2 -0
- package/dist/esm/api/resources/messages/client/Client.d.mts +10 -11
- package/dist/esm/api/resources/messages/client/Client.mjs +10 -11
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +20 -0
- package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.mjs +18 -1
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +15 -2
- package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +12 -1
- package/dist/esm/api/resources/messages/client/requests/index.d.mts +2 -2
- package/dist/esm/api/resources/messages/client/requests/index.mjs +2 -1
- package/dist/esm/api/resources/numbers/client/Client.d.mts +4 -4
- package/dist/esm/api/resources/numbers/client/Client.mjs +4 -4
- package/dist/esm/api/types/AgentResponse.d.mts +1 -0
- package/dist/esm/api/types/ContactCardResponse.d.mts +6 -0
- package/dist/esm/api/types/ContactCardResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +286 -17
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { ContactCardWriteRequest } from "./ContactCardWriteRequest.js";
|
|
2
|
+
export type { DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest } from "./DeleteContactCardV1NumbersNumberIdContactCardDeleteRequest.js";
|
|
3
|
+
export type { GetContactCardV1NumbersNumberIdContactCardGetRequest } from "./GetContactCardV1NumbersNumberIdContactCardGetRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -14,6 +14,7 @@ export declare class ConversationsClient {
|
|
|
14
14
|
* List all conversations for this account.
|
|
15
15
|
*
|
|
16
16
|
* Sorted by most recent activity (lastMessageAt desc).
|
|
17
|
+
* Also includes conversations on shared lines owned by this account.
|
|
17
18
|
*
|
|
18
19
|
* @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
|
|
19
20
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -70,6 +70,7 @@ class ConversationsClient {
|
|
|
70
70
|
* List all conversations for this account.
|
|
71
71
|
*
|
|
72
72
|
* Sorted by most recent activity (lastMessageAt desc).
|
|
73
|
+
* Also includes conversations on shared lines owned by this account.
|
|
73
74
|
*
|
|
74
75
|
* @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
|
|
75
76
|
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -6,6 +6,8 @@ export * from "./agentWebhooks/client/requests/index.js";
|
|
|
6
6
|
export * as agentWebhooks from "./agentWebhooks/index.js";
|
|
7
7
|
export * from "./calls/client/requests/index.js";
|
|
8
8
|
export * as calls from "./calls/index.js";
|
|
9
|
+
export * from "./contactCards/client/requests/index.js";
|
|
10
|
+
export * as contactCards from "./contactCards/index.js";
|
|
9
11
|
export * from "./contacts/client/requests/index.js";
|
|
10
12
|
export * as contacts from "./contacts/index.js";
|
|
11
13
|
export * from "./conversations/client/requests/index.js";
|
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
|
|
39
|
+
exports.webhooks = exports.usage = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.contactCards = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
|
|
40
40
|
__exportStar(require("./agentSignup/client/requests/index.js"), exports);
|
|
41
41
|
exports.agentSignup = __importStar(require("./agentSignup/index.js"));
|
|
42
42
|
__exportStar(require("./agents/client/requests/index.js"), exports);
|
|
@@ -45,6 +45,8 @@ __exportStar(require("./agentWebhooks/client/requests/index.js"), exports);
|
|
|
45
45
|
exports.agentWebhooks = __importStar(require("./agentWebhooks/index.js"));
|
|
46
46
|
__exportStar(require("./calls/client/requests/index.js"), exports);
|
|
47
47
|
exports.calls = __importStar(require("./calls/index.js"));
|
|
48
|
+
__exportStar(require("./contactCards/client/requests/index.js"), exports);
|
|
49
|
+
exports.contactCards = __importStar(require("./contactCards/index.js"));
|
|
48
50
|
__exportStar(require("./contacts/client/requests/index.js"), exports);
|
|
49
51
|
exports.contacts = __importStar(require("./contacts/index.js"));
|
|
50
52
|
__exportStar(require("./conversations/client/requests/index.js"), exports);
|
|
@@ -13,7 +13,11 @@ export declare class MessagesClient {
|
|
|
13
13
|
/**
|
|
14
14
|
* Send an outbound message (SMS or iMessage) via the provider assigned to the number.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* Attach media by passing public HTTPS URLs in `media_urls`.
|
|
17
|
+
*
|
|
18
|
+
* ### Single attachment
|
|
19
|
+
*
|
|
20
|
+
* Pass a single-item array in `media_urls`. The URL must be publicly accessible.
|
|
17
21
|
*
|
|
18
22
|
* ### Carousel / multi-image (iMessage)
|
|
19
23
|
*
|
|
@@ -23,13 +27,7 @@ export declare class MessagesClient {
|
|
|
23
27
|
* - `body` must be omitted or empty (text cannot be sent alongside a carousel)
|
|
24
28
|
* - Only supported on iMessage-capable lines
|
|
25
29
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
|
|
29
|
-
*
|
|
30
|
-
* ### Multi-attachment (iMessage)
|
|
31
|
-
*
|
|
32
|
-
* Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
|
|
30
|
+
* > **Deprecation notice:** The `media_url` field (singular) is deprecated and will be removed in a future version. Use `media_urls` (array) instead — even for a single attachment, pass it as `media_urls: ["https://..."]`.
|
|
33
31
|
*
|
|
34
32
|
* @param {AgentPhone.SendMessageRequest} request
|
|
35
33
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -48,8 +46,9 @@ export declare class MessagesClient {
|
|
|
48
46
|
/**
|
|
49
47
|
* Send a tapback reaction to a message (iMessage only).
|
|
50
48
|
*
|
|
51
|
-
* Reactions are
|
|
52
|
-
*
|
|
49
|
+
* Reactions are available only for iMessage messages. Attempting to react
|
|
50
|
+
* to an SMS message or another channel that does not support tapbacks
|
|
51
|
+
* returns a clear error.
|
|
53
52
|
*
|
|
54
53
|
* @param {AgentPhone.SendReactionRequest} request
|
|
55
54
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -59,7 +58,7 @@ export declare class MessagesClient {
|
|
|
59
58
|
* @example
|
|
60
59
|
* await client.messages.sendReaction({
|
|
61
60
|
* message_id: "message_id",
|
|
62
|
-
* reaction: "
|
|
61
|
+
* reaction: "love"
|
|
63
62
|
* })
|
|
64
63
|
*/
|
|
65
64
|
sendReaction(request: AgentPhone.SendReactionRequest, requestOptions?: MessagesClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendReactionResponse>;
|
|
@@ -69,7 +69,11 @@ class MessagesClient {
|
|
|
69
69
|
/**
|
|
70
70
|
* Send an outbound message (SMS or iMessage) via the provider assigned to the number.
|
|
71
71
|
*
|
|
72
|
-
*
|
|
72
|
+
* Attach media by passing public HTTPS URLs in `media_urls`.
|
|
73
|
+
*
|
|
74
|
+
* ### Single attachment
|
|
75
|
+
*
|
|
76
|
+
* Pass a single-item array in `media_urls`. The URL must be publicly accessible.
|
|
73
77
|
*
|
|
74
78
|
* ### Carousel / multi-image (iMessage)
|
|
75
79
|
*
|
|
@@ -79,13 +83,7 @@ class MessagesClient {
|
|
|
79
83
|
* - `body` must be omitted or empty (text cannot be sent alongside a carousel)
|
|
80
84
|
* - Only supported on iMessage-capable lines
|
|
81
85
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* Pass a single URL in `media_url`. The URL must be publicly accessible. Works across all channels.
|
|
85
|
-
*
|
|
86
|
-
* ### Multi-attachment (iMessage)
|
|
87
|
-
*
|
|
88
|
-
* Some iMessage lines support multiple attachments (images and other file types) via `media_urls`. No minimum count; `body` can be included alongside attachments.
|
|
86
|
+
* > **Deprecation notice:** The `media_url` field (singular) is deprecated and will be removed in a future version. Use `media_urls` (array) instead — even for a single attachment, pass it as `media_urls: ["https://..."]`.
|
|
89
87
|
*
|
|
90
88
|
* @param {AgentPhone.SendMessageRequest} request
|
|
91
89
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -142,8 +140,9 @@ class MessagesClient {
|
|
|
142
140
|
/**
|
|
143
141
|
* Send a tapback reaction to a message (iMessage only).
|
|
144
142
|
*
|
|
145
|
-
* Reactions are
|
|
146
|
-
*
|
|
143
|
+
* Reactions are available only for iMessage messages. Attempting to react
|
|
144
|
+
* to an SMS message or another channel that does not support tapbacks
|
|
145
|
+
* returns a clear error.
|
|
147
146
|
*
|
|
148
147
|
* @param {AgentPhone.SendReactionRequest} request
|
|
149
148
|
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -153,7 +152,7 @@ class MessagesClient {
|
|
|
153
152
|
* @example
|
|
154
153
|
* await client.messages.sendReaction({
|
|
155
154
|
* message_id: "message_id",
|
|
156
|
-
* reaction: "
|
|
155
|
+
* reaction: "love"
|
|
157
156
|
* })
|
|
158
157
|
*/
|
|
159
158
|
sendReaction(request, requestOptions) {
|
|
@@ -13,4 +13,24 @@ export interface SendMessageRequest {
|
|
|
13
13
|
media_url?: string | null;
|
|
14
14
|
media_urls?: string[] | null;
|
|
15
15
|
number_id?: string | null;
|
|
16
|
+
/** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
|
|
17
|
+
send_style?: SendMessageRequest.SendStyle;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace SendMessageRequest {
|
|
20
|
+
/** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
|
|
21
|
+
const SendStyle: {
|
|
22
|
+
readonly Celebration: "celebration";
|
|
23
|
+
readonly Fireworks: "fireworks";
|
|
24
|
+
readonly Lasers: "lasers";
|
|
25
|
+
readonly Love: "love";
|
|
26
|
+
readonly Confetti: "confetti";
|
|
27
|
+
readonly Balloons: "balloons";
|
|
28
|
+
readonly Spotlight: "spotlight";
|
|
29
|
+
readonly Echo: "echo";
|
|
30
|
+
readonly Invisible: "invisible";
|
|
31
|
+
readonly Gentle: "gentle";
|
|
32
|
+
readonly Loud: "loud";
|
|
33
|
+
readonly Slam: "slam";
|
|
34
|
+
};
|
|
35
|
+
type SendStyle = (typeof SendStyle)[keyof typeof SendStyle];
|
|
16
36
|
}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SendMessageRequest = void 0;
|
|
5
|
+
var SendMessageRequest;
|
|
6
|
+
(function (SendMessageRequest) {
|
|
7
|
+
/** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
|
|
8
|
+
SendMessageRequest.SendStyle = {
|
|
9
|
+
Celebration: "celebration",
|
|
10
|
+
Fireworks: "fireworks",
|
|
11
|
+
Lasers: "lasers",
|
|
12
|
+
Love: "love",
|
|
13
|
+
Confetti: "confetti",
|
|
14
|
+
Balloons: "balloons",
|
|
15
|
+
Spotlight: "spotlight",
|
|
16
|
+
Echo: "echo",
|
|
17
|
+
Invisible: "invisible",
|
|
18
|
+
Gentle: "gentle",
|
|
19
|
+
Loud: "loud",
|
|
20
|
+
Slam: "slam",
|
|
21
|
+
};
|
|
22
|
+
})(SendMessageRequest || (exports.SendMessageRequest = SendMessageRequest = {}));
|
|
@@ -2,10 +2,23 @@
|
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
4
|
* message_id: "message_id",
|
|
5
|
-
* reaction: "
|
|
5
|
+
* reaction: "love"
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface SendReactionRequest {
|
|
9
9
|
message_id: string;
|
|
10
|
-
reaction:
|
|
10
|
+
/** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
|
|
11
|
+
reaction: SendReactionRequest.Reaction;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace SendReactionRequest {
|
|
14
|
+
/** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
|
|
15
|
+
const Reaction: {
|
|
16
|
+
readonly Love: "love";
|
|
17
|
+
readonly Like: "like";
|
|
18
|
+
readonly Dislike: "dislike";
|
|
19
|
+
readonly Laugh: "laugh";
|
|
20
|
+
readonly Emphasize: "emphasize";
|
|
21
|
+
readonly Question: "question";
|
|
22
|
+
};
|
|
23
|
+
type Reaction = (typeof Reaction)[keyof typeof Reaction];
|
|
11
24
|
}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SendReactionRequest = void 0;
|
|
5
|
+
var SendReactionRequest;
|
|
6
|
+
(function (SendReactionRequest) {
|
|
7
|
+
/** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
|
|
8
|
+
SendReactionRequest.Reaction = {
|
|
9
|
+
Love: "love",
|
|
10
|
+
Like: "like",
|
|
11
|
+
Dislike: "dislike",
|
|
12
|
+
Laugh: "laugh",
|
|
13
|
+
Emphasize: "emphasize",
|
|
14
|
+
Question: "question",
|
|
15
|
+
};
|
|
16
|
+
})(SendReactionRequest || (exports.SendReactionRequest = SendReactionRequest = {}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { SendMessageRequest } from "./SendMessageRequest.js";
|
|
2
|
+
export { SendReactionRequest } from "./SendReactionRequest.js";
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SendReactionRequest = exports.SendMessageRequest = void 0;
|
|
4
|
+
var SendMessageRequest_js_1 = require("./SendMessageRequest.js");
|
|
5
|
+
Object.defineProperty(exports, "SendMessageRequest", { enumerable: true, get: function () { return SendMessageRequest_js_1.SendMessageRequest; } });
|
|
6
|
+
var SendReactionRequest_js_1 = require("./SendReactionRequest.js");
|
|
7
|
+
Object.defineProperty(exports, "SendReactionRequest", { enumerable: true, get: function () { return SendReactionRequest_js_1.SendReactionRequest; } });
|
|
@@ -27,10 +27,10 @@ export declare class NumbersClient {
|
|
|
27
27
|
* Provision a new SMS-enabled phone number.
|
|
28
28
|
*
|
|
29
29
|
* 1. Check number limit (lifetime limit)
|
|
30
|
-
* 2. Search
|
|
30
|
+
* 2. Search the account's configured SMS provider for available numbers
|
|
31
31
|
* 3. Purchase the first available one
|
|
32
|
-
* 4. Configure
|
|
33
|
-
* 5. Store in our database
|
|
32
|
+
* 4. Configure messaging and voice routing
|
|
33
|
+
* 5. Store the number in our database
|
|
34
34
|
*
|
|
35
35
|
* @param {AgentPhone.CreateNumberRequest} request
|
|
36
36
|
* @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -63,7 +63,7 @@ export declare class NumbersClient {
|
|
|
63
63
|
* Release (delete) a phone number.
|
|
64
64
|
*
|
|
65
65
|
* This will:
|
|
66
|
-
* 1. Release the number from
|
|
66
|
+
* 1. Release the number from its upstream provider when supported
|
|
67
67
|
* 2. Mark the number as "released" in the database
|
|
68
68
|
* 3. Keep all messages and conversation history (for audit purposes)
|
|
69
69
|
*
|
|
@@ -112,10 +112,10 @@ class NumbersClient {
|
|
|
112
112
|
* Provision a new SMS-enabled phone number.
|
|
113
113
|
*
|
|
114
114
|
* 1. Check number limit (lifetime limit)
|
|
115
|
-
* 2. Search
|
|
115
|
+
* 2. Search the account's configured SMS provider for available numbers
|
|
116
116
|
* 3. Purchase the first available one
|
|
117
|
-
* 4. Configure
|
|
118
|
-
* 5. Store in our database
|
|
117
|
+
* 4. Configure messaging and voice routing
|
|
118
|
+
* 5. Store the number in our database
|
|
119
119
|
*
|
|
120
120
|
* @param {AgentPhone.CreateNumberRequest} request
|
|
121
121
|
* @param {NumbersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -227,7 +227,7 @@ class NumbersClient {
|
|
|
227
227
|
* Release (delete) a phone number.
|
|
228
228
|
*
|
|
229
229
|
* This will:
|
|
230
|
-
* 1. Release the number from
|
|
230
|
+
* 1. Release the number from its upstream provider when supported
|
|
231
231
|
* 2. Mark the number as "released" in the database
|
|
232
232
|
* 3. Keep all messages and conversation history (for audit purposes)
|
|
233
233
|
*
|
|
@@ -11,6 +11,7 @@ export * from "./AppRoutesConversationsConversationSummary.js";
|
|
|
11
11
|
export * from "./AttachNumberResponse.js";
|
|
12
12
|
export * from "./CallListResponse.js";
|
|
13
13
|
export * from "./CallSummary.js";
|
|
14
|
+
export * from "./ContactCardResponse.js";
|
|
14
15
|
export * from "./ContactListResponse.js";
|
|
15
16
|
export * from "./ContactResponse.js";
|
|
16
17
|
export * from "./ConversationDetail.js";
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./AppRoutesConversationsConversationSummary.js"), exports)
|
|
|
27
27
|
__exportStar(require("./AttachNumberResponse.js"), exports);
|
|
28
28
|
__exportStar(require("./CallListResponse.js"), exports);
|
|
29
29
|
__exportStar(require("./CallSummary.js"), exports);
|
|
30
|
+
__exportStar(require("./ContactCardResponse.js"), exports);
|
|
30
31
|
__exportStar(require("./ContactListResponse.js"), exports);
|
|
31
32
|
__exportStar(require("./ContactResponse.js"), exports);
|
|
32
33
|
__exportStar(require("./ConversationDetail.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.10";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentphone",
|
|
9
|
-
"X-Fern-SDK-Version": "1.0.
|
|
10
|
-
"User-Agent": "agentphone/1.0.
|
|
9
|
+
"X-Fern-SDK-Version": "1.0.10",
|
|
10
|
+
"User-Agent": "agentphone/1.0.10",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs
|
|
|
2
2
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
3
3
|
import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
|
|
4
4
|
import { CallsClient } from "./api/resources/calls/client/Client.mjs";
|
|
5
|
+
import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
|
|
5
6
|
import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
|
|
6
7
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
7
8
|
import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
|
|
@@ -27,6 +28,7 @@ export declare class AgentPhoneClient {
|
|
|
27
28
|
protected _calls: CallsClient | undefined;
|
|
28
29
|
protected _usage: UsageClient | undefined;
|
|
29
30
|
protected _messages: MessagesClient | undefined;
|
|
31
|
+
protected _contactCards: ContactCardsClient | undefined;
|
|
30
32
|
constructor(options?: AgentPhoneClient.Options);
|
|
31
33
|
get agentSignup(): AgentSignupClient;
|
|
32
34
|
get agents(): AgentsClient;
|
|
@@ -38,4 +40,5 @@ export declare class AgentPhoneClient {
|
|
|
38
40
|
get calls(): CallsClient;
|
|
39
41
|
get usage(): UsageClient;
|
|
40
42
|
get messages(): MessagesClient;
|
|
43
|
+
get contactCards(): ContactCardsClient;
|
|
41
44
|
}
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { AgentSignupClient } from "./api/resources/agentSignup/client/Client.mjs
|
|
|
3
3
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
4
4
|
import { AgentWebhooksClient } from "./api/resources/agentWebhooks/client/Client.mjs";
|
|
5
5
|
import { CallsClient } from "./api/resources/calls/client/Client.mjs";
|
|
6
|
+
import { ContactCardsClient } from "./api/resources/contactCards/client/Client.mjs";
|
|
6
7
|
import { ContactsClient } from "./api/resources/contacts/client/Client.mjs";
|
|
7
8
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
8
9
|
import { MessagesClient } from "./api/resources/messages/client/Client.mjs";
|
|
@@ -54,4 +55,8 @@ export class AgentPhoneClient {
|
|
|
54
55
|
var _a;
|
|
55
56
|
return ((_a = this._messages) !== null && _a !== void 0 ? _a : (this._messages = new MessagesClient(this._options)));
|
|
56
57
|
}
|
|
58
|
+
get contactCards() {
|
|
59
|
+
var _a;
|
|
60
|
+
return ((_a = this._contactCards) !== null && _a !== void 0 ? _a : (this._contactCards = new ContactCardsClient(this._options)));
|
|
61
|
+
}
|
|
57
62
|
}
|
|
@@ -31,7 +31,7 @@ export declare class AgentSignupClient {
|
|
|
31
31
|
/**
|
|
32
32
|
* Verify the OTP and atomically provision everything.
|
|
33
33
|
*
|
|
34
|
-
* Creates: User + Project (+ mirrored Account) + starter hosted Agent +
|
|
34
|
+
* Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
|
|
35
35
|
* + first-month charge + API key. Returns the key once — agents must save it.
|
|
36
36
|
*
|
|
37
37
|
* @param {AgentPhone.AgentVerifyRequest} request
|
|
@@ -77,7 +77,7 @@ export class AgentSignupClient {
|
|
|
77
77
|
/**
|
|
78
78
|
* Verify the OTP and atomically provision everything.
|
|
79
79
|
*
|
|
80
|
-
* Creates: User + Project (+ mirrored Account) + starter hosted Agent +
|
|
80
|
+
* Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
|
|
81
81
|
* + first-month charge + API key. Returns the key once — agents must save it.
|
|
82
82
|
*
|
|
83
83
|
* @param {AgentPhone.AgentVerifyRequest} request
|
|
@@ -11,7 +11,7 @@ export declare class AgentsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<AgentsClient.Options>;
|
|
12
12
|
constructor(options?: AgentsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Return available voices
|
|
14
|
+
* Return available voices from the call provider (Retell).
|
|
15
15
|
*
|
|
16
16
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
17
|
*
|
|
@@ -31,7 +31,7 @@ export class AgentsClient {
|
|
|
31
31
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Return available voices
|
|
34
|
+
* Return available voices from the call provider (Retell).
|
|
35
35
|
*
|
|
36
36
|
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
37
|
*
|
|
@@ -8,6 +8,8 @@ export interface CreateAgentRequest {
|
|
|
8
8
|
name: string;
|
|
9
9
|
description?: string | null;
|
|
10
10
|
voiceMode?: CreateAgentRequest.VoiceMode;
|
|
11
|
+
/** When true, hosted-mode agents can send and read SMS/iMessage during calls. Defaults to true. */
|
|
12
|
+
enableMessaging?: boolean | null;
|
|
11
13
|
modelTier?: CreateAgentRequest.ModelTier;
|
|
12
14
|
systemPrompt?: string | null;
|
|
13
15
|
beginMessage?: string | null;
|
|
@@ -9,6 +9,8 @@ export interface UpdateAgentRequest {
|
|
|
9
9
|
name?: string | null;
|
|
10
10
|
description?: string | null;
|
|
11
11
|
voiceMode?: UpdateAgentRequest.VoiceMode;
|
|
12
|
+
/** When true, hosted-mode agents can send and read SMS/iMessage during calls. */
|
|
13
|
+
enableMessaging?: boolean | null;
|
|
12
14
|
modelTier?: UpdateAgentRequest.ModelTier;
|
|
13
15
|
systemPrompt?: string | null;
|
|
14
16
|
beginMessage?: string | null;
|
|
@@ -90,6 +90,26 @@ export declare class CallsClient {
|
|
|
90
90
|
*/
|
|
91
91
|
getCall(request: AgentPhone.GetCallV1CallsCallIdGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
92
92
|
private __getCall;
|
|
93
|
+
/**
|
|
94
|
+
* Terminate an ongoing call.
|
|
95
|
+
*
|
|
96
|
+
* Works for both hosted-mode and webhook-mode calls. The call_ended
|
|
97
|
+
* webhook from Retell updates status/endedAt asynchronously, so this
|
|
98
|
+
* endpoint returns the current call as soon as the stop request is
|
|
99
|
+
* accepted by Retell.
|
|
100
|
+
*
|
|
101
|
+
* @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
|
|
102
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
103
|
+
*
|
|
104
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* await client.calls.endCall({
|
|
108
|
+
* call_id: "call_id"
|
|
109
|
+
* })
|
|
110
|
+
*/
|
|
111
|
+
endCall(request: AgentPhone.EndCallV1CallsCallIdEndPostRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
112
|
+
private __endCall;
|
|
93
113
|
/**
|
|
94
114
|
* Returns the audio file (WAV format) for a completed call.
|
|
95
115
|
*
|
|
@@ -255,6 +255,62 @@ export class CallsClient {
|
|
|
255
255
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}");
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
+
/**
|
|
259
|
+
* Terminate an ongoing call.
|
|
260
|
+
*
|
|
261
|
+
* Works for both hosted-mode and webhook-mode calls. The call_ended
|
|
262
|
+
* webhook from Retell updates status/endedAt asynchronously, so this
|
|
263
|
+
* endpoint returns the current call as soon as the stop request is
|
|
264
|
+
* accepted by Retell.
|
|
265
|
+
*
|
|
266
|
+
* @param {AgentPhone.EndCallV1CallsCallIdEndPostRequest} request
|
|
267
|
+
* @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
268
|
+
*
|
|
269
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* await client.calls.endCall({
|
|
273
|
+
* call_id: "call_id"
|
|
274
|
+
* })
|
|
275
|
+
*/
|
|
276
|
+
endCall(request, requestOptions) {
|
|
277
|
+
return core.HttpResponsePromise.fromPromise(this.__endCall(request, requestOptions));
|
|
278
|
+
}
|
|
279
|
+
__endCall(request, requestOptions) {
|
|
280
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
282
|
+
const { call_id: callId } = request;
|
|
283
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
284
|
+
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);
|
|
285
|
+
const _response = yield core.fetcher({
|
|
286
|
+
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/${core.url.encodePathParam(callId)}/end`),
|
|
287
|
+
method: "POST",
|
|
288
|
+
headers: _headers,
|
|
289
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
290
|
+
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,
|
|
291
|
+
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,
|
|
292
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
293
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
294
|
+
logging: this._options.logging,
|
|
295
|
+
});
|
|
296
|
+
if (_response.ok) {
|
|
297
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
298
|
+
}
|
|
299
|
+
if (_response.error.reason === "status-code") {
|
|
300
|
+
switch (_response.error.statusCode) {
|
|
301
|
+
case 422:
|
|
302
|
+
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
303
|
+
default:
|
|
304
|
+
throw new errors.AgentPhoneError({
|
|
305
|
+
statusCode: _response.error.statusCode,
|
|
306
|
+
body: _response.error.body,
|
|
307
|
+
rawResponse: _response.rawResponse,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/calls/{call_id}/end");
|
|
312
|
+
});
|
|
313
|
+
}
|
|
258
314
|
/**
|
|
259
315
|
* Returns the audio file (WAV format) for a completed call.
|
|
260
316
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { CreateOutboundCallRequest } from "./CreateOutboundCallRequest.mjs";
|
|
2
2
|
export type { CreateWebCallRequest } from "./CreateWebCallRequest.mjs";
|
|
3
|
+
export type { EndCallV1CallsCallIdEndPostRequest } from "./EndCallV1CallsCallIdEndPostRequest.mjs";
|
|
3
4
|
export type { GetCallRecordingV1CallsCallIdRecordingGetRequest } from "./GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs";
|
|
4
5
|
export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCallTranscriptV1CallsCallIdTranscriptGetRequest.mjs";
|
|
5
6
|
export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.mjs";
|