@kontent-ai/delivery-sdk
Version:
Official Kontent.AI Delivery API SDK
53 lines (52 loc) • 2.64 kB
TypeScript
import { Contracts } from '../../contracts';
import { IDeliveryClientConfig } from '../../config';
import { IDeliveryNetworkResponse, Responses, IItemFeedQueryConfig, ClientTypes, IUsedInItemRecord, IQueryConfig } from '../../models';
import { QueryService } from '../../services';
import { BaseListingQuery } from '../common/base-listing-query.class';
export type UsedInSetup = {
readonly entity: 'asset' | 'contentItem';
readonly codename: string;
};
export declare class UsedInQuery<TClientTypes extends ClientTypes> extends BaseListingQuery<TClientTypes, IUsedInItemRecord<TClientTypes>, Responses.IUsedInResponse<TClientTypes>, Responses.IUsedInAllResponse<TClientTypes>, IQueryConfig, Contracts.IUsedInItemsContract> {
protected readonly config: IDeliveryClientConfig;
protected readonly queryService: QueryService<TClientTypes>;
protected readonly setup: UsedInSetup;
protected _queryConfig: IQueryConfig;
constructor(config: IDeliveryClientConfig, queryService: QueryService<TClientTypes>, setup: UsedInSetup);
/**
* Gets only item of given type
* @param type Codename of type to get
*/
type(type: TClientTypes['contentTypeCodenames']): this;
/**
* Gets items of given types (logical or)
* I.e. get items of either 'Actor' or 'Movie' type
* @param types Types to get
*/
types(types: TClientTypes['contentTypeCodenames'][]): this;
/**
* Gets only item from given collection
* @param collection Codename of collection to get
*/
collection(collection: TClientTypes['collectionCodenames']): this;
/**
* Gets items from given collections (logical or)
* I.e. get items of either 'default' or 'christmas-campaign' collection
* @param collections Collections to get
*/
collections(collections: TClientTypes['collectionCodenames'][]): this;
/**
* Language codename
* @param languageCodename Codename of the language
*/
languageParameter(languageCodename: TClientTypes['languageCodenames']): this;
toPromise(): Promise<IDeliveryNetworkResponse<Responses.IUsedInResponse<TClientTypes>, Contracts.IUsedInItemsContract>>;
getUrl(): string;
/**
* Used to configure query
* @param queryConfig Query configuration
*/
queryConfig(queryConfig: IItemFeedQueryConfig): this;
map(json: any): Responses.IUsedInResponse<TClientTypes>;
protected allResponseFactory(items: IUsedInItemRecord<TClientTypes>[], responses: IDeliveryNetworkResponse<Responses.IUsedInResponse<TClientTypes>, Contracts.IUsedInItemsContract>[]): Responses.IUsedInAllResponse<TClientTypes>;
}