agentphone 1.0.10 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +10 -10
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +3 -3
  4. package/dist/cjs/Client.js +21 -21
  5. package/dist/cjs/api/resources/agents/client/Client.d.ts +1 -1
  6. package/dist/cjs/api/resources/agents/client/Client.js +1 -1
  7. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +75 -0
  8. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +66 -0
  9. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +75 -0
  10. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +66 -0
  11. package/dist/cjs/api/resources/calls/client/Client.d.ts +4 -4
  12. package/dist/cjs/api/resources/calls/client/Client.js +4 -4
  13. package/dist/cjs/api/resources/conversations/client/Client.d.ts +39 -1
  14. package/dist/cjs/api/resources/conversations/client/Client.js +114 -1
  15. package/dist/cjs/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.ts +9 -0
  16. package/dist/cjs/api/resources/conversations/client/requests/SetBackgroundRequest.d.ts +12 -0
  17. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +2 -0
  18. package/dist/cjs/api/resources/index.d.ts +2 -2
  19. package/dist/cjs/api/resources/index.js +3 -3
  20. package/dist/cjs/api/resources/messages/client/requests/SendMessageRequest.d.ts +2 -0
  21. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.d.ts +2 -14
  22. package/dist/cjs/api/resources/messages/client/requests/SendReactionRequest.js +0 -13
  23. package/dist/cjs/api/resources/messages/client/requests/index.d.ts +1 -1
  24. package/dist/cjs/api/resources/messages/client/requests/index.js +1 -3
  25. package/dist/cjs/api/resources/registration/client/Client.d.ts +61 -0
  26. package/dist/cjs/api/resources/{agentSignup → registration}/client/Client.js +44 -69
  27. package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.d.ts +61 -0
  28. package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.js +3 -0
  29. package/dist/cjs/api/resources/registration/client/requests/index.d.ts +1 -0
  30. package/dist/cjs/api/types/AgentResponse.d.ts +8 -0
  31. package/dist/cjs/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.ts +0 -6
  32. package/dist/cjs/api/types/AgentSignUpRequest.js +3 -0
  33. package/dist/cjs/api/types/AgentVerifyRequest.d.ts +4 -0
  34. package/dist/cjs/api/types/AgentVerifyRequest.js +3 -0
  35. package/dist/cjs/api/types/FieldWarning.d.ts +6 -0
  36. package/dist/cjs/api/types/FieldWarning.js +3 -0
  37. package/dist/cjs/api/types/RegistrationResponse.d.ts +8 -0
  38. package/dist/cjs/api/types/RegistrationResponse.js +3 -0
  39. package/dist/cjs/api/types/SendMessageResponse.d.ts +2 -0
  40. package/dist/cjs/api/types/SetBackgroundResponse.d.ts +8 -0
  41. package/dist/cjs/api/types/SetBackgroundResponse.js +3 -0
  42. package/dist/cjs/api/types/index.d.ts +5 -0
  43. package/dist/cjs/api/types/index.js +5 -0
  44. package/dist/cjs/version.d.ts +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/esm/BaseClient.mjs +2 -2
  47. package/dist/esm/Client.d.mts +3 -3
  48. package/dist/esm/Client.mjs +5 -5
  49. package/dist/esm/api/resources/agents/client/Client.d.mts +1 -1
  50. package/dist/esm/api/resources/agents/client/Client.mjs +1 -1
  51. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +75 -0
  52. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +66 -0
  53. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +75 -0
  54. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +66 -0
  55. package/dist/esm/api/resources/calls/client/Client.d.mts +4 -4
  56. package/dist/esm/api/resources/calls/client/Client.mjs +4 -4
  57. package/dist/esm/api/resources/conversations/client/Client.d.mts +39 -1
  58. package/dist/esm/api/resources/conversations/client/Client.mjs +114 -1
  59. package/dist/esm/api/resources/conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.d.mts +9 -0
  60. package/dist/esm/api/resources/conversations/client/requests/SetBackgroundRequest.d.mts +12 -0
  61. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +2 -0
  62. package/dist/esm/api/resources/index.d.mts +2 -2
  63. package/dist/esm/api/resources/index.mjs +2 -2
  64. package/dist/esm/api/resources/messages/client/requests/SendMessageRequest.d.mts +2 -0
  65. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.d.mts +2 -14
  66. package/dist/esm/api/resources/messages/client/requests/SendReactionRequest.mjs +1 -12
  67. package/dist/esm/api/resources/messages/client/requests/index.d.mts +1 -1
  68. package/dist/esm/api/resources/messages/client/requests/index.mjs +0 -1
  69. package/dist/esm/api/resources/registration/client/Client.d.mts +61 -0
  70. package/dist/esm/api/resources/registration/client/Client.mjs +108 -0
  71. package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.d.mts +61 -0
  72. package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.mjs +2 -0
  73. package/dist/esm/api/resources/registration/client/requests/index.d.mts +1 -0
  74. package/dist/esm/api/types/AgentResponse.d.mts +8 -0
  75. package/dist/esm/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.mts +0 -6
  76. package/dist/esm/api/types/AgentSignUpRequest.mjs +2 -0
  77. package/dist/esm/api/types/AgentVerifyRequest.d.mts +4 -0
  78. package/dist/esm/api/types/AgentVerifyRequest.mjs +2 -0
  79. package/dist/esm/api/types/FieldWarning.d.mts +6 -0
  80. package/dist/esm/api/types/FieldWarning.mjs +2 -0
  81. package/dist/esm/api/types/RegistrationResponse.d.mts +8 -0
  82. package/dist/esm/api/types/RegistrationResponse.mjs +2 -0
  83. package/dist/esm/api/types/SendMessageResponse.d.mts +2 -0
  84. package/dist/esm/api/types/SetBackgroundResponse.d.mts +8 -0
  85. package/dist/esm/api/types/SetBackgroundResponse.mjs +2 -0
  86. package/dist/esm/api/types/index.d.mts +5 -0
  87. package/dist/esm/api/types/index.mjs +5 -0
  88. package/dist/esm/version.d.mts +1 -1
  89. package/dist/esm/version.mjs +1 -1
  90. package/package.json +1 -1
  91. package/reference.md +243 -144
  92. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +0 -50
  93. package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +0 -11
  94. package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +0 -2
  95. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +0 -50
  96. package/dist/esm/api/resources/agentSignup/client/Client.mjs +0 -133
  97. package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +0 -11
  98. package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +0 -2
  99. /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentSignUpRequest.js → conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.js} +0 -0
  100. /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentVerifyRequest.js → conversations/client/requests/SetBackgroundRequest.js} +0 -0
  101. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.d.ts +0 -0
  102. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.js +0 -0
  103. /package/dist/cjs/api/resources/{agentSignup → registration}/client/requests/index.js +0 -0
  104. /package/dist/cjs/api/resources/{agentSignup → registration}/index.d.ts +0 -0
  105. /package/dist/cjs/api/resources/{agentSignup → registration}/index.js +0 -0
  106. /package/dist/esm/api/resources/{agentSignup/client/requests/AgentSignUpRequest.mjs → conversations/client/requests/RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.mjs} +0 -0
  107. /package/dist/esm/api/resources/{agentSignup/client/requests/AgentVerifyRequest.mjs → conversations/client/requests/SetBackgroundRequest.mjs} +0 -0
  108. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.d.mts +0 -0
  109. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.mjs +0 -0
  110. /package/dist/esm/api/resources/{agentSignup → registration}/client/requests/index.mjs +0 -0
  111. /package/dist/esm/api/resources/{agentSignup → registration}/index.d.mts +0 -0
  112. /package/dist/esm/api/resources/{agentSignup → registration}/index.mjs +0 -0
