- Add tsconfig.json for TypeScript compilation with declaration and source map generation - Generate .d.ts declaration files for all modules, services, controllers, and models - Update package.json with NestJS dependencies and TypeScript development tools - Include database files in the distribution output for persistence
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
import { ConfigService } from '@nestjs/config';
|
|
import { FoodItem } from '../models/food-item.model';
|
|
import { APICache } from '../models/api-cache.model';
|
|
export declare class NutritionService {
|
|
private configService;
|
|
private foodItemModel;
|
|
private apiCacheModel;
|
|
private apiKey;
|
|
private baseUrl;
|
|
private headers;
|
|
private cacheDurationDays;
|
|
constructor(configService: ConfigService, foodItemModel: typeof FoodItem, apiCacheModel: typeof APICache);
|
|
searchFood(query: string): Promise<{
|
|
name: any;
|
|
calories: any;
|
|
protein_g: any;
|
|
carbs_g: any;
|
|
fat_g: any;
|
|
fiber_g: any;
|
|
sugar_g: any;
|
|
sodium_mg: any;
|
|
serving_size_g: any;
|
|
source: string;
|
|
}[]>;
|
|
_getFromCache(query: string): Promise<{
|
|
name: any;
|
|
calories: any;
|
|
protein_g: any;
|
|
carbs_g: any;
|
|
fat_g: any;
|
|
fiber_g: any;
|
|
sugar_g: any;
|
|
sodium_mg: any;
|
|
serving_size_g: any;
|
|
source: string;
|
|
}[]>;
|
|
_saveToCache(query: string, source: string, data: any): Promise<void>;
|
|
_parseApiResponse(data: any[]): {
|
|
name: any;
|
|
calories: any;
|
|
protein_g: any;
|
|
carbs_g: any;
|
|
fat_g: any;
|
|
fiber_g: any;
|
|
sugar_g: any;
|
|
sodium_mg: any;
|
|
serving_size_g: any;
|
|
source: string;
|
|
}[];
|
|
saveFoodToDb(foodData: any): Promise<FoodItem>;
|
|
searchAllSources(query: string): Promise<any[]>;
|
|
}
|