Files
cannaiq/backend/src/platforms/dutchie/index.ts
Kelly 91efd1d03d feat(images): Add local image storage with on-demand resizing
- Store product images locally with hierarchy: /images/products/<state>/<store>/<brand>/<product>/
- Add /img/* proxy endpoint for on-demand resizing via Sharp
- Implement per-product image checking to skip existing downloads
- Fix pathToUrl() to correctly generate /images/... URLs
- Add frontend getImageUrl() helper with preset sizes (thumb, medium, large)
- Update all product pages to use optimized image URLs
- Add stealth session support for Dutchie GraphQL crawls
- Include test scripts for crawl and image verification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 11:04:50 -07:00

58 lines
1.1 KiB
TypeScript

/**
* Dutchie Platform Module
*
* Single export point for all Dutchie communication.
* All Dutchie workers MUST import from this module.
*/
export {
// HTTP Client
curlPost,
curlGet,
executeGraphQL,
fetchPage,
extractNextData,
// Headers & Fingerprints
buildHeaders,
getFingerprint,
rotateFingerprint,
resetFingerprint,
getRandomFingerprint,
getLocaleForTimezone,
// Session Management (per-store fingerprint rotation)
startSession,
endSession,
getCurrentSession,
// Proxy
setProxy,
getProxy,
setCrawlRotator,
getCrawlRotator,
// Configuration
DUTCHIE_CONFIG,
GRAPHQL_HASHES,
// Types
type CurlResponse,
type Fingerprint,
type CrawlSession,
type ExecuteGraphQLOptions,
type FetchPageOptions,
} from './client';
// Re-export CrawlRotator types from canonical location
export type { CrawlRotator, Proxy, ProxyStats } from '../../services/crawl-rotator';
// GraphQL Queries
export {
resolveDispensaryId,
resolveDispensaryIdWithDetails,
getDispensaryInfo,
type ResolveDispensaryResult,
type DispensaryInfo,
} from './queries';