phonic 0.32.2 → 0.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +23 -18
- package/dist/cjs/api/errors/TooManyRequestsError.d.ts +6 -0
- package/dist/cjs/api/errors/TooManyRequestsError.js +54 -0
- package/dist/cjs/api/errors/index.d.ts +1 -0
- package/dist/cjs/api/errors/index.js +1 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +8 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +14 -0
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +6 -0
- package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.d.ts +5 -0
- package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +79 -0
- package/dist/cjs/api/resources/apiKeys/client/Client.js +293 -0
- package/dist/cjs/api/resources/apiKeys/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/apiKeys/client/index.js +17 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/CreateApiKeyRequest.d.ts +10 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/CreateApiKeyRequest.js +3 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.d.ts +10 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.js +3 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/apiKeys/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/apiKeys/exports.d.ts +2 -0
- package/dist/cjs/api/resources/apiKeys/exports.js +21 -0
- package/dist/cjs/api/resources/apiKeys/index.d.ts +2 -0
- package/dist/cjs/api/resources/apiKeys/index.js +18 -0
- package/dist/cjs/api/resources/apiKeys/types/ApiKeysDeleteResponse.d.ts +3 -0
- package/dist/cjs/api/resources/apiKeys/types/ApiKeysDeleteResponse.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/ApiKeysUpdateResponse.d.ts +3 -0
- package/dist/cjs/api/resources/apiKeys/types/ApiKeysUpdateResponse.js +3 -0
- package/dist/cjs/api/resources/apiKeys/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/apiKeys/types/index.js +18 -0
- package/dist/cjs/api/resources/auth/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/auth/client/Client.js +70 -0
- package/dist/cjs/api/resources/auth/client/requests/CreateConversationTokenRequest.d.ts +13 -0
- package/dist/cjs/api/resources/auth/client/requests/CreateConversationTokenRequest.js +3 -0
- package/dist/cjs/api/resources/auth/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/auth/types/AuthCreateConversationTokenResponse.d.ts +6 -0
- package/dist/cjs/api/resources/auth/types/AuthCreateConversationTokenResponse.js +3 -0
- package/dist/cjs/api/resources/auth/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/auth/types/index.js +1 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +26 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +78 -0
- package/dist/cjs/api/resources/conversations/client/requests/ReplayConversationRequest.d.ts +10 -0
- package/dist/cjs/api/resources/conversations/client/requests/ReplayConversationRequest.js +3 -0
- package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/types/ConversationsEvaluateResponse.d.ts +19 -0
- package/dist/cjs/api/resources/conversations/types/ConversationsEvaluateResponse.js +17 -0
- package/dist/cjs/api/resources/conversations/types/ConversationsReplayResponse.d.ts +4 -0
- package/dist/cjs/api/resources/conversations/types/ConversationsReplayResponse.js +3 -0
- package/dist/cjs/api/resources/conversations/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/conversations/types/index.js +2 -0
- package/dist/cjs/api/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/index.js +5 -1
- package/dist/cjs/api/resources/projects/client/Client.d.ts +16 -0
- package/dist/cjs/api/resources/projects/client/Client.js +58 -0
- package/dist/cjs/api/resources/projects/types/ProjectsListEvalsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/projects/types/ProjectsListEvalsResponse.js +3 -0
- package/dist/cjs/api/resources/projects/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/projects/types/index.js +1 -0
- package/dist/cjs/api/resources/tools/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/tools/client/Client.js +2 -1
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +4 -1
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +5 -13
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +0 -8
- package/dist/cjs/api/resources/workspace/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/workspace/client/Client.js +65 -0
- package/dist/cjs/api/resources/workspace/client/index.d.ts +1 -1
- package/dist/cjs/api/resources/workspace/client/index.js +15 -0
- package/dist/cjs/api/resources/workspace/client/requests/UpdateWorkspaceRequest.d.ts +16 -0
- package/dist/cjs/api/resources/workspace/client/requests/UpdateWorkspaceRequest.js +3 -0
- package/dist/cjs/api/resources/workspace/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/workspace/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.d.ts +6 -0
- package/dist/cjs/api/resources/workspace/types/WorkspaceUpdateResponse.d.ts +3 -0
- package/dist/cjs/api/resources/workspace/types/WorkspaceUpdateResponse.js +3 -0
- package/dist/cjs/api/resources/workspace/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/workspace/types/index.js +1 -0
- package/dist/cjs/api/types/Agent.d.ts +9 -0
- package/dist/cjs/api/types/AgentIntegration.d.ts +13 -0
- package/dist/cjs/api/types/AgentIntegration.js +3 -0
- package/dist/cjs/api/types/ApiKeyWithSecret.d.ts +8 -0
- package/dist/cjs/api/types/ApiKeyWithSecret.js +3 -0
- package/dist/cjs/api/types/AudioChunkResponsePayload.d.ts +2 -0
- package/dist/cjs/api/types/ConfigOptions.d.ts +67 -0
- package/dist/cjs/api/types/Conversation.d.ts +31 -0
- package/dist/cjs/api/types/Conversation.js +8 -0
- package/dist/cjs/api/types/ConversationEval.d.ts +22 -1
- package/dist/cjs/api/types/ConversationEval.js +11 -0
- package/dist/cjs/api/types/ConversationEvalPromptInfo.d.ts +7 -0
- package/dist/cjs/api/types/ConversationEvalPromptInfo.js +3 -0
- package/dist/cjs/api/types/ConversationExtraction.d.ts +2 -4
- package/dist/cjs/api/types/ConversationItem.d.ts +4 -2
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +8 -0
- package/dist/cjs/api/types/DataRetentionPolicy.d.ts +21 -0
- package/dist/cjs/api/types/DataRetentionPolicy.js +3 -0
- package/dist/cjs/api/types/DtmfPayload.d.ts +2 -0
- package/dist/cjs/api/types/ExtractionField.d.ts +2 -2
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +40 -0
- package/dist/cjs/api/types/OutboundCallConfig.js +6 -0
- package/dist/cjs/api/types/OutboundNumberPool.d.ts +9 -0
- package/dist/cjs/api/types/OutboundNumberPool.js +3 -0
- package/dist/cjs/api/types/Tool.d.ts +3 -1
- 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 +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/errors/TooManyRequestsError.d.mts +6 -0
- package/dist/esm/api/errors/TooManyRequestsError.mjs +17 -0
- package/dist/esm/api/errors/index.d.mts +1 -0
- package/dist/esm/api/errors/index.mjs +1 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +8 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +14 -0
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +6 -0
- package/dist/esm/api/resources/agents/types/AgentsUpdateResponse.d.mts +5 -0
- package/dist/esm/api/resources/apiKeys/client/Client.d.mts +79 -0
- package/dist/esm/api/resources/apiKeys/client/Client.mjs +256 -0
- package/dist/esm/api/resources/apiKeys/client/index.d.mts +1 -0
- package/dist/esm/api/resources/apiKeys/client/index.mjs +1 -0
- package/dist/esm/api/resources/apiKeys/client/requests/CreateApiKeyRequest.d.mts +10 -0
- package/dist/esm/api/resources/apiKeys/client/requests/CreateApiKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.d.mts +10 -0
- package/dist/esm/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/apiKeys/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/apiKeys/exports.d.mts +2 -0
- package/dist/esm/api/resources/apiKeys/exports.mjs +3 -0
- package/dist/esm/api/resources/apiKeys/index.d.mts +2 -0
- package/dist/esm/api/resources/apiKeys/index.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/ApiKeysDeleteResponse.d.mts +3 -0
- package/dist/esm/api/resources/apiKeys/types/ApiKeysDeleteResponse.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/ApiKeysUpdateResponse.d.mts +3 -0
- package/dist/esm/api/resources/apiKeys/types/ApiKeysUpdateResponse.mjs +2 -0
- package/dist/esm/api/resources/apiKeys/types/index.d.mts +2 -0
- package/dist/esm/api/resources/apiKeys/types/index.mjs +2 -0
- package/dist/esm/api/resources/auth/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/auth/client/Client.mjs +70 -0
- package/dist/esm/api/resources/auth/client/requests/CreateConversationTokenRequest.d.mts +13 -0
- package/dist/esm/api/resources/auth/client/requests/CreateConversationTokenRequest.mjs +2 -0
- package/dist/esm/api/resources/auth/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/auth/types/AuthCreateConversationTokenResponse.d.mts +6 -0
- package/dist/esm/api/resources/auth/types/AuthCreateConversationTokenResponse.mjs +2 -0
- package/dist/esm/api/resources/auth/types/index.d.mts +1 -0
- package/dist/esm/api/resources/auth/types/index.mjs +1 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +26 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +78 -0
- package/dist/esm/api/resources/conversations/client/requests/ReplayConversationRequest.d.mts +10 -0
- package/dist/esm/api/resources/conversations/client/requests/ReplayConversationRequest.mjs +2 -0
- package/dist/esm/api/resources/conversations/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/conversations/types/ConversationsEvaluateResponse.d.mts +19 -0
- package/dist/esm/api/resources/conversations/types/ConversationsEvaluateResponse.mjs +14 -0
- package/dist/esm/api/resources/conversations/types/ConversationsReplayResponse.d.mts +4 -0
- package/dist/esm/api/resources/conversations/types/ConversationsReplayResponse.mjs +2 -0
- package/dist/esm/api/resources/conversations/types/index.d.mts +2 -0
- package/dist/esm/api/resources/conversations/types/index.mjs +2 -0
- package/dist/esm/api/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/index.mjs +4 -0
- package/dist/esm/api/resources/projects/client/Client.d.mts +16 -0
- package/dist/esm/api/resources/projects/client/Client.mjs +58 -0
- package/dist/esm/api/resources/projects/types/ProjectsListEvalsResponse.d.mts +4 -0
- package/dist/esm/api/resources/projects/types/ProjectsListEvalsResponse.mjs +2 -0
- package/dist/esm/api/resources/projects/types/index.d.mts +1 -0
- package/dist/esm/api/resources/projects/types/index.mjs +1 -0
- package/dist/esm/api/resources/tools/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/tools/client/Client.mjs +2 -1
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +4 -1
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +5 -13
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +0 -8
- package/dist/esm/api/resources/workspace/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/workspace/client/Client.mjs +65 -0
- package/dist/esm/api/resources/workspace/client/index.d.mts +1 -1
- package/dist/esm/api/resources/workspace/client/index.mjs +1 -1
- package/dist/esm/api/resources/workspace/client/requests/UpdateWorkspaceRequest.d.mts +16 -0
- package/dist/esm/api/resources/workspace/client/requests/UpdateWorkspaceRequest.mjs +2 -0
- package/dist/esm/api/resources/workspace/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/workspace/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.d.mts +6 -0
- package/dist/esm/api/resources/workspace/types/WorkspaceUpdateResponse.d.mts +3 -0
- package/dist/esm/api/resources/workspace/types/WorkspaceUpdateResponse.mjs +2 -0
- package/dist/esm/api/resources/workspace/types/index.d.mts +1 -0
- package/dist/esm/api/resources/workspace/types/index.mjs +1 -0
- package/dist/esm/api/types/Agent.d.mts +9 -0
- package/dist/esm/api/types/AgentIntegration.d.mts +13 -0
- package/dist/esm/api/types/AgentIntegration.mjs +2 -0
- package/dist/esm/api/types/ApiKeyWithSecret.d.mts +8 -0
- package/dist/esm/api/types/ApiKeyWithSecret.mjs +2 -0
- package/dist/esm/api/types/AudioChunkResponsePayload.d.mts +2 -0
- package/dist/esm/api/types/ConfigOptions.d.mts +67 -0
- package/dist/esm/api/types/Conversation.d.mts +31 -0
- package/dist/esm/api/types/Conversation.mjs +8 -0
- package/dist/esm/api/types/ConversationEval.d.mts +22 -1
- package/dist/esm/api/types/ConversationEval.mjs +10 -1
- package/dist/esm/api/types/ConversationEvalPromptInfo.d.mts +7 -0
- package/dist/esm/api/types/ConversationEvalPromptInfo.mjs +2 -0
- package/dist/esm/api/types/ConversationExtraction.d.mts +2 -4
- package/dist/esm/api/types/ConversationItem.d.mts +4 -2
- package/dist/esm/api/types/CreateAgentRequest.d.mts +8 -0
- package/dist/esm/api/types/DataRetentionPolicy.d.mts +21 -0
- package/dist/esm/api/types/DataRetentionPolicy.mjs +2 -0
- package/dist/esm/api/types/DtmfPayload.d.mts +2 -0
- package/dist/esm/api/types/ExtractionField.d.mts +2 -2
- package/dist/esm/api/types/OutboundCallConfig.d.mts +40 -0
- package/dist/esm/api/types/OutboundCallConfig.mjs +6 -0
- package/dist/esm/api/types/OutboundNumberPool.d.mts +9 -0
- package/dist/esm/api/types/OutboundNumberPool.mjs +2 -0
- package/dist/esm/api/types/Tool.d.mts +3 -1
- 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 +12 -1
- package/reference.md +540 -2
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
export interface ConversationExtraction {
|
|
2
2
|
/** The extraction ID. */
|
|
3
3
|
id: string;
|
|
4
|
-
/** The conversation ID. */
|
|
5
|
-
conversation_id?: string | undefined;
|
|
6
4
|
schema: ConversationExtraction.Schema;
|
|
7
5
|
/** The extracted data. */
|
|
8
6
|
result: Record<string, unknown>;
|
|
9
|
-
/** Error message if extraction failed. */
|
|
10
|
-
error: string | null;
|
|
11
7
|
/** When the extraction was created. */
|
|
12
8
|
created_at: string;
|
|
13
9
|
}
|
|
@@ -15,5 +11,7 @@ export declare namespace ConversationExtraction {
|
|
|
15
11
|
interface Schema {
|
|
16
12
|
id: string;
|
|
17
13
|
name: string;
|
|
14
|
+
/** Whether the extraction schema has been deleted. */
|
|
15
|
+
isDeleted: boolean;
|
|
18
16
|
}
|
|
19
17
|
}
|
|
@@ -5,10 +5,12 @@ export interface ConversationItem {
|
|
|
5
5
|
item_idx: number;
|
|
6
6
|
/** Who spoke in this turn. */
|
|
7
7
|
role: ConversationItem.Role;
|
|
8
|
-
/** Live transcript of this turn. */
|
|
9
|
-
live_transcript: string;
|
|
8
|
+
/** Live transcript of this turn. `null` when the turn has been redacted. */
|
|
9
|
+
live_transcript: string | null;
|
|
10
10
|
/** Post-call processed transcript. */
|
|
11
11
|
post_call_transcript: string | null;
|
|
12
|
+
/** The redacted transcript of this turn. `null` when the turn is not redacted. */
|
|
13
|
+
redacted_transcript?: (string | null) | undefined;
|
|
12
14
|
/** Duration of this turn in milliseconds. */
|
|
13
15
|
duration_ms: number;
|
|
14
16
|
/** When this turn started. */
|
|
@@ -2,6 +2,8 @@ import type * as Phonic from "../index.js";
|
|
|
2
2
|
export interface CreateAgentRequest {
|
|
3
3
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
4
4
|
name: string;
|
|
5
|
+
/** URL-friendly agent slug. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
6
|
+
slug?: string | undefined;
|
|
5
7
|
/** When set to `null`, the agent will not be associated with a phone number. When set to `"assign-automatically"`, the agent will be assigned a random phone number. When set to `"custom"`, you must provide `custom_phone_numbers`. */
|
|
6
8
|
phone_number?: (CreateAgentRequest.PhoneNumber | null) | undefined;
|
|
7
9
|
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
@@ -42,6 +44,12 @@ export interface CreateAgentRequest {
|
|
|
42
44
|
no_input_poke_text?: string | undefined;
|
|
43
45
|
/** Seconds of silence before ending the conversation. */
|
|
44
46
|
no_input_end_conversation_sec?: number | undefined;
|
|
47
|
+
/** When `true`, the assistant will produce backchannel responses (e.g. "mm-hmm") while the user is speaking. */
|
|
48
|
+
enable_assistant_backchannel?: boolean | undefined;
|
|
49
|
+
/** How aggressively the assistant produces backchannel responses. Only relevant when `enable_assistant_backchannel` is `true`. */
|
|
50
|
+
assistant_backchannel_aggressiveness?: number | undefined;
|
|
51
|
+
/** Controls how long transcripts and audio recordings are retained before deletion. */
|
|
52
|
+
data_retention_policy?: Phonic.DataRetentionPolicy | undefined;
|
|
45
53
|
/** ISO 639-1 language code that sets the agent's default language to recognize and speak. Welcome message and no input poke text should be in this language. */
|
|
46
54
|
default_language?: Phonic.LanguageCode | undefined;
|
|
47
55
|
/** Array of additional ISO 639-1 language codes that the agent should be able to recognize and speak. Should not include `default_language`. */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controls how long transcripts and audio recordings are retained before deletion.
|
|
3
|
+
* When `zero_data_retention` is `true`, nothing is retained and `transcripts`/`audio_recordings` are omitted.
|
|
4
|
+
*/
|
|
5
|
+
export type DataRetentionPolicy =
|
|
6
|
+
/**
|
|
7
|
+
* Zero data retention mode. No transcripts or audio recordings are retained. */
|
|
8
|
+
{
|
|
9
|
+
zero_data_retention: true;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Standard data retention with configurable deletion windows. */
|
|
13
|
+
| {
|
|
14
|
+
zero_data_retention: false;
|
|
15
|
+
transcripts: {
|
|
16
|
+
delete_after_hours: number | null;
|
|
17
|
+
};
|
|
18
|
+
audio_recordings: {
|
|
19
|
+
delete_after_hours: number | null;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -3,8 +3,8 @@ export interface ExtractionField {
|
|
|
3
3
|
name: string;
|
|
4
4
|
/** The field type. */
|
|
5
5
|
type: ExtractionField.Type;
|
|
6
|
-
/** Description of the field. */
|
|
7
|
-
description
|
|
6
|
+
/** Description of the field. May be null, but the property must be present. */
|
|
7
|
+
description: string | null;
|
|
8
8
|
}
|
|
9
9
|
export declare namespace ExtractionField {
|
|
10
10
|
/** The field type. */
|
|
@@ -47,6 +47,28 @@ export interface OutboundCallConfig {
|
|
|
47
47
|
tools?: OutboundCallConfig.Tools.Item[] | undefined;
|
|
48
48
|
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
49
49
|
enable_redaction?: boolean | undefined;
|
|
50
|
+
/** The speech-to-speech model to use. */
|
|
51
|
+
model?: "merritt" | undefined;
|
|
52
|
+
/** The audio speed of the agent. */
|
|
53
|
+
audio_speed?: number | undefined;
|
|
54
|
+
/** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
|
|
55
|
+
background_noise?: (OutboundCallConfig.BackgroundNoise | null) | undefined;
|
|
56
|
+
/** The background noise level of the agent. */
|
|
57
|
+
background_noise_level?: number | undefined;
|
|
58
|
+
/** Array of MCP server names to use. */
|
|
59
|
+
mcp_servers?: string[] | undefined;
|
|
60
|
+
/** Array of task objects with `name` and `description` fields. */
|
|
61
|
+
tasks?: Phonic.Task[] | undefined;
|
|
62
|
+
/** Pool of phone numbers used for outbound calls. */
|
|
63
|
+
outbound_number_pool?: (Phonic.OutboundNumberPool | null) | undefined;
|
|
64
|
+
/** When `true`, the assistant will produce backchannel responses (e.g. "mm-hmm") while the user is speaking. */
|
|
65
|
+
enable_assistant_backchannel?: boolean | undefined;
|
|
66
|
+
/** How aggressively the assistant produces backchannel responses. Only relevant when `enable_assistant_backchannel` is `true`. */
|
|
67
|
+
assistant_backchannel_aggressiveness?: number | undefined;
|
|
68
|
+
/** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options. */
|
|
69
|
+
configuration_endpoint?: (OutboundCallConfig.ConfigurationEndpoint | null) | undefined;
|
|
70
|
+
/** Controls how long transcripts and audio recordings are retained before deletion. */
|
|
71
|
+
data_retention_policy?: Phonic.DataRetentionPolicy | undefined;
|
|
50
72
|
}
|
|
51
73
|
export declare namespace OutboundCallConfig {
|
|
52
74
|
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
@@ -70,4 +92,22 @@ export declare namespace OutboundCallConfig {
|
|
|
70
92
|
* Custom tool */
|
|
71
93
|
| string;
|
|
72
94
|
}
|
|
95
|
+
/** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
|
|
96
|
+
const BackgroundNoise: {
|
|
97
|
+
readonly Office: "office";
|
|
98
|
+
readonly CallCenter: "call-center";
|
|
99
|
+
readonly CoffeeShop: "coffee-shop";
|
|
100
|
+
};
|
|
101
|
+
type BackgroundNoise = (typeof BackgroundNoise)[keyof typeof BackgroundNoise];
|
|
102
|
+
/**
|
|
103
|
+
* When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options.
|
|
104
|
+
*/
|
|
105
|
+
interface ConfigurationEndpoint {
|
|
106
|
+
/** URL to call */
|
|
107
|
+
url: string;
|
|
108
|
+
/** Object of key-value pairs. */
|
|
109
|
+
headers?: Record<string, string> | undefined;
|
|
110
|
+
/** Timeout in milliseconds for the endpoint call. */
|
|
111
|
+
timeout_ms?: number | undefined;
|
|
112
|
+
}
|
|
73
113
|
}
|
|
@@ -10,4 +10,10 @@ var OutboundCallConfig;
|
|
|
10
10
|
Request: "request",
|
|
11
11
|
Initial: "initial",
|
|
12
12
|
};
|
|
13
|
+
/** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
|
|
14
|
+
OutboundCallConfig.BackgroundNoise = {
|
|
15
|
+
Office: "office",
|
|
16
|
+
CallCenter: "call-center",
|
|
17
|
+
CoffeeShop: "coffee-shop",
|
|
18
|
+
};
|
|
13
19
|
})(OutboundCallConfig || (exports.OutboundCallConfig = OutboundCallConfig = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pool of phone numbers used for outbound calls.
|
|
3
|
+
*/
|
|
4
|
+
export interface OutboundNumberPool {
|
|
5
|
+
/** E.164 formatted phone numbers available for outbound calls. */
|
|
6
|
+
active: string[];
|
|
7
|
+
/** E.164 formatted phone numbers that are blocked from being used. */
|
|
8
|
+
blocked: string[];
|
|
9
|
+
}
|
|
@@ -10,7 +10,7 @@ export interface Tool {
|
|
|
10
10
|
/** The type of tool. */
|
|
11
11
|
type: Tool.Type;
|
|
12
12
|
/** Mode of operation - sync waits for response, async continues without waiting. */
|
|
13
|
-
execution_mode
|
|
13
|
+
execution_mode?: Tool.ExecutionMode | undefined;
|
|
14
14
|
/** Array of parameter definitions for the tool. */
|
|
15
15
|
parameters: Phonic.ToolParameter[];
|
|
16
16
|
/** HTTP method for webhook tools. */
|
|
@@ -43,6 +43,8 @@ export interface Tool {
|
|
|
43
43
|
allow_tool_chaining?: boolean | undefined;
|
|
44
44
|
/** The agent doesn't typically wait for the response of async custom_websocket tools. When true, makes the agent wait for a response, not call other tools and inform the user of the result. Only available for async custom_websocket tools. */
|
|
45
45
|
wait_for_response?: boolean | undefined;
|
|
46
|
+
/** The static context returned to the agent. Only present for custom_context tools. */
|
|
47
|
+
context?: string | undefined;
|
|
46
48
|
}
|
|
47
49
|
export declare namespace Tool {
|
|
48
50
|
interface Project {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./AddSystemMessagePayload.js";
|
|
2
2
|
export * from "./Agent.js";
|
|
3
|
+
export * from "./AgentIntegration.js";
|
|
4
|
+
export * from "./ApiKeyWithSecret.js";
|
|
3
5
|
export * from "./AssistantChoseNotToRespondPayload.js";
|
|
4
6
|
export * from "./AssistantEndedConversationPayload.js";
|
|
5
7
|
export * from "./AssistantFinishedSpeakingPayload.js";
|
|
@@ -15,6 +17,7 @@ export * from "./ConversationAnalysis.js";
|
|
|
15
17
|
export * from "./ConversationCreatedPayload.js";
|
|
16
18
|
export * from "./ConversationEval.js";
|
|
17
19
|
export * from "./ConversationEvalPrompt.js";
|
|
20
|
+
export * from "./ConversationEvalPromptInfo.js";
|
|
18
21
|
export * from "./ConversationEvaluation.js";
|
|
19
22
|
export * from "./ConversationEvaluationResult.js";
|
|
20
23
|
export * from "./ConversationExtraction.js";
|
|
@@ -23,6 +26,7 @@ export * from "./ConversationsListResponseConversation.js";
|
|
|
23
26
|
export * from "./ConversationsListResponseConversations.js";
|
|
24
27
|
export * from "./ConversationsListResponseConversationsPagination.js";
|
|
25
28
|
export * from "./CreateAgentRequest.js";
|
|
29
|
+
export * from "./DataRetentionPolicy.js";
|
|
26
30
|
export * from "./DtmfPayload.js";
|
|
27
31
|
export * from "./Error_.js";
|
|
28
32
|
export * from "./ErrorPayload.js";
|
|
@@ -40,6 +44,7 @@ export * from "./OpenAiTool.js";
|
|
|
40
44
|
export * from "./OutboundCallConfig.js";
|
|
41
45
|
export * from "./OutboundCallInitiatedResponse.js";
|
|
42
46
|
export * from "./OutboundDryRunResponse.js";
|
|
47
|
+
export * from "./OutboundNumberPool.js";
|
|
43
48
|
export * from "./Project.js";
|
|
44
49
|
export * from "./ReadyToStartConversationPayload.js";
|
|
45
50
|
export * from "./ReplayConversationItemResponse.js";
|
|
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./AddSystemMessagePayload.js"), exports);
|
|
18
18
|
__exportStar(require("./Agent.js"), exports);
|
|
19
|
+
__exportStar(require("./AgentIntegration.js"), exports);
|
|
20
|
+
__exportStar(require("./ApiKeyWithSecret.js"), exports);
|
|
19
21
|
__exportStar(require("./AssistantChoseNotToRespondPayload.js"), exports);
|
|
20
22
|
__exportStar(require("./AssistantEndedConversationPayload.js"), exports);
|
|
21
23
|
__exportStar(require("./AssistantFinishedSpeakingPayload.js"), exports);
|
|
@@ -31,6 +33,7 @@ __exportStar(require("./ConversationAnalysis.js"), exports);
|
|
|
31
33
|
__exportStar(require("./ConversationCreatedPayload.js"), exports);
|
|
32
34
|
__exportStar(require("./ConversationEval.js"), exports);
|
|
33
35
|
__exportStar(require("./ConversationEvalPrompt.js"), exports);
|
|
36
|
+
__exportStar(require("./ConversationEvalPromptInfo.js"), exports);
|
|
34
37
|
__exportStar(require("./ConversationEvaluation.js"), exports);
|
|
35
38
|
__exportStar(require("./ConversationEvaluationResult.js"), exports);
|
|
36
39
|
__exportStar(require("./ConversationExtraction.js"), exports);
|
|
@@ -39,6 +42,7 @@ __exportStar(require("./ConversationsListResponseConversation.js"), exports);
|
|
|
39
42
|
__exportStar(require("./ConversationsListResponseConversations.js"), exports);
|
|
40
43
|
__exportStar(require("./ConversationsListResponseConversationsPagination.js"), exports);
|
|
41
44
|
__exportStar(require("./CreateAgentRequest.js"), exports);
|
|
45
|
+
__exportStar(require("./DataRetentionPolicy.js"), exports);
|
|
42
46
|
__exportStar(require("./DtmfPayload.js"), exports);
|
|
43
47
|
__exportStar(require("./Error_.js"), exports);
|
|
44
48
|
__exportStar(require("./ErrorPayload.js"), exports);
|
|
@@ -56,6 +60,7 @@ __exportStar(require("./OpenAiTool.js"), exports);
|
|
|
56
60
|
__exportStar(require("./OutboundCallConfig.js"), exports);
|
|
57
61
|
__exportStar(require("./OutboundCallInitiatedResponse.js"), exports);
|
|
58
62
|
__exportStar(require("./OutboundDryRunResponse.js"), exports);
|
|
63
|
+
__exportStar(require("./OutboundNumberPool.js"), exports);
|
|
59
64
|
__exportStar(require("./Project.js"), exports);
|
|
60
65
|
__exportStar(require("./ReadyToStartConversationPayload.js"), exports);
|
|
61
66
|
__exportStar(require("./ReplayConversationItemResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.32.
|
|
1
|
+
export declare const SDK_VERSION = "0.32.4";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "phonic",
|
|
9
|
-
"X-Fern-SDK-Version": "0.32.
|
|
10
|
-
"User-Agent": "phonic/0.32.
|
|
9
|
+
"X-Fern-SDK-Version": "0.32.4",
|
|
10
|
+
"User-Agent": "phonic/0.32.4",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
2
|
+
import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.mjs";
|
|
2
3
|
import { AuthClient } from "./api/resources/auth/client/Client.mjs";
|
|
3
4
|
import { ConversationItemsClient } from "./api/resources/conversationItems/client/Client.mjs";
|
|
4
5
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
@@ -27,6 +28,7 @@ export declare namespace PhonicClient {
|
|
|
27
28
|
export declare class PhonicClient {
|
|
28
29
|
protected readonly _options: NormalizedClientOptionsWithAuth<PhonicClient.Options>;
|
|
29
30
|
protected _agents: AgentsClient | undefined;
|
|
31
|
+
protected _apiKeys: ApiKeysClient | undefined;
|
|
30
32
|
protected _tools: ToolsClient | undefined;
|
|
31
33
|
protected _extractionSchemas: ExtractionSchemasClient | undefined;
|
|
32
34
|
protected _tts: TtsClient | undefined;
|
|
@@ -38,6 +40,7 @@ export declare class PhonicClient {
|
|
|
38
40
|
protected _workspace: WorkspaceClient | undefined;
|
|
39
41
|
constructor(options?: PhonicClient.Options);
|
|
40
42
|
get agents(): AgentsClient;
|
|
43
|
+
get apiKeys(): ApiKeysClient;
|
|
41
44
|
get tools(): ToolsClient;
|
|
42
45
|
get extractionSchemas(): ExtractionSchemasClient;
|
|
43
46
|
get tts(): TtsClient;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
|
|
12
|
+
import { ApiKeysClient } from "./api/resources/apiKeys/client/Client.mjs";
|
|
12
13
|
import { AuthClient } from "./api/resources/auth/client/Client.mjs";
|
|
13
14
|
import { ConversationItemsClient } from "./api/resources/conversationItems/client/Client.mjs";
|
|
14
15
|
import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
|
|
@@ -29,6 +30,10 @@ export class PhonicClient {
|
|
|
29
30
|
var _a;
|
|
30
31
|
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new AgentsClient(this._options)));
|
|
31
32
|
}
|
|
33
|
+
get apiKeys() {
|
|
34
|
+
var _a;
|
|
35
|
+
return ((_a = this._apiKeys) !== null && _a !== void 0 ? _a : (this._apiKeys = new ApiKeysClient(this._options)));
|
|
36
|
+
}
|
|
32
37
|
get tools() {
|
|
33
38
|
var _a;
|
|
34
39
|
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new ToolsClient(this._options)));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as core from "../../core/index.mjs";
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
import type * as Phonic from "../index.mjs";
|
|
4
|
+
export declare class TooManyRequestsError extends errors.PhonicError {
|
|
5
|
+
constructor(body: Phonic.BasicError, rawResponse?: core.RawResponse);
|
|
6
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as errors from "../../errors/index.mjs";
|
|
3
|
+
export class TooManyRequestsError extends errors.PhonicError {
|
|
4
|
+
constructor(body, rawResponse) {
|
|
5
|
+
super({
|
|
6
|
+
message: "TooManyRequestsError",
|
|
7
|
+
statusCode: 429,
|
|
8
|
+
body: body,
|
|
9
|
+
rawResponse: rawResponse,
|
|
10
|
+
});
|
|
11
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
12
|
+
if (Error.captureStackTrace) {
|
|
13
|
+
Error.captureStackTrace(this, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
this.name = this.constructor.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -4,5 +4,6 @@ export * from "./ForbiddenError.mjs";
|
|
|
4
4
|
export * from "./GatewayTimeoutError.mjs";
|
|
5
5
|
export * from "./InternalServerError.mjs";
|
|
6
6
|
export * from "./NotFoundError.mjs";
|
|
7
|
+
export * from "./TooManyRequestsError.mjs";
|
|
7
8
|
export * from "./UnauthorizedError.mjs";
|
|
8
9
|
export * from "./UnprocessableEntityError.mjs";
|
|
@@ -4,5 +4,6 @@ export * from "./ForbiddenError.mjs";
|
|
|
4
4
|
export * from "./GatewayTimeoutError.mjs";
|
|
5
5
|
export * from "./InternalServerError.mjs";
|
|
6
6
|
export * from "./NotFoundError.mjs";
|
|
7
|
+
export * from "./TooManyRequestsError.mjs";
|
|
7
8
|
export * from "./UnauthorizedError.mjs";
|
|
8
9
|
export * from "./UnprocessableEntityError.mjs";
|
|
@@ -49,6 +49,8 @@ export interface AgentsCreateRequest {
|
|
|
49
49
|
project?: string;
|
|
50
50
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
51
51
|
name: string;
|
|
52
|
+
/** URL-friendly agent slug. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
53
|
+
slug?: string;
|
|
52
54
|
/** When set to `null`, the agent will not be associated with a phone number. When set to `"assign-automatically"`, the agent will be assigned a random phone number. When set to `"custom"`, you must provide `custom_phone_numbers`. */
|
|
53
55
|
phone_number?: Phonic.CreateAgentRequest.PhoneNumber | null;
|
|
54
56
|
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
@@ -89,6 +91,12 @@ export interface AgentsCreateRequest {
|
|
|
89
91
|
no_input_poke_text?: string;
|
|
90
92
|
/** Seconds of silence before ending the conversation. */
|
|
91
93
|
no_input_end_conversation_sec?: number;
|
|
94
|
+
/** When `true`, the assistant will produce backchannel responses (e.g. "mm-hmm") while the user is speaking. */
|
|
95
|
+
enable_assistant_backchannel?: boolean;
|
|
96
|
+
/** How aggressively the assistant produces backchannel responses. Only relevant when `enable_assistant_backchannel` is `true`. */
|
|
97
|
+
assistant_backchannel_aggressiveness?: number;
|
|
98
|
+
/** Controls how long transcripts and audio recordings are retained before deletion. */
|
|
99
|
+
data_retention_policy?: Phonic.DataRetentionPolicy;
|
|
92
100
|
/** ISO 639-1 language code that sets the agent's default language to recognize and speak. Welcome message and no input poke text should be in this language. */
|
|
93
101
|
default_language?: Phonic.LanguageCode;
|
|
94
102
|
/** Array of additional ISO 639-1 language codes that the agent should be able to recognize and speak. Should not include `default_language`. */
|
|
@@ -49,6 +49,8 @@ export interface UpdateAgentRequest {
|
|
|
49
49
|
project?: string;
|
|
50
50
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
51
51
|
name?: string;
|
|
52
|
+
/** URL-friendly agent slug. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
53
|
+
slug?: string;
|
|
52
54
|
/** When set to `null`, the agent will not be associated with a phone number anymore. When set to `"assign-automatically"`, the agent will be assigned a random phone number if it doesn't have one yet. If the agent already has a phone number, `"assign-automatically"` has no effect. When set to `"custom"`, you must provide `custom_phone_numbers`. */
|
|
53
55
|
phone_number?: UpdateAgentRequest.PhoneNumber | null;
|
|
54
56
|
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
@@ -89,6 +91,18 @@ export interface UpdateAgentRequest {
|
|
|
89
91
|
no_input_poke_text?: string;
|
|
90
92
|
/** Seconds of silence before ending the conversation. */
|
|
91
93
|
no_input_end_conversation_sec?: number;
|
|
94
|
+
/** When `true`, the assistant will produce backchannel responses (e.g. "mm-hmm") while the user is speaking. */
|
|
95
|
+
enable_assistant_backchannel?: boolean;
|
|
96
|
+
/** How aggressively the assistant produces backchannel responses. Only relevant when `enable_assistant_backchannel` is `true`. */
|
|
97
|
+
assistant_backchannel_aggressiveness?: number;
|
|
98
|
+
/** Controls how long transcripts and audio recordings are retained before deletion. */
|
|
99
|
+
data_retention_policy?: Phonic.DataRetentionPolicy;
|
|
100
|
+
/** Pool of phone numbers used for outbound calls. Set to `null` to remove the pool. */
|
|
101
|
+
outbound_number_pool?: Phonic.OutboundNumberPool | null;
|
|
102
|
+
/** Array of procedure IDs associated with the agent. */
|
|
103
|
+
procedure_ids?: string[];
|
|
104
|
+
/** Array of third-party integrations enabled for the agent. */
|
|
105
|
+
integrations?: Phonic.AgentIntegration[];
|
|
92
106
|
/** ISO 639-1 language code that sets the agent's default language to recognize and speak. Welcome message and no input poke text should be in this language. */
|
|
93
107
|
default_language?: Phonic.LanguageCode;
|
|
94
108
|
/** Array of additional ISO 639-1 language codes that the agent should be able to recognize and speak. Should not include `default_language`. */
|
|
@@ -47,4 +47,10 @@ import type * as Phonic from "../../../../index.mjs";
|
|
|
47
47
|
export interface UpsertAgentRequest extends Phonic.CreateAgentRequest {
|
|
48
48
|
/** The name of the project containing the agent. */
|
|
49
49
|
project?: string;
|
|
50
|
+
/** Pool of phone numbers used for outbound calls. Set to `null` to remove the pool. */
|
|
51
|
+
outbound_number_pool?: Phonic.OutboundNumberPool | null;
|
|
52
|
+
/** Array of procedure IDs associated with the agent. */
|
|
53
|
+
procedure_ids?: string[];
|
|
54
|
+
/** Array of third-party integrations enabled for the agent. */
|
|
55
|
+
integrations?: Phonic.AgentIntegration[];
|
|
50
56
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import type * as Phonic from "../../../index.mjs";
|
|
1
2
|
export interface AgentsUpdateResponse {
|
|
2
3
|
/** Whether the agent was updated successfully. */
|
|
3
4
|
success: boolean;
|
|
5
|
+
/** The version number of the agent after the update. */
|
|
6
|
+
version_number: number;
|
|
7
|
+
/** The updated agent. */
|
|
8
|
+
agent: Phonic.Agent;
|
|
4
9
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 Phonic from "../../../index.mjs";
|
|
5
|
+
export declare namespace ApiKeysClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ApiKeysClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ApiKeysClient.Options>;
|
|
12
|
+
constructor(options?: ApiKeysClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new API key in the workspace.
|
|
15
|
+
*
|
|
16
|
+
* @param {Phonic.CreateApiKeyRequest} request
|
|
17
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Phonic.BadRequestError}
|
|
20
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
21
|
+
* @throws {@link Phonic.InternalServerError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.apiKeys.create({
|
|
25
|
+
* name: "production-key"
|
|
26
|
+
* })
|
|
27
|
+
*/
|
|
28
|
+
create(request: Phonic.CreateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeyWithSecret>;
|
|
29
|
+
private __create;
|
|
30
|
+
/**
|
|
31
|
+
* Deletes an API key.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} id - The ID of the API key to delete.
|
|
34
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
37
|
+
* @throws {@link Phonic.NotFoundError}
|
|
38
|
+
* @throws {@link Phonic.InternalServerError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await client.apiKeys.delete("id")
|
|
42
|
+
*/
|
|
43
|
+
delete(id: string, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeysDeleteResponse>;
|
|
44
|
+
private __delete;
|
|
45
|
+
/**
|
|
46
|
+
* Updates an API key.
|
|
47
|
+
*
|
|
48
|
+
* @param {string} id - The ID of the API key to update.
|
|
49
|
+
* @param {Phonic.UpdateApiKeyRequest} request
|
|
50
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
+
*
|
|
52
|
+
* @throws {@link Phonic.BadRequestError}
|
|
53
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
54
|
+
* @throws {@link Phonic.NotFoundError}
|
|
55
|
+
* @throws {@link Phonic.InternalServerError}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await client.apiKeys.update("id", {
|
|
59
|
+
* name: "renamed-key"
|
|
60
|
+
* })
|
|
61
|
+
*/
|
|
62
|
+
update(id: string, request: Phonic.UpdateApiKeyRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeysUpdateResponse>;
|
|
63
|
+
private __update;
|
|
64
|
+
/**
|
|
65
|
+
* Rotates an API key, generating a new secret and invalidating the old one.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} id - The ID of the API key to rotate.
|
|
68
|
+
* @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
69
|
+
*
|
|
70
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
71
|
+
* @throws {@link Phonic.NotFoundError}
|
|
72
|
+
* @throws {@link Phonic.InternalServerError}
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* await client.apiKeys.rotate("id")
|
|
76
|
+
*/
|
|
77
|
+
rotate(id: string, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise<Phonic.ApiKeyWithSecret>;
|
|
78
|
+
private __rotate;
|
|
79
|
+
}
|