@@ -34,7 +34,7 @@ export class ConversationsClient {
34
34
  * List all conversations for this account.
35
35
  *
36
36
  * Sorted by most recent activity (lastMessageAt desc).
37
- * Also includes conversations on shared lines owned by this account.
37
+ * Sorted by most recent activity.
38
38
  *
39
39
  * @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
40
40
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -317,4 +317,117 @@ export class ConversationsClient {
317
317
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/typing");
318
318
  });
319
319
  }
320
+ /**
321
+ * Set a custom wallpaper for the chat (iMessage only).
322
+ *
323
+ * Customer sends `image_url`; we fetch (≤10MB, JPEG/PNG/GIF/WebP/HEIC),
324
+ * validate, and forward as multipart to the iMessage provider. Idempotent —
325
+ * re-setting replaces. Recipients on iOS < 18 fall back to the default
326
+ * silently.
327
+ *
328
+ * @param {AgentPhone.SetBackgroundRequest} request
329
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
330
+ *
331
+ * @throws {@link AgentPhone.UnprocessableEntityError}
332
+ *
333
+ * @example
334
+ * await client.conversations.setChatBackground({
335
+ * conversation_id: "conversation_id",
336
+ * image_url: "https://example.com/wallpaper.jpg"
337
+ * })
338
+ */
339
+ setChatBackground(request, requestOptions) {
340
+ return core.HttpResponsePromise.fromPromise(this.__setChatBackground(request, requestOptions));
341
+ }
342
+ __setChatBackground(request, requestOptions) {
343
+ return __awaiter(this, void 0, void 0, function* () {
344
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
345
+ const { conversation_id: conversationId } = request, _body = __rest(request, ["conversation_id"]);
346
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
347
+ 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);
348
+ const _response = yield core.fetcher({
349
+ 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/${core.url.encodePathParam(conversationId)}/background`),
350
+ method: "POST",
351
+ headers: _headers,
352
+ contentType: "application/json",
353
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
354
+ requestType: "json",
355
+ body: _body,
356
+ 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,
357
+ 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,
358
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
359
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
360
+ logging: this._options.logging,
361
+ });
362
+ if (_response.ok) {
363
+ return { data: _response.body, rawResponse: _response.rawResponse };
364
+ }
365
+ if (_response.error.reason === "status-code") {
366
+ switch (_response.error.statusCode) {
367
+ case 422:
368
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
369
+ default:
370
+ throw new errors.AgentPhoneError({
371
+ statusCode: _response.error.statusCode,
372
+ body: _response.error.body,
373
+ rawResponse: _response.rawResponse,
374
+ });
375
+ }
376
+ }
377
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/background");
378
+ });
379
+ }
380
+ /**
381
+ * Clear the custom wallpaper for the chat (iMessage only).
382
+ *
383
+ * Idempotent: deleting a default-background chat returns 204 (no-op).
384
+ *
385
+ * @param {AgentPhone.RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest} request
386
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
387
+ *
388
+ * @throws {@link AgentPhone.UnprocessableEntityError}
389
+ *
390
+ * @example
391
+ * await client.conversations.removeChatBackground({
392
+ * conversation_id: "conversation_id"
393
+ * })
394
+ */
395
+ removeChatBackground(request, requestOptions) {
396
+ return core.HttpResponsePromise.fromPromise(this.__removeChatBackground(request, requestOptions));
397
+ }
398
+ __removeChatBackground(request, requestOptions) {
399
+ return __awaiter(this, void 0, void 0, function* () {
400
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
401
+ const { conversation_id: conversationId } = request;
402
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
403
+ 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);
404
+ const _response = yield core.fetcher({
405
+ 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/${core.url.encodePathParam(conversationId)}/background`),
406
+ method: "DELETE",
407
+ headers: _headers,
408
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
409
+ 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,
410
+ 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,
411
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
412
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
413
+ logging: this._options.logging,
414
+ });
415
+ if (_response.ok) {
416
+ return { data: undefined, rawResponse: _response.rawResponse };
417
+ }
418
+ if (_response.error.reason === "status-code") {
419
+ switch (_response.error.statusCode) {
420
+ case 422:
421
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
422
+ default:
423
+ throw new errors.AgentPhoneError({
424
+ statusCode: _response.error.statusCode,
425
+ body: _response.error.body,
426
+ rawResponse: _response.rawResponse,
427
+ });
428
+ }
429
+ }
430
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/conversations/{conversation_id}/background");
431
+ });
432
+ }
320
433
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * conversation_id: "conversation_id"
5
+ * }
6
+ */
7
+ export interface RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest {
8
+ conversation_id: string;
9
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * conversation_id: "conversation_id",
5
+ * image_url: "https://example.com/wallpaper.jpg"
6
+ * }
7
+ */
8
+ export interface SetBackgroundRequest {
9
+ conversation_id: string;
10
+ /** HTTPS URL of the background image. JPEG/PNG/GIF/WebP/HEIC, max 10MB. Recipients on iOS < 18 see the default background; no error is raised. */
11
+ image_url: string;
12
+ }
@@ -1,5 +1,7 @@
1
1
  export type { GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest } from "./GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest.mjs";
