import { CheckoutOperations } from './checkout.mjs'; import { CollectionOperations } from './collections.mjs'; import { ProductOperations } from './products.mjs'; import { P as ProductClassification, S as SEOContent, C as CountryDetectionResult, a as StoreOperations, b as ShopifyProduct, c as Product, d as ShopifySingleProduct, e as ShopifyCollection, f as Collection, g as StoreInfo, h as StoreTypeBreakdown } from './store-CJVUz2Yb.mjs'; export { H as Address, F as CatalogCategory, I as ContactUrls, K as CountryScore, N as CountryScores, J as Coupon, y as CurrencyCode, G as Demographics, Q as JsonLdEntry, L as LocalizedPricing, M as MetaTag, D as ProductImage, z as ProductOption, x as ProductPricing, B as ProductVariant, A as ProductVariantImage, E as ShopifyApiProduct, u as ShopifyBaseProduct, r as ShopifyBaseVariant, k as ShopifyBasicInfo, o as ShopifyFeaturedMedia, O as ShopifyFeaturesData, m as ShopifyImage, l as ShopifyImageDimensions, p as ShopifyMedia, q as ShopifyOption, w as ShopifyPredictiveProductSearch, v as ShopifyProductAndStore, s as ShopifyProductVariant, t as ShopifySingleProductVariant, j as ShopifyTimestamps, n as ShopifyVariantImage, i as StoreCatalog, R as StoreTypeResult, V as ValidStoreCatalog } from './store-CJVUz2Yb.mjs'; export { configureRateLimit } from './utils/rate-limit.mjs'; /** * Classify product content into a three-tier hierarchy using LLM. * Returns strictly validated JSON with audience, vertical, and optional category/subCategory. */ declare function classifyProduct(productContent: string, options?: { apiKey?: string; model?: string; }): Promise; /** * Generate SEO and marketing content for a product. Returns strictly validated JSON. */ declare function generateSEOContent(product: { title: string; description?: string; vendor?: string; price?: number; tags?: string[]; }, options?: { apiKey?: string; model?: string; }): Promise; /** * Detects the country of a Shopify store by analyzing various signals in the HTML content. * * This function examines multiple data sources within the HTML to determine the store's country: * - Shopify features JSON data (country, locale, money format) * - Phone number prefixes in contact information * - JSON-LD structured data with address information * - Footer mentions of country names * - Currency symbols in money formatting * * @param html - The HTML content of the Shopify store's homepage * @returns Promise resolving to country detection results containing: * - `country` - The detected country ISO 3166-1 alpha-2 code (e.g., "US", "GB") or "Unknown" if no reliable detection * - `confidence` - Confidence score between 0 and 1 (higher = more confident) * - `signals` - Array of detection signals that contributed to the result * * @example * ```typescript * const response = await fetch('https://exampleshop.com'); * const html = await response.text(); * const result = await detectShopifyCountry(html); * * console.log(result.country); // "US" (ISO code for United States) * console.log(result.confidence); // 0.85 * console.log(result.signals); // ["shopify-features.country", "phone prefix +1"] * ``` */ declare function detectShopifyCountry(html: string): Promise; declare function extractDomainWithoutSuffix(domain: string): string | null; declare function generateStoreSlug(domain: string): string; declare const genProductSlug: ({ handle, storeDomain, }: { handle: string; storeDomain: string; }) => string; declare const calculateDiscount: (price: number, compareAtPrice?: number) => number; /** * Normalize and sanitize a domain string. * * Accepts inputs like full URLs, protocol-relative URLs, bare hostnames, * or strings with paths/query/fragment, and returns a normalized domain. * * Examples: * - "https://WWW.Example.com/path" -> "example.com" * - "//sub.example.co.uk" -> "example.co.uk" * - "www.example.com:8080" -> "example.com" * - "example" -> "example" */ declare function sanitizeDomain(input: string, opts?: { stripWWW?: boolean; }): string; /** * Safely parse a date string into a Date object. * * Returns `undefined` when input is falsy or cannot be parsed into a valid date. * Use `|| null` at call sites that expect `null` instead of `undefined`. */ declare function safeParseDate(input?: string | null): Date | undefined; /** * A comprehensive Shopify store client for fetching products, collections, and store information. * * @example * ```typescript * import { ShopClient } from 'shop-search'; * * const shop = new ShopClient('https://exampleshop.com'); * * // Fetch all products * const products = await shop.products.all(); * * // Get store information * const storeInfo = await shop.getInfo(); * ``` */ declare class ShopClient { private storeDomain; private baseUrl; private storeSlug; private validationCache; private cacheExpiry; private cacheTimestamps; private normalizeImageUrlCache; private storeCurrency?; products: ProductOperations; collections: CollectionOperations; checkout: CheckoutOperations; storeOperations: StoreOperations; /** * Creates a new ShopClient instance for interacting with a Shopify store. * * @param urlPath - The Shopify store URL (e.g., 'https://exampleshop.com' or 'exampleshop.com') * * @throws {Error} When the URL is invalid or contains malicious patterns * * @example * ```typescript * // With full URL * const shop = new ShopClient('https://exampleshop.com'); * * // Without protocol (automatically adds https://) * const shop = new ShopClient('exampleshop.com'); * * // Works with any Shopify store domain * const shop1 = new ShopClient('https://example.myshopify.com'); * const shop2 = new ShopClient('https://boutique.fashion'); * ``` */ constructor(urlPath: string); /** * Optimized image URL normalization with caching */ private normalizeImageUrl; /** * Format a price amount (in cents) using the store currency. */ private formatPrice; /** * Transform Shopify products to our Product format */ productsDto(products: ShopifyProduct[]): Product[] | null; productDto(product: ShopifySingleProduct): Product; collectionsDto(collections: ShopifyCollection[]): Collection[]; /** * Enhanced error handling with context */ private handleFetchError; /** * Fetch products with pagination */ private fetchProducts; /** * Fetch collections with pagination */ private fetchCollections; /** * Fetch paginated products from a specific collection */ private fetchPaginatedProductsFromCollection; /** * Validate if a product exists (with caching) */ private validateProductExists; /** * Validate if a collection exists (with caching) */ private validateCollectionExists; /** * Check if cache entry is still valid */ private isCacheValid; /** * Set cache value with timestamp */ private setCacheValue; /** * Validate links in batches to avoid overwhelming the server */ private validateLinksInBatches; /** * Fetches comprehensive store information including metadata, social links, and showcase content. * * @returns {Promise} Store information object containing: * - `name` - Store name from meta tags or domain * - `domain` - Store domain URL * - `slug` - Generated store slug * - `title` - Store title from meta tags * - `description` - Store description from meta tags * - `logoUrl` - Store logo URL from Open Graph or CDN * - `socialLinks` - Object with social media links (facebook, twitter, instagram, etc.) * - `contactLinks` - Object with contact information (tel, email, contactPage) * - `headerLinks` - Array of navigation links from header * - `showcase` - Object with featured products and collections from homepage * - `jsonLdData` - Structured data from JSON-LD scripts * - `techProvider` - Shopify-specific information (walletId, subDomain) * - `country` - Country detection results with ISO 3166-1 alpha-2 codes (e.g., "US", "GB") * * @throws {Error} When the store URL is unreachable or returns an error * * @example * ```typescript * const shop = new ShopClient('https://exampleshop.com'); * const storeInfo = await shop.getInfo(); * * console.log(storeInfo.name); // "Example Store" * console.log(storeInfo.socialLinks.instagram); // "https://instagram.com/example" * console.log(storeInfo.showcase.products); // ["product-handle-1", "product-handle-2"] * console.log(storeInfo.country); // "US" * ``` */ getInfo(): Promise; /** * Determine the store's primary vertical and target audience. * Uses `getInfo()` internally; no input required. */ determineStoreType(options?: { apiKey?: string; model?: string; maxShowcaseProducts?: number; maxShowcaseCollections?: number; }): Promise; } export { CheckoutOperations, Collection, CollectionOperations, CountryDetectionResult, Product, ProductClassification, ProductOperations, SEOContent, ShopClient, ShopifyCollection, ShopifyProduct, ShopifySingleProduct, StoreInfo, StoreOperations, StoreTypeBreakdown, calculateDiscount, classifyProduct, detectShopifyCountry, extractDomainWithoutSuffix, genProductSlug, generateSEOContent, generateStoreSlug, safeParseDate, sanitizeDomain };