Skip to content

Commit b3f0c9f

Browse files
committed
lint
1 parent a55b224 commit b3f0c9f

File tree

53 files changed

+249
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+249
-142
lines changed

apps/sim/app/api/tools/brightdata/dataset/route.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export async function POST(request: Request) {
1919
}
2020

2121
const params: Record<string, unknown> = { ...body }
22-
delete params.datasetId
23-
delete params.apiToken
22+
params.datasetId = undefined
23+
params.apiToken = undefined
2424

2525
logger.info(`[${requestId}] Triggering dataset`, { datasetId })
2626

@@ -66,7 +66,9 @@ export async function POST(request: Request) {
6666
}
6767

6868
const snapshotId =
69-
typeof triggerPayload === 'object' && triggerPayload !== null && 'snapshot_id' in triggerPayload
69+
typeof triggerPayload === 'object' &&
70+
triggerPayload !== null &&
71+
'snapshot_id' in triggerPayload
7072
? String((triggerPayload as { snapshot_id?: unknown }).snapshot_id ?? '')
7173
: ''
7274

@@ -129,7 +131,9 @@ export async function POST(request: Request) {
129131
}
130132

131133
const status =
132-
typeof snapshotPayload === 'object' && snapshotPayload !== null && 'status' in snapshotPayload
134+
typeof snapshotPayload === 'object' &&
135+
snapshotPayload !== null &&
136+
'status' in snapshotPayload
133137
? String((snapshotPayload as { status?: unknown }).status ?? '')
134138
: ''
135139

@@ -155,10 +159,7 @@ export async function POST(request: Request) {
155159
}
156160

