UNPKG

@datocms/cma-client

Version:
133 lines (132 loc) 4.59 kB
import BaseResource from '../../BaseResource'; import type * as ApiTypes from '../ApiTypes'; import type * as RawApiTypes from '../RawApiTypes'; export default class SearchIndex extends BaseResource { static readonly TYPE: "search_index"; /** * List all search indexes for a site * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/instances * * @throws {ApiError} * @throws {TimeoutError} */ list(): Promise<ApiTypes.SearchIndexInstancesTargetSchema>; /** * List all search indexes for a site * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/instances * * @throws {ApiError} * @throws {TimeoutError} */ rawList(): Promise<RawApiTypes.SearchIndexInstancesTargetSchema>; /** * Retrieve a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/self * * @throws {ApiError} * @throws {TimeoutError} */ find(searchIndexId: string | ApiTypes.SearchIndexData): Promise<ApiTypes.SearchIndex>; /** * Retrieve a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/self * * @throws {ApiError} * @throws {TimeoutError} */ rawFind(searchIndexId: string): Promise<RawApiTypes.SearchIndexSelfTargetSchema>; /** * Create a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/create * * @throws {ApiError} * @throws {TimeoutError} */ create(body: ApiTypes.SearchIndexCreateSchema): Promise<ApiTypes.SearchIndex>; /** * Create a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/create * * @throws {ApiError} * @throws {TimeoutError} */ rawCreate(body: RawApiTypes.SearchIndexCreateSchema): Promise<RawApiTypes.SearchIndexCreateTargetSchema>; /** * Update a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/update * * @throws {ApiError} * @throws {TimeoutError} */ update(searchIndexId: string | ApiTypes.SearchIndexData, body: ApiTypes.SearchIndexUpdateSchema): Promise<ApiTypes.SearchIndex>; /** * Update a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/update * * @throws {ApiError} * @throws {TimeoutError} */ rawUpdate(searchIndexId: string, body: RawApiTypes.SearchIndexUpdateSchema): Promise<RawApiTypes.SearchIndexUpdateTargetSchema>; /** * Trigger the indexing process * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/trigger * * @throws {ApiError} * @throws {TimeoutError} */ trigger(searchIndexId: string | ApiTypes.SearchIndexData): Promise<void>; /** * Trigger the indexing process * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/trigger * * @throws {ApiError} * @throws {TimeoutError} */ rawTrigger(searchIndexId: string): Promise<void>; /** * Abort a the current indexing process and mark it as failed * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/abort * * @throws {ApiError} * @throws {TimeoutError} */ abort(searchIndexId: string | ApiTypes.SearchIndexData): Promise<void>; /** * Abort a the current indexing process and mark it as failed * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/abort * * @throws {ApiError} * @throws {TimeoutError} */ rawAbort(searchIndexId: string): Promise<void>; /** * Delete a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/destroy * * @throws {ApiError} * @throws {TimeoutError} */ destroy(searchIndexId: string | ApiTypes.SearchIndexData): Promise<ApiTypes.SearchIndex>; /** * Delete a search index * * Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/destroy * * @throws {ApiError} * @throws {TimeoutError} */ rawDestroy(searchIndexId: string): Promise<RawApiTypes.SearchIndexDestroyTargetSchema>; }