agentphone 1.0.2 → 1.0.4

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