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
+ /**
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 @@
1
+ export type { RegistrationRequest } from "./RegistrationRequest.mjs";
@@ -0,0 +1,61 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as AgentPhone from "../../../index.mjs";
5
+ export declare namespace 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
+ }
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
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
+ };
11
22
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
23
  import { mergeHeaders } from "../../../../core/headers.mjs";
13
24
  import * as core from "../../../../core/index.mjs";
@@ -15,82 +26,27 @@ import * as environments from "../../../../environments.mjs";
15
26
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
27
  import * as errors from "../../../../errors/index.mjs";
17
28
  import * as AgentPhone from "../../../index.mjs";
18
- export class IntegrationsClient {
29
+ export class SubAccountsClient {
19
30
  constructor(options = {}) {
20
31
  this._options = normalizeClientOptionsWithAuth(options);
21
32
  }
22
33
  /**
23
- * Exchange a one-time connect code and redirect to Supabase OAuth.
24
- *
25
- * @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
26
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
27
- *
28
- * @throws {@link AgentPhone.UnprocessableEntityError}
29
- *
30
- * @example
31
- * await client.integrations.supabaseConnect({
32
- * code: "code"
33
- * })
34
- */
35
- supabaseConnect(request, requestOptions) {
36
- return core.HttpResponsePromise.fromPromise(this.__supabaseConnect(request, requestOptions));
37
- }
38
- __supabaseConnect(request, requestOptions) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
41
- const { code } = request;
42
- const _queryParams = {
43
- code,
44
- };
45
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
46
- const _response = yield core.fetcher({
47
- 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"),
48
- method: "GET",
49
- headers: _headers,
50
- queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
51
- 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,
52
- 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,
53
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
54
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
55
- logging: this._options.logging,
56
- });
57
- if (_response.ok) {
58
- return { data: _response.body, rawResponse: _response.rawResponse };
59
- }
60
- if (_response.error.reason === "status-code") {
61
- switch (_response.error.statusCode) {
62
- case 422:
63
- throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
64
- default:
65
- throw new errors.AgentPhoneError({
66
- statusCode: _response.error.statusCode,
67
- body: _response.error.body,
68
- rawResponse: _response.rawResponse,
69
- });
70
- }
71
- }
72
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/integrations/supabase/connect");
73
- });
74
- }
75
- /**
76
- * Create a short-lived one-time code for initiating the Supabase OAuth flow.
77
- *
78
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
34
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
79
35
  *
80
36
  * @example
81
- * await client.integrations.supabaseConnectCode()
37
+ * await client.subAccounts.listSubAccounts()
82
38
  */
