agora-agents 3.0.0-alpha.2 → 3.0.0-alpha.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/README.md +4 -4
- package/dist/cjs/AgoraPoolClient.d.ts +16 -3
- package/dist/cjs/AgoraPoolClient.js +47 -16
- package/dist/cjs/agentkit/Agent.js +17 -7
- package/dist/cjs/agentkit/AgentSession.js +8 -10
- package/dist/cjs/agentkit/avatar-types.d.ts +6 -0
- package/dist/cjs/agentkit/index.d.ts +7 -9
- package/dist/cjs/agentkit/index.js +8 -6
- package/dist/cjs/agentkit/presets.js +3 -3
- package/dist/cjs/agentkit/preview/client.d.ts +6 -5
- package/dist/cjs/agentkit/preview/client.js +7 -7
- package/dist/cjs/agentkit/preview/gemini-tts.d.ts +3 -31
- package/dist/cjs/agentkit/preview/gemini-tts.js +4 -30
- package/dist/cjs/agentkit/preview/index.d.ts +2 -2
- package/dist/cjs/agentkit/preview/index.js +4 -4
- package/dist/cjs/agentkit/session-backend.d.ts +3 -1
- package/dist/cjs/agentkit/session-backend.js +32 -33
- package/dist/cjs/agentkit/token.d.ts +46 -9
- package/dist/cjs/agentkit/token.js +35 -7
- package/dist/cjs/agentkit/types.d.ts +12 -3
- package/dist/cjs/agentkit/v3.d.ts +7 -3
- package/dist/cjs/agentkit/v3.js +35 -21
- package/dist/cjs/agentkit/vendors/avatar.d.ts +6 -0
- package/dist/cjs/agentkit/vendors/avatar.js +14 -2
- package/dist/cjs/agentkit/vendors/stt.d.ts +35 -0
- package/dist/cjs/agentkit/vendors/stt.js +19 -2
- package/dist/cjs/agentkit/vendors/tts.d.ts +72 -18
- package/dist/cjs/agentkit/vendors/tts.js +60 -11
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +13 -0
- package/dist/cjs/api/resources/agents/types/GetTurnsAgentsResponse.d.ts +3 -1
- package/dist/cjs/api/types/Asr.d.ts +4 -1
- package/dist/cjs/api/types/CartesiaTts.d.ts +10 -0
- package/dist/cjs/api/types/CartesiaTts.js +9 -0
- package/dist/cjs/api/types/CartesiaTtsParams.d.ts +1 -1
- package/dist/cjs/api/types/DeepgramAsrParams.d.ts +1 -1
- package/dist/cjs/api/types/FishAudioTts.d.ts +10 -0
- package/dist/cjs/api/types/FishAudioTts.js +9 -0
- package/dist/cjs/api/types/FishAudioTtsParams.d.ts +1 -1
- package/dist/cjs/api/types/GeminiTts.d.ts +9 -0
- package/dist/cjs/api/types/GeminiTts.js +3 -0
- package/dist/cjs/api/types/GeminiTtsParams.d.ts +15 -0
- package/dist/cjs/api/types/GeminiTtsParams.js +3 -0
- package/dist/cjs/api/types/RtzrAsr.d.ts +10 -0
- package/dist/cjs/api/types/RtzrAsr.js +3 -0
- package/dist/cjs/api/types/RtzrAsrParams.d.ts +31 -0
- package/dist/cjs/api/types/RtzrAsrParams.js +3 -0
- package/dist/cjs/api/types/SarvamTtsParams.d.ts +12 -8
- package/dist/cjs/api/types/SarvamTtsParams.js +1 -1
- package/dist/cjs/api/types/Tts.d.ts +4 -1
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -0
- package/dist/cjs/core/auth/publicAuthorization.d.ts +3 -0
- package/dist/cjs/core/auth/publicAuthorization.js +37 -0
- package/dist/cjs/index.d.ts +6 -6
- package/dist/cjs/index.js +14 -6
- package/dist/cjs/v3/campaigns.js +5 -2
- package/dist/cjs/v3/errors.d.ts +103 -0
- package/dist/cjs/v3/errors.js +179 -0
- package/dist/cjs/v3/index.d.ts +2 -0
- package/dist/cjs/v3/index.js +9 -1
- package/dist/cjs/v3/resources.js +17 -8
- package/dist/cjs/v3/session-lifecycle.d.ts +2 -1
- package/dist/cjs/v3/session-lifecycle.js +22 -18
- package/dist/cjs/v3/transport.d.ts +1 -13
- package/dist/cjs/v3/transport.js +88 -42
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/AgoraPoolClient.d.mts +16 -3
- package/dist/esm/AgoraPoolClient.mjs +48 -17
- package/dist/esm/agentkit/Agent.mjs +17 -7
- package/dist/esm/agentkit/AgentSession.mjs +8 -10
- package/dist/esm/agentkit/avatar-types.d.mts +6 -0
- package/dist/esm/agentkit/index.d.mts +7 -9
- package/dist/esm/agentkit/index.mjs +3 -4
- package/dist/esm/agentkit/presets.mjs +3 -3
- package/dist/esm/agentkit/preview/client.d.mts +6 -5
- package/dist/esm/agentkit/preview/client.mjs +7 -7
- package/dist/esm/agentkit/preview/gemini-tts.d.mts +3 -31
- package/dist/esm/agentkit/preview/gemini-tts.mjs +1 -28
- package/dist/esm/agentkit/preview/index.d.mts +2 -2
- package/dist/esm/agentkit/preview/index.mjs +1 -1
- package/dist/esm/agentkit/session-backend.d.mts +3 -1
- package/dist/esm/agentkit/session-backend.mjs +33 -34
- package/dist/esm/agentkit/token.d.mts +46 -9
- package/dist/esm/agentkit/token.mjs +34 -7
- package/dist/esm/agentkit/types.d.mts +12 -3
- package/dist/esm/agentkit/v3.d.mts +7 -3
- package/dist/esm/agentkit/v3.mjs +34 -20
- package/dist/esm/agentkit/vendors/avatar.d.mts +6 -0
- package/dist/esm/agentkit/vendors/avatar.mjs +14 -2
- package/dist/esm/agentkit/vendors/stt.d.mts +35 -0
- package/dist/esm/agentkit/vendors/stt.mjs +17 -1
- package/dist/esm/agentkit/vendors/tts.d.mts +72 -18
- package/dist/esm/agentkit/vendors/tts.mjs +58 -10
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +13 -0
- package/dist/esm/api/resources/agents/types/GetTurnsAgentsResponse.d.mts +3 -1
- package/dist/esm/api/types/Asr.d.mts +4 -1
- package/dist/esm/api/types/CartesiaTts.d.mts +10 -0
- package/dist/esm/api/types/CartesiaTts.mjs +8 -1
- package/dist/esm/api/types/CartesiaTtsParams.d.mts +1 -1
- package/dist/esm/api/types/DeepgramAsrParams.d.mts +1 -1
- package/dist/esm/api/types/FishAudioTts.d.mts +10 -0
- package/dist/esm/api/types/FishAudioTts.mjs +8 -1
- package/dist/esm/api/types/FishAudioTtsParams.d.mts +1 -1
- package/dist/esm/api/types/GeminiTts.d.mts +9 -0
- package/dist/esm/api/types/GeminiTts.mjs +2 -0
- package/dist/esm/api/types/GeminiTtsParams.d.mts +15 -0
- package/dist/esm/api/types/GeminiTtsParams.mjs +2 -0
- package/dist/esm/api/types/RtzrAsr.d.mts +10 -0
- package/dist/esm/api/types/RtzrAsr.mjs +2 -0
- package/dist/esm/api/types/RtzrAsrParams.d.mts +31 -0
- package/dist/esm/api/types/RtzrAsrParams.mjs +2 -0
- package/dist/esm/api/types/SarvamTtsParams.d.mts +12 -8
- package/dist/esm/api/types/SarvamTtsParams.mjs +1 -1
- package/dist/esm/api/types/Tts.d.mts +4 -1
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/core/auth/publicAuthorization.d.mts +3 -0
- package/dist/esm/core/auth/publicAuthorization.mjs +33 -0
- package/dist/esm/index.d.mts +6 -6
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/v3/campaigns.mjs +5 -2
- package/dist/esm/v3/errors.d.mts +103 -0
- package/dist/esm/v3/errors.mjs +167 -0
- package/dist/esm/v3/index.d.mts +2 -0
- package/dist/esm/v3/index.mjs +1 -0
- package/dist/esm/v3/resources.mjs +17 -8
- package/dist/esm/v3/session-lifecycle.d.mts +2 -1
- package/dist/esm/v3/session-lifecycle.mjs +22 -18
- package/dist/esm/v3/transport.d.mts +1 -13
- package/dist/esm/v3/transport.mjs +85 -39
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/openapi.yaml +13 -5
- package/package.json +2 -2
|
@@ -4,23 +4,27 @@
|
|
|
4
4
|
export interface SarvamTtsParams {
|
|
5
5
|
/** Sarvam API subscription key */
|
|
6
6
|
api_subscription_key: string;
|
|
7
|
-
/**
|
|
7
|
+
/** Speaker voice to use. */
|
|
8
8
|
speaker: string;
|
|
9
|
-
/** Target language code (e.g., en-IN) */
|
|
9
|
+
/** Target language code in BCP-47 format (e.g., `hi-IN`, `bn-IN`, `en-IN`). */
|
|
10
10
|
target_language_code: SarvamTtsParams.TargetLanguageCode;
|
|
11
|
-
/** Pitch
|
|
11
|
+
/** Pitch control for the `bulbul:v2` model. */
|
|
12
12
|
pitch?: number;
|
|
13
|
-
/**
|
|
13
|
+
/** Speech speed. Defaults to `1.0`. */
|
|
14
14
|
pace?: number;
|
|
15
|
-
/**
|
|
15
|
+
/** Audio loudness control for the `bulbul:v2` model. */
|
|
16
16
|
loudness?: number;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/** Output speech sample rate in Hz. Defaults to `24000`. */
|
|
18
|
+
speech_sample_rate?: number;
|
|
19
|
+
/** Whether to normalize English words and numeric entities. Defaults to `false`. */
|
|
20
|
+
enable_preprocessing?: boolean;
|
|
21
|
+
/** TTS model to use. Defaults to `bulbul:v3`. */
|
|
22
|
+
model?: string;
|
|
19
23
|
/** Accepts any additional properties */
|
|
20
24
|
[key: string]: any;
|
|
21
25
|
}
|
|
22
26
|
export declare namespace SarvamTtsParams {
|
|
23
|
-
/** Target language code (e.g., en-IN) */
|
|
27
|
+
/** Target language code in BCP-47 format (e.g., `hi-IN`, `bn-IN`, `en-IN`). */
|
|
24
28
|
const TargetLanguageCode: {
|
|
25
29
|
readonly EnIn: "en-IN";
|
|
26
30
|
readonly HiIn: "hi-IN";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.SarvamTtsParams = void 0;
|
|
5
5
|
var SarvamTtsParams;
|
|
6
6
|
(function (SarvamTtsParams) {
|
|
7
|
-
/** Target language code (e.g., en-IN) */
|
|
7
|
+
/** Target language code in BCP-47 format (e.g., `hi-IN`, `bn-IN`, `en-IN`). */
|
|
8
8
|
SarvamTtsParams.TargetLanguageCode = {
|
|
9
9
|
EnIn: "en-IN",
|
|
10
10
|
HiIn: "hi-IN",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Agora from "../index.js";
|
|
2
|
-
export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Humeai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.GenericHttp | Agora.Tts.Xai | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun | Agora.Tts.Gradium | Agora.Tts.Mistral | Agora.Tts.Typecast | Agora.Tts.Smallestai;
|
|
2
|
+
export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Humeai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Gemini | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.GenericHttp | Agora.Tts.Xai | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun | Agora.Tts.Gradium | Agora.Tts.Mistral | Agora.Tts.Typecast | Agora.Tts.Smallestai;
|
|
3
3
|
export declare namespace Tts {
|
|
4
4
|
interface Tencent extends Agora.TencentTts {
|
|
5
5
|
vendor: "tencent";
|
|
@@ -37,6 +37,9 @@ export declare namespace Tts {
|
|
|
37
37
|
interface Google extends Agora.GoogleTts {
|
|
38
38
|
vendor: "google";
|
|
39
39
|
}
|
|
40
|
+
interface Gemini extends Agora.GeminiTts {
|
|
41
|
+
vendor: "gemini";
|
|
42
|
+
}
|
|
40
43
|
interface Amazon extends Agora.AmazonTts {
|
|
41
44
|
vendor: "amazon";
|
|
42
45
|
}
|
|
@@ -32,6 +32,8 @@ export * from "./FishAudioTts.js";
|
|
|
32
32
|
export * from "./FishAudioTtsParams.js";
|
|
33
33
|
export * from "./GeminiAsr.js";
|
|
34
34
|
export * from "./GeminiAsrParams.js";
|
|
35
|
+
export * from "./GeminiTts.js";
|
|
36
|
+
export * from "./GeminiTtsParams.js";
|
|
35
37
|
export * from "./GenericHttpTts.js";
|
|
36
38
|
export * from "./GenericHttpTtsParams.js";
|
|
37
39
|
export * from "./GoogleAsr.js";
|
|
@@ -73,6 +75,8 @@ export * from "./OpenAiTts.js";
|
|
|
73
75
|
export * from "./OpenAiTtsParams.js";
|
|
74
76
|
export * from "./RimeTts.js";
|
|
75
77
|
export * from "./RimeTtsParams.js";
|
|
78
|
+
export * from "./RtzrAsr.js";
|
|
79
|
+
export * from "./RtzrAsrParams.js";
|
|
76
80
|
export * from "./SarvamAsr.js";
|
|
77
81
|
export * from "./SarvamAsrParams.js";
|
|
78
82
|
export * from "./SarvamTts.js";
|
|
@@ -48,6 +48,8 @@ __exportStar(require("./FishAudioTts.js"), exports);
|
|
|
48
48
|
__exportStar(require("./FishAudioTtsParams.js"), exports);
|
|
49
49
|
__exportStar(require("./GeminiAsr.js"), exports);
|
|
50
50
|
__exportStar(require("./GeminiAsrParams.js"), exports);
|
|
51
|
+
__exportStar(require("./GeminiTts.js"), exports);
|
|
52
|
+
__exportStar(require("./GeminiTtsParams.js"), exports);
|
|
51
53
|
__exportStar(require("./GenericHttpTts.js"), exports);
|
|
52
54
|
__exportStar(require("./GenericHttpTtsParams.js"), exports);
|
|
53
55
|
__exportStar(require("./GoogleAsr.js"), exports);
|
|
@@ -89,6 +91,8 @@ __exportStar(require("./OpenAiTts.js"), exports);
|
|
|
89
91
|
__exportStar(require("./OpenAiTtsParams.js"), exports);
|
|
90
92
|
__exportStar(require("./RimeTts.js"), exports);
|
|
91
93
|
__exportStar(require("./RimeTtsParams.js"), exports);
|
|
94
|
+
__exportStar(require("./RtzrAsr.js"), exports);
|
|
95
|
+
__exportStar(require("./RtzrAsrParams.js"), exports);
|
|
92
96
|
__exportStar(require("./SarvamAsr.js"), exports);
|
|
93
97
|
__exportStar(require("./SarvamAsrParams.js"), exports);
|
|
94
98
|
__exportStar(require("./SarvamTts.js"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateBasicCredentials = validateBasicCredentials;
|
|
4
|
+
exports.validatePublicAuthorization = validatePublicAuthorization;
|
|
5
|
+
const base64_js_1 = require("../base64.js");
|
|
6
|
+
function validateBasicCredentials(customerId, customerSecret) {
|
|
7
|
+
if (typeof customerId !== "string" ||
|
|
8
|
+
!customerId.trim() ||
|
|
9
|
+
typeof customerSecret !== "string" ||
|
|
10
|
+
!customerSecret.trim())
|
|
11
|
+
throw new Error("customerId and customerSecret must both be non-empty strings");
|
|
12
|
+
if (customerId.includes(":"))
|
|
13
|
+
throw new Error("customerId must not contain ':'");
|
|
14
|
+
}
|
|
15
|
+
/** Validate public REST schemes without including credential values in errors. */
|
|
16
|
+
function validatePublicAuthorization(value) {
|
|
17
|
+
if (/^agora token=\S+$/i.test(value))
|
|
18
|
+
return;
|
|
19
|
+
const basic = /^Basic ([A-Za-z0-9+/]+={0,2})$/i.exec(value);
|
|
20
|
+
if (basic) {
|
|
21
|
+
try {
|
|
22
|
+
const decoded = (0, base64_js_1.base64Decode)(basic[1]);
|
|
23
|
+
// Exact UTF-8 round-trip also rejects malformed/noncanonical base64.
|
|
24
|
+
if ((0, base64_js_1.base64Encode)(decoded) !== basic[1])
|
|
25
|
+
throw new Error("Invalid encoding");
|
|
26
|
+
const separator = decoded.indexOf(":");
|
|
27
|
+
if (separator < 0)
|
|
28
|
+
throw new Error("Missing separator");
|
|
29
|
+
validateBasicCredentials(decoded.slice(0, separator), decoded.slice(separator + 1));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
catch (_a) {
|
|
33
|
+
throw new Error("Basic authorization requires valid base64 UTF-8 customerId:customerSecret credentials");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
throw new Error("Only Agora token or valid Basic authorization is supported");
|
|
37
|
+
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export type { AgoraAuthMode } from "./AgoraPoolClient.js";
|
|
2
2
|
export { AgoraClient } from "./AgoraPoolClient.js";
|
|
3
3
|
export type { AgoraArea, AreaScope, GlobalArea } from "./agentkit/area.js";
|
|
4
|
-
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, BaseMllmOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FengmingSTTOptions, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiOptions, GeminiPreviewVoice, GeminiSTTModel, GeminiSTTOptions, GeminiThinkingLevel, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GenericTTSOptions, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GradiumTTSOptions, GradiumTts, GradiumTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LemonSliceOptions, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, LlmVendor, McpServer, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MistralTTSOptions, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIGPTLiveOptions, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, PreviewFeature, PreviewRoute, ProtofaceOptions, QwenOmniOptions, RimeTTSOptions, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SmallestAISTTOptions, SmallestAITTSOptions, SmallestAiAsr, SmallestAiAsrParams, SmallestAiTts, SmallestAiTtsParams, SpatiusAvatarConfig, SpatiusAvatarOptions, SpatiusAvatarParams, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TavusOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTTSOptions, TypecastTts, TypecastTtsParams, VertexAILLMOptions, VertexAIOptions, XAiAsr, XAiAsrParams, XAiSTTOptions, XAiTTSOptions, XAiTts, XAiTtsParams, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.js";
|
|
5
|
-
export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, AzureOpenAIRealtime, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, createPreviewRoute, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, Gemini, GeminiLive, GeminiLiveModels, GeminiSTT, GeminiSTTModels, GeminiThinkingLevels, GeminiTranscriptionMode, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LemonSlice, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIGPTLive, OpenAIRealtime, OpenAISTT, OpenAITTS, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, Protoface, previewRequestHeaders, QwenOmni, REDACTED, RimeTTS, redactHeadersForDebug, redactSecrets, SalModeValues, SarvamSTT, SarvamTTS, SensetimeAvatar, SilenceActionValues, SmallestAISTT, SmallestAITTS, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, Tavus, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, TypecastTTS, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XAiSTT, XAiTTS, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.js";
|
|
6
|
-
export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./agentkit/preview/gemini-tts.js";
|
|
7
|
-
export { GeminiTTS, GeminiTTSModels } from "./agentkit/preview/gemini-tts.js";
|
|
4
|
+
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, BaseMllmOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FengmingSTTOptions, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiOptions, GeminiPreviewVoice, GeminiSTTModel, GeminiSTTOptions, GeminiThinkingLevel, GenerateClientTokenOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GenericTTSOptions, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GradiumTTSOptions, GradiumTts, GradiumTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LemonSliceOptions, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, LlmVendor, McpServer, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MistralTTSOptions, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIGPTLiveOptions, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, PreviewFeature, PreviewRoute, ProtofaceOptions, QwenOmniOptions, RimeTTSOptions, RimeTts, RimeTtsParams, RTZRSTTOptions, RtcConfig, RtzrAsr, RtzrAsrParams, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SmallestAISTTOptions, SmallestAITTSOptions, SmallestAiAsr, SmallestAiAsrParams, SmallestAiTts, SmallestAiTtsParams, SpatiusAvatarConfig, SpatiusAvatarOptions, SpatiusAvatarParams, SpeakConfig, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TavusOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTTSOptions, TypecastTts, TypecastTtsParams, VertexAILLMOptions, VertexAIOptions, XAiAsr, XAiAsrParams, XAiSTTOptions, XAiTTSOptions, XAiTts, XAiTtsParams, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.js";
|
|
5
|
+
export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, AzureOpenAIRealtime, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, createPreviewRoute, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, Gemini, GeminiLive, GeminiLiveModels, GeminiSTT, GeminiSTTModels, GeminiThinkingLevels, GeminiTranscriptionMode, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateClientToken, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LemonSlice, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIGPTLive, OpenAIRealtime, OpenAISTT, OpenAITTS, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, Protoface, previewRequestHeaders, QwenOmni, REDACTED, RimeTTS, RTZRSTT, redactHeadersForDebug, redactSecrets, SalModeValues, SarvamSTT, SarvamTTS, SarvamTTSLanguage, SensetimeAvatar, SilenceActionValues, SmallestAISTT, SmallestAITTS, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, Tavus, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, TypecastTTS, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XAiSTT, XAiTTS, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.js";
|
|
8
6
|
export { UnsupportedSessionOperationError } from "./agentkit/session-backend.js";
|
|
9
7
|
export type { AssignNumberOptions, DeployOptions, SaveOptions, SecretRef, VariableDefinition } from "./agentkit/v3.js";
|
|
10
8
|
export { DeployedAgent, NumberNotFoundError, SavedAgent, SecretRefNotSupportedError, secretRef, UnsupportedFieldError, } from "./agentkit/v3.js";
|
|
9
|
+
export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./agentkit/vendors/tts.js";
|
|
10
|
+
export { GeminiTTS, GeminiTTSModels } from "./agentkit/vendors/tts.js";
|
|
11
11
|
export * as Agora from "./api/index.js";
|
|
12
12
|
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
|
|
13
13
|
export { Area } from "./core/domain/index.js";
|
|
14
14
|
export { AgoraEnvironment } from "./environments.js";
|
|
15
15
|
export { AgoraError, AgoraTimeoutError } from "./errors/index.js";
|
|
16
16
|
export * from "./exports.js";
|
|
17
|
-
export type { V3, V3Options } from "./v3/index.js";
|
|
18
|
-
export { PreconditionFailedError, V3Client, V3Error } from "./v3/index.js";
|
|
17
|
+
export type { AnyV3Error, V3, V3ApiErrorOptions, V3ErrorCategory, V3ErrorOptions, V3Options, } from "./v3/index.js";
|
|
18
|
+
export { AgoraV3Error, PreconditionFailedError, V3Client, V3ConfigurationError, V3ConnectionError, V3Error, V3TimeoutError, V3ValidationError, } from "./v3/index.js";
|
package/dist/cjs/index.js
CHANGED
|
@@ -37,9 +37,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.GeminiLiveModels = exports.GeminiLive = exports.Gemini = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.FishAudioTTS = exports.FillerWordsSelectionRule = exports.FengmingSTT = exports.ExpiresIn = exports.ElevenLabsTTS = exports.Dify = exports.DeepSeekLLM = exports.DeepgramTTS = exports.DeepgramSTT = exports.DataChannel = exports.createPreviewRoute = exports.CustomLLM = exports.CredentialMode = exports.CosyVoiceTTS = exports.CartesiaTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.AzureOpenAIRealtime = exports.AzureOpenAI = exports.AudioScenario = exports.AssemblyAISTT = exports.AresSTT = exports.Anthropic = exports.AnamAvatar = exports.AmazonTTS = exports.AmazonSTT = exports.AmazonBedrock = exports.AliyunLLM = exports.AkoolAvatar = exports.AgentSession = exports.AgentPresets = exports.Agent = exports.AgoraClient = void 0;
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.V3Error = exports.V3Client = exports.PreconditionFailedError = exports.AgoraTimeoutError = exports.AgoraError = exports.AgoraEnvironment = exports.Area = exports.Agora = exports.UnsupportedFieldError = exports.secretRef = exports.SecretRefNotSupportedError = exports.SavedAgent = exports.NumberNotFoundError = exports.DeployedAgent = exports.UnsupportedSessionOperationError = void 0;
|
|
40
|
+
exports.OpenAISTT = exports.OpenAIRealtime = exports.OpenAIGPTLive = exports.OpenAI = exports.normalizePresetInput = exports.MurfTTS = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.MistralTTS = exports.MiniMaxTTS = exports.MiniMaxCNTTS = exports.MicrosoftTTS = exports.MicrosoftSTT = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.MAX_EXPIRY_SECONDS = exports.LiveAvatarAvatar = exports.LemonSlice = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.HumeAITTS = exports.HeyGenAvatar = exports.generateRtcToken = exports.generateConvoAIToken = exports.generateClientToken = exports.Groq = exports.GradiumTTS = exports.GoogleTTS = exports.GoogleSTT = exports.Geofence = exports.GenericTTS = exports.GenericAvatar = exports.GeminiTranscriptionMode = exports.GeminiThinkingLevels = exports.GeminiSTTModels = exports.GeminiSTT = void 0;
|
|
41
|
+
exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XaiGrok = exports.XAiTTS = exports.XAiSTT = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.VertexAILLM = exports.VertexAI = exports.toBaseAvatarConfig = exports.TypecastTTS = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.Tavus = exports.StepFunTTS = exports.SpeechmaticsSTT = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpatiusAvatar = exports.SmallestAITTS = exports.SmallestAISTT = exports.SilenceActionValues = exports.SensetimeAvatar = exports.SarvamTTSLanguage = exports.SarvamTTS = exports.SarvamSTT = exports.SalModeValues = exports.redactSecrets = exports.redactHeadersForDebug = exports.RTZRSTT = exports.RimeTTS = exports.REDACTED = exports.QwenOmni = exports.previewRequestHeaders = exports.Protoface = exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = exports.OpenAITTS = void 0;
|
|
42
|
+
exports.V3ValidationError = exports.V3TimeoutError = exports.V3Error = exports.V3ConnectionError = exports.V3ConfigurationError = exports.V3Client = exports.PreconditionFailedError = exports.AgoraV3Error = exports.AgoraTimeoutError = exports.AgoraError = exports.AgoraEnvironment = exports.Area = exports.Agora = exports.GeminiTTSModels = exports.GeminiTTS = exports.UnsupportedFieldError = exports.secretRef = exports.SecretRefNotSupportedError = exports.SavedAgent = exports.NumberNotFoundError = exports.DeployedAgent = exports.UnsupportedSessionOperationError = exports.XfyunSTT = void 0;
|
|
43
43
|
var AgoraPoolClient_js_1 = require("./AgoraPoolClient.js");
|
|
44
44
|
Object.defineProperty(exports, "AgoraClient", { enumerable: true, get: function () { return AgoraPoolClient_js_1.AgoraClient; } });
|
|
45
45
|
// Agentkit layer exports - clean, ergonomic API
|
|
@@ -106,6 +106,7 @@ Object.defineProperty(exports, "GoogleSTT", { enumerable: true, get: function ()
|
|
|
106
106
|
Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return index_js_1.GoogleTTS; } });
|
|
107
107
|
Object.defineProperty(exports, "GradiumTTS", { enumerable: true, get: function () { return index_js_1.GradiumTTS; } });
|
|
108
108
|
Object.defineProperty(exports, "Groq", { enumerable: true, get: function () { return index_js_1.Groq; } });
|
|
109
|
+
Object.defineProperty(exports, "generateClientToken", { enumerable: true, get: function () { return index_js_1.generateClientToken; } });
|
|
109
110
|
Object.defineProperty(exports, "generateConvoAIToken", { enumerable: true, get: function () { return index_js_1.generateConvoAIToken; } });
|
|
110
111
|
Object.defineProperty(exports, "generateRtcToken", { enumerable: true, get: function () { return index_js_1.generateRtcToken; } });
|
|
111
112
|
// Avatar vendors
|
|
@@ -156,11 +157,13 @@ Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get:
|
|
|
156
157
|
Object.defineProperty(exports, "QwenOmni", { enumerable: true, get: function () { return index_js_1.QwenOmni; } });
|
|
157
158
|
Object.defineProperty(exports, "REDACTED", { enumerable: true, get: function () { return index_js_1.REDACTED; } });
|
|
158
159
|
Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return index_js_1.RimeTTS; } });
|
|
160
|
+
Object.defineProperty(exports, "RTZRSTT", { enumerable: true, get: function () { return index_js_1.RTZRSTT; } });
|
|
159
161
|
Object.defineProperty(exports, "redactHeadersForDebug", { enumerable: true, get: function () { return index_js_1.redactHeadersForDebug; } });
|
|
160
162
|
Object.defineProperty(exports, "redactSecrets", { enumerable: true, get: function () { return index_js_1.redactSecrets; } });
|
|
161
163
|
Object.defineProperty(exports, "SalModeValues", { enumerable: true, get: function () { return index_js_1.SalModeValues; } });
|
|
162
164
|
Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return index_js_1.SarvamSTT; } });
|
|
163
165
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return index_js_1.SarvamTTS; } });
|
|
166
|
+
Object.defineProperty(exports, "SarvamTTSLanguage", { enumerable: true, get: function () { return index_js_1.SarvamTTSLanguage; } });
|
|
164
167
|
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return index_js_1.SensetimeAvatar; } });
|
|
165
168
|
Object.defineProperty(exports, "SilenceActionValues", { enumerable: true, get: function () { return index_js_1.SilenceActionValues; } });
|
|
166
169
|
Object.defineProperty(exports, "SmallestAISTT", { enumerable: true, get: function () { return index_js_1.SmallestAISTT; } });
|
|
@@ -197,9 +200,6 @@ Object.defineProperty(exports, "XaiGrok", { enumerable: true, get: function () {
|
|
|
197
200
|
Object.defineProperty(exports, "XfyunBigModelSTT", { enumerable: true, get: function () { return index_js_1.XfyunBigModelSTT; } });
|
|
198
201
|
Object.defineProperty(exports, "XfyunDialectSTT", { enumerable: true, get: function () { return index_js_1.XfyunDialectSTT; } });
|
|
199
202
|
Object.defineProperty(exports, "XfyunSTT", { enumerable: true, get: function () { return index_js_1.XfyunSTT; } });
|
|
200
|
-
var gemini_tts_js_1 = require("./agentkit/preview/gemini-tts.js");
|
|
201
|
-
Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTS; } });
|
|
202
|
-
Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTSModels; } });
|
|
203
203
|
var session_backend_js_1 = require("./agentkit/session-backend.js");
|
|
204
204
|
Object.defineProperty(exports, "UnsupportedSessionOperationError", { enumerable: true, get: function () { return session_backend_js_1.UnsupportedSessionOperationError; } });
|
|
205
205
|
var v3_js_1 = require("./agentkit/v3.js");
|
|
@@ -209,6 +209,9 @@ Object.defineProperty(exports, "SavedAgent", { enumerable: true, get: function (
|
|
|
209
209
|
Object.defineProperty(exports, "SecretRefNotSupportedError", { enumerable: true, get: function () { return v3_js_1.SecretRefNotSupportedError; } });
|
|
210
210
|
Object.defineProperty(exports, "secretRef", { enumerable: true, get: function () { return v3_js_1.secretRef; } });
|
|
211
211
|
Object.defineProperty(exports, "UnsupportedFieldError", { enumerable: true, get: function () { return v3_js_1.UnsupportedFieldError; } });
|
|
212
|
+
var tts_js_1 = require("./agentkit/vendors/tts.js");
|
|
213
|
+
Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return tts_js_1.GeminiTTS; } });
|
|
214
|
+
Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return tts_js_1.GeminiTTSModels; } });
|
|
212
215
|
exports.Agora = __importStar(require("./api/index.js"));
|
|
213
216
|
var index_js_2 = require("./core/domain/index.js");
|
|
214
217
|
Object.defineProperty(exports, "Area", { enumerable: true, get: function () { return index_js_2.Area; } });
|
|
@@ -219,6 +222,11 @@ Object.defineProperty(exports, "AgoraError", { enumerable: true, get: function (
|
|
|
219
222
|
Object.defineProperty(exports, "AgoraTimeoutError", { enumerable: true, get: function () { return index_js_3.AgoraTimeoutError; } });
|
|
220
223
|
__exportStar(require("./exports.js"), exports);
|
|
221
224
|
var index_js_4 = require("./v3/index.js");
|
|
225
|
+
Object.defineProperty(exports, "AgoraV3Error", { enumerable: true, get: function () { return index_js_4.AgoraV3Error; } });
|
|
222
226
|
Object.defineProperty(exports, "PreconditionFailedError", { enumerable: true, get: function () { return index_js_4.PreconditionFailedError; } });
|
|
223
227
|
Object.defineProperty(exports, "V3Client", { enumerable: true, get: function () { return index_js_4.V3Client; } });
|
|
228
|
+
Object.defineProperty(exports, "V3ConfigurationError", { enumerable: true, get: function () { return index_js_4.V3ConfigurationError; } });
|
|
229
|
+
Object.defineProperty(exports, "V3ConnectionError", { enumerable: true, get: function () { return index_js_4.V3ConnectionError; } });
|
|
224
230
|
Object.defineProperty(exports, "V3Error", { enumerable: true, get: function () { return index_js_4.V3Error; } });
|
|
231
|
+
Object.defineProperty(exports, "V3TimeoutError", { enumerable: true, get: function () { return index_js_4.V3TimeoutError; } });
|
|
232
|
+
Object.defineProperty(exports, "V3ValidationError", { enumerable: true, get: function () { return index_js_4.V3ValidationError; } });
|
package/dist/cjs/v3/campaigns.js
CHANGED
|
@@ -26,6 +26,7 @@ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _ar
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.CampaignsResource = void 0;
|
|
29
|
+
const errors_js_1 = require("./errors.js");
|
|
29
30
|
const transport_js_1 = require("./transport.js");
|
|
30
31
|
class CampaignsResource {
|
|
31
32
|
constructor(transport) {
|
|
@@ -45,12 +46,14 @@ class CampaignsResource {
|
|
|
45
46
|
const seen = new Set();
|
|
46
47
|
let cursor = request === null || request === void 0 ? void 0 : request.cursor;
|
|
47
48
|
while (true) {
|
|
48
|
-
const page = yield __await(this.list(Object.assign(Object.assign({}, request), { cursor }), options));
|
|
49
|
+
const { data: page, rawResponse } = yield __await(this.list(Object.assign(Object.assign({}, request), { cursor }), options).withRawResponse());
|
|
49
50
|
yield __await(yield* __asyncDelegator(__asyncValues(page.data.list)));
|
|
50
51
|
if (!page.has_more)
|
|
51
52
|
return yield __await(void 0);
|
|
52
53
|
if (!page.next_cursor || seen.has(page.next_cursor))
|
|
53
|
-
throw new
|
|
54
|
+
throw new errors_js_1.V3Error(rawResponse.status, page, rawResponse, {
|
|
55
|
+
message: "Invalid repeated or missing pagination cursor",
|
|
56
|
+
});
|
|
54
57
|
cursor = page.next_cursor;
|
|
55
58
|
seen.add(cursor);
|
|
56
59
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured error taxonomy for the v3 preview API.
|
|
3
|
+
*
|
|
4
|
+
* Every error raised by a `client.v3.*` operation, and by the AgentKit paths that
|
|
5
|
+
* call it, is an {@link AgoraV3Error} in exactly one {@link V3ErrorCategory}:
|
|
6
|
+
*
|
|
7
|
+
* - `validation` {@link V3ValidationError}: input rejected locally before any request.
|
|
8
|
+
* - `configuration` {@link V3ConfigurationError}: the client itself is misconfigured.
|
|
9
|
+
* - `connection` {@link V3ConnectionError}: the request could not complete;
|
|
10
|
+
* {@link V3TimeoutError} is its timeout subtype.
|
|
11
|
+
* - `api` {@link V3Error}: a non-2xx response, or a 2xx response that violates
|
|
12
|
+
* the API contract; {@link PreconditionFailedError} is its 412 subtype.
|
|
13
|
+
*
|
|
14
|
+
* The category names and meanings are shared with the Go and Python SDKs.
|
|
15
|
+
*/
|
|
16
|
+
import type { RawResponse } from "../core/fetcher/RawResponse.js";
|
|
17
|
+
import type { ErrorReason } from "./types.js";
|
|
18
|
+
/** The failure kind shared by every v3 error. Subtypes keep their parent's category. */
|
|
19
|
+
export type V3ErrorCategory = "validation" | "configuration" | "connection" | "api";
|
|
20
|
+
/** Constructor options for v3 errors. Mirrors ES2022 `ErrorOptions`. */
|
|
21
|
+
export interface V3ErrorOptions {
|
|
22
|
+
/** The underlying error, exposed as the standard `error.cause`. */
|
|
23
|
+
cause?: unknown;
|
|
24
|
+
}
|
|
25
|
+
/** Root of every v3 error. Catch this to handle any failure from a v3 operation. */
|
|
26
|
+
export declare abstract class AgoraV3Error extends Error {
|
|
27
|
+
/** Which of the four shared categories this error belongs to. */
|
|
28
|
+
abstract readonly category: V3ErrorCategory;
|
|
29
|
+
/** The underlying error, when this error wraps one. */
|
|
30
|
+
readonly cause?: unknown;
|
|
31
|
+
constructor(message: string, options?: V3ErrorOptions);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The caller's input was rejected locally, before any HTTP request was sent:
|
|
35
|
+
* invalid identifiers, bodies, secret names, idempotency keys, unsupported
|
|
36
|
+
* fields or options, or conflicting options.
|
|
37
|
+
*/
|
|
38
|
+
export declare class V3ValidationError extends AgoraV3Error {
|
|
39
|
+
get category(): "validation";
|
|
40
|
+
constructor(message: string, options?: V3ErrorOptions);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The client itself is misconfigured, such as an invalid `v3.baseUrl` origin or
|
|
44
|
+
* missing or conflicting credentials. A deployment problem, not a bad request.
|
|
45
|
+
*/
|
|
46
|
+
export declare class V3ConfigurationError extends AgoraV3Error {
|
|
47
|
+
get category(): "configuration";
|
|
48
|
+
constructor(message: string, options?: V3ErrorOptions);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The request could not complete: DNS failure, refused or reset connection, TLS
|
|
52
|
+
* failure, an aborted request or body. The underlying error, when the runtime
|
|
53
|
+
* reported one, is available as `cause`.
|
|
54
|
+
*/
|
|
55
|
+
export declare class V3ConnectionError extends AgoraV3Error {
|
|
56
|
+
get category(): "connection";
|
|
57
|
+
constructor(message: string, options?: V3ErrorOptions);
|
|
58
|
+
}
|
|
59
|
+
/** The request exceeded its timeout (`timeoutInSeconds`). A {@link V3ConnectionError}. */
|
|
60
|
+
export declare class V3TimeoutError extends V3ConnectionError {
|
|
61
|
+
constructor(message: string, options?: V3ErrorOptions);
|
|
62
|
+
}
|
|
63
|
+
/** Options for {@link V3Error}. */
|
|
64
|
+
export interface V3ApiErrorOptions extends V3ErrorOptions {
|
|
65
|
+
/** Overrides the default `v3 request failed (<status>)` message. */
|
|
66
|
+
message?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A non-2xx response, or a 2xx response that violates the API contract (a body that
|
|
70
|
+
* is not valid JSON, or missing required data such as an ETag); `statusCode` is then
|
|
71
|
+
* the 2xx status. `body` is the parsed JSON body when available, otherwise the text.
|
|
72
|
+
*/
|
|
73
|
+
export declare class V3Error extends AgoraV3Error {
|
|
74
|
+
readonly statusCode: number;
|
|
75
|
+
readonly body: unknown;
|
|
76
|
+
readonly rawResponse: RawResponse;
|
|
77
|
+
get category(): "api";
|
|
78
|
+
constructor(statusCode: number, body: unknown, rawResponse: RawResponse, options?: V3ApiErrorOptions);
|
|
79
|
+
/** Response headers. */
|
|
80
|
+
get headers(): Headers;
|
|
81
|
+
/** The `Agora-Request-Id` response header; quote it when contacting support. */
|
|
82
|
+
get requestId(): string | null;
|
|
83
|
+
/** Human-readable `detail` from the error body, when present. */
|
|
84
|
+
get detail(): string | undefined;
|
|
85
|
+
/** Machine-readable `reason` from the error body (for example `"AgentNotFound"`), when present. */
|
|
86
|
+
get reason(): ErrorReason | (string & {}) | undefined;
|
|
87
|
+
}
|
|
88
|
+
/** The `If-Match` / `If-None-Match` precondition failed (HTTP 412). A {@link V3Error}. */
|
|
89
|
+
export declare class PreconditionFailedError extends V3Error {
|
|
90
|
+
private readonly reload;
|
|
91
|
+
constructor(body: unknown, raw: RawResponse, reload: () => Promise<unknown>, options?: V3ApiErrorOptions);
|
|
92
|
+
/** Re-read the resource to obtain its current representation and ETag. */
|
|
93
|
+
latest(): Promise<unknown>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Union of the four category classes, discriminated by `category`:
|
|
97
|
+
* `if (error.category === "api") error.statusCode` narrows without `instanceof`.
|
|
98
|
+
*/
|
|
99
|
+
export type AnyV3Error = V3ValidationError | V3ConfigurationError | V3ConnectionError | V3Error;
|
|
100
|
+
/** @internal Register an error class defined outside this module for cross-build `instanceof`. */
|
|
101
|
+
export declare function registerV3ErrorClass(target: abstract new (...args: never[]) => AgoraV3Error, name: string): void;
|
|
102
|
+
/** @internal Run a local validator and rethrow its plain errors as {@link V3ValidationError}. */
|
|
103
|
+
export declare function asValidation<T>(run: () => T): T;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreconditionFailedError = exports.V3Error = exports.V3TimeoutError = exports.V3ConnectionError = exports.V3ConfigurationError = exports.V3ValidationError = exports.AgoraV3Error = void 0;
|
|
4
|
+
exports.registerV3ErrorClass = registerV3ErrorClass;
|
|
5
|
+
exports.asValidation = asValidation;
|
|
6
|
+
// Instances carry the tags of every taxonomy class in their chain under a
|
|
7
|
+
// registry symbol, so `instanceof` also holds when an application ends up with
|
|
8
|
+
// both the CommonJS and ESM builds (or two installed copies) of this package.
|
|
9
|
+
const BRANDS = Symbol.for("agora-agents.v3.error-brands");
|
|
10
|
+
const TAGS = new WeakMap();
|
|
11
|
+
function tag(target, name) {
|
|
12
|
+
TAGS.set(target, `agora-agents.${name}`);
|
|
13
|
+
}
|
|
14
|
+
/** Root of every v3 error. Catch this to handle any failure from a v3 operation. */
|
|
15
|
+
class AgoraV3Error extends Error {
|
|
16
|
+
constructor(message, options) {
|
|
17
|
+
super(message);
|
|
18
|
+
// Native classes already get the right prototype; keep it explicit for
|
|
19
|
+
// consumers that down-level this package to ES5.
|
|
20
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
21
|
+
this.name = "AgoraV3Error";
|
|
22
|
+
if (options !== undefined && "cause" in options) {
|
|
23
|
+
Object.defineProperty(this, "cause", {
|
|
24
|
+
value: options.cause,
|
|
25
|
+
writable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
enumerable: false,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const brands = [];
|
|
31
|
+
for (let ctor = new.target; typeof ctor === "function"; ctor = Object.getPrototypeOf(ctor)) {
|
|
32
|
+
const name = TAGS.get(ctor);
|
|
33
|
+
if (name !== undefined)
|
|
34
|
+
brands.push(name);
|
|
35
|
+
}
|
|
36
|
+
Object.defineProperty(this, BRANDS, { value: brands, enumerable: false });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.AgoraV3Error = AgoraV3Error;
|
|
40
|
+
// Inherited by every subclass; `this` is the class on the right of `instanceof`.
|
|
41
|
+
Object.defineProperty(AgoraV3Error, Symbol.hasInstance, {
|
|
42
|
+
value: function hasInstance(value) {
|
|
43
|
+
if (Function.prototype[Symbol.hasInstance].call(this, value))
|
|
44
|
+
return true;
|
|
45
|
+
const name = TAGS.get(this);
|
|
46
|
+
if (name === undefined || value === null || typeof value !== "object")
|
|
47
|
+
return false;
|
|
48
|
+
const brands = value[BRANDS];
|
|
49
|
+
return Array.isArray(brands) && brands.includes(name);
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* The caller's input was rejected locally, before any HTTP request was sent:
|
|
54
|
+
* invalid identifiers, bodies, secret names, idempotency keys, unsupported
|
|
55
|
+
* fields or options, or conflicting options.
|
|
56
|
+
*/
|
|
57
|
+
class V3ValidationError extends AgoraV3Error {
|
|
58
|
+
get category() {
|
|
59
|
+
return "validation";
|
|
60
|
+
}
|
|
61
|
+
constructor(message, options) {
|
|
62
|
+
super(message, options);
|
|
63
|
+
this.name = "V3ValidationError";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.V3ValidationError = V3ValidationError;
|
|
67
|
+
/**
|
|
68
|
+
* The client itself is misconfigured, such as an invalid `v3.baseUrl` origin or
|
|
69
|
+
* missing or conflicting credentials. A deployment problem, not a bad request.
|
|
70
|
+
*/
|
|
71
|
+
class V3ConfigurationError extends AgoraV3Error {
|
|
72
|
+
get category() {
|
|
73
|
+
return "configuration";
|
|
74
|
+
}
|
|
75
|
+
constructor(message, options) {
|
|
76
|
+
super(message, options);
|
|
77
|
+
this.name = "V3ConfigurationError";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.V3ConfigurationError = V3ConfigurationError;
|
|
81
|
+
/**
|
|
82
|
+
* The request could not complete: DNS failure, refused or reset connection, TLS
|
|
83
|
+
* failure, an aborted request or body. The underlying error, when the runtime
|
|
84
|
+
* reported one, is available as `cause`.
|
|
85
|
+
*/
|
|
86
|
+
class V3ConnectionError extends AgoraV3Error {
|
|
87
|
+
get category() {
|
|
88
|
+
return "connection";
|
|
89
|
+
}
|
|
90
|
+
constructor(message, options) {
|
|
91
|
+
super(message, options);
|
|
92
|
+
this.name = "V3ConnectionError";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.V3ConnectionError = V3ConnectionError;
|
|
96
|
+
/** The request exceeded its timeout (`timeoutInSeconds`). A {@link V3ConnectionError}. */
|
|
97
|
+
class V3TimeoutError extends V3ConnectionError {
|
|
98
|
+
constructor(message, options) {
|
|
99
|
+
super(message, options);
|
|
100
|
+
this.name = "V3TimeoutError";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.V3TimeoutError = V3TimeoutError;
|
|
104
|
+
function stringField(body, key) {
|
|
105
|
+
if (body === null || typeof body !== "object" || Array.isArray(body))
|
|
106
|
+
return undefined;
|
|
107
|
+
const value = body[key];
|
|
108
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A non-2xx response, or a 2xx response that violates the API contract (a body that
|
|
112
|
+
* is not valid JSON, or missing required data such as an ETag); `statusCode` is then
|
|
113
|
+
* the 2xx status. `body` is the parsed JSON body when available, otherwise the text.
|
|
114
|
+
*/
|
|
115
|
+
class V3Error extends AgoraV3Error {
|
|
116
|
+
get category() {
|
|
117
|
+
return "api";
|
|
118
|
+
}
|
|
119
|
+
constructor(statusCode, body, rawResponse, options) {
|
|
120
|
+
var _a;
|
|
121
|
+
super((_a = options === null || options === void 0 ? void 0 : options.message) !== null && _a !== void 0 ? _a : `v3 request failed (${statusCode})`, options);
|
|
122
|
+
this.statusCode = statusCode;
|
|
123
|
+
this.body = body;
|
|
124
|
+
this.rawResponse = rawResponse;
|
|
125
|
+
this.name = "V3Error";
|
|
126
|
+
}
|
|
127
|
+
/** Response headers. */
|
|
128
|
+
get headers() {
|
|
129
|
+
return this.rawResponse.headers;
|
|
130
|
+
}
|
|
131
|
+
/** The `Agora-Request-Id` response header; quote it when contacting support. */
|
|
132
|
+
get requestId() {
|
|
133
|
+
return this.rawResponse.headers.get("Agora-Request-Id");
|
|
134
|
+
}
|
|
135
|
+
/** Human-readable `detail` from the error body, when present. */
|
|
136
|
+
get detail() {
|
|
137
|
+
return stringField(this.body, "detail");
|
|
138
|
+
}
|
|
139
|
+
/** Machine-readable `reason` from the error body (for example `"AgentNotFound"`), when present. */
|
|
140
|
+
get reason() {
|
|
141
|
+
return stringField(this.body, "reason");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.V3Error = V3Error;
|
|
145
|
+
/** The `If-Match` / `If-None-Match` precondition failed (HTTP 412). A {@link V3Error}. */
|
|
146
|
+
class PreconditionFailedError extends V3Error {
|
|
147
|
+
constructor(body, raw, reload, options) {
|
|
148
|
+
super(412, body, raw, options);
|
|
149
|
+
this.reload = reload;
|
|
150
|
+
this.name = "PreconditionFailedError";
|
|
151
|
+
}
|
|
152
|
+
/** Re-read the resource to obtain its current representation and ETag. */
|
|
153
|
+
latest() {
|
|
154
|
+
return this.reload();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.PreconditionFailedError = PreconditionFailedError;
|
|
158
|
+
tag(AgoraV3Error, "AgoraV3Error");
|
|
159
|
+
tag(V3ValidationError, "V3ValidationError");
|
|
160
|
+
tag(V3ConfigurationError, "V3ConfigurationError");
|
|
161
|
+
tag(V3ConnectionError, "V3ConnectionError");
|
|
162
|
+
tag(V3TimeoutError, "V3TimeoutError");
|
|
163
|
+
tag(V3Error, "V3Error");
|
|
164
|
+
tag(PreconditionFailedError, "PreconditionFailedError");
|
|
165
|
+
/** @internal Register an error class defined outside this module for cross-build `instanceof`. */
|
|
166
|
+
function registerV3ErrorClass(target, name) {
|
|
167
|
+
tag(target, name);
|
|
168
|
+
}
|
|
169
|
+
/** @internal Run a local validator and rethrow its plain errors as {@link V3ValidationError}. */
|
|
170
|
+
function asValidation(run) {
|
|
171
|
+
try {
|
|
172
|
+
return run();
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
if (error instanceof AgoraV3Error || !(error instanceof Error))
|
|
176
|
+
throw error;
|
|
177
|
+
throw new V3ValidationError(error.message, { cause: error });
|
|
178
|
+
}
|
|
179
|
+
}
|
package/dist/cjs/v3/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { CampaignsResource } from "./campaigns.js";
|
|
|
2
2
|
export { CampaignsResource } from "./campaigns.js";
|
|
3
3
|
import { AgentsResource, NumbersResource, SecretsResource, SessionsResource } from "./resources.js";
|
|
4
4
|
import type { V3Transport } from "./transport.js";
|
|
5
|
+
export type { AnyV3Error, V3ApiErrorOptions, V3ErrorCategory, V3ErrorOptions } from "./errors.js";
|
|
6
|
+
export { AgoraV3Error, PreconditionFailedError, V3ConfigurationError, V3ConnectionError, V3Error, V3TimeoutError, V3ValidationError, } from "./errors.js";
|
|
5
7
|
export * from "./resources.js";
|
|
6
8
|
export * from "./transport.js";
|
|
7
9
|
export * as V3 from "./types.js";
|
package/dist/cjs/v3/index.js
CHANGED
|
@@ -36,11 +36,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.V3Client = exports.V3 = exports.CampaignsResource = void 0;
|
|
39
|
+
exports.V3Client = exports.V3 = exports.V3ValidationError = exports.V3TimeoutError = exports.V3Error = exports.V3ConnectionError = exports.V3ConfigurationError = exports.PreconditionFailedError = exports.AgoraV3Error = exports.CampaignsResource = void 0;
|
|
40
40
|
const campaigns_js_1 = require("./campaigns.js");
|
|
41
41
|
var campaigns_js_2 = require("./campaigns.js");
|
|
42
42
|
Object.defineProperty(exports, "CampaignsResource", { enumerable: true, get: function () { return campaigns_js_2.CampaignsResource; } });
|
|
43
43
|
const resources_js_1 = require("./resources.js");
|
|
44
|
+
var errors_js_1 = require("./errors.js");
|
|
45
|
+
Object.defineProperty(exports, "AgoraV3Error", { enumerable: true, get: function () { return errors_js_1.AgoraV3Error; } });
|
|
46
|
+
Object.defineProperty(exports, "PreconditionFailedError", { enumerable: true, get: function () { return errors_js_1.PreconditionFailedError; } });
|
|
47
|
+
Object.defineProperty(exports, "V3ConfigurationError", { enumerable: true, get: function () { return errors_js_1.V3ConfigurationError; } });
|
|
48
|
+
Object.defineProperty(exports, "V3ConnectionError", { enumerable: true, get: function () { return errors_js_1.V3ConnectionError; } });
|
|
49
|
+
Object.defineProperty(exports, "V3Error", { enumerable: true, get: function () { return errors_js_1.V3Error; } });
|
|
50
|
+
Object.defineProperty(exports, "V3TimeoutError", { enumerable: true, get: function () { return errors_js_1.V3TimeoutError; } });
|
|
51
|
+
Object.defineProperty(exports, "V3ValidationError", { enumerable: true, get: function () { return errors_js_1.V3ValidationError; } });
|
|
44
52
|
__exportStar(require("./resources.js"), exports);
|
|
45
53
|
__exportStar(require("./transport.js"), exports);
|
|
46
54
|
exports.V3 = __importStar(require("./types.js"));
|