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
@@ -70,7 +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
+ * Sorted by most recent activity.
74
74
  *
75
75
  * @param {AgentPhone.ListConversationsV1ConversationsGetRequest} request
76
76
  * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -353,5 +353,118 @@ class ConversationsClient {
353
353
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/typing");
354
354
  });
355
355
  }
356
+ /**
357
+ * Set a custom wallpaper for the chat (iMessage only).
358
+ *
359
+ * Customer sends `image_url`; we fetch (≤10MB, JPEG/PNG/GIF/WebP/HEIC),
360
+ * validate, and forward as multipart to the iMessage provider. Idempotent —
361
+ * re-setting replaces. Recipients on iOS < 18 fall back to the default
362
+ * silently.
363
+ *
364
+ * @param {AgentPhone.SetBackgroundRequest} request
365
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
366
+ *
367
+ * @throws {@link AgentPhone.UnprocessableEntityError}
368
+ *
369
+ * @example
370
+ * await client.conversations.setChatBackground({
371
+ * conversation_id: "conversation_id",
372
+ * image_url: "https://example.com/wallpaper.jpg"
373
+ * })
374
+ */
375
+ setChatBackground(request, requestOptions) {
376
+ return core.HttpResponsePromise.fromPromise(this.__setChatBackground(request, requestOptions));
377
+ }
378
+ __setChatBackground(request, requestOptions) {
379
+ return __awaiter(this, void 0, void 0, function* () {
380
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
381
+ const { conversation_id: conversationId } = request, _body = __rest(request, ["conversation_id"]);
382
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
383
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
384
+ const _response = yield core.fetcher({
385
+ 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`),
386
+ method: "POST",
387
+ headers: _headers,
388
+ contentType: "application/json",
389
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
390
+ requestType: "json",
391
+ body: _body,
392
+ 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,
393
+ 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,
394
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
395
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
396
+ logging: this._options.logging,
397
+ });
398
+ if (_response.ok) {
399
+ return { data: _response.body, rawResponse: _response.rawResponse };
400
+ }
401
+ if (_response.error.reason === "status-code") {
402
+ switch (_response.error.statusCode) {
403
+ case 422:
404
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
405
+ default:
406
+ throw new errors.AgentPhoneError({
407
+ statusCode: _response.error.statusCode,
408
+ body: _response.error.body,
409
+ rawResponse: _response.rawResponse,
410
+ });
411
+ }
412
+ }
413
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/background");
414
+ });
415
+ }
416
+ /**
417
+ * Clear the custom wallpaper for the chat (iMessage only).
418
+ *
419
+ * Idempotent: deleting a default-background chat returns 204 (no-op).
420
+ *
421
+ * @param {AgentPhone.RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest} request
422
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
423
+ *
424
+ * @throws {@link AgentPhone.UnprocessableEntityError}
425
+ *
426
+ * @example
427
+ * await client.conversations.removeChatBackground({
428
+ * conversation_id: "conversation_id"
429
+ * })
430
+ */
431
+ removeChatBackground(request, requestOptions) {
432
+ return core.HttpResponsePromise.fromPromise(this.__removeChatBackground(request, requestOptions));
433
+ }
434
+ __removeChatBackground(request, requestOptions) {
435
+ return __awaiter(this, void 0, void 0, function* () {
436
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
437
+ const { conversation_id: conversationId } = request;
438
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
439
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
440
+ const _response = yield core.fetcher({
441
+ 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`),
442
+ method: "DELETE",
443
+ headers: _headers,
444
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
445
+ 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,
446
+ 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,
447
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
448
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
449
+ logging: this._options.logging,
450
+ });
451
+ if (_response.ok) {
452
+ return { data: undefined, rawResponse: _response.rawResponse };
453
+ }
454
+ if (_response.error.reason === "status-code") {
455
+ switch (_response.error.statusCode) {
456
+ case 422:
457
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
458
+ default:
459
+ throw new errors.AgentPhoneError({
460
+ statusCode: _response.error.statusCode,
461
+ body: _response.error.body,
462
+ rawResponse: _response.rawResponse,
463
+ });
464
+ }
465
+ }
466
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/conversations/{conversation_id}/background");
467
+ });
468
+ }
356
469
  }
357
470
  exports.ConversationsClient = ConversationsClient;
@@ -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.js";
2
2
  export type { GetConversationV1ConversationsConversationIdGetRequest } from "./GetConversationV1ConversationsConversationIdGetRequest.js";
3
3
  export type { ListConversationsV1ConversationsGetRequest } from "./ListConversationsV1ConversationsGetRequest.js";
4
+ export type { RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest } from "./RemoveChatBackgroundV1ConversationsConversationIdBackgroundDeleteRequest.js";
4
5
  export type { SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest } from "./SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js";
