@kontent-ai/delivery-sdk
Version:
Official Kontent.AI Delivery API SDK
82 lines (81 loc) • 3.61 kB
TypeScript
import { IDeliveryClientConfig } from '../config';
import { ClientTypes, IContentItem } from '../models';
import { ElementQuery, ItemsFeedQuery, MultipleItemsQuery, MultipleTypeQuery, SingleItemQuery, SingleTypeQuery, TaxonomiesQuery, TaxonomyQuery, LanguagesQuery, InitializeSyncQuery, SyncChangesQuery, UsedInQuery } from '../query';
import { IMappingService } from '../services';
import { IDeliveryClient } from './idelivery-client.interface';
export declare class DeliveryClient<TClientTypes extends ClientTypes = ClientTypes> implements IDeliveryClient {
protected config: IDeliveryClientConfig;
private queryService;
mappingService: IMappingService<TClientTypes>;
/**
* Delivery client used to fetch data from Kontent.ai
* @constructor
* @param {IDeliveryClientConfig} config - The client configuration
*/
constructor(config: IDeliveryClientConfig);
/**
* Gets query for multiple languages
*/
languages(): LanguagesQuery<TClientTypes>;
/**
* Gets query for multiple types
*/
types(): MultipleTypeQuery<TClientTypes>;
/**
* Gets query for single type
* @param {string} typeCodename - Codename of the type to fetch
*/
type(typeCodename: TClientTypes['contentTypeCodenames']): SingleTypeQuery<TClientTypes>;
/**
* Gets query for multiple items
*/
items<TContentItem extends IContentItem = TClientTypes['contentItemType']>(): MultipleItemsQuery<TClientTypes, TContentItem>;
/**
* Gets query for single item
* @param {string} codename - Codename of item to fetch
*/
item<TContentItem extends IContentItem = TClientTypes['contentItemType']>(codename: string): SingleItemQuery<TClientTypes, TContentItem>;
/**
* Gets query for items feed. Executes single HTTP request only
*/
itemsFeed<TContentItem extends IContentItem = TClientTypes['contentItemType']>(): ItemsFeedQuery<TClientTypes, TContentItem>;
/**
* Gets query for single taxonomy
* @param {string} codename - Codename of taxonomy to fetch
*/
taxonomy(codename: TClientTypes['taxonomyCodenames']): TaxonomyQuery<TClientTypes>;
/**
* Gets query for multiple taxonomies
*/
taxonomies(): TaxonomiesQuery<TClientTypes>;
/**
* Gets query for an element within a type
* @param {string} typeCodename - Codename of the type
* @param {string} elementCodename - Codename of the element
*/
element(typeCodename: TClientTypes['contentTypeCodenames'], elementCodename: TClientTypes['elementCodenames']): ElementQuery<TClientTypes>;
/**
* @deprecated Sync API v1 is deprecated and will be shut down by the end of this year.
* Please migrate to Sync API v2 using the `@kontent-ai/sync-sdk` package.
*
* For migration guidance and full documentation, visit:
* https://kontent.ai/learn/docs/apis/openapi/sync-api-v2/
*/
initializeSync(): InitializeSyncQuery<TClientTypes>;
/**
* @deprecated Sync API v1 is deprecated and will be shut down by the end of this year.
* Please migrate to Sync API v2 using the `@kontent-ai/sync-sdk` package.
*
* For migration guidance and full documentation, visit:
* https://kontent.ai/learn/docs/apis/openapi/sync-api-v2/
*/
syncChanges(): SyncChangesQuery<TClientTypes>;
/**
* Item listing of where an asset is used
*/
assetUsedIn(assetCodename: string): UsedInQuery<TClientTypes>;
/**
* Item listing of where a content item is used
*/
itemUsedIn(itemCodename: string): UsedInQuery<TClientTypes>;
}