@azure/search-documents 12.0.0-alpha.20240112.1 → 12.0.0-alpha.20240118.1
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 +568 -1080
- package/dist/index.js.map +1 -1
- package/dist-esm/src/generated/data/models/mappers.js +4 -10
- package/dist-esm/src/generated/data/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/data/searchClient.js +3 -9
- package/dist-esm/src/generated/data/searchClient.js.map +1 -1
- package/dist-esm/src/generated/service/models/mappers.js +278 -642
- package/dist-esm/src/generated/service/models/mappers.js.map +1 -1
- package/dist-esm/src/generated/service/searchServiceClient.js +3 -7
- package/dist-esm/src/generated/service/searchServiceClient.js.map +1 -1
- package/dist-esm/src/indexDocumentsBatch.js +4 -16
- package/dist-esm/src/indexDocumentsBatch.js.map +1 -1
- package/dist-esm/src/indexModels.js.map +1 -1
- package/dist-esm/src/searchClient.js +68 -97
- package/dist-esm/src/searchClient.js.map +1 -1
- package/dist-esm/src/searchIndexClient.js +137 -116
- package/dist-esm/src/searchIndexClient.js.map +1 -1
- package/dist-esm/src/searchIndexerClient.js +25 -62
- package/dist-esm/src/searchIndexerClient.js.map +1 -1
- package/dist-esm/src/searchIndexingBufferedSender.js +8 -7
- package/dist-esm/src/searchIndexingBufferedSender.js.map +1 -1
- package/dist-esm/src/serialization.js +1 -1
- package/dist-esm/src/serialization.js.map +1 -1
- package/dist-esm/src/serviceUtils.js +39 -112
- package/dist-esm/src/serviceUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await, __rest } from "tslib";
|
|
3
4
|
/// <reference lib="esnext.asynciterable" />
|
|
4
5
|
import { isTokenCredential } from "@azure/core-auth";
|
|
5
6
|
import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline";
|
|
@@ -34,6 +35,7 @@ export class SearchIndexClient {
|
|
|
34
35
|
* @param options - Used to configure the Search Index client.
|
|
35
36
|
*/
|
|
36
37
|
constructor(endpoint, credential, options = {}) {
|
|
38
|
+
var _a, _b;
|
|
37
39
|
/**
|
|
38
40
|
* The API version to use when communicating with the service.
|
|
39
41
|
*/
|
|
@@ -46,24 +48,21 @@ export class SearchIndexClient {
|
|
|
46
48
|
this.endpoint = endpoint;
|
|
47
49
|
this.credential = credential;
|
|
48
50
|
this.options = options;
|
|
49
|
-
const internalClientPipelineOptions = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"throttle-reason",
|
|
61
|
-
],
|
|
62
|
-
},
|
|
51
|
+
const internalClientPipelineOptions = Object.assign(Object.assign({}, this.options), {
|
|
52
|
+
loggingOptions: {
|
|
53
|
+
logger: logger.info,
|
|
54
|
+
additionalAllowedHeaderNames: [
|
|
55
|
+
"elapsed-time",
|
|
56
|
+
"Location",
|
|
57
|
+
"OData-MaxVersion",
|
|
58
|
+
"OData-Version",
|
|
59
|
+
"Prefer",
|
|
60
|
+
"throttle-reason",
|
|
61
|
+
],
|
|
63
62
|
},
|
|
64
|
-
};
|
|
63
|
+
});
|
|
65
64
|
this.serviceVersion =
|
|
66
|
-
this.options.serviceVersion
|
|
65
|
+
(_b = (_a = this.options.serviceVersion) !== null && _a !== void 0 ? _a : this.options.apiVersion) !== null && _b !== void 0 ? _b : utils.defaultServiceVersion;
|
|
67
66
|
this.apiVersion = this.serviceVersion;
|
|
68
67
|
this.client = new GeneratedClient(this.endpoint, this.serviceVersion, internalClientPipelineOptions);
|
|
69
68
|
if (isTokenCredential(credential)) {
|
|
@@ -77,28 +76,45 @@ export class SearchIndexClient {
|
|
|
77
76
|
}
|
|
78
77
|
this.client.pipeline.addPolicy(createOdataMetadataPolicy("minimal"));
|
|
79
78
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
79
|
+
listIndexesPage(options = {}) {
|
|
80
|
+
return __asyncGenerator(this, arguments, function* listIndexesPage_1() {
|
|
81
|
+
const { span, updatedOptions } = createSpan("SearchIndexClient-listIndexesPage", options);
|
|
82
|
+
try {
|
|
83
|
+
const result = yield __await(this.client.indexes.list(updatedOptions));
|
|
84
|
+
const mapped = result.indexes.map(utils.generatedIndexToPublicIndex);
|
|
85
|
+
yield yield __await(mapped);
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
span.setStatus({
|
|
89
|
+
status: "error",
|
|
90
|
+
error: e.message,
|
|
91
|
+
});
|
|
92
|
+
throw e;
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
span.end();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
97
98
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
listIndexesAll(options = {}) {
|
|
100
|
+
return __asyncGenerator(this, arguments, function* listIndexesAll_1() {
|
|
101
|
+
var _a, e_1, _b, _c;
|
|
102
|
+
try {
|
|
103
|
+
for (var _d = true, _e = __asyncValues(this.listIndexesPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
104
|
+
_c = _f.value;
|
|
105
|
+
_d = false;
|
|
106
|
+
const page = _c;
|
|
107
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
111
|
+
finally {
|
|
112
|
+
try {
|
|
113
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
114
|
+
}
|
|
115
|
+
finally { if (e_1) throw e_1.error; }
|
|
116
|
+
}
|
|
117
|
+
});
|
|
102
118
|
}
|
|
103
119
|
/**
|
|
104
120
|
* Retrieves a list of existing indexes in the service.
|
|
@@ -118,27 +134,44 @@ export class SearchIndexClient {
|
|
|
118
134
|
},
|
|
119
135
|
};
|
|
120
136
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
listAliasesPage(options = {}) {
|
|
138
|
+
return __asyncGenerator(this, arguments, function* listAliasesPage_1() {
|
|
139
|
+
const { span, updatedOptions } = createSpan("SearchIndexerClient-listAliases", options);
|
|
140
|
+
try {
|
|
141
|
+
const result = yield __await(this.client.aliases.list(updatedOptions));
|
|
142
|
+
yield yield __await(result.aliases);
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
span.setStatus({
|
|
146
|
+
status: "error",
|
|
147
|
+
error: e.message,
|
|
148
|
+
});
|
|
149
|
+
throw e;
|
|
150
|
+
}
|
|
151
|
+
finally {
|
|
152
|
+
span.end();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
137
155
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
156
|
+
listAliasesAll(options = {}) {
|
|
157
|
+
return __asyncGenerator(this, arguments, function* listAliasesAll_1() {
|
|
158
|
+
var _a, e_2, _b, _c;
|
|
159
|
+
try {
|
|
160
|
+
for (var _d = true, _e = __asyncValues(this.listAliasesPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
161
|
+
_c = _f.value;
|
|
162
|
+
_d = false;
|
|
163
|
+
const page = _c;
|
|
164
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
168
|
+
finally {
|
|
169
|
+
try {
|
|
170
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
171
|
+
}
|
|
172
|
+
finally { if (e_2) throw e_2.error; }
|
|
173
|
+
}
|
|
174
|
+
});
|
|
142
175
|
}
|
|
143
176
|
/**
|
|
144
177
|
* Lists all aliases available for a search service.
|
|
@@ -158,31 +191,45 @@ export class SearchIndexClient {
|
|
|
158
191
|
},
|
|
159
192
|
};
|
|
160
193
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
194
|
+
listIndexesNamesPage(options = {}) {
|
|
195
|
+
return __asyncGenerator(this, arguments, function* listIndexesNamesPage_1() {
|
|
196
|
+
const { span, updatedOptions } = createSpan("SearchIndexClient-listIndexesNamesPage", options);
|
|
197
|
+
try {
|
|
198
|
+
const result = yield __await(this.client.indexes.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" })));
|
|
199
|
+
const mapped = result.indexes.map((idx) => idx.name);
|
|
200
|
+
yield yield __await(mapped);
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
span.setStatus({
|
|
204
|
+
status: "error",
|
|
205
|
+
error: e.message,
|
|
206
|
+
});
|
|
207
|
+
throw e;
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
span.end();
|
|
211
|
+
}
|
|
212
|
+
});
|
|
181
213
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
214
|
+
listIndexesNamesAll(options = {}) {
|
|
215
|
+
return __asyncGenerator(this, arguments, function* listIndexesNamesAll_1() {
|
|
216
|
+
var _a, e_3, _b, _c;
|
|
217
|
+
try {
|
|
218
|
+
for (var _d = true, _e = __asyncValues(this.listIndexesNamesPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
219
|
+
_c = _f.value;
|
|
220
|
+
_d = false;
|
|
221
|
+
const page = _c;
|
|
222
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
226
|
+
finally {
|
|
227
|
+
try {
|
|
228
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
229
|
+
}
|
|
230
|
+
finally { if (e_3) throw e_3.error; }
|
|
231
|
+
}
|
|
232
|
+
});
|
|
186
233
|
}
|
|
187
234
|
/**
|
|
188
235
|
* Retrieves a list of names of existing indexes in the service.
|
|
@@ -230,10 +277,7 @@ export class SearchIndexClient {
|
|
|
230
277
|
async listSynonymMapsNames(options = {}) {
|
|
231
278
|
const { span, updatedOptions } = createSpan("SearchIndexClient-listSynonymMapsNames", options);
|
|
232
279
|
try {
|
|
233
|
-
const result = await this.client.synonymMaps.list({
|
|
234
|
-
...updatedOptions,
|
|
235
|
-
select: "name",
|
|
236
|
-
});
|
|
280
|
+
const result = await this.client.synonymMaps.list(Object.assign(Object.assign({}, updatedOptions), { select: "name" }));
|
|
237
281
|
return result.synonymMaps.map((sm) => sm.name);
|
|
238
282
|
}
|
|
239
283
|
catch (e) {
|
|
@@ -344,10 +388,7 @@ export class SearchIndexClient {
|
|
|
344
388
|
const { span, updatedOptions } = createSpan("SearchIndexClient-createOrUpdateIndex", options);
|
|
345
389
|
try {
|
|
346
390
|
const etag = options.onlyIfUnchanged ? index.etag : undefined;
|
|
347
|
-
const result = await this.client.indexes.createOrUpdate(index.name, utils.publicIndexToGeneratedIndex(index), {
|
|
348
|
-
...updatedOptions,
|
|
349
|
-
ifMatch: etag,
|
|
350
|
-
});
|
|
391
|
+
const result = await this.client.indexes.createOrUpdate(index.name, utils.publicIndexToGeneratedIndex(index), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
351
392
|
return utils.generatedIndexToPublicIndex(result);
|
|
352
393
|
}
|
|
353
394
|
catch (e) {
|
|
@@ -370,10 +411,7 @@ export class SearchIndexClient {
|
|
|
370
411
|
const { span, updatedOptions } = createSpan("SearchIndexClient-createOrUpdateSynonymMap", options);
|
|
371
412
|
try {
|
|
372
413
|
const etag = options.onlyIfUnchanged ? synonymMap.etag : undefined;
|
|
373
|
-
const result = await this.client.synonymMaps.createOrUpdate(synonymMap.name, utils.publicSynonymMapToGeneratedSynonymMap(synonymMap), {
|
|
374
|
-
...updatedOptions,
|
|
375
|
-
ifMatch: etag,
|
|
376
|
-
});
|
|
414
|
+
const result = await this.client.synonymMaps.createOrUpdate(synonymMap.name, utils.publicSynonymMapToGeneratedSynonymMap(synonymMap), Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
377
415
|
return utils.generatedSynonymMapToPublicSynonymMap(result);
|
|
378
416
|
}
|
|
379
417
|
catch (e) {
|
|
@@ -397,10 +435,7 @@ export class SearchIndexClient {
|
|
|
397
435
|
try {
|
|
398
436
|
const indexName = typeof index === "string" ? index : index.name;
|
|
399
437
|
const etag = typeof index === "string" ? undefined : options.onlyIfUnchanged ? index.etag : undefined;
|
|
400
|
-
await this.client.indexes.delete(indexName, {
|
|
401
|
-
...updatedOptions,
|
|
402
|
-
ifMatch: etag,
|
|
403
|
-
});
|
|
438
|
+
await this.client.indexes.delete(indexName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
404
439
|
}
|
|
405
440
|
catch (e) {
|
|
406
441
|
span.setStatus({
|
|
@@ -427,10 +462,7 @@ export class SearchIndexClient {
|
|
|
427
462
|
: options.onlyIfUnchanged
|
|
428
463
|
? synonymMap.etag
|
|
429
464
|
: undefined;
|
|
430
|
-
await this.client.synonymMaps.delete(synonymMapName, {
|
|
431
|
-
...updatedOptions,
|
|
432
|
-
ifMatch: etag,
|
|
433
|
-
});
|
|
465
|
+
await this.client.synonymMaps.delete(synonymMapName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
434
466
|
}
|
|
435
467
|
catch (e) {
|
|
436
468
|
span.setStatus({
|
|
@@ -452,10 +484,7 @@ export class SearchIndexClient {
|
|
|
452
484
|
const { span, updatedOptions } = createSpan("SearchIndexerClient-createOrUpdateAlias", options);
|
|
453
485
|
try {
|
|
454
486
|
const etag = options.onlyIfUnchanged ? alias.etag : undefined;
|
|
455
|
-
const result = await this.client.aliases.createOrUpdate(alias.name, alias, {
|
|
456
|
-
...updatedOptions,
|
|
457
|
-
ifMatch: etag,
|
|
458
|
-
});
|
|
487
|
+
const result = await this.client.aliases.createOrUpdate(alias.name, alias, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
459
488
|
return result;
|
|
460
489
|
}
|
|
461
490
|
catch (e) {
|
|
@@ -502,10 +531,7 @@ export class SearchIndexClient {
|
|
|
502
531
|
try {
|
|
503
532
|
const aliasName = typeof alias === "string" ? alias : alias.name;
|
|
504
533
|
const etag = typeof alias === "string" ? undefined : options.onlyIfUnchanged ? alias.etag : undefined;
|
|
505
|
-
await this.client.aliases.delete(aliasName, {
|
|
506
|
-
...updatedOptions,
|
|
507
|
-
ifMatch: etag,
|
|
508
|
-
});
|
|
534
|
+
await this.client.aliases.delete(aliasName, Object.assign(Object.assign({}, updatedOptions), { ifMatch: etag }));
|
|
509
535
|
}
|
|
510
536
|
catch (e) {
|
|
511
537
|
span.setStatus({
|
|
@@ -570,7 +596,7 @@ export class SearchIndexClient {
|
|
|
570
596
|
* @param options - Additional arguments
|
|
571
597
|
*/
|
|
572
598
|
async analyzeText(indexName, options) {
|
|
573
|
-
const { abortSignal, requestOptions, tracingOptions,
|
|
599
|
+
const { abortSignal, requestOptions, tracingOptions } = options, restOptions = __rest(options, ["abortSignal", "requestOptions", "tracingOptions"]);
|
|
574
600
|
const operationOptions = {
|
|
575
601
|
abortSignal,
|
|
576
602
|
requestOptions,
|
|
@@ -578,12 +604,7 @@ export class SearchIndexClient {
|
|
|
578
604
|
};
|
|
579
605
|
const { span, updatedOptions } = createSpan("SearchIndexClient-analyzeText", operationOptions);
|
|
580
606
|
try {
|
|
581
|
-
const result = await this.client.indexes.analyze(indexName, {
|
|
582
|
-
...restOptions,
|
|
583
|
-
analyzer: restOptions.analyzerName,
|
|
584
|
-
tokenizer: restOptions.tokenizerName,
|
|
585
|
-
normalizer: restOptions.normalizerName,
|
|
586
|
-
}, updatedOptions);
|
|
607
|
+
const result = await this.client.indexes.analyze(indexName, Object.assign(Object.assign({}, restOptions), { analyzer: restOptions.analyzerName, tokenizer: restOptions.tokenizerName, normalizer: restOptions.normalizerName }), updatedOptions);
|
|
587
608
|
return result;
|
|
588
609
|
}
|
|
589
610
|
catch (e) {
|
|
@@ -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,2BAA2B,CAAC;AAE5E,OAAO,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AA6BpF,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAiD,YA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AC,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;;;;;;;;OAQG;IACI,eAAe,CACpB,SAAiB,EACjB,OAAgC;QAEhC,OAAO,IAAI,YAAY,CACrB,IAAI,CAAC,QAAQ,EACb,SAAS,EACT,IAAI,CAAC,UAAU,EACf,OAAO,IAAI,IAAI,CAAC,OAAO,CACxB,CAAC;IACJ,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 { AnalyzeResult } from \"./generated/service/models\";\nimport { SearchServiceClient as GeneratedClient } from \"./generated/service/searchServiceClient\";\nimport { logger } from \"./logger\";\nimport { createSearchApiKeyCredentialPolicy } from \"./searchApiKeyCredentialPolicy\";\nimport {\n AliasIterator,\n AnalyzeTextOptions,\n CreateAliasOptions,\n CreateIndexOptions,\n CreateOrUpdateAliasOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSynonymMapOptions,\n DeleteAliasOptions,\n DeleteIndexOptions,\n DeleteSynonymMapOptions,\n GetAliasOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n GetServiceStatisticsOptions,\n GetSynonymMapsOptions,\n IndexIterator,\n IndexNameIterator,\n ListAliasesOptions,\n ListIndexesOptions,\n ListSynonymMapsOptions,\n SearchIndex,\n SearchIndexAlias,\n SearchIndexStatistics,\n SearchServiceStatistics,\n SynonymMap,\n} from \"./serviceModels\";\nimport * as utils from \"./serviceUtils\";\nimport { createSpan } from \"./tracing\";\nimport { createOdataMetadataPolicy } from \"./odataMetadataPolicy\";\nimport { SearchClientOptions as GetSearchClientOptions, SearchClient } 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 internalClientPipelineOptions: InternalClientPipelineOptions = {\n ...this.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 this.serviceVersion =\n this.options.serviceVersion ?? this.options.apiVersion ?? utils.defaultServiceVersion;\n this.apiVersion = this.serviceVersion;\n\n this.client = new GeneratedClient(\n this.endpoint,\n this.serviceVersion,\n internalClientPipelineOptions,\n );\n\n if (isTokenCredential(credential)) {\n const scope: string = this.options.audience\n ? `${this.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 * @typeParam TModel - An optional type that represents the documents stored in\n * the search index. For the best typing experience, all non-key fields should\n * be marked optional and nullable, and the key property should have the\n * non-nullable type `string`.\n */\n public getSearchClient<TModel extends object>(\n indexName: string,\n options?: GetSearchClientOptions,\n ): SearchClient<TModel> {\n return new SearchClient<TModel>(\n this.endpoint,\n indexName,\n this.credential,\n options || this.options,\n );\n }\n}\n"]}
|
|
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,2BAA2B,CAAC;AAE5E,OAAO,EAAE,mBAAmB,IAAI,eAAe,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,kCAAkC,EAAE,MAAM,gCAAgC,CAAC;AA6BpF,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAA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,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;;;;;;;;OAQG;IACI,eAAe,CACpB,SAAiB,EACjB,OAAgC;QAEhC,OAAO,IAAI,YAAY,CACrB,IAAI,CAAC,QAAQ,EACb,SAAS,EACT,IAAI,CAAC,UAAU,EACf,OAAO,IAAI,IAAI,CAAC,OAAO,CACxB,CAAC;IACJ,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 { AnalyzeResult } from \"./generated/service/models\";\nimport { SearchServiceClient as GeneratedClient } from \"./generated/service/searchServiceClient\";\nimport { logger } from \"./logger\";\nimport { createSearchApiKeyCredentialPolicy } from \"./searchApiKeyCredentialPolicy\";\nimport {\n AliasIterator,\n AnalyzeTextOptions,\n CreateAliasOptions,\n CreateIndexOptions,\n CreateOrUpdateAliasOptions,\n CreateOrUpdateIndexOptions,\n CreateOrUpdateSynonymMapOptions,\n CreateSynonymMapOptions,\n DeleteAliasOptions,\n DeleteIndexOptions,\n DeleteSynonymMapOptions,\n GetAliasOptions,\n GetIndexOptions,\n GetIndexStatisticsOptions,\n GetServiceStatisticsOptions,\n GetSynonymMapsOptions,\n IndexIterator,\n IndexNameIterator,\n ListAliasesOptions,\n ListIndexesOptions,\n ListSynonymMapsOptions,\n SearchIndex,\n SearchIndexAlias,\n SearchIndexStatistics,\n SearchServiceStatistics,\n SynonymMap,\n} from \"./serviceModels\";\nimport * as utils from \"./serviceUtils\";\nimport { createSpan } from \"./tracing\";\nimport { createOdataMetadataPolicy } from \"./odataMetadataPolicy\";\nimport { SearchClientOptions as GetSearchClientOptions, SearchClient } 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 internalClientPipelineOptions: InternalClientPipelineOptions = {\n ...this.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 this.serviceVersion =\n this.options.serviceVersion ?? this.options.apiVersion ?? utils.defaultServiceVersion;\n this.apiVersion = this.serviceVersion;\n\n this.client = new GeneratedClient(\n this.endpoint,\n this.serviceVersion,\n internalClientPipelineOptions,\n );\n\n if (isTokenCredential(credential)) {\n const scope: string = this.options.audience\n ? `${this.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 * @typeParam TModel - An optional type that represents the documents stored in\n * the search index. For the best typing experience, all non-key fields should\n * be marked optional and nullable, and the key property should have the\n * non-nullable type `string`.\n */\n public getSearchClient<TModel extends object>(\n indexName: string,\n options?: GetSearchClientOptions,\n ): SearchClient<TModel> {\n return new SearchClient<TModel>(\n this.endpoint,\n indexName,\n this.credential,\n options || this.options,\n );\n }\n}\n"]}
|