@wave-av/sdk 2.0.4 → 2.0.5
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/audience.d.ts +105 -0
- package/dist/audience.d.ts.map +1 -0
- package/dist/billing-types.d.ts +39 -0
- package/dist/billing-types.d.ts.map +1 -0
- package/dist/billing-types.js +18 -0
- package/dist/billing-types.mjs +0 -0
- package/dist/billing.d.ts +69 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +139 -0
- package/dist/billing.mjs +9 -0
- package/dist/camera-control.d.ts +55 -0
- package/dist/camera-control.d.ts.map +1 -0
- package/dist/captions-types.d.ts +119 -0
- package/dist/captions-types.d.ts.map +1 -0
- package/dist/captions.d.ts +218 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/chapters-types.d.ts +87 -0
- package/dist/chapters-types.d.ts.map +1 -0
- package/dist/chapters.d.ts +207 -0
- package/dist/chapters.d.ts.map +1 -0
- package/dist/chunk-I3V47I4W.mjs +114 -0
- package/dist/client-types.d.ts +59 -0
- package/dist/client-types.d.ts.map +1 -0
- package/dist/client.d.ts +119 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/clips-types.d.ts +31 -0
- package/dist/clips-types.d.ts.map +1 -0
- package/dist/clips.d.ts +230 -0
- package/dist/clips.d.ts.map +1 -0
- package/dist/cloud-switcher.d.ts +66 -0
- package/dist/cloud-switcher.d.ts.map +1 -0
- package/dist/collab-types.d.ts +205 -0
- package/dist/collab-types.d.ts.map +1 -0
- package/dist/collab.d.ts +227 -0
- package/dist/collab.d.ts.map +1 -0
- package/dist/connect.d.ts +89 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/creator.d.ts +110 -0
- package/dist/creator.d.ts.map +1 -0
- package/dist/desktop.d.ts +96 -0
- package/dist/desktop.d.ts.map +1 -0
- package/dist/distribution.d.ts +93 -0
- package/dist/distribution.d.ts.map +1 -0
- package/dist/drm.d.ts +88 -0
- package/dist/drm.d.ts.map +1 -0
- package/dist/edge.d.ts +113 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/editor-types.d.ts +237 -0
- package/dist/editor-types.d.ts.map +1 -0
- package/dist/editor.d.ts +207 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/fleet.d.ts +208 -0
- package/dist/fleet.d.ts.map +1 -0
- package/dist/ghost.d.ts +214 -0
- package/dist/ghost.d.ts.map +1 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +114 -0
- package/dist/index.mjs +49 -43
- package/dist/marketplace.d.ts +91 -0
- package/dist/marketplace.d.ts.map +1 -0
- package/dist/mesh.d.ts +238 -0
- package/dist/mesh.d.ts.map +1 -0
- package/dist/notifications.d.ts +83 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/phone-types.d.ts +111 -0
- package/dist/phone-types.d.ts.map +1 -0
- package/dist/phone.d.ts +235 -0
- package/dist/phone.d.ts.map +1 -0
- package/dist/pipeline-types.d.ts +188 -0
- package/dist/pipeline-types.d.ts.map +1 -0
- package/dist/pipeline.d.ts +224 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/podcast.d.ts +114 -0
- package/dist/podcast.d.ts.map +1 -0
- package/dist/prism.d.ts +133 -0
- package/dist/prism.d.ts.map +1 -0
- package/dist/prompter.d.ts +185 -0
- package/dist/prompter.d.ts.map +1 -0
- package/dist/pulse.d.ts +157 -0
- package/dist/pulse.d.ts.map +1 -0
- package/dist/qr.d.ts +83 -0
- package/dist/qr.d.ts.map +1 -0
- package/dist/replay.d.ts +53 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/scene-types.d.ts +191 -0
- package/dist/scene-types.d.ts.map +1 -0
- package/dist/scene.d.ts +214 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/search-types.d.ts +211 -0
- package/dist/search-types.d.ts.map +1 -0
- package/dist/search.d.ts +251 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/sentiment-types.d.ts +108 -0
- package/dist/sentiment-types.d.ts.map +1 -0
- package/dist/sentiment.d.ts +247 -0
- package/dist/sentiment.d.ts.map +1 -0
- package/dist/signage.d.ts +102 -0
- package/dist/signage.d.ts.map +1 -0
- package/dist/slides.d.ts +69 -0
- package/dist/slides.d.ts.map +1 -0
- package/dist/studio-ai-types.d.ts +199 -0
- package/dist/studio-ai-types.d.ts.map +1 -0
- package/dist/studio-ai.d.ts +219 -0
- package/dist/studio-ai.d.ts.map +1 -0
- package/dist/studio-types.d.ts +268 -0
- package/dist/studio-types.d.ts.map +1 -0
- package/dist/studio.d.ts +235 -0
- package/dist/studio.d.ts.map +1 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/transcribe-types.d.ts +154 -0
- package/dist/transcribe-types.d.ts.map +1 -0
- package/dist/transcribe.d.ts +219 -0
- package/dist/transcribe.d.ts.map +1 -0
- package/dist/usb.d.ts +65 -0
- package/dist/usb.d.ts.map +1 -0
- package/dist/vault.d.ts +122 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/voice-types.d.ts +107 -0
- package/dist/voice-types.d.ts.map +1 -0
- package/dist/voice.d.ts +178 -0
- package/dist/voice.d.ts.map +1 -0
- package/dist/zoom.d.ts +92 -0
- package/dist/zoom.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Search API
|
|
3
|
+
*
|
|
4
|
+
* Search across media content using text, visual, and audio queries.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This is a client SDK. All authorization checks are performed server-side.
|
|
7
|
+
* The API will return 403 Forbidden if the user lacks required permissions.
|
|
8
|
+
*/
|
|
9
|
+
import type { WaveClient, PaginationParams, PaginatedResponse } from './client';
|
|
10
|
+
export * from './search-types';
|
|
11
|
+
import type { AudioSearchRequest, IndexStatus, SearchFilters, SearchRequest, SearchResponse, SearchResult, SearchResultType, SearchSuggestion, VisualSearchRequest } from './search-types';
|
|
12
|
+
export declare class SearchAPI {
|
|
13
|
+
private readonly client;
|
|
14
|
+
private readonly basePath;
|
|
15
|
+
constructor(client: WaveClient);
|
|
16
|
+
/**
|
|
17
|
+
* Search content
|
|
18
|
+
*
|
|
19
|
+
* Requires: search:query permission
|
|
20
|
+
*/
|
|
21
|
+
search(request: SearchRequest): Promise<SearchResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Quick search (simplified API)
|
|
24
|
+
*
|
|
25
|
+
* Requires: search:query permission
|
|
26
|
+
*/
|
|
27
|
+
quickSearch(query: string, options?: {
|
|
28
|
+
types?: SearchResultType[];
|
|
29
|
+
limit?: number;
|
|
30
|
+
filters?: SearchFilters;
|
|
31
|
+
}): Promise<SearchResult[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Search within a specific media
|
|
34
|
+
*
|
|
35
|
+
* Requires: search:query permission
|
|
36
|
+
*/
|
|
37
|
+
searchInMedia(mediaId: string, mediaType: 'video' | 'audio' | 'clip' | 'stream', query: string, options?: {
|
|
38
|
+
limit?: number;
|
|
39
|
+
}): Promise<Array<{
|
|
40
|
+
timestamp: number;
|
|
41
|
+
end_timestamp?: number;
|
|
42
|
+
text?: string;
|
|
43
|
+
score: number;
|
|
44
|
+
type: 'speech' | 'visual' | 'chapter';
|
|
45
|
+
}>>;
|
|
46
|
+
/**
|
|
47
|
+
* Visual search (search by image)
|
|
48
|
+
*
|
|
49
|
+
* Requires: search:visual permission
|
|
50
|
+
*/
|
|
51
|
+
visualSearch(request: VisualSearchRequest): Promise<SearchResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Find similar frames
|
|
54
|
+
*
|
|
55
|
+
* Requires: search:visual permission
|
|
56
|
+
*/
|
|
57
|
+
findSimilarFrames(mediaId: string, timestamp: number, options?: {
|
|
58
|
+
limit?: number;
|
|
59
|
+
min_similarity?: number;
|
|
60
|
+
}): Promise<Array<{
|
|
61
|
+
media_id: string;
|
|
62
|
+
media_type: string;
|
|
63
|
+
timestamp: number;
|
|
64
|
+
thumbnail_url: string;
|
|
65
|
+
similarity: number;
|
|
66
|
+
}>>;
|
|
67
|
+
/**
|
|
68
|
+
* Detect objects in media
|
|
69
|
+
*
|
|
70
|
+
* Requires: search:visual permission
|
|
71
|
+
*/
|
|
72
|
+
detectObjects(mediaId: string, options?: {
|
|
73
|
+
timestamps?: number[];
|
|
74
|
+
confidence_threshold?: number;
|
|
75
|
+
}): Promise<Array<{
|
|
76
|
+
timestamp: number;
|
|
77
|
+
objects: Array<{
|
|
78
|
+
label: string;
|
|
79
|
+
confidence: number;
|
|
80
|
+
bounding_box: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
}>>;
|
|
88
|
+
/**
|
|
89
|
+
* Audio search (search by audio)
|
|
90
|
+
*
|
|
91
|
+
* Requires: search:audio permission
|
|
92
|
+
*/
|
|
93
|
+
audioSearch(request: AudioSearchRequest): Promise<SearchResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Find similar audio segments
|
|
96
|
+
*
|
|
97
|
+
* Requires: search:audio permission
|
|
98
|
+
*/
|
|
99
|
+
findSimilarAudio(mediaId: string, startTime: number, endTime: number, options?: {
|
|
100
|
+
limit?: number;
|
|
101
|
+
min_similarity?: number;
|
|
102
|
+
}): Promise<Array<{
|
|
103
|
+
media_id: string;
|
|
104
|
+
media_type: string;
|
|
105
|
+
start_time: number;
|
|
106
|
+
end_time: number;
|
|
107
|
+
similarity: number;
|
|
108
|
+
}>>;
|
|
109
|
+
/**
|
|
110
|
+
* Detect music in media
|
|
111
|
+
*
|
|
112
|
+
* Requires: search:audio permission
|
|
113
|
+
*/
|
|
114
|
+
detectMusic(mediaId: string): Promise<Array<{
|
|
115
|
+
start_time: number;
|
|
116
|
+
end_time: number;
|
|
117
|
+
confidence: number;
|
|
118
|
+
music_info?: {
|
|
119
|
+
title?: string;
|
|
120
|
+
artist?: string;
|
|
121
|
+
album?: string;
|
|
122
|
+
isrc?: string;
|
|
123
|
+
};
|
|
124
|
+
}>>;
|
|
125
|
+
/**
|
|
126
|
+
* Get search suggestions
|
|
127
|
+
*
|
|
128
|
+
* Requires: search:query permission
|
|
129
|
+
*/
|
|
130
|
+
getSuggestions(prefix: string, options?: {
|
|
131
|
+
limit?: number;
|
|
132
|
+
types?: SearchResultType[];
|
|
133
|
+
}): Promise<SearchSuggestion[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Get trending searches
|
|
136
|
+
*
|
|
137
|
+
* Requires: search:query permission
|
|
138
|
+
*/
|
|
139
|
+
getTrending(options?: {
|
|
140
|
+
limit?: number;
|
|
141
|
+
timeframe?: 'hour' | 'day' | 'week';
|
|
142
|
+
}): Promise<Array<{
|
|
143
|
+
query: string;
|
|
144
|
+
count: number;
|
|
145
|
+
trend: number;
|
|
146
|
+
}>>;
|
|
147
|
+
/**
|
|
148
|
+
* Index media for search
|
|
149
|
+
*
|
|
150
|
+
* Requires: search:index permission
|
|
151
|
+
*/
|
|
152
|
+
indexMedia(mediaId: string, mediaType: 'video' | 'audio' | 'clip' | 'stream', options?: {
|
|
153
|
+
features?: ('transcript' | 'visual' | 'audio' | 'metadata')[];
|
|
154
|
+
priority?: 'low' | 'normal' | 'high';
|
|
155
|
+
webhook_url?: string;
|
|
156
|
+
}): Promise<IndexStatus>;
|
|
157
|
+
/**
|
|
158
|
+
* Get index status
|
|
159
|
+
*
|
|
160
|
+
* Requires: search:read permission
|
|
161
|
+
*/
|
|
162
|
+
getIndexStatus(mediaId: string): Promise<IndexStatus>;
|
|
163
|
+
/**
|
|
164
|
+
* Reindex media
|
|
165
|
+
*
|
|
166
|
+
* Requires: search:index permission
|
|
167
|
+
*/
|
|
168
|
+
reindexMedia(mediaId: string, options?: {
|
|
169
|
+
features?: ('transcript' | 'visual' | 'audio' | 'metadata')[];
|
|
170
|
+
}): Promise<IndexStatus>;
|
|
171
|
+
/**
|
|
172
|
+
* Remove media from index
|
|
173
|
+
*
|
|
174
|
+
* Requires: search:index permission (server-side RBAC enforced)
|
|
175
|
+
*/
|
|
176
|
+
removeFromIndex(mediaId: string): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* Save a search
|
|
179
|
+
*
|
|
180
|
+
* Requires: search:save permission
|
|
181
|
+
*/
|
|
182
|
+
saveSearch(name: string, request: SearchRequest, options?: {
|
|
183
|
+
notify_on_new?: boolean;
|
|
184
|
+
}): Promise<{
|
|
185
|
+
id: string;
|
|
186
|
+
name: string;
|
|
187
|
+
query: SearchRequest;
|
|
188
|
+
created_at: string;
|
|
189
|
+
}>;
|
|
190
|
+
/**
|
|
191
|
+
* List saved searches
|
|
192
|
+
*
|
|
193
|
+
* Requires: search:read permission
|
|
194
|
+
*/
|
|
195
|
+
listSavedSearches(params?: PaginationParams): Promise<PaginatedResponse<{
|
|
196
|
+
id: string;
|
|
197
|
+
name: string;
|
|
198
|
+
query: SearchRequest;
|
|
199
|
+
last_run?: string;
|
|
200
|
+
new_results?: number;
|
|
201
|
+
}>>;
|
|
202
|
+
/**
|
|
203
|
+
* Run a saved search
|
|
204
|
+
*
|
|
205
|
+
* Requires: search:query permission
|
|
206
|
+
*/
|
|
207
|
+
runSavedSearch(savedSearchId: string): Promise<SearchResponse>;
|
|
208
|
+
/**
|
|
209
|
+
* Remove a saved search
|
|
210
|
+
*
|
|
211
|
+
* Requires: search:save permission (server-side RBAC enforced)
|
|
212
|
+
*/
|
|
213
|
+
removeSavedSearch(savedSearchId: string): Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* Get search analytics
|
|
216
|
+
*
|
|
217
|
+
* Requires: search:analytics permission
|
|
218
|
+
*/
|
|
219
|
+
getAnalytics(options?: {
|
|
220
|
+
start_date?: string;
|
|
221
|
+
end_date?: string;
|
|
222
|
+
group_by?: 'day' | 'week' | 'month';
|
|
223
|
+
}): Promise<{
|
|
224
|
+
total_searches: number;
|
|
225
|
+
unique_queries: number;
|
|
226
|
+
zero_results_rate: number;
|
|
227
|
+
average_results: number;
|
|
228
|
+
top_queries: Array<{
|
|
229
|
+
query: string;
|
|
230
|
+
count: number;
|
|
231
|
+
avg_results: number;
|
|
232
|
+
}>;
|
|
233
|
+
top_zero_results: Array<{
|
|
234
|
+
query: string;
|
|
235
|
+
count: number;
|
|
236
|
+
}>;
|
|
237
|
+
}>;
|
|
238
|
+
/**
|
|
239
|
+
* Wait for indexing to complete
|
|
240
|
+
*/
|
|
241
|
+
waitForIndex(mediaId: string, options?: {
|
|
242
|
+
pollInterval?: number;
|
|
243
|
+
timeout?: number;
|
|
244
|
+
onProgress?: (status: IndexStatus) => void;
|
|
245
|
+
}): Promise<IndexStatus>;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Create a Search API instance
|
|
249
|
+
*/
|
|
250
|
+
export declare function createSearchAPI(client: WaveClient): SearchAPI;
|
|
251
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAExB,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;gBAE7B,MAAM,EAAE,UAAU;IAI9B;;;;OAIG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAI7D;;;;OAIG;IACG,WAAW,CACf,K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A;SAAE,CAAC,CAAC;KAC3D,CAAC;IAIF;;OAEG;IACG,YAAY,CAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;KAC5C,GACA,OAAO,CAAC,WAAW,CAAC;CAyBxB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export type AnalysisStatus = 'pending' | 'processing' | 'ready' | 'failed';
|
|
2
|
+
export type SentimentLabel = 'very_negative' | 'negative' | 'neutral' | 'positive' | 'very_positive';
|
|
3
|
+
export type EmotionType = 'joy' | 'sadness' | 'anger' | 'fear' | 'surprise' | 'disgust' | 'contempt' | 'neutral';
|
|
4
|
+
export type SourceType = 'video' | 'audio' | 'text' | 'chat' | 'transcript';
|
|
5
|
+
export interface SentimentAnalysis extends Timestamps {
|
|
6
|
+
id: string;
|
|
7
|
+
organization_id: string;
|
|
8
|
+
source_type: SourceType;
|
|
9
|
+
source_id?: string;
|
|
10
|
+
source_url?: string;
|
|
11
|
+
status: AnalysisStatus;
|
|
12
|
+
overall_sentiment: SentimentLabel;
|
|
13
|
+
sentiment_score: number;
|
|
14
|
+
confidence: number;
|
|
15
|
+
dominant_emotions: EmotionType[];
|
|
16
|
+
duration?: number;
|
|
17
|
+
segment_count?: number;
|
|
18
|
+
error?: string;
|
|
19
|
+
metadata?: Metadata;
|
|
20
|
+
}
|
|
21
|
+
export interface SentimentSegment {
|
|
22
|
+
id: string;
|
|
23
|
+
start_time: number;
|
|
24
|
+
end_time: number;
|
|
25
|
+
text?: string;
|
|
26
|
+
sentiment: SentimentLabel;
|
|
27
|
+
sentiment_score: number;
|
|
28
|
+
confidence: number;
|
|
29
|
+
emotions: EmotionScore[];
|
|
30
|
+
speaker_id?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface EmotionScore {
|
|
33
|
+
emotion: EmotionType;
|
|
34
|
+
score: number;
|
|
35
|
+
confidence: number;
|
|
36
|
+
}
|
|
37
|
+
export interface SentimentTrend {
|
|
38
|
+
timestamp: number;
|
|
39
|
+
sentiment_score: number;
|
|
40
|
+
dominant_emotion: EmotionType;
|
|
41
|
+
window_size: number;
|
|
42
|
+
}
|
|
43
|
+
export interface SentimentSummary {
|
|
44
|
+
overall_sentiment: SentimentLabel;
|
|
45
|
+
sentiment_score: number;
|
|
46
|
+
sentiment_distribution: Record<SentimentLabel, number>;
|
|
47
|
+
emotion_distribution: Record<EmotionType, number>;
|
|
48
|
+
key_moments: KeyMoment[];
|
|
49
|
+
topics_sentiment: TopicSentiment[];
|
|
50
|
+
}
|
|
51
|
+
export interface KeyMoment {
|
|
52
|
+
timestamp: number;
|
|
53
|
+
end_time?: number;
|
|
54
|
+
type: 'peak_positive' | 'peak_negative' | 'sentiment_shift' | 'high_emotion';
|
|
55
|
+
sentiment_score: number;
|
|
56
|
+
emotion: EmotionType;
|
|
57
|
+
description?: string;
|
|
58
|
+
text?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface TopicSentiment {
|
|
61
|
+
topic: string;
|
|
62
|
+
sentiment: SentimentLabel;
|
|
63
|
+
sentiment_score: number;
|
|
64
|
+
mention_count: number;
|
|
65
|
+
examples: string[];
|
|
66
|
+
}
|
|
67
|
+
export interface CreateAnalysisRequest {
|
|
68
|
+
source_type: SourceType;
|
|
69
|
+
source_id?: string;
|
|
70
|
+
source_url?: string;
|
|
71
|
+
text?: string;
|
|
72
|
+
/** Analysis options */
|
|
73
|
+
options?: {
|
|
74
|
+
/** Enable emotion detection */
|
|
75
|
+
emotions?: boolean;
|
|
76
|
+
/** Enable topic extraction */
|
|
77
|
+
topics?: boolean;
|
|
78
|
+
/** Enable key moment detection */
|
|
79
|
+
key_moments?: boolean;
|
|
80
|
+
/** Segment granularity in seconds */
|
|
81
|
+
segment_size?: number;
|
|
82
|
+
/** Language (auto-detect if not specified) */
|
|
83
|
+
language?: string;
|
|
84
|
+
/** Enable speaker-level analysis */
|
|
85
|
+
per_speaker?: boolean;
|
|
86
|
+
};
|
|
87
|
+
/** Webhook URL for completion */
|
|
88
|
+
webhook_url?: string;
|
|
89
|
+
metadata?: Metadata;
|
|
90
|
+
}
|
|
91
|
+
export interface BatchAnalysisRequest {
|
|
92
|
+
items: Array<{
|
|
93
|
+
source_type: SourceType;
|
|
94
|
+
source_id?: string;
|
|
95
|
+
source_url?: string;
|
|
96
|
+
text?: string;
|
|
97
|
+
}>;
|
|
98
|
+
options?: CreateAnalysisRequest['options'];
|
|
99
|
+
webhook_url?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface ListAnalysesParams extends PaginationParams {
|
|
102
|
+
status?: AnalysisStatus;
|
|
103
|
+
source_type?: SourceType;
|
|
104
|
+
sentiment?: SentimentLabel;
|
|
105
|
+
created_after?: string;
|
|
106
|
+
created_before?: string;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=sentiment-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentiment-types.d.ts","sourceRoot":"","sources":["../src/sentiment-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC3E,MAAM,MAAM,cAAc,GACtB,eAAe,GACf,UAAU,GACV,SAAS,GACT,UAAU,GACV,eAAe,CAAC;AACpB,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,SAAS,GACT,OAAO,GACP,MAAM,GACN,UAAU,GACV,SAAS,GACT,UAAU,GACV,SAAS,CAAC;AACd,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAC5E,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,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MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,KAAK,CAAC;QACX,WAAW,EAAE,UAAU,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WAVE SDK - Sentiment API
|
|
3
|
+
*
|
|
4
|
+
* Analyze sentiment and emotions in audio, video, and text content.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This is a client SDK. All authorization checks are performed server-side.
|
|
7
|
+
* The API will return 403 Forbidden if the user lacks required permissions.
|
|
8
|
+
*/
|
|
9
|
+
import type { WaveClient, PaginationParams, PaginatedResponse } from './client';
|
|
10
|
+
import type { SentimentLabel, EmotionType, SentimentAnalysis, SentimentSegment, EmotionScore, SentimentTrend, SentimentSummary, KeyMoment, TopicSentiment, CreateAnalysisRequest, BatchAnalysisRequest, ListAnalysesParams } from './sentiment-types';
|
|
11
|
+
/**
|
|
12
|
+
* Analysis status
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Sentiment label
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Emotion type
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Analysis source type
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Sentiment analysis job
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Sentiment segment
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Emotion score
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Sentiment trend point
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Sentiment summary
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Key emotional moment
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Topic sentiment
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* Create analysis request
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Batch analysis request
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* List analyses params
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* Sentiment API client
|
|
55
|
+
*/
|
|
56
|
+
export declare class SentimentAPI {
|
|
57
|
+
private readonly client;
|
|
58
|
+
private readonly basePath;
|
|
59
|
+
constructor(client: WaveClient);
|
|
60
|
+
/**
|
|
61
|
+
* Create a sentiment analysis job
|
|
62
|
+
*
|
|
63
|
+
* Requires: sentiment:analyze permission
|
|
64
|
+
*/
|
|
65
|
+
analyze(request: CreateAnalysisRequest): Promise<SentimentAnalysis>;
|
|
66
|
+
/**
|
|
67
|
+
* Analyze text directly (synchronous for short text)
|
|
68
|
+
*
|
|
69
|
+
* Requires: sentiment:analyze permission
|
|
70
|
+
*/
|
|
71
|
+
analyzeText(text: string, options?: {
|
|
72
|
+
emotions?: boolean;
|
|
73
|
+
language?: string;
|
|
74
|
+
}): Promise<{
|
|
75
|
+
sentiment: SentimentLabel;
|
|
76
|
+
sentiment_score: number;
|
|
77
|
+
confidence: number;
|
|
78
|
+
emotions?: EmotionScore[];
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Batch analyze multiple items
|
|
82
|
+
*
|
|
83
|
+
* Requires: sentiment:analyze permission
|
|
84
|
+
*/
|
|
85
|
+
batchAnalyze(request: BatchAnalysisRequest): Promise<{
|
|
86
|
+
batch_id: string;
|
|
87
|
+
jobs: SentimentAnalysis[];
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* Get an analysis by ID
|
|
91
|
+
*
|
|
92
|
+
* Requires: sentiment:read permission
|
|
93
|
+
*/
|
|
94
|
+
get(analysisId: string): Promise<SentimentAnalysis>;
|
|
95
|
+
/**
|
|
96
|
+
* Remove an analysis
|
|
97
|
+
*
|
|
98
|
+
* Requires: sentiment:remove permission (server-side RBAC enforced)
|
|
99
|
+
*/
|
|
100
|
+
remove(analysisId: string): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* List analyses
|
|
103
|
+
*
|
|
104
|
+
* Requires: sentiment:read permission
|
|
105
|
+
*/
|
|
106
|
+
list(params?: ListAnalysesParams): Promise<PaginatedResponse<SentimentAnalysis>>;
|
|
107
|
+
/**
|
|
108
|
+
* Get sentiment segments
|
|
109
|
+
*
|
|
110
|
+
* Requires: sentiment:read permission
|
|
111
|
+
*/
|
|
112
|
+
getSegments(analysisId: string, params?: PaginationParams & {
|
|
113
|
+
start_time?: number;
|
|
114
|
+
end_time?: number;
|
|
115
|
+
sentiment?: SentimentLabel;
|
|
116
|
+
min_score?: number;
|
|
117
|
+
}): Promise<PaginatedResponse<SentimentSegment>>;
|
|
118
|
+
/**
|
|
119
|
+
* Get sentiment summary
|
|
120
|
+
*
|
|
121
|
+
* Requires: sentiment:read permission
|
|
122
|
+
*/
|
|
123
|
+
getSummary(analysisId: string): Promise<SentimentSummary>;
|
|
124
|
+
/**
|
|
125
|
+
* Get sentiment trend over time
|
|
126
|
+
*
|
|
127
|
+
* Requires: sentiment:read permission
|
|
128
|
+
*/
|
|
129
|
+
getTrend(analysisId: string, options?: {
|
|
130
|
+
window_size?: number;
|
|
131
|
+
resolution?: number;
|
|
132
|
+
}): Promise<SentimentTrend[]>;
|
|
133
|
+
/**
|
|
134
|
+
* Get key emotional moments
|
|
135
|
+
*
|
|
136
|
+
* Requires: sentiment:read permission
|
|
137
|
+
*/
|
|
138
|
+
getKeyMoments(analysisId: string, options?: {
|
|
139
|
+
type?: KeyMoment['type'];
|
|
140
|
+
limit?: number;
|
|
141
|
+
}): Promise<KeyMoment[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Get topic sentiments
|
|
144
|
+
*
|
|
145
|
+
* Requires: sentiment:read permission
|
|
146
|
+
*/
|
|
147
|
+
getTopicSentiments(analysisId: string, options?: {
|
|
148
|
+
min_mentions?: number;
|
|
149
|
+
}): Promise<TopicSentiment[]>;
|
|
150
|
+
/**
|
|
151
|
+
* Get sentiment by speaker
|
|
152
|
+
*
|
|
153
|
+
* Requires: sentiment:read permission
|
|
154
|
+
*/
|
|
155
|
+
getSpeakerSentiment(analysisId: string): Promise<Array<{
|
|
156
|
+
speaker_id: number;
|
|
157
|
+
speaker_label?: string;
|
|
158
|
+
sentiment: SentimentLabel;
|
|
159
|
+
sentiment_score: number;
|
|
160
|
+
dominant_emotions: EmotionType[];
|
|
161
|
+
segment_count: number;
|
|
162
|
+
total_duration: number;
|
|
163
|
+
}>>;
|
|
164
|
+
/**
|
|
165
|
+
* Start real-time sentiment analysis
|
|
166
|
+
*
|
|
167
|
+
* Requires: sentiment:realtime permission
|
|
168
|
+
*/
|
|
169
|
+
startRealtime(streamId: string, options?: {
|
|
170
|
+
emotions?: boolean;
|
|
171
|
+
segment_size?: number;
|
|
172
|
+
language?: string;
|
|
173
|
+
}): Promise<{
|
|
174
|
+
session_id: string;
|
|
175
|
+
websocket_url: string;
|
|
176
|
+
expires_at: string;
|
|
177
|
+
}>;
|
|
178
|
+
/**
|
|
179
|
+
* Stop real-time analysis
|
|
180
|
+
*
|
|
181
|
+
* Requires: sentiment:realtime permission
|
|
182
|
+
*/
|
|
183
|
+
stopRealtime(sessionId: string): Promise<SentimentAnalysis>;
|
|
184
|
+
/**
|
|
185
|
+
* Get real-time session status
|
|
186
|
+
*
|
|
187
|
+
* Requires: sentiment:read permission
|
|
188
|
+
*/
|
|
189
|
+
getRealtimeStatus(sessionId: string): Promise<{
|
|
190
|
+
status: 'active' | 'paused' | 'stopped';
|
|
191
|
+
duration: number;
|
|
192
|
+
current_sentiment: SentimentLabel;
|
|
193
|
+
current_score: number;
|
|
194
|
+
segments_processed: number;
|
|
195
|
+
}>;
|
|
196
|
+
/**
|
|
197
|
+
* Compare sentiment between analyses
|
|
198
|
+
*
|
|
199
|
+
* Requires: sentiment:read permission
|
|
200
|
+
*/
|
|
201
|
+
compare(analysisIds: string[]): Promise<{
|
|
202
|
+
analyses: Array<{
|
|
203
|
+
id: string;
|
|
204
|
+
sentiment: SentimentLabel;
|
|
205
|
+
sentiment_score: number;
|
|
206
|
+
dominant_emotions: EmotionType[];
|
|
207
|
+
}>;
|
|
208
|
+
comparison: {
|
|
209
|
+
most_positive: string;
|
|
210
|
+
most_negative: string;
|
|
211
|
+
score_range: number;
|
|
212
|
+
common_emotions: EmotionType[];
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
/**
|
|
216
|
+
* Export analysis results
|
|
217
|
+
*
|
|
218
|
+
* Requires: sentiment:read permission
|
|
219
|
+
*/
|
|
220
|
+
exportAnalysis(analysisId: string, format: 'json' | 'csv' | 'pdf'): Promise<{
|
|
221
|
+
url: string;
|
|
222
|
+
expires_at: string;
|
|
223
|
+
}>;
|
|
224
|
+
/**
|
|
225
|
+
* Wait for analysis to complete
|
|
226
|
+
*/
|
|
227
|
+
waitForReady(analysisId: string, options?: {
|
|
228
|
+
pollInterval?: number;
|
|
229
|
+
timeout?: number;
|
|
230
|
+
onProgress?: (analysis: SentimentAnalysis) => void;
|
|
231
|
+
}): Promise<SentimentAnalysis>;
|
|
232
|
+
/**
|
|
233
|
+
* Get supported languages
|
|
234
|
+
*
|
|
235
|
+
* Requires: sentiment:read permission
|
|
236
|
+
*/
|
|
237
|
+
getSupportedLanguages(): Promise<Array<{
|
|
238
|
+
code: string;
|
|
239
|
+
name: string;
|
|
240
|
+
emotion_detection: boolean;
|
|
241
|
+
}>>;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Create a Sentiment API instance
|
|
245
|
+
*/
|
|
246
|
+
export declare function createSentimentAPI(client: WaveClient): SentimentAPI;
|
|
247
|
+
//# sourceMappingURL=sentiment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentiment.d.ts","sourceRoot":"","sources":["../src/sentiment.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EAGlB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAkB,cAAc,EAAE,WAAW,EAAc,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAIlR;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAIH;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;gBAEhC,MAAM,EAAE,UAAU;IAI9B;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIzE;;;;OAIG;IACG,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAClD,OAAO,CAAC;QACT,SAAS,EAAE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