@azure/search-documents 12.0.0-alpha.20230320.1 → 12.0.0-alpha.20230418.2

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/dist/index.js CHANGED
@@ -1734,7 +1734,7 @@ class SearchClient$1 extends coreHttpCompat__namespace.ExtendedServiceClient {
1734
1734
  const defaults = {
1735
1735
  requestContentType: "application/json; charset=utf-8"
1736
1736
  };
1737
- const packageDetails = `azsdk-js-search-documents/11.3.0-beta.8`;
1737
+ const packageDetails = `azsdk-js-search-documents/12.0.0-beta.1`;
1738
1738
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1739
1739
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1740
1740
  : `${packageDetails}`;
@@ -3216,7 +3216,6 @@ function getRandomIntegerInclusive(min, max) {
3216
3216
  function delay(timeInMs) {
3217
3217
  return new Promise((resolve) => setTimeout(() => resolve(), timeInMs));
3218
3218
  }
3219
- const serviceVersions = ["2020-06-30", "2021-04-30-Preview"];
3220
3219
  const defaultServiceVersion = "2021-04-30-Preview";
3221
3220
 
3222
3221
  // Copyright (c) Microsoft Corporation.
@@ -3285,6 +3284,7 @@ class SearchClient {
3285
3284
  * non-nullable type `string`.
3286
3285
  */
3287
3286
  constructor(endpoint, indexName, credential, options = {}) {
3287
+ var _a, _b;
3288
3288
  /// Maintenance note: when updating supported API versions,
3289
3289
  /// the ContinuationToken logic will need to be updated below.
3290
3290
  /**
@@ -3321,20 +3321,9 @@ class SearchClient {
3321
3321
  ],
3322
3322
  },
3323
3323
  });
3324
- if (options.apiVersion) {
3325
- if (!serviceVersions.includes(options.apiVersion)) {
3326
- throw new Error(`Invalid Api Version: ${options.apiVersion}`);
3327
- }
3328
- this.serviceVersion = options.apiVersion;
3329
- this.apiVersion = options.apiVersion;
3330
- }
3331
- if (options.serviceVersion) {
3332
- if (!serviceVersions.includes(options.serviceVersion)) {
3333
- throw new Error(`Invalid Service Version: ${options.serviceVersion}`);
3334
- }
3335
- this.serviceVersion = options.serviceVersion;
3336
- this.apiVersion = options.serviceVersion;
3337
- }
3324
+ this.serviceVersion =
3325
+ (_b = (_a = options.serviceVersion) !== null && _a !== void 0 ? _a : options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
3326
+ this.apiVersion = this.serviceVersion;
3338
3327
  this.client = new SearchClient$1(this.endpoint, this.indexName, this.serviceVersion, internalClientPipelineOptions);
3339
3328
  if (coreAuth.isTokenCredential(credential)) {
3340
3329
  const scope = options.audience
@@ -3480,21 +3469,28 @@ class SearchClient {
3480
3469
  }
3481
3470
  listSearchResultsAll(firstPage, searchText, options = {}) {
3482
3471
  return tslib.__asyncGenerator(this, arguments, function* listSearchResultsAll_1() {
3483
- var e_1, _a;
3472
+ var _a, e_1, _b, _c;
3484
3473
  yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(firstPage.results)));
3485
3474
  if (firstPage.continuationToken) {
3486
3475
  try {
3487
- for (var _b = tslib.__asyncValues(this.listSearchResultsPage(searchText, options, {
3476
+ for (var _d = true, _e = tslib.__asyncValues(this.listSearchResultsPage(searchText, options, {
3488
3477
  continuationToken: firstPage.continuationToken,
3489
- })), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
3490
- const page = _c.value;
3491
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page.results)));
3478
+ })), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
3479
+ _c = _f.value;
3480
+ _d = false;
3481
+ try {
3482
+ const page = _c;
3483
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page.results)));
3484
+ }
3485
+ finally {
3486
+ _d = true;
3487
+ }
3492
3488
  }
3493
3489
  }
3494
3490
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
3495
3491
  finally {
3496
3492
  try {
3497
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
3493
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
3498
3494
  }
3499
3495
  finally { if (e_1) throw e_1.error; }
3500
3496
  }
@@ -10780,7 +10776,7 @@ class SearchServiceClient extends coreHttpCompat__namespace.ExtendedServiceClien
10780
10776
  const defaults = {
10781
10777
  requestContentType: "application/json; charset=utf-8"
10782
10778
  };
10783
- const packageDetails = `azsdk-js-search-documents/11.3.0-beta.8`;
10779
+ const packageDetails = `azsdk-js-search-documents/12.0.0-beta.1`;
10784
10780
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
10785
10781
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
10786
10782
  : `${packageDetails}`;
@@ -10849,6 +10845,7 @@ class SearchIndexClient {
10849
10845
  * @param options - Used to configure the Search Index client.
10850
10846
  */
10851
10847
  constructor(endpoint, credential, options = {}) {
10848
+ var _a, _b;
10852
10849
  /**
10853
10850
  * The API version to use when communicating with the service.
10854
10851
  */
@@ -10884,20 +10881,9 @@ class SearchIndexClient {
10884
10881
  ],
10885
10882
  },
10886
10883
  });
10887
- if (options.apiVersion) {
10888
- if (!serviceVersions.includes(options.apiVersion)) {
10889
- throw new Error(`Invalid Api Version: ${options.apiVersion}`);
10890
- }
10891
- this.serviceVersion = options.apiVersion;
10892
- this.apiVersion = options.apiVersion;
10893
- }
10894
- if (options.serviceVersion) {
10895
- if (!serviceVersions.includes(options.serviceVersion)) {
10896
- throw new Error(`Invalid Service Version: ${options.serviceVersion}`);
10897
- }
10898
- this.serviceVersion = options.serviceVersion;
10899
- this.apiVersion = options.serviceVersion;
10900
- }
10884
+ this.serviceVersion =
10885
+ (_b = (_a = options.serviceVersion) !== null && _a !== void 0 ? _a : options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
10886
+ this.apiVersion = this.serviceVersion;
10901
10887
  this.client = new SearchServiceClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
10902
10888
  if (coreAuth.isTokenCredential(credential)) {
10903
10889
  const scope = options.audience
@@ -10932,17 +10918,24 @@ class SearchIndexClient {
10932
10918
  }
10933
10919
  listIndexesAll(options = {}) {
10934
10920
  return tslib.__asyncGenerator(this, arguments, function* listIndexesAll_1() {
10935
- var e_1, _a;
10921
+ var _a, e_1, _b, _c;
10936
10922
  try {
10937
- for (var _b = tslib.__asyncValues(this.listIndexesPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
10938
- const page = _c.value;
10939
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
10923
+ for (var _d = true, _e = tslib.__asyncValues(this.listIndexesPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
10924
+ _c = _f.value;
10925
+ _d = false;
10926
+ try {
10927
+ const page = _c;
10928
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
10929
+ }
10930
+ finally {
10931
+ _d = true;
10932
+ }
10940
10933
  }
10941
10934
  }
10942
10935
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
10943
10936
  finally {
10944
10937
  try {
10945
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
10938
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
10946
10939
  }
10947
10940
  finally { if (e_1) throw e_1.error; }
10948
10941
  }
@@ -10987,17 +10980,24 @@ class SearchIndexClient {
10987
10980
  }
10988
10981
  listAliasesAll(options = {}) {
10989
10982
  return tslib.__asyncGenerator(this, arguments, function* listAliasesAll_1() {
10990
- var e_2, _a;
10983
+ var _a, e_2, _b, _c;
10991
10984
  try {
10992
- for (var _b = tslib.__asyncValues(this.listAliasesPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
10993
- const page = _c.value;
10994
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
10985
+ for (var _d = true, _e = tslib.__asyncValues(this.listAliasesPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
10986
+ _c = _f.value;
10987
+ _d = false;
10988
+ try {
10989
+ const page = _c;
10990
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
10991
+ }
10992
+ finally {
10993
+ _d = true;
10994
+ }
10995
10995
  }
10996
10996
  }
10997
10997
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
10998
10998
  finally {
10999
10999
  try {
11000
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
11000
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
11001
11001
  }
11002
11002
  finally { if (e_2) throw e_2.error; }
11003
11003
  }
@@ -11043,17 +11043,24 @@ class SearchIndexClient {
11043
11043
  }
11044
11044
  listIndexesNamesAll(options = {}) {
11045
11045
  return tslib.__asyncGenerator(this, arguments, function* listIndexesNamesAll_1() {
11046
- var e_3, _a;
11046
+ var _a, e_3, _b, _c;
11047
11047
  try {
11048
- for (var _b = tslib.__asyncValues(this.listIndexesNamesPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
11049
- const page = _c.value;
11050
- yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
11048
+ for (var _d = true, _e = tslib.__asyncValues(this.listIndexesNamesPage(options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a;) {
11049
+ _c = _f.value;
11050
+ _d = false;
11051
+ try {
11052
+ const page = _c;
11053
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
11054
+ }
11055
+ finally {
11056
+ _d = true;
11057
+ }
11051
11058
  }
11052
11059
  }
11053
11060
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
11054
11061
  finally {
11055
11062
  try {
11056
- if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
11063
+ if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
11057
11064
  }
11058
11065
  finally { if (e_3) throw e_3.error; }
11059
11066
  }
@@ -11505,6 +11512,7 @@ class SearchIndexerClient {
11505
11512
  * @param options - Used to configure the Search client.
11506
11513
  */
11507
11514
  constructor(endpoint, credential, options = {}) {
11515
+ var _a, _b;
11508
11516
  /**
11509
11517
  * The API version to use when communicating with the service.
11510
11518
  */
@@ -11538,20 +11546,9 @@ class SearchIndexerClient {
11538
11546
  ],
11539
11547
  },
11540
11548
  });
11541
- if (options.apiVersion) {
11542
- if (!serviceVersions.includes(options.apiVersion)) {
11543
- throw new Error(`Invalid Api Version: ${options.apiVersion}`);
11544
- }
11545
- this.serviceVersion = options.apiVersion;
11546
- this.apiVersion = options.apiVersion;
11547
- }
11548
- if (options.serviceVersion) {
11549
- if (!serviceVersions.includes(options.serviceVersion)) {
11550
- throw new Error(`Invalid Service Version: ${options.serviceVersion}`);
11551
- }
11552
- this.serviceVersion = options.serviceVersion;
11553
- this.apiVersion = options.serviceVersion;
11554
- }
11549
+ this.serviceVersion =
11550
+ (_b = (_a = options.serviceVersion) !== null && _a !== void 0 ? _a : options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
11551
+ this.apiVersion = this.serviceVersion;
11555
11552
  this.client = new SearchServiceClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
11556
11553
  if (coreAuth.isTokenCredential(credential)) {
11557
11554
  const scope = options.audience