agentphone 1.0.11 → 1.0.13

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 (164) hide show
  1. package/README.md +10 -10
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +6 -6
  4. package/dist/cjs/Client.js +26 -26
  5. package/dist/cjs/api/resources/agents/client/Client.js +11 -11
  6. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +71 -0
  7. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +66 -0
  8. package/dist/cjs/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.ts +2 -0
  9. package/dist/cjs/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.ts +2 -0
  10. package/dist/cjs/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.ts +2 -1
  11. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +71 -0
  12. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +66 -0
  13. package/dist/cjs/api/resources/calls/client/Client.js +16 -5
  14. package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
  15. package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +2 -1
  16. package/dist/cjs/api/resources/contacts/client/Client.js +2 -3
  17. package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +2 -1
  18. package/dist/cjs/api/resources/conversations/client/Client.d.ts +5 -3
  19. package/dist/cjs/api/resources/conversations/client/Client.js +7 -6
  20. package/dist/cjs/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.ts +2 -1
  21. package/dist/cjs/api/resources/index.d.ts +4 -4
  22. package/dist/cjs/api/resources/index.js +5 -5
  23. package/dist/cjs/api/resources/numbers/client/Client.js +18 -7
  24. package/dist/cjs/api/resources/numbers/client/requests/CreateNumberRequest.d.ts +2 -0
  25. package/dist/cjs/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.ts +2 -0
  26. package/dist/cjs/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.ts +2 -1
  27. package/dist/cjs/api/resources/registration/client/Client.d.ts +61 -0
  28. package/dist/cjs/api/resources/{agentSignup → registration}/client/Client.js +44 -69
  29. package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.d.ts +61 -0
  30. package/dist/cjs/api/resources/registration/client/requests/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/subAccounts/client/Client.d.ts +61 -0
  32. package/dist/cjs/api/resources/{integrations → subAccounts}/client/Client.js +99 -106
  33. package/dist/cjs/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.ts +9 -0
  34. package/dist/cjs/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.ts +9 -0
  35. package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.ts +11 -0
  36. package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.js +3 -0
  37. package/dist/cjs/api/resources/subAccounts/client/requests/index.d.ts +3 -0
  38. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +7 -4
  39. package/dist/cjs/api/resources/webhooks/client/Client.js +14 -9
  40. package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.ts +14 -0
  41. package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.js +3 -0
  42. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.ts +8 -0
  43. package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.js +3 -0
  44. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
  45. package/dist/cjs/api/types/AgentResponse.d.ts +2 -0
  46. package/dist/cjs/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.ts +0 -6
  47. package/dist/cjs/api/types/AgentSignUpRequest.js +3 -0
  48. package/dist/cjs/api/types/AgentVerifyRequest.d.ts +4 -0
  49. package/dist/cjs/api/types/AgentVerifyRequest.js +3 -0
  50. package/dist/cjs/api/types/AppRoutesConversationsConversationSummary.d.ts +6 -0
  51. package/dist/cjs/api/types/ConversationDetail.d.ts +5 -0
  52. package/dist/cjs/api/types/FieldWarning.d.ts +6 -0
  53. package/dist/cjs/api/types/FieldWarning.js +3 -0
  54. package/dist/cjs/api/types/GroupParticipant.d.ts +7 -0
  55. package/dist/cjs/api/types/GroupParticipant.js +3 -0
  56. package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
  57. package/dist/cjs/api/types/RegistrationResponse.d.ts +8 -0
  58. package/dist/cjs/api/types/RegistrationResponse.js +3 -0
  59. package/dist/cjs/api/types/index.d.ts +5 -0
  60. package/dist/cjs/api/types/index.js +5 -0
  61. package/dist/cjs/version.d.ts +1 -1
  62. package/dist/cjs/version.js +1 -1
  63. package/dist/esm/BaseClient.mjs +2 -2
  64. package/dist/esm/Client.d.mts +6 -6
  65. package/dist/esm/Client.mjs +10 -10
  66. package/dist/esm/api/resources/agents/client/Client.mjs +12 -12
  67. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +71 -0
  68. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +66 -0
  69. package/dist/esm/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.mts +2 -0
  70. package/dist/esm/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.mts +2 -0
  71. package/dist/esm/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.mts +2 -1
  72. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +71 -0
  73. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +66 -0
  74. package/dist/esm/api/resources/calls/client/Client.mjs +17 -6
  75. package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
  76. package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +2 -1
  77. package/dist/esm/api/resources/contacts/client/Client.mjs +3 -4
  78. package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +2 -1
  79. package/dist/esm/api/resources/conversations/client/Client.d.mts +5 -3
  80. package/dist/esm/api/resources/conversations/client/Client.mjs +8 -7
  81. package/dist/esm/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.mts +2 -1
  82. package/dist/esm/api/resources/index.d.mts +4 -4
  83. package/dist/esm/api/resources/index.mjs +4 -4
  84. package/dist/esm/api/resources/numbers/client/Client.mjs +19 -8
  85. package/dist/esm/api/resources/numbers/client/requests/CreateNumberRequest.d.mts +2 -0
  86. package/dist/esm/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.mts +2 -0
  87. package/dist/esm/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.mts +2 -1
  88. package/dist/esm/api/resources/registration/client/Client.d.mts +61 -0
  89. package/dist/esm/api/resources/registration/client/Client.mjs +108 -0
  90. package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.d.mts +61 -0
  91. package/dist/esm/api/resources/registration/client/requests/index.d.mts +1 -0
  92. package/dist/esm/api/resources/subAccounts/client/Client.d.mts +61 -0
  93. package/dist/esm/api/resources/{integrations → subAccounts}/client/Client.mjs +97 -104
  94. package/dist/esm/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.mts +9 -0
  95. package/dist/esm/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.mts +9 -0
  96. package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.mts +11 -0
  97. package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.mjs +2 -0
  98. package/dist/esm/api/resources/subAccounts/client/requests/index.d.mts +3 -0
  99. package/dist/esm/api/resources/webhooks/client/Client.d.mts +7 -4
  100. package/dist/esm/api/resources/webhooks/client/Client.mjs +15 -10
  101. package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.mts +14 -0
  102. package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.mjs +2 -0
  103. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.mts +8 -0
  104. package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.mjs +2 -0
  105. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
  106. package/dist/esm/api/types/AgentResponse.d.mts +2 -0
  107. package/dist/esm/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.mts +0 -6
  108. package/dist/esm/api/types/AgentSignUpRequest.mjs +2 -0
  109. package/dist/esm/api/types/AgentVerifyRequest.d.mts +4 -0
  110. package/dist/esm/api/types/AgentVerifyRequest.mjs +2 -0
  111. package/dist/esm/api/types/AppRoutesConversationsConversationSummary.d.mts +6 -0
  112. package/dist/esm/api/types/ConversationDetail.d.mts +5 -0
  113. package/dist/esm/api/types/FieldWarning.d.mts +6 -0
  114. package/dist/esm/api/types/FieldWarning.mjs +2 -0
  115. package/dist/esm/api/types/GroupParticipant.d.mts +7 -0
  116. package/dist/esm/api/types/GroupParticipant.mjs +2 -0
  117. package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
  118. package/dist/esm/api/types/RegistrationResponse.d.mts +8 -0
  119. package/dist/esm/api/types/RegistrationResponse.mjs +2 -0
  120. package/dist/esm/api/types/index.d.mts +5 -0
  121. package/dist/esm/api/types/index.mjs +5 -0
  122. package/dist/esm/version.d.mts +1 -1
  123. package/dist/esm/version.mjs +1 -1
  124. package/package.json +1 -1
  125. package/reference.md +188 -277
  126. package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +0 -50
  127. package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +0 -11
  128. package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +0 -2
  129. package/dist/cjs/api/resources/integrations/client/Client.d.ts +0 -64
  130. package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +0 -9
  131. package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +0 -1
  132. package/dist/esm/api/resources/agentSignup/client/Client.d.mts +0 -50
  133. package/dist/esm/api/resources/agentSignup/client/Client.mjs +0 -133
  134. package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +0 -11
  135. package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +0 -2
  136. package/dist/esm/api/resources/integrations/client/Client.d.mts +0 -64
  137. package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +0 -9
  138. package/dist/esm/api/resources/integrations/client/requests/index.d.mts +0 -1
  139. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.d.ts +0 -0
  140. /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.js +0 -0
  141. /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentSignUpRequest.js → registration/client/requests/RegistrationRequest.js} +0 -0
  142. /package/dist/cjs/api/resources/{agentSignup → registration}/client/requests/index.js +0 -0
  143. /package/dist/cjs/api/resources/{agentSignup → registration}/index.d.ts +0 -0
  144. /package/dist/cjs/api/resources/{agentSignup → registration}/index.js +0 -0
  145. /package/dist/cjs/api/resources/{integrations → subAccounts}/client/index.d.ts +0 -0
  146. /package/dist/cjs/api/resources/{integrations → subAccounts}/client/index.js +0 -0
  147. /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentVerifyRequest.js → subAccounts/client/requests/CreateSubAccountRequest.js} +0 -0
  148. /package/dist/cjs/api/resources/{integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js → subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.js} +0 -0
  149. /package/dist/cjs/api/resources/{integrations → subAccounts}/client/requests/index.js +0 -0
  150. /package/dist/cjs/api/resources/{integrations → subAccounts}/index.d.ts +0 -0
  151. /package/dist/cjs/api/resources/{integrations → subAccounts}/index.js +0 -0
  152. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.d.mts +0 -0
  153. /package/dist/esm/api/resources/{agentSignup → registration}/client/index.mjs +0 -0
  154. /package/dist/esm/api/resources/{agentSignup/client/requests/AgentSignUpRequest.mjs → registration/client/requests/RegistrationRequest.mjs} +0 -0
  155. /package/dist/esm/api/resources/{agentSignup → registration}/client/requests/index.mjs +0 -0
  156. /package/dist/esm/api/resources/{agentSignup → registration}/index.d.mts +0 -0
  157. /package/dist/esm/api/resources/{agentSignup → registration}/index.mjs +0 -0
  158. /package/dist/esm/api/resources/{integrations → subAccounts}/client/index.d.mts +0 -0
  159. /package/dist/esm/api/resources/{integrations → subAccounts}/client/index.mjs +0 -0
  160. /package/dist/esm/api/resources/{agentSignup/client/requests/AgentVerifyRequest.mjs → subAccounts/client/requests/CreateSubAccountRequest.mjs} +0 -0
  161. /package/dist/esm/api/resources/{integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs → subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.mjs} +0 -0
  162. /package/dist/esm/api/resources/{integrations → subAccounts}/client/requests/index.mjs +0 -0
  163. /package/dist/esm/api/resources/{integrations → subAccounts}/index.d.mts +0 -0
  164. /package/dist/esm/api/resources/{integrations → subAccounts}/index.mjs +0 -0
