@azure/search-documents 11.3.0-alpha.20220517.1 → 11.3.0-alpha.20220815.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/README.md +71 -55
- package/dist/index.js +155 -125
- package/dist/index.js.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/searchAudience.js +21 -0
- package/dist-esm/src/searchAudience.js.map +1 -0
- package/dist-esm/src/searchClient.js +27 -24
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +45 -42
- package/dist-esm/src/searchIndexClient.js.map +1 -1
- package/dist-esm/src/searchIndexerClient.js +51 -48
- package/dist-esm/src/searchIndexerClient.js.map +1 -1
- package/dist-esm/src/searchIndexingBufferedSender.js +10 -11
- package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
- package/dist-esm/src/serviceUtils.js +0 -1
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/dist-esm/src/tracing.js +5 -4
- package/dist-esm/src/tracing.js.map +1 -1
- package/package.json +3 -3
- package/types/search-documents.d.ts +36 -0
|
@@ -4,7 +4,6 @@ import { __asyncDelegator, __asyncGenerator, __asyncValues, __await, __rest } fr
|
|
|
4
4
|
/// <reference lib="esnext.asynciterable" />
|
|
5
5
|
import { isTokenCredential } from "@azure/core-auth";
|
|
6
6
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
7
|
-
import { SpanStatusCode } from "@azure/core-tracing";
|
|
8
7
|
import { SDK_VERSION } from "./constants";
|
|
9
8
|
import { SearchServiceClient as GeneratedClient } from "./generated/service/searchServiceClient";
|
|
10
9
|
import { logger } from "./logger";
|
|
@@ -13,6 +12,7 @@ import * as utils from "./serviceUtils";
|
|
|
13
12
|
import { createSpan } from "./tracing";
|
|
14
13
|
import { createOdataMetadataPolicy } from "./odataMetadataPolicy";
|
|
15
14
|
import { SearchClient } from "./searchClient";
|
|
15
|
+
import { KnownSearchAudience } from "./searchAudience";
|
|
16
16
|
/**
|
|
17
17
|
* Class to perform operations to manage
|
|
18
18
|
* (create, update, list/delete)
|
|
@@ -87,7 +87,10 @@ export class SearchIndexClient {
|
|
|
87
87
|
}
|
|
88
88
|
this.client = new GeneratedClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
|
|
89
89
|
if (isTokenCredential(credential)) {
|
|
90
|
-
|
|
90
|
+
const scope = options.audience
|
|
91
|
+
? `${options.audience}/.default`
|
|
92
|
+
: `${KnownSearchAudience.AzurePublicCloud}/.default`;
|
|
93
|
+
this.client.pipeline.addPolicy(bearerTokenAuthenticationPolicy({ credential, scopes: scope }));
|
|
91
94
|
}
|
|
92
95
|
else {
|
|
93
96
|
this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));
|
|
@@ -104,8 +107,8 @@ export class SearchIndexClient {
|
|
|
104
107
|
}
|
|
105
108
|
catch (e) {
|
|
106
109
|
span.setStatus({
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
status: "error",
|
|
111
|
+
error: e.message,
|
|
109
112
|
});
|
|
110
113
|
throw e;
|
|
111
114
|
}
|
|
@@ -159,8 +162,8 @@ export class SearchIndexClient {
|
|
|
159
162
|
}
|
|
160
163
|
catch (e) {
|
|
161
164
|
span.setStatus({
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
status: "error",
|
|
166
|
+
error: e.message,
|
|
164
167
|
});
|
|
165
168
|
throw e;
|
|
166
169
|
}
|
|
@@ -215,8 +218,8 @@ export class SearchIndexClient {
|
|
|
215
218
|
}
|
|
216
219
|
catch (e) {
|
|
217
220
|
span.setStatus({
|
|
218
|
-
|
|
219
|
-
|
|
221
|
+
status: "error",
|
|
222
|
+
error: e.message,
|
|
220
223
|
});
|
|
221
224
|
throw e;
|
|
222
225
|
}
|
|
@@ -273,8 +276,8 @@ export class SearchIndexClient {
|
|
|
273
276
|
}
|
|
274
277
|
catch (e) {
|
|
275
278
|
span.setStatus({
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
status: "error",
|
|
280
|
+
error: e.message,
|
|
278
281
|
});
|
|
279
282
|
throw e;
|
|
280
283
|
}
|
|
@@ -294,8 +297,8 @@ export class SearchIndexClient {
|
|
|
294
297
|
}
|
|
295
298
|
catch (e) {
|
|
296
299
|
span.setStatus({
|
|
297
|
-
|
|
298
|
-
|
|
300
|
+
status: "error",
|
|
301
|
+
error: e.message,
|
|
299
302
|
});
|
|
300
303
|
throw e;
|
|
301
304
|
}
|
|
@@ -316,8 +319,8 @@ export class SearchIndexClient {
|
|
|
316
319
|
}
|
|
317
320
|
catch (e) {
|
|
318
321
|
span.setStatus({
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
status: "error",
|
|
323
|
+
error: e.message,
|
|
321
324
|
});
|
|
322
325
|
throw e;
|
|
323
326
|
}
|
|
@@ -338,8 +341,8 @@ export class SearchIndexClient {
|
|
|
338
341
|
}
|
|
339
342
|
catch (e) {
|
|
340
343
|
span.setStatus({
|
|
341
|
-
|
|
342
|
-
|
|
344
|
+
status: "error",
|
|
345
|
+
error: e.message,
|
|
343
346
|
});
|
|
344
347
|
throw e;
|
|
345
348
|
}
|
|
@@ -360,8 +363,8 @@ export class SearchIndexClient {
|
|
|
360
363
|
}
|
|
361
364
|
catch (e) {
|
|
362
365
|
span.setStatus({
|
|
363
|
-
|
|
364
|
-
|
|
366
|
+
status: "error",
|
|
367
|
+
error: e.message,
|
|
365
368
|
});
|
|
366
369
|
throw e;
|
|
367
370
|
}
|
|
@@ -382,8 +385,8 @@ export class SearchIndexClient {
|
|
|
382
385
|
}
|
|
383
386
|
catch (e) {
|
|
384
387
|
span.setStatus({
|
|
385
|
-
|
|
386
|
-
|
|
388
|
+
status: "error",
|
|
389
|
+
error: e.message,
|
|
387
390
|
});
|
|
388
391
|
throw e;
|
|
389
392
|
}
|
|
@@ -405,8 +408,8 @@ export class SearchIndexClient {
|
|
|
405
408
|
}
|
|
406
409
|
catch (e) {
|
|
407
410
|
span.setStatus({
|
|
408
|
-
|
|
409
|
-
|
|
411
|
+
status: "error",
|
|
412
|
+
error: e.message,
|
|
410
413
|
});
|
|
411
414
|
throw e;
|
|
412
415
|
}
|
|
@@ -428,8 +431,8 @@ export class SearchIndexClient {
|
|
|
428
431
|
}
|
|
429
432
|
catch (e) {
|
|
430
433
|
span.setStatus({
|
|
431
|
-
|
|
432
|
-
|
|
434
|
+
status: "error",
|
|
435
|
+
error: e.message,
|
|
433
436
|
});
|
|
434
437
|
throw e;
|
|
435
438
|
}
|
|
@@ -451,8 +454,8 @@ export class SearchIndexClient {
|
|
|
451
454
|
}
|
|
452
455
|
catch (e) {
|
|
453
456
|
span.setStatus({
|
|
454
|
-
|
|
455
|
-
|
|
457
|
+
status: "error",
|
|
458
|
+
error: e.message,
|
|
456
459
|
});
|
|
457
460
|
throw e;
|
|
458
461
|
}
|
|
@@ -478,8 +481,8 @@ export class SearchIndexClient {
|
|
|
478
481
|
}
|
|
479
482
|
catch (e) {
|
|
480
483
|
span.setStatus({
|
|
481
|
-
|
|
482
|
-
|
|
484
|
+
status: "error",
|
|
485
|
+
error: e.message,
|
|
483
486
|
});
|
|
484
487
|
throw e;
|
|
485
488
|
}
|
|
@@ -501,8 +504,8 @@ export class SearchIndexClient {
|
|
|
501
504
|
}
|
|
502
505
|
catch (e) {
|
|
503
506
|
span.setStatus({
|
|
504
|
-
|
|
505
|
-
|
|
507
|
+
status: "error",
|
|
508
|
+
error: e.message,
|
|
506
509
|
});
|
|
507
510
|
throw e;
|
|
508
511
|
}
|
|
@@ -523,8 +526,8 @@ export class SearchIndexClient {
|
|
|
523
526
|
}
|
|
524
527
|
catch (e) {
|
|
525
528
|
span.setStatus({
|
|
526
|
-
|
|
527
|
-
|
|
529
|
+
status: "error",
|
|
530
|
+
error: e.message,
|
|
528
531
|
});
|
|
529
532
|
throw e;
|
|
530
533
|
}
|
|
@@ -547,8 +550,8 @@ export class SearchIndexClient {
|
|
|
547
550
|
}
|
|
548
551
|
catch (e) {
|
|
549
552
|
span.setStatus({
|
|
550
|
-
|
|
551
|
-
|
|
553
|
+
status: "error",
|
|
554
|
+
error: e.message,
|
|
552
555
|
});
|
|
553
556
|
throw e;
|
|
554
557
|
}
|
|
@@ -569,8 +572,8 @@ export class SearchIndexClient {
|
|
|
569
572
|
}
|
|
570
573
|
catch (e) {
|
|
571
574
|
span.setStatus({
|
|
572
|
-
|
|
573
|
-
|
|
575
|
+
status: "error",
|
|
576
|
+
error: e.message,
|
|
574
577
|
});
|
|
575
578
|
throw e;
|
|
576
579
|
}
|
|
@@ -592,8 +595,8 @@ export class SearchIndexClient {
|
|
|
592
595
|
}
|
|
593
596
|
catch (e) {
|
|
594
597
|
span.setStatus({
|
|
595
|
-
|
|
596
|
-
|
|
598
|
+
status: "error",
|
|
599
|
+
error: e.message,
|
|
597
600
|
});
|
|
598
601
|
throw e;
|
|
599
602
|
}
|
|
@@ -621,8 +624,8 @@ export class SearchIndexClient {
|
|
|
621
624
|
}
|
|
622
625
|
catch (e) {
|
|
623
626
|
span.setStatus({
|
|
624
|
-
|
|
625
|
-
|
|
627
|
+
status: "error",
|
|
628
|
+
error: e.message,
|
|
626
629
|
});
|
|
627
630
|
throw e;
|
|
628
631
|
}
|
|
@@ -642,8 +645,8 @@ export class SearchIndexClient {
|
|
|
642
645
|
}
|
|
643
646
|
catch (e) {
|
|
644
647
|
span.setStatus({
|
|
645
|
-
|
|
646
|
-
|
|
648
|
+
status: "error",
|
|
649
|
+
error: e.message,
|
|
647
650
|
});
|
|
648
651
|
throw e;
|
|
649
652
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchIndexClient.js","sourceRoot":"","sources":["../../src/searchIndexClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,4CAA4C;AAE5C,OAAO,EAAkC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2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,UAAU,CAAC,wCAAwC,EAAE,OAAO,CAAC,CAAC;QAC/F,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACtE,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;aACnB,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAI,SAAiB,EAAE,OAAgC;QAC3E,OAAO,IAAI,YAAY,CAAI,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IACjG,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport { KeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { InternalClientPipelineOptions } from \"@azure/core-client\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { SDK_VERSION } from \"./constants\";\nimport { AnalyzeResult } from \"./generated/service/models\";\nimport { SearchServiceClient as GeneratedClient } from \"./generated/service/searchServiceClient\";\nimport { logger } from \"./logger\";\nimport { createSearchApiKeyCredentialPolicy } from \"./searchApiKeyCredentialPolicy\";\nimport {\n AnalyzeTextOptions,\n CreateIndexOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSynonymMapOptions,\n DeleteIndexOptions,\n DeleteSynonymMapOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n GetSynonymMapsOptions,\n SearchIndex,\n ListIndexesOptions,\n ListSynonymMapsOptions,\n SynonymMap,\n GetServiceStatisticsOptions,\n IndexIterator,\n IndexNameIterator,\n SearchIndexStatistics,\n SearchServiceStatistics,\n CreateAliasOptions,\n SearchIndexAlias,\n CreateOrUpdateAliasOptions,\n DeleteAliasOptions,\n GetAliasOptions,\n ListAliasesOptions,\n AliasIterator,\n} from \"./serviceModels\";\nimport * as utils from \"./serviceUtils\";\nimport { createSpan } from \"./tracing\";\nimport { createOdataMetadataPolicy } from \"./odataMetadataPolicy\";\nimport { SearchClient, SearchClientOptions as GetSearchClientOptions } from \"./searchClient\";\nimport { ExtendedCommonClientOptions } from \"@azure/core-http-compat\";\n\n/**\n * Client options used to configure Cognitive Search API requests.\n */\nexport interface SearchIndexClientOptions extends ExtendedCommonClientOptions {\n /**\n * The API version to use when communicating with the service.\n * @deprecated use {@Link serviceVersion} instead\n */\n apiVersion?: string;\n\n /**\n * The service version to use when communicating with the service.\n */\n serviceVersion?: string;\n}\n\n/**\n * Class to perform operations to manage\n * (create, update, list/delete)\n * indexes, & synonymmaps.\n */\nexport class SearchIndexClient {\n /**\n * The API version to use when communicating with the service.\n */\n public readonly serviceVersion: string = utils.defaultServiceVersion;\n\n /**\n * The API version to use when communicating with the service.\n * @deprecated use {@Link serviceVersion} instead\n */\n public readonly apiVersion: string = utils.defaultServiceVersion;\n\n /**\n * The endpoint of the search service\n */\n public readonly endpoint: string;\n\n /**\n * @internal\n * @hidden\n * A reference to the auto-generated SearchServiceClient\n */\n private readonly client: GeneratedClient;\n\n /**\n * Used to authenticate requests to the service.\n */\n private readonly credential: KeyCredential | TokenCredential;\n\n /**\n * Used to configure the Search Index client.\n */\n private readonly options: SearchIndexClientOptions;\n\n /**\n * Creates an instance of SearchIndexClient.\n *\n * Example usage:\n * ```ts\n * const { SearchIndexClient, AzureKeyCredential } = require(\"@azure/search-documents\");\n *\n * const client = new SearchIndexClient(\n * \"<endpoint>\",\n * new AzureKeyCredential(\"<Admin Key>\");\n * );\n * ```\n * @param endpoint - The endpoint of the search service\n * @param credential - Used to authenticate requests to the service.\n * @param options - Used to configure the Search Index client.\n */\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options: SearchIndexClientOptions = {}\n ) {\n this.endpoint = endpoint;\n this.credential = credential;\n this.options = options;\n\n const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;\n if (!options.userAgentOptions) {\n options.userAgentOptions = {};\n }\n if (options.userAgentOptions.userAgentPrefix) {\n options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;\n } else {\n options.userAgentOptions.userAgentPrefix = libInfo;\n }\n\n const internalClientPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"elapsed-time\",\n \"Location\",\n \"OData-MaxVersion\",\n \"OData-Version\",\n \"Prefer\",\n \"throttle-reason\",\n ],\n },\n },\n };\n\n if (options.apiVersion) {\n if (!utils.serviceVersions.includes(options.apiVersion)) {\n throw new Error(`Invalid Api Version: ${options.apiVersion}`);\n }\n this.serviceVersion = options.apiVersion;\n this.apiVersion = options.apiVersion;\n }\n\n if (options.serviceVersion) {\n if (!utils.serviceVersions.includes(options.serviceVersion)) {\n throw new Error(`Invalid Service Version: ${options.serviceVersion}`);\n }\n this.serviceVersion = options.serviceVersion;\n this.apiVersion = options.serviceVersion;\n }\n\n this.client = new GeneratedClient(\n this.endpoint,\n this.serviceVersion,\n internalClientPipelineOptions\n );\n\n if (isTokenCredential(credential)) {\n this.client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({ credential, scopes: utils.DEFAULT_SEARCH_SCOPE })\n );\n } else {\n this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));\n }\n\n this.client.pipeline.addPolicy(createOdataMetadataPolicy(\"minimal\"));\n }\n\n private async *listIndexesPage(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<SearchIndex[]> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listIndexesPage\", options);\n try {\n const result = await this.client.indexes.list(updatedOptions);\n const mapped = result.indexes.map(utils.generatedIndexToPublicIndex);\n yield mapped;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async *listIndexesAll(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<SearchIndex> {\n for await (const page of this.listIndexesPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Retrieves a list of existing indexes in the service.\n * @param options - Options to the list index operation.\n */\n public listIndexes(options: ListIndexesOptions = {}): IndexIterator {\n const iter = this.listIndexesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listIndexesPage(options);\n },\n };\n }\n\n private async *listAliasesPage(\n options: ListAliasesOptions = {}\n ): AsyncIterableIterator<SearchIndexAlias[]> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-listAliases\", options);\n try {\n const result = await this.client.aliases.list(updatedOptions);\n yield result.aliases;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async *listAliasesAll(\n options: ListAliasesOptions = {}\n ): AsyncIterableIterator<SearchIndexAlias> {\n for await (const page of this.listAliasesPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Lists all aliases available for a search service.\n * @param options - The options parameters.\n */\n public listAliases(options: ListAliasesOptions = {}): AliasIterator {\n const iter = this.listAliasesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listAliasesPage(options);\n },\n };\n }\n\n private async *listIndexesNamesPage(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<string[]> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listIndexesNamesPage\", options);\n try {\n const result = await this.client.indexes.list({\n ...updatedOptions,\n select: \"name\",\n });\n const mapped = result.indexes.map((idx) => idx.name);\n yield mapped;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async *listIndexesNamesAll(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<string> {\n for await (const page of this.listIndexesNamesPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Retrieves a list of names of existing indexes in the service.\n * @param options - Options to the list index operation.\n */\n public listIndexesNames(options: ListIndexesOptions = {}): IndexNameIterator {\n const iter = this.listIndexesNamesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listIndexesNamesPage(options);\n },\n };\n }\n\n /**\n * Retrieves a list of existing SynonymMaps in the service.\n * @param options - Options to the list SynonymMaps operation.\n */\n public async listSynonymMaps(options: ListSynonymMapsOptions = {}): Promise<Array<SynonymMap>> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listSynonymMaps\", options);\n try {\n const result = await this.client.synonymMaps.list(updatedOptions);\n return result.synonymMaps.map(utils.generatedSynonymMapToPublicSynonymMap);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves a list of names of existing SynonymMaps in the service.\n * @param options - Options to the list SynonymMaps operation.\n */\n public async listSynonymMapsNames(options: ListSynonymMapsOptions = {}): Promise<Array<string>> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listSynonymMapsNames\", options);\n try {\n const result = await this.client.synonymMaps.list({\n ...updatedOptions,\n select: \"name\",\n });\n return result.synonymMaps.map((sm) => sm.name);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves information about an index.\n * @param indexName - The name of the index.\n * @param options - Additional optional arguments.\n */\n public async getIndex(indexName: string, options: GetIndexOptions = {}): Promise<SearchIndex> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getIndex\", options);\n try {\n const result = await this.client.indexes.get(indexName, updatedOptions);\n return utils.generatedIndexToPublicIndex(result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves information about a SynonymMap.\n * @param synonymMapName - The name of the SynonymMap.\n * @param options - Additional optional arguments.\n */\n public async getSynonymMap(\n synonymMapName: string,\n options: GetSynonymMapsOptions = {}\n ): Promise<SynonymMap> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getSynonymMaps\", options);\n try {\n const result = await this.client.synonymMaps.get(synonymMapName, updatedOptions);\n return utils.generatedSynonymMapToPublicSynonymMap(result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new index.\n * @param index - The information describing the index to be created.\n * @param options - Additional optional arguments.\n */\n public async createIndex(\n index: SearchIndex,\n options: CreateIndexOptions = {}\n ): Promise<SearchIndex> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-createIndex\", options);\n try {\n const result = await this.client.indexes.create(\n utils.publicIndexToGeneratedIndex(index),\n updatedOptions\n );\n return utils.generatedIndexToPublicIndex(result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new SynonymMap in a search service.\n * @param synonymMap - The synonymMap definition to create in a search service.\n * @param options - Additional optional arguments.\n */\n public async createSynonymMap(\n synonymMap: SynonymMap,\n options: CreateSynonymMapOptions = {}\n ): Promise<SynonymMap> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-createSynonymMaps\", options);\n try {\n const result = await this.client.synonymMaps.create(\n utils.publicSynonymMapToGeneratedSynonymMap(synonymMap),\n updatedOptions\n );\n return utils.generatedSynonymMapToPublicSynonymMap(result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new index or modifies an existing one.\n * @param index - The information describing the index to be created.\n * @param options - Additional optional arguments.\n */\n public async createOrUpdateIndex(\n index: SearchIndex,\n options: CreateOrUpdateIndexOptions = {}\n ): Promise<SearchIndex> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-createOrUpdateIndex\", options);\n try {\n const etag = options.onlyIfUnchanged ? index.etag : undefined;\n\n const result = await this.client.indexes.createOrUpdate(\n index.name,\n utils.publicIndexToGeneratedIndex(index),\n {\n ...updatedOptions,\n ifMatch: etag,\n }\n );\n return utils.generatedIndexToPublicIndex(result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new SynonymMap or modifies an existing one.\n * @param synonymMap - The information describing the SynonymMap to be created.\n * @param options - Additional optional arguments.\n */\n public async createOrUpdateSynonymMap(\n synonymMap: SynonymMap,\n options: CreateOrUpdateSynonymMapOptions = {}\n ): Promise<SynonymMap> {\n const { span, updatedOptions } = createSpan(\n \"SearchIndexClient-createOrUpdateSynonymMap\",\n options\n );\n try {\n const etag = options.onlyIfUnchanged ? synonymMap.etag : undefined;\n\n const result = await this.client.synonymMaps.createOrUpdate(\n synonymMap.name,\n utils.publicSynonymMapToGeneratedSynonymMap(synonymMap),\n {\n ...updatedOptions,\n ifMatch: etag,\n }\n );\n return utils.generatedSynonymMapToPublicSynonymMap(result);\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes an existing index.\n * @param indexName - Index/Name of the index to delete.\n * @param options - Additional optional arguments.\n */\n public async deleteIndex(\n index: string | SearchIndex,\n options: DeleteIndexOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-deleteIndex\", options);\n try {\n const indexName: string = typeof index === \"string\" ? index : index.name;\n const etag =\n typeof index === \"string\" ? undefined : options.onlyIfUnchanged ? index.etag : undefined;\n\n await this.client.indexes.delete(indexName, {\n ...updatedOptions,\n ifMatch: etag,\n });\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes an existing SynonymMap.\n * @param synonymMapName - SynonymMap/Name of the synonymMap to delete.\n * @param options - Additional optional arguments.\n */\n public async deleteSynonymMap(\n synonymMap: string | SynonymMap,\n options: DeleteSynonymMapOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-deleteSynonymMap\", options);\n try {\n const synonymMapName: string = typeof synonymMap === \"string\" ? synonymMap : synonymMap.name;\n const etag =\n typeof synonymMap === \"string\"\n ? undefined\n : options.onlyIfUnchanged\n ? synonymMap.etag\n : undefined;\n\n await this.client.synonymMaps.delete(synonymMapName, {\n ...updatedOptions,\n ifMatch: etag,\n });\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new search alias or updates an alias if it already exists.\n * @param alias - The definition of the alias to create or update.\n * @param options - The options parameters.\n */\n public async createOrUpdateAlias(\n alias: SearchIndexAlias,\n options: CreateOrUpdateAliasOptions = {}\n ): Promise<SearchIndexAlias> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-createOrUpdateAlias\", options);\n try {\n const etag = options.onlyIfUnchanged ? alias.etag : undefined;\n\n const result = await this.client.aliases.createOrUpdate(alias.name, alias, {\n ...updatedOptions,\n ifMatch: etag,\n });\n return result;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new search alias.\n * @param alias - The definition of the alias to create.\n * @param options - The options parameters.\n */\n public async createAlias(\n alias: SearchIndexAlias,\n options: CreateAliasOptions = {}\n ): Promise<SearchIndexAlias> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-createAlias\", options);\n try {\n const result = await this.client.aliases.create(alias, updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes a search alias and its associated mapping to an index. This operation is permanent, with no\n * recovery option. The mapped index is untouched by this operation.\n * @param alias - Alias/Name name of the alias to delete.\n * @param options - The options parameters.\n */\n public async deleteAlias(\n alias: string | SearchIndexAlias,\n options: DeleteAliasOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-deleteAlias\", options);\n try {\n const aliasName: string = typeof alias === \"string\" ? alias : alias.name;\n const etag =\n typeof alias === \"string\" ? undefined : options.onlyIfUnchanged ? alias.etag : undefined;\n\n await this.client.aliases.delete(aliasName, {\n ...updatedOptions,\n ifMatch: etag,\n });\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves an alias definition.\n * @param aliasName - The name of the alias to retrieve.\n * @param options - The options parameters.\n */\n public async getAlias(\n aliasName: string,\n options: GetAliasOptions = {}\n ): Promise<SearchIndexAlias> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-getAlias\", options);\n try {\n const result = await this.client.aliases.get(aliasName, updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves statistics about an index, such as the count of documents and the size\n * of index storage.\n * @param indexName - The name of the index.\n * @param options - Additional optional arguments.\n */\n public async getIndexStatistics(\n indexName: string,\n options: GetIndexStatisticsOptions = {}\n ): Promise<SearchIndexStatistics> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getIndexStatistics\", options);\n try {\n const result = await this.client.indexes.getStatistics(indexName, updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Calls an analyzer or tokenizer manually on provided text.\n * @param indexName - The name of the index that contains the field to analyze\n * @param text - The text to break into tokens.\n * @param options - Additional arguments\n */\n public async analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult> {\n const { abortSignal, requestOptions, tracingOptions, ...restOptions } = options;\n const operationOptions = {\n abortSignal,\n requestOptions,\n tracingOptions,\n };\n\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-analyzeText\", operationOptions);\n try {\n const result = await this.client.indexes.analyze(\n indexName,\n {\n ...restOptions,\n analyzer: restOptions.analyzerName,\n tokenizer: restOptions.tokenizerName,\n normalizer: restOptions.normalizerName,\n },\n updatedOptions\n );\n return result;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves statistics about the service, such as the count of documents, index, etc.\n * @param options - Additional optional arguments.\n */\n public async getServiceStatistics(\n options: GetServiceStatisticsOptions = {}\n ): Promise<SearchServiceStatistics> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getServiceStatistics\", options);\n try {\n const result = await this.client.getServiceStatistics(updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves the SearchClient corresponding to this SearchIndexClient\n * @param indexName - Name of the index\n * @param options - SearchClient Options\n */\n public getSearchClient<T>(indexName: string, options?: GetSearchClientOptions): SearchClient<T> {\n return new SearchClient<T>(this.endpoint, indexName, this.credential, options || this.options);\n }\n}\n"]}
|
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ACI,KAAK,CAAC,oBAAoB,CAC/B,UAAuC,EAAE;QAEzC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,wCAAwC,EAAE,OAAO,CAAC,CAAC;QAC/F,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;YACtE,OAAO,MAAM,CAAC;SACf;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC,CAAC,OAAO;aACjB,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;SACT;gBAAS;YACR,IAAI,CAAC,GAAG,EAAE,CAAC;SACZ;IACH,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAI,SAAiB,EAAE,OAAgC;QAC3E,OAAO,IAAI,YAAY,CAAI,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC;IACjG,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport { KeyCredential, TokenCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { InternalClientPipelineOptions } from \"@azure/core-client\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\nimport { SDK_VERSION } from \"./constants\";\nimport { AnalyzeResult } from \"./generated/service/models\";\nimport { SearchServiceClient as GeneratedClient } from \"./generated/service/searchServiceClient\";\nimport { logger } from \"./logger\";\nimport { createSearchApiKeyCredentialPolicy } from \"./searchApiKeyCredentialPolicy\";\nimport {\n AnalyzeTextOptions,\n CreateIndexOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSynonymMapOptions,\n DeleteIndexOptions,\n DeleteSynonymMapOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n GetSynonymMapsOptions,\n SearchIndex,\n ListIndexesOptions,\n ListSynonymMapsOptions,\n SynonymMap,\n GetServiceStatisticsOptions,\n IndexIterator,\n IndexNameIterator,\n SearchIndexStatistics,\n SearchServiceStatistics,\n CreateAliasOptions,\n SearchIndexAlias,\n CreateOrUpdateAliasOptions,\n DeleteAliasOptions,\n GetAliasOptions,\n ListAliasesOptions,\n AliasIterator,\n} from \"./serviceModels\";\nimport * as utils from \"./serviceUtils\";\nimport { createSpan } from \"./tracing\";\nimport { createOdataMetadataPolicy } from \"./odataMetadataPolicy\";\nimport { SearchClient, SearchClientOptions as GetSearchClientOptions } from \"./searchClient\";\nimport { ExtendedCommonClientOptions } from \"@azure/core-http-compat\";\nimport { KnownSearchAudience } from \"./searchAudience\";\n\n/**\n * Client options used to configure Cognitive Search API requests.\n */\nexport interface SearchIndexClientOptions extends ExtendedCommonClientOptions {\n /**\n * The API version to use when communicating with the service.\n * @deprecated use {@Link serviceVersion} instead\n */\n apiVersion?: string;\n\n /**\n * The service version to use when communicating with the service.\n */\n serviceVersion?: string;\n\n /**\n * The Audience to use for authentication with Azure Active Directory (AAD). The\n * audience is not considered when using a shared key.\n * {@link KnownSearchAudience} can be used interchangeably with audience\n */\n audience?: string;\n}\n\n/**\n * Class to perform operations to manage\n * (create, update, list/delete)\n * indexes, & synonymmaps.\n */\nexport class SearchIndexClient {\n /**\n * The API version to use when communicating with the service.\n */\n public readonly serviceVersion: string = utils.defaultServiceVersion;\n\n /**\n * The API version to use when communicating with the service.\n * @deprecated use {@Link serviceVersion} instead\n */\n public readonly apiVersion: string = utils.defaultServiceVersion;\n\n /**\n * The endpoint of the search service\n */\n public readonly endpoint: string;\n\n /**\n * @internal\n * @hidden\n * A reference to the auto-generated SearchServiceClient\n */\n private readonly client: GeneratedClient;\n\n /**\n * Used to authenticate requests to the service.\n */\n private readonly credential: KeyCredential | TokenCredential;\n\n /**\n * Used to configure the Search Index client.\n */\n private readonly options: SearchIndexClientOptions;\n\n /**\n * Creates an instance of SearchIndexClient.\n *\n * Example usage:\n * ```ts\n * const { SearchIndexClient, AzureKeyCredential } = require(\"@azure/search-documents\");\n *\n * const client = new SearchIndexClient(\n * \"<endpoint>\",\n * new AzureKeyCredential(\"<Admin Key>\");\n * );\n * ```\n * @param endpoint - The endpoint of the search service\n * @param credential - Used to authenticate requests to the service.\n * @param options - Used to configure the Search Index client.\n */\n constructor(\n endpoint: string,\n credential: KeyCredential | TokenCredential,\n options: SearchIndexClientOptions = {}\n ) {\n this.endpoint = endpoint;\n this.credential = credential;\n this.options = options;\n\n const libInfo = `azsdk-js-search-documents/${SDK_VERSION}`;\n if (!options.userAgentOptions) {\n options.userAgentOptions = {};\n }\n if (options.userAgentOptions.userAgentPrefix) {\n options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;\n } else {\n options.userAgentOptions.userAgentPrefix = libInfo;\n }\n\n const internalClientPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [\n \"elapsed-time\",\n \"Location\",\n \"OData-MaxVersion\",\n \"OData-Version\",\n \"Prefer\",\n \"throttle-reason\",\n ],\n },\n },\n };\n\n if (options.apiVersion) {\n if (!utils.serviceVersions.includes(options.apiVersion)) {\n throw new Error(`Invalid Api Version: ${options.apiVersion}`);\n }\n this.serviceVersion = options.apiVersion;\n this.apiVersion = options.apiVersion;\n }\n\n if (options.serviceVersion) {\n if (!utils.serviceVersions.includes(options.serviceVersion)) {\n throw new Error(`Invalid Service Version: ${options.serviceVersion}`);\n }\n this.serviceVersion = options.serviceVersion;\n this.apiVersion = options.serviceVersion;\n }\n\n this.client = new GeneratedClient(\n this.endpoint,\n this.serviceVersion,\n internalClientPipelineOptions\n );\n\n if (isTokenCredential(credential)) {\n const scope: string = options.audience\n ? `${options.audience}/.default`\n : `${KnownSearchAudience.AzurePublicCloud}/.default`;\n\n this.client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({ credential, scopes: scope })\n );\n } else {\n this.client.pipeline.addPolicy(createSearchApiKeyCredentialPolicy(credential));\n }\n\n this.client.pipeline.addPolicy(createOdataMetadataPolicy(\"minimal\"));\n }\n\n private async *listIndexesPage(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<SearchIndex[]> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listIndexesPage\", options);\n try {\n const result = await this.client.indexes.list(updatedOptions);\n const mapped = result.indexes.map(utils.generatedIndexToPublicIndex);\n yield mapped;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async *listIndexesAll(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<SearchIndex> {\n for await (const page of this.listIndexesPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Retrieves a list of existing indexes in the service.\n * @param options - Options to the list index operation.\n */\n public listIndexes(options: ListIndexesOptions = {}): IndexIterator {\n const iter = this.listIndexesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listIndexesPage(options);\n },\n };\n }\n\n private async *listAliasesPage(\n options: ListAliasesOptions = {}\n ): AsyncIterableIterator<SearchIndexAlias[]> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-listAliases\", options);\n try {\n const result = await this.client.aliases.list(updatedOptions);\n yield result.aliases;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async *listAliasesAll(\n options: ListAliasesOptions = {}\n ): AsyncIterableIterator<SearchIndexAlias> {\n for await (const page of this.listAliasesPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Lists all aliases available for a search service.\n * @param options - The options parameters.\n */\n public listAliases(options: ListAliasesOptions = {}): AliasIterator {\n const iter = this.listAliasesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listAliasesPage(options);\n },\n };\n }\n\n private async *listIndexesNamesPage(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<string[]> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listIndexesNamesPage\", options);\n try {\n const result = await this.client.indexes.list({\n ...updatedOptions,\n select: \"name\",\n });\n const mapped = result.indexes.map((idx) => idx.name);\n yield mapped;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async *listIndexesNamesAll(\n options: ListIndexesOptions = {}\n ): AsyncIterableIterator<string> {\n for await (const page of this.listIndexesNamesPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Retrieves a list of names of existing indexes in the service.\n * @param options - Options to the list index operation.\n */\n public listIndexesNames(options: ListIndexesOptions = {}): IndexNameIterator {\n const iter = this.listIndexesNamesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: () => {\n return this.listIndexesNamesPage(options);\n },\n };\n }\n\n /**\n * Retrieves a list of existing SynonymMaps in the service.\n * @param options - Options to the list SynonymMaps operation.\n */\n public async listSynonymMaps(options: ListSynonymMapsOptions = {}): Promise<Array<SynonymMap>> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listSynonymMaps\", options);\n try {\n const result = await this.client.synonymMaps.list(updatedOptions);\n return result.synonymMaps.map(utils.generatedSynonymMapToPublicSynonymMap);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves a list of names of existing SynonymMaps in the service.\n * @param options - Options to the list SynonymMaps operation.\n */\n public async listSynonymMapsNames(options: ListSynonymMapsOptions = {}): Promise<Array<string>> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-listSynonymMapsNames\", options);\n try {\n const result = await this.client.synonymMaps.list({\n ...updatedOptions,\n select: \"name\",\n });\n return result.synonymMaps.map((sm) => sm.name);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves information about an index.\n * @param indexName - The name of the index.\n * @param options - Additional optional arguments.\n */\n public async getIndex(indexName: string, options: GetIndexOptions = {}): Promise<SearchIndex> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getIndex\", options);\n try {\n const result = await this.client.indexes.get(indexName, updatedOptions);\n return utils.generatedIndexToPublicIndex(result);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves information about a SynonymMap.\n * @param synonymMapName - The name of the SynonymMap.\n * @param options - Additional optional arguments.\n */\n public async getSynonymMap(\n synonymMapName: string,\n options: GetSynonymMapsOptions = {}\n ): Promise<SynonymMap> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getSynonymMaps\", options);\n try {\n const result = await this.client.synonymMaps.get(synonymMapName, updatedOptions);\n return utils.generatedSynonymMapToPublicSynonymMap(result);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new index.\n * @param index - The information describing the index to be created.\n * @param options - Additional optional arguments.\n */\n public async createIndex(\n index: SearchIndex,\n options: CreateIndexOptions = {}\n ): Promise<SearchIndex> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-createIndex\", options);\n try {\n const result = await this.client.indexes.create(\n utils.publicIndexToGeneratedIndex(index),\n updatedOptions\n );\n return utils.generatedIndexToPublicIndex(result);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new SynonymMap in a search service.\n * @param synonymMap - The synonymMap definition to create in a search service.\n * @param options - Additional optional arguments.\n */\n public async createSynonymMap(\n synonymMap: SynonymMap,\n options: CreateSynonymMapOptions = {}\n ): Promise<SynonymMap> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-createSynonymMaps\", options);\n try {\n const result = await this.client.synonymMaps.create(\n utils.publicSynonymMapToGeneratedSynonymMap(synonymMap),\n updatedOptions\n );\n return utils.generatedSynonymMapToPublicSynonymMap(result);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new index or modifies an existing one.\n * @param index - The information describing the index to be created.\n * @param options - Additional optional arguments.\n */\n public async createOrUpdateIndex(\n index: SearchIndex,\n options: CreateOrUpdateIndexOptions = {}\n ): Promise<SearchIndex> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-createOrUpdateIndex\", options);\n try {\n const etag = options.onlyIfUnchanged ? index.etag : undefined;\n\n const result = await this.client.indexes.createOrUpdate(\n index.name,\n utils.publicIndexToGeneratedIndex(index),\n {\n ...updatedOptions,\n ifMatch: etag,\n }\n );\n return utils.generatedIndexToPublicIndex(result);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new SynonymMap or modifies an existing one.\n * @param synonymMap - The information describing the SynonymMap to be created.\n * @param options - Additional optional arguments.\n */\n public async createOrUpdateSynonymMap(\n synonymMap: SynonymMap,\n options: CreateOrUpdateSynonymMapOptions = {}\n ): Promise<SynonymMap> {\n const { span, updatedOptions } = createSpan(\n \"SearchIndexClient-createOrUpdateSynonymMap\",\n options\n );\n try {\n const etag = options.onlyIfUnchanged ? synonymMap.etag : undefined;\n\n const result = await this.client.synonymMaps.createOrUpdate(\n synonymMap.name,\n utils.publicSynonymMapToGeneratedSynonymMap(synonymMap),\n {\n ...updatedOptions,\n ifMatch: etag,\n }\n );\n return utils.generatedSynonymMapToPublicSynonymMap(result);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes an existing index.\n * @param indexName - Index/Name of the index to delete.\n * @param options - Additional optional arguments.\n */\n public async deleteIndex(\n index: string | SearchIndex,\n options: DeleteIndexOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-deleteIndex\", options);\n try {\n const indexName: string = typeof index === \"string\" ? index : index.name;\n const etag =\n typeof index === \"string\" ? undefined : options.onlyIfUnchanged ? index.etag : undefined;\n\n await this.client.indexes.delete(indexName, {\n ...updatedOptions,\n ifMatch: etag,\n });\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes an existing SynonymMap.\n * @param synonymMapName - SynonymMap/Name of the synonymMap to delete.\n * @param options - Additional optional arguments.\n */\n public async deleteSynonymMap(\n synonymMap: string | SynonymMap,\n options: DeleteSynonymMapOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-deleteSynonymMap\", options);\n try {\n const synonymMapName: string = typeof synonymMap === \"string\" ? synonymMap : synonymMap.name;\n const etag =\n typeof synonymMap === \"string\"\n ? undefined\n : options.onlyIfUnchanged\n ? synonymMap.etag\n : undefined;\n\n await this.client.synonymMaps.delete(synonymMapName, {\n ...updatedOptions,\n ifMatch: etag,\n });\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new search alias or updates an alias if it already exists.\n * @param alias - The definition of the alias to create or update.\n * @param options - The options parameters.\n */\n public async createOrUpdateAlias(\n alias: SearchIndexAlias,\n options: CreateOrUpdateAliasOptions = {}\n ): Promise<SearchIndexAlias> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-createOrUpdateAlias\", options);\n try {\n const etag = options.onlyIfUnchanged ? alias.etag : undefined;\n\n const result = await this.client.aliases.createOrUpdate(alias.name, alias, {\n ...updatedOptions,\n ifMatch: etag,\n });\n return result;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new search alias.\n * @param alias - The definition of the alias to create.\n * @param options - The options parameters.\n */\n public async createAlias(\n alias: SearchIndexAlias,\n options: CreateAliasOptions = {}\n ): Promise<SearchIndexAlias> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-createAlias\", options);\n try {\n const result = await this.client.aliases.create(alias, updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes a search alias and its associated mapping to an index. This operation is permanent, with no\n * recovery option. The mapped index is untouched by this operation.\n * @param alias - Alias/Name name of the alias to delete.\n * @param options - The options parameters.\n */\n public async deleteAlias(\n alias: string | SearchIndexAlias,\n options: DeleteAliasOptions = {}\n ): Promise<void> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-deleteAlias\", options);\n try {\n const aliasName: string = typeof alias === \"string\" ? alias : alias.name;\n const etag =\n typeof alias === \"string\" ? undefined : options.onlyIfUnchanged ? alias.etag : undefined;\n\n await this.client.aliases.delete(aliasName, {\n ...updatedOptions,\n ifMatch: etag,\n });\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves an alias definition.\n * @param aliasName - The name of the alias to retrieve.\n * @param options - The options parameters.\n */\n public async getAlias(\n aliasName: string,\n options: GetAliasOptions = {}\n ): Promise<SearchIndexAlias> {\n const { span, updatedOptions } = createSpan(\"SearchIndexerClient-getAlias\", options);\n try {\n const result = await this.client.aliases.get(aliasName, updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves statistics about an index, such as the count of documents and the size\n * of index storage.\n * @param indexName - The name of the index.\n * @param options - Additional optional arguments.\n */\n public async getIndexStatistics(\n indexName: string,\n options: GetIndexStatisticsOptions = {}\n ): Promise<SearchIndexStatistics> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getIndexStatistics\", options);\n try {\n const result = await this.client.indexes.getStatistics(indexName, updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Calls an analyzer or tokenizer manually on provided text.\n * @param indexName - The name of the index that contains the field to analyze\n * @param text - The text to break into tokens.\n * @param options - Additional arguments\n */\n public async analyzeText(indexName: string, options: AnalyzeTextOptions): Promise<AnalyzeResult> {\n const { abortSignal, requestOptions, tracingOptions, ...restOptions } = options;\n const operationOptions = {\n abortSignal,\n requestOptions,\n tracingOptions,\n };\n\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-analyzeText\", operationOptions);\n try {\n const result = await this.client.indexes.analyze(\n indexName,\n {\n ...restOptions,\n analyzer: restOptions.analyzerName,\n tokenizer: restOptions.tokenizerName,\n normalizer: restOptions.normalizerName,\n },\n updatedOptions\n );\n return result;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves statistics about the service, such as the count of documents, index, etc.\n * @param options - Additional optional arguments.\n */\n public async getServiceStatistics(\n options: GetServiceStatisticsOptions = {}\n ): Promise<SearchServiceStatistics> {\n const { span, updatedOptions } = createSpan(\"SearchIndexClient-getServiceStatistics\", options);\n try {\n const result = await this.client.getServiceStatistics(updatedOptions);\n return result;\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e.message,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves the SearchClient corresponding to this SearchIndexClient\n * @param indexName - Name of the index\n * @param options - SearchClient Options\n */\n public getSearchClient<T>(indexName: string, options?: GetSearchClientOptions): SearchClient<T> {\n return new SearchClient<T>(this.endpoint, indexName, this.credential, options || this.options);\n }\n}\n"]}
|