83
- supabaseConnectCode(requestOptions) {
84
- return core.HttpResponsePromise.fromPromise(this.__supabaseConnectCode(requestOptions));
39
+ listSubAccounts(requestOptions) {
40
+ return core.HttpResponsePromise.fromPromise(this.__listSubAccounts(requestOptions));
85
41
  }
86
- __supabaseConnectCode(requestOptions) {
42
+ __listSubAccounts(requestOptions) {
87
43
  return __awaiter(this, void 0, void 0, function* () {
88
44
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
89
45
  const _authRequest = yield this._options.authProvider.getAuthRequest();
90
46
  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);
91
47
  const _response = yield core.fetcher({
92
- 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"),
93
- method: "POST",
48
+ 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"),
49
+ method: "GET",
94
50
  headers: _headers,
95
51
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
96
52
  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,
@@ -109,28 +65,36 @@ export class IntegrationsClient {
109
65
  rawResponse: _response.rawResponse,
110
66
  });
111
67
  }
112
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/integrations/supabase/connect");
68
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/sub-accounts");
113
69
  });
114
70
  }
115
71
  /**
116
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
72
+ * @param {AgentPhone.CreateSubAccountRequest} request
73
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
74
+ *
75
+ * @throws {@link AgentPhone.UnprocessableEntityError}
117
76
  *
118
77
  * @example
119
- * await client.integrations.supabaseStatus()
78
+ * await client.subAccounts.createSubAccount({
79
+ * name: "name"
80
+ * })
120
81
  */
121
- supabaseStatus(requestOptions) {
122
- return core.HttpResponsePromise.fromPromise(this.__supabaseStatus(requestOptions));
82
+ createSubAccount(request, requestOptions) {
83
+ return core.HttpResponsePromise.fromPromise(this.__createSubAccount(request, requestOptions));
123
84
  }
124
- __supabaseStatus(requestOptions) {
85
+ __createSubAccount(request, requestOptions) {
125
86
  return __awaiter(this, void 0, void 0, function* () {
126
87
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
127
88
  const _authRequest = yield this._options.authProvider.getAuthRequest();
128
89
  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);
129
90
  const _response = yield core.fetcher({
130
- 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"),
131
- method: "GET",
91
+ 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"),
92
+ method: "POST",
132
93
  headers: _headers,
94
+ contentType: "application/json",
133
95
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
96
+ requestType: "json",
97
+ body: request,
134
98
  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,
135
99
  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,
136
100
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -141,34 +105,43 @@ export class IntegrationsClient {
141
105
  return { data: _response.body, rawResponse: _response.rawResponse };
142
106
  }
143
107
  if (_response.error.reason === "status-code") {
144
- throw new errors.AgentPhoneError({
145
- statusCode: _response.error.statusCode,
146
- body: _response.error.body,
147
- rawResponse: _response.rawResponse,
148
- });
108
+ switch (_response.error.statusCode) {
109
+ case 422:
110
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
111
+ default:
112
+ throw new errors.AgentPhoneError({
113
+ statusCode: _response.error.statusCode,
114
+ body: _response.error.body,
115
+ rawResponse: _response.rawResponse,
116
+ });
117
+ }
149
118
  }
150
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/integrations/supabase/status");
119
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/sub-accounts");
151
120
  });
152
121
  }
153
122
  /**
154
- * Get a valid Supabase access token, auto-refreshing if expired.
123
+ * @param {AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest} request
124
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
155
125
  *
156
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
126
+ * @throws {@link AgentPhone.UnprocessableEntityError}
157
127
  *
158
128
  * @example
159
- * await client.integrations.supabaseToken()
129
+ * await client.subAccounts.deleteSubAccount({
130
+ * sub_account_id: "sub_account_id"
131
+ * })
160
132
  */
161
- supabaseToken(requestOptions) {
162
- return core.HttpResponsePromise.fromPromise(this.__supabaseToken(requestOptions));
133
+ deleteSubAccount(request, requestOptions) {
134
+ return core.HttpResponsePromise.fromPromise(this.__deleteSubAccount(request, requestOptions));
163
135
  }
164
- __supabaseToken(requestOptions) {
136
+ __deleteSubAccount(request, requestOptions) {
165
137
  return __awaiter(this, void 0, void 0, function* () {
166
138
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
139
+ const { sub_account_id: subAccountId } = request;
167
140
  const _authRequest = yield this._options.authProvider.getAuthRequest();
168
141
  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);
169
142
  const _response = yield core.fetcher({
170
- 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"),
171
- method: "GET",
143
+ 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)}`),
144
+ method: "DELETE",
172
145
  headers: _headers,
173
146
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
174
147
  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,
@@ -181,34 +154,49 @@ export class IntegrationsClient {
181
154
  return { data: _response.body, rawResponse: _response.rawResponse };
182
155
  }
183
156
  if (_response.error.reason === "status-code") {
184
- throw new errors.AgentPhoneError({
185
- statusCode: _response.error.statusCode,
186
- body: _response.error.body,
187
- rawResponse: _response.rawResponse,
188
- });
157
+ switch (_response.error.statusCode) {
158
+ case 422:
159
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
160
+ default:
161
+ throw new errors.AgentPhoneError({
162
+ statusCode: _response.error.statusCode,
163
+ body: _response.error.body,
164
+ rawResponse: _response.rawResponse,
165
+ });
166
+ }
189
167
  }
190
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/integrations/supabase/token");
168
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/sub-accounts/{sub_account_id}");
191
169
  });
192
170
  }
193
171
  /**
194
- * @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
172
+ * @param {AgentPhone.UpdateSubAccountRequest} request
173
+ * @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
174
+ *
175
+ * @throws {@link AgentPhone.UnprocessableEntityError}
195
176
  *
196
177
  * @example
197
- * await client.integrations.supabaseDisconnect()
178
+ * await client.subAccounts.updateSubAccount({
179
+ * sub_account_id: "sub_account_id",
180
+ * name: "name"
181
+ * })
198
182
  */
199
- supabaseDisconnect(requestOptions) {
200
- return core.HttpResponsePromise.fromPromise(this.__supabaseDisconnect(requestOptions));
183
+ updateSubAccount(request, requestOptions) {
184
+ return core.HttpResponsePromise.fromPromise(this.__updateSubAccount(request, requestOptions));
201
185
  }
202
- __supabaseDisconnect(requestOptions) {
186
+ __updateSubAccount(request, requestOptions) {
203
187
  return __awaiter(this, void 0, void 0, function* () {
204
188
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
189
+ const { sub_account_id: subAccountId } = request, _body = __rest(request, ["sub_account_id"]);
205
190
  const _authRequest = yield this._options.authProvider.getAuthRequest();
206
191
  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);
207
192
  const _response = yield core.fetcher({
208
- 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"),
209
- method: "DELETE",
193
+ 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)}`),
194
+ method: "PATCH",
210
195
  headers: _headers,
196
+ contentType: "application/json",
211
197
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
198
+ requestType: "json",
199
+ body: _body,
212
200
  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,
213
201
  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,
214
202
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -219,13 +207,18 @@ export class IntegrationsClient {
219
207
  return { data: _response.body, rawResponse: _response.rawResponse };
220
208
  }
221
209
  if (_response.error.reason === "status-code") {
222
- throw new errors.AgentPhoneError({
223
- statusCode: _response.error.statusCode,
224
- body: _response.error.body,
225
- rawResponse: _response.rawResponse,
226
- });
210
+ switch (_response.error.statusCode) {
211
+ case 422:
212
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
213
+ default:
214
+ throw new errors.AgentPhoneError({
215
+ statusCode: _response.error.statusCode,
216
+ body: _response.error.body,
217
+ rawResponse: _response.rawResponse,
218
+ });
219
+ }
227
220
  }
228
- return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/integrations/supabase");
221
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/sub-accounts/{sub_account_id}");
229
222
  });
230
223
  }
231
224
  }
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { CreateSubAccountRequest } from "./CreateSubAccountRequest.mjs";
2
+ export type { DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest } from "./DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.mjs";
3
+ export type { UpdateSubAccountRequest } from "./UpdateSubAccountRequest.mjs";
@@ -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.
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
- import { mergeHeaders } from "../../../../core/headers.mjs";
12
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
13
13
  import * as core from "../../../../core/index.mjs";
14
14
  import * as environments from "../../../../environments.mjs";
15
15
  import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
@@ -22,19 +22,21 @@ export class WebhooksClient {
22
22
  /**
23
23
  * Get the master webhook configuration for this account.
24
24
  *
25
+ * @param {AgentPhone.GetWebhookV1WebhooksGetRequest} request
25
26
  * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
26
27
  *
27
28
  * @example
28
29
  * await client.webhooks.getWebhook()
29
30
  */
30
- getWebhook(requestOptions) {
31
- return core.HttpResponsePromise.fromPromise(this.__getWebhook(requestOptions));
31
+ getWebhook(request = {}, requestOptions) {
32
+ return core.HttpResponsePromise.fromPromise(this.__getWebhook(request, requestOptions));
32
33
  }
33
- __getWebhook(requestOptions) {
34
- return __awaiter(this, void 0, void 0, function* () {
34
+ __getWebhook() {
35
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
35
36
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
37
+ const { "X-Sub-Account-Id": subAccountId } = request;
36
38
  const _authRequest = yield this._options.authProvider.getAuthRequest();
37
- 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);
39
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
38
40
  const _response = yield core.fetcher({
39
41
  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"),
40
42
  method: "GET",
@@ -68,14 +70,16 @@ export class WebhooksClient {
68
70
  * contextLimit: Number of recent messages to include in webhook payloads (0-50, default: 10).
69
71
  * Set to 0 to disable history in webhooks.
70
72
  *
71
- * @param {AgentPhone.WebhookCreateRequest} request
73
+ * @param {AgentPhone.CreateOrUpdateWebhookV1WebhooksPostRequest} request
72
74
  * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
73
75
  *
74
76
  * @throws {@link AgentPhone.UnprocessableEntityError}
75
77
  *
76
78
  * @example
77
79
  * await client.webhooks.createOrUpdateWebhook({
78
- * url: "url"
80
+ * body: {
81
+ * url: "url"
82
+ * }
79
83
  * })
80
84
  */
81
85
  createOrUpdateWebhook(request, requestOptions) {
@@ -84,8 +88,9 @@ export class WebhooksClient {
84
88
  __createOrUpdateWebhook(request, requestOptions) {
85
89
  return __awaiter(this, void 0, void 0, function* () {
86
90
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
91
+ const { "X-Sub-Account-Id": subAccountId, body: _body } = request;
87
92
  const _authRequest = yield this._options.authProvider.getAuthRequest();
88
- 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);
93
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Sub-Account-Id": subAccountId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
89
94
  const _response = yield core.fetcher({
90
95
  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"),
91
96
  method: "POST",
@@ -93,7 +98,7 @@ export class WebhooksClient {
93
98
  contentType: "application/json",
94
99
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
95
100
  requestType: "json",
96
- body: request,
101
+ body: _body,
97
102
  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,
98
103
  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,
99
104
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -0,0 +1,14 @@
1
+ import type * as AgentPhone from "../../../../index.mjs";
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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -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,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,3 +1,5 @@
1
+ export type { CreateOrUpdateWebhookV1WebhooksPostRequest } from "./CreateOrUpdateWebhookV1WebhooksPostRequest.mjs";
1
2
  export type { DeliveryStatsV1WebhooksDeliveriesStatsGetRequest } from "./DeliveryStatsV1WebhooksDeliveriesStatsGetRequest.mjs";
3
+ export type { GetWebhookV1WebhooksGetRequest } from "./GetWebhookV1WebhooksGetRequest.mjs";
2
4
  export type { ListDeliveriesV1WebhooksDeliveriesGetRequest } from "./ListDeliveriesV1WebhooksDeliveriesGetRequest.mjs";
3
5
  export type { TestWebhookV1WebhooksTestPostRequest } from "./TestWebhookV1WebhooksTestPostRequest.mjs";
@@ -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
  }