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.
- package/README.md +10 -10
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -6
- package/dist/cjs/Client.js +26 -26
- package/dist/cjs/api/resources/agents/client/Client.js +11 -11
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +71 -0
- package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +66 -0
- package/dist/cjs/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +71 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +66 -0
- package/dist/cjs/api/resources/calls/client/Client.js +16 -5
- package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
- package/dist/cjs/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/contacts/client/Client.js +2 -3
- package/dist/cjs/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/conversations/client/Client.js +7 -6
- package/dist/cjs/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/index.d.ts +4 -4
- package/dist/cjs/api/resources/index.js +5 -5
- package/dist/cjs/api/resources/numbers/client/Client.js +18 -7
- package/dist/cjs/api/resources/numbers/client/requests/CreateNumberRequest.d.ts +2 -0
- package/dist/cjs/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.ts +2 -0
- package/dist/cjs/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.ts +2 -1
- package/dist/cjs/api/resources/registration/client/Client.d.ts +61 -0
- package/dist/cjs/api/resources/{agentSignup → registration}/client/Client.js +44 -69
- package/dist/cjs/api/resources/registration/client/requests/RegistrationRequest.d.ts +61 -0
- package/dist/cjs/api/resources/registration/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/subAccounts/client/Client.d.ts +61 -0
- package/dist/cjs/api/resources/{integrations → subAccounts}/client/Client.js +99 -106
- package/dist/cjs/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.ts +9 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.ts +9 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.ts +11 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.js +3 -0
- package/dist/cjs/api/resources/subAccounts/client/requests/index.d.ts +3 -0
- package/dist/cjs/api/resources/webhooks/client/Client.d.ts +7 -4
- package/dist/cjs/api/resources/webhooks/client/Client.js +14 -9
- package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.ts +14 -0
- package/dist/cjs/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.ts +8 -0
- package/dist/cjs/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.js +3 -0
- package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/types/AgentResponse.d.ts +2 -0
- package/dist/cjs/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.ts +0 -6
- package/dist/cjs/api/types/AgentSignUpRequest.js +3 -0
- package/dist/cjs/api/types/AgentVerifyRequest.d.ts +4 -0
- package/dist/cjs/api/types/AgentVerifyRequest.js +3 -0
- package/dist/cjs/api/types/AppRoutesConversationsConversationSummary.d.ts +6 -0
- package/dist/cjs/api/types/ConversationDetail.d.ts +5 -0
- package/dist/cjs/api/types/FieldWarning.d.ts +6 -0
- package/dist/cjs/api/types/FieldWarning.js +3 -0
- package/dist/cjs/api/types/GroupParticipant.d.ts +7 -0
- package/dist/cjs/api/types/GroupParticipant.js +3 -0
- package/dist/cjs/api/types/MessageInConversation.d.ts +1 -0
- package/dist/cjs/api/types/RegistrationResponse.d.ts +8 -0
- package/dist/cjs/api/types/RegistrationResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +5 -0
- package/dist/cjs/api/types/index.js +5 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +6 -6
- package/dist/esm/Client.mjs +10 -10
- package/dist/esm/api/resources/agents/client/Client.mjs +12 -12
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +71 -0
- package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +66 -0
- package/dist/esm/api/resources/agents/client/requests/DeleteAgentV1AgentsAgentIdDeleteRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/GetAgentV1AgentsAgentIdGetRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/ListAgentsV1AgentsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +71 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +66 -0
- package/dist/esm/api/resources/calls/client/Client.mjs +17 -6
- package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
- package/dist/esm/api/resources/calls/client/requests/ListCallsV1CallsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/contacts/client/Client.mjs +3 -4
- package/dist/esm/api/resources/contacts/client/requests/ListContactsV1ContactsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/conversations/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/conversations/client/Client.mjs +8 -7
- package/dist/esm/api/resources/conversations/client/requests/ListConversationsV1ConversationsGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/index.d.mts +4 -4
- package/dist/esm/api/resources/index.mjs +4 -4
- package/dist/esm/api/resources/numbers/client/Client.mjs +19 -8
- package/dist/esm/api/resources/numbers/client/requests/CreateNumberRequest.d.mts +2 -0
- package/dist/esm/api/resources/numbers/client/requests/DeleteNumberV1NumbersNumberIdDeleteRequest.d.mts +2 -0
- package/dist/esm/api/resources/numbers/client/requests/ListNumbersV1NumbersGetRequest.d.mts +2 -1
- package/dist/esm/api/resources/registration/client/Client.d.mts +61 -0
- package/dist/esm/api/resources/registration/client/Client.mjs +108 -0
- package/dist/esm/api/resources/registration/client/requests/RegistrationRequest.d.mts +61 -0
- package/dist/esm/api/resources/registration/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/subAccounts/client/Client.d.mts +61 -0
- package/dist/esm/api/resources/{integrations → subAccounts}/client/Client.mjs +97 -104
- package/dist/esm/api/resources/subAccounts/client/requests/CreateSubAccountRequest.d.mts +9 -0
- package/dist/esm/api/resources/subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.d.mts +9 -0
- package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.d.mts +11 -0
- package/dist/esm/api/resources/subAccounts/client/requests/UpdateSubAccountRequest.mjs +2 -0
- package/dist/esm/api/resources/subAccounts/client/requests/index.d.mts +3 -0
- package/dist/esm/api/resources/webhooks/client/Client.d.mts +7 -4
- package/dist/esm/api/resources/webhooks/client/Client.mjs +15 -10
- package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.d.mts +14 -0
- package/dist/esm/api/resources/webhooks/client/requests/CreateOrUpdateWebhookV1WebhooksPostRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.d.mts +8 -0
- package/dist/esm/api/resources/webhooks/client/requests/GetWebhookV1WebhooksGetRequest.mjs +2 -0
- package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +2 -0
- package/dist/esm/api/types/AgentResponse.d.mts +2 -0
- package/dist/esm/api/{resources/agentSignup/client/requests → types}/AgentSignUpRequest.d.mts +0 -6
- package/dist/esm/api/types/AgentSignUpRequest.mjs +2 -0
- package/dist/esm/api/types/AgentVerifyRequest.d.mts +4 -0
- package/dist/esm/api/types/AgentVerifyRequest.mjs +2 -0
- package/dist/esm/api/types/AppRoutesConversationsConversationSummary.d.mts +6 -0
- package/dist/esm/api/types/ConversationDetail.d.mts +5 -0
- package/dist/esm/api/types/FieldWarning.d.mts +6 -0
- package/dist/esm/api/types/FieldWarning.mjs +2 -0
- package/dist/esm/api/types/GroupParticipant.d.mts +7 -0
- package/dist/esm/api/types/GroupParticipant.mjs +2 -0
- package/dist/esm/api/types/MessageInConversation.d.mts +1 -0
- package/dist/esm/api/types/RegistrationResponse.d.mts +8 -0
- package/dist/esm/api/types/RegistrationResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +5 -0
- package/dist/esm/api/types/index.mjs +5 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +188 -277
- package/dist/cjs/api/resources/agentSignup/client/Client.d.ts +0 -50
- package/dist/cjs/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.ts +0 -11
- package/dist/cjs/api/resources/agentSignup/client/requests/index.d.ts +0 -2
- package/dist/cjs/api/resources/integrations/client/Client.d.ts +0 -64
- package/dist/cjs/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.ts +0 -9
- package/dist/cjs/api/resources/integrations/client/requests/index.d.ts +0 -1
- package/dist/esm/api/resources/agentSignup/client/Client.d.mts +0 -50
- package/dist/esm/api/resources/agentSignup/client/Client.mjs +0 -133
- package/dist/esm/api/resources/agentSignup/client/requests/AgentVerifyRequest.d.mts +0 -11
- package/dist/esm/api/resources/agentSignup/client/requests/index.d.mts +0 -2
- package/dist/esm/api/resources/integrations/client/Client.d.mts +0 -64
- package/dist/esm/api/resources/integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.d.mts +0 -9
- package/dist/esm/api/resources/integrations/client/requests/index.d.mts +0 -1
- /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentSignUpRequest.js → registration/client/requests/RegistrationRequest.js} +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{agentSignup → registration}/index.js +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/client/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/client/index.js +0 -0
- /package/dist/cjs/api/resources/{agentSignup/client/requests/AgentVerifyRequest.js → subAccounts/client/requests/CreateSubAccountRequest.js} +0 -0
- /package/dist/cjs/api/resources/{integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.js → subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.js} +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/client/requests/index.js +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/index.d.ts +0 -0
- /package/dist/cjs/api/resources/{integrations → subAccounts}/index.js +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{agentSignup/client/requests/AgentSignUpRequest.mjs → registration/client/requests/RegistrationRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/index.d.mts +0 -0
- /package/dist/esm/api/resources/{agentSignup → registration}/index.mjs +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/client/index.d.mts +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/client/index.mjs +0 -0
- /package/dist/esm/api/resources/{agentSignup/client/requests/AgentVerifyRequest.mjs → subAccounts/client/requests/CreateSubAccountRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{integrations/client/requests/SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs → subAccounts/client/requests/DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest.mjs} +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/client/requests/index.mjs +0 -0
- /package/dist/esm/api/resources/{integrations → subAccounts}/index.d.mts +0 -0
- /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.
|
|
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
|
|
65
|
+
class SubAccountsClient {
|
|
55
66
|
constructor(options = {}) {
|
|
56
67
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
68
|
}
|
|
58
69
|
/**
|
|
59
|
-
*
|
|
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.
|
|
73
|
+
* await client.subAccounts.listSubAccounts()
|
|
118
74
|
*/
|
|
119
|
-
|
|
120
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
75
|
+
listSubAccounts(requestOptions) {
|
|
76
|
+
return core.HttpResponsePromise.fromPromise(this.__listSubAccounts(requestOptions));
|
|
121
77
|
}
|
|
122
|
-
|
|
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, "
|
|
129
|
-
method: "
|
|
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, "
|
|
104
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/sub-accounts");
|
|
149
105
|
});
|
|
150
106
|
}
|
|
151
107
|
/**
|
|
152
|
-
* @param {
|
|
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.
|
|
114
|
+
* await client.subAccounts.createSubAccount({
|
|
115
|
+
* name: "name"
|
|
116
|
+
* })
|
|
156
117
|
*/
|
|
157
|
-
|
|
158
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
118
|
+
createSubAccount(request, requestOptions) {
|
|
119
|
+
return core.HttpResponsePromise.fromPromise(this.__createSubAccount(request, requestOptions));
|
|
159
120
|
}
|
|
160
|
-
|
|
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, "
|
|
167
|
-
method: "
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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, "
|
|
155
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/sub-accounts");
|
|
187
156
|
});
|
|
188
157
|
}
|
|
189
158
|
/**
|
|
190
|
-
*
|
|
159
|
+
* @param {AgentPhone.DeleteSubAccountV1SubAccountsSubAccountIdDeleteRequest} request
|
|
160
|
+
* @param {SubAccountsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
191
161
|
*
|
|
192
|
-
* @
|
|
162
|
+
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
193
163
|
*
|
|
194
164
|
* @example
|
|
195
|
-
* await client.
|
|
165
|
+
* await client.subAccounts.deleteSubAccount({
|
|
166
|
+
* sub_account_id: "sub_account_id"
|
|
167
|
+
* })
|
|
196
168
|
*/
|
|
197
|
-
|
|
198
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
169
|
+
deleteSubAccount(request, requestOptions) {
|
|
170
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteSubAccount(request, requestOptions));
|
|
199
171
|
}
|
|
200
|
-
|
|
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,
|
|
207
|
-
method: "
|
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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, "
|
|
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 {
|
|
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.
|
|
214
|
+
* await client.subAccounts.updateSubAccount({
|
|
215
|
+
* sub_account_id: "sub_account_id",
|
|
216
|
+
* name: "name"
|
|
217
|
+
* })
|
|
234
218
|
*/
|
|
235
|
-
|
|
236
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
219
|
+
updateSubAccount(request, requestOptions) {
|
|
220
|
+
return core.HttpResponsePromise.fromPromise(this.__updateSubAccount(request, requestOptions));
|
|
237
221
|
}
|
|
238
|
-
|
|
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,
|
|
245
|
-
method: "
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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, "
|
|
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.
|
|
261
|
+
exports.SubAccountsClient = SubAccountsClient;
|
|
@@ -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.
|
|
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
|
-
*
|
|
40
|
+
* body: {
|
|
41
|
+
* url: "url"
|
|
42
|
+
* }
|
|
40
43
|
* })
|
|
41
44
|
*/
|
|
42
|
-
createOrUpdateWebhook(request: AgentPhone.
|
|
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(
|
|
70
|
-
return __awaiter(this,
|
|
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.
|
|
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
|
-
*
|
|
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:
|
|
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
|
+
}
|
|
@@ -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,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;
|