ikea-availability-checker
Version:
ikea product in-store availability checker and product search
38 lines (37 loc) • 1.51 kB
TypeScript
import { AxiosInstance, AxiosRequestConfig } from "axios";
import { buCode, countryCode, Store } from "./stores";
import { IngkaAvailabilitiesResponse } from "./ingkaResponse";
export interface ItemStockInfo {
createdAt?: Date;
probability?: PRODUCT_AVAILABILITY;
buCode: string;
productId: string;
stock: number;
store: Store;
restockDate?: Date;
}
export declare enum PRODUCT_AVAILABILITY {
HIGH_IN_STOCK = "HIGH_IN_STOCK",
LOW_IN_STOCK = "LOW_IN_STOCK",
OUT_OF_STOCK = "OUT_OF_STOCK"
}
export declare const BASE_URL_DEFAULT = "https://api.ingka.ikea.com";
export declare class IngkaApi {
client: AxiosInstance;
constructor(clientId?: string, options?: AxiosRequestConfig);
parseAvailabilitiesResponse(responseData: IngkaAvailabilitiesResponse): ItemStockInfo[];
cache: Map<string, Promise<ItemStockInfo[]>>;
getStoreProductAvailability(countryCode: countryCode, productId: string, buCode: buCode): Promise<ItemStockInfo | undefined>;
private handleResponseError;
private validateResponseStructure;
buildAvailabilityUri(countryCode: countryCode, unitType?: string): string;
getAvailabilities(
/** a single supported country code */
countryCode: countryCode,
/** one or multiple ikea article ids */
itemNos: string[] | string,
/** value of expand parameter */
expand?: string[],
/** optional additional request configuration settings */
options?: AxiosRequestConfig): Promise<ItemStockInfo[]>;
}