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
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
-
import { type NormalizedClientOptions } from "../../../../BaseClient.js";
|
|
3
|
-
import * as core from "../../../../core/index.js";
|
|
4
|
-
import * as AgentPhone from "../../../index.js";
|
|
5
|
-
export declare namespace AgentSignupClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class AgentSignupClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptions<AgentSignupClient.Options>;
|
|
12
|
-
constructor(options?: AgentSignupClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* Kick off agent self-signup.
|
|
15
|
-
*
|
|
16
|
-
* Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
|
|
17
|
-
* until /v0/agent/verify is called with the code.
|
|
18
|
-
*
|
|
19
|
-
* @param {AgentPhone.AgentSignUpRequest} request
|
|
20
|
-
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
|
-
*
|
|
22
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* await client.agentSignup.agentSignUp({
|
|
26
|
-
* human_email: "human_email"
|
|
27
|
-
* })
|
|
28
|
-
*/
|
|
29
|
-
agentSignUp(request: AgentPhone.AgentSignUpRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
30
|
-
private __agentSignUp;
|
|
31
|
-
/**
|
|
32
|
-
* Verify the OTP and atomically provision everything.
|
|
33
|
-
*
|
|
34
|
-
* Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
|
|
35
|
-
* + first-month charge + API key. Returns the key once — agents must save it.
|
|
36
|
-
*
|
|
37
|
-
* @param {AgentPhone.AgentVerifyRequest} request
|
|
38
|
-
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
-
*
|
|
40
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* await client.agentSignup.agentVerify({
|
|
44
|
-
* verification_id: "verification_id",
|
|
45
|
-
* otp_code: "otp_code"
|
|
46
|
-
* })
|
|
47
|
-
*/
|
|
48
|
-
agentVerify(request: AgentPhone.AgentVerifyRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
49
|
-
private __agentVerify;
|
|
50
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
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 IntegrationsClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class IntegrationsClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<IntegrationsClient.Options>;
|
|
12
|
-
constructor(options?: IntegrationsClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* Exchange a one-time connect code and redirect to Supabase OAuth.
|
|
15
|
-
*
|
|
16
|
-
* @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
|
|
17
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
-
*
|
|
19
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* await client.integrations.supabaseConnect({
|
|
23
|
-
* code: "code"
|
|
24
|
-
* })
|
|
25
|
-
*/
|
|
26
|
-
supabaseConnect(request: AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest, requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
27
|
-
private __supabaseConnect;
|
|
28
|
-
/**
|
|
29
|
-
* Create a short-lived one-time code for initiating the Supabase OAuth flow.
|
|
30
|
-
*
|
|
31
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* await client.integrations.supabaseConnectCode()
|
|
35
|
-
*/
|
|
36
|
-
supabaseConnectCode(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
37
|
-
private __supabaseConnectCode;
|
|
38
|
-
/**
|
|
39
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* await client.integrations.supabaseStatus()
|
|
43
|
-
*/
|
|
44
|
-
supabaseStatus(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
45
|
-
private __supabaseStatus;
|
|
46
|
-
/**
|
|
47
|
-
* Get a valid Supabase access token, auto-refreshing if expired.
|
|
48
|
-
*
|
|
49
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* await client.integrations.supabaseToken()
|
|
53
|
-
*/
|
|
54
|
-
supabaseToken(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
55
|
-
private __supabaseToken;
|
|
56
|
-
/**
|
|
57
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* await client.integrations.supabaseDisconnect()
|
|
61
|
-
*/
|
|
62
|
-
supabaseDisconnect(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
63
|
-
private __supabaseDisconnect;
|
|
64
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { SupabaseConnectIntegrationsSupabaseConnectGetRequest } from "./SupabaseConnectIntegrationsSupabaseConnectGetRequest.js";
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type NormalizedClientOptions } from "../../../../BaseClient.mjs";
|
|
3
|
-
import * as core from "../../../../core/index.mjs";
|
|
4
|
-
import * as AgentPhone from "../../../index.mjs";
|
|
5
|
-
export declare namespace AgentSignupClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class AgentSignupClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptions<AgentSignupClient.Options>;
|
|
12
|
-
constructor(options?: AgentSignupClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* Kick off agent self-signup.
|
|
15
|
-
*
|
|
16
|
-
* Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
|
|
17
|
-
* until /v0/agent/verify is called with the code.
|
|
18
|
-
*
|
|
19
|
-
* @param {AgentPhone.AgentSignUpRequest} request
|
|
20
|
-
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
21
|
-
*
|
|
22
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* await client.agentSignup.agentSignUp({
|
|
26
|
-
* human_email: "human_email"
|
|
27
|
-
* })
|
|
28
|
-
*/
|
|
29
|
-
agentSignUp(request: AgentPhone.AgentSignUpRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
30
|
-
private __agentSignUp;
|
|
31
|
-
/**
|
|
32
|
-
* Verify the OTP and atomically provision everything.
|
|
33
|
-
*
|
|
34
|
-
* Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
|
|
35
|
-
* + first-month charge + API key. Returns the key once — agents must save it.
|
|
36
|
-
*
|
|
37
|
-
* @param {AgentPhone.AgentVerifyRequest} request
|
|
38
|
-
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
-
*
|
|
40
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* await client.agentSignup.agentVerify({
|
|
44
|
-
* verification_id: "verification_id",
|
|
45
|
-
* otp_code: "otp_code"
|
|
46
|
-
* })
|
|
47
|
-
*/
|
|
48
|
-
agentVerify(request: AgentPhone.AgentVerifyRequest, requestOptions?: AgentSignupClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
49
|
-
private __agentVerify;
|
|
50
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
import { normalizeClientOptions } from "../../../../BaseClient.mjs";
|
|
12
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
-
import * as core from "../../../../core/index.mjs";
|
|
14
|
-
import * as environments from "../../../../environments.mjs";
|
|
15
|
-
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
-
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
-
import * as AgentPhone from "../../../index.mjs";
|
|
18
|
-
export class AgentSignupClient {
|
|
19
|
-
constructor(options = {}) {
|
|
20
|
-
this._options = normalizeClientOptions(options);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Kick off agent self-signup.
|
|
24
|
-
*
|
|
25
|
-
* Sends a 6-digit OTP to the human's email. Nothing is provisioned server-side
|
|
26
|
-
* until /v0/agent/verify is called with the code.
|
|
27
|
-
*
|
|
28
|
-
* @param {AgentPhone.AgentSignUpRequest} request
|
|
29
|
-
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
30
|
-
*
|
|
31
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* await client.agentSignup.agentSignUp({
|
|
35
|
-
* human_email: "human_email"
|
|
36
|
-
* })
|
|
37
|
-
*/
|
|
38
|
-
agentSignUp(request, requestOptions) {
|
|
39
|
-
return core.HttpResponsePromise.fromPromise(this.__agentSignUp(request, requestOptions));
|
|
40
|
-
}
|
|
41
|
-
__agentSignUp(request, requestOptions) {
|
|
42
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
44
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
45
|
-
const _response = yield core.fetcher({
|
|
46
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v0/agent/sign-up"),
|
|
47
|
-
method: "POST",
|
|
48
|
-
headers: _headers,
|
|
49
|
-
contentType: "application/json",
|
|
50
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
51
|
-
requestType: "json",
|
|
52
|
-
body: request,
|
|
53
|
-
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,
|
|
54
|
-
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,
|
|
55
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
56
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
57
|
-
logging: this._options.logging,
|
|
58
|
-
});
|
|
59
|
-
if (_response.ok) {
|
|
60
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
61
|
-
}
|
|
62
|
-
if (_response.error.reason === "status-code") {
|
|
63
|
-
switch (_response.error.statusCode) {
|
|
64
|
-
case 422:
|
|
65
|
-
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
66
|
-
default:
|
|
67
|
-
throw new errors.AgentPhoneError({
|
|
68
|
-
statusCode: _response.error.statusCode,
|
|
69
|
-
body: _response.error.body,
|
|
70
|
-
rawResponse: _response.rawResponse,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/sign-up");
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Verify the OTP and atomically provision everything.
|
|
79
|
-
*
|
|
80
|
-
* Creates: User + Project (+ mirrored Account) + starter hosted Agent + phone number
|
|
81
|
-
* + first-month charge + API key. Returns the key once — agents must save it.
|
|
82
|
-
*
|
|
83
|
-
* @param {AgentPhone.AgentVerifyRequest} request
|
|
84
|
-
* @param {AgentSignupClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
85
|
-
*
|
|
86
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* await client.agentSignup.agentVerify({
|
|
90
|
-
* verification_id: "verification_id",
|
|
91
|
-
* otp_code: "otp_code"
|
|
92
|
-
* })
|
|
93
|
-
*/
|
|
94
|
-
agentVerify(request, requestOptions) {
|
|
95
|
-
return core.HttpResponsePromise.fromPromise(this.__agentVerify(request, requestOptions));
|
|
96
|
-
}
|
|
97
|
-
__agentVerify(request, requestOptions) {
|
|
98
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
100
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
101
|
-
const _response = yield core.fetcher({
|
|
102
|
-
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentPhoneEnvironment.Production, "v0/agent/verify"),
|
|
103
|
-
method: "POST",
|
|
104
|
-
headers: _headers,
|
|
105
|
-
contentType: "application/json",
|
|
106
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
107
|
-
requestType: "json",
|
|
108
|
-
body: request,
|
|
109
|
-
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,
|
|
110
|
-
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,
|
|
111
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
112
|
-
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
113
|
-
logging: this._options.logging,
|
|
114
|
-
});
|
|
115
|
-
if (_response.ok) {
|
|
116
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
117
|
-
}
|
|
118
|
-
if (_response.error.reason === "status-code") {
|
|
119
|
-
switch (_response.error.statusCode) {
|
|
120
|
-
case 422:
|
|
121
|
-
throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
122
|
-
default:
|
|
123
|
-
throw new errors.AgentPhoneError({
|
|
124
|
-
statusCode: _response.error.statusCode,
|
|
125
|
-
body: _response.error.body,
|
|
126
|
-
rawResponse: _response.rawResponse,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/agent/verify");
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
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 IntegrationsClient {
|
|
6
|
-
type Options = BaseClientOptions;
|
|
7
|
-
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export declare class IntegrationsClient {
|
|
11
|
-
protected readonly _options: NormalizedClientOptionsWithAuth<IntegrationsClient.Options>;
|
|
12
|
-
constructor(options?: IntegrationsClient.Options);
|
|
13
|
-
/**
|
|
14
|
-
* Exchange a one-time connect code and redirect to Supabase OAuth.
|
|
15
|
-
*
|
|
16
|
-
* @param {AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest} request
|
|
17
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
-
*
|
|
19
|
-
* @throws {@link AgentPhone.UnprocessableEntityError}
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* await client.integrations.supabaseConnect({
|
|
23
|
-
* code: "code"
|
|
24
|
-
* })
|
|
25
|
-
*/
|
|
26
|
-
supabaseConnect(request: AgentPhone.SupabaseConnectIntegrationsSupabaseConnectGetRequest, requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
27
|
-
private __supabaseConnect;
|
|
28
|
-
/**
|
|
29
|
-
* Create a short-lived one-time code for initiating the Supabase OAuth flow.
|
|
30
|
-
*
|
|
31
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* await client.integrations.supabaseConnectCode()
|
|
35
|
-
*/
|
|
36
|
-
supabaseConnectCode(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
37
|
-
private __supabaseConnectCode;
|
|
38
|
-
/**
|
|
39
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* await client.integrations.supabaseStatus()
|
|
43
|
-
*/
|
|
44
|
-
supabaseStatus(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
45
|
-
private __supabaseStatus;
|
|
46
|
-
/**
|
|
47
|
-
* Get a valid Supabase access token, auto-refreshing if expired.
|
|
48
|
-
*
|
|
49
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* await client.integrations.supabaseToken()
|
|
53
|
-
*/
|
|
54
|
-
supabaseToken(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
55
|
-
private __supabaseToken;
|
|
56
|
-
/**
|
|
57
|
-
* @param {IntegrationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* await client.integrations.supabaseDisconnect()
|
|
61
|
-
*/
|
|
62
|
-
supabaseDisconnect(requestOptions?: IntegrationsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
63
|
-
private __supabaseDisconnect;
|
|
64
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { SupabaseConnectIntegrationsSupabaseConnectGetRequest } from "./SupabaseConnectIntegrationsSupabaseConnectGetRequest.mjs";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|