6
+ export type { SetBackgroundRequest } from "./SetBackgroundRequest.js";
5
7
  export type { UpdateConversationRequest } from "./UpdateConversationRequest.js";
@@ -1,5 +1,3 @@
1
- export * from "./agentSignup/client/requests/index.js";
2
- export * as agentSignup from "./agentSignup/index.js";
3
1
  export * from "./agents/client/requests/index.js";
4
2
  export * as agents from "./agents/index.js";
5
3
  export * from "./agentWebhooks/client/requests/index.js";
@@ -16,6 +14,8 @@ export * from "./messages/client/requests/index.js";
16
14
  export * as messages from "./messages/index.js";
17
15
  export * from "./numbers/client/requests/index.js";
18
16
  export * as numbers from "./numbers/index.js";
17
+ export * from "./registration/client/requests/index.js";
18
+ export * as registration from "./registration/index.js";
19
19
  export * from "./usage/client/requests/index.js";
20
20
  export * as usage from "./usage/index.js";
21
21
  export * from "./usage/types/index.js";
@@ -36,9 +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.contactCards = exports.calls = exports.agentWebhooks = exports.agents = exports.agentSignup = void 0;
40
- __exportStar(require("./agentSignup/client/requests/index.js"), exports);
41
- exports.agentSignup = __importStar(require("./agentSignup/index.js"));
39
+ exports.webhooks = exports.usage = exports.registration = exports.numbers = exports.messages = exports.conversations = exports.contacts = exports.contactCards = exports.calls = exports.agentWebhooks = exports.agents = void 0;
42
40
  __exportStar(require("./agents/client/requests/index.js"), exports);
43
41
  exports.agents = __importStar(require("./agents/index.js"));
44
42
  __exportStar(require("./agentWebhooks/client/requests/index.js"), exports);
@@ -55,6 +53,8 @@ __exportStar(require("./messages/client/requests/index.js"), exports);
55
53
  exports.messages = __importStar(require("./messages/index.js"));
56
54
  __exportStar(require("./numbers/client/requests/index.js"), exports);
57
55
  exports.numbers = __importStar(require("./numbers/index.js"));
56
+ __exportStar(require("./registration/client/requests/index.js"), exports);
57
+ exports.registration = __importStar(require("./registration/index.js"));
58
58
  __exportStar(require("./usage/client/requests/index.js"), exports);
59
59
  exports.usage = __importStar(require("./usage/index.js"));
60
60
  __exportStar(require("./usage/types/index.js"), exports);
@@ -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,16 +1,3 @@
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
1
  export { SendMessageRequest } from "./SendMessageRequest.js";
2
- export { SendReactionRequest } from "./SendReactionRequest.js";
2
+ export type { SendReactionRequest } from "./SendReactionRequest.js";
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SendReactionRequest = exports.SendMessageRequest = void 0;
3
+ exports.SendMessageRequest = void 0;
4
4
  var SendMessageRequest_js_1 = require("./SendMessageRequest.js");
5
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; } });
@@ -0,0 +1,61 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as AgentPhone from "../../../index.js";
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
+ }
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  });
44
44
  };
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.AgentSignupClient = void 0;
46
+ exports.RegistrationClient = void 0;
47
47
  const BaseClient_js_1 = require("../../../../BaseClient.js");
48
48
  const headers_js_1 = require("../../../../core/headers.js");
49
49
  const core = __importStar(require("../../../../core/index.js"));
@@ -51,91 +51,66 @@ const environments = __importStar(require("../../../../environments.js"));
51
51
  const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
52
  const errors = __importStar(require("../../../../errors/index.js"));
53
53
  const AgentPhone = __importStar(require("../../../index.js"));
