feat: initialize asin-check project with Bun
- Add README.md with installation and usage instructions. - Create bun.lock for dependency management. - Add package.json to define project metadata and dependencies. - Implement caching with Redis in cache.ts for ASIN data. - Configure environment variables in config.ts for API keys and Redis URL. - Develop main application logic in index.ts to read products, fetch data, and analyze results. - Integrate Keepa API for product data retrieval in keepa.ts. - Create LLM analysis functionality in llm.ts for product viability assessment. - Implement product reading from Excel files in reader.ts. - Stub SP-API integration in sp-api.ts for future implementation. - Define TypeScript types in types.ts for product and analysis data structures. - Write results to console and CSV in writer.ts. - Configure TypeScript settings in tsconfig.json for project compilation.
This commit is contained in:
59
src/types.ts
Normal file
59
src/types.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
export interface ProductRecord {
|
||||
asin: string;
|
||||
name: string;
|
||||
unitCost: number;
|
||||
brand?: string;
|
||||
category?: string;
|
||||
amazonRank?: number;
|
||||
fbaNet?: number;
|
||||
grossProfit?: number;
|
||||
grossProfitPct?: number;
|
||||
moq?: number;
|
||||
moqCost?: number;
|
||||
totalQtyAvail?: number;
|
||||
|
||||
link?: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface KeepaData {
|
||||
currentPrice: number | null;
|
||||
avgPrice90: number | null;
|
||||
minPrice90: number | null;
|
||||
maxPrice90: number | null;
|
||||
salesRank: number | null;
|
||||
salesRankAvg90: number | null;
|
||||
salesRankDrops30: number | null;
|
||||
salesRankDrops90: number | null;
|
||||
sellerCount: number | null;
|
||||
buyBoxSeller: string | null;
|
||||
buyBoxPrice: number | null;
|
||||
monthlySold: number | null;
|
||||
categoryTree: string[];
|
||||
}
|
||||
|
||||
export interface SpApiData {
|
||||
fbaFee: number;
|
||||
fbmFee: number;
|
||||
referralFeePercent: number;
|
||||
estimatedSalePrice: number;
|
||||
}
|
||||
|
||||
export interface EnrichedProduct {
|
||||
record: ProductRecord;
|
||||
keepa: KeepaData | null;
|
||||
spApi: SpApiData;
|
||||
fetchedAt: string;
|
||||
}
|
||||
|
||||
export interface LlmVerdict {
|
||||
asin: string;
|
||||
verdict: "FBA" | "FBM" | "SKIP";
|
||||
confidence: number;
|
||||
reasoning: string;
|
||||
}
|
||||
|
||||
export interface AnalysisResult {
|
||||
product: EnrichedProduct;
|
||||
verdict: LlmVerdict;
|
||||
}
|
||||
Reference in New Issue
Block a user