@azure/search-documents 12.0.0-alpha.20230515.2 → 12.0.0-alpha.20230622.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
@@ -1770,10 +1770,6 @@ function createSearchApiKeyCredentialPolicy(credential) {
1770
1770
  };
1771
1771
  }
1772
1772
 
1773
- // Copyright (c) Microsoft Corporation.
1774
- // Licensed under the MIT license.
1775
- const SDK_VERSION = "12.0.0-beta.2";
1776
-
1777
1773
  // Copyright (c) Microsoft Corporation.
1778
1774
  /**
1779
1775
  * The `@azure/logger` configuration for this package.
@@ -3298,16 +3294,6 @@ class SearchClient {
3298
3294
  this.apiVersion = defaultServiceVersion;
3299
3295
  this.endpoint = endpoint;
3300
3296
  this.indexName = indexName;
3301
- const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
3302
- if (!options.userAgentOptions) {
3303
- options.userAgentOptions = {};
3304
- }
3305
- if (options.userAgentOptions.userAgentPrefix) {
3306
- options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
3307
- }
3308
- else {
3309
- options.userAgentOptions.userAgentPrefix = libInfo;
3310
- }
3311
3297
  const internalClientPipelineOptions = Object.assign(Object.assign({}, options), {
3312
3298
  loggingOptions: {
3313
3299
  logger: logger.info,
@@ -10858,17 +10844,7 @@ class SearchIndexClient {
10858
10844
  this.endpoint = endpoint;
10859
10845
  this.credential = credential;
10860
10846
  this.options = options;
10861
- const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
10862
- if (!options.userAgentOptions) {
10863
- options.userAgentOptions = {};
10864
- }
10865
- if (options.userAgentOptions.userAgentPrefix) {
10866
- options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
10867
- }
10868
- else {
10869
- options.userAgentOptions.userAgentPrefix = libInfo;
10870
- }
10871
- const internalClientPipelineOptions = Object.assign(Object.assign({}, options), {
10847
+ const internalClientPipelineOptions = Object.assign(Object.assign({}, this.options), {
10872
10848
  loggingOptions: {
10873
10849
  logger: logger.info,
10874
10850
  additionalAllowedHeaderNames: [
@@ -10882,12 +10858,12 @@ class SearchIndexClient {
10882
10858
  },
10883
10859
  });
10884
10860
  this.serviceVersion =
10885
- (_b = (_a = options.serviceVersion) !== null && _a !== void 0 ? _a : options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
10861
+ (_b = (_a = this.options.serviceVersion) !== null && _a !== void 0 ? _a : this.options.apiVersion) !== null && _b !== void 0 ? _b : defaultServiceVersion;
10886
10862
  this.apiVersion = this.serviceVersion;
10887
10863
  this.client = new SearchServiceClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
10888
10864
  if (coreAuth.isTokenCredential(credential)) {
10889
- const scope = options.audience
10890
- ? `${options.audience}/.default`
10865
+ const scope = this.options.audience
10866
+ ? `${this.options.audience}/.default`
10891
10867
  : `${exports.KnownSearchAudience.AzurePublicCloud}/.default`;
10892
10868
  this.client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
10893
10869
  }
@@ -11523,16 +11499,6 @@ class SearchIndexerClient {
11523
11499
  */
11524
11500
  this.apiVersion = defaultServiceVersion;
11525
11501
  this.endpoint = endpoint;
11526
- const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
11527
- if (!options.userAgentOptions) {
11528
- options.userAgentOptions = {};
11529
- }
11530
- if (options.userAgentOptions.userAgentPrefix) {
11531
- options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
11532
- }
11533
- else {
11534
- options.userAgentOptions.userAgentPrefix = libInfo;
11535
- }
11536
11502
  const internalClientPipelineOptions = Object.assign(Object.assign({}, options), {
11537
11503
  loggingOptions: {
11538
11504
  logger: logger.info,