@azure/search-documents
Version:
Azure client library to use AI Search for node.js and browser.
164 lines (163 loc) • 8.38 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var searchIndexClient_exports = {};
__export(searchIndexClient_exports, {
SearchIndexClient: () => SearchIndexClient
});
module.exports = __toCommonJS(searchIndexClient_exports);
var import_api = require("./api/index.js");
var import_operations = require("./api/operations.js");
class SearchIndexClient {
_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 = (0, import_api.createSearchIndex)(endpointParam, credential, {
...options,
userAgentOptions: { userAgentPrefix }
});
this.pipeline = this._client.pipeline;
}
/** Gets service level statistics for a search service. */
getServiceStatistics(options = { requestOptions: {} }) {
return (0, import_operations.getServiceStatistics)(this._client, options);
}
/** Retrieves the status of a knowledge source. */
getKnowledgeSourceStatus(name, options = { requestOptions: {} }) {
return (0, import_operations.getKnowledgeSourceStatus)(this._client, name, options);
}
/** Creates a new knowledge source. */
createKnowledgeSource(knowledgeSource, options = { requestOptions: {} }) {
return (0, import_operations.createKnowledgeSource)(this._client, knowledgeSource, options);
}
/** Lists all knowledge sources available for a search service. */
listKnowledgeSources(options = { requestOptions: {} }) {
return (0, import_operations.listKnowledgeSources)(this._client, options);
}
/** Retrieves a knowledge source definition. */
getKnowledgeSource(name, options = { requestOptions: {} }) {
return (0, import_operations.getKnowledgeSource)(this._client, name, options);
}
/** Deletes an existing knowledge source. */
deleteKnowledgeSource(name, options = { requestOptions: {} }) {
return (0, import_operations.deleteKnowledgeSource)(this._client, name, options);
}
/** Creates a new knowledge source or updates an knowledge source if it already exists. */
createOrUpdateKnowledgeSource(knowledgeSource, name, options = { requestOptions: {} }) {
return (0, import_operations.createOrUpdateKnowledgeSource)(this._client, knowledgeSource, name, options);
}
/** Creates a new knowledge base. */
createKnowledgeBase(knowledgeBase, options = { requestOptions: {} }) {
return (0, import_operations.createKnowledgeBase)(this._client, knowledgeBase, options);
}
/** Lists all knowledge bases available for a search service. */
listKnowledgeBases(options = { requestOptions: {} }) {
return (0, import_operations.listKnowledgeBases)(this._client, options);
}
/** Retrieves a knowledge base definition. */
getKnowledgeBase(name, options = { requestOptions: {} }) {
return (0, import_operations.getKnowledgeBase)(this._client, name, options);
}
/** Deletes a knowledge base. */
deleteKnowledgeBase(name, options = { requestOptions: {} }) {
return (0, import_operations.deleteKnowledgeBase)(this._client, name, options);
}
/** Creates a new knowledge base or updates a knowledge base if it already exists. */
createOrUpdateKnowledgeBase(knowledgeBase, name, options = { requestOptions: {} }) {
return (0, import_operations.createOrUpdateKnowledgeBase)(this._client, knowledgeBase, name, options);
}
/** Creates a new search alias. */
createAlias(alias, options = { requestOptions: {} }) {
return (0, import_operations.createAlias)(this._client, alias, options);
}
/** Lists all aliases available for a search service. */
listAliases(options = { requestOptions: {} }) {
return (0, import_operations.listAliases)(this._client, options);
}
/** Retrieves an alias definition. */
getAlias(name, options = { requestOptions: {} }) {
return (0, import_operations.getAlias)(this._client, name, options);
}
/** Deletes a search alias and its associated mapping to an index. This operation is permanent, with no recovery option. The mapped index is untouched by this operation. */
deleteAlias(name, options = { requestOptions: {} }) {
return (0, import_operations.deleteAlias)(this._client, name, options);
}
/** Creates a new search alias or updates an alias if it already exists. */
createOrUpdateAlias(alias, name, options = { requestOptions: {} }) {
return (0, import_operations.createOrUpdateAlias)(this._client, alias, name, options);
}
/** Shows how an analyzer breaks text into tokens. */
analyzeText(request, name, options = { requestOptions: {} }) {
return (0, import_operations.analyzeText)(this._client, request, name, options);
}
/** Returns statistics for the given index, including a document count and storage usage. */
getIndexStatistics(name, options = { requestOptions: {} }) {
return (0, import_operations.getIndexStatistics)(this._client, name, options);
}
/** Creates a new search index. */
createIndex(index, options = { requestOptions: {} }) {
return (0, import_operations.createIndex)(this._client, index, options);
}
/** Lists all indexes available for a search service. */
listIndexesWithSelectedProperties(options = { requestOptions: {} }) {
return (0, import_operations.listIndexesWithSelectedProperties)(this._client, options);
}
/** Lists all indexes available for a search service. */
listIndexes(options = { requestOptions: {} }) {
return (0, import_operations.listIndexes)(this._client, options);
}
/** Retrieves an index definition. */
getIndex(name, options = { requestOptions: {} }) {
return (0, import_operations.getIndex)(this._client, name, options);
}
/** Deletes a search index and all the documents it contains. This operation is permanent, with no recovery option. Make sure you have a master copy of your index definition, data ingestion code, and a backup of the primary data source in case you need to re-build the index. */
deleteIndex(name, options = { requestOptions: {} }) {
return (0, import_operations.deleteIndex)(this._client, name, options);
}
/** Creates a new search index or updates an index if it already exists. */
createOrUpdateIndex(index, name, options = { requestOptions: {} }) {
return (0, import_operations.createOrUpdateIndex)(this._client, index, name, options);
}
/** Creates a new synonym map. */
createSynonymMap(synonymMap, options = { requestOptions: {} }) {
return (0, import_operations.createSynonymMap)(this._client, synonymMap, options);
}
/** Lists all synonym maps available for a search service. */
getSynonymMaps(options = { requestOptions: {} }) {
return (0, import_operations.getSynonymMaps)(this._client, options);
}
/** Retrieves a synonym map definition. */
getSynonymMap(name, options = { requestOptions: {} }) {
return (0, import_operations.getSynonymMap)(this._client, name, options);
}
/** Deletes a synonym map. */
deleteSynonymMap(name, options = { requestOptions: {} }) {
return (0, import_operations.deleteSynonymMap)(this._client, name, options);
}
/** Creates a new synonym map or updates a synonym map if it already exists. */
createOrUpdateSynonymMap(synonymMap, name, options = { requestOptions: {} }) {
return (0, import_operations.createOrUpdateSynonymMap)(this._client, synonymMap, name, options);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SearchIndexClient
});
//# sourceMappingURL=searchIndexClient.js.map