verdantly
Version:
Node.js client for accessing plant species and variety data from the Verdantly API
164 lines (160 loc) • 4.85 kB
TypeScript
interface PlantVarietySearchResponse {
totalCount: number;
data: PlantVariety[];
meta: {
page: number;
perPage: number;
pages: number;
};
}
interface PlantVariety {
id: string;
mappingId: string;
category: string;
name: string;
type: string;
subtype: string;
description: string;
growingRequirements: GrowingRequirements;
growthDetails: GrowthDetails;
lifecycleMilestones: LifecycleMilestones;
careInstructions: CareInstructions;
commonUses: string;
pestAndDiseaseRisks: string;
highlights: string;
history: string;
}
interface GrowingRequirements {
minGrowingZone: number;
maxGrowingZone: number;
growingZoneRange: string;
careInstructions: string;
soilPreference: string;
sunlightRequirement: string;
waterRequirement: string;
preferredTemperature: string;
spacingRequirement: string;
}
interface GrowthDetails {
growthPeriod: string;
growthType: string;
matureHeight: number;
matureWidth: number;
}
interface LifecycleMilestones {
avgFirstBloomDate: string;
firstHarvestDate: string | null;
lastHarvestDate: string | null;
}
interface CareInstructions {
plantingInstructions: {
startIndoors: string;
transplantOutdoors: string;
directSow: string;
};
pruningInstructions: string;
harvestingInstructions: string | null;
}
interface PlantVarietyFilter {
category?: string;
type?: string;
subtype?: string;
growingZone?: number;
sunlightRequirement?: string;
soilPreference?: string;
growthPeriod?: string;
growthType?: string;
pestAndDiseaseRisks?: string;
minHeight?: number;
maxHeight?: number;
commonUses?: string;
preferredTemperature?: string;
waterRequirement?: string;
highlights?: string;
}
interface PlantSpeciesSearchResponse {
totalCount: number;
data: PlantSpecies[];
meta: {
page: number;
perPage: number;
pages: number;
};
}
interface PlantSpecies {
id: string;
symbol: string;
acceptedSymbol: string;
synonymSymbol: string | null;
commonName: string;
scientificName: string;
hybridGenusIndicator: string | null;
hybridSpeciesIndicator: string | null;
species: string | null;
subspeciesPrefix: string | null;
hybridSubspeciesIndicator: string | null;
subspecies: string | null;
varietyPrefix: string | null;
hybridVarietyIndicator: string | null;
variety: string | null;
subvarietyPrefix: string | null;
subvariety: string | null;
formaPrefix: string | null;
forma: string | null;
generaBinomialAuthor: string | null;
trinomialAuthor: string | null;
quadranomialAuthor: string | null;
questionableTaxonIndicator: string | null;
parents: string | null;
stateAndProvince: string | null;
category: string;
family: string;
familySymbol: string;
familyCommonName: string;
order: string;
subclass: string;
class: string;
subdivision: string | null;
division: string;
superdivision: string;
subkingdom: string;
kingdom: string;
duration: string | null;
growthHabit: string | null;
nativeStatus: string | null;
federalNoxiousStatus: string | null;
stateNoxiousStatus: string | null;
stateNoxiousCommonName: string | null;
invasive: string | null;
federalTeStatus: string | null;
stateTeStatus: string | null;
stateTeCommonName: string | null;
activeGrowthPeriod: string | null;
}
interface PlantSpeciesFilter {
symbol?: string;
acceptedSymbol?: string;
commonName?: string;
scientificName?: string;
family?: string;
category?: string;
order?: string;
}
interface VerdantlyClientConfig {
apiKey: string;
baseUrl?: string;
}
declare class VerdantlyClient {
private apiKey;
private baseUrl;
constructor(config: VerdantlyClientConfig);
getPlantVarietyCategories(): Promise<string[]>;
getTypesByCategory(category: string): Promise<string[]>;
getSubtypesByType(type: string): Promise<string[]>;
searchPlantVarietiesByName(query: string, page?: number): Promise<PlantVarietySearchResponse>;
searchPlantVarietiesByFilter(filters: PlantVarietyFilter, page?: number): Promise<PlantVarietySearchResponse>;
searchPlantSpeciesByName(query: string, page?: number): Promise<PlantSpeciesSearchResponse>;
searchPlantSpeciesByFilter(filters: PlantSpeciesFilter, page?: number): Promise<PlantSpeciesSearchResponse>;
private apiRequest;
}
export { CareInstructions, GrowingRequirements, GrowthDetails, LifecycleMilestones, PlantSpecies, PlantSpeciesFilter, PlantSpeciesSearchResponse, PlantVariety, PlantVarietyFilter, PlantVarietySearchResponse, VerdantlyClient, VerdantlyClientConfig };