@azure/search-documents 11.3.0-beta.2 → 11.3.0-beta.6

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