omnipartners
Version:
Node.js wrapper for Omniparners API.
359 lines (358 loc) • 9.19 kB
TypeScript
import Api from "../../lib/Api";
interface IBaseInput {
lang?: string;
}
interface IBasePaginatedResult<T> {
data: T[];
page: number;
records_per_page: number;
total_record_count: string;
total_pages: number;
}
export interface IMetadataLegalForm {
code: string;
name: string;
description?: string | null;
forget_on_revoke: boolean;
url?: string | null;
subscriptions?: string[] | null;
}
export interface IMetadataCounty {
id: string;
name: string;
country: string;
order: string;
}
export interface IMetadataAddressType {
code: string;
name: string;
}
export interface IMetadataMemberCountry {
code: string;
name: string;
order?: string;
has_post_code: string;
mobile_validation_rule: string | null;
phone_prefix: string;
region: string | null;
registration_age_limit: string | null;
}
export interface IMetadataCommunicationPreference {
code: string;
name: string;
}
export interface IMetadataInterest {
code: string;
name: string;
}
export interface IMetadataUserTitle {
code: string;
name: string;
gender: string;
}
export interface IMetadataMemberLanguage {
code: string;
name?: string;
}
export interface IMetadataSubscription {
code: string;
name: string;
type: string;
consent_text?: string;
}
export interface IMetadataPlaceOfPurchase {
code: string;
name: string;
}
export interface IMetadataCustomerGroup {
code: string;
name: string;
description: string;
}
export interface IMetadataAnimalType {
code: string;
name?: string;
}
export interface IMetadataAnimalBreed {
id: string;
name: string;
species: string;
order: string;
com_id: string;
universe: string;
alt_name: string | null;
synonyms: string | null;
adult_weight_min: string;
adult_weight_max: string;
has_dedicated_product: string;
other_ids: string | null;
other: string;
is_high_energy: string;
is_low_energy: string;
has_image: boolean;
}
export interface IMetadataAnimalLifestyle {
code: string;
name: string;
species: string;
}
export interface IMetadataAgendaCategory {
code: string;
name: string;
}
export interface IMetadataAnimalUniverse {
id: string;
name: string;
species: string;
default_breed_id: string | null;
default_breed_com_id: string | null;
has_image: boolean;
stages: IMetadataAnimalUniverseStage[];
}
interface IMetadataAnimalUniverseStage {
stage_name: string;
stage_code: string;
stage_order: string;
stage_feeding_stage: string;
universe_id: string;
stage_from: string;
stage_from_unit: string;
stage_to: string;
stage_to_unit: string;
species_code: string;
breed_id: string | null;
}
export interface IMetadataAnimalPathology {
code: string;
name: string;
species: string | null;
has_dedicated_product: string;
}
export interface IMetadataAnimalStage {
species: string;
universe_id: string;
breed_id: string | null;
stage_code: string;
stage_name: string;
stage_to: string;
stage_to_unit: string;
stage_from: string;
stage_from_unit: string;
stage_order: string;
feeding_stage: string;
}
export interface IMetadataAnimalSpecialNeeds {
reference: string;
generic_name: string;
name: string;
pathologies: string[];
}
export interface IMetadataDiagnosticCode {
diagnostic_code: string;
generic_name: string;
name: string;
}
export interface IMetadataPartnerType {
code: string;
name: string;
member_cardinality: string;
}
export interface IMetadataProductRange {
reference: string;
generic_name: string;
priority: string;
name: string;
tag_line: string | null;
description: string | null;
public_visibility: string;
partner_visibility: boolean;
incl_partner_groups: any[];
excl_partner_groups: any[];
incl_places_purchase: any[];
excl_places_purchase: any[];
incl_partner_types: any[];
excl_partner_types: any[];
}
export interface IMetadataProductBrand {
id: string;
name: string;
}
export interface IMetadataCollectionRelationType {
reference: string;
name: string;
}
export interface IMetadataLoyaltyProgramType {
id: string;
name: string;
show_in_website: "Y" | "N";
}
export interface IMetadataLoyaltyProgram {
id: string;
name: string;
type: string;
thirdParty: "Y" | "N";
}
export interface IMetadataPartnerRelationType {
code: string;
name: string;
}
interface IBaseMetadataType {
code: string;
name: string;
}
export default class Metadata extends Api {
defaultHost: string;
_call(action: string, data?: {}): Promise<any>;
getLegalForms(data?: {
legal_form_codes?: string;
lang?: string;
indexed?: string;
}): Promise<{
data: IMetadataLegalForm[];
}>;
getCounties(data?: {
country: string;
lang: string;
indexed: string;
}): Promise<{
data: IMetadataCounty[];
}>;
getAddressTypes(data?: IBaseInput): Promise<{
data: IMetadataAddressType[];
}>;
getMemberCountries(data?: IBaseInput): Promise<{
data: IMetadataMemberCountry[];
}>;
getCommunicationPreferences(data?: IBaseInput): Promise<{
data: IMetadataCommunicationPreference[];
}>;
getInterests(data?: IBaseInput): Promise<{
data: IMetadataInterest[];
}>;
getUserTitles(data?: IBaseInput): Promise<{
data: IMetadataUserTitle[];
}>;
getMemberLanguages(data?: IBaseInput): Promise<{
data: IMetadataMemberLanguage[];
}>;
getAccessRights(data?: IBaseInput): Promise<{
data: any;
}>;
getSubscriptions(data?: IBaseInput): Promise<{
data: IMetadataSubscription[];
}>;
getPlaceOfPurchase(data?: IBaseInput): Promise<{
data: IMetadataPlaceOfPurchase[];
}>;
getCustomerGroups(data?: IBaseInput): Promise<{
data: IMetadataCustomerGroup[];
}>;
getAnimalTypes(data?: IBaseInput): Promise<{
data: IMetadataAnimalType[];
}>;
getAnimalBreeds(data?: {
lang?: string;
type?: string;
indexed?: string;
search?: string;
order?: string;
}): Promise<{
data: IMetadataAnimalBreed[];
}>;
getAnimalDeletionCauses(data?: IBaseInput): Promise<{
data: any;
}>;
getAnimalLifestyles(data?: {
type?: string;
lang?: string;
indexed?: string;
}): Promise<{
data: IMetadataAnimalLifestyle[];
}>;
getAgendaCategories(data?: IBaseInput): Promise<{
data: IMetadataAgendaCategory[];
}>;
getAnimalUniverse(data?: IBaseInput): Promise<{
data: IMetadataAnimalUniverse[];
}>;
getAnimalPathologies(data?: IBaseInput): Promise<{
data: IMetadataAnimalPathology[];
}>;
getAnimalStages(data?: IBaseInput): Promise<{
data: IMetadataAnimalStage[];
}>;
getAnimalSpecialNeeds(data?: IBaseInput): Promise<{
data: IMetadataAnimalSpecialNeeds[];
}>;
getDiagnosticCodes(data?: {
lang: string;
type: string;
search: string;
page: number;
"record_per-page": number;
}): Promise<IBasePaginatedResult<IMetadataDiagnosticCode>>;
getAnimalBCS(data?: {
lang: string;
species: string;
universe: string;
}): Promise<{
data: any;
}>;
getPartnerTypesList(data?: IBaseInput): Promise<{
data: IMetadataPartnerType[];
}>;
getPartnerTypeRoles(data?: {
indexed?: string;
partner_type?: string;
}): Promise<{
data: {
code: string;
name: string;
default: 'N' | 'Y';
type: string;
relationship: "partof" | "clientof";
}[];
}>;
getProductRanges(data?: IBaseInput): Promise<{
data: IMetadataProductRange[];
}>;
getProductBrands(data?: IBaseInput): Promise<{
data: IMetadataProductBrand[];
}>;
getProductFamilies(data?: IBaseInput): Promise<{
data: any;
}>;
getCollectionRelationTypesList(data?: IBaseInput): Promise<{
data: IMetadataCollectionRelationType[];
}>;
getLoyaltyProgramTypes(data?: IBaseInput): Promise<{
data: IMetadataLoyaltyProgramType[];
}>;
getLoyaltyProgram(data?: IBaseInput): Promise<{
data: IMetadataLoyaltyProgram[];
}>;
getFeaturedAactivities(data?: IBaseInput): Promise<{
data: any;
}>;
getFeaturedServices(data?: IBaseInput): Promise<{
data: {
code: string;
generic_name: string;
name: string;
description: {
EN: string;
FR: string;
NL: string;
};
}[];
}>;
getPartnerRelationTypes(data?: IBaseInput): Promise<{
data: IMetadataPartnerRelationType[];
}>;
getSocialNetworks(data?: {
indexed?: string;
}): Promise<{
data: IBaseMetadataType[];
}>;
}
export {};