@@ -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 SubAccountsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class SubAccountsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<SubAccountsClient.Options>;
12
+ constructor(options?: SubAccountsClient.Options);
13
+ /**
14
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
15
+ *
16
+ * @example
17
+ * await client.subAccounts.listSubAccounts()
18
+ */
19
+ listSubAccounts(requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
20
+ private __listSubAccounts;
21
+ /**
22
+ * @param {AgentPhone.CreateSubAccountRequest} request
23
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
24
+ *
25
+ * @throws {@link AgentPhone.UnprocessableEntityError}
26
+ *
27
+ * @example
28
+ * await client.subAccounts.createSubAccount({
29
+ * name: "name"
30
+ * })
31
+ */
32
+ createSubAccount(request: AgentPhone.CreateSubAccountRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
33
+ private __createSubAccount;
34
+ /**
35
+ * @param {AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest} request
36
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
37
+ *
38
+ * @throws {@link AgentPhone.UnprocessableEntityError}
39
+ *
40
+ * @example
41
+ * await client.subAccounts.deleteSubAccount({
42
+ * sub_account_id: "sub_account_id"
43
+ * })
44
+ */
45
+ deleteSubAccount(request: AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
46
+ private __deleteSubAccount;
47
+ /**
48
+ * @param {AgentPhone.UpdateSubAccountRequest} request
49
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
50
+ *
51
+ * @throws {@link AgentPhone.UnprocessableEntityError}
52
+ *
53
+ * @example
54
+ * await client.subAccounts.updateSubAccount({
55
+ * sub_account_id: "sub_account_id",
56
+ * name: "name"
57
+ * })
58
+ */
59
+ updateSubAccount(request: AgentPhone.UpdateSubAccountRequest, requestOptions?: SubAccountsClient.RequestOptions): core.HttpResponsePromise<unknown>;
60
+ private __updateSubAccount;
61
+ }
@@ -42,8 +42,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
43
43
  });
