podscan 1.0.0
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/LICENSE +21 -0
- package/README.md +484 -0
- package/dist/index.cjs +630 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +849 -0
- package/dist/index.d.ts +849 -0
- package/dist/index.js +593 -0
- package/dist/index.js.map +1 -0
- package/package.json +74 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,849 @@
|
|
|
1
|
+
interface HttpClientOptions {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
timeout?: number;
|
|
5
|
+
}
|
|
6
|
+
interface RateLimitInfo {
|
|
7
|
+
limit: number;
|
|
8
|
+
remaining: number;
|
|
9
|
+
used: number;
|
|
10
|
+
resetsAt: string | null;
|
|
11
|
+
}
|
|
12
|
+
interface PodscanErrorDetails {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
status: number;
|
|
16
|
+
details?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
declare class PodscanError extends Error {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
readonly status: number;
|
|
21
|
+
readonly details?: Record<string, unknown>;
|
|
22
|
+
constructor({ code, message, status, details }: PodscanErrorDetails);
|
|
23
|
+
}
|
|
24
|
+
declare class HttpClient {
|
|
25
|
+
private readonly apiKey;
|
|
26
|
+
private readonly baseUrl;
|
|
27
|
+
private readonly timeout;
|
|
28
|
+
rateLimit: RateLimitInfo | null;
|
|
29
|
+
constructor(options: HttpClientOptions);
|
|
30
|
+
get<T>(path: string, params?: object): Promise<T>;
|
|
31
|
+
post<T>(path: string, body?: object): Promise<T>;
|
|
32
|
+
private buildUrl;
|
|
33
|
+
private request;
|
|
34
|
+
private parseRateLimitHeaders;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface Pagination {
|
|
38
|
+
total: number;
|
|
39
|
+
per_page: number;
|
|
40
|
+
current_page: number;
|
|
41
|
+
last_page: number;
|
|
42
|
+
from: number | null;
|
|
43
|
+
to: number | null;
|
|
44
|
+
}
|
|
45
|
+
interface Quota {
|
|
46
|
+
daily_used: number;
|
|
47
|
+
daily_limit: number;
|
|
48
|
+
daily_remaining: number;
|
|
49
|
+
plan: string;
|
|
50
|
+
resets_at: string;
|
|
51
|
+
}
|
|
52
|
+
interface Sentiment {
|
|
53
|
+
label: string;
|
|
54
|
+
short: string;
|
|
55
|
+
score: number;
|
|
56
|
+
}
|
|
57
|
+
type SortDirection = 'asc' | 'desc';
|
|
58
|
+
interface Category {
|
|
59
|
+
category_id: string;
|
|
60
|
+
category_name: string;
|
|
61
|
+
}
|
|
62
|
+
interface SearchHighlight {
|
|
63
|
+
transcription?: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
title?: string;
|
|
66
|
+
}
|
|
67
|
+
interface PodcastRef {
|
|
68
|
+
podcast_id: string;
|
|
69
|
+
podcast_name: string;
|
|
70
|
+
podcast_url?: string;
|
|
71
|
+
podcast_reach_score?: number;
|
|
72
|
+
}
|
|
73
|
+
interface Podcast {
|
|
74
|
+
podcast_id: string;
|
|
75
|
+
podcast_guid: string;
|
|
76
|
+
podcast_name: string;
|
|
77
|
+
podcast_url: string;
|
|
78
|
+
podcast_description: string;
|
|
79
|
+
podcast_image_url: string | null;
|
|
80
|
+
podcast_categories: Category[];
|
|
81
|
+
podcast_iab_categories: string[] | null;
|
|
82
|
+
podcast_has_guests: boolean | null;
|
|
83
|
+
podcast_has_sponsors: boolean | null;
|
|
84
|
+
podcast_itunes_id: string | null;
|
|
85
|
+
podcast_spotify_id: string | null;
|
|
86
|
+
podcast_reach_score: number;
|
|
87
|
+
publisher_name: string | null;
|
|
88
|
+
publisher_ids: string[] | null;
|
|
89
|
+
brand_safety: string | null;
|
|
90
|
+
reach: Record<string, unknown> | null;
|
|
91
|
+
rss_url: string | null;
|
|
92
|
+
is_active: boolean;
|
|
93
|
+
episode_count: number;
|
|
94
|
+
episodes_in_database: number;
|
|
95
|
+
language: string | null;
|
|
96
|
+
region: string | null;
|
|
97
|
+
last_posted_at: string | null;
|
|
98
|
+
last_scanned_at: string | null;
|
|
99
|
+
created_at: string;
|
|
100
|
+
updated_at: string;
|
|
101
|
+
is_duplicate: boolean;
|
|
102
|
+
is_duplicate_of: string | null;
|
|
103
|
+
_search_highlight?: SearchHighlight;
|
|
104
|
+
}
|
|
105
|
+
interface HostInfo {
|
|
106
|
+
host_name: string;
|
|
107
|
+
host_company: string | null;
|
|
108
|
+
host_social_media_links: string[] | null;
|
|
109
|
+
speaker_label: string | null;
|
|
110
|
+
}
|
|
111
|
+
interface GuestInfo {
|
|
112
|
+
guest_name: string;
|
|
113
|
+
guest_company: string | null;
|
|
114
|
+
guest_social_media_links: string[] | null;
|
|
115
|
+
guest_industry: string | null;
|
|
116
|
+
guest_occupation: string | null;
|
|
117
|
+
speaker_label: string | null;
|
|
118
|
+
}
|
|
119
|
+
interface SponsorInfo {
|
|
120
|
+
sponsor_name: string;
|
|
121
|
+
sponsor_url: string | null;
|
|
122
|
+
sponsor_description: string | null;
|
|
123
|
+
}
|
|
124
|
+
interface FirstOccurrence {
|
|
125
|
+
type: 'host' | 'guest' | 'keyword' | 'sponsor';
|
|
126
|
+
value: string;
|
|
127
|
+
first_occurence: string;
|
|
128
|
+
}
|
|
129
|
+
interface EpisodeMetadata {
|
|
130
|
+
hosts: HostInfo[];
|
|
131
|
+
guests: GuestInfo[];
|
|
132
|
+
sponsors: SponsorInfo[];
|
|
133
|
+
/** Maps speaker labels (e.g. "SPEAKER_01") to real names. */
|
|
134
|
+
speakers: Record<string, string>;
|
|
135
|
+
has_hosts: boolean;
|
|
136
|
+
has_guests: boolean;
|
|
137
|
+
has_sponsors: boolean;
|
|
138
|
+
is_branded: boolean;
|
|
139
|
+
is_branded_confidence_score: number;
|
|
140
|
+
is_branded_confidence_reason: string | null;
|
|
141
|
+
summary_short: string | null;
|
|
142
|
+
summary_long: string | null;
|
|
143
|
+
summary_keywords: string[];
|
|
144
|
+
first_occurences: FirstOccurrence[];
|
|
145
|
+
brand_safety: string | null;
|
|
146
|
+
}
|
|
147
|
+
interface Episode {
|
|
148
|
+
episode_fully_processed: boolean;
|
|
149
|
+
episode_id: string;
|
|
150
|
+
episode_guid: string;
|
|
151
|
+
episode_title: string;
|
|
152
|
+
episode_url: string;
|
|
153
|
+
episode_audio_url: string | null;
|
|
154
|
+
episode_image_url: string | null;
|
|
155
|
+
episode_duration: number;
|
|
156
|
+
episode_word_count: number;
|
|
157
|
+
episode_categories: Category[];
|
|
158
|
+
episode_iab_category: string | null;
|
|
159
|
+
episode_has_guests: boolean | null;
|
|
160
|
+
episode_has_sponsors: boolean | null;
|
|
161
|
+
created_at: string;
|
|
162
|
+
updated_at: string;
|
|
163
|
+
posted_at: string;
|
|
164
|
+
episode_transcript: string | null;
|
|
165
|
+
episode_transcript_word_level_timestamps: unknown;
|
|
166
|
+
episode_description: string;
|
|
167
|
+
episode_permalink: string;
|
|
168
|
+
podcast: PodcastRef;
|
|
169
|
+
metadata: EpisodeMetadata | null;
|
|
170
|
+
topics: TopicOccurrence[];
|
|
171
|
+
_search_highlight?: SearchHighlight;
|
|
172
|
+
}
|
|
173
|
+
interface TopicSummary {
|
|
174
|
+
topic_id: string;
|
|
175
|
+
name: string;
|
|
176
|
+
occurrences_count?: number;
|
|
177
|
+
latest_occurrence?: string;
|
|
178
|
+
}
|
|
179
|
+
interface TopicOccurrence {
|
|
180
|
+
topic_id: string;
|
|
181
|
+
name?: string;
|
|
182
|
+
topic_name?: string;
|
|
183
|
+
topic_name_normalized?: string;
|
|
184
|
+
sentiment?: Sentiment;
|
|
185
|
+
}
|
|
186
|
+
interface TopicMomentum {
|
|
187
|
+
daily_growth: number;
|
|
188
|
+
weekly_growth: number;
|
|
189
|
+
is_trending: boolean;
|
|
190
|
+
current_velocity?: {
|
|
191
|
+
occurrences_last_hour: number;
|
|
192
|
+
occurrences_last_day: number;
|
|
193
|
+
occurrences_last_week: number;
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
interface Topic {
|
|
197
|
+
topic_id: string;
|
|
198
|
+
name: string;
|
|
199
|
+
occurrences_count: number;
|
|
200
|
+
latest_occurrence: string;
|
|
201
|
+
momentum?: TopicMomentum;
|
|
202
|
+
recent_occurrences?: TopicEpisodeOccurrence[];
|
|
203
|
+
related_topics?: TopicSummary[];
|
|
204
|
+
lists?: ListSummary[];
|
|
205
|
+
}
|
|
206
|
+
interface TopicEpisodeOccurrence {
|
|
207
|
+
episode_id: string;
|
|
208
|
+
episode_title: string;
|
|
209
|
+
podcast_id: string;
|
|
210
|
+
podcast_name: string;
|
|
211
|
+
posted_at: string;
|
|
212
|
+
sentiment?: Sentiment;
|
|
213
|
+
}
|
|
214
|
+
interface TrendingTopic {
|
|
215
|
+
topic_id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
occurrences: number;
|
|
218
|
+
momentum?: TopicMomentum;
|
|
219
|
+
related_topics?: TopicSummary[];
|
|
220
|
+
}
|
|
221
|
+
interface EntityAppearanceCounts {
|
|
222
|
+
hosts_count: number;
|
|
223
|
+
guests_count: number;
|
|
224
|
+
sponsors_count: number;
|
|
225
|
+
producers_count: number;
|
|
226
|
+
mentions_count: number;
|
|
227
|
+
total_count: number;
|
|
228
|
+
}
|
|
229
|
+
interface Entity {
|
|
230
|
+
entity_id: string;
|
|
231
|
+
entity_name: string;
|
|
232
|
+
entity_type: 'person' | 'organization';
|
|
233
|
+
created_at: string;
|
|
234
|
+
updated_at: string;
|
|
235
|
+
company: string | null;
|
|
236
|
+
occupation: string | null;
|
|
237
|
+
industry: string | null;
|
|
238
|
+
url: string | null;
|
|
239
|
+
appearances: EntityAppearanceCounts;
|
|
240
|
+
_search_highlight?: SearchHighlight;
|
|
241
|
+
}
|
|
242
|
+
interface EntityAppearance {
|
|
243
|
+
appearance_id?: string;
|
|
244
|
+
role: string;
|
|
245
|
+
episode_id: string;
|
|
246
|
+
episode_title: string;
|
|
247
|
+
podcast_id: string;
|
|
248
|
+
podcast_name: string;
|
|
249
|
+
posted_at: string;
|
|
250
|
+
}
|
|
251
|
+
interface Alert {
|
|
252
|
+
alert_id: string;
|
|
253
|
+
alert_name: string;
|
|
254
|
+
filters: string;
|
|
255
|
+
enabled: boolean;
|
|
256
|
+
mention_count: number;
|
|
257
|
+
recent_mention_count: number;
|
|
258
|
+
created_at: string;
|
|
259
|
+
}
|
|
260
|
+
interface Mention {
|
|
261
|
+
mention_id: string;
|
|
262
|
+
detected_filter: string;
|
|
263
|
+
detected_excerpt: string;
|
|
264
|
+
detected_at: string;
|
|
265
|
+
sentiment?: Sentiment;
|
|
266
|
+
episode?: Episode;
|
|
267
|
+
}
|
|
268
|
+
interface ListSummary {
|
|
269
|
+
list_id: string;
|
|
270
|
+
list_name: string;
|
|
271
|
+
list_description?: string;
|
|
272
|
+
item_count: number;
|
|
273
|
+
created_at: string;
|
|
274
|
+
updated_at: string;
|
|
275
|
+
}
|
|
276
|
+
interface ListItem {
|
|
277
|
+
id: string;
|
|
278
|
+
type: 'podcast' | 'episode' | 'entity' | 'topic';
|
|
279
|
+
[key: string]: unknown;
|
|
280
|
+
}
|
|
281
|
+
interface Publisher {
|
|
282
|
+
publisher_id: string;
|
|
283
|
+
publisher_name: string;
|
|
284
|
+
website?: string;
|
|
285
|
+
podcasts?: Podcast[];
|
|
286
|
+
}
|
|
287
|
+
interface SearchEpisodesParams {
|
|
288
|
+
query: string;
|
|
289
|
+
search_fields?: string;
|
|
290
|
+
category_ids?: string;
|
|
291
|
+
podcast_ids?: string;
|
|
292
|
+
since?: string;
|
|
293
|
+
before?: string;
|
|
294
|
+
language?: string;
|
|
295
|
+
has_guests?: boolean;
|
|
296
|
+
has_sponsors?: boolean;
|
|
297
|
+
show_only_fully_processed?: boolean;
|
|
298
|
+
order_by?: 'posted_at' | 'relevance' | 'duration';
|
|
299
|
+
order_dir?: SortDirection;
|
|
300
|
+
page?: number;
|
|
301
|
+
per_page?: number;
|
|
302
|
+
exclude_transcript?: boolean;
|
|
303
|
+
show_full_podcast?: boolean;
|
|
304
|
+
remove_timestamps?: boolean;
|
|
305
|
+
remove_speaker_labels?: boolean;
|
|
306
|
+
transcript_formatter?: 'raw' | 'paragraphs';
|
|
307
|
+
}
|
|
308
|
+
interface GetEpisodeParams {
|
|
309
|
+
episode_id: string;
|
|
310
|
+
include_transcript?: boolean;
|
|
311
|
+
include_topics?: boolean;
|
|
312
|
+
include_entities?: boolean;
|
|
313
|
+
}
|
|
314
|
+
interface GetRecentEpisodesParams {
|
|
315
|
+
limit?: number;
|
|
316
|
+
since?: string;
|
|
317
|
+
before?: string;
|
|
318
|
+
category_ids?: string;
|
|
319
|
+
podcast_ids?: string;
|
|
320
|
+
language?: string;
|
|
321
|
+
has_guests?: boolean;
|
|
322
|
+
has_sponsors?: boolean;
|
|
323
|
+
show_only_fully_processed?: boolean;
|
|
324
|
+
exclude_transcript?: boolean;
|
|
325
|
+
show_full_podcast?: boolean;
|
|
326
|
+
remove_timestamps?: boolean;
|
|
327
|
+
remove_speaker_labels?: boolean;
|
|
328
|
+
transcript_formatter?: 'raw' | 'paragraphs';
|
|
329
|
+
}
|
|
330
|
+
interface GetPodcastEpisodesParams {
|
|
331
|
+
podcast_id: string;
|
|
332
|
+
per_page?: number;
|
|
333
|
+
page?: number;
|
|
334
|
+
order_by?: 'posted_at' | 'created_at' | 'title' | 'duration';
|
|
335
|
+
order_dir?: SortDirection;
|
|
336
|
+
since?: string;
|
|
337
|
+
before?: string;
|
|
338
|
+
has_guests?: boolean;
|
|
339
|
+
has_sponsors?: boolean;
|
|
340
|
+
title_contains?: string;
|
|
341
|
+
title_excludes?: string;
|
|
342
|
+
exclude_transcript?: boolean;
|
|
343
|
+
show_full_podcast?: boolean;
|
|
344
|
+
remove_timestamps?: boolean;
|
|
345
|
+
remove_speaker_labels?: boolean;
|
|
346
|
+
transcript_formatter?: 'raw' | 'paragraphs';
|
|
347
|
+
}
|
|
348
|
+
interface SearchPodcastsParams {
|
|
349
|
+
query: string;
|
|
350
|
+
search_fields?: string;
|
|
351
|
+
category_ids?: string;
|
|
352
|
+
language?: string;
|
|
353
|
+
region?: string;
|
|
354
|
+
min_audience_size?: number;
|
|
355
|
+
max_audience_size?: number;
|
|
356
|
+
min_episode_count?: number;
|
|
357
|
+
has_guests?: boolean;
|
|
358
|
+
has_sponsors?: boolean;
|
|
359
|
+
order_by?: 'rating' | 'audience_size' | 'episode_count';
|
|
360
|
+
order_dir?: SortDirection;
|
|
361
|
+
page?: number;
|
|
362
|
+
per_page?: number;
|
|
363
|
+
}
|
|
364
|
+
interface GetPodcastParams {
|
|
365
|
+
podcast_id: string;
|
|
366
|
+
include_episodes?: boolean;
|
|
367
|
+
episode_limit?: number;
|
|
368
|
+
include_demographics?: boolean;
|
|
369
|
+
include_reviews?: boolean;
|
|
370
|
+
}
|
|
371
|
+
interface SearchEntitiesParams {
|
|
372
|
+
query: string;
|
|
373
|
+
entity_type?: 'person' | 'organization';
|
|
374
|
+
min_appearances?: number;
|
|
375
|
+
order_by?: 'appearances' | 'name';
|
|
376
|
+
order_dir?: SortDirection;
|
|
377
|
+
page?: number;
|
|
378
|
+
per_page?: number;
|
|
379
|
+
}
|
|
380
|
+
interface GetEntityParams {
|
|
381
|
+
entity_id: string;
|
|
382
|
+
with_appearances?: boolean;
|
|
383
|
+
appearances_limit?: number;
|
|
384
|
+
}
|
|
385
|
+
interface GetEntityAppearancesParams {
|
|
386
|
+
entity_id: string;
|
|
387
|
+
per_page?: number;
|
|
388
|
+
page?: number;
|
|
389
|
+
role?: 'host' | 'guest' | 'sponsor' | 'producer' | 'mention';
|
|
390
|
+
podcast_id?: string;
|
|
391
|
+
from?: string;
|
|
392
|
+
to?: string;
|
|
393
|
+
order_by?: 'posted_at' | 'created_at';
|
|
394
|
+
order_dir?: SortDirection;
|
|
395
|
+
}
|
|
396
|
+
interface SearchTopicsParams {
|
|
397
|
+
query: string;
|
|
398
|
+
min_episodes?: number;
|
|
399
|
+
order_by?: 'relevance' | 'episode_count';
|
|
400
|
+
order_dir?: SortDirection;
|
|
401
|
+
page?: number;
|
|
402
|
+
per_page?: number;
|
|
403
|
+
}
|
|
404
|
+
interface GetTopicParams {
|
|
405
|
+
topic_id: string;
|
|
406
|
+
with_history?: boolean;
|
|
407
|
+
}
|
|
408
|
+
interface GetTopicEpisodesParams {
|
|
409
|
+
topic_id: string;
|
|
410
|
+
per_page?: number;
|
|
411
|
+
page?: number;
|
|
412
|
+
podcast_has_guests?: boolean;
|
|
413
|
+
podcast_has_sponsors?: boolean;
|
|
414
|
+
podcast_audience_min?: number;
|
|
415
|
+
podcast_audience_max?: number;
|
|
416
|
+
exclude_transcript?: boolean;
|
|
417
|
+
show_full_podcast?: boolean;
|
|
418
|
+
remove_timestamps?: boolean;
|
|
419
|
+
remove_speaker_labels?: boolean;
|
|
420
|
+
transcript_formatter?: 'raw' | 'paragraphs';
|
|
421
|
+
}
|
|
422
|
+
interface GetTrendingTopicsParams {
|
|
423
|
+
period?: '24h' | '7d' | '30d';
|
|
424
|
+
limit?: number;
|
|
425
|
+
category?: string;
|
|
426
|
+
}
|
|
427
|
+
interface ListAlertsParams {
|
|
428
|
+
enabled_only?: boolean;
|
|
429
|
+
page?: number;
|
|
430
|
+
per_page?: number;
|
|
431
|
+
}
|
|
432
|
+
interface GetAlertMentionsParams {
|
|
433
|
+
alert_id: string;
|
|
434
|
+
since?: string;
|
|
435
|
+
detected_type?: 'transcript' | 'title' | 'description';
|
|
436
|
+
page?: number;
|
|
437
|
+
per_page?: number;
|
|
438
|
+
}
|
|
439
|
+
interface CreateAlertParams {
|
|
440
|
+
name: string;
|
|
441
|
+
filters: string;
|
|
442
|
+
context_question?: string;
|
|
443
|
+
use_context_question?: boolean;
|
|
444
|
+
notification_email?: string;
|
|
445
|
+
webhook_url?: string;
|
|
446
|
+
webhook_active?: boolean;
|
|
447
|
+
enabled?: boolean;
|
|
448
|
+
}
|
|
449
|
+
interface ListUserListsParams {
|
|
450
|
+
page?: number;
|
|
451
|
+
per_page?: number;
|
|
452
|
+
}
|
|
453
|
+
interface GetListItemsParams {
|
|
454
|
+
list_id: string;
|
|
455
|
+
item_type?: 'podcasts' | 'episodes' | 'entities' | 'topics';
|
|
456
|
+
page?: number;
|
|
457
|
+
per_page?: number;
|
|
458
|
+
}
|
|
459
|
+
interface AddToListParams {
|
|
460
|
+
list_id: string;
|
|
461
|
+
item_ids: string;
|
|
462
|
+
}
|
|
463
|
+
interface GetPublisherParams {
|
|
464
|
+
publisher_id: string;
|
|
465
|
+
include_podcasts?: boolean;
|
|
466
|
+
podcast_limit?: number;
|
|
467
|
+
}
|
|
468
|
+
interface SearchEpisodesResponse {
|
|
469
|
+
episodes: Episode[];
|
|
470
|
+
pagination: Pagination;
|
|
471
|
+
}
|
|
472
|
+
interface GetEpisodeResponse {
|
|
473
|
+
episode: Episode;
|
|
474
|
+
}
|
|
475
|
+
interface GetRecentEpisodesResponse {
|
|
476
|
+
episodes: Episode[];
|
|
477
|
+
}
|
|
478
|
+
interface GetPodcastEpisodesResponse {
|
|
479
|
+
episodes: Episode[];
|
|
480
|
+
pagination: Pagination;
|
|
481
|
+
}
|
|
482
|
+
interface SearchPodcastsResponse {
|
|
483
|
+
podcasts: Podcast[];
|
|
484
|
+
pagination: Pagination;
|
|
485
|
+
}
|
|
486
|
+
interface GetPodcastResponse {
|
|
487
|
+
podcast: Podcast;
|
|
488
|
+
}
|
|
489
|
+
interface SearchEntitiesResponse {
|
|
490
|
+
entities: Entity[];
|
|
491
|
+
pagination: Pagination;
|
|
492
|
+
filters?: Record<string, unknown>;
|
|
493
|
+
}
|
|
494
|
+
interface GetEntityResponse {
|
|
495
|
+
entity: Entity;
|
|
496
|
+
}
|
|
497
|
+
interface GetEntityAppearancesResponse {
|
|
498
|
+
entity: Entity;
|
|
499
|
+
appearances: EntityAppearance[];
|
|
500
|
+
pagination: Pagination;
|
|
501
|
+
}
|
|
502
|
+
interface SearchTopicsResponse {
|
|
503
|
+
topics: TopicSummary[];
|
|
504
|
+
pagination: Pagination;
|
|
505
|
+
}
|
|
506
|
+
interface GetTopicResponse {
|
|
507
|
+
topic: Topic;
|
|
508
|
+
}
|
|
509
|
+
interface GetTopicEpisodesResponse {
|
|
510
|
+
episodes: Episode[];
|
|
511
|
+
pagination: Pagination;
|
|
512
|
+
}
|
|
513
|
+
interface GetTrendingTopicsResponse {
|
|
514
|
+
topics: TrendingTopic[];
|
|
515
|
+
timeframe?: string;
|
|
516
|
+
}
|
|
517
|
+
interface ListAlertsResponse {
|
|
518
|
+
alerts: Alert[];
|
|
519
|
+
pagination: Pagination;
|
|
520
|
+
}
|
|
521
|
+
interface GetAlertMentionsResponse {
|
|
522
|
+
mentions: Mention[];
|
|
523
|
+
pagination: Pagination;
|
|
524
|
+
}
|
|
525
|
+
interface CreateAlertResponse {
|
|
526
|
+
alert: Alert;
|
|
527
|
+
}
|
|
528
|
+
interface ListUserListsResponse {
|
|
529
|
+
lists: ListSummary[];
|
|
530
|
+
pagination: Pagination;
|
|
531
|
+
}
|
|
532
|
+
interface GetListItemsResponse {
|
|
533
|
+
items: ListItem[];
|
|
534
|
+
pagination: Pagination;
|
|
535
|
+
}
|
|
536
|
+
interface AddToListResponse {
|
|
537
|
+
success: boolean;
|
|
538
|
+
summary: {
|
|
539
|
+
added: number;
|
|
540
|
+
skipped: number;
|
|
541
|
+
failed: number;
|
|
542
|
+
};
|
|
543
|
+
added: string[];
|
|
544
|
+
skipped: string[];
|
|
545
|
+
failed: {
|
|
546
|
+
id: string;
|
|
547
|
+
reason: string;
|
|
548
|
+
}[];
|
|
549
|
+
}
|
|
550
|
+
interface GetPublisherResponse {
|
|
551
|
+
publisher: Publisher;
|
|
552
|
+
}
|
|
553
|
+
/** A date range that can be spread into any search params with `since`/`before`. */
|
|
554
|
+
interface DateRange {
|
|
555
|
+
since: string;
|
|
556
|
+
before?: string;
|
|
557
|
+
}
|
|
558
|
+
/** Checkpoint for delta/incremental sync workflows. */
|
|
559
|
+
interface Checkpoint {
|
|
560
|
+
/** ISO 8601 timestamp of the most recent item seen. */
|
|
561
|
+
lastSeenAt: string;
|
|
562
|
+
/** ID of the most recent item seen. */
|
|
563
|
+
lastSeenId: string;
|
|
564
|
+
/** Total number of items iterated. */
|
|
565
|
+
totalSeen: number;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* A function that fetches one page of results.
|
|
570
|
+
* The paginator calls it with incrementing page numbers.
|
|
571
|
+
*/
|
|
572
|
+
type PageFetcher<T> = (page: number) => Promise<{
|
|
573
|
+
items: T[];
|
|
574
|
+
pagination: Pagination;
|
|
575
|
+
}>;
|
|
576
|
+
/**
|
|
577
|
+
* An async-iterable paginator that walks through all pages of a paginated
|
|
578
|
+
* API response, yielding individual items.
|
|
579
|
+
*
|
|
580
|
+
* ```ts
|
|
581
|
+
* const paginator = new Paginator(async (page) => {
|
|
582
|
+
* const res = await client.episodes.search({ query: 'AI', page, per_page: 50 });
|
|
583
|
+
* return { items: res.episodes, pagination: res.pagination };
|
|
584
|
+
* });
|
|
585
|
+
*
|
|
586
|
+
* for await (const episode of paginator) {
|
|
587
|
+
* console.log(episode.episode_title);
|
|
588
|
+
* }
|
|
589
|
+
*
|
|
590
|
+
* console.log(paginator.checkpoint());
|
|
591
|
+
* ```
|
|
592
|
+
*/
|
|
593
|
+
declare class Paginator<T> implements AsyncIterable<T> {
|
|
594
|
+
private readonly fetcher;
|
|
595
|
+
private _totalSeen;
|
|
596
|
+
private _lastSeenAt;
|
|
597
|
+
private _lastSeenId;
|
|
598
|
+
constructor(fetcher: PageFetcher<T>);
|
|
599
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
600
|
+
/**
|
|
601
|
+
* Returns a checkpoint representing the sync position after iteration.
|
|
602
|
+
* Save this and pass `checkpoint.lastSeenAt` as `since` on the next run
|
|
603
|
+
* to only fetch new items.
|
|
604
|
+
*/
|
|
605
|
+
checkpoint(): Checkpoint;
|
|
606
|
+
/** Total number of items yielded so far. */
|
|
607
|
+
get totalSeen(): number;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
declare class EpisodesResource {
|
|
611
|
+
private readonly http;
|
|
612
|
+
constructor(http: HttpClient);
|
|
613
|
+
/**
|
|
614
|
+
* Full-text search across podcast episode transcripts, titles, and descriptions.
|
|
615
|
+
*/
|
|
616
|
+
search(params: SearchEpisodesParams): Promise<SearchEpisodesResponse>;
|
|
617
|
+
/**
|
|
618
|
+
* Auto-paginating search that yields every matching episode across all pages.
|
|
619
|
+
*
|
|
620
|
+
* ```ts
|
|
621
|
+
* for await (const episode of client.episodes.searchAll({ query: 'AI', ...periods.thisWeek() })) {
|
|
622
|
+
* console.log(episode.episode_title);
|
|
623
|
+
* }
|
|
624
|
+
* ```
|
|
625
|
+
*/
|
|
626
|
+
searchAll(params: Omit<SearchEpisodesParams, 'page'>): Paginator<Episode>;
|
|
627
|
+
/**
|
|
628
|
+
* Get detailed information about a specific episode.
|
|
629
|
+
*/
|
|
630
|
+
get(params: GetEpisodeParams): Promise<GetEpisodeResponse>;
|
|
631
|
+
/**
|
|
632
|
+
* Get the most recently published podcast episodes.
|
|
633
|
+
*/
|
|
634
|
+
getRecent(params?: GetRecentEpisodesParams): Promise<GetRecentEpisodesResponse>;
|
|
635
|
+
/**
|
|
636
|
+
* List all episodes for a specific podcast.
|
|
637
|
+
*/
|
|
638
|
+
getByPodcast(params: GetPodcastEpisodesParams): Promise<GetPodcastEpisodesResponse>;
|
|
639
|
+
/**
|
|
640
|
+
* Auto-paginating version of `getByPodcast()` that yields every episode.
|
|
641
|
+
*
|
|
642
|
+
* ```ts
|
|
643
|
+
* for await (const ep of client.episodes.getByPodcastAll({
|
|
644
|
+
* podcast_id: 'pd_abc',
|
|
645
|
+
* ...periods.thisMonth(),
|
|
646
|
+
* })) {
|
|
647
|
+
* console.log(ep.episode_title);
|
|
648
|
+
* }
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
651
|
+
getByPodcastAll(params: Omit<GetPodcastEpisodesParams, 'page'>): Paginator<Episode>;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
declare class PodcastsResource {
|
|
655
|
+
private readonly http;
|
|
656
|
+
constructor(http: HttpClient);
|
|
657
|
+
/**
|
|
658
|
+
* Search podcasts by name, topic, or characteristics.
|
|
659
|
+
*/
|
|
660
|
+
search(params: SearchPodcastsParams): Promise<SearchPodcastsResponse>;
|
|
661
|
+
/**
|
|
662
|
+
* Auto-paginating search that yields every matching podcast across all pages.
|
|
663
|
+
*/
|
|
664
|
+
searchAll(params: Omit<SearchPodcastsParams, 'page'>): Paginator<Podcast>;
|
|
665
|
+
/**
|
|
666
|
+
* Get detailed information about a specific podcast.
|
|
667
|
+
*/
|
|
668
|
+
get(params: GetPodcastParams): Promise<GetPodcastResponse>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
declare class AlertsResource {
|
|
672
|
+
private readonly http;
|
|
673
|
+
constructor(http: HttpClient);
|
|
674
|
+
/**
|
|
675
|
+
* List your team's content monitoring alerts.
|
|
676
|
+
*/
|
|
677
|
+
list(params?: ListAlertsParams): Promise<ListAlertsResponse>;
|
|
678
|
+
/**
|
|
679
|
+
* Get mentions found by a specific alert.
|
|
680
|
+
*/
|
|
681
|
+
getMentions(params: GetAlertMentionsParams): Promise<GetAlertMentionsResponse>;
|
|
682
|
+
/**
|
|
683
|
+
* Create a new content monitoring alert.
|
|
684
|
+
*/
|
|
685
|
+
create(params: CreateAlertParams): Promise<CreateAlertResponse>;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
declare class TopicsResource {
|
|
689
|
+
private readonly http;
|
|
690
|
+
constructor(http: HttpClient);
|
|
691
|
+
/**
|
|
692
|
+
* Discover topics and subjects discussed across podcasts.
|
|
693
|
+
*/
|
|
694
|
+
search(params: SearchTopicsParams): Promise<SearchTopicsResponse>;
|
|
695
|
+
/**
|
|
696
|
+
* Auto-paginating search that yields every matching topic across all pages.
|
|
697
|
+
*/
|
|
698
|
+
searchAll(params: Omit<SearchTopicsParams, 'page'>): Paginator<TopicSummary>;
|
|
699
|
+
/**
|
|
700
|
+
* Get detailed information about a specific topic.
|
|
701
|
+
*/
|
|
702
|
+
get(params: GetTopicParams): Promise<GetTopicResponse>;
|
|
703
|
+
/**
|
|
704
|
+
* Get episodes where a specific topic was mentioned.
|
|
705
|
+
*/
|
|
706
|
+
getEpisodes(params: GetTopicEpisodesParams): Promise<GetTopicEpisodesResponse>;
|
|
707
|
+
/**
|
|
708
|
+
* Auto-paginating version of `getEpisodes()` that yields every episode for a topic.
|
|
709
|
+
*/
|
|
710
|
+
getEpisodesAll(params: Omit<GetTopicEpisodesParams, 'page'>): Paginator<Episode>;
|
|
711
|
+
/**
|
|
712
|
+
* Get currently trending topics across podcasts.
|
|
713
|
+
*/
|
|
714
|
+
getTrending(params?: GetTrendingTopicsParams): Promise<GetTrendingTopicsResponse>;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
declare class EntitiesResource {
|
|
718
|
+
private readonly http;
|
|
719
|
+
constructor(http: HttpClient);
|
|
720
|
+
/**
|
|
721
|
+
* Search for people and organizations mentioned across podcasts.
|
|
722
|
+
*/
|
|
723
|
+
search(params: SearchEntitiesParams): Promise<SearchEntitiesResponse>;
|
|
724
|
+
/**
|
|
725
|
+
* Auto-paginating search that yields every matching entity across all pages.
|
|
726
|
+
*/
|
|
727
|
+
searchAll(params: Omit<SearchEntitiesParams, 'page'>): Paginator<Entity>;
|
|
728
|
+
/**
|
|
729
|
+
* Get detailed information about a person or organization.
|
|
730
|
+
*/
|
|
731
|
+
get(params: GetEntityParams): Promise<GetEntityResponse>;
|
|
732
|
+
/**
|
|
733
|
+
* Get all podcast appearances for a specific entity.
|
|
734
|
+
*/
|
|
735
|
+
getAppearances(params: GetEntityAppearancesParams): Promise<GetEntityAppearancesResponse>;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
declare class ListsResource {
|
|
739
|
+
private readonly http;
|
|
740
|
+
constructor(http: HttpClient);
|
|
741
|
+
/**
|
|
742
|
+
* Get all lists/collections for your team.
|
|
743
|
+
*/
|
|
744
|
+
list(params?: ListUserListsParams): Promise<ListUserListsResponse>;
|
|
745
|
+
/**
|
|
746
|
+
* Get contents of a specific list.
|
|
747
|
+
*/
|
|
748
|
+
getItems(params: GetListItemsParams): Promise<GetListItemsResponse>;
|
|
749
|
+
/**
|
|
750
|
+
* Add items to a list. Accepts mixed item types (podcasts, episodes, entities, topics).
|
|
751
|
+
*/
|
|
752
|
+
addItems(params: AddToListParams): Promise<AddToListResponse>;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
declare class PublishersResource {
|
|
756
|
+
private readonly http;
|
|
757
|
+
constructor(http: HttpClient);
|
|
758
|
+
/**
|
|
759
|
+
* Get publisher information with their podcast portfolio.
|
|
760
|
+
*/
|
|
761
|
+
get(params: GetPublisherParams): Promise<GetPublisherResponse>;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
interface PodscanClientOptions {
|
|
765
|
+
/** Your Podscan API key (Bearer token). */
|
|
766
|
+
apiKey: string;
|
|
767
|
+
/** Override the base URL (default: https://podscan.fm/api/v1). */
|
|
768
|
+
baseUrl?: string;
|
|
769
|
+
/** Request timeout in milliseconds (default: 30000). */
|
|
770
|
+
timeout?: number;
|
|
771
|
+
}
|
|
772
|
+
declare class PodscanClient {
|
|
773
|
+
private readonly http;
|
|
774
|
+
/** Search and retrieve podcast episodes and recent content. */
|
|
775
|
+
readonly episodes: EpisodesResource;
|
|
776
|
+
/** Search and retrieve podcast metadata. */
|
|
777
|
+
readonly podcasts: PodcastsResource;
|
|
778
|
+
/** Create and manage keyword monitoring alerts and their mentions. */
|
|
779
|
+
readonly alerts: AlertsResource;
|
|
780
|
+
/** Search, retrieve, and track trending topics across podcasts. */
|
|
781
|
+
readonly topics: TopicsResource;
|
|
782
|
+
/** Search and retrieve people and organizations mentioned in podcasts. */
|
|
783
|
+
readonly entities: EntitiesResource;
|
|
784
|
+
/** Manage curated collections of podcasts, episodes, entities, and topics. */
|
|
785
|
+
readonly lists: ListsResource;
|
|
786
|
+
/** Retrieve publisher information and podcast portfolios. */
|
|
787
|
+
readonly publishers: PublishersResource;
|
|
788
|
+
constructor(options: PodscanClientOptions);
|
|
789
|
+
/** Current rate-limit info from the most recent API response, or null if no request has been made. */
|
|
790
|
+
get rateLimit(): RateLimitInfo | null;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Time period helpers for the Podscan SDK.
|
|
795
|
+
*
|
|
796
|
+
* Each method returns a `{ since, before? }` object that can be spread
|
|
797
|
+
* directly into any search params:
|
|
798
|
+
*
|
|
799
|
+
* ```ts
|
|
800
|
+
* const results = await client.episodes.search({
|
|
801
|
+
* query: 'AI',
|
|
802
|
+
* ...periods.thisWeek(),
|
|
803
|
+
* });
|
|
804
|
+
* ```
|
|
805
|
+
*/
|
|
806
|
+
declare const periods: {
|
|
807
|
+
/**
|
|
808
|
+
* From midnight today (UTC) until now.
|
|
809
|
+
*/
|
|
810
|
+
today(): DateRange;
|
|
811
|
+
/**
|
|
812
|
+
* From midnight yesterday (UTC) to midnight today (UTC).
|
|
813
|
+
*/
|
|
814
|
+
yesterday(): DateRange;
|
|
815
|
+
/**
|
|
816
|
+
* Rolling window: now minus 24 hours.
|
|
817
|
+
*/
|
|
818
|
+
last24Hours(): DateRange;
|
|
819
|
+
/**
|
|
820
|
+
* From Monday 00:00 UTC of the current week until now.
|
|
821
|
+
*/
|
|
822
|
+
thisWeek(): DateRange;
|
|
823
|
+
/**
|
|
824
|
+
* From Monday 00:00 UTC of last week to Monday 00:00 UTC of this week.
|
|
825
|
+
*/
|
|
826
|
+
lastWeek(): DateRange;
|
|
827
|
+
/**
|
|
828
|
+
* From the 1st of the current month (UTC) until now.
|
|
829
|
+
*/
|
|
830
|
+
thisMonth(): DateRange;
|
|
831
|
+
/**
|
|
832
|
+
* From the 1st of last month to the 1st of this month (UTC).
|
|
833
|
+
*/
|
|
834
|
+
lastMonth(): DateRange;
|
|
835
|
+
/**
|
|
836
|
+
* Rolling window: now minus N days.
|
|
837
|
+
*/
|
|
838
|
+
lastNDays(n: number): DateRange;
|
|
839
|
+
/**
|
|
840
|
+
* Rolling window: now minus N hours.
|
|
841
|
+
*/
|
|
842
|
+
lastNHours(n: number): DateRange;
|
|
843
|
+
/**
|
|
844
|
+
* Everything after a given date. Accepts an ISO string or Date object.
|
|
845
|
+
*/
|
|
846
|
+
since(date: string | Date): DateRange;
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
export { type AddToListParams, type AddToListResponse, type Alert, AlertsResource, type Category, type Checkpoint, type CreateAlertParams, type CreateAlertResponse, type DateRange, EntitiesResource, type Entity, type EntityAppearance, type EntityAppearanceCounts, type Episode, type EpisodeMetadata, EpisodesResource, type FirstOccurrence, type GetAlertMentionsParams, type GetAlertMentionsResponse, type GetEntityAppearancesParams, type GetEntityAppearancesResponse, type GetEntityParams, type GetEntityResponse, type GetEpisodeParams, type GetEpisodeResponse, type GetListItemsParams, type GetListItemsResponse, type GetPodcastEpisodesParams, type GetPodcastEpisodesResponse, type GetPodcastParams, type GetPodcastResponse, type GetPublisherParams, type GetPublisherResponse, type GetRecentEpisodesParams, type GetRecentEpisodesResponse, type GetTopicEpisodesParams, type GetTopicEpisodesResponse, type GetTopicParams, type GetTopicResponse, type GetTrendingTopicsParams, type GetTrendingTopicsResponse, type GuestInfo, type HostInfo, type ListAlertsParams, type ListAlertsResponse, type ListItem, type ListSummary, type ListUserListsParams, type ListUserListsResponse, ListsResource, type Mention, type Pagination, Paginator, type Podcast, type PodcastRef, PodcastsResource, PodscanClient, type PodscanClientOptions, PodscanError, type Publisher, PublishersResource, type Quota, type RateLimitInfo, type SearchEntitiesParams, type SearchEntitiesResponse, type SearchEpisodesParams, type SearchEpisodesResponse, type SearchHighlight, type SearchPodcastsParams, type SearchPodcastsResponse, type SearchTopicsParams, type SearchTopicsResponse, type Sentiment, type SortDirection, type SponsorInfo, type Topic, type TopicEpisodeOccurrence, type TopicMomentum, type TopicOccurrence, type TopicSummary, TopicsResource, type TrendingTopic, periods };
|