@azure/search-documents 11.3.0-beta.8 → 11.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +233 -0
- package/README.md +40 -18
- package/dist/index.js +952 -3434
- package/dist/index.js.map +1 -1
- package/dist-esm/src/constants.js +1 -1
- package/dist-esm/src/constants.js.map +1 -1
- package/dist-esm/src/generated/data/index.js +1 -1
- package/dist-esm/src/generated/data/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/index.js +1 -202
- package/dist-esm/src/generated/data/models/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/mappers.js +1 -138
- package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/data/models/parameters.js +13 -72
- package/dist-esm/src/generated/data/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/data/operations/documents.js +51 -23
- package/dist-esm/src/generated/data/operations/documents.js.map +1 -1
- package/dist-esm/src/generated/data/searchClient.js +5 -33
- package/dist-esm/src/generated/data/searchClient.js.map +1 -1
- package/dist-esm/src/generated/data/searchClientContext.js +11 -13
- package/dist-esm/src/generated/data/searchClientContext.js.map +1 -1
- package/dist-esm/src/generated/service/index.js +1 -1
- package/dist-esm/src/generated/service/index.js.map +1 -1
- package/dist-esm/src/generated/service/models/index.js +1 -904
- package/dist-esm/src/generated/service/models/index.js.map +1 -1
- package/dist-esm/src/generated/service/models/mappers.js +16 -741
- package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/service/models/parameters.js +1 -51
- package/dist-esm/src/generated/service/models/parameters.js.map +1 -1
- package/dist-esm/src/generated/service/operations/dataSources.js +30 -13
- package/dist-esm/src/generated/service/operations/dataSources.js.map +1 -1
- package/dist-esm/src/generated/service/operations/index.js +0 -1
- package/dist-esm/src/generated/service/operations/index.js.map +1 -1
- package/dist-esm/src/generated/service/operations/indexers.js +45 -45
- package/dist-esm/src/generated/service/operations/indexers.js.map +1 -1
- package/dist-esm/src/generated/service/operations/indexes.js +40 -11
- package/dist-esm/src/generated/service/operations/indexes.js.map +1 -1
- package/dist-esm/src/generated/service/operations/skillsets.js +30 -43
- package/dist-esm/src/generated/service/operations/skillsets.js.map +1 -1
- package/dist-esm/src/generated/service/operations/synonymMaps.js +29 -9
- package/dist-esm/src/generated/service/operations/synonymMaps.js.map +1 -1
- package/dist-esm/src/generated/service/searchServiceClient.js +15 -37
- package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
- package/dist-esm/src/generated/service/searchServiceClientContext.js +11 -13
- package/dist-esm/src/generated/service/searchServiceClientContext.js.map +1 -1
- package/dist-esm/src/geographyPoint.js +1 -1
- package/dist-esm/src/geographyPoint.js.map +1 -1
- package/dist-esm/src/index.js +2 -4
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/indexDocumentsBatch.js +1 -1
- package/dist-esm/src/indexDocumentsBatch.js.map +1 -1
- package/dist-esm/src/indexModels.js.map +1 -1
- package/dist-esm/src/odataMetadataPolicy.js +15 -7
- package/dist-esm/src/odataMetadataPolicy.js.map +1 -1
- package/dist-esm/src/searchApiKeyCredentialPolicy.js +21 -8
- package/dist-esm/src/searchApiKeyCredentialPolicy.js.map +1 -1
- package/dist-esm/src/searchAudience.js.map +1 -1
- package/dist-esm/src/searchClient.js +67 -91
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +74 -236
- package/dist-esm/src/searchIndexClient.js.map +1 -1
- package/dist-esm/src/searchIndexerClient.js +86 -143
- package/dist-esm/src/searchIndexerClient.js.map +1 -1
- package/dist-esm/src/searchIndexingBufferedSender.js +17 -16
- package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
- package/dist-esm/src/serialization.js +5 -5
- package/dist-esm/src/serialization.js.map +1 -1
- package/dist-esm/src/serviceModels.js.map +1 -1
- package/dist-esm/src/serviceUtils.js +31 -68
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/dist-esm/src/synonymMapHelper.js +2 -6
- package/dist-esm/src/synonymMapHelper.js.map +1 -1
- package/dist-esm/src/tracing.js +5 -6
- package/dist-esm/src/tracing.js.map +1 -1
- package/package.json +44 -45
- package/types/search-documents.d.ts +162 -1150
- package/dist-esm/src/generated/data/operationsInterfaces/documents.js +0 -9
- package/dist-esm/src/generated/data/operationsInterfaces/documents.js.map +0 -1
- package/dist-esm/src/generated/data/operationsInterfaces/index.js +0 -9
- package/dist-esm/src/generated/data/operationsInterfaces/index.js.map +0 -1
- package/dist-esm/src/generated/service/operations/aliases.js +0 -166
- package/dist-esm/src/generated/service/operations/aliases.js.map +0 -1
- package/dist-esm/src/generated/service/operationsInterfaces/aliases.js +0 -9
- package/dist-esm/src/generated/service/operationsInterfaces/aliases.js.map +0 -1
- package/dist-esm/src/generated/service/operationsInterfaces/dataSources.js +0 -9
- package/dist-esm/src/generated/service/operationsInterfaces/dataSources.js.map +0 -1
- package/dist-esm/src/generated/service/operationsInterfaces/index.js +0 -14
- package/dist-esm/src/generated/service/operationsInterfaces/index.js.map +0 -1
- package/dist-esm/src/generated/service/operationsInterfaces/indexers.js +0 -9
- package/dist-esm/src/generated/service/operationsInterfaces/indexers.js.map +0 -1
- package/dist-esm/src/generated/service/operationsInterfaces/indexes.js +0 -9
- package/dist-esm/src/generated/service/operationsInterfaces/indexes.js.map +0 -1
- package/dist-esm/src/generated/service/operationsInterfaces/skillsets.js +0 -9
- package/dist-esm/src/generated/service/operationsInterfaces/skillsets.js.map +0 -1
- package/dist-esm/src/generated/service/operationsInterfaces/synonymMaps.js +0 -9
- package/dist-esm/src/generated/service/operationsInterfaces/synonymMaps.js.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
import { isTokenCredential } from "@azure/core-auth";
|
|
4
|
-
import { bearerTokenAuthenticationPolicy } from "@azure/core-
|
|
4
|
+
import { createPipelineFromOptions, operationOptionsToRequestOptionsBase, bearerTokenAuthenticationPolicy } from "@azure/core-http";
|
|
5
|
+
import { SpanStatusCode } from "@azure/core-tracing";
|
|
5
6
|
import { SDK_VERSION } from "./constants";
|
|
6
7
|
import { SearchServiceClient as GeneratedClient } from "./generated/service/searchServiceClient";
|
|
7
8
|
import { logger } from "./logger";
|
|
8
9
|
import { createSearchApiKeyCredentialPolicy } from "./searchApiKeyCredentialPolicy";
|
|
9
10
|
import * as utils from "./serviceUtils";
|
|
10
11
|
import { createSpan } from "./tracing";
|
|
11
|
-
import {
|
|
12
|
+
import { odataMetadataPolicy } from "./odataMetadataPolicy";
|
|
12
13
|
import { KnownSearchAudience } from "./searchAudience";
|
|
13
14
|
/**
|
|
14
15
|
* Class to perform operations to manage
|
|
@@ -36,12 +37,7 @@ export class SearchIndexerClient {
|
|
|
36
37
|
/**
|
|
37
38
|
* The API version to use when communicating with the service.
|
|
38
39
|
*/
|
|
39
|
-
this.
|
|
40
|
-
/**
|
|
41
|
-
* The API version to use when communicating with the service.
|
|
42
|
-
* @deprecated use {@Link serviceVersion} instead
|
|
43
|
-
*/
|
|
44
|
-
this.apiVersion = utils.defaultServiceVersion;
|
|
40
|
+
this.apiVersion = "2020-06-30";
|
|
45
41
|
this.endpoint = endpoint;
|
|
46
42
|
const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
|
|
47
43
|
if (!options.userAgentOptions) {
|
|
@@ -53,44 +49,37 @@ export class SearchIndexerClient {
|
|
|
53
49
|
else {
|
|
54
50
|
options.userAgentOptions.userAgentPrefix = libInfo;
|
|
55
51
|
}
|
|
56
|
-
const
|
|
52
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
57
53
|
loggingOptions: {
|
|
58
54
|
logger: logger.info,
|
|
59
|
-
|
|
55
|
+
allowedHeaderNames: [
|
|
60
56
|
"elapsed-time",
|
|
61
57
|
"Location",
|
|
62
58
|
"OData-MaxVersion",
|
|
63
59
|
"OData-Version",
|
|
64
60
|
"Prefer",
|
|
65
|
-
"throttle-reason"
|
|
66
|
-
]
|
|
67
|
-
}
|
|
61
|
+
"throttle-reason"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
68
64
|
});
|
|
65
|
+
const scope = options.audience
|
|
66
|
+
? `${options.audience}/.default`
|
|
67
|
+
: `${KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
68
|
+
const requestPolicyFactory = isTokenCredential(credential)
|
|
69
|
+
? bearerTokenAuthenticationPolicy(credential, scope)
|
|
70
|
+
: createSearchApiKeyCredentialPolicy(credential);
|
|
71
|
+
const pipeline = createPipelineFromOptions(internalPipelineOptions, requestPolicyFactory);
|
|
72
|
+
if (Array.isArray(pipeline.requestPolicyFactories)) {
|
|
73
|
+
pipeline.requestPolicyFactories.unshift(odataMetadataPolicy("minimal"));
|
|
74
|
+
}
|
|
75
|
+
let apiVersion = this.apiVersion;
|
|
69
76
|
if (options.apiVersion) {
|
|
70
|
-
if (!
|
|
77
|
+
if (!["2020-06-30-Preview", "2020-06-30"].includes(options.apiVersion)) {
|
|
71
78
|
throw new Error(`Invalid Api Version: ${options.apiVersion}`);
|
|
72
79
|
}
|
|
73
|
-
|
|
74
|
-
this.apiVersion = options.apiVersion;
|
|
75
|
-
}
|
|
76
|
-
if (options.serviceVersion) {
|
|
77
|
-
if (!utils.serviceVersions.includes(options.serviceVersion)) {
|
|
78
|
-
throw new Error(`Invalid Service Version: ${options.serviceVersion}`);
|
|
79
|
-
}
|
|
80
|
-
this.serviceVersion = options.serviceVersion;
|
|
81
|
-
this.apiVersion = options.serviceVersion;
|
|
82
|
-
}
|
|
83
|
-
this.client = new GeneratedClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
|
|
84
|
-
if (isTokenCredential(credential)) {
|
|
85
|
-
const scope = options.audience
|
|
86
|
-
? `${options.audience}/.default`
|
|
87
|
-
: `${KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
88
|
-
this.client.pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));
|
|
80
|
+
apiVersion = options.apiVersion;
|
|
92
81
|
}
|
|
93
|
-
this.client.pipeline
|
|
82
|
+
this.client = new GeneratedClient(this.endpoint, apiVersion, pipeline);
|
|
94
83
|
}
|
|
95
84
|
/**
|
|
96
85
|
* Retrieves a list of existing indexers in the service.
|
|
@@ -99,13 +88,13 @@ export class SearchIndexerClient {
|
|
|
99
88
|
async listIndexers(options = {}) {
|
|
100
89
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listIndexers", options);
|
|
101
90
|
try {
|
|
102
|
-
const result = await this.client.indexers.list(updatedOptions);
|
|
91
|
+
const result = await this.client.indexers.list(operationOptionsToRequestOptionsBase(updatedOptions));
|
|
103
92
|
return result.indexers.map(utils.generatedSearchIndexerToPublicSearchIndexer);
|
|
104
93
|
}
|
|
105
94
|
catch (e) {
|
|
106
95
|
span.setStatus({
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
code: SpanStatusCode.ERROR,
|
|
97
|
+
message: e.message
|
|
109
98
|
});
|
|
110
99
|
throw e;
|
|
111
100
|
}
|
|
@@ -120,13 +109,13 @@ export class SearchIndexerClient {
|
|
|
120
109
|
async listIndexersNames(options = {}) {
|
|
121
110
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listIndexersNames", options);
|
|
122
111
|
try {
|
|
123
|
-
const result = await this.client.indexers.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
112
|
+
const result = await this.client.indexers.list(Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { select: "name" }));
|
|
124
113
|
return result.indexers.map((idx) => idx.name);
|
|
125
114
|
}
|
|
126
115
|
catch (e) {
|
|
127
116
|
span.setStatus({
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
code: SpanStatusCode.ERROR,
|
|
118
|
+
message: e.message
|
|
130
119
|
});
|
|
131
120
|
throw e;
|
|
132
121
|
}
|
|
@@ -141,13 +130,13 @@ export class SearchIndexerClient {
|
|
|
141
130
|
async listDataSourceConnections(options = {}) {
|
|
142
131
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listDataSourceConnections", options);
|
|
143
132
|
try {
|
|
144
|
-
const result = await this.client.dataSources.list(updatedOptions);
|
|
133
|
+
const result = await this.client.dataSources.list(operationOptionsToRequestOptionsBase(updatedOptions));
|
|
145
134
|
return result.dataSources.map(utils.generatedDataSourceToPublicDataSource);
|
|
146
135
|
}
|
|
147
136
|
catch (e) {
|
|
148
137
|
span.setStatus({
|
|
149
|
-
|
|
150
|
-
|
|
138
|
+
code: SpanStatusCode.ERROR,
|
|
139
|
+
message: e.message
|
|
151
140
|
});
|
|
152
141
|
throw e;
|
|
153
142
|
}
|
|
@@ -162,13 +151,13 @@ export class SearchIndexerClient {
|
|
|
162
151
|
async listDataSourceConnectionsNames(options = {}) {
|
|
163
152
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listDataSourceConnectionsNames", options);
|
|
164
153
|
try {
|
|
165
|
-
const result = await this.client.dataSources.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
154
|
+
const result = await this.client.dataSources.list(Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { select: "name" }));
|
|
166
155
|
return result.dataSources.map((ds) => ds.name);
|
|
167
156
|
}
|
|
168
157
|
catch (e) {
|
|
169
158
|
span.setStatus({
|
|
170
|
-
|
|
171
|
-
|
|
159
|
+
code: SpanStatusCode.ERROR,
|
|
160
|
+
message: e.message
|
|
172
161
|
});
|
|
173
162
|
throw e;
|
|
174
163
|
}
|
|
@@ -183,13 +172,13 @@ export class SearchIndexerClient {
|
|
|
183
172
|
async listSkillsets(options = {}) {
|
|
184
173
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listSkillsets", options);
|
|
185
174
|
try {
|
|
186
|
-
const result = await this.client.skillsets.list(updatedOptions);
|
|
175
|
+
const result = await this.client.skillsets.list(operationOptionsToRequestOptionsBase(updatedOptions));
|
|
187
176
|
return result.skillsets.map(utils.generatedSkillsetToPublicSkillset);
|
|
188
177
|
}
|
|
189
178
|
catch (e) {
|
|
190
179
|
span.setStatus({
|
|
191
|
-
|
|
192
|
-
|
|
180
|
+
code: SpanStatusCode.ERROR,
|
|
181
|
+
message: e.message
|
|
193
182
|
});
|
|
194
183
|
throw e;
|
|
195
184
|
}
|
|
@@ -204,13 +193,13 @@ export class SearchIndexerClient {
|
|
|
204
193
|
async listSkillsetsNames(options = {}) {
|
|
205
194
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-listSkillsetsNames", options);
|
|
206
195
|
try {
|
|
207
|
-
const result = await this.client.skillsets.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
196
|
+
const result = await this.client.skillsets.list(Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { select: "name" }));
|
|
208
197
|
return result.skillsets.map((sks) => sks.name);
|
|
209
198
|
}
|
|
210
199
|
catch (e) {
|
|
211
200
|
span.setStatus({
|
|
212
|
-
|
|
213
|
-
|
|
201
|
+
code: SpanStatusCode.ERROR,
|
|
202
|
+
message: e.message
|
|
214
203
|
});
|
|
215
204
|
throw e;
|
|
216
205
|
}
|
|
@@ -226,13 +215,13 @@ export class SearchIndexerClient {
|
|
|
226
215
|
async getIndexer(indexerName, options = {}) {
|
|
227
216
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getIndexer", options);
|
|
228
217
|
try {
|
|
229
|
-
const result = await this.client.indexers.get(indexerName, updatedOptions);
|
|
218
|
+
const result = await this.client.indexers.get(indexerName, operationOptionsToRequestOptionsBase(updatedOptions));
|
|
230
219
|
return utils.generatedSearchIndexerToPublicSearchIndexer(result);
|
|
231
220
|
}
|
|
232
221
|
catch (e) {
|
|
233
222
|
span.setStatus({
|
|
234
|
-
|
|
235
|
-
|
|
223
|
+
code: SpanStatusCode.ERROR,
|
|
224
|
+
message: e.message
|
|
236
225
|
});
|
|
237
226
|
throw e;
|
|
238
227
|
}
|
|
@@ -248,13 +237,13 @@ export class SearchIndexerClient {
|
|
|
248
237
|
async getDataSourceConnection(dataSourceConnectionName, options = {}) {
|
|
249
238
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getDataSourceConnection", options);
|
|
250
239
|
try {
|
|
251
|
-
const result = await this.client.dataSources.get(dataSourceConnectionName, updatedOptions);
|
|
240
|
+
const result = await this.client.dataSources.get(dataSourceConnectionName, operationOptionsToRequestOptionsBase(updatedOptions));
|
|
252
241
|
return utils.generatedDataSourceToPublicDataSource(result);
|
|
253
242
|
}
|
|
254
243
|
catch (e) {
|
|
255
244
|
span.setStatus({
|
|
256
|
-
|
|
257
|
-
|
|
245
|
+
code: SpanStatusCode.ERROR,
|
|
246
|
+
message: e.message
|
|
258
247
|
});
|
|
259
248
|
throw e;
|
|
260
249
|
}
|
|
@@ -270,13 +259,13 @@ export class SearchIndexerClient {
|
|
|
270
259
|
async getSkillset(skillsetName, options = {}) {
|
|
271
260
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getSkillset", options);
|
|
272
261
|
try {
|
|
273
|
-
const result = await this.client.skillsets.get(skillsetName, updatedOptions);
|
|
262
|
+
const result = await this.client.skillsets.get(skillsetName, operationOptionsToRequestOptionsBase(updatedOptions));
|
|
274
263
|
return utils.generatedSkillsetToPublicSkillset(result);
|
|
275
264
|
}
|
|
276
265
|
catch (e) {
|
|
277
266
|
span.setStatus({
|
|
278
|
-
|
|
279
|
-
|
|
267
|
+
code: SpanStatusCode.ERROR,
|
|
268
|
+
message: e.message
|
|
280
269
|
});
|
|
281
270
|
throw e;
|
|
282
271
|
}
|
|
@@ -292,13 +281,13 @@ export class SearchIndexerClient {
|
|
|
292
281
|
async createIndexer(indexer, options = {}) {
|
|
293
282
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createIndexer", options);
|
|
294
283
|
try {
|
|
295
|
-
const result = await this.client.indexers.create(utils.publicSearchIndexerToGeneratedSearchIndexer(indexer), updatedOptions);
|
|
284
|
+
const result = await this.client.indexers.create(utils.publicSearchIndexerToGeneratedSearchIndexer(indexer), operationOptionsToRequestOptionsBase(updatedOptions));
|
|
296
285
|
return utils.generatedSearchIndexerToPublicSearchIndexer(result);
|
|
297
286
|
}
|
|
298
287
|
catch (e) {
|
|
299
288
|
span.setStatus({
|
|
300
|
-
|
|
301
|
-
|
|
289
|
+
code: SpanStatusCode.ERROR,
|
|
290
|
+
message: e.message
|
|
302
291
|
});
|
|
303
292
|
throw e;
|
|
304
293
|
}
|
|
@@ -314,13 +303,13 @@ export class SearchIndexerClient {
|
|
|
314
303
|
async createDataSourceConnection(dataSourceConnection, options = {}) {
|
|
315
304
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createDataSourceConnection", options);
|
|
316
305
|
try {
|
|
317
|
-
const result = await this.client.dataSources.create(utils.publicDataSourceToGeneratedDataSource(dataSourceConnection), updatedOptions);
|
|
306
|
+
const result = await this.client.dataSources.create(utils.publicDataSourceToGeneratedDataSource(dataSourceConnection), operationOptionsToRequestOptionsBase(updatedOptions));
|
|
318
307
|
return utils.generatedDataSourceToPublicDataSource(result);
|
|
319
308
|
}
|
|
320
309
|
catch (e) {
|
|
321
310
|
span.setStatus({
|
|
322
|
-
|
|
323
|
-
|
|
311
|
+
code: SpanStatusCode.ERROR,
|
|
312
|
+
message: e.message
|
|
324
313
|
});
|
|
325
314
|
throw e;
|
|
326
315
|
}
|
|
@@ -336,13 +325,13 @@ export class SearchIndexerClient {
|
|
|
336
325
|
async createSkillset(skillset, options = {}) {
|
|
337
326
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createSkillset", options);
|
|
338
327
|
try {
|
|
339
|
-
const result = await this.client.skillsets.create(utils.publicSkillsetToGeneratedSkillset(skillset), updatedOptions);
|
|
328
|
+
const result = await this.client.skillsets.create(utils.publicSkillsetToGeneratedSkillset(skillset), operationOptionsToRequestOptionsBase(updatedOptions));
|
|
340
329
|
return utils.generatedSkillsetToPublicSkillset(result);
|
|
341
330
|
}
|
|
342
331
|
catch (e) {
|
|
343
332
|
span.setStatus({
|
|
344
|
-
|
|
345
|
-
|
|
333
|
+
code: SpanStatusCode.ERROR,
|
|
334
|
+
message: e.message
|
|
346
335
|
});
|
|
347
336
|
throw e;
|
|
348
337
|
}
|
|
@@ -359,13 +348,13 @@ export class SearchIndexerClient {
|
|
|
359
348
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createOrUpdateIndexer", options);
|
|
360
349
|
try {
|
|
361
350
|
const etag = options.onlyIfUnchanged ? indexer.etag : undefined;
|
|
362
|
-
const result = await this.client.indexers.createOrUpdate(indexer.name, utils.publicSearchIndexerToGeneratedSearchIndexer(indexer), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag
|
|
351
|
+
const result = await this.client.indexers.createOrUpdate(indexer.name, utils.publicSearchIndexerToGeneratedSearchIndexer(indexer), Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { ifMatch: etag }));
|
|
363
352
|
return utils.generatedSearchIndexerToPublicSearchIndexer(result);
|
|
364
353
|
}
|
|
365
354
|
catch (e) {
|
|
366
355
|
span.setStatus({
|
|
367
|
-
|
|
368
|
-
|
|
356
|
+
code: SpanStatusCode.ERROR,
|
|
357
|
+
message: e.message
|
|
369
358
|
});
|
|
370
359
|
throw e;
|
|
371
360
|
}
|
|
@@ -382,13 +371,13 @@ export class SearchIndexerClient {
|
|
|
382
371
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createOrUpdateDataSourceConnection", options);
|
|
383
372
|
try {
|
|
384
373
|
const etag = options.onlyIfUnchanged ? dataSourceConnection.etag : undefined;
|
|
385
|
-
const result = await this.client.dataSources.createOrUpdate(dataSourceConnection.name, utils.publicDataSourceToGeneratedDataSource(dataSourceConnection), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag
|
|
374
|
+
const result = await this.client.dataSources.createOrUpdate(dataSourceConnection.name, utils.publicDataSourceToGeneratedDataSource(dataSourceConnection), Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { ifMatch: etag }));
|
|
386
375
|
return utils.generatedDataSourceToPublicDataSource(result);
|
|
387
376
|
}
|
|
388
377
|
catch (e) {
|
|
389
378
|
span.setStatus({
|
|
390
|
-
|
|
391
|
-
|
|
379
|
+
code: SpanStatusCode.ERROR,
|
|
380
|
+
message: e.message
|
|
392
381
|
});
|
|
393
382
|
throw e;
|
|
394
383
|
}
|
|
@@ -405,13 +394,13 @@ export class SearchIndexerClient {
|
|
|
405
394
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createOrUpdateSkillset", options);
|
|
406
395
|
try {
|
|
407
396
|
const etag = options.onlyIfUnchanged ? skillset.etag : undefined;
|
|
408
|
-
const result = await this.client.skillsets.createOrUpdate(skillset.name, utils.publicSkillsetToGeneratedSkillset(skillset), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag
|
|
397
|
+
const result = await this.client.skillsets.createOrUpdate(skillset.name, utils.publicSkillsetToGeneratedSkillset(skillset), Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { ifMatch: etag }));
|
|
409
398
|
return utils.generatedSkillsetToPublicSkillset(result);
|
|
410
399
|
}
|
|
411
400
|
catch (e) {
|
|
412
401
|
span.setStatus({
|
|
413
|
-
|
|
414
|
-
|
|
402
|
+
code: SpanStatusCode.ERROR,
|
|
403
|
+
message: e.message
|
|
415
404
|
});
|
|
416
405
|
throw e;
|
|
417
406
|
}
|
|
@@ -433,12 +422,12 @@ export class SearchIndexerClient {
|
|
|
433
422
|
: options.onlyIfUnchanged
|
|
434
423
|
? indexer.etag
|
|
435
424
|
: undefined;
|
|
436
|
-
await this.client.indexers.delete(indexerName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
425
|
+
await this.client.indexers.delete(indexerName, Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { ifMatch: etag }));
|
|
437
426
|
}
|
|
438
427
|
catch (e) {
|
|
439
428
|
span.setStatus({
|
|
440
|
-
|
|
441
|
-
|
|
429
|
+
code: SpanStatusCode.ERROR,
|
|
430
|
+
message: e.message
|
|
442
431
|
});
|
|
443
432
|
throw e;
|
|
444
433
|
}
|
|
@@ -460,12 +449,12 @@ export class SearchIndexerClient {
|
|
|
460
449
|
: options.onlyIfUnchanged
|
|
461
450
|
? dataSourceConnection.etag
|
|
462
451
|
: undefined;
|
|
463
|
-
await this.client.dataSources.delete(dataSourceConnectionName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
452
|
+
await this.client.dataSources.delete(dataSourceConnectionName, Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { ifMatch: etag }));
|
|
464
453
|
}
|
|
465
454
|
catch (e) {
|
|
466
455
|
span.setStatus({
|
|
467
|
-
|
|
468
|
-
|
|
456
|
+
code: SpanStatusCode.ERROR,
|
|
457
|
+
message: e.message
|
|
469
458
|
});
|
|
470
459
|
throw e;
|
|
471
460
|
}
|
|
@@ -487,12 +476,12 @@ export class SearchIndexerClient {
|
|
|
487
476
|
: options.onlyIfUnchanged
|
|
488
477
|
? skillset.etag
|
|
489
478
|
: undefined;
|
|
490
|
-
await this.client.skillsets.delete(skillsetName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
479
|
+
await this.client.skillsets.delete(skillsetName, Object.assign(Object.assign({}, operationOptionsToRequestOptionsBase(updatedOptions)), { ifMatch: etag }));
|
|
491
480
|
}
|
|
492
481
|
catch (e) {
|
|
493
482
|
span.setStatus({
|
|
494
|
-
|
|
495
|
-
|
|
483
|
+
code: SpanStatusCode.ERROR,
|
|
484
|
+
message: e.message
|
|
496
485
|
});
|
|
497
486
|
throw e;
|
|
498
487
|
}
|
|
@@ -508,13 +497,13 @@ export class SearchIndexerClient {
|
|
|
508
497
|
async getIndexerStatus(indexerName, options = {}) {
|
|
509
498
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-getIndexerStatus", options);
|
|
510
499
|
try {
|
|
511
|
-
const result = await this.client.indexers.getStatus(indexerName, updatedOptions);
|
|
500
|
+
const result = await this.client.indexers.getStatus(indexerName, operationOptionsToRequestOptionsBase(updatedOptions));
|
|
512
501
|
return result;
|
|
513
502
|
}
|
|
514
503
|
catch (e) {
|
|
515
504
|
span.setStatus({
|
|
516
|
-
|
|
517
|
-
|
|
505
|
+
code: SpanStatusCode.ERROR,
|
|
506
|
+
message: e.message
|
|
518
507
|
});
|
|
519
508
|
throw e;
|
|
520
509
|
}
|
|
@@ -530,12 +519,12 @@ export class SearchIndexerClient {
|
|
|
530
519
|
async resetIndexer(indexerName, options = {}) {
|
|
531
520
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-resetIndexer", options);
|
|
532
521
|
try {
|
|
533
|
-
await this.client.indexers.reset(indexerName, updatedOptions);
|
|
522
|
+
await this.client.indexers.reset(indexerName, operationOptionsToRequestOptionsBase(updatedOptions));
|
|
534
523
|
}
|
|
535
524
|
catch (e) {
|
|
536
525
|
span.setStatus({
|
|
537
|
-
|
|
538
|
-
|
|
526
|
+
code: SpanStatusCode.ERROR,
|
|
527
|
+
message: e.message
|
|
539
528
|
});
|
|
540
529
|
throw e;
|
|
541
530
|
}
|
|
@@ -551,58 +540,12 @@ export class SearchIndexerClient {
|
|
|
551
540
|
async runIndexer(indexerName, options = {}) {
|
|
552
541
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-runIndexer", options);
|
|
553
542
|
try {
|
|
554
|
-
await this.client.indexers.run(indexerName, updatedOptions);
|
|
555
|
-
}
|
|
556
|
-
catch (e) {
|
|
557
|
-
span.setStatus({
|
|
558
|
-
status: "error",
|
|
559
|
-
error: e.message,
|
|
560
|
-
});
|
|
561
|
-
throw e;
|
|
562
|
-
}
|
|
563
|
-
finally {
|
|
564
|
-
span.end();
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* Resets specific documents in the datasource to be selectively re-ingested by the indexer.
|
|
569
|
-
* @param indexerName - The name of the indexer to reset documents for.
|
|
570
|
-
* @param options - Additional optional arguments.
|
|
571
|
-
*/
|
|
572
|
-
async resetDocuments(indexerName, options = {}) {
|
|
573
|
-
const { span, updatedOptions } = createSpan("SearchIndexerClient-resetDocs", options);
|
|
574
|
-
try {
|
|
575
|
-
await this.client.indexers.resetDocs(indexerName, Object.assign(Object.assign({}, updatedOptions), { keysOrIds: {
|
|
576
|
-
documentKeys: updatedOptions.documentKeys,
|
|
577
|
-
datasourceDocumentIds: updatedOptions.datasourceDocumentIds,
|
|
578
|
-
} }));
|
|
579
|
-
}
|
|
580
|
-
catch (e) {
|
|
581
|
-
span.setStatus({
|
|
582
|
-
status: "error",
|
|
583
|
-
error: e.message,
|
|
584
|
-
});
|
|
585
|
-
throw e;
|
|
586
|
-
}
|
|
587
|
-
finally {
|
|
588
|
-
span.end();
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
/**
|
|
592
|
-
* Reset an existing skillset in a search service.
|
|
593
|
-
* @param skillsetName - The name of the skillset to reset.
|
|
594
|
-
* @param skillNames - The names of skills to reset.
|
|
595
|
-
* @param options - The options parameters.
|
|
596
|
-
*/
|
|
597
|
-
async resetSkills(skillsetName, options = {}) {
|
|
598
|
-
const { span, updatedOptions } = createSpan("SearchIndexerClient-resetSkills", options);
|
|
599
|
-
try {
|
|
600
|
-
await this.client.skillsets.resetSkills(skillsetName, { skillNames: options.skillNames }, updatedOptions);
|
|
543
|
+
await this.client.indexers.run(indexerName, operationOptionsToRequestOptionsBase(updatedOptions));
|
|
601
544
|
}
|
|
602
545
|
catch (e) {
|
|
603
546
|
span.setStatus({
|
|
604
|
-
|
|
605
|
-
|
|
547
|
+
code: SpanStatusCode.ERROR,
|
|
548
|
+
message: e.message
|
|
606
549
|
});
|
|
607
550
|
throw e;
|
|
608
551
|
}
|