@azure/search-documents 11.3.0-alpha.20220105.1 → 11.3.0-alpha.20220110.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 +40 -20
- package/dist/index.js.map +1 -1
- package/dist-esm/src/searchClient.js +8 -10
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +15 -5
- package/dist-esm/src/searchIndexClient.js.map +1 -1
- package/dist-esm/src/searchIndexerClient.js +15 -5
- package/dist-esm/src/searchIndexerClient.js.map +1 -1
- package/dist-esm/src/serviceUtils.js +2 -0
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/package.json +2 -1
- package/types/search-documents.d.ts +21 -1
package/dist/index.js
CHANGED
|
@@ -3213,6 +3213,8 @@ function getRandomIntegerInclusive(min, max) {
|
|
|
3213
3213
|
function delay(timeInMs) {
|
|
3214
3214
|
return new Promise((resolve) => setTimeout(() => resolve(), timeInMs));
|
|
3215
3215
|
}
|
|
3216
|
+
const serviceVersions = ["2020-06-30", "2021-04-30-Preview"];
|
|
3217
|
+
const defaultServiceVersion = "2021-04-30-Preview";
|
|
3216
3218
|
|
|
3217
3219
|
// Copyright (c) Microsoft Corporation.
|
|
3218
3220
|
/**
|
|
@@ -3245,7 +3247,12 @@ class SearchClient$1 {
|
|
|
3245
3247
|
/**
|
|
3246
3248
|
* The service version to use when communicating with the service.
|
|
3247
3249
|
*/
|
|
3248
|
-
this.serviceVersion =
|
|
3250
|
+
this.serviceVersion = defaultServiceVersion;
|
|
3251
|
+
/**
|
|
3252
|
+
* The API version to use when communicating with the service.
|
|
3253
|
+
* @deprecated use {@Link serviceVersion} instead
|
|
3254
|
+
*/
|
|
3255
|
+
this.apiVersion = defaultServiceVersion;
|
|
3249
3256
|
this.endpoint = endpoint;
|
|
3250
3257
|
this.indexName = indexName;
|
|
3251
3258
|
const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
|
|
@@ -3272,13 +3279,13 @@ class SearchClient$1 {
|
|
|
3272
3279
|
},
|
|
3273
3280
|
});
|
|
3274
3281
|
if (options.apiVersion) {
|
|
3275
|
-
if (!
|
|
3282
|
+
if (!serviceVersions.includes(options.apiVersion)) {
|
|
3276
3283
|
throw new Error(`Invalid Api Version: ${options.apiVersion}`);
|
|
3277
3284
|
}
|
|
3278
3285
|
this.serviceVersion = options.apiVersion;
|
|
3279
3286
|
}
|
|
3280
3287
|
if (options.serviceVersion) {
|
|
3281
|
-
if (!
|
|
3288
|
+
if (!serviceVersions.includes(options.serviceVersion)) {
|
|
3282
3289
|
throw new Error(`Invalid Service Version: ${options.serviceVersion}`);
|
|
3283
3290
|
}
|
|
3284
3291
|
this.serviceVersion = options.serviceVersion;
|
|
@@ -3292,13 +3299,6 @@ class SearchClient$1 {
|
|
|
3292
3299
|
}
|
|
3293
3300
|
this.client.pipeline.addPolicy(createOdataMetadataPolicy("none"));
|
|
3294
3301
|
}
|
|
3295
|
-
/**
|
|
3296
|
-
* The API version to use when communicating with the service.
|
|
3297
|
-
* @deprecated use {@Link serviceVersion} instead
|
|
3298
|
-
*/
|
|
3299
|
-
get apiVersion() {
|
|
3300
|
-
return this.serviceVersion;
|
|
3301
|
-
}
|
|
3302
3302
|
/**
|
|
3303
3303
|
* Retrieves the number of documents in the index.
|
|
3304
3304
|
* @param options - Options to the count operation.
|
|
@@ -10503,7 +10503,12 @@ class SearchIndexClient {
|
|
|
10503
10503
|
/**
|
|
10504
10504
|
* The API version to use when communicating with the service.
|
|
10505
10505
|
*/
|
|
10506
|
-
this.
|
|
10506
|
+
this.serviceVersion = defaultServiceVersion;
|
|
10507
|
+
/**
|
|
10508
|
+
* The API version to use when communicating with the service.
|
|
10509
|
+
* @deprecated use {@Link serviceVersion} instead
|
|
10510
|
+
*/
|
|
10511
|
+
this.apiVersion = defaultServiceVersion;
|
|
10507
10512
|
this.endpoint = endpoint;
|
|
10508
10513
|
this.credential = credential;
|
|
10509
10514
|
this.options = options;
|
|
@@ -10530,14 +10535,19 @@ class SearchIndexClient {
|
|
|
10530
10535
|
],
|
|
10531
10536
|
},
|
|
10532
10537
|
});
|
|
10533
|
-
let apiVersion = this.apiVersion;
|
|
10534
10538
|
if (options.apiVersion) {
|
|
10535
|
-
if (!
|
|
10539
|
+
if (!serviceVersions.includes(options.apiVersion)) {
|
|
10536
10540
|
throw new Error(`Invalid Api Version: ${options.apiVersion}`);
|
|
10537
10541
|
}
|
|
10538
|
-
|
|
10542
|
+
this.serviceVersion = options.apiVersion;
|
|
10543
|
+
}
|
|
10544
|
+
if (options.serviceVersion) {
|
|
10545
|
+
if (!serviceVersions.includes(options.serviceVersion)) {
|
|
10546
|
+
throw new Error(`Invalid Service Version: ${options.serviceVersion}`);
|
|
10547
|
+
}
|
|
10548
|
+
this.serviceVersion = options.serviceVersion;
|
|
10539
10549
|
}
|
|
10540
|
-
this.client = new SearchServiceClient(this.endpoint,
|
|
10550
|
+
this.client = new SearchServiceClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
|
|
10541
10551
|
if (coreAuth.isTokenCredential(credential)) {
|
|
10542
10552
|
this.client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_SEARCH_SCOPE }));
|
|
10543
10553
|
}
|
|
@@ -10994,7 +11004,12 @@ class SearchIndexerClient {
|
|
|
10994
11004
|
/**
|
|
10995
11005
|
* The API version to use when communicating with the service.
|
|
10996
11006
|
*/
|
|
10997
|
-
this.
|
|
11007
|
+
this.serviceVersion = defaultServiceVersion;
|
|
11008
|
+
/**
|
|
11009
|
+
* The API version to use when communicating with the service.
|
|
11010
|
+
* @deprecated use {@Link serviceVersion} instead
|
|
11011
|
+
*/
|
|
11012
|
+
this.apiVersion = defaultServiceVersion;
|
|
10998
11013
|
this.endpoint = endpoint;
|
|
10999
11014
|
const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;
|
|
11000
11015
|
if (!options.userAgentOptions) {
|
|
@@ -11019,14 +11034,19 @@ class SearchIndexerClient {
|
|
|
11019
11034
|
],
|
|
11020
11035
|
},
|
|
11021
11036
|
});
|
|
11022
|
-
let apiVersion = this.apiVersion;
|
|
11023
11037
|
if (options.apiVersion) {
|
|
11024
|
-
if (!
|
|
11038
|
+
if (!serviceVersions.includes(options.apiVersion)) {
|
|
11025
11039
|
throw new Error(`Invalid Api Version: ${options.apiVersion}`);
|
|
11026
11040
|
}
|
|
11027
|
-
|
|
11041
|
+
this.serviceVersion = options.apiVersion;
|
|
11042
|
+
}
|
|
11043
|
+
if (options.serviceVersion) {
|
|
11044
|
+
if (!serviceVersions.includes(options.serviceVersion)) {
|
|
11045
|
+
throw new Error(`Invalid Service Version: ${options.serviceVersion}`);
|
|
11046
|
+
}
|
|
11047
|
+
this.serviceVersion = options.serviceVersion;
|
|
11028
11048
|
}
|
|
11029
|
-
this.client = new SearchServiceClient(this.endpoint,
|
|
11049
|
+
this.client = new SearchServiceClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
|
|
11030
11050
|
if (coreAuth.isTokenCredential(credential)) {
|
|
11031
11051
|
this.client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ credential, scopes: DEFAULT_SEARCH_SCOPE }));
|
|
11032
11052
|
}
|