157161
logger.error(`[${requestId}] Dataset snapshot timed out`, { datasetId, snapshotId })
158-
return NextResponse.json(
159-
{ error: 'Timeout waiting for dataset snapshot' },
160-
{ status: 504 }
161-
)
162+
return NextResponse.json({ error: 'Timeout waiting for dataset snapshot' }, { status: 504 })
162163
} catch (error) {
163164
const message = error instanceof Error ? error.message : 'Dataset fetch failed'
164165
logger.error(`[${requestId}] Dataset fetch failed`, { error: message })

apps/sim/app/api/tools/brightdata/scrape-markdown/route.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ export async function POST(request: Request) {
4848
? String((payload as { error?: unknown }).error)
4949
: response.statusText
5050

51-
logger.error(`[${requestId}] Scraping failed`, { url, status: response.status, error: errorMessage })
51+
logger.error(`[${requestId}] Scraping failed`, {
52+
url,
53+
status: response.status,
54+
error: errorMessage,
55+
})
5256

53-
return NextResponse.json({ error: errorMessage || 'Scraping failed' }, { status: response.status })
57+
return NextResponse.json(
58+
{ error: errorMessage || 'Scraping failed' },
59+
{ status: response.status }
60+
)
5461
}
5562

5663
const markdown =

apps/sim/app/api/tools/brightdata/search-engine/route.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,16 @@ export async function POST(request: Request) {
5656
? String((payload as { error?: unknown }).error)
5757
: response.statusText
5858

59-
logger.error(`[${requestId}] Search failed`, { query, status: response.status, error: errorMessage })
60-
61-
return NextResponse.json({ error: errorMessage || 'Search failed' }, { status: response.status })
59+
logger.error(`[${requestId}] Search failed`, {
60+
query,
61+
status: response.status,
62+
error: errorMessage,
63+
})
64+
65+
return NextResponse.json(
66+
{ error: errorMessage || 'Search failed' },
67+
{ status: response.status }
68+
)
6269
}
6370

6471
let normalizedResults: Array<{ title: string; url: string; snippet: string }> = []

apps/sim/blocks/blocks/brightdata.ts

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@ export const BrightDataBlock: BlockConfig<BrightDataResponse> = {
9494
{ label: 'Instagram Reels Dataset', id: 'dataset_instagram_reels' },
9595
{ label: 'Instagram Comments Dataset', id: 'dataset_instagram_comments' },
9696
{ label: 'Facebook Posts Dataset', id: 'dataset_facebook_posts' },
97-
{ label: 'Facebook Marketplace Listings Dataset', id: 'dataset_facebook_marketplace_listings' },
97+
{
98+
label: 'Facebook Marketplace Listings Dataset',
99+
id: 'dataset_facebook_marketplace_listings',
100+
},
98101
{ label: 'Facebook Company Reviews Dataset', id: 'dataset_facebook_company_reviews' },
99102
{ label: 'Facebook Events Dataset', id: 'dataset_facebook_events' },
100103
{ label: 'Tiktok Profiles Dataset', id: 'dataset_tiktok_profiles' },
@@ -148,7 +151,54 @@ export const BrightDataBlock: BlockConfig<BrightDataResponse> = {
148151
title: 'Dataset URL',
149152
type: 'short-input',
150153
placeholder: 'https://example.com',
151-
condition: { field: 'operation', value: ['dataset_amazon_product', 'dataset_amazon_product_reviews', 'dataset_amazon_product_search', 'dataset_walmart_product', 'dataset_walmart_seller', 'dataset_ebay_product', 'dataset_homedepot_products', 'dataset_zara_products', 'dataset_etsy_products', 'dataset_bestbuy_products', 'dataset_linkedin_person_profile', 'dataset_linkedin_company_profile', 'dataset_linkedin_job_listings', 'dataset_linkedin_posts', 'dataset_linkedin_people_search', 'dataset_crunchbase_company', 'dataset_zoominfo_company_profile', 'dataset_instagram_profiles', 'dataset_instagram_posts', 'dataset_instagram_reels', 'dataset_instagram_comments', 'dataset_facebook_posts', 'dataset_facebook_marketplace_listings', 'dataset_facebook_company_reviews', 'dataset_facebook_events', 'dataset_tiktok_profiles', 'dataset_tiktok_posts', 'dataset_tiktok_shop', 'dataset_tiktok_comments', 'dataset_google_maps_reviews', 'dataset_google_shopping', 'dataset_google_play_store', 'dataset_apple_app_store', 'dataset_reuter_news', 'dataset_github_repository_file', 'dataset_yahoo_finance_business', 'dataset_x_posts', 'dataset_zillow_properties_listing', 'dataset_booking_hotel_listings', 'dataset_youtube_profiles', 'dataset_youtube_comments', 'dataset_reddit_posts', 'dataset_youtube_videos'] },
154+
condition: {
155+
field: 'operation',
156+
value: [
157+
'dataset_amazon_product',
158+
'dataset_amazon_product_reviews',
159+
'dataset_amazon_product_search',
160+
'dataset_walmart_product',
161+
'dataset_walmart_seller',
162+
'dataset_ebay_product',
163+
'dataset_homedepot_products',
164+
'dataset_zara_products',
165+
'dataset_etsy_products',
166+
'dataset_bestbuy_products',
167+
'dataset_linkedin_person_profile',
168+
'dataset_linkedin_company_profile',
169+
'dataset_linkedin_job_listings',
170+
'dataset_linkedin_posts',
171+
'dataset_linkedin_people_search',
172+
'dataset_crunchbase_company',
173+
'dataset_zoominfo_company_profile',
174+
'dataset_instagram_profiles',
175+
'dataset_instagram_posts',
176+
'dataset_instagram_reels',
177+
'dataset_instagram_comments',
178+
'dataset_facebook_posts',
179+
'dataset_facebook_marketplace_listings',
180+
'dataset_facebook_company_reviews',
181+
'dataset_facebook_events',
182+
'dataset_tiktok_profiles',
183+
'dataset_tiktok_posts',
184+
'dataset_tiktok_shop',
185+
'dataset_tiktok_comments',
186+
'dataset_google_maps_reviews',
187+
'dataset_google_shopping',
188+
'dataset_google_play_store',
189+
'dataset_apple_app_store',
190+
'dataset_reuter_news',
191+
'dataset_github_repository_file',
192+
'dataset_yahoo_finance_business',
193+
'dataset_x_posts',
194+
'dataset_zillow_properties_listing',
195+
'dataset_booking_hotel_listings',
196+
'dataset_youtube_profiles',
197+
'dataset_youtube_comments',
198+
'dataset_reddit_posts',
199+
'dataset_youtube_videos',
200+
],
201+
},
152202
required: true,
153203
},
154204
{

apps/sim/tools/brightdata/dataset_amazon_product.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type { ToolConfig } from '@/tools/types'
77
export const datasetAmazonProductTool: ToolConfig<DatasetParams, DatasetResponse> = {
88
id: 'brightdata_dataset_amazon_product',
99
name: 'Bright Data Amazon Product Dataset',
10-
description: "Quickly read structured amazon product data.\nRequires a valid product URL with /dp/ in it.\nThis can be a cache lookup, so it can be more reliable than scraping",
10+
description:
11+
'Quickly read structured amazon product data.\nRequires a valid product URL with /dp/ in it.\nThis can be a cache lookup, so it can be more reliable than scraping',
1112
version: '1.0.0',
1213

1314
params: {

apps/sim/tools/brightdata/dataset_amazon_product_reviews.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type { ToolConfig } from '@/tools/types'
77
export const datasetAmazonProductReviewsTool: ToolConfig<DatasetParams, DatasetResponse> = {
88
id: 'brightdata_dataset_amazon_product_reviews',
99
name: 'Bright Data Amazon Product Reviews Dataset',
10-
description: "Quickly read structured amazon product review data.\nRequires a valid product URL with /dp/ in it.\nThis can be a cache lookup, so it can be more reliable than scraping",
10+
description:
11+
'Quickly read structured amazon product review data.\nRequires a valid product URL with /dp/ in it.\nThis can be a cache lookup, so it can be more reliable than scraping',
1112
version: '1.0.0',
1213

1314
params: {

apps/sim/tools/brightdata/dataset_amazon_product_search.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type { ToolConfig } from '@/tools/types'
77
export const datasetAmazonProductSearchTool: ToolConfig<DatasetParams, DatasetResponse> = {
88
id: 'brightdata_dataset_amazon_product_search',
99
name: 'Bright Data Amazon Product Search Dataset',
10-
description: "Quickly read structured amazon product search data.\nRequires a valid search keyword and amazon domain URL.\nThis can be a cache lookup, so it can be more reliable than scraping",
10+
description:
11+
'Quickly read structured amazon product search data.\nRequires a valid search keyword and amazon domain URL.\nThis can be a cache lookup, so it can be more reliable than scraping',
1112
version: '1.0.0',
1213

1314
params: {

apps/sim/tools/brightdata/dataset_apple_app_store.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type { ToolConfig } from '@/tools/types'
77
export const datasetAppleAppStoreTool: ToolConfig<DatasetParams, DatasetResponse> = {
88
id: 'brightdata_dataset_apple_app_store',
99
name: 'Bright Data Apple App Store Dataset',
10-
description: "Quickly read structured apple app store data.\nRequires a valid apple app store app URL.\nThis can be a cache lookup, so it can be more reliable than scraping",
10+
description:
11+
'Quickly read structured apple app store data.\nRequires a valid apple app store app URL.\nThis can be a cache lookup, so it can be more reliable than scraping',
1112
version: '1.0.0',
1213

1314
params: {

apps/sim/tools/brightdata/dataset_bestbuy_products.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type { ToolConfig } from '@/tools/types'
77
export const datasetBestbuyProductsTool: ToolConfig<DatasetParams, DatasetResponse> = {
88
id: 'brightdata_dataset_bestbuy_products',
99
name: 'Bright Data Bestbuy Products Dataset',
10-
description: "Quickly read structured bestbuy product data.\nRequires a valid bestbuy product URL.\nThis can be a cache lookup, so it can be more reliable than scraping",
10+
description:
11+
'Quickly read structured bestbuy product data.\nRequires a valid bestbuy product URL.\nThis can be a cache lookup, so it can be more reliable than scraping',
1112
version: '1.0.0',
1213

1314
params: {

apps/sim/tools/brightdata/dataset_booking_hotel_listings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import type { ToolConfig } from '@/tools/types'
77
export const datasetBookingHotelListingsTool: ToolConfig<DatasetParams, DatasetResponse> = {
88
id: 'brightdata_dataset_booking_hotel_listings',
99
name: 'Bright Data Booking Hotel Listings Dataset',
10-
description: "Quickly read structured booking hotel listings data.\nRequires a valid booking hotel listing URL.\nThis can be a cache lookup, so it can be more reliable than scraping",
10+
description:
11+
'Quickly read structured booking hotel listings data.\nRequires a valid booking hotel listing URL.\nThis can be a cache lookup, so it can be more reliable than scraping',
1112
version: '1.0.0',
1213

1314
params: {

0 commit comments

Comments
 (0)