@azure/search-documents
Version:
Azure client library to use AI Search for node.js and browser.
116 lines (115 loc) • 5.51 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 searchIndexerClient_exports = {};
__export(searchIndexerClient_exports, {
SearchIndexerClient: () => SearchIndexerClient
});
module.exports = __toCommonJS(searchIndexerClient_exports);
var import_api = require("./api/index.js");
var import_operations = require("./api/operations.js");
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 = (0, import_api.createSearchIndexer)(endpointParam, credential, {
...options,
userAgentOptions: { userAgentPrefix }
});
this.pipeline = this._client.pipeline;
}
/** Creates a new skillset in a search service. */
createSkillset(skillset, options = { requestOptions: {} }) {
return (0, import_operations.createSkillset)(this._client, skillset, options);
}
/** List all skillsets in a search service. */
getSkillsets(options = { requestOptions: {} }) {
return (0, import_operations.getSkillsets)(this._client, options);
}
/** Retrieves a skillset in a search service. */
getSkillset(name, options = { requestOptions: {} }) {
return (0, import_operations.getSkillset)(this._client, name, options);
}
/** Deletes a skillset in a search service. */
deleteSkillset(name, options = { requestOptions: {} }) {
return (0, import_operations.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 (0, import_operations.createOrUpdateSkillset)(this._client, skillset, name, options);
}
/** Returns the current status and execution history of an indexer. */
getIndexerStatus(name, options = { requestOptions: {} }) {
return (0, import_operations.getIndexerStatus)(this._client, name, options);
}
/** Creates a new indexer. */
createIndexer(indexer, options = { requestOptions: {} }) {
return (0, import_operations.createIndexer)(this._client, indexer, options);
}
/** Lists all indexers available for a search service. */
getIndexers(options = { requestOptions: {} }) {
return (0, import_operations.getIndexers)(this._client, options);
}
/** Retrieves an indexer definition. */
getIndexer(name, options = { requestOptions: {} }) {
return (0, import_operations.getIndexer)(this._client, name, options);
}
/** Deletes an indexer. */
deleteIndexer(name, options = { requestOptions: {} }) {
return (0, import_operations.deleteIndexer)(this._client, name, options);
}
/** Creates a new indexer or updates an indexer if it already exists. */
createOrUpdateIndexer(indexer, name, options = { requestOptions: {} }) {
return (0, import_operations.createOrUpdateIndexer)(this._client, indexer, name, options);
}
/** Runs an indexer on-demand. */
runIndexer(name, options = { requestOptions: {} }) {
return (0, import_operations.runIndexer)(this._client, name, options);
}
/** Resets the change tracking state associated with an indexer. */
resetIndexer(name, options = { requestOptions: {} }) {
return (0, import_operations.resetIndexer)(this._client, name, options);
}
/** Creates a new datasource. */
createDataSourceConnection(dataSourceConnection, options = { requestOptions: {} }) {
return (0, import_operations.createDataSourceConnection)(this._client, dataSourceConnection, options);
}
/** Lists all datasources available for a search service. */
getDataSourceConnections(options = { requestOptions: {} }) {
return (0, import_operations.getDataSourceConnections)(this._client, options);
}
/** Retrieves a datasource definition. */
getDataSourceConnection(name, options = { requestOptions: {} }) {
return (0, import_operations.getDataSourceConnection)(this._client, name, options);
}
/** Deletes a datasource. */
deleteDataSourceConnection(name, options = { requestOptions: {} }) {
return (0, import_operations.deleteDataSourceConnection)(this._client, name, options);
}
/** Creates a new datasource or updates a datasource if it already exists. */
createOrUpdateDataSourceConnection(dataSource, name, options = { requestOptions: {} }) {
return (0, import_operations.createOrUpdateDataSourceConnection)(this._client, dataSource, name, options);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SearchIndexerClient
});
//# sourceMappingURL=searchIndexerClient.js.map