UNPKG

omnipartners

Version:
965 lines (964 loc) 28.5 kB
/// <reference types="node" /> import { Readable } from "stream"; import { IDealProduct } from "./deal-types"; declare type IUserDataOption = "owner_details" | "pet_details" | "pet_breed_details" | "pet_medical_condition_details" | "preferences" | "related_partners" | "related_partners_details" | "segments" | "stamp_counts" | "loyalty_cards" | "access_rights" | "children" | "pet_eco_systems" | "user_tags" | "-owner_details" | "-pet_details" | "-preferences" | "-loyalty_cards" | "-access_rights"; export declare type IUserDataOptions = IUserDataOption[] | IUserDataOption; declare type IUserPetDataOption = "basic_details" | "extended_details" | "breed_details" | "pet_medical_condition_details" | "special_needs" | "stage" | "medical_conditions" | "pet_eco_systems" | "user_tags"; export declare type IUserPetDataOptions = IUserPetDataOption[] | IUserPetDataOption; declare type IPartnerDataOption = "partner_details" | "links" | "activities" | "services" | "extended_profile" | "primary_contact_details" | "cis_account_guid" | "open_close_hours" | "logo_images" | "groups" | "location" | "translations" | "partner_breed_relations"; export declare type IPartnerDataOptions = IPartnerDataOption[] | IPartnerDataOption; declare type IProductDataOption = "collection_details" | "images" | "key_benefits" | "related_collections" | "targeting" | "range" | "family" | "collection_description" | "benefits" | "pathologies" | "links" | "products" | "collection_components" | "available_packages" | "product_groups" | "targeting_constraints"; export declare type IProductDataOptions = IProductDataOption[] | IProductDataOption; declare type ICollectionDataOption = "collection_details" | "images" | "key_benefits" | "related_collections" | "targeting" | "range" | "family" | "collection_description" | "benefits" | "pathologies" | "links" | "products" | "collection_components" | "available_packages" | "product_groups" | "targeting_constraints"; export declare type ICollectionDataOptions = ICollectionDataOption[] | ICollectionDataOption; declare type IArticlesDataOption = "content" | "targeting" | "targeting_constraints"; export declare type IArticlesDataOptions = IArticlesDataOption[] | IArticlesDataOption; export interface IUserPartial { statusCode: 0; user_guid: string; user_email: string; user_mobile_phone: string; user_language: string; user_status: string; data: { user_guid: string; user_ext_id: string | null; user_first_name: string; user_last_name: string; user_email: string; user_mobile_phone: string; user_country: string | null; user_language: string; user_status: string; user_confirmed: string; user_created_on: string; user_updated_on: string; user_has_password: 1; user_email_status: string; }; } export interface IUserPartnerRelation { ptn_ext_customer_id: string; ptn_type: string; partner_ext_id: string; partner_type: string; updated_on: string; partner_relationship_roles: string[]; partner_relationship_status: string; partner_relationship_is_explicit: string; partner_relationship_deleted: string; partner_relationship_implicit_on: null; partner_relationship_explicit_on: null; partner_relationship_deleted_on: null; partner_relationship_added_on: string; } export interface IUserPartnerRelationFromGet { ptn_id: string; ptn_guid: string | null; ptn_created: string; ptn_updated: string; ptn_status: string; ptn_admin_id?: string | null; ptn_ext_customer_id: string; ptn_inv_name?: string; ptn_inv_street1?: string; ptn_inv_street2?: string; ptn_inv_streetnum?: string; ptn_inv_postal_code?: string; ptn_inv_city?: string; ptn_inv_region?: string; ptn_inv_country?: string; ptn_pub_name?: string; ptn_pub_street1?: string; ptn_pub_street2?: string; ptn_pub_streetnum?: string; ptn_pub_postal_code?: string; ptn_pub_city?: string; ptn_pub_region?: string; ptn_pub_country?: string; ptn_email?: string; ptn_emergency?: string; ptn_phone?: string; ptn_fax?: string; ptn_website?: string; ptn_facebook?: string; ptn_twitter?: string; ptn_vat?: string; ptn_type: string; ptn_subtype?: string; ptn_prim_cnt_guid?: string; ptn_prim_cnt_title?: string; ptn_prim_cnt_first_name?: string; ptn_prim_cnt_last_name?: string; ptn_prim_cnt_email?: string; ptn_prim_cnt_mobile?: string; ptn_prim_cnt_language?: string; ptn_stamp_image?: string | null; ptn_stamp_image_updated_on?: string | null; ptn_stamp_card_image?: string | null; ptn_stamp_card_image_updated_on?: string | null; ptn_default_user_guid?: string | null; ptn_stamp_unlock_count?: string | null; ptn_salesrep?: string; ptn_sales_support?: string; ptn_location_lookup?: string; ptn_short_description?: string; ptn_eshop_url?: string; ptn_has_logo?: string; ptn_logo_image_type?: string | null; ptn_logo_updated_on?: string | null; ptn_opening_hours?: string | null; ptn_closing_periods?: string | null; ptn_parent_id?: string | null; ptn_show_saving_deals?: string; ptn_is_hidden?: string; ptn_timezone?: string; ptn_self_id?: string; ptn_self_prefix?: string; ptn_deals_redirection_url?: string | null; ptn_referral_code?: string | null; ptn_snap?: string; ptn_instagram?: string; ptn_pinterest?: string; ptn_linkedin?: string; ptn_googleplus?: string; ptn_viadeo?: string; ptn_whatsapp?: string; ptn_youtube?: string; ptn_ext_id: string; ptn_groups?: string[]; partner_lat?: string | null; partner_lng?: string | null; ptn_logo?: string | null; ptn_logo_small?: string | null; ptn_logo_medium?: string | null; ptn_logo_large?: string | null; links?: []; partner_short_description_generic?: string; ptn_user_guid?: string; partner_relationship_roles?: string[]; partner_relationship_status?: string; updated_on?: string; partner_relationship_is_explicit?: string; partner_relationship_deleted?: string; partner_relationship_implicit_on?: string | null; partner_relationship_explicit_on?: string; partner_relationship_deleted_on?: string | null; partner_relationship_added_on?: string; } interface IUserCard { card_id: string; program_id: string; personal_reference: string; activated_partner: null; expiration_month: null; expiration_year: null; added_on: string; } export interface IUserPetMedicalCondition { code: string; name: string; name_FR?: string; } export interface IUserPetSpecialNeed { code: string; name: string; } export interface IUserPet { guid: string; id: string; _id: string; pet_guid: string; pet_ext_id: null; name: string; birthDate: string; pet_dob: string; pet_dob_approx: string; breed?: string; petType: string; pedigreeName: string; dateCreated: string; lastUpdated: string; gender: string; neutered: boolean; pet_neutering_date: null; pet_neutered: string; owner: null; pet_owner_since: null; tattooId: null; chipNumber: null; pet_lifestyle: string | null; pet_brand: null; pet_declarative_product?: string; pet_ideal_product: null; vaccinationDate: null; type: string; profile_completion: string; has_picture: "0" | "1"; status: string; pet_status: string; insured: string; pet_referrer: null; pet_origin: null; kcNumber: string; breedDetails: IUserPetBreedDetail; pet_stage?: string; pet_feeding_stage?: string; medicalConditions: IUserPetMedicalCondition[]; pet_special_needs?: IUserPetSpecialNeed[]; } export interface IUserPetBreedDetail { id: string; name: string; type: string; pet_breed_com_id: string; com_id: string; universe_id: string; name_fr: string; } export interface IUsetPetWithOwner extends IUserPet { pet_owner: IUserOwner; } export interface IUserPetCreateInput { user_guid: string; pet_name: string; pet_type: string; pet_breed?: string; pet_breed_com_id?: string; pet_pedigreename?: string; pet_dob: string; pet_dob_approx?: number; pet_neutered?: "Y" | "N"; pet_neutering_date?: string; pet_gender?: string; vaccination_date?: string; pet_insured?: string; pet_medical_condition?: string; pet_lifestyle?: string; pet_brand?: string; pet_declarative_product?: string; tattoo_number?: string; chip_number?: string; pet_picture?: string | Readable | { value: Buffer; options: { filename: string; }; }; kc_number?: string; pet_ext_id?: string; } export interface IUserPetDeleteInput { pet_guid: string; pet_deletion_cause?: string; } export interface IUserPetUpdateInput { pet_guid: string; pet_name?: string; pet_type?: string; pet_breed?: string; pet_pedigreename?: string; pet_breed_com_id?: string; pet_dob?: string; pet_dob_approx?: string; pet_gender?: string; pet_neutered?: "Y" | "N"; pet_neutering_date?: string; vaccination_date?: string; pet_insured?: string; pet_medical_condition?: string; pet_special_needs?: string; pet_lifestyle?: string; pet_brand?: string; pet_declarative_product?: string; tattoo_number?: string; chip_number?: string; kc_number?: string; pet_picture?: string | Readable | { value: Buffer; options: { filename: string; }; }; pet_ext_id?: string; } export interface IUserPetPlaceOfPurchaseUpdateInput { pet_guid: string; place_id: string; place_rating: string; replace_existing_preferences?: string; } export interface IUserPetPlaceOfPurchase { place_id: string; place_rating: string; place_rated_on?: string; } export interface IUserPetPlaceOfPurchaseDeleteInput { pet_guid: string; place_id: string; } export interface IUserPetWeightEntryAddInput extends IUserPetWeightEntry { pet_guid: string; } export interface IUserPetWeightEntry { date: string; weight: number; partner_ext_id?: string; source: string; ideal_weight?: string; } export interface IUserPetBmiEntryAddInput extends IUserPetBmiEntry { pet_guid: string; } export interface IUserPetBmiEntry { date: string; bmi: number; partner_ext_id?: string; source: string; } export interface IUserPetDietRecommendationAddInput extends IUserPetDietRecommendationEntry { pet_guid: string; custom_logger_info?: string; } export interface IUserPetDietRecommendationDeleteInput extends Partial<Pick<IUserPetDietRecommendationEntry, "collection_reference" | "creation_date" | "partner_ext_id">> { pet_guid: string; custom_logger_info?: string; } export interface IUserPetDietRecommendationEntry { creation_date: string; collection_reference: string; expiration_date?: string; partner_ext_id?: string; ration?: string; ration_unit?: string; } export interface IUserChild { child_birthday: string; child_added_on: string; child_updated_on: string; child_gender: string; child_guid: string; child_first_name: string; child_parent: string; child_status: string; child_ext_id: string; child_multiples?: string[] | null; } export interface IUserChildCreateInput { user_guid: string; child_first_name: string; child_birthday: string; child_gender: string; child_ext_id?: string; multiples?: 1 | 0; } export interface IUserChildUpdateInput extends Omit<Partial<IUserChildCreateInput>, "user_guid"> { child_guid: string; } export interface IUserOwner { id: string; _id: string; guid: string; user_guid: string; user_ext_id: null; user_public_token: string; user_facebook_id: null; user_force_password_reset: 1; user_blacklisted: 0; user_customer_group: string | null; user_origin: string; user_origin_details: null; user_creation_origin: null; user_creation_origin_details: null; country: string; country_name: string; dateCreated: string; lastUpdated: string; user_activated_on: null; email: string; user_email: string; username: string; firstName: string; lastName: string; gender: string; language: string; telephone: string; mobilePhone: string; user_mobile_phone: string; passwordHash: string; status: string; user_status: string; user_confirmed: string; title: string; number: string; street1: string; street2: null; city: string; zip: string; longitude: null; latitude: null; user_national_id: null; user_email_status: string; type: string[]; businessName: string; dob: string; countyId: null; website: string; profile_completion: string; user_has_profile_logo: 1; profile_logo: string; profile_logo_small: string; profile_logo_medium: string; profile_logo_large: string; default_address: null; } export interface IUserSegment { id: number; handle: string; } export interface IUserFavourites { content_id: string; date: string; type: string; content: string; source: string; } export interface IUserFavouritesAddInput extends Omit<IUserFavourites, "content_id"> { user_guid: string; } export interface IUserFavouritesDeleteInput { content_id: string; user_guid: string; } export interface IUser { feedback: { unauthorized_data_options: []; }; accessToken: string; session_token: string; owner: IUserOwner; pets: IUserPet[]; communicationPreferences: []; interests: []; subscriptions: string[]; user_access_rights: []; cards: IUserCard[]; partners: { clientof: IUserPartnerRelation[]; partof: IUserPartnerRelation[]; }; segments: IUserSegment[]; stamps_count: number | null; user_tags: string[]; } export interface IUserUpdateInput extends IBaseUserInput { user_guid: string; user_context?: string; } interface IBaseUserInput { user_title?: string; user_first_name?: string; user_last_name?: string; user_dob?: string; user_gender?: string; user_streetnum?: string; user_street1?: string; user_street2?: string; user_postal_code?: string; user_city?: string; user_county?: string; user_country?: string; user_telephone?: string; user_mobile_phone?: string; user_website?: string; user_email?: string; user_username?: string; user_password?: string; user_language?: string; user_ext_id?: string; user_national_id?: string; user_facebook_id?: string; } export interface IRegisterUserInput extends IBaseUserInput { user_lat?: string; user_lng?: string; user_confirmed?: string; password_mode?: "link" | "password" | "remoteform"; noPets?: string | 1 | 0; pet_name?: string; pet_type?: string; pet_breed?: string; pet_breed_com_id?: string; pet_pedigreename?: string; pet_dob?: string; pet_dob_approx?: string; pet_gender?: string; pet_neutered?: string; vaccination_date?: string; pet_insured?: string; pet_medical_condition?: string; tattoo_number?: string; chip_number?: string; kc_number?: string; pet_ext_id?: string; com_prefs?: string; interests?: string; subscriptions?: string; user_access_rights?: string; send_welcome_mail?: string | 1 | 0; send_notification?: "email" | "sms"; user_origin_details?: string; data_options?: IUserDataOptions; force_update?: 1 | 0; user_context?: string; } export interface IUserAddress { address_id: number; address_name: string; address_company: string | null; address_phone: string | null; address_region: string | null; address_streetnum: string; address_street1: string; address_street2: string | null; address_postal_code: string; address_city: string; address_county: string | null; address_country: string; address_type: string; address_is_default: boolean; address_comment: string | null; address_latitude: number; address_longitude: number; user_streetnum: string; user_street1: string; user_street2: string | null; user_postal_code: string; user_city: string; user_county: string | null; is_default: boolean; } interface IBaseUserAddressInput { user_guid: string; address_type?: string; address_name?: string; address_company?: string; address_phone?: string; address_streetnum?: string; address_street1?: string; address_street2?: string; address_postal_code: string; address_city: string; address_region?: string; address_county?: string; address_country?: string; address_comment?: string; address_is_default?: string; address_lat?: string; address_lng?: string; } export declare type IRegisterUserAddressInput = IBaseUserAddressInput; export interface IUpdateUserAddressInput extends IBaseUserAddressInput { address_id: string; } export interface ICountry { id: string; name: string; mobile_validation_rule: string | null; phone_prefix: string; has_post_code: string; region: string | null; } export interface IUserPreferences { communicationPreferences: string[]; interests: string[]; subscriptions: string[]; } export interface IUserLegalFormsItems { legal_form_code: string; confirmed_date: string; confirmed_place: string; confirmed_document_link: string; } export interface IUserConfirmLegalFormsInput { legal_form_code: string; user_guid: string; confirmed_place: string; send_notification?: string; signature?: string; } export interface IUserUpdateSubscriptionsInput { user_guid: string; com_prefs?: string; interests?: string; subscriptions?: string | string[]; replace?: 1 | 0; } export interface IUserPlaceOfPurchase { place_id: string; place_rating: string; } export interface IUserUpdatePlacesOfPurchaseInput { user_guid: string; place_id: string; place_rating: string; } export interface IDealListItem { id: number; ref: string; name: string; type: string; available_from?: string | null; available_to?: string | null; is_locked: boolean; subscription_count: { REDEEMED: number; SUBSCRIBED: number; IN_PROGRESS: number; }; pet_type?: string | null; pet_breed?: string[] | null; deal_groups?: { group_name: string; group_handle: string; }[] | null; } export interface IDeal extends IDealListItem { redeem_days: string[]; partner_visibility: string; restrict_registration: boolean; image_url?: string | null; postal_address_required: boolean; delivery_address_required: "1" | "0" | null; optin_options: { id: string; visible: "1" | "0"; default_value: string; can_change: "1" | "0"; }[]; display_on_terminal: 1 | 0; redeem_duration_value: number; redeem_duration_unit: string; is_relative_redeem_dates: boolean; google_tracking_id?: string | null; status: string; referrer_required: 1 | 0; child_required: "1" | "0"; child_gnder: string; child_age_limit_value: string; child_age_limit_unit: string; child_age_limit_operator: string; child_age_limit_to_value: string; child_age_limit_to_unit: string; pet_required: "1" | "0"; /** * @deprecated Use `pet_universe_included` instead */ pet_universe?: string | null; pet_universe_included?: string | null; pet_universe_excluded?: string | null; pet_breeds_included?: number[] | null; pet_breeds_excluded?: number[] | null; pet_age_limit_value?: string | null; pet_age_limit_unit?: "DAY" | "WEEK" | "MONTH" | "YEAR" | null; pet_age_limit_operator?: "LOWER" | "EQUAL" | "HIGHER" | "BTW" | ""; pet_age_limit_to_value?: string | null; pet_age_limit_to_unit?: "DAY" | "WEEK" | "MONTH" | "YEAR" | null; send_voucher_email: boolean; send_voucher_sms: boolean; need_to_scan: 0 | 1; redeem_validity_from?: string | null; redeem_validity_to?: string | null; validity_message: string; confirmation_text: string; description: string; benefit_type: "FIXED_PRODUCT" | "FIXED_TIER" | "PERCENTAGE_PRODUCT" | "PERCENTAGE_TIER"; slogan: string; public_name: string; site_footer: string; voucher_small_print: string; redemption_confirmation_text: string; redirect_url?: string | null; langs: string[]; logo_url?: string | null; css_file_url?: string | null; internal_barcode?: string | null; presentation_images: { small: { NL?: string | null; FR?: string | null; }; large: { NL?: string | null; FR?: string | null; }; }; saving_end_time_value?: string | null; saving_end_time_unit?: string | null; saving_end_date?: string | null; pet_stages_included?: string[] | null; pet_stages_excluded?: string[] | null; pet_type_included: string | null; pet_type_excluded: string | null; allowed_partner_groups: string[]; excluded_partner_groups: string[]; subscription_partner_required: number; subscription_referral_partner_required: number; referral_partner_as_subscription_partner: number; redemption_partner_required: number; redemption_referral_partner_required: number; can_redeem_without_subscription: number; can_redeem_anonymously: number; products: IDealProduct[]; limitations: { max_payments_per_iban: string; max_subscription_per_delivery_address: string; max_subscription_limit: number; remaining_subscription_count: number; }; type_details: { discount_type: string; amounts: { EUR?: number; }; }; benefits: { id: string; product?: { ean: string; id: string | string[]; label: string; friendly_name: string; }; value: string; currency: string; communications?: { tier_purchase_label?: { [k: string]: string; }; tier_purchase_proof_label?: { [k: string]: string; }; validity_text?: { [k: string]: string; }; }; }[]; } export interface IUserEligibleDirectCashbackDeal { id: string; ref: string; name: string; available_from: string; available_to: string; } export interface IUserDirectCashbackDealEligiblePet { pet_guid: string; pet_name: string; } export interface IDirectCashbackDealDetail { id: string; ref: string; name: string; redeem_duration_value: number; redeem_duration_unit: string; is_relative_redeem_dates: boolean; status: string; pet_required: "1" | "0"; pet_type_included: string; pet_universe_included: string; pet_type_excluded: number[]; pet_universe_excluded: number[]; pet_breeds_included: number[]; pet_breeds_excluded: number[]; available_from: string; available_to: string; redeem_validity_from: string; redeem_validity_to: string; confirmation_text: string; redemption_confirmation_text: string; site_footer: string; presentation_images: { small: { NL: string | null; FR: string | null; }; large: { NL: string | null; FR: string | null; }; }; slogan: string; public_name: string; langs: string[]; benefits: { id: string; products?: { id: number; }[]; product?: { ean: string; id: string | string[] | number | number[]; label: string; friendly_name: string; }; value: string; currency: string; }[]; } export interface IDirectCashbackVoucherDetail { id: string; user_guid: string; barcode: string; status: string; pet_guid: string; ts_redeemed: string; active_redemption_request_status: string; ts_subscribed: string; benefit: IDirectCashbackVoucherBenefit; redeem_validity_from: string; redeem_validity_to: string; deal: IDirectCashbackDealDetail; } export interface IDirectCashbackRedemptionRequestInput { barcode: string; benefit_id?: string; receipt_date: string; receipt_image_mime_type: string; target_currency: "EUR" | "GBP"; payment_details: { iban?: string; sort_code?: string; account_number?: string; }; partner_ext_id?: string; benefit_product_ean?: string; benefit_product_purchase_value?: string; tier_purchase_receipt_image_mime_type?: string; } export interface IDirectCashbackRedemptionInput { barcode: string; transaction_id: string; payment_details: { iban: string; }; } export interface IDirectCashbackVoucherBenefit { product_id?: string | string[]; amount?: string; currency?: string; } export interface ILoyaltyUserProfile { user_status: "A" | "T"; has_email: "Y" | "N"; has_mobile_phone: "Y" | "N"; } export interface ILoyaltyTransactionProductCodes { [key: string]: number; } export interface ILoyaltyTransactionTransactionMessage { [key: string]: string; } export interface ILoyaltyBalance { user_total_points: string; user_total_points_alt: string; user_guid: string; user_hold_points: string; user_hold_points_alt: string; status: string; user_profile: ILoyaltyUserProfile; } export interface ILoyaltyTransactionHistory { transaction_id: string; log_id: string; action: string; program_id: string; total_points: string; shop_id: string; partner_ext_id: string; is_synced: string; transaction_date: string; user_id: string; user_type: string; product_codes: ILoyaltyTransactionProductCodes; transaction_ext_id: string; transaction_ext_origin: string; transaction_message: ILoyaltyTransactionTransactionMessage; } export interface ILoyaltyPointsExpirationDate { status: string; user_guid: string; expiration_date?: string | null; expiration_points: string; expiration_points_alt: string; data?: { expiration_date: string; expiration_points: string; expiration_points_alt: string; }[]; } export interface ILoyaltyPointStampAddition { transactionpoints: number; newtotalpoints: number; transactionstamps: number; new_total_all_stamps: number; status: string; message: string; log_id: number; transaction_id: number; user_guid: string; user_profile: ILoyaltyUserProfile; } export interface ILoyaltyPointDeduction { transactionpoints: number; newtotalpoints: number; status: string; message: string; log_id: number; transaction_id: number; user_guid: string; user_profile: ILoyaltyUserProfile; } export interface IAddUserTagsInput { user_guid: string; user_tags: string; replace_existing_tags?: string; custom_logger_info?: { [key: string]: string; }; } export interface IAddPetTagsInput { pet_guid: string; pet_tags: string; replace_existing_tags?: string; } export interface IDeleteUserTagsInput { user_guid: string; user_tags: string; custom_logger_info?: { [key: string]: string; }; } export interface IDeletePetTagsInput { pet_guid: string; pet_tags: string; } export interface ISocialNetwork { social_network: string; username: string; follower_count?: number; added_on: string; updated_on: string; } export interface ISocialNetworkInput { user_guid: string; social_network: string; username: string; follower_count?: number; } export interface ISocialNetworkDeleteInput { user_guid: string; social_network: string; username: string; } export {};