44
44
  };
45
+ var __rest = (this && this.__rest) || function (s, e) {
46
+ var t = {};
47
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
48
+ t[p] = s[p];
49
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
50
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
51
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
52
+ t[p[i]] = s[p[i]];
53
+ }
54
+ return t;
55
+ };
45
56
  Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.IntegrationsClient = void 0;
57
+ exports.SubAccountsClient = void 0;
47
58
  const BaseClient_js_1 = require("../../../../BaseClient.js");
48
59
  const headers_js_1 = require("../../../../core/headers.js");
49
60
  const core = __importStar(require("../../../../core/index.js"));
@@ -51,82 +62,27 @@ const environments = __importStar(require("../../../../environments.js"));
51
62
  const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
63
  const errors = __importStar(require("../../../../errors/index.js"));
53
64
  const AgentPhone = __importStar(require("../../../index.js"));
54
- class IntegrationsClient {
65
+ class SubAccountsClient {
55
66
  constructor(options = {}) {
56
67
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
68
  }
58
69
  /**
59
- * Exchange a one-time connect code and redirect to Supabase OAuth.
60
- *
61
- * @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
62
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
63
- *
64
- * @throws {@link AgentPhone.UnprocessableEntityError}
65
- *
66
- * @example
67
- * await client.integrations.supabaseConnect({
68
- * code: "code"
69
- * })
70
- */
71
- supabaseConnect(request, requestOptions) {
72
- return core.HttpResponsePromise.fromPromise(this.__supabaseConnect(request, requestOptions));
73
- }
74
- __supabaseConnect(request, requestOptions) {
75
- return __awaiter(this, void 0, void 0, function* () {
76
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
- const { code } = request;
78
- const _queryParams = {
79
- code,
80
- };
81
- 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);
82
- const _response = yield core.fetcher({
83
- 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, "integrations/supabase/connect"),
84
- method: "GET",
85
- headers: _headers,
86
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
87
- 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,
88
- 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,
89
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
90
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
91
- logging: this._options.logging,
92
- });
93
- if (_response.ok) {
94
- return { data: _response.body, rawResponse: _response.rawResponse };
95
- }
96
- if (_response.error.reason === "status-code") {
97
- switch (_response.error.statusCode) {
98
- case 422:
99
- throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
100
- default:
101
- throw new errors.AgentPhoneError({
102
- statusCode: _response.error.statusCode,
103
- body: _response.error.body,
104
- rawResponse: _response.rawResponse,
105
- });
106
- }
107
- }
108
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/connect");
109
- });
110
- }
111
- /**
112
- * Create a short-lived one-time code for initiating the Supabase OAuth flow.
113
- *
114
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
70
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
115
71
  *
116
72
  * @example
117
- * await client.integrations.supabaseConnectCode()
73
+ * await client.subAccounts.listSubAccounts()
118
74
  */
