trendsearch 0.0.1

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.
@@ -0,0 +1,208 @@
1
+ import { A as TrendingArticlesResponse, B as ExploreWidget, C as ExploreResponse, D as TrendingNowResponse, E as TrendingNowRequest, F as PickerNode, G as AutocompleteResponse, H as Resolution, I as DailyTrendArticle, L as DailyTrendItem, M as CategoryPickerResponse, N as GeoPickerRequest, O as TrendingArticleItem, P as GeoPickerResponse, R as DailyTrendsRequest, S as ExploreRequest, T as TrendingNowItem, U as Topic, V as GoogleProperty, W as AutocompleteRequest, _ as InterestOverTimeRequest, a as TrendSearchClient, b as InterestByRegionRequest, c as RelatedTopicsRequest, d as RelatedQueriesResponse, f as RelatedQueryItem, g as InterestOverTimePoint, h as RealTimeTrendsResponse, i as EndpointOutput, j as CategoryPickerRequest, k as TrendingArticlesRequest, l as RelatedTopicsResponse, m as RealTimeTrendsRequest, n as CreateClientConfig, o as schemas, p as RealTimeStory, r as EndpointDebugOptions, s as RelatedTopicItem, t as CookieStore, u as RelatedQueriesRequest, v as InterestOverTimeResponse, w as ArticleKey, x as InterestByRegionResponse, y as GeoMapData, z as DailyTrendsResponse } from "./public-types-B6pmbT6Z.mjs";
2
+
3
+ //#region src/client/create-client.d.ts
4
+ declare const createClient: (config?: CreateClientConfig) => TrendSearchClient;
5
+ //#endregion
6
+ //#region src/core/session/cookies.d.ts
7
+ declare class MemoryCookieStore implements CookieStore {
8
+ private readonly cookiesByOrigin;
9
+ getCookieHeader(url: string): Promise<string | undefined>;
10
+ setCookieHeaders(url: string, setCookieHeaders: string[]): Promise<void>;
11
+ }
12
+ //#endregion
13
+ //#region src/errors/trendsearch-error.d.ts
14
+ declare class TrendSearchError extends Error {
15
+ readonly code: string;
16
+ constructor(message: string, code?: string);
17
+ }
18
+ //#endregion
19
+ //#region src/errors/endpoint-unavailable-error.d.ts
20
+ declare class EndpointUnavailableError extends TrendSearchError {
21
+ readonly endpoint: string;
22
+ readonly status?: number;
23
+ readonly replacements: string[];
24
+ constructor(args: {
25
+ endpoint: string;
26
+ status?: number;
27
+ replacements?: string[];
28
+ });
29
+ }
30
+ //#endregion
31
+ //#region src/errors/rate-limit-error.d.ts
32
+ declare class RateLimitError extends TrendSearchError {
33
+ readonly url: string;
34
+ readonly status: number;
35
+ constructor(args: {
36
+ message: string;
37
+ url: string;
38
+ status?: number;
39
+ });
40
+ }
41
+ //#endregion
42
+ //#region src/errors/schema-validation-error.d.ts
43
+ declare class SchemaValidationError extends TrendSearchError {
44
+ readonly endpoint: string;
45
+ readonly issues: string[];
46
+ constructor(args: {
47
+ endpoint: string;
48
+ issues: string[];
49
+ });
50
+ }
51
+ //#endregion
52
+ //#region src/errors/transport-error.d.ts
53
+ declare class TransportError extends TrendSearchError {
54
+ readonly status?: number;
55
+ readonly url: string;
56
+ readonly responseBody?: string;
57
+ constructor(args: {
58
+ message: string;
59
+ url: string;
60
+ status?: number;
61
+ responseBody?: string;
62
+ });
63
+ }
64
+ //#endregion
65
+ //#region src/errors/unexpected-response-error.d.ts
66
+ declare class UnexpectedResponseError extends TrendSearchError {
67
+ readonly endpoint: string;
68
+ constructor(args: {
69
+ endpoint: string;
70
+ message: string;
71
+ });
72
+ }
73
+ //#endregion
74
+ //#region src/index.d.ts
75
+ declare const autocomplete: (input: {
76
+ keyword: string;
77
+ hl?: string;
78
+ tz?: number;
79
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
80
+ topics: Topic[];
81
+ }>>;
82
+ declare const explore: (input: {
83
+ keywords: string[];
84
+ geo?: string | string[];
85
+ time?: string;
86
+ category?: number;
87
+ property?: "" | "images" | "news" | "youtube" | "froogle";
88
+ hl?: string;
89
+ tz?: number;
90
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
91
+ widgets: ExploreWidget[];
92
+ comparisonItem: {
93
+ keyword: string;
94
+ geo?: string;
95
+ time: string;
96
+ }[];
97
+ }>>;
98
+ declare const interestOverTime: (input: {
99
+ keywords: string[];
100
+ geo?: string | string[];
101
+ time?: string;
102
+ category?: number;
103
+ property?: "" | "images" | "news" | "youtube" | "froogle";
104
+ hl?: string;
105
+ tz?: number;
106
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
107
+ timeline: InterestOverTimePoint[];
108
+ }>>;
109
+ declare const interestByRegion: (input: {
110
+ keywords: string[];
111
+ geo?: string | string[];
112
+ time?: string;
113
+ category?: number;
114
+ property?: "" | "images" | "news" | "youtube" | "froogle";
115
+ resolution?: "COUNTRY" | "REGION" | "CITY" | "DMA";
116
+ hl?: string;
117
+ tz?: number;
118
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
119
+ regions: GeoMapData[];
120
+ }>>;
121
+ declare const relatedQueries: (input: {
122
+ keywords: string[];
123
+ geo?: string | string[];
124
+ time?: string;
125
+ category?: number;
126
+ property?: "" | "images" | "news" | "youtube" | "froogle";
127
+ hl?: string;
128
+ tz?: number;
129
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
130
+ top: RelatedQueryItem[];
131
+ rising: RelatedQueryItem[];
132
+ }>>;
133
+ declare const relatedTopics: (input: {
134
+ keywords: string[];
135
+ geo?: string | string[];
136
+ time?: string;
137
+ category?: number;
138
+ property?: "" | "images" | "news" | "youtube" | "froogle";
139
+ hl?: string;
140
+ tz?: number;
141
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
142
+ top: RelatedTopicItem[];
143
+ rising: RelatedTopicItem[];
144
+ }>>;
145
+ declare const dailyTrends: (input: {
146
+ geo: string;
147
+ category?: string | number;
148
+ date?: string | Date;
149
+ ns?: number;
150
+ hl?: string;
151
+ tz?: number;
152
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
153
+ days: DailyTrendsResponse["default"]["trendingSearchesDays"];
154
+ trends: DailyTrendsResponse["default"]["trendingSearchesDays"][number]["trendingSearches"];
155
+ }>>;
156
+ declare const realTimeTrends: (input: {
157
+ geo: string;
158
+ category?: string | number;
159
+ fi?: number;
160
+ fs?: number;
161
+ ri?: number;
162
+ rs?: number;
163
+ sort?: number;
164
+ hl?: string;
165
+ tz?: number;
166
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
167
+ stories: Record<string, unknown>[];
168
+ }>>;
169
+ declare const trendingNow: (input: {
170
+ geo?: string;
171
+ language?: string;
172
+ hours?: 4 | 24 | 48 | 168;
173
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
174
+ items: TrendingNowItem[];
175
+ }>>;
176
+ declare const trendingArticles: (input: {
177
+ articleKeys: [number, string, string][];
178
+ articleCount?: number;
179
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
180
+ articles: TrendingArticleItem[];
181
+ }>>;
182
+ declare const experimental: {
183
+ trendingNow: (input: {
184
+ geo?: string;
185
+ language?: string;
186
+ hours?: 4 | 24 | 48 | 168;
187
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
188
+ items: TrendingNowItem[];
189
+ }>>;
190
+ trendingArticles: (input: {
191
+ articleKeys: [number, string, string][];
192
+ articleCount?: number;
193
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
194
+ articles: TrendingArticleItem[];
195
+ }>>;
196
+ geoPicker: (input?: {
197
+ hl?: string;
198
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
199
+ items: GeoPickerResponse;
200
+ }>>;
201
+ categoryPicker: (input?: {
202
+ hl?: string;
203
+ }, options?: EndpointDebugOptions) => Promise<EndpointOutput<{
204
+ items: CategoryPickerResponse;
205
+ }>>;
206
+ };
207
+ //#endregion
208
+ export { type ArticleKey, type AutocompleteRequest, type AutocompleteResponse, type CategoryPickerRequest, type CategoryPickerResponse, type CreateClientConfig, type DailyTrendArticle, type DailyTrendItem, type DailyTrendsRequest, type DailyTrendsResponse, type EndpointDebugOptions, EndpointUnavailableError, type ExploreRequest, type ExploreResponse, type ExploreWidget, type GeoMapData, type GeoPickerRequest, type GeoPickerResponse, type GoogleProperty, type InterestByRegionRequest, type InterestByRegionResponse, type InterestOverTimePoint, type InterestOverTimeRequest, type InterestOverTimeResponse, MemoryCookieStore, type PickerNode, RateLimitError, type RealTimeStory, type RealTimeTrendsRequest, type RealTimeTrendsResponse, type RelatedQueriesRequest, type RelatedQueriesResponse, type RelatedQueryItem, type RelatedTopicItem, type RelatedTopicsRequest, type RelatedTopicsResponse, type Resolution, SchemaValidationError, type Topic, TransportError, type TrendSearchClient, TrendSearchError, type TrendingArticleItem, type TrendingArticlesRequest, type TrendingArticlesResponse, type TrendingNowItem, type TrendingNowRequest, type TrendingNowResponse, UnexpectedResponseError, autocomplete, createClient, dailyTrends, experimental, explore, interestByRegion, interestOverTime, realTimeTrends, relatedQueries, relatedTopics, schemas, trendingArticles, trendingNow };
package/dist/index.mjs ADDED
@@ -0,0 +1,18 @@
1
+ import { a as UnexpectedResponseError, c as RateLimitError, i as MemoryCookieStore, l as EndpointUnavailableError, n as schemas, o as TransportError, s as SchemaValidationError, t as createClient, u as TrendSearchError } from "./create-client-B1euQ5Of.mjs";
2
+
3
+ //#region src/index.ts
4
+ const defaultClient = createClient();
5
+ const { autocomplete } = defaultClient;
6
+ const { explore } = defaultClient;
7
+ const { interestOverTime } = defaultClient;
8
+ const { interestByRegion } = defaultClient;
9
+ const { relatedQueries } = defaultClient;
10
+ const { relatedTopics } = defaultClient;
11
+ const { dailyTrends } = defaultClient;
12
+ const { realTimeTrends } = defaultClient;
13
+ const { trendingNow } = defaultClient;
14
+ const { trendingArticles } = defaultClient;
15
+ const { experimental } = defaultClient;
16
+
17
+ //#endregion
18
+ export { EndpointUnavailableError, MemoryCookieStore, RateLimitError, SchemaValidationError, TransportError, TrendSearchError, UnexpectedResponseError, autocomplete, createClient, dailyTrends, experimental, explore, interestByRegion, interestOverTime, realTimeTrends, relatedQueries, relatedTopics, schemas, trendingArticles, trendingNow };