2
2
  export type { GetConversationV1ConversationsConversationIdGetRequest } from "./GetConversationV1ConversationsConversationIdGetRequest.mjs";
3
3
  export type { ListConversationsV1ConversationsGetRequest } from "./ListConversationsV1ConversationsGetRequest.mjs";
4
+ export type { RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest } from "./RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.mjs";
4
5
  export type { SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest } from "./SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.mjs";
6
+ export type { SetBackgroundRequest } from "./SetBackgroundRequest.mjs";
5
7
  export type { UpdateConversationRequest } from "./UpdateConversationRequest.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";
@@ -16,6 +14,8 @@ export * from "./messages/client/requests/index.mjs";
16
14
  export * as messages from "./messages/index.mjs";
17
15
  export * from "./numbers/client/requests/index.mjs";
18
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
19
  export * from "./usage/client/requests/index.mjs";
20
20
  export * as usage from "./usage/index.mjs";
21
21
  export * from "./usage/types/index.mjs";
@@ -1,5 +1,3 @@
1
- export * from "./agentSignup/client/requests/index.mjs";
2
- export * as agentSignup from "./agentSignup/index.mjs";
3
1
  export * from "./agents/client/requests/index.mjs";
4
2
  export * as agents from "./agents/index.mjs";
5
3
  export * from "./agentWebhooks/client/requests/index.mjs";