54
- class AgentSignupClient {
54
+ class RegistrationClient {
55
55
  constructor(options = {}) {
56
- this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
57
  }
58
58
  /**
59
- * Kick off agent self-signup.
59
+ * Submit an A2P 10DLC registration to enable outbound SMS on your account.
60
60
  *
61
- * Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
62
- * until /v0/agent/verify is called with the code.
61
+ * US carriers require 10DLC registration before your AI agent can send text messages. This endpoint accepts both `sole_proprietor` and `standard_brand` registration types.
63
62
  *
64
- * @param {AgentPhone.AgentSignUpRequest} request
65
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ * ### How it works
66
64
  *
67
- * @throws {@link AgentPhone.UnprocessableEntityError}
65
+ * 1. Submit your registration details via this endpoint
66
+ * 2. We validate your submission and flag any issues (RED = blocked, YELLOW = warning)
67
+ * 3. On success, you receive a Stripe payment URL to pay the one-time registration fee
68
+ * 4. After payment, we submit your registration to the carriers on your behalf
69
+ * 5. Carrier approval typically takes 7-10 business days
68
70
  *
69
- * @example
70
- * await client.agentSignup.agentSignUp({
71
- * human_email: "human_email"
72
- * })
73
- */
74
- agentSignUp(request, requestOptions) {
75
- return core.HttpResponsePromise.fromPromise(this.__agentSignUp(request, requestOptions));
76
- }
77
- __agentSignUp(request, requestOptions) {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
80
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
- const _response = yield core.fetcher({
82
- 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, "v0/agent/sign-up"),
83
- method: "POST",
84
- headers: _headers,
85
- contentType: "application/json",
86
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
87
- requestType: "json",
88
- body: request,
89
- 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,
90
- 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,
91
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
92
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
93
- logging: this._options.logging,
94
- });
95
- if (_response.ok) {
96
- return { data: _response.body, rawResponse: _response.rawResponse };
97
- }
98
- if (_response.error.reason === "status-code") {
99
- switch (_response.error.statusCode) {
100
- case 422:
101
- throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
102
- default:
103
- throw new errors.AgentPhoneError({
104
- statusCode: _response.error.statusCode,
105
- body: _response.error.body,
106
- rawResponse: _response.rawResponse,
107
- });
108
- }
109
- }
110
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/agent/sign-up");
111
- });
112
- }
113
- /**
114
- * Verify the OTP and atomically provision everything.
71
+ * ### Registration types
72
+ *
73
+ * - **`sole_proprietor`** — For individuals or small businesses. Simpler requirements, fewer fields.
74
+ * - **`standard_brand`** — For established businesses. Requires `business_name`, `privacy_policy_url`, `terms_of_service_url`, `sample_message_1`, and `sample_message_2`.
75
+ *
76
+ * ### Opt-in image
77
+ *
78
+ * `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.
79
+ *
80
+ * ### Re-submitting
115
81
  *
116
- * Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
117
- * + first-month charge + API key. Returns the key once — agents must save it.
82
+ * If you've already submitted but haven't completed payment, calling this endpoint again returns the payment URL without re-sending the registration email.
118
83
  *
119
- * @param {AgentPhone.AgentVerifyRequest} request
120
- * @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
84
+ * @param {AgentPhone.RegistrationRequest} request
85
+ * @param {RegistrationClient.RequestOptions} requestOptions - Request-specific configuration.
121
86
  *
122
87
  * @throws {@link AgentPhone.UnprocessableEntityError}
123
88
  *
124
89
  * @example
125
- * await client.agentSignup.agentVerify({
126
- * verification_id: "verification_id",
127
- * otp_code: "otp_code"
90
+ * await client.registration.registerA2P({
91
+ * registration_type: "registration_type",
92
+ * first_name: "first_name",
93
+ * last_name: "last_name",
94
+ * email: "email",
95
+ * phone_number: "phone_number",
96
+ * street_address: "street_address",
97
+ * city: "city",
98
+ * state: "state",
99
+ * zip_code: "zip_code",
100
+ * use_case_description: "use_case_description",
101
+ * opt_in_image_url: "opt_in_image_url"
128
102
  * })
129
103
  */
130
- agentVerify(request, requestOptions) {
131
- return core.HttpResponsePromise.fromPromise(this.__agentVerify(request, requestOptions));
104
+ registerA2P(request, requestOptions) {
105
+ return core.HttpResponsePromise.fromPromise(this.__registerA2P(request, requestOptions));
132
106
  }
133
- __agentVerify(request, requestOptions) {
107
+ __registerA2P(request, requestOptions) {
134
108
  return __awaiter(this, void 0, void 0, function* () {
135
109
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
136
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
110
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
111
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
137
112
  const _response = yield core.fetcher({
138
- 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, "v0/agent/verify"),
113
+ 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"),
139
114
  method: "POST",
140
115
  headers: _headers,
141
116
  contentType: "application/json",
@@ -163,8 +138,8 @@ class AgentSignupClient {
163
138
  });
164
139
  }
165
140
  }
166
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v0/agent/verify");
141
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/register");
167
142
  });
168
143
  }
169
144
  }
170
- exports.AgentSignupClient = AgentSignupClient;
145
+ exports.RegistrationClient = RegistrationClient;
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { RegistrationRequest } from "./RegistrationRequest.js";
@@ -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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface AgentVerifyRequest {
2
+ verification_id: string;
3
+ otp_code: string;
4
+ }
@@ -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 });
@@ -0,0 +1,6 @@
1
+ export interface FieldWarning {
2
+ field: string;
3
+ tier: string;
4
+ message: string;
5
+ suggestion: string;
6
+ }
@@ -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 });
@@ -0,0 +1,8 @@
1
+ import type * as AgentPhone from "../index.js";
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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  }