119
- supabaseConnectCode(requestOptions) {
120
- return core.HttpResponsePromise.fromPromise(this.__supabaseConnectCode(requestOptions));
75
+ listSubAccounts(requestOptions) {
76
+ return core.HttpResponsePromise.fromPromise(this.__listSubAccounts(requestOptions));
121
77
  }
122
- __supabaseConnectCode(requestOptions) {
78
+ __listSubAccounts(requestOptions) {
123
79
  return __awaiter(this, void 0, void 0, function* () {
124
80
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
125
81
  const _authRequest = yield this._options.authProvider.getAuthRequest();
126
82
  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);
127
83
  const _response = yield core.fetcher({
128
- 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, "integrations/supabase/connect"),
129
- method: "POST",
84
+ 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/sub-accounts"),
85
+ method: "GET",
130
86
  headers: _headers,
131
87
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
132
88
  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,
@@ -145,28 +101,36 @@ class IntegrationsClient {
145
101
  rawResponse: _response.rawResponse,
146
102
  });
147
103
  }
148
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/integrations/supabase/connect");
104
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/sub-accounts");
149
105
  });
150
106
  }
151
107
  /**
152
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
108
+ * @param {AgentPhone.CreateSubAccountRequest} request
109
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
110
+ *
111
+ * @throws {@link AgentPhone.UnprocessableEntityError}
153
112
  *
154
113
  * @example
155
- * await client.integrations.supabaseStatus()
114
+ * await client.subAccounts.createSubAccount({
115
+ * name: "name"
116
+ * })
156
117
  */
