scavio 0.1.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.
@@ -0,0 +1,235 @@
1
+ interface AmazonSearchOptions {
2
+ query: string;
3
+ domain?: string;
4
+ country?: string;
5
+ language?: string;
6
+ currency?: string;
7
+ device?: string;
8
+ sort_by?: string;
9
+ start_page?: number;
10
+ pages?: number;
11
+ category_id?: string;
12
+ merchant_id?: string;
13
+ zip_code?: string;
14
+ autoselect_variant?: boolean;
15
+ }
16
+ interface AmazonProductOptions {
17
+ asin: string;
18
+ domain?: string;
19
+ country?: string;
20
+ language?: string;
21
+ currency?: string;
22
+ device?: string;
23
+ zip_code?: string;
24
+ autoselect_variant?: boolean;
25
+ }
26
+ declare class AmazonNamespace {
27
+ private client;
28
+ constructor(client: Scavio);
29
+ search(options: AmazonSearchOptions): Promise<Record<string, unknown>>;
30
+ product(options: AmazonProductOptions): Promise<Record<string, unknown>>;
31
+ }
32
+
33
+ interface GoogleSearchOptions {
34
+ query: string;
35
+ country_code?: string;
36
+ language?: string;
37
+ page?: number;
38
+ search_type?: string;
39
+ device?: string;
40
+ nfpr?: boolean;
41
+ light_request?: boolean;
42
+ }
43
+ declare class GoogleNamespace {
44
+ private client;
45
+ constructor(client: Scavio);
46
+ search(options: GoogleSearchOptions): Promise<Record<string, unknown>>;
47
+ }
48
+
49
+ interface RedditSearchOptions {
50
+ query: string;
51
+ type?: string;
52
+ sort?: string;
53
+ cursor?: string;
54
+ }
55
+ interface RedditPostOptions {
56
+ url: string;
57
+ }
58
+ declare class RedditNamespace {
59
+ private client;
60
+ constructor(client: Scavio);
61
+ search(options: RedditSearchOptions): Promise<Record<string, unknown>>;
62
+ post(options: RedditPostOptions): Promise<Record<string, unknown>>;
63
+ }
64
+
65
+ interface TikTokProfileOptions {
66
+ username?: string;
67
+ sec_user_id?: string;
68
+ }
69
+ interface TikTokUserPostsOptions {
70
+ sec_user_id: string;
71
+ cursor?: string;
72
+ count?: number;
73
+ sort_type?: string;
74
+ }
75
+ interface TikTokVideoOptions {
76
+ video_id: string;
77
+ }
78
+ interface TikTokVideoCommentsOptions {
79
+ video_id: string;
80
+ cursor?: string;
81
+ count?: number;
82
+ }
83
+ interface TikTokCommentRepliesOptions {
84
+ video_id: string;
85
+ comment_id: string;
86
+ cursor?: string;
87
+ count?: number;
88
+ }
89
+ interface TikTokSearchVideosOptions {
90
+ keyword: string;
91
+ cursor?: string;
92
+ count?: number;
93
+ sort_type?: string;
94
+ publish_time?: string;
95
+ }
96
+ interface TikTokSearchUsersOptions {
97
+ keyword: string;
98
+ cursor?: string;
99
+ count?: number;
100
+ }
101
+ interface TikTokHashtagOptions {
102
+ hashtag_name?: string;
103
+ hashtag_id?: string;
104
+ }
105
+ interface TikTokHashtagVideosOptions {
106
+ hashtag_id: string;
107
+ cursor?: string;
108
+ count?: number;
109
+ }
110
+ interface TikTokUserFollowersOptions {
111
+ sec_user_id: string;
112
+ count?: number;
113
+ page_token?: string;
114
+ min_time?: number;
115
+ }
116
+ interface TikTokUserFollowingsOptions {
117
+ sec_user_id: string;
118
+ count?: number;
119
+ page_token?: string;
120
+ min_time?: number;
121
+ }
122
+ declare class TikTokNamespace {
123
+ private client;
124
+ constructor(client: Scavio);
125
+ profile(options: TikTokProfileOptions): Promise<Record<string, unknown>>;
126
+ userPosts(options: TikTokUserPostsOptions): Promise<Record<string, unknown>>;
127
+ video(options: TikTokVideoOptions): Promise<Record<string, unknown>>;
128
+ videoComments(options: TikTokVideoCommentsOptions): Promise<Record<string, unknown>>;
129
+ commentReplies(options: TikTokCommentRepliesOptions): Promise<Record<string, unknown>>;
130
+ searchVideos(options: TikTokSearchVideosOptions): Promise<Record<string, unknown>>;
131
+ searchUsers(options: TikTokSearchUsersOptions): Promise<Record<string, unknown>>;
132
+ hashtag(options: TikTokHashtagOptions): Promise<Record<string, unknown>>;
133
+ hashtagVideos(options: TikTokHashtagVideosOptions): Promise<Record<string, unknown>>;
134
+ userFollowers(options: TikTokUserFollowersOptions): Promise<Record<string, unknown>>;
135
+ userFollowings(options: TikTokUserFollowingsOptions): Promise<Record<string, unknown>>;
136
+ }
137
+
138
+ interface WalmartSearchOptions {
139
+ query: string;
140
+ domain?: string;
141
+ device?: string;
142
+ sort_by?: string;
143
+ start_page?: number;
144
+ min_price?: number;
145
+ max_price?: number;
146
+ fulfillment_speed?: string;
147
+ fulfillment_type?: string;
148
+ delivery_zip?: string;
149
+ store_id?: string;
150
+ }
151
+ interface WalmartProductOptions {
152
+ product_id: string;
153
+ domain?: string;
154
+ device?: string;
155
+ delivery_zip?: string;
156
+ store_id?: string;
157
+ }
158
+ declare class WalmartNamespace {
159
+ private client;
160
+ constructor(client: Scavio);
161
+ search(options: WalmartSearchOptions): Promise<Record<string, unknown>>;
162
+ product(options: WalmartProductOptions): Promise<Record<string, unknown>>;
163
+ }
164
+
165
+ interface YouTubeSearchOptions {
166
+ query: string;
167
+ upload_date?: string;
168
+ type?: string;
169
+ duration?: string;
170
+ sort_by?: string;
171
+ hd?: boolean;
172
+ subtitles?: boolean;
173
+ creative_commons?: boolean;
174
+ live?: boolean;
175
+ }
176
+ interface YouTubeMetadataOptions {
177
+ video_id: string;
178
+ }
179
+ declare class YouTubeNamespace {
180
+ private client;
181
+ constructor(client: Scavio);
182
+ search(options: YouTubeSearchOptions): Promise<Record<string, unknown>>;
183
+ metadata(options: YouTubeMetadataOptions): Promise<Record<string, unknown>>;
184
+ }
185
+
186
+ interface ScavioConfig {
187
+ apiKey?: string;
188
+ baseUrl?: string;
189
+ timeout?: number;
190
+ maxRequestsPerSecond?: number;
191
+ }
192
+ declare class Scavio {
193
+ readonly google: GoogleNamespace;
194
+ readonly amazon: AmazonNamespace;
195
+ readonly walmart: WalmartNamespace;
196
+ readonly youtube: YouTubeNamespace;
197
+ readonly reddit: RedditNamespace;
198
+ readonly tiktok: TikTokNamespace;
199
+ private readonly apiKey;
200
+ private readonly baseUrl;
201
+ private readonly timeout;
202
+ private readonly rateLimiter;
203
+ constructor(config?: ScavioConfig);
204
+ /** @internal */
205
+ _post(path: string, body: object): Promise<Record<string, unknown>>;
206
+ /** @internal */
207
+ _get(path: string): Promise<Record<string, unknown>>;
208
+ search(options: GoogleSearchOptions): Promise<Record<string, unknown>>;
209
+ getUsage(): Promise<Record<string, unknown>>;
210
+ }
211
+
212
+ declare class ScavioError extends Error {
213
+ constructor(message: string);
214
+ }
215
+ declare class MissingAPIKeyError extends ScavioError {
216
+ constructor();
217
+ }
218
+ declare class InvalidAPIKeyError extends ScavioError {
219
+ constructor(message?: string);
220
+ }
221
+ declare class InsufficientCreditsError extends ScavioError {
222
+ constructor(message?: string);
223
+ }
224
+ declare class BadRequestError extends ScavioError {
225
+ constructor(message?: string);
226
+ }
227
+ declare class RateLimitError extends ScavioError {
228
+ constructor(message?: string);
229
+ }
230
+ declare class ScavioAPIError extends ScavioError {
231
+ readonly statusCode: number;
232
+ constructor(statusCode: number, message: string);
233
+ }
234
+
235
+ export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleSearchOptions, InsufficientCreditsError, InvalidAPIKeyError, MissingAPIKeyError, RateLimitError, type RedditPostOptions, type RedditSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type WalmartProductOptions, type WalmartSearchOptions, type YouTubeMetadataOptions, type YouTubeSearchOptions };
@@ -0,0 +1,235 @@
1
+ interface AmazonSearchOptions {
2
+ query: string;
3
+ domain?: string;
4
+ country?: string;
5
+ language?: string;
6
+ currency?: string;
7
+ device?: string;
8
+ sort_by?: string;
9
+ start_page?: number;
10
+ pages?: number;
11
+ category_id?: string;
12
+ merchant_id?: string;
13
+ zip_code?: string;
14
+ autoselect_variant?: boolean;
15
+ }
16
+ interface AmazonProductOptions {
17
+ asin: string;
18
+ domain?: string;
19
+ country?: string;
20
+ language?: string;
21
+ currency?: string;
22
+ device?: string;
23
+ zip_code?: string;
24
+ autoselect_variant?: boolean;
25
+ }
26
+ declare class AmazonNamespace {
27
+ private client;
28
+ constructor(client: Scavio);
29
+ search(options: AmazonSearchOptions): Promise<Record<string, unknown>>;
30
+ product(options: AmazonProductOptions): Promise<Record<string, unknown>>;
31
+ }
32
+
33
+ interface GoogleSearchOptions {
34
+ query: string;
35
+ country_code?: string;
36
+ language?: string;
37
+ page?: number;
38
+ search_type?: string;
39
+ device?: string;
40
+ nfpr?: boolean;
41
+ light_request?: boolean;
42
+ }
43
+ declare class GoogleNamespace {
44
+ private client;
45
+ constructor(client: Scavio);
46
+ search(options: GoogleSearchOptions): Promise<Record<string, unknown>>;
47
+ }
48
+
49
+ interface RedditSearchOptions {
50
+ query: string;
51
+ type?: string;
52
+ sort?: string;
53
+ cursor?: string;
54
+ }
55
+ interface RedditPostOptions {
56
+ url: string;
57
+ }
58
+ declare class RedditNamespace {
59
+ private client;
60
+ constructor(client: Scavio);
61
+ search(options: RedditSearchOptions): Promise<Record<string, unknown>>;
62
+ post(options: RedditPostOptions): Promise<Record<string, unknown>>;
63
+ }
64
+
65
+ interface TikTokProfileOptions {
66
+ username?: string;
67
+ sec_user_id?: string;
68
+ }
69
+ interface TikTokUserPostsOptions {
70
+ sec_user_id: string;
71
+ cursor?: string;
72
+ count?: number;
73
+ sort_type?: string;
74
+ }
75
+ interface TikTokVideoOptions {
76
+ video_id: string;
77
+ }
78
+ interface TikTokVideoCommentsOptions {
79
+ video_id: string;
80
+ cursor?: string;
81
+ count?: number;
82
+ }
83
+ interface TikTokCommentRepliesOptions {
84
+ video_id: string;
85
+ comment_id: string;
86
+ cursor?: string;
87
+ count?: number;
88
+ }
89
+ interface TikTokSearchVideosOptions {
90
+ keyword: string;
91
+ cursor?: string;
92
+ count?: number;
93
+ sort_type?: string;
94
+ publish_time?: string;
95
+ }
96
+ interface TikTokSearchUsersOptions {
97
+ keyword: string;
98
+ cursor?: string;
99
+ count?: number;
100
+ }
101
+ interface TikTokHashtagOptions {
102
+ hashtag_name?: string;
103
+ hashtag_id?: string;
104
+ }
105
+ interface TikTokHashtagVideosOptions {
106
+ hashtag_id: string;
107
+ cursor?: string;
108
+ count?: number;
109
+ }
110
+ interface TikTokUserFollowersOptions {
111
+ sec_user_id: string;
112
+ count?: number;
113
+ page_token?: string;
114
+ min_time?: number;
115
+ }
116
+ interface TikTokUserFollowingsOptions {
117
+ sec_user_id: string;
118
+ count?: number;
119
+ page_token?: string;
120
+ min_time?: number;
121
+ }
122
+ declare class TikTokNamespace {
123
+ private client;
124
+ constructor(client: Scavio);
125
+ profile(options: TikTokProfileOptions): Promise<Record<string, unknown>>;
126
+ userPosts(options: TikTokUserPostsOptions): Promise<Record<string, unknown>>;
127
+ video(options: TikTokVideoOptions): Promise<Record<string, unknown>>;
128
+ videoComments(options: TikTokVideoCommentsOptions): Promise<Record<string, unknown>>;
129
+ commentReplies(options: TikTokCommentRepliesOptions): Promise<Record<string, unknown>>;
130
+ searchVideos(options: TikTokSearchVideosOptions): Promise<Record<string, unknown>>;
131
+ searchUsers(options: TikTokSearchUsersOptions): Promise<Record<string, unknown>>;
132
+ hashtag(options: TikTokHashtagOptions): Promise<Record<string, unknown>>;
133
+ hashtagVideos(options: TikTokHashtagVideosOptions): Promise<Record<string, unknown>>;
134
+ userFollowers(options: TikTokUserFollowersOptions): Promise<Record<string, unknown>>;
135
+ userFollowings(options: TikTokUserFollowingsOptions): Promise<Record<string, unknown>>;
136
+ }
137
+
138
+ interface WalmartSearchOptions {
139
+ query: string;
140
+ domain?: string;
141
+ device?: string;
142
+ sort_by?: string;
143
+ start_page?: number;
144
+ min_price?: number;
145
+ max_price?: number;
146
+ fulfillment_speed?: string;
147
+ fulfillment_type?: string;
148
+ delivery_zip?: string;
149
+ store_id?: string;
150
+ }
151
+ interface WalmartProductOptions {
152
+ product_id: string;
153
+ domain?: string;
154
+ device?: string;
155
+ delivery_zip?: string;
156
+ store_id?: string;
157
+ }
158
+ declare class WalmartNamespace {
159
+ private client;
160
+ constructor(client: Scavio);
161
+ search(options: WalmartSearchOptions): Promise<Record<string, unknown>>;
162
+ product(options: WalmartProductOptions): Promise<Record<string, unknown>>;
163
+ }
164
+
165
+ interface YouTubeSearchOptions {
166
+ query: string;
167
+ upload_date?: string;
168
+ type?: string;
169
+ duration?: string;
170
+ sort_by?: string;
171
+ hd?: boolean;
172
+ subtitles?: boolean;
173
+ creative_commons?: boolean;
174
+ live?: boolean;
175
+ }
176
+ interface YouTubeMetadataOptions {
177
+ video_id: string;
178
+ }
179
+ declare class YouTubeNamespace {
180
+ private client;
181
+ constructor(client: Scavio);
182
+ search(options: YouTubeSearchOptions): Promise<Record<string, unknown>>;
183
+ metadata(options: YouTubeMetadataOptions): Promise<Record<string, unknown>>;
184
+ }
185
+
186
+ interface ScavioConfig {
187
+ apiKey?: string;
188
+ baseUrl?: string;
189
+ timeout?: number;
190
+ maxRequestsPerSecond?: number;
191
+ }
192
+ declare class Scavio {
193
+ readonly google: GoogleNamespace;
194
+ readonly amazon: AmazonNamespace;
195
+ readonly walmart: WalmartNamespace;
196
+ readonly youtube: YouTubeNamespace;
197
+ readonly reddit: RedditNamespace;
198
+ readonly tiktok: TikTokNamespace;
199
+ private readonly apiKey;
200
+ private readonly baseUrl;
201
+ private readonly timeout;
202
+ private readonly rateLimiter;
203
+ constructor(config?: ScavioConfig);
204
+ /** @internal */
205
+ _post(path: string, body: object): Promise<Record<string, unknown>>;
206
+ /** @internal */
207
+ _get(path: string): Promise<Record<string, unknown>>;
208
+ search(options: GoogleSearchOptions): Promise<Record<string, unknown>>;
209
+ getUsage(): Promise<Record<string, unknown>>;
210
+ }
211
+
212
+ declare class ScavioError extends Error {
213
+ constructor(message: string);
214
+ }
215
+ declare class MissingAPIKeyError extends ScavioError {
216
+ constructor();
217
+ }
218
+ declare class InvalidAPIKeyError extends ScavioError {
219
+ constructor(message?: string);
220
+ }
221
+ declare class InsufficientCreditsError extends ScavioError {
222
+ constructor(message?: string);
223
+ }
224
+ declare class BadRequestError extends ScavioError {
225
+ constructor(message?: string);
226
+ }
227
+ declare class RateLimitError extends ScavioError {
228
+ constructor(message?: string);
229
+ }
230
+ declare class ScavioAPIError extends ScavioError {
231
+ readonly statusCode: number;
232
+ constructor(statusCode: number, message: string);
233
+ }
234
+
235
+ export { type AmazonProductOptions, type AmazonSearchOptions, BadRequestError, type GoogleSearchOptions, InsufficientCreditsError, InvalidAPIKeyError, MissingAPIKeyError, RateLimitError, type RedditPostOptions, type RedditSearchOptions, Scavio, ScavioAPIError, type ScavioConfig, ScavioError, type TikTokCommentRepliesOptions, type TikTokHashtagOptions, type TikTokHashtagVideosOptions, type TikTokProfileOptions, type TikTokSearchUsersOptions, type TikTokSearchVideosOptions, type TikTokUserFollowersOptions, type TikTokUserFollowingsOptions, type TikTokUserPostsOptions, type TikTokVideoCommentsOptions, type TikTokVideoOptions, type WalmartProductOptions, type WalmartSearchOptions, type YouTubeMetadataOptions, type YouTubeSearchOptions };