import { AxiosResponse } from 'axios'; import { IPost, IPostRequest } from '../types/Post'; import { IAggregation } from '../types/Aggregation'; import { IPostRelationships } from '../types/PostRelationships'; import { ITints, ITintsWithSocialsAndPersonalization } from '../types/Tint'; export interface ITintsWithInclusions extends ITints, ITintsWithSocialsAndPersonalization { } export interface PublicPostBody { type: string; attributes: { author: { name: string; email?: string; username: string; image_url: string; }; text: string; custom_field: string; media_url: string[]; tags?: string; }; } export interface ReviewBody { type: string; attributes: { type?: string; author: { name?: string; email?: string; }; title: string; text: string; rating: number; media_url?: string[]; tags?: string; }; } export interface IPostsHttpResponseLinks { first: string; self: string; next?: string; previous?: string; } export interface IGetPostRequestReturnValue { data: IPostRequest; } export interface IAggregationsHttpResponse { data: IAggregation[]; } export interface IPostsHttpResponse { data: IPost[]; links: IPostsHttpResponseLinks; included?: ReadonlyArray; } export interface IQueryParam { size?: number; q?: string; social_feed_id?: number[]; id?: string[]; language?: string[]; published_at?: number; sentiment?: 'neutral' | 'positive' | 'negative'; type?: string; tag?: string; saved_filter_id?: number; product_sku?: string; rating?: { [key: string]: string; } | string; sort?: string; } export interface IGetPostsReturnValue { posts: ReadonlyArray; postsRelationships?: ReadonlyArray; links: IPostsHttpResponseLinks; } export interface IGetAggregationsReturnValue { aggregations: ReadonlyArray; } export interface ISinglePost { post: IPost; postsRelationships?: ReadonlyArray; links: IPostsHttpResponseLinks; } export declare type TintInclude = 'personalizations' | 'social_feeds' | 'default_personalization'; export default class ApiService { private readonly tintSlug; constructor(tintSlug: string); getSinglePost(id: string): Promise; getPosts(config?: IQueryParam): Promise; getAggregations(): Promise; getPage(url: string): Promise; postReview: (body: ReviewBody) => Promise>; postPublicPost: (body: PublicPostBody) => Promise>; getPublicPostRequest: (requestId: string) => Promise>; getTintBasicData: (includes: readonly TintInclude[]) => Promise>; getPersonalization: (personalizationId: number) => any; private convertDateFrom; private setQueryParam; private mapConfigToQueryParams; private queryPosts; private getAggregationsData; private get; private post; }