agentphone 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/conversations/client/Client.d.ts +8 -6
  3. package/dist/cjs/api/resources/conversations/client/Client.js +8 -6
  4. package/dist/cjs/api/resources/conversations/client/requests/UpdateConversationRequest.d.ts +2 -0
  5. package/dist/cjs/api/resources/messages/client/Client.d.ts +0 -1
  6. package/dist/cjs/api/resources/messages/client/Client.js +0 -1
  7. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +4 -2
  8. package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
  9. package/dist/cjs/api/types/ReplyToInConversation.d.ts +5 -0
  10. package/dist/cjs/api/types/ReplyToInConversation.js +3 -0
  11. package/dist/cjs/api/types/SendMessageResponse.d.ts +1 -0
  12. package/dist/cjs/api/types/index.d.ts +1 -0
  13. package/dist/cjs/api/types/index.js +1 -0
  14. package/dist/cjs/version.d.ts +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/esm/BaseClient.mjs +2 -2
  17. package/dist/esm/api/resources/conversations/client/Client.d.mts +8 -6
  18. package/dist/esm/api/resources/conversations/client/Client.mjs +8 -6
  19. package/dist/esm/api/resources/conversations/client/requests/UpdateConversationRequest.d.mts +2 -0
  20. package/dist/esm/api/resources/messages/client/Client.d.mts +0 -1
  21. package/dist/esm/api/resources/messages/client/Client.mjs +0 -1
  22. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +4 -2
  23. package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
  24. package/dist/esm/api/types/ReplyToInConversation.d.mts +5 -0
  25. package/dist/esm/api/types/ReplyToInConversation.mjs +2 -0
  26. package/dist/esm/api/types/SendMessageResponse.d.mts +1 -0
  27. package/dist/esm/api/types/index.d.mts +1 -0
  28. package/dist/esm/api/types/index.mjs +1 -0
  29. package/dist/esm/version.d.mts +1 -1
  30. package/dist/esm/version.mjs +1 -1
  31. package/package.json +1 -1
  32. package/reference.md +8 -7
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "agentphone",
46
- "X-Fern-SDK-Version": "1.0.14",
47
- "User-Agent": "agentphone/1.0.14",
46
+ "X-Fern-SDK-Version": "1.0.15",
47
+ "User-Agent": "agentphone/1.0.15",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -42,14 +42,16 @@ export declare class ConversationsClient {
42
42
  getConversation(request: AgentPhone.GetConversationV1ConversationsConversationIdGetRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ConversationDetail>;
43
43
  private __getConversation;
44
44
  /**
45
- * Update conversation metadata (state).
45
+ * Update a conversation.
46
46
  *
47
- * Use this to store custom context for AI agents:
48
- * - Customer information (name, account ID)
49
- * - Business context (order ID, ticket number)
50
- * - Session state (current topic, preferences)
47
+ * - `metadata`: store custom context for AI agents (customer info, order/ticket
48
+ * ids, session state). Replaces the stored object; surfaced in webhook
49
+ * payloads as `conversationState`.
50
+ * - `group_name`: rename a group conversation (iMessage groups only). Also
51
+ * renames the underlying iMessage thread.
51
52
  *
52
- * The metadata is included in webhook payloads as `conversationState`.
53
+ * Only the fields you include are changed: a rename-only PATCH leaves metadata
54
+ * untouched, and vice versa.
53
55
  *
54
56
  * @param {AgentPhone.UpdateConversationRequest} request
55
57
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -179,14 +179,16 @@ class ConversationsClient {
179
179
  });
180
180
  }
181
181
  /**
182
- * Update conversation metadata (state).
182
+ * Update a conversation.
183
183
  *
184
- * Use this to store custom context for AI agents:
185
- * - Customer information (name, account ID)
186
- * - Business context (order ID, ticket number)
187
- * - Session state (current topic, preferences)
184
+ * - `metadata`: store custom context for AI agents (customer info, order/ticket
185
+ * ids, session state). Replaces the stored object; surfaced in webhook
186
+ * payloads as `conversationState`.
187
+ * - `group_name`: rename a group conversation (iMessage groups only). Also
188
+ * renames the underlying iMessage thread.
188
189
  *
189
- * The metadata is included in webhook payloads as `conversationState`.
190
+ * Only the fields you include are changed: a rename-only PATCH leaves metadata
191
+ * untouched, and vice versa.
190
192
  *
191
193
  * @param {AgentPhone.UpdateConversationRequest} request
192
194
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -7,4 +7,6 @@
7
7
  export interface UpdateConversationRequest {
8
8
  conversation_id: string;
9
9
  metadata?: Record<string, unknown> | null;
10
+ /** New display name for a group conversation. iMessage groups only; also renames the underlying iMessage thread. Ignored (omit) for 1:1 chats. */
11
+ group_name?: string | null;
10
12
  }
@@ -36,7 +36,6 @@ export declare class MessagesClient {
36
36
  *
37
37
  * @example
38
38
  * await client.messages.sendMessage({
39
- * to_number: "to_number",
40
39
  * body: "body"
41
40
  * })
42
41
  */
@@ -92,7 +92,6 @@ class MessagesClient {
92
92
  *
93
93
  * @example
94
94
  * await client.messages.sendMessage({
95
- * to_number: "to_number",
96
95
  * body: "body"
97
96
  * })
98
97
  */
@@ -1,13 +1,15 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * to_number: "to_number",
5
4
  * body: "body"
6
5
  * }
7
6
  */
8
7
  export interface SendMessageRequest {
9
8
  agent_id?: string | null;
10
- to_number: string;
9
+ /** Recipient of an existing chat: a phone (any format, normalized to E.164), US short code, email, or a group id (grp_...). Provide this OR `recipients` (to start a new group), not both. */
10
+ to_number?: string | null;
11
+ /** Start a NEW iMessage group by listing 2 or more recipients (phones or emails). The first message is delivered to all of them, an iMessage group is created, and the response `to_number` returns the new group id (grp_...) to use for follow-up sends. iMessage numbers only. */
12
+ recipients?: string[] | null;
11
13
  body: string;
12
14
  media_url?: string | null;
13
15
  media_urls?: string[] | null;
@@ -11,4 +11,5 @@ export interface MessageInConversation {
11
11
  mediaUrls?: string[];
12
12
  receivedAt: string;
13
13
  reactions?: AgentPhone.ReactionInConversation[];
14
+ replyTo?: AgentPhone.ReplyToInConversation | null;
14
15
  }
@@ -0,0 +1,5 @@
1
+ export interface ReplyToInConversation {
2
+ messageId: string;
3
+ message: string;
4
+ mediaUrls?: string[];
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,6 +4,7 @@ export interface SendMessageResponse {
4
4
  channel: string;
5
5
  from_number: string;
6
6
  to_number: string;
7
+ conversation_id?: string | null;
7
8
  media_urls?: string[];
8
9
  reply_to_message_id?: string | null;
9
10
  reply_parent_unresolved?: boolean | null;
@@ -41,6 +41,7 @@ export * from "./PlanInfo.js";
41
41
  export * from "./PlanLimits.js";
42
42
  export * from "./ReactionInConversation.js";
43
43
  export * from "./RegistrationResponse.js";
44
+ export * from "./ReplyToInConversation.js";
44
45
  export * from "./SendMessageResponse.js";
45
46
  export * from "./SendReactionResponse.js";
46
47
  export * from "./SendTypingResponse.js";
@@ -57,6 +57,7 @@ __exportStar(require("./PlanInfo.js"), exports);
57
57
  __exportStar(require("./PlanLimits.js"), exports);
58
58
  __exportStar(require("./ReactionInConversation.js"), exports);
59
59
  __exportStar(require("./RegistrationResponse.js"), exports);
60
+ __exportStar(require("./ReplyToInConversation.js"), exports);
60
61
  __exportStar(require("./SendMessageResponse.js"), exports);
61
62
  __exportStar(require("./SendReactionResponse.js"), exports);
62
63
  __exportStar(require("./SendTypingResponse.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.14";
1
+ export declare const SDK_VERSION = "1.0.15";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.0.14";
4
+ exports.SDK_VERSION = "1.0.15";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "agentphone",
9
- "X-Fern-SDK-Version": "1.0.14",
10
- "User-Agent": "agentphone/1.0.14",
9
+ "X-Fern-SDK-Version": "1.0.15",
10
+ "User-Agent": "agentphone/1.0.15",
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);
@@ -42,14 +42,16 @@ export declare class ConversationsClient {
42
42
  getConversation(request: AgentPhone.GetConversationV1ConversationsConversationIdGetRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.ConversationDetail>;
43
43
  private __getConversation;
44
44
  /**
45
- * Update conversation metadata (state).
45
+ * Update a conversation.
46
46
  *
47
- * Use this to store custom context for AI agents:
48
- * - Customer information (name, account ID)
49
- * - Business context (order ID, ticket number)
50
- * - Session state (current topic, preferences)
47
+ * - `metadata`: store custom context for AI agents (customer info, order/ticket
48
+ * ids, session state). Replaces the stored object; surfaced in webhook
49
+ * payloads as `conversationState`.
50
+ * - `group_name`: rename a group conversation (iMessage groups only). Also
51
+ * renames the underlying iMessage thread.
51
52
  *
52
- * The metadata is included in webhook payloads as `conversationState`.
53
+ * Only the fields you include are changed: a rename-only PATCH leaves metadata
54
+ * untouched, and vice versa.
53
55
  *
54
56
  * @param {AgentPhone.UpdateConversationRequest} request
55
57
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -143,14 +143,16 @@ export class ConversationsClient {
143
143
  });
144
144
  }
145
145
  /**
146
- * Update conversation metadata (state).
146
+ * Update a conversation.
147
147
  *
148
- * Use this to store custom context for AI agents:
149
- * - Customer information (name, account ID)
150
- * - Business context (order ID, ticket number)
151
- * - Session state (current topic, preferences)
148
+ * - `metadata`: store custom context for AI agents (customer info, order/ticket
149
+ * ids, session state). Replaces the stored object; surfaced in webhook
150
+ * payloads as `conversationState`.
151
+ * - `group_name`: rename a group conversation (iMessage groups only). Also
152
+ * renames the underlying iMessage thread.
152
153
  *
153
- * The metadata is included in webhook payloads as `conversationState`.
154
+ * Only the fields you include are changed: a rename-only PATCH leaves metadata
155
+ * untouched, and vice versa.
154
156
  *
155
157
  * @param {AgentPhone.UpdateConversationRequest} request
156
158
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -7,4 +7,6 @@
7
7
  export interface UpdateConversationRequest {
8
8
  conversation_id: string;
9
9
  metadata?: Record<string, unknown> | null;
10
+ /** New display name for a group conversation. iMessage groups only; also renames the underlying iMessage thread. Ignored (omit) for 1:1 chats. */
11
+ group_name?: string | null;
10
12
  }
@@ -36,7 +36,6 @@ export declare class MessagesClient {
36
36
  *
37
37
  * @example
38
38
  * await client.messages.sendMessage({
39
- * to_number: "to_number",
40
39
  * body: "body"
41
40
  * })
42
41
  */
@@ -56,7 +56,6 @@ export class MessagesClient {
56
56
  *
57
57
  * @example
58
58
  * await client.messages.sendMessage({
59
- * to_number: "to_number",
60
59
  * body: "body"
61
60
  * })
62
61
  */
@@ -1,13 +1,15 @@
1
1
  /**
2
2
  * @example
3
3
  * {
4
- * to_number: "to_number",
5
4
  * body: "body"
6
5
  * }
7
6
  */
8
7
  export interface SendMessageRequest {
9
8
  agent_id?: string | null;
10
- to_number: string;
9
+ /** Recipient of an existing chat: a phone (any format, normalized to E.164), US short code, email, or a group id (grp_...). Provide this OR `recipients` (to start a new group), not both. */
10
+ to_number?: string | null;
11
+ /** Start a NEW iMessage group by listing 2 or more recipients (phones or emails). The first message is delivered to all of them, an iMessage group is created, and the response `to_number` returns the new group id (grp_...) to use for follow-up sends. iMessage numbers only. */
12
+ recipients?: string[] | null;
11
13
  body: string;
12
14
  media_url?: string | null;
13
15
  media_urls?: string[] | null;
@@ -11,4 +11,5 @@ export interface MessageInConversation {
11
11
  mediaUrls?: string[];
12
12
  receivedAt: string;
13
13
  reactions?: AgentPhone.ReactionInConversation[];
14
+ replyTo?: AgentPhone.ReplyToInConversation | null;
14
15
  }
@@ -0,0 +1,5 @@
1
+ export interface ReplyToInConversation {
2
+ messageId: string;
3
+ message: string;
4
+ mediaUrls?: string[];
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -4,6 +4,7 @@ export interface SendMessageResponse {
4
4
  channel: string;
5
5
  from_number: string;
6
6
  to_number: string;
7
+ conversation_id?: string | null;
7
8
  media_urls?: string[];
8
9
  reply_to_message_id?: string | null;
9
10
  reply_parent_unresolved?: boolean | null;
@@ -41,6 +41,7 @@ export * from "./PlanInfo.mjs";
41
41
  export * from "./PlanLimits.mjs";
42
42
  export * from "./ReactionInConversation.mjs";
43
43
  export * from "./RegistrationResponse.mjs";
44
+ export * from "./ReplyToInConversation.mjs";
44
45
  export * from "./SendMessageResponse.mjs";
45
46
  export * from "./SendReactionResponse.mjs";
46
47
  export * from "./SendTypingResponse.mjs";
@@ -41,6 +41,7 @@ export * from "./PlanInfo.mjs";
41
41
  export * from "./PlanLimits.mjs";
42
42
  export * from "./ReactionInConversation.mjs";
43
43
  export * from "./RegistrationResponse.mjs";
44
+ export * from "./ReplyToInConversation.mjs";
44
45
  export * from "./SendMessageResponse.mjs";
45
46
  export * from "./SendReactionResponse.mjs";
46
47
  export * from "./SendTypingResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.14";
1
+ export declare const SDK_VERSION = "1.0.15";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.0.14";
1
+ export const SDK_VERSION = "1.0.15";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentphone",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -2247,14 +2247,16 @@ await client.conversations.getConversation({
2247
2247
  <dl>
2248
2248
  <dd>
2249
2249
 
2250
- Update conversation metadata (state).
2250
+ Update a conversation.
2251
2251
 
2252
- Use this to store custom context for AI agents:
2253
- - Customer information (name, account ID)
2254
- - Business context (order ID, ticket number)
2255
- - Session state (current topic, preferences)
2252
+ - `metadata`: store custom context for AI agents (customer info, order/ticket
2253
+ ids, session state). Replaces the stored object; surfaced in webhook
2254
+ payloads as `conversationState`.
2255
+ - `group_name`: rename a group conversation (iMessage groups only). Also
2256
+ renames the underlying iMessage thread.
2256
2257
 
2257
- The metadata is included in webhook payloads as `conversationState`.
2258
+ Only the fields you include are changed: a rename-only PATCH leaves metadata
2259
+ untouched, and vice versa.
2258
2260
  </dd>
2259
2261
  </dl>
2260
2262
  </dd>
@@ -3575,7 +3577,6 @@ To send a carousel of images on iMessage, pass 2-20 URLs in `media_urls`. Requir
3575
3577
 
3576
3578
  ```typescript
3577
3579
  await client.messages.sendMessage({
3578
- to_number: "to_number",
3579
3580
  body: "body"
3580
3581
  });
3581
3582