157
- supabaseStatus(requestOptions) {
158
- return core.HttpResponsePromise.fromPromise(this.__supabaseStatus(requestOptions));
118
+ createSubAccount(request, requestOptions) {
119
+ return core.HttpResponsePromise.fromPromise(this.__createSubAccount(request, requestOptions));
159
120
  }
160
- __supabaseStatus(requestOptions) {
121
+ __createSubAccount(request, requestOptions) {
161
122
  return __awaiter(this, void 0, void 0, function* () {
162
123
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
163
124
  const _authRequest = yield this._options.authProvider.getAuthRequest();
164
125
  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);
165
126
  const _response = yield core.fetcher({
166
- 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, "integrations/supabase/status"),
167
- method: "GET",
127
+ 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/sub-accounts"),
128
+ method: "POST",
168
129
  headers: _headers,
130
+ contentType: "application/json",
169
131
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
132
+ requestType: "json",
133
+ body: request,
170
134
  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,
171
135
  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,
172
136
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -177,34 +141,43 @@ class IntegrationsClient {
177
141
  return { data: _response.body, rawResponse: _response.rawResponse };
178
142
  }
179
143
  if (_response.error.reason === "status-code") {
180
- throw new errors.AgentPhoneError({
181
- statusCode: _response.error.statusCode,
182
- body: _response.error.body,
183
- rawResponse: _response.rawResponse,
184
- });
144
+ switch (_response.error.statusCode) {
145
+ case 422:
146
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
147
+ default:
148
+ throw new errors.AgentPhoneError({
149
+ statusCode: _response.error.statusCode,
150
+ body: _response.error.body,
151
+ rawResponse: _response.rawResponse,
152
+ });
153
+ }
185
154
  }
186
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/status");
155
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/sub-accounts");
187
156
  });
188
157
  }
189
158
  /**
190
- * Get a valid Supabase access token, auto-refreshing if expired.
159
+ * @param {AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest} request
160
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
191
161
  *
192
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
162
+ * @throws {@link AgentPhone.UnprocessableEntityError}
193
163
  *
194
164
  * @example
195
- * await client.integrations.supabaseToken()
165
+ * await client.subAccounts.deleteSubAccount({
166
+ * sub_account_id: "sub_account_id"
167
+ * })
196
168
  */
197
- supabaseToken(requestOptions) {
198
- return core.HttpResponsePromise.fromPromise(this.__supabaseToken(requestOptions));
169
+ deleteSubAccount(request, requestOptions) {
170
+ return core.HttpResponsePromise.fromPromise(this.__deleteSubAccount(request, requestOptions));
199
171
  }
200
- __supabaseToken(requestOptions) {
172
+ __deleteSubAccount(request, requestOptions) {
201
173
  return __awaiter(this, void 0, void 0, function* () {
202
174
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
175
+ const { sub_account_id: subAccountId } = request;
203
176
  const _authRequest = yield this._options.authProvider.getAuthRequest();
204
177
  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);
205
178
  const _response = yield core.fetcher({
206
- 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, "integrations/supabase/token"),
207
- method: "GET",
179
+ 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/sub-accounts/${core.url.encodePathParam(subAccountId)}`),
180
+ method: "DELETE",
208
181
  headers: _headers,
209
182
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
210
183
  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,
@@ -217,34 +190,49 @@ class IntegrationsClient {
217
190
  return { data: _response.body, rawResponse: _response.rawResponse };
218
191
  }
219
192
  if (_response.error.reason === "status-code") {
220
- throw new errors.AgentPhoneError({
221
- statusCode: _response.error.statusCode,
222
- body: _response.error.body,
223
- rawResponse: _response.rawResponse,
224
- });
193
+ switch (_response.error.statusCode) {
194
+ case 422:
195
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
196
+ default:
197
+ throw new errors.AgentPhoneError({
198
+ statusCode: _response.error.statusCode,
199
+ body: _response.error.body,
200
+ rawResponse: _response.rawResponse,
201
+ });
202
+ }
225
203
  }
226
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/integrations/supabase/token");
204
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/sub-accounts/{sub_account_id}");
227
205
  });
228
206
  }
229
207
  /**
230
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
208
+ * @param {AgentPhone.UpdateSubAccountRequest} request
209
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
210
+ *
211
+ * @throws {@link AgentPhone.UnprocessableEntityError}
231
212
  *
232
213
  * @example
233
- * await client.integrations.supabaseDisconnect()
214
+ * await client.subAccounts.updateSubAccount({
215
+ * sub_account_id: "sub_account_id",
216
+ * name: "name"
217
+ * })
234
218
  */
235
- supabaseDisconnect(requestOptions) {
236
- return core.HttpResponsePromise.fromPromise(this.__supabaseDisconnect(requestOptions));
219
+ updateSubAccount(request, requestOptions) {
220
+ return core.HttpResponsePromise.fromPromise(this.__updateSubAccount(request, requestOptions));
237
221
  }
238
- __supabaseDisconnect(requestOptions) {
222
+ __updateSubAccount(request, requestOptions) {
239
223
  return __awaiter(this, void 0, void 0, function* () {
240
224
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
225
+ const { sub_account_id: subAccountId } = request, _body = __rest(request, ["sub_account_id"]);
241
226
  const _authRequest = yield this._options.authProvider.getAuthRequest();
242
227
  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);
243
228
  const _response = yield core.fetcher({
244
- 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, "integrations/supabase"),
245
- method: "DELETE",
229
+ 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/sub-accounts/${core.url.encodePathParam(subAccountId)}`),
230
+ method: "PATCH",
246
231
  headers: _headers,
232
+ contentType: "application/json",
247
233
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
234
+ requestType: "json",
235
+ body: _body,
248
236
  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,
249
237
  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,
250
238
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -255,14 +243,19 @@ class IntegrationsClient {
255
243
  return { data: _response.body, rawResponse: _response.rawResponse };
256
244
  }
257
245
  if (_response.error.reason === "status-code") {
258
- throw new errors.AgentPhoneError({
259
- statusCode: _response.error.statusCode,
260
- body: _response.error.body,
261
- rawResponse: _response.rawResponse,
262
- });
246
+ switch (_response.error.statusCode) {
247
+ case 422:
248
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
249
+ default:
250
+ throw new errors.AgentPhoneError({
251
+ statusCode: _response.error.statusCode,
252
+ body: _response.error.body,
253
+ rawResponse: _response.rawResponse,
254
+ });
255
+ }
263
256
  }
264
- return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/integrations/supabase");
257
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v1/sub-accounts/{sub_account_id}");
265
258
  });
266
259
  }
267
260
  }
268
- exports.IntegrationsClient = IntegrationsClient;
261
+ exports.SubAccountsClient = SubAccountsClient;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * name: "name"
5
+ * }
6
+ */
7
+ export interface CreateSubAccountRequest {
8
+ name: string;
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * sub_account_id: "sub_account_id"
5
+ * }
6
+ */
7
+ export interface DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest {
8
+ sub_account_id: string;
9
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * sub_account_id: "sub_account_id",
5
+ * name: "name"
6
+ * }
7
+ */
8
+ export interface UpdateSubAccountRequest {
9
+ sub_account_id: string;
10
+ name: string;
11
+ }
@@ -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,3 @@
1
+ export type { CreateSubAccountRequest } from "./CreateSubAccountRequest.js";
2
+ export type { DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest } from "./DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.js";
3
+ export type { UpdateSubAccountRequest } from "./UpdateSubAccountRequest.js";
@@ -13,12 +13,13 @@ export declare class WebhooksClient {
13
13
  /**
14
14
  * Get the master webhook configuration for this account.
15
15
  *
16
+ * @param {AgentPhone.GetWebhookV1WebhooksGetRequest} request
16
17
  * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
17
18
  *
18
19
  * @example
19
20
  * await client.webhooks.getWebhook()
20
21
  */
21
- getWebhook(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentPhone.WebhookResponse | null>;
22
+ getWebhook(request?: AgentPhone.GetWebhookV1WebhooksGetRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentPhone.WebhookResponse | null>;
22
23
  private __getWebhook;
23
24
  /**
24
25
  * Register or update the webhook URL for this account.
@@ -29,17 +30,19 @@ export declare class WebhooksClient {
29
30
  * contextLimit: Number of recent messages to include in webhook payloads (0-50, default: 10).
30
31
  * Set to 0 to disable history in webhooks.
31
32
  *
32
- * @param {AgentPhone.WebhookCreateRequest} request
33
+ * @param {AgentPhone.CreateOrUpdateWebhookV1WebhooksPostRequest} request
33
34
  * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
34
35
  *
35
36
  * @throws {@link AgentPhone.UnprocessableEntityError}
36
37
  *
37
38
  * @example
38
39
  * await client.webhooks.createOrUpdateWebhook({
39
- * url: "url"
40
+ * body: {
41
+ * url: "url"
42
+ * }
40
43
  * })
41
44
  */
42
- createOrUpdateWebhook(request: AgentPhone.WebhookCreateRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentPhone.WebhookResponse>;
45
+ createOrUpdateWebhook(request: AgentPhone.CreateOrUpdateWebhookV1WebhooksPostRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<AgentPhone.WebhookResponse>;
43
46
  private __createOrUpdateWebhook;
44
47
  /**
45
48
  * Remove the master webhook for this account.
@@ -58,19 +58,21 @@ class WebhooksClient {
58
58
  /**
59
59
  * Get the master webhook configuration for this account.
60
60
  *
61
+ * @param {AgentPhone.GetWebhookV1WebhooksGetRequest} request
61
62
  * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
62
63
  *
63
64
  * @example
64
65
  * await client.webhooks.getWebhook()
65
66
  */
66
- getWebhook(requestOptions) {
67
- return core.HttpResponsePromise.fromPromise(this.__getWebhook(requestOptions));
67
+ getWebhook(request = {}, requestOptions) {
68
+ return core.HttpResponsePromise.fromPromise(this.__getWebhook(request, requestOptions));
68
69
  }
69
- __getWebhook(requestOptions) {
70
- return __awaiter(this, void 0, void 0, function* () {
70
+ __getWebhook() {
71
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
71
72
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
73
+ const { "X-Sub-Account-Id": subAccountId } = request;
72
74
  const _authRequest = yield this._options.authProvider.getAuthRequest();
73
- 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);
75
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
74
76
  const _response = yield core.fetcher({
75
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/webhooks"),
76
78
  method: "GET",
@@ -104,14 +106,16 @@ class WebhooksClient {
104
106
  * contextLimit: Number of recent messages to include in webhook payloads (0-50, default: 10).
105
107
  * Set to 0 to disable history in webhooks.
106
108
  *
107
- * @param {AgentPhone.WebhookCreateRequest} request
109
+ * @param {AgentPhone.CreateOrUpdateWebhookV1WebhooksPostRequest} request
108
110
  * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
109
111
  *
110
112
  * @throws {@link AgentPhone.UnprocessableEntityError}
111
113
  *
112
114
  * @example
113
115
  * await client.webhooks.createOrUpdateWebhook({
114
- * url: "url"
116
+ * body: {
117
+ * url: "url"
118
+ * }
115
119
  * })
116
120
  */
117
121
  createOrUpdateWebhook(request, requestOptions) {
@@ -120,8 +124,9 @@ class WebhooksClient {
120
124
  __createOrUpdateWebhook(request, requestOptions) {
121
125
  return __awaiter(this, void 0, void 0, function* () {
122
126
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
127
+ const { "X-Sub-Account-Id": subAccountId, body: _body } = request;
123
128
  const _authRequest = yield this._options.authProvider.getAuthRequest();
124
- 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);
129
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
125
130
  const _response = yield core.fetcher({
126
131
  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/webhooks"),
127
132
  method: "POST",
@@ -129,7 +134,7 @@ class WebhooksClient {
129
134
  contentType: "application/json",
130
135
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
131
136
  requestType: "json",
132
- body: request,
137
+ body: _body,
133
138
  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,
134
139
  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,
135
140
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -0,0 +1,14 @@
1
+ import type * as AgentPhone from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * body: {
6
+ * url: "url"
7
+ * }
8
+ * }
9
+ */
10
+ export interface CreateOrUpdateWebhookV1WebhooksPostRequest {
11
+ /** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
12
+ "X-Sub-Account-Id"?: string;
13
+ body: AgentPhone.WebhookCreateRequest;
14
+ }
@@ -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
+ /**
2
+ * @example
3
+ * {}
4
+ */
5
+ export interface GetWebhookV1WebhooksGetRequest {
6
+ /** Target a sub-account. Pass a sub-account ID to scope this request. Omit to use the master account. */
7
+ "X-Sub-Account-Id"?: string;
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 });
@@ -1,3 +1,5 @@
1
+ export type { CreateOrUpdateWebhookV1WebhooksPostRequest } from "./CreateOrUpdateWebhookV1WebhooksPostRequest.js";
1
2
  export type { DeliveryStatsV1WebhooksDeliveriesStatsGetRequest } from "./DeliveryStatsV1WebhooksDeliveriesStatsGetRequest.js";
3
+ export type { GetWebhookV1WebhooksGetRequest } from "./GetWebhookV1WebhooksGetRequest.js";
2
4
  export type { ListDeliveriesV1WebhooksDeliveriesGetRequest } from "./ListDeliveriesV1WebhooksDeliveriesGetRequest.js";
3
5
  export type { TestWebhookV1WebhooksTestPostRequest } from "./TestWebhookV1WebhooksTestPostRequest.js";
@@ -25,6 +25,8 @@ export interface AgentResponse {
25
25
  interruptionSensitivity?: number;
26
26
  /** When true, the agent interjects short filler words like 'uh-huh' or 'mhmm' during longer caller utterances. Defaults to true. */
27
27
  enableBackchannel?: boolean;
28
+ /** BCP-47 locale that drives the agent's speech recognition and pronunciation. Defaults to 'en-US'. */
29
+ language?: string;
28
30
  createdAt: string;
29
31
  numbers?: AgentPhone.AgentNumberResponse[] | null;
30
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 });
@@ -1,9 +1,15 @@
1
+ import type * as AgentPhone from "../index.js";
1
2
  export interface AppRoutesConversationsConversationSummary {
2
3
  id: string;
3
4
  agentId?: string | null;
4
5
  phoneNumberId: string;
5
6
  phoneNumber: string;
6
7
  participant: string;
8
+ isGroup?: boolean;
9
+ groupId?: string | null;
10
+ groupName?: string | null;
11
+ groupIconUrl?: string | null;
12
+ participants?: AgentPhone.GroupParticipant[] | null;
7
13
  lastMessageAt: string;
8
14
  lastMessagePreview: string;
9
15
  messageCount: number;
@@ -5,6 +5,11 @@ export interface ConversationDetail {
5
5
  phoneNumberId: string;
6
6
  phoneNumber: string;
7
7
  participant: string;
8
+ isGroup?: boolean;
9
+ groupId?: string | null;
10
+ groupName?: string | null;
11
+ groupIconUrl?: string | null;
12
+ participants?: AgentPhone.GroupParticipant[] | null;
8
13
  lastMessageAt: string;
9
14
  messageCount: number;
10
15
  metadata?: Record<string, unknown> | null;