UNPKG

@azure/search-documents

Version:
93 lines 4.66 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { createSearchIndexer } from "./api/index.js"; import { createSkillset, getSkillsets, getSkillset, deleteSkillset, createOrUpdateSkillset, getIndexerStatus, createIndexer, getIndexers, getIndexer, deleteIndexer, createOrUpdateIndexer, runIndexer, resetIndexer, createDataSourceConnection, getDataSourceConnections, getDataSourceConnection, deleteDataSourceConnection, createOrUpdateDataSourceConnection, } from "./api/operations.js"; export class SearchIndexerClient { _client; /** The pipeline used by this client to make requests */ pipeline; constructor(endpointParam, credential, options = {}) { const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-client` : `azsdk-js-client`; this._client = createSearchIndexer(endpointParam, credential, { ...options, userAgentOptions: { userAgentPrefix }, }); this.pipeline = this._client.pipeline; } /** Creates a new skillset in a search service. */ createSkillset(skillset, options = { requestOptions: {} }) { return createSkillset(this._client, skillset, options); } /** List all skillsets in a search service. */ getSkillsets(options = { requestOptions: {} }) { return getSkillsets(this._client, options); } /** Retrieves a skillset in a search service. */ getSkillset(name, options = { requestOptions: {} }) { return getSkillset(this._client, name, options); } /** Deletes a skillset in a search service. */ deleteSkillset(name, options = { requestOptions: {} }) { return deleteSkillset(this._client, name, options); } /** Creates a new skillset in a search service or updates the skillset if it already exists. */ createOrUpdateSkillset(skillset, name, options = { requestOptions: {} }) { return createOrUpdateSkillset(this._client, skillset, name, options); } /** Returns the current status and execution history of an indexer. */ getIndexerStatus(name, options = { requestOptions: {} }) { return getIndexerStatus(this._client, name, options); } /** Creates a new indexer. */ createIndexer(indexer, options = { requestOptions: {} }) { return createIndexer(this._client, indexer, options); } /** Lists all indexers available for a search service. */ getIndexers(options = { requestOptions: {} }) { return getIndexers(this._client, options); } /** Retrieves an indexer definition. */ getIndexer(name, options = { requestOptions: {} }) { return getIndexer(this._client, name, options); } /** Deletes an indexer. */ deleteIndexer(name, options = { requestOptions: {} }) { return deleteIndexer(this._client, name, options); } /** Creates a new indexer or updates an indexer if it already exists. */ createOrUpdateIndexer(indexer, name, options = { requestOptions: {} }) { return createOrUpdateIndexer(this._client, indexer, name, options); } /** Runs an indexer on-demand. */ runIndexer(name, options = { requestOptions: {} }) { return runIndexer(this._client, name, options); } /** Resets the change tracking state associated with an indexer. */ resetIndexer(name, options = { requestOptions: {} }) { return resetIndexer(this._client, name, options); } /** Creates a new datasource. */ createDataSourceConnection(dataSourceConnection, options = { requestOptions: {} }) { return createDataSourceConnection(this._client, dataSourceConnection, options); } /** Lists all datasources available for a search service. */ getDataSourceConnections(options = { requestOptions: {} }) { return getDataSourceConnections(this._client, options); } /** Retrieves a datasource definition. */ getDataSourceConnection(name, options = { requestOptions: {} }) { return getDataSourceConnection(this._client, name, options); } /** Deletes a datasource. */ deleteDataSourceConnection(name, options = { requestOptions: {} }) { return deleteDataSourceConnection(this._client, name, options); } /** Creates a new datasource or updates a datasource if it already exists. */ createOrUpdateDataSourceConnection(dataSource, name, options = { requestOptions: {} }) { return createOrUpdateDataSourceConnection(this._client, dataSource, name, options); } } //# sourceMappingURL=searchIndexerClient.js.map