@@ -16,6 +14,8 @@ export * from "./messages/client/requests/index.mjs";
16
14
  export * as messages from "./messages/index.mjs";
17
15
  export * from "./numbers/client/requests/index.mjs";
18
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
19
  export * from "./usage/client/requests/index.mjs";
20
20
  export * as usage from "./usage/index.mjs";
21
21
  export * from "./usage/types/index.mjs";
@@ -15,6 +15,8 @@ export interface SendMessageRequest {
15
15
  number_id?: string | null;
16
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
17
  send_style?: SendMessageRequest.SendStyle;
18
+ /** Optional parent message ID (AgentPhone Message.id) to send this message as an inline reply in iMessage. */
19
+ reply_to_message_id?: string | null;
18
20
  }
19
21
  export declare namespace SendMessageRequest {
20
22
  /** Optional iMessage expressive effect. Only valid on iMessage-capable numbers. Supported values: celebration, fireworks, lasers, love, confetti, balloons, spotlight, echo, invisible, gentle, loud, slam. */
@@ -7,18 +7,6 @@
7
7
  */
8
8
  export interface SendReactionRequest {
9
9
  message_id: string;
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];
10
+ /** iMessage reaction to send. Classic tapbacks (love, like, dislike, laugh, emphasize, question) are supported on every iMessage line. Custom emoji reactions (e.g. "🔥", "😂", "👍") are supported on newer lines only; lines that don't support them return a 400 with upgrade instructions. Custom emoji also require the recipient to be on macOS 14 / iOS 17 or later. */
11
+ reaction: string;
24
12
  }
@@ -1,13 +1,2 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export var SendReactionRequest;
3
- (function (SendReactionRequest) {
4
- /** iMessage tapback reaction to send. Supported values are: love, like, dislike, laugh, emphasize, question. */
5
- SendReactionRequest.Reaction = {
6
- Love: "love",
7
- Like: "like",
8
- Dislike: "dislike",
9
- Laugh: "laugh",
10
- Emphasize: "emphasize",
11
- Question: "question",
12
- };
13
- })(SendReactionRequest || (SendReactionRequest = {}));
2
+ export {};
@@ -1,2 +1,2 @@
1
1
  export { SendMessageRequest } from "./SendMessageRequest.mjs";
2
- export { SendReactionRequest } from "./SendReactionRequest.mjs";
2
+ export type { SendReactionRequest } from "./SendReactionRequest.mjs";
@@ -1,2 +1 @@
1
1
  export { SendMessageRequest } from "./SendMessageRequest.mjs";
2
- export { SendReactionRequest } from "./SendReactionRequest.mjs";
@@ -0,0 +1,61 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as AgentPhone from "../../../index.mjs";
5
+ export declare namespace RegistrationClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class RegistrationClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<RegistrationClient.Options>;
12
+ constructor(options?: RegistrationClient.Options);
13
+ /**
14
+ * Submit an A2P 10DLC registration to enable outbound SMS on your account.
15
+ *
16
+ * US carriers require 10DLC registration before your AI agent can send text messages. This endpoint accepts both `sole_proprietor` and `standard_brand` registration types.
17
+ *
18
+ * ### How it works
19
+ *
20
+ * 1. Submit your registration details via this endpoint
21
+ * 2. We validate your submission and flag any issues (RED = blocked, YELLOW = warning)
22
+ * 3. On success, you receive a Stripe payment URL to pay the one-time registration fee
23
+ * 4. After payment, we submit your registration to the carriers on your behalf
24
+ * 5. Carrier approval typically takes 7-10 business days
25
+ *
26
+ * ### Registration types
27
+ *
28
+ * - **`sole_proprietor`** — For individuals or small businesses. Simpler requirements, fewer fields.
29
+ * - **`standard_brand`** — For established businesses. Requires `business_name`, `privacy_policy_url`, `terms_of_service_url`, `sample_message_1`, and `sample_message_2`.
30
+ *
31
+ * ### Opt-in image
32
+ *
33
+ * `opt_in_image_url` must be a publicly accessible HTTPS URL to a screenshot showing how users opt in to receive messages from you (e.g. a consent checkbox on your signup form). Supports PNG, JPG, WEBP, and GIF up to 2MB. Google Drive links (`drive.google.com/file/d/.../view`) are automatically converted if the file is shared publicly.
34
+ *
35
+ * ### Re-submitting
36
+ *
37
+ * If you've already submitted but haven't completed payment, calling this endpoint again returns the payment URL without re-sending the registration email.
38
+ *
39
+ * @param {AgentPhone.RegistrationRequest} request
40
+ * @param {RegistrationClient.RequestOptions} requestOptions - Request-specific configuration.
41
+ *
42
+ * @throws {@link AgentPhone.UnprocessableEntityError}
43
+ *
44
+ * @example
45
+ * await client.registration.registerA2P({
46
+ * registration_type: "registration_type",
47
+ * first_name: "first_name",
48
+ * last_name: "last_name",
49
+ * email: "email",
50
+ * phone_number: "phone_number",
51
+ * street_address: "street_address",
52
+ * city: "city",
53
+ * state: "state",
54
+ * zip_code: "zip_code",
55
+ * use_case_description: "use_case_description",
56
+ * opt_in_image_url: "opt_in_image_url"
57
+ * })
58
+ */
59
+ registerA2P(request: AgentPhone.RegistrationRequest, requestOptions?: RegistrationClient.RequestOptions): core.HttpResponsePromise<AgentPhone.RegistrationResponse>;
60
+ private __registerA2P;
61
+ }
@@ -0,0 +1,108 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as AgentPhone from "../../../index.mjs";
18
+ export class RegistrationClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Submit an A2P 10DLC registration to enable outbound SMS on your account.
24
+ *
25
+ * US carriers require 10DLC registration before your AI agent can send text messages. This endpoint accepts both `sole_proprietor` and `standard_brand` registration types.
26
+ *
27
+ * ### How it works
28
+ *
29
+ * 1. Submit your registration details via this endpoint
30
+ * 2. We validate your submission and flag any issues (RED = blocked, YELLOW = warning)
31
+ * 3. On success, you receive a Stripe payment URL to pay the one-time registration fee
32
+ * 4. After payment, we submit your registration to the carriers on your behalf
33
+ * 5. Carrier approval typically takes 7-10 business days
34
+ *
35
+ * ### Registration types
36
+ *
37
+ * - **`sole_proprietor`** — For individuals or small businesses. Simpler requirements, fewer fields.
38
+ * - **`standard_brand`** — For established businesses. Requires `business_name`, `privacy_policy_url`, `terms_of_service_url`, `sample_message_1`, and `sample_message_2`.
39
+ *
40
+ * ### Opt-in image
41
+ *
42
+ * `opt_in_image_url` must be a publicly accessible HTTPS URL to a screenshot showing how users opt in to receive messages from you (e.g. a consent checkbox on your signup form). Supports PNG, JPG, WEBP, and GIF up to 2MB. Google Drive links (`drive.google.com/file/d/.../view`) are automatically converted if the file is shared publicly.
43
+ *
44
+ * ### Re-submitting
45
+ *
46
+ * If you've already submitted but haven't completed payment, calling this endpoint again returns the payment URL without re-sending the registration email.
47
+ *
48
+ * @param {AgentPhone.RegistrationRequest} request
49
+ * @param {RegistrationClient.RequestOptions} requestOptions - Request-specific configuration.
50
+ *
51
+ * @throws {@link AgentPhone.UnprocessableEntityError}
52
+ *
53
+ * @example
54
+ * await client.registration.registerA2P({
55
+ * registration_type: "registration_type",
56
+ * first_name: "first_name",
57
+ * last_name: "last_name",
58
+ * email: "email",
59
+ * phone_number: "phone_number",
60
+ * street_address: "street_address",
61
+ * city: "city",
62
+ * state: "state",
63
+ * zip_code: "zip_code",
64
+ * use_case_description: "use_case_description",
65
+ * opt_in_image_url: "opt_in_image_url"
66
+ * })
67
+ */
68
+ registerA2P(request, requestOptions) {
69
+ return core.HttpResponsePromise.fromPromise(this.__registerA2P(request, requestOptions));
70
+ }
71
+ __registerA2P(request, requestOptions) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
74
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
75
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
76
+ const _response = yield core.fetcher({
77
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v1/register"),
78
+ method: "POST",
79
+ headers: _headers,
80
+ contentType: "application/json",
81
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
82
+ requestType: "json",
83
+ body: request,
84
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
85
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
86
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
87
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
88
+ logging: this._options.logging,
89
+ });
90
+ if (_response.ok) {
91
+ return { data: _response.body, rawResponse: _response.rawResponse };
92
+ }
93
+ if (_response.error.reason === "status-code") {
94
+ switch (_response.error.statusCode) {
95
+ case 422:
96
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
97
+ default:
98
+ throw new errors.AgentPhoneError({
99
+ statusCode: _response.error.statusCode,
100
+ body: _response.error.body,
101
+ rawResponse: _response.rawResponse,
102
+ });
103
+ }
104
+ }
105
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/register");
106
+ });
107
+ }
108
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * registration_type: "registration_type",
5
+ * first_name: "first_name",
6
+ * last_name: "last_name",
7
+ * email: "email",
8
+ * phone_number: "phone_number",
9
+ * street_address: "street_address",
10
+ * city: "city",
11
+ * state: "state",
12
+ * zip_code: "zip_code",
13
+ * use_case_description: "use_case_description",
14
+ * opt_in_image_url: "opt_in_image_url"
15
+ * }
16
+ */
17
+ export interface RegistrationRequest {
18
+ /** 'sole_proprietor' or 'standard_brand' */
19
+ registration_type: string;
20
+ /** Required for standard_brand */
21
+ business_name?: string | null;
22
+ first_name: string;
23
+ last_name: string;
24
+ email: string;
25
+ /** E.164 format, e.g. +15551234567 */
26
+ phone_number: string;
27
+ /** Number of phone numbers you plan to use */
28
+ planned_numbers?: number;
29
+ street_address: string;
30
+ city: string;
31
+ state: string;
32
+ zip_code: string;
33
+ country?: string;
34
+ business_type?: string | null;
35
+ business_industry?: string | null;
36
+ position_in_company?: string | null;
37
+ /** EIN / Tax ID (standard_brand only) */
38
+ ein?: string | null;
39
+ registration_id_type?: string | null;
40
+ company_type?: string | null;
41
+ website_url?: string | null;
42
+ social_media_url?: string | null;
43
+ business_regions?: string | null;
44
+ /** Required for standard_brand */
45
+ privacy_policy_url?: string | null;
46
+ /** Required for standard_brand */
47
+ terms_of_service_url?: string | null;
48
+ use_case?: string | null;
49
+ /** Who you message, why, and how. Minimum 40 characters. */
50
+ use_case_description: string;
51
+ /** Required for standard_brand. Min 20 chars, include brand name. */
52
+ sample_message_1?: string | null;
53
+ /** Required for standard_brand. Min 20 chars, include brand name. */
54
+ sample_message_2?: string | null;
55
+ /** How users opt in to receive messages */
56
+ message_flow?: string | null;
57
+ /** Publicly accessible URL to a screenshot of your opt-in flow (PNG, JPG, WEBP, or GIF, max 2MB) */
58
+ opt_in_image_url: string;
59
+ has_embedded_links?: boolean;
60
+ has_embedded_phone?: boolean;
61
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { RegistrationRequest } from "./RegistrationRequest.mjs";
@@ -19,6 +19,14 @@ export interface AgentResponse {
19
19
  denoisingMode?: AgentResponse.DenoisingMode;
20
20
  /** Hang up the call after this many milliseconds of caller silence. Range 10000 (10s) to 3600000 (1 hour). Default 600000 (10 min). */
21
21
  maxSilenceMs?: number;
22
+ /** Voice speed multiplier. Range 0.5 to 2.0. Default 1.0. */
23
+ voiceSpeed?: number;
24
+ /** How easily callers can interrupt the agent. Range 0.0 to 1.0. Default 0.8. */
25
+ interruptionSensitivity?: number;
26
+ /** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true. */
27
+ enableBackchannel?: boolean;
28
+ /** BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. */
29
+ language?: string;
22
30
  createdAt: string;
23
31
  numbers?: AgentPhone.AgentNumberResponse[] | null;
24
32
  }
@@ -1,9 +1,3 @@
1
- /**
2
- * @example
3
- * {
4
- * human_email: "human_email"
5
- * }
6
- */
7
1
  export interface AgentSignUpRequest {
8
2
  human_email: string;
9
3
  agent_name?: string | null;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface AgentVerifyRequest {
2
+ verification_id: string;
3
+ otp_code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface FieldWarning {
2
+ field: string;
3
+ tier: string;
4
+ message: string;
5
+ suggestion: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,8 @@
1
+ import type * as AgentPhone from "../index.mjs";
2
+ export interface RegistrationResponse {
3
+ ok: boolean;
4
+ message: string;
5
+ payment_url: string;
6
+ campaign_status: string;
7
+ warnings?: AgentPhone.FieldWarning[];
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -5,4 +5,6 @@ export interface SendMessageResponse {
5
5
  from_number: string;
6
6
  to_number: string;
7
7
  media_urls?: string[];
8
+ reply_to_message_id?: string | null;
9
+ reply_parent_unresolved?: boolean | null;
8
10
  }
@@ -0,0 +1,8 @@
1
+ export interface SetBackgroundResponse {
2
+ conversationId: string;
3
+ channel: string;
4
+ hasBackground: boolean;
5
+ backgroundId?: string | null;
6
+ backgroundVersion?: number | null;
7
+ changed: boolean;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,8 +1,10 @@
1
1
  export * from "./AgentListResponse.mjs";
2
2
  export * from "./AgentNumberResponse.mjs";
3
3
  export * from "./AgentResponse.mjs";
4
+ export * from "./AgentSignUpRequest.mjs";
4
5
  export * from "./AgentUsageItem.mjs";
5
6
  export * from "./AgentUsageResponse.mjs";
7
+ export * from "./AgentVerifyRequest.mjs";
6
8
  export * from "./AllTimeStatsResponse.mjs";
7
9
  export * from "./AppRoutesAgentsConversationListResponse.mjs";
8
10
  export * from "./AppRoutesAgentsConversationSummary.mjs";
@@ -18,6 +20,7 @@ export * from "./ConversationDetail.mjs";
18
20
  export * from "./DailyUsagePoint.mjs";
19
21
  export * from "./DailyUsageResponse.mjs";
20
22
  export * from "./DeleteAgentResponse.mjs";
23
+ export * from "./FieldWarning.mjs";
21
24
  export * from "./HttpValidationError.mjs";
22
25
  export * from "./MessageInConversation.mjs";
23
26
  export * from "./MessageListResponse.mjs";
@@ -34,9 +37,11 @@ export * from "./PhoneNumberResponse.mjs";
34
37
  export * from "./PlanInfo.mjs";
35
38
  export * from "./PlanLimits.mjs";
36
39
  export * from "./ReactionInConversation.mjs";
40
+ export * from "./RegistrationResponse.mjs";
37
41
  export * from "./SendMessageResponse.mjs";
38
42
  export * from "./SendReactionResponse.mjs";
39
43
  export * from "./SendTypingResponse.mjs";
44
+ export * from "./SetBackgroundResponse.mjs";
40
45
  export * from "./UsageResponse.mjs";
41
46
  export * from "./UsageStats.mjs";
42
47
  export * from "./ValidationError.mjs";
@@ -1,8 +1,10 @@
1
1
  export * from "./AgentListResponse.mjs";
2
2
  export * from "./AgentNumberResponse.mjs";
3
3
  export * from "./AgentResponse.mjs";
4
+ export * from "./AgentSignUpRequest.mjs";
4
5
  export * from "./AgentUsageItem.mjs";
5
6
  export * from "./AgentUsageResponse.mjs";
7
+ export * from "./AgentVerifyRequest.mjs";
6
8
  export * from "./AllTimeStatsResponse.mjs";
7
9
  export * from "./AppRoutesAgentsConversationListResponse.mjs";
8
10
  export * from "./AppRoutesAgentsConversationSummary.mjs";
@@ -18,6 +20,7 @@ export * from "./ConversationDetail.mjs";
18
20
  export * from "./DailyUsagePoint.mjs";
19
21
  export * from "./DailyUsageResponse.mjs";
20
22
  export * from "./DeleteAgentResponse.mjs";
23
+ export * from "./FieldWarning.mjs";
21
24
  export * from "./HttpValidationError.mjs";
22
25
  export * from "./MessageInConversation.mjs";
23
26
  export * from "./MessageListResponse.mjs";
@@ -34,9 +37,11 @@ export * from "./PhoneNumberResponse.mjs";
34
37
  export * from "./PlanInfo.mjs";
35
38
  export * from "./PlanLimits.mjs";
36
39
  export * from "./ReactionInConversation.mjs";
40
+ export * from "./RegistrationResponse.mjs";
37
41
  export * from "./SendMessageResponse.mjs";
38
42
  export * from "./SendReactionResponse.mjs";
39
43
  export * from "./SendTypingResponse.mjs";
44
+ export * from "./SetBackgroundResponse.mjs";
40
45
  export * from "./UsageResponse.mjs";
41
46
  export * from "./UsageStats.mjs";
42
47
  export * from "./ValidationError.mjs";