import { Dictionary } from '../typings/dictionary'; import { BreadcrumbItem } from './dto/breadcrumb-item'; import { CollectionResponse } from './dto/collection-response'; import { GenericContentItem } from './dto/generic-content-item'; import { NavigationItem } from './dto/navigation-item'; import { SdkItem } from './dto/sdk-item'; import { Widget } from './dto/widget'; import { CreateArgs } from './args/create.args'; import { CreateWidgetArgs } from './args/create-widget.args'; import { DeleteArgs } from './args/delete.args'; import { GetAllArgs } from './args/get-all.args'; import { GetBreadcrumbArgs } from './args/get-breadcrumb.args'; import { GetPageLayoutArgs } from './args/get-page-layout.args'; import { GetNavigationArgs } from './args/get-navigation.args'; import { ItemArgs } from './args/item.args'; import { LockArgs } from './args/lock-page.args'; import { PublishArgs } from './args/publish.args'; import { RelateArgs } from './args/relate.args'; import { ScheduleArgs } from './args/schedule.args'; import { UpdateArgs } from './args/update.args'; import { UploadMediaArgs } from './args/upload.args'; import { LayoutResponse, LayoutServiceResponse } from './dto/layout-service.response'; import { GetFormLayoutArgs } from './args/get-form-layout.args'; import { UserDto } from './dto/user-item'; import { ExternalProvider } from './dto/external-provider'; import { RegistrationSettingsDto } from './dto/registration-settings'; import { FacetsViewModelDto } from './dto/facets/facets-viewmodel-dto'; import { GetFacetsArgs } from './args/get-facets.args'; import { FacetFlatResponseDto } from './dto/facets/facet-flat-dto'; import { SearchArgs } from './args/perform-search.args'; import { SuggestionsArgs } from './args/get-search-suggestions.args'; import { SearchResultDocumentDto } from './dto/search-results-document-dto'; import { GetTaxonArgs } from './args/get-taxon.args'; import { TaxonDto } from './dto/taxon-dto'; import { GetTemplatesArgs } from './args/get-templates-args'; import { PageTemplateCategoryDto } from './dto/page-template-category.dto'; import { PageTemplateStatisticsDto } from './dto/page-template-statistics.dto'; import { WidgetModel } from '../editor/widget-framework/widget-model'; import { GetHierarchicalWidgetModelArgs } from './args/get-hierarchical-widget-model.args'; import { CommonArgs } from './args/common.args'; import { GetLazyWidgetsArgs } from './args/get-lazy-widgets.args'; import { SiteDto } from './dto/site-item'; import { ChangeLocationPriorityArgs } from './args/change-location-priority.args'; import { RequestArgs } from './args/request.args'; import { GetFacatebleFieldsArgs } from './args/get-facateble-fields.args'; import { GetSharedContentArgs } from './args/get-shared-content.args'; import { GetTemplatesStatisticsArgs } from './args/get-templates-statistics-args'; import { SearchMetadataDto } from './dto/search-metadata-dto'; import { ChangeTemplateArgs } from './args/change-template-args'; import { State } from './dto/state'; /** * Provides implementation for communicating with the Sitefinity REST API services. * This class is used to perform CRUD operations on items, search for items, and manage content in Sitefinity. */ export declare class RestClient { static contextQueryParams: { [key: string]: string; }; /** * Gets a media item with extended properties by type and id. * @param {ItemArgs} args The arguments for the request. *@param {string} args.type The type name of the item to retrieve. *@param {string} args.id The id of the item to retrieve. *@param {string} [args.culture] The culture for the request. *@param {string} [args.provider] The provider for the item if it is a part of non-default provider for the site and type. * @returns {Promise} The requested item. */ static getItemWithFallback(args: ItemArgs): Promise; /** * Gets a collection of taxons based on request arguments. * @param {GetTaxonArgs}args The arguments for the request. * @param {string} args.taxonomyId The taxonomy type id to retrieve taxons from. * @param {string[]} args.taxaIds The ids of the taxons to retrieve. Used when selection mode is "Selected" or "UnderParent". * @param {'All' | 'TopLevel' | 'UnderParent' | 'Selected' | 'ByContentType'} args.selectionMode The selection mode for the taxons. * @param {string} args.contentType Filter taxons that refer a specific content type. Used when selection mode is "ByContentType". * @param {boolean} args.showEmpty Whether to show taxons that have no related content items. * @param {string} args.orderBy The order by clause for the taxons. * @returns {Promise>} A collection of matching taxons. */ static getTaxons(args: GetTaxonArgs): Promise; static getSearchMetadata(args: RequestArgs): Promise; static getItemWithStatus(args: ItemArgs): Promise; /** * Gets a content item by type and id. * @param {ItemArgs} args The arguments for the request. * @param {string} args.type The type name of the item to retrieve. * @param {string} args.id The id of the item to retrieve. * @param {string} [args.culture] The culture for the request. * @param {string[]} [args.fields] The fields to include in the response. By default the '*' wildcard is used and related fields are excluded. * @param {string} [args.provider] The provider for the item if it is a part of non-default provider for the site and type. * @param {Dictionary} [args.additionalQueryParams] Additional query parameters to include in the request. * @param {Dictionary} [args.additionalHeaders] Additional headers to include in the request. * @param {any} [args.additionalFetchData] Additional fetch data to include in the request. * @param {any} [args.traceContext] The current OpenTelemetry trace context for the request if such is available. It could be found in the WidgetContext. * @returns {Promise} The requested item. */ static getItem(args: ItemArgs): Promise; /** * Gets a shared content block by id. * @param args The arguments for the request. * @param {string} args.id The id of the shared content block to retrieve. * @param {string} [args.cultureName] The culture for the request and the version of the shared content block content to retrieve. * @returns {Promise} The requested content block. */ static getSharedContent(args: GetSharedContentArgs): Promise; /** * Gets a collection of items based on the provided arguments. * @param {GetAllArgs}args The get multiple items args. * @param {string} args.type The type name of the items to retrieve. * @param {number} [args.skip] The number of items to skip in the response. * @param {number} [args.take] The maximum number of items to return in the response. * @param {OrderBy} [args.orderBy] The order by clause to apply to the request. * @param {string} [args.provider] The provider for the items if they are part of a non-default provider for the site and type. * @param {string} [args.culture] The culture for the request. * @param {string[]} [args.fields] The fields to include in the response. By default the '*' wildcard is used and related fields are excluded. * @param {FilterClause | CombinedFilter | RelationFilter | DateOffsetPeriod | null} [args.filter] The filter to apply to the collection request. * @param {boolean} [args.count] Whether to include the total count of items in the response. * @param {Dictionary} [args.additionalQueryParams] Additional query parameters to include in the request. * @param {Dictionary} [args.additionalHeaders] Additional headers to include in the request. * @param {any} [args.additionalFetchData] Additional fetch data to include in the request. * @param {any} [args.traceContext] The current OpenTelemetry trace context for the request if such is available. It could be found in the WidgetContext. * @returns {Promise} The wrepper object with a collection of the matched items if such exist. Otherwise an empty collection. */ static getItems(args: GetAllArgs): Promise>; static createItem(args: CreateArgs): Promise; static scheduleItem(args: ScheduleArgs): Promise; static updateItem(args: UpdateArgs): Promise; static deleteItem(args: DeleteArgs): Promise; static publishItem(args: PublishArgs): Promise; static saveDraftItem(args: PublishArgs): Promise; static syncPage(args: UpdateArgs): Promise; static lockItem(args: UpdateArgs): Promise; static relateItem(args: RelateArgs): Promise; static lockPage(args: LockArgs): Promise; static createWidget(args: CreateWidgetArgs): Promise; static updateWidget(page: SdkItem, propertyValues: any): Promise; static uploadItem(args: UploadMediaArgs): Promise; static performSearch(args: SearchArgs): Promise<{ totalCount: number; searchResults: SearchResultDocumentDto[]; }>; static getSearchSuggestions(args: SuggestionsArgs): Promise<{ value: string[]; }>; static getFacatebleFields(args: GetFacatebleFieldsArgs): Promise; static getFacets(args: GetFacetsArgs): Promise; static getResetPasswordModel(token: string, traceContext?: any, headers?: Dictionary): Promise; static getRegistrationSettings(args: RequestArgs): Promise; static activateAccount(encryptedParam: string, traceContext?: any, headers?: Dictionary): Promise; static getExternalProviders(args: RequestArgs): Promise; static getCurrentUser(args?: RequestArgs): Promise; static getCurrentSite(args?: RequestArgs): Promise; static getSites(args?: RequestArgs): Promise; static getNavigation(args: GetNavigationArgs): Promise; static getBreadcrumb(args: GetBreadcrumbArgs): Promise; static setHomePage(args: ItemArgs): Promise; static getPreviewLink(args: ItemArgs): Promise; static getPageSharePreviewLink(pageId: string): Promise; static getContentLocations(args: CommonArgs): Promise; static getDisplayPages(args: ItemArgs): Promise; static getProviders(args: CommonArgs): Promise; static changeLocationPriority(args: ChangeLocationPriorityArgs): Promise; static getFormLayout(args: GetFormLayoutArgs): Promise; static getWidgetModel(args: GetHierarchicalWidgetModelArgs): Promise>; static getLazyWidget(args: GetHierarchicalWidgetModelArgs): Promise | undefined>; static getLazyWidgets(args: GetLazyWidgetsArgs): Promise>>; static getPageLayout(args: GetPageLayoutArgs): Promise; static getTemplates(args: GetTemplatesArgs): Promise; static getState(args: ItemArgs): Promise; static changeTemplate(args: ChangeTemplateArgs): Promise; static getTemplatesStatistics(args: GetTemplatesStatisticsArgs): Promise; private static getSimpleFields; private static getRelatedFields; private static parseInnerFields; static buildQueryParams(queryParams: { [key: string]: string | undefined; } | undefined): string; static addAuthHeaders(cookie: string | undefined, headers: { [key: string]: string; }): void; private static getQueryParams; private static buildHeaders; static sendRequest(request: RequestData, throwErrorAsJson?: boolean): Promise; static buildItemBaseUrl(itemType: string): string; private static handleApiResponse; private static getSystemRoutePath; } export declare class RestSdkTypes { static readonly Video: string; static readonly Image: string; static readonly Document: string; static readonly DocumentLibrary: string; static readonly News: string; static readonly Taxonomies: string; static readonly Tags: string; static readonly Categories: string; static readonly GenericContent: string; static readonly Pages: string; static readonly PageTemplates: string; static readonly Form: string; static readonly Site: string; static readonly Blog: string; static readonly Event: string; static readonly Calendar: string; static readonly BlogPost: string; static readonly Author: string; static readonly List: string; static readonly ListItem: string; } interface RequestData { url: string; method?: string; headers?: { [key: string]: string; }; data?: any; additionalFetchData?: any; traceContext?: any; } export {};