diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 36d8343e64e7..f5de043e3f43 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1408,6 +1408,7 @@ packages: /@opentelemetry/node/0.22.0_@opentelemetry+api@1.0.3: resolution: {integrity: sha512-+HhGbDruQ7cwejVOIYyxRa28uosnG8W95NiQZ6qE8PXXPsDSyGeftAPbtYpGit0H2f5hrVcMlwmWHeAo9xkSLA==} engines: {node: '>=8.0.0'} + deprecated: Package renamed to @opentelemetry/sdk-trace-node peerDependencies: '@opentelemetry/api': ^1.0.0 dependencies: @@ -2792,7 +2793,7 @@ packages: /core-js/2.6.12: resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} - deprecated: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. + deprecated: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. requiresBuild: true dev: false @@ -8066,7 +8067,7 @@ packages: dev: false file:projects/arm-batch.tgz: - resolution: {integrity: sha512-QDWMjs1TGNDU/wHWTMlAvGsBnDgX25veyFnRoHZCFlbWTTMY/yrt9teLhcXL8Jcrbn1fyEApNNtrcw0iFarr+A==, tarball: file:projects/arm-batch.tgz} + resolution: {integrity: sha512-3Icocw0QnB8/JYmiR/jIr/2A2XhYvFbte2ah1d8s7Mx4Bb23RCnZjTREPQinlGgdpuNSUL0va2ixFwyXTRCiBA==, tarball: file:projects/arm-batch.tgz} name: '@rush-temp/arm-batch' version: 0.0.0 dependencies: @@ -11887,14 +11888,14 @@ packages: dev: false file:projects/perf-search-documents.tgz: - resolution: {integrity: sha512-a5TdwW3am8vY/JPngbKHtzKUqkR6pvnUsQVHwOOH8VSdyKMWaxDDndLG49y1cAUCX9UKpFfxx7snTAm1Gh+SQg==, tarball: file:projects/perf-search-documents.tgz} + resolution: {integrity: sha512-bWYNxuFrCq2vaETECiEOezIqefS87rjYMH1x78m9obtk1B2SHnjhPZafV29/nHiI3q+DL0jVlydcJSyI4e2USg==, tarball: file:projects/perf-search-documents.tgz} name: '@rush-temp/perf-search-documents' version: 0.0.0 dependencies: '@types/node': 12.20.37 dotenv: 8.6.0 eslint: 7.32.0 - prettier: 1.19.1 + prettier: 2.5.1 rimraf: 3.0.2 ts-node: 10.4.0_276ff2ad8f60608417677a4691c0f835 tslib: 2.3.1 @@ -12339,7 +12340,7 @@ packages: dev: false file:projects/search-documents.tgz: - resolution: {integrity: sha512-ojTJp1YUTBaGGVHEKSbVrXNwr21YCOw8jwMSccBRKH79hKsGM/LyP+HV++BCMoxiFpYBFieeOdr7pSqLdgYo/w==, tarball: file:projects/search-documents.tgz} + resolution: {integrity: sha512-I6kFqKY744occjIC9lcpQPR/+nuOMbO60AL2wPVl6HOxxyulw07zh/AImKLDiY2/v3iAVQ9LvJ2BHnHUQNuNtw==, tarball: file:projects/search-documents.tgz} name: '@rush-temp/search-documents' version: 0.0.0 dependencies: @@ -12371,7 +12372,7 @@ packages: mocha: 7.2.0 mocha-junit-reporter: 2.0.2_mocha@7.2.0 nyc: 15.1.0 - prettier: 1.19.1 + prettier: 2.5.1 rimraf: 3.0.2 rollup: 1.32.1 sinon: 9.2.4 diff --git a/sdk/search/perf-tests/search-documents/package.json b/sdk/search/perf-tests/search-documents/package.json index 595a0912959c..fa63a3196657 100644 --- a/sdk/search/perf-tests/search-documents/package.json +++ b/sdk/search/perf-tests/search-documents/package.json @@ -16,7 +16,7 @@ "devDependencies": { "@types/node": "^12.0.0", "eslint": "^7.15.0", - "prettier": "^1.16.4", + "prettier": "^2.5.1", "rimraf": "^3.0.0", "tslib": "^2.2.0", "ts-node": "^10.0.0", @@ -29,9 +29,9 @@ "build": "npm run clean && tsc -p .", "build:samples": "echo skipped", "build:test": "echo skipped", - "check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"", "clean": "rimraf dist dist-* types *.tgz *.log", - "format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"test/**/*.ts\" \"*.{js,json}\"", "integration-test:browser": "echo skipped", "integration-test:node": "echo skipped", "integration-test": "echo skipped", diff --git a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts index 3aeb51c9475e..18bd08496e67 100644 --- a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts @@ -8,8 +8,8 @@ export class AutoCompleteTest extends SearchDocumentsBase> extends PerfTest< - TOptions -> { +export abstract class SearchDocumentsBase< + TOptions = Record +> extends PerfTest { searchIndexClient: SearchIndexClient; searchClient: SearchClient; indexName: string; @@ -40,26 +40,26 @@ export abstract class SearchDocumentsBase> ex name: "hotelId", key: true, filterable: true, - sortable: true + sortable: true, }, { type: "Edm.String", name: "hotelName", searchable: true, filterable: true, - sortable: true + sortable: true, }, { type: "Edm.String", name: "description", searchable: true, - analyzerName: KnownAnalyzerNames.EnLucene + analyzerName: KnownAnalyzerNames.EnLucene, }, { type: "Edm.String", name: "descriptionFr", searchable: true, - analyzerName: KnownAnalyzerNames.FrLucene + analyzerName: KnownAnalyzerNames.FrLucene, }, { type: "Edm.String", @@ -67,48 +67,48 @@ export abstract class SearchDocumentsBase> ex searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Collection(Edm.String)", name: "tags", searchable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Boolean", name: "parkingIncluded", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.Boolean", name: "smokingAllowed", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.DateTimeOffset", name: "lastRenovationDate", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.Double", name: "rating", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.GeographyPoint", name: "location", filterable: true, - sortable: true + sortable: true, }, { type: "Edm.ComplexType", @@ -117,7 +117,7 @@ export abstract class SearchDocumentsBase> ex { type: "Edm.String", name: "streetAddress", - searchable: true + searchable: true, }, { type: "Edm.String", @@ -125,7 +125,7 @@ export abstract class SearchDocumentsBase> ex searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.String", @@ -133,7 +133,7 @@ export abstract class SearchDocumentsBase> ex searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.String", @@ -141,7 +141,7 @@ export abstract class SearchDocumentsBase> ex searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.String", @@ -149,9 +149,9 @@ export abstract class SearchDocumentsBase> ex searchable: true, filterable: true, sortable: true, - facetable: true - } - ] + facetable: true, + }, + ], }, { type: "Collection(Edm.ComplexType)", @@ -161,62 +161,62 @@ export abstract class SearchDocumentsBase> ex type: "Edm.String", name: "description", searchable: true, - analyzerName: KnownAnalyzerNames.EnLucene + analyzerName: KnownAnalyzerNames.EnLucene, }, { type: "Edm.String", name: "descriptionFr", searchable: true, - analyzerName: KnownAnalyzerNames.FrLucene + analyzerName: KnownAnalyzerNames.FrLucene, }, { type: "Edm.String", name: "type", searchable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Double", name: "baseRate", filterable: true, - facetable: true + facetable: true, }, { type: "Edm.String", name: "bedOptions", searchable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Int32", name: "sleepsCount", filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Boolean", name: "smokingAllowed", filterable: true, - facetable: true + facetable: true, }, { type: "Collection(Edm.String)", name: "tags", searchable: true, filterable: true, - facetable: true - } - ] - } + facetable: true, + }, + ], + }, ], suggesters: [ { name: "sg", searchMode: "analyzingInfixMatching", - sourceFields: ["description", "hotelName"] - } + sourceFields: ["description", "hotelName"], + }, ], scoringProfiles: [ { @@ -229,16 +229,16 @@ export abstract class SearchDocumentsBase> ex boost: 2, parameters: { referencePointParameter: "myloc", - boostingDistance: 100 - } - } - ] - } + boostingDistance: 100, + }, + }, + ], + }, ], corsOptions: { // for browser tests - allowedOrigins: ["*"] - } + allowedOrigins: ["*"], + }, }; await this.searchIndexClient.createIndex(hotelIndex); } diff --git a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts index 963f936b6f2b..0af32d86fb0a 100644 --- a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts @@ -11,8 +11,8 @@ export class IndexDocumentsTest extends SearchDocumentsBase description: "Number of Documents to be created", shortName: "dc", longName: "documentsCount", - defaultValue: 10 - } + defaultValue: 10, + }, }; constructor() { diff --git a/sdk/search/search-documents/karma.conf.js b/sdk/search/search-documents/karma.conf.js index 8dfa92ac4fd5..554afd8cac83 100644 --- a/sdk/search/search-documents/karma.conf.js +++ b/sdk/search/search-documents/karma.conf.js @@ -5,9 +5,9 @@ const { jsonRecordingFilterFunction, isPlaybackMode, isSoftRecordMode, - isRecordMode + isRecordMode, } = require("@azure-tools/test-recorder"); -module.exports = function(config) { +module.exports = function (config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: "./", @@ -28,13 +28,13 @@ module.exports = function(config) { "karma-sourcemap-loader", "karma-junit-reporter", "karma-json-to-file-reporter", - "karma-json-preprocessor" + "karma-json-preprocessor", ], // list of files / patterns to load in the browser files: [ "dist-test/index.browser.js", - { pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true } + { pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }, ].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []), // list of files / patterns to exclude @@ -47,7 +47,7 @@ module.exports = function(config) { "recordings/browsers/**/*.json": ["json"], // IMPORTANT: COMMENT following line if you want to debug in your browsers!! // Preprocess source file to calculate code coverage, however this will make source file unreadable - "dist-test/index.js": ["coverage"] + "dist-test/index.js": ["coverage"], }, // inject following environment values into browser testing with window.__env__ @@ -67,8 +67,8 @@ module.exports = function(config) { { type: "json", subdir: ".", file: "coverage.json" }, { type: "lcovonly", subdir: ".", file: "lcov.info" }, { type: "html", subdir: "html" }, - { type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" } - ] + { type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }, + ], }, junitReporter: { @@ -78,12 +78,12 @@ module.exports = function(config) { useBrowserName: false, // add browser name to report and classes names nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element - properties: {} // key value pair of properties to add to the section of the report + properties: {}, // key value pair of properties to add to the section of the report }, jsonToFileReporter: { filter: jsonRecordingFilterFunction, - outputPath: "." + outputPath: ".", }, // web server port @@ -117,15 +117,15 @@ module.exports = function(config) { browserDisconnectTolerance: 3, browserConsoleLogOptions: { - terminal: !isRecordMode() + terminal: !isRecordMode(), }, client: { mocha: { // change Karma's debug.html to the mocha web reporter reporter: "html", - timeout: "600000" - } - } + timeout: "600000", + }, + }, }); }; diff --git a/sdk/search/search-documents/package.json b/sdk/search/search-documents/package.json index 8f0a97063b8f..3bf3ae4d0e2b 100644 --- a/sdk/search/search-documents/package.json +++ b/sdk/search/search-documents/package.json @@ -113,7 +113,7 @@ "mocha": "^7.1.1", "mocha-junit-reporter": "^2.0.0", "nyc": "^15.0.0", - "prettier": "^1.16.4", + "prettier": "^2.5.1", "rimraf": "^3.0.0", "rollup": "^1.16.3", "sinon": "^9.0.2", diff --git a/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushSize.ts b/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushSize.ts index b54381521708..a5f5e67c37a7 100644 --- a/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushSize.ts +++ b/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushSize.ts @@ -10,7 +10,7 @@ import { AzureKeyCredential, SearchClient, GeographyPoint, - SearchIndexClient + SearchIndexClient, } from "@azure/search-documents"; import { createIndex, documentKeyRetriever, WAIT_TIME, delay } from "./setup"; import { Hotel } from "./interfaces"; @@ -51,8 +51,8 @@ function getDocumentsArray(size: number): Hotel[] { rating: 5, location: new GeographyPoint({ longitude: -122.131577, - latitude: 47.678581 - }) + latitude: 47.678581, + }), }); } return array; @@ -81,7 +81,7 @@ async function main() { searchClient, documentKeyRetriever, { - autoFlush: true + autoFlush: true, } ); diff --git a/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushTimer.ts b/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushTimer.ts index c9a1f2391291..e436edad52a1 100644 --- a/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushTimer.ts +++ b/sdk/search/search-documents/samples-dev/bufferedSenderAutoFlushTimer.ts @@ -11,7 +11,7 @@ import { SearchClient, GeographyPoint, SearchIndexClient, - DEFAULT_FLUSH_WINDOW + DEFAULT_FLUSH_WINDOW, } from "@azure/search-documents"; import { createIndex, documentKeyRetriever, WAIT_TIME, delay } from "./setup"; import { Hotel } from "./interfaces"; @@ -53,7 +53,7 @@ export async function main() { searchClient, documentKeyRetriever, { - autoFlush: true + autoFlush: true, } ); @@ -95,9 +95,9 @@ export async function main() { rating: 5, location: new GeographyPoint({ longitude: -122.131577, - latitude: 47.678581 - }) - } + latitude: 47.678581, + }), + }, ]); const wait_time = DEFAULT_FLUSH_WINDOW + 5000; diff --git a/sdk/search/search-documents/samples-dev/bufferedSenderManualFlush.ts b/sdk/search/search-documents/samples-dev/bufferedSenderManualFlush.ts index c289c4d6c957..8ce2e0b3d440 100644 --- a/sdk/search/search-documents/samples-dev/bufferedSenderManualFlush.ts +++ b/sdk/search/search-documents/samples-dev/bufferedSenderManualFlush.ts @@ -10,7 +10,7 @@ import { AzureKeyCredential, SearchClient, GeographyPoint, - SearchIndexClient + SearchIndexClient, } from "@azure/search-documents"; import { createIndex, documentKeyRetriever, WAIT_TIME, delay } from "./setup"; import { Hotel } from "./interfaces"; @@ -50,7 +50,7 @@ export async function main() { searchClient, documentKeyRetriever, { - autoFlush: false + autoFlush: false, } ); @@ -92,9 +92,9 @@ export async function main() { rating: 5, location: new GeographyPoint({ longitude: -122.131577, - latitude: 47.678581 - }) - } + latitude: 47.678581, + }), + }, ]); await bufferedClient.flush(); diff --git a/sdk/search/search-documents/samples-dev/dataSourceConnectionOperations.ts b/sdk/search/search-documents/samples-dev/dataSourceConnectionOperations.ts index 8b0416617bc1..49c45e886cc3 100644 --- a/sdk/search/search-documents/samples-dev/dataSourceConnectionOperations.ts +++ b/sdk/search/search-documents/samples-dev/dataSourceConnectionOperations.ts @@ -8,7 +8,7 @@ import { SearchIndexerClient, AzureKeyCredential, - SearchIndexerDataSourceConnection + SearchIndexerDataSourceConnection, } from "@azure/search-documents"; import * as dotenv from "dotenv"; @@ -29,9 +29,9 @@ async function createDataSourceConnection( description: "My Data Source 1", type: "cosmosdb", container: { - name: "my-container-1" + name: "my-container-1", }, - connectionString + connectionString, }; await client.createDataSourceConnection(dataSourceConnection); } @@ -51,7 +51,8 @@ async function getAndUpdateDataSourceConnection( async function listDataSourceConnections(client: SearchIndexerClient) { console.log(`List DS Connection Operation`); - const listOfDataSourceConnections: Array = await client.listDataSourceConnections(); + const listOfDataSourceConnections: Array = + await client.listDataSourceConnections(); console.log(`List of Data Source Connections`); console.log(`*******************************`); diff --git a/sdk/search/search-documents/samples-dev/indexOperations.ts b/sdk/search/search-documents/samples-dev/indexOperations.ts index 4c1c8905cce6..9ba3e3da83b9 100644 --- a/sdk/search/search-documents/samples-dev/indexOperations.ts +++ b/sdk/search/search-documents/samples-dev/indexOperations.ts @@ -9,7 +9,7 @@ import { SearchIndexClient, AzureKeyCredential, SearchIndex, - SearchIndexStatistics + SearchIndexStatistics, } from "@azure/search-documents"; import * as dotenv from "dotenv"; @@ -27,19 +27,19 @@ async function createIndex(indexName: string, client: SearchIndexClient) { { type: "Edm.String", name: "id", - key: true + key: true, }, { type: "Edm.Double", name: "awesomenessLevel", sortable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.String", name: "description", - searchable: true + searchable: true, }, { type: "Edm.ComplexType", @@ -48,16 +48,16 @@ async function createIndex(indexName: string, client: SearchIndexClient) { { type: "Collection(Edm.String)", name: "tags", - searchable: true - } - ] + searchable: true, + }, + ], }, { type: "Edm.Int32", name: "hiddenWeight", - hidden: true - } - ] + hidden: true, + }, + ], }; await client.createIndex(index); } @@ -68,7 +68,7 @@ async function getAndUpdateIndex(indexName: string, client: SearchIndexClient) { index.fields.push({ type: "Edm.DateTimeOffset", name: "lastUpdatedOn", - filterable: true + filterable: true, }); await client.createOrUpdateIndex(index); } diff --git a/sdk/search/search-documents/samples-dev/indexerOperations.ts b/sdk/search/search-documents/samples-dev/indexerOperations.ts index 52b41fcd9ee4..1e61c2374071 100644 --- a/sdk/search/search-documents/samples-dev/indexerOperations.ts +++ b/sdk/search/search-documents/samples-dev/indexerOperations.ts @@ -9,7 +9,7 @@ import { SearchIndexerClient, AzureKeyCredential, SearchIndexer, - SearchIndexerStatus + SearchIndexerStatus, } from "@azure/search-documents"; import * as dotenv from "dotenv"; @@ -29,7 +29,7 @@ async function createIndexer(indexerName: string, client: SearchIndexerClient) { description: "Description for Sample Indexer", dataSourceName, targetIndexName, - isDisabled: false + isDisabled: false, }; await client.createIndexer(indexer); } diff --git a/sdk/search/search-documents/samples-dev/setup.ts b/sdk/search/search-documents/samples-dev/setup.ts index 472cfa45ed4f..7a24ef76a7d2 100644 --- a/sdk/search/search-documents/samples-dev/setup.ts +++ b/sdk/search/search-documents/samples-dev/setup.ts @@ -34,26 +34,26 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom name: "hotelId", key: true, filterable: true, - sortable: true + sortable: true, }, { type: "Edm.String", name: "hotelName", searchable: true, filterable: true, - sortable: true + sortable: true, }, { type: "Edm.String", name: "description", searchable: true, - analyzerName: KnownAnalyzerNames.EnLucene + analyzerName: KnownAnalyzerNames.EnLucene, }, { type: "Edm.String", name: "descriptionFr", searchable: true, - analyzerName: KnownAnalyzerNames.FrLucene + analyzerName: KnownAnalyzerNames.FrLucene, }, { type: "Edm.String", @@ -61,48 +61,48 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Collection(Edm.String)", name: "tags", searchable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Boolean", name: "parkingIncluded", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.Boolean", name: "smokingAllowed", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.DateTimeOffset", name: "lastRenovationDate", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.Double", name: "rating", filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.GeographyPoint", name: "location", filterable: true, - sortable: true + sortable: true, }, { type: "Edm.ComplexType", @@ -111,7 +111,7 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom { type: "Edm.String", name: "streetAddress", - searchable: true + searchable: true, }, { type: "Edm.String", @@ -119,7 +119,7 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.String", @@ -127,7 +127,7 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.String", @@ -135,7 +135,7 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom searchable: true, filterable: true, sortable: true, - facetable: true + facetable: true, }, { type: "Edm.String", @@ -143,9 +143,9 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom searchable: true, filterable: true, sortable: true, - facetable: true - } - ] + facetable: true, + }, + ], }, { type: "Collection(Edm.ComplexType)", @@ -155,62 +155,62 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom type: "Edm.String", name: "description", searchable: true, - analyzerName: KnownAnalyzerNames.EnLucene + analyzerName: KnownAnalyzerNames.EnLucene, }, { type: "Edm.String", name: "descriptionFr", searchable: true, - analyzerName: KnownAnalyzerNames.FrLucene + analyzerName: KnownAnalyzerNames.FrLucene, }, { type: "Edm.String", name: "type", searchable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Double", name: "baseRate", filterable: true, - facetable: true + facetable: true, }, { type: "Edm.String", name: "bedOptions", searchable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Int32", name: "sleepsCount", filterable: true, - facetable: true + facetable: true, }, { type: "Edm.Boolean", name: "smokingAllowed", filterable: true, - facetable: true + facetable: true, }, { type: "Collection(Edm.String)", name: "tags", searchable: true, filterable: true, - facetable: true - } - ] - } + facetable: true, + }, + ], + }, ], suggesters: [ { name: "sg", sourceFields: ["description", "hotelName"], - searchMode: "analyzingInfixMatching" - } + searchMode: "analyzingInfixMatching", + }, ], scoringProfiles: [ { @@ -223,16 +223,16 @@ export async function createIndex(client: SearchIndexClient, name: string): Prom boost: 2, parameters: { referencePointParameter: "myloc", - boostingDistance: 100 - } - } - ] - } + boostingDistance: 100, + }, + }, + ], + }, ], corsOptions: { // for browser tests - allowedOrigins: ["*"] - } + allowedOrigins: ["*"], + }, }; await client.createIndex(hotelIndex); } diff --git a/sdk/search/search-documents/samples-dev/skillSetOperations.ts b/sdk/search/search-documents/samples-dev/skillSetOperations.ts index 488b381c75ba..e357bb8efa8c 100644 --- a/sdk/search/search-documents/samples-dev/skillSetOperations.ts +++ b/sdk/search/search-documents/samples-dev/skillSetOperations.ts @@ -8,7 +8,7 @@ import { SearchIndexerClient, AzureKeyCredential, - SearchIndexerSkillset + SearchIndexerSkillset, } from "@azure/search-documents"; import * as dotenv from "dotenv"; @@ -30,29 +30,29 @@ async function createSkillset(skillsetName: string, client: SearchIndexerClient) inputs: [ { name: "text", - source: "/document/merged_content" + source: "/document/merged_content", }, { name: "languageCode", - source: "/document/language" - } + source: "/document/language", + }, ], outputs: [ { name: "persons", - targetName: "people" + targetName: "people", }, { name: "organizations", - targetName: "organizations" + targetName: "organizations", }, { name: "locations", - targetName: "locations" - } - ] - } - ] + targetName: "locations", + }, + ], + }, + ], }; await client.createSkillset(skillset); } @@ -64,12 +64,12 @@ async function getAndUpdateSkillset(skillsetName: string, client: SearchIndexerC skillset.skills[0].outputs = [ { name: "persons", - targetName: "people" + targetName: "people", }, { name: "organizations", - targetName: "organizations" - } + targetName: "organizations", + }, ]; await client.createOrUpdateSkillset(skillset); diff --git a/sdk/search/search-documents/samples-dev/synonymMapOperations.ts b/sdk/search/search-documents/samples-dev/synonymMapOperations.ts index 3609f20c8344..56bcf98f75c5 100644 --- a/sdk/search/search-documents/samples-dev/synonymMapOperations.ts +++ b/sdk/search/search-documents/samples-dev/synonymMapOperations.ts @@ -18,7 +18,7 @@ async function createSynonymMap(synonymMapName: string, client: SearchIndexClien console.log(`Creating SynonymMap Operation`); const sm: SynonymMap = { name: synonymMapName, - synonyms: ["United States, United States of America => USA", "Washington, Wash. => WA"] + synonyms: ["United States, United States of America => USA", "Washington, Wash. => WA"], }; await client.createSynonymMap(sm); } diff --git a/sdk/search/search-documents/src/geographyPoint.ts b/sdk/search/search-documents/src/geographyPoint.ts index 9eafdb09e18a..6fc07ee7d14a 100644 --- a/sdk/search/search-documents/src/geographyPoint.ts +++ b/sdk/search/search-documents/src/geographyPoint.ts @@ -33,7 +33,7 @@ export default class GeographyPoint { return { type: "Point", coordinates: [this.longitude, this.latitude], - crs: { type: "name", properties: { name: WorldGeodeticSystem1984 } } + crs: { type: "name", properties: { name: WorldGeodeticSystem1984 } }, }; } } diff --git a/sdk/search/search-documents/src/index.ts b/sdk/search/search-documents/src/index.ts index bfaf171875f3..f179fd383655 100644 --- a/sdk/search/search-documents/src/index.ts +++ b/sdk/search/search-documents/src/index.ts @@ -5,7 +5,7 @@ export { SearchClient, SearchClientOptions } from "./searchClient"; export { DEFAULT_BATCH_SIZE, DEFAULT_FLUSH_WINDOW, - DEFAULT_RETRY_COUNT + DEFAULT_RETRY_COUNT, } from "./searchIndexingBufferedSender"; export { AutocompleteRequest, @@ -36,7 +36,7 @@ export { SearchIndexingBufferedSenderFlushDocumentsOptions, SearchIndexingBufferedSenderMergeDocumentsOptions, SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions, - SearchIndexingBufferedSenderUploadDocumentsOptions + SearchIndexingBufferedSenderUploadDocumentsOptions, } from "./indexModels"; export { SearchIndexingBufferedSender, IndexDocumentsClient } from "./searchIndexingBufferedSender"; export { SearchIndexClient, SearchIndexClientOptions } from "./searchIndexClient"; @@ -114,7 +114,7 @@ export { LexicalNormalizer, SearchIndexerDataIdentity, ResetDocumentsOptions, - ResetSkillsOptions + ResetSkillsOptions, } from "./serviceModels"; export { default as GeographyPoint } from "./geographyPoint"; export { odata } from "./odata"; @@ -144,7 +144,7 @@ export { QuerySpellerType, KnownQuerySpellerType, KnownQueryAnswerType, - KnownQueryCaptionType + KnownQueryCaptionType, } from "./generated/data/models"; export { RegexFlags, @@ -329,7 +329,7 @@ export { SemanticSettings, SemanticConfiguration, PrioritizedFields, - SemanticField + SemanticField, } from "./generated/service/models"; export { AzureKeyCredential } from "@azure/core-auth"; export { createSynonymMapFromFile } from "./synonymMapHelper"; diff --git a/sdk/search/search-documents/src/indexDocumentsBatch.ts b/sdk/search/search-documents/src/indexDocumentsBatch.ts index 4df575e7e02b..28910ac384f3 100644 --- a/sdk/search/search-documents/src/indexDocumentsBatch.ts +++ b/sdk/search/search-documents/src/indexDocumentsBatch.ts @@ -25,7 +25,7 @@ export class IndexDocumentsBatch { const batch = documents.map>((doc) => { return { ...doc, - __actionType: "upload" + __actionType: "upload", }; }); @@ -41,7 +41,7 @@ export class IndexDocumentsBatch { const batch = documents.map>((doc) => { return { ...doc, - __actionType: "merge" + __actionType: "merge", }; }); @@ -57,7 +57,7 @@ export class IndexDocumentsBatch { const batch = documents.map>((doc) => { return { ...doc, - __actionType: "mergeOrUpload" + __actionType: "mergeOrUpload", }; }); @@ -84,7 +84,7 @@ export class IndexDocumentsBatch { const batch = keyValues.map>((keyValue) => { return { __actionType: "delete", - [keyName]: keyValue + [keyName]: keyValue, } as IndexDocumentsAction; }); @@ -95,7 +95,7 @@ export class IndexDocumentsBatch { const batch = documents.map>((document) => { return { __actionType: "delete", - ...document + ...document, } as IndexDocumentsAction; }); diff --git a/sdk/search/search-documents/src/indexModels.ts b/sdk/search/search-documents/src/indexModels.ts index 89c2a22570f5..745af2f4986e 100644 --- a/sdk/search/search-documents/src/indexModels.ts +++ b/sdk/search/search-documents/src/indexModels.ts @@ -17,7 +17,7 @@ import { Captions, QuerySpellerType, QueryAnswerType, - QueryCaptionType + QueryCaptionType, } from "./generated/data/models"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; diff --git a/sdk/search/search-documents/src/odataMetadataPolicy.ts b/sdk/search/search-documents/src/odataMetadataPolicy.ts index 9bad7ded9b5e..badab436e202 100644 --- a/sdk/search/search-documents/src/odataMetadataPolicy.ts +++ b/sdk/search/search-documents/src/odataMetadataPolicy.ts @@ -5,7 +5,7 @@ import { PipelinePolicy, PipelineRequest, SendRequest, - PipelineResponse + PipelineResponse, } from "@azure/core-rest-pipeline"; const AcceptHeaderName = "Accept"; @@ -23,6 +23,6 @@ export function createOdataMetadataPolicy(metadataLevel: MetadataLevel): Pipelin async sendRequest(request: PipelineRequest, next: SendRequest): Promise { request.headers.set(AcceptHeaderName, `application/json;odata.metadata=${metadataLevel}`); return next(request); - } + }, }; } diff --git a/sdk/search/search-documents/src/searchApiKeyCredentialPolicy.ts b/sdk/search/search-documents/src/searchApiKeyCredentialPolicy.ts index 6e1ce419676b..bbcfae9ce93f 100644 --- a/sdk/search/search-documents/src/searchApiKeyCredentialPolicy.ts +++ b/sdk/search/search-documents/src/searchApiKeyCredentialPolicy.ts @@ -6,7 +6,7 @@ import { PipelinePolicy, PipelineRequest, SendRequest, - PipelineResponse + PipelineResponse, } from "@azure/core-rest-pipeline"; const API_KEY_HEADER_NAME = "api-key"; @@ -24,6 +24,6 @@ export function createSearchApiKeyCredentialPolicy(credential: KeyCredential): P request.headers.set(API_KEY_HEADER_NAME, credential.key); } return next(request); - } + }, }; } diff --git a/sdk/search/search-documents/src/searchClient.ts b/sdk/search/search-documents/src/searchClient.ts index 758618df3f6b..ab1634a39d20 100644 --- a/sdk/search/search-documents/src/searchClient.ts +++ b/sdk/search/search-documents/src/searchClient.ts @@ -6,7 +6,7 @@ import { CommonClientOptions, InternalClientPipelineOptions, - OperationOptions + OperationOptions, } from "@azure/core-client"; import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline"; import { SearchClient as GeneratedClient } from "./generated/data/searchClient"; @@ -18,7 +18,7 @@ import { AutocompleteResult, AutocompleteRequest, SuggestRequest, - IndexDocumentsResult + IndexDocumentsResult, } from "./generated/data/models"; import { createSpan } from "./tracing"; import { SpanStatusCode } from "@azure/core-tracing"; @@ -40,7 +40,7 @@ import { DeleteDocumentsOptions, SearchDocumentsPageResult, MergeOrUploadDocumentsOptions, - SearchRequest + SearchRequest, } from "./indexModels"; import { createOdataMetadataPolicy } from "./odataMetadataPolicy"; import { IndexDocumentsBatch } from "./indexDocumentsBatch"; @@ -151,10 +151,10 @@ export class SearchClient implements IndexDocumentsClient { "OData-MaxVersion", "OData-Version", "Prefer", - "throttle-reason" - ] - } - } + "throttle-reason", + ], + }, + }, }; if (options.apiVersion) { @@ -201,14 +201,14 @@ export class SearchClient implements IndexDocumentsClient { ...updatedOptions, onResponse: (response) => { documentsCount = Number(response.bodyAsText); - } + }, }); return documentsCount; } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -234,7 +234,7 @@ export class SearchClient implements IndexDocumentsClient { searchText: searchText, suggesterName: suggesterName, searchFields: this.convertSearchFields(searchFields), - ...nonFieldOptions + ...nonFieldOptions, }; if (!fullOptions.searchText) { @@ -253,7 +253,7 @@ export class SearchClient implements IndexDocumentsClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -274,7 +274,7 @@ export class SearchClient implements IndexDocumentsClient { select: this.convertSelect(select), orderBy: this.convertOrderBy(orderBy), ...nonFieldOptions, - ...nextPageParameters + ...nextPageParameters, }; const { span, updatedOptions } = createSpan("SearchClient-searchDocuments", operationOptions); @@ -284,7 +284,7 @@ export class SearchClient implements IndexDocumentsClient { { ...fullOptions, includeTotalResultCount: fullOptions.includeTotalCount, - searchText: searchText + searchText: searchText, }, updatedOptions ); @@ -299,14 +299,14 @@ export class SearchClient implements IndexDocumentsClient { coverage, facets, answers, - continuationToken: this.encodeContinuationToken(nextLink, result.nextPageParameters) + continuationToken: this.encodeContinuationToken(nextLink, result.nextPageParameters), }; return deserialize>>(converted); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -349,7 +349,7 @@ export class SearchClient implements IndexDocumentsClient { yield* firstPage.results; if (firstPage.continuationToken) { for await (const page of this.listSearchResultsPage(searchText, options, { - continuationToken: firstPage.continuationToken + continuationToken: firstPage.continuationToken, })) { yield* page.results; } @@ -372,7 +372,7 @@ export class SearchClient implements IndexDocumentsClient { }, byPage: (settings: ListSearchResultsPageSettings = {}) => { return this.listSearchResultsPage(searchText, options, settings); - } + }, }; } @@ -398,12 +398,12 @@ export class SearchClient implements IndexDocumentsClient { coverage, facets, answers, - results: this.listSearchResults(pageResult, searchText, updatedOptions) + results: this.listSearchResults(pageResult, searchText, updatedOptions), }; } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -431,7 +431,7 @@ export class SearchClient implements IndexDocumentsClient { searchFields: this.convertSearchFields(searchFields), select: this.convertSelect(select), orderBy: this.convertOrderBy(orderBy), - ...nonFieldOptions + ...nonFieldOptions, }; if (!fullOptions.searchText) { @@ -447,15 +447,14 @@ export class SearchClient implements IndexDocumentsClient { try { const result = await this.client.documents.suggestPost(fullOptions, updatedOptions); - const modifiedResult = utils.generatedSuggestDocumentsResultToPublicSuggestDocumentsResult( - result - ); + const modifiedResult = + utils.generatedSuggestDocumentsResultToPublicSuggestDocumentsResult(result); return deserialize>>(modifiedResult); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -479,7 +478,7 @@ export class SearchClient implements IndexDocumentsClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -511,7 +510,7 @@ export class SearchClient implements IndexDocumentsClient { ...updatedOptions, onResponse: (response) => { status = response.status; - } + }, } ); if (options.throwOnAnyFailure && status === 207) { @@ -521,7 +520,7 @@ export class SearchClient implements IndexDocumentsClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -548,7 +547,7 @@ export class SearchClient implements IndexDocumentsClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -576,7 +575,7 @@ export class SearchClient implements IndexDocumentsClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -604,7 +603,7 @@ export class SearchClient implements IndexDocumentsClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -653,7 +652,7 @@ export class SearchClient implements IndexDocumentsClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -671,7 +670,7 @@ export class SearchClient implements IndexDocumentsClient { const payload = JSON.stringify({ apiVersion: this.apiVersion, nextLink, - nextPageParameters + nextPageParameters, }); return encode(payload); } @@ -698,7 +697,7 @@ export class SearchClient implements IndexDocumentsClient { return { nextLink: result.nextLink, - nextPageParameters: result.nextPageParameters + nextPageParameters: result.nextPageParameters, }; } catch (e) { throw new Error(`Corrupted or invalid continuation token: ${decodedToken}`); @@ -718,9 +717,9 @@ export class SearchClient implements IndexDocumentsClient { operationOptions: { abortSignal, requestOptions, - tracingOptions + tracingOptions, }, - restOptions + restOptions, }; } diff --git a/sdk/search/search-documents/src/searchIndexClient.ts b/sdk/search/search-documents/src/searchIndexClient.ts index a085f1eb9ed9..55c56a345297 100644 --- a/sdk/search/search-documents/src/searchIndexClient.ts +++ b/sdk/search/search-documents/src/searchIndexClient.ts @@ -31,7 +31,7 @@ import { IndexIterator, IndexNameIterator, SearchIndexStatistics, - SearchServiceStatistics + SearchServiceStatistics, } from "./serviceModels"; import * as utils from "./serviceUtils"; import { createSpan } from "./tracing"; @@ -127,10 +127,10 @@ export class SearchIndexClient { "OData-MaxVersion", "OData-Version", "Prefer", - "throttle-reason" - ] - } - } + "throttle-reason", + ], + }, + }, }; let apiVersion = this.apiVersion; @@ -166,7 +166,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -198,7 +198,7 @@ export class SearchIndexClient { }, byPage: () => { return this.listIndexesPage(options); - } + }, }; } @@ -209,14 +209,14 @@ export class SearchIndexClient { try { const result = await this.client.indexes.list({ ...updatedOptions, - select: "name" + select: "name", }); const mapped = result.indexes.map((idx) => idx.name); yield mapped; } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -248,7 +248,7 @@ export class SearchIndexClient { }, byPage: () => { return this.listIndexesNamesPage(options); - } + }, }; } @@ -264,7 +264,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -281,13 +281,13 @@ export class SearchIndexClient { try { const result = await this.client.synonymMaps.list({ ...updatedOptions, - select: "name" + select: "name", }); return result.synonymMaps.map((sm) => sm.name); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -308,7 +308,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -332,7 +332,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -359,7 +359,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -386,7 +386,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -412,14 +412,14 @@ export class SearchIndexClient { utils.publicIndexToGeneratedIndex(index), { ...updatedOptions, - ifMatch: etag + ifMatch: etag, } ); return utils.generatedIndexToPublicIndex(result); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -448,14 +448,14 @@ export class SearchIndexClient { utils.publicSynonymMapToGeneratedSynonymMap(synonymMap), { ...updatedOptions, - ifMatch: etag + ifMatch: etag, } ); return utils.generatedSynonymMapToPublicSynonymMap(result); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -480,12 +480,12 @@ export class SearchIndexClient { await this.client.indexes.delete(indexName, { ...updatedOptions, - ifMatch: etag + ifMatch: etag, }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -514,12 +514,12 @@ export class SearchIndexClient { await this.client.synonymMaps.delete(synonymMapName, { ...updatedOptions, - ifMatch: etag + ifMatch: etag, }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -544,7 +544,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -563,7 +563,7 @@ export class SearchIndexClient { const operationOptions = { abortSignal, requestOptions, - tracingOptions + tracingOptions, }; const { span, updatedOptions } = createSpan("SearchIndexClient-analyzeText", operationOptions); @@ -574,7 +574,7 @@ export class SearchIndexClient { ...restOptions, analyzer: restOptions.analyzerName, tokenizer: restOptions.tokenizerName, - normalizer: restOptions.normalizerName + normalizer: restOptions.normalizerName, }, updatedOptions ); @@ -582,7 +582,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -604,7 +604,7 @@ export class SearchIndexClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { diff --git a/sdk/search/search-documents/src/searchIndexerClient.ts b/sdk/search/search-documents/src/searchIndexerClient.ts index 68eb94f91f9f..039222a96b06 100644 --- a/sdk/search/search-documents/src/searchIndexerClient.ts +++ b/sdk/search/search-documents/src/searchIndexerClient.ts @@ -33,7 +33,7 @@ import { GetDataSourceConnectionOptions, CreateorUpdateDataSourceConnectionOptions, ResetDocumentsOptions, - ResetSkillsOptions + ResetSkillsOptions, } from "./serviceModels"; import * as utils from "./serviceUtils"; import { createSpan } from "./tracing"; @@ -116,10 +116,10 @@ export class SearchIndexerClient { "OData-MaxVersion", "OData-Version", "Prefer", - "throttle-reason" - ] - } - } + "throttle-reason", + ], + }, + }, }; let apiVersion = this.apiVersion; @@ -156,7 +156,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -173,13 +173,13 @@ export class SearchIndexerClient { try { const result = await this.client.indexers.list({ ...updatedOptions, - select: "name" + select: "name", }); return result.indexers.map((idx) => idx.name); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -204,7 +204,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -226,13 +226,13 @@ export class SearchIndexerClient { try { const result = await this.client.dataSources.list({ ...updatedOptions, - select: "name" + select: "name", }); return result.dataSources.map((ds) => ds.name); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -254,7 +254,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -271,13 +271,13 @@ export class SearchIndexerClient { try { const result = await this.client.skillsets.list({ ...updatedOptions, - select: "name" + select: "name", }); return result.skillsets.map((sks) => sks.name); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -301,7 +301,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -328,7 +328,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -352,7 +352,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -379,7 +379,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -409,7 +409,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -436,7 +436,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -467,14 +467,14 @@ export class SearchIndexerClient { ...updatedOptions, ifMatch: etag, skipIndexerResetRequirementForCache: options.skipIndexerResetRequirementForCache, - disableCacheReprocessingChangeDetection: options.disableCacheReprocessingChangeDetection + disableCacheReprocessingChangeDetection: options.disableCacheReprocessingChangeDetection, } ); return utils.generatedSearchIndexerToPublicSearchIndexer(result); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -504,14 +504,14 @@ export class SearchIndexerClient { { ...updatedOptions, ifMatch: etag, - skipIndexerResetRequirementForCache: options.skipIndexerResetRequirementForCache + skipIndexerResetRequirementForCache: options.skipIndexerResetRequirementForCache, } ); return utils.generatedDataSourceToPublicDataSource(result); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -542,7 +542,7 @@ export class SearchIndexerClient { ...updatedOptions, ifMatch: etag, skipIndexerResetRequirementForCache: options.skipIndexerResetRequirementForCache, - disableCacheReprocessingChangeDetection: options.disableCacheReprocessingChangeDetection + disableCacheReprocessingChangeDetection: options.disableCacheReprocessingChangeDetection, } ); @@ -550,7 +550,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -579,12 +579,12 @@ export class SearchIndexerClient { await this.client.indexers.delete(indexerName, { ...updatedOptions, - ifMatch: etag + ifMatch: etag, }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -617,12 +617,12 @@ export class SearchIndexerClient { await this.client.dataSources.delete(dataSourceConnectionName, { ...updatedOptions, - ifMatch: etag + ifMatch: etag, }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -651,12 +651,12 @@ export class SearchIndexerClient { await this.client.skillsets.delete(skillsetName, { ...updatedOptions, - ifMatch: etag + ifMatch: etag, }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -680,7 +680,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -700,7 +700,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -720,7 +720,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -743,13 +743,13 @@ export class SearchIndexerClient { ...updatedOptions, keysOrIds: { documentKeys: updatedOptions.documentKeys, - datasourceDocumentIds: updatedOptions.datasourceDocumentIds - } + datasourceDocumentIds: updatedOptions.datasourceDocumentIds, + }, }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -774,7 +774,7 @@ export class SearchIndexerClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { diff --git a/sdk/search/search-documents/src/searchIndexingBufferedSender.ts b/sdk/search/search-documents/src/searchIndexingBufferedSender.ts index b6eb722b0e4e..630a753c4ac5 100644 --- a/sdk/search/search-documents/src/searchIndexingBufferedSender.ts +++ b/sdk/search/search-documents/src/searchIndexingBufferedSender.ts @@ -10,7 +10,7 @@ import { SearchIndexingBufferedSenderMergeOrUploadDocumentsOptions, SearchIndexingBufferedSenderDeleteDocumentsOptions, SearchIndexingBufferedSenderFlushDocumentsOptions, - IndexDocumentsOptions + IndexDocumentsOptions, } from "./indexModels"; import { IndexDocumentsResult } from "./generated/data/models"; import { OperationOptions } from "@azure/core-client"; @@ -160,13 +160,13 @@ export class SearchIndexingBufferedSender { this.batchObject.upload(documents); this.emitter.emit("batchAdded", { action: "upload", - documents + documents, }); return this.internalFlush(false, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -192,13 +192,13 @@ export class SearchIndexingBufferedSender { this.batchObject.merge(documents); this.emitter.emit("batchAdded", { action: "merge", - documents + documents, }); return this.internalFlush(false, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -224,13 +224,13 @@ export class SearchIndexingBufferedSender { this.batchObject.mergeOrUpload(documents); this.emitter.emit("batchAdded", { action: "mergeOrUpload", - documents + documents, }); return this.internalFlush(false, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -256,13 +256,13 @@ export class SearchIndexingBufferedSender { this.batchObject.delete(documents); this.emitter.emit("batchAdded", { action: "delete", - documents + documents, }); return this.internalFlush(false, updatedOptions); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -286,7 +286,7 @@ export class SearchIndexingBufferedSender { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -394,15 +394,16 @@ export class SearchIndexingBufferedSender { } } - private pruneActions( - batch: IndexDocumentsAction[] - ): { batchToSubmit: IndexDocumentsAction[]; submitLater: IndexDocumentsAction[] } { + private pruneActions(batch: IndexDocumentsAction[]): { + batchToSubmit: IndexDocumentsAction[]; + submitLater: IndexDocumentsAction[]; + } { const hashSet: Set = new Set(); const resultBatch: IndexDocumentsAction[] = []; const pruned: IndexDocumentsAction[] = []; for (const document of batch) { - const key = this.documentKeyRetriever((document as unknown) as T); + const key = this.documentKeyRetriever(document as unknown as T); if (hashSet.has(key)) { pruned.push(document); } else { @@ -433,7 +434,7 @@ export class SearchIndexingBufferedSender { // Cut the payload size to half const splitActionsArray = [ actionsToSend.slice(0, actionsToSend.length / 2), - actionsToSend.slice(actionsToSend.length / 2, actionsToSend.length) + actionsToSend.slice(actionsToSend.length / 2, actionsToSend.length), ]; this.initialBatchActionCount = splitActionsArray[0].length; // So, we do not want 413 happening again and again for (const actions of splitActionsArray) { diff --git a/sdk/search/search-documents/src/serialization.ts b/sdk/search/search-documents/src/serialization.ts index ffd7e657241e..b8b143263f5b 100644 --- a/sdk/search/search-documents/src/serialization.ts +++ b/sdk/search/search-documents/src/serialization.ts @@ -28,7 +28,7 @@ function walk(start: unknown, mapper: (val: any) => any): any { const seenMarker = new WeakMap(); const result = { value: undefined }; const queue: { value: any; parent: any; key: string }[] = [ - { value: start, parent: result, key: "value" } + { value: start, parent: result, key: "value" }, ]; while (queue.length) { @@ -51,7 +51,7 @@ function walk(start: unknown, mapper: (val: any) => any): any { queue.push({ value: mapped[key], parent: mapped, - key + key, }); } } @@ -132,7 +132,7 @@ function isGeoJSONPoint(obj: any): obj is GeoJSONPoint { default: return false; } - } + }, }); } @@ -163,7 +163,7 @@ function isCrs(maybeCrs: any): boolean { default: return false; } - } + }, }); } @@ -176,7 +176,7 @@ function isCrsProperties(maybeProperties: any): boolean { } else { return false; } - } + }, }); } diff --git a/sdk/search/search-documents/src/serviceModels.ts b/sdk/search/search-documents/src/serviceModels.ts index 02ffaba3a2cd..cbeb867f94b0 100644 --- a/sdk/search/search-documents/src/serviceModels.ts +++ b/sdk/search/search-documents/src/serviceModels.ts @@ -84,7 +84,7 @@ import { CustomNormalizer, SearchIndexerKnowledgeStore, SearchIndexerCache, - SemanticSettings + SemanticSettings, } from "./generated/service/models"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; @@ -1261,7 +1261,7 @@ export enum KnownTokenizerNames { * Divides text at whitespace. See * http://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/core/WhitespaceTokenizer.html */ - Whitespace = "whitespace" + Whitespace = "whitespace", } /** @@ -1444,7 +1444,7 @@ export enum KnownTokenFilterNames { /** * Splits words into subwords and performs optional transformations on subword groups. */ - WordDelimiter = "word_delimiter" + WordDelimiter = "word_delimiter", } /** @@ -1456,7 +1456,7 @@ export enum KnownCharFilterNames { * A character filter that attempts to strip out HTML constructs. See * https://lucene.apache.org/core/4_10_3/analyzers-common/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.html */ - HtmlStrip = "html_strip" + HtmlStrip = "html_strip", } /** @@ -1835,7 +1835,7 @@ export enum KnownAnalyzerNames { /** * An analyzer that uses the whitespace tokenizer. */ - Whitespace = "whitespace" + Whitespace = "whitespace", } /** diff --git a/sdk/search/search-documents/src/serviceUtils.ts b/sdk/search/search-documents/src/serviceUtils.ts index afaba26c788e..80aee752ce44 100644 --- a/sdk/search/search-documents/src/serviceUtils.ts +++ b/sdk/search/search-documents/src/serviceUtils.ts @@ -52,7 +52,7 @@ import { CustomAnalyzer, PatternTokenizer, LexicalNormalizerName, - SearchIndexerDataIdentityUnion + SearchIndexerDataIdentityUnion, } from "./generated/service/models"; import { LexicalAnalyzer, @@ -76,12 +76,12 @@ import { SearchResourceEncryptionKey, PatternAnalyzer, LexicalNormalizer, - SearchIndexerDataIdentity + SearchIndexerDataIdentity, } from "./serviceModels"; import { SuggestDocumentsResult, SuggestResult, SearchResult } from "./indexModels"; import { SuggestDocumentsResult as GeneratedSuggestDocumentsResult, - SearchResult as GeneratedSearchResult + SearchResult as GeneratedSearchResult, } from "./generated/data/models"; export const DEFAULT_SEARCH_SCOPE = "https://search.azure.com/.default"; @@ -209,13 +209,13 @@ export function convertAnalyzersToGenerated( case "#Microsoft.Azure.Search.PatternAnalyzer": result.push({ ...analyzer, - flags: analyzer.flags ? analyzer.flags.join("|") : undefined + flags: analyzer.flags ? analyzer.flags.join("|") : undefined, }); break; case "#Microsoft.Azure.Search.CustomAnalyzer": result.push({ ...analyzer, - tokenizerName: analyzer.tokenizerName + tokenizerName: analyzer.tokenizerName, }); break; } @@ -244,13 +244,13 @@ export function convertAnalyzersToPublic( ...analyzer, flags: (analyzer as GeneratedPatternAnalyzer).flags ? ((analyzer as GeneratedPatternAnalyzer).flags!.split("|") as RegexFlags[]) - : undefined + : undefined, } as PatternAnalyzer); break; case "#Microsoft.Azure.Search.CustomAnalyzer": result.push({ ...analyzer, - tokenizerName: (analyzer as CustomAnalyzer).tokenizerName + tokenizerName: (analyzer as CustomAnalyzer).tokenizerName, } as CustomAnalyzer); break; } @@ -269,7 +269,7 @@ export function convertFieldsToPublic(fields: GeneratedSearchField[]): SearchFie return { name: field.name, type: field.type, - fields: convertFieldsToPublic(field.fields!) + fields: convertFieldsToPublic(field.fields!), }; } else { const analyzerName: LexicalAnalyzerName | undefined = field.analyzer; @@ -288,7 +288,7 @@ export function convertFieldsToPublic(fields: GeneratedSearchField[]): SearchFie searchAnalyzerName, indexAnalyzerName, synonymMapNames, - normalizerName + normalizerName, } as SimpleField; } return result; @@ -301,7 +301,7 @@ export function convertFieldsToGenerated(fields: SearchField[]): GeneratedSearch return { name: field.name, type: field.type, - fields: convertFieldsToGenerated(field.fields) + fields: convertFieldsToGenerated(field.fields), }; } else { const { hidden, ...restField } = field; @@ -318,7 +318,7 @@ export function convertFieldsToGenerated(fields: SearchField[]): GeneratedSearch searchAnalyzer: field.searchAnalyzerName, indexAnalyzer: field.indexAnalyzerName, synonymMaps: field.synonymMapNames, - normalizer: field.normalizerName + normalizer: field.normalizerName, }; } }); @@ -336,7 +336,7 @@ export function convertTokenizersToGenerated( if (tokenizer.odatatype === "#Microsoft.Azure.Search.PatternTokenizer") { result.push({ ...tokenizer, - flags: tokenizer.flags ? tokenizer.flags.join("|") : undefined + flags: tokenizer.flags ? tokenizer.flags.join("|") : undefined, }); } else { result.push(tokenizer); @@ -359,7 +359,7 @@ export function convertTokenizersToPublic( ...tokenizer, flags: (tokenizer as PatternTokenizer).flags ? ((tokenizer as PatternTokenizer).flags!.split("|") as RegexFlags[]) - : undefined + : undefined, }); } else { result.push(tokenizer); @@ -403,7 +403,7 @@ export function convertEncryptionKeyToPublic( keyName: encryptionKey.keyName, keyVersion: encryptionKey.keyVersion, vaultUrl: encryptionKey.vaultUri, - identity: convertSearchIndexerDataIdentityToPublic(encryptionKey.identity) + identity: convertSearchIndexerDataIdentityToPublic(encryptionKey.identity), }; if (encryptionKey.accessCredentials) { @@ -425,13 +425,13 @@ export function convertEncryptionKeyToGenerated( keyName: encryptionKey.keyName, keyVersion: encryptionKey.keyVersion, vaultUri: encryptionKey.vaultUrl, - identity: encryptionKey.identity + identity: encryptionKey.identity, }; if (encryptionKey.applicationId) { result.accessCredentials = { applicationId: encryptionKey.applicationId, - applicationSecret: encryptionKey.applicationSecret + applicationSecret: encryptionKey.applicationSecret, }; } @@ -454,7 +454,7 @@ export function generatedIndexToPublicIndex(generatedIndex: GeneratedSearchIndex scoringProfiles: generatedIndex.scoringProfiles as ScoringProfile[], fields: convertFieldsToPublic(generatedIndex.fields), similarity: convertSimilarityToPublic(generatedIndex.similarity), - semanticSettings: generatedIndex.semanticSettings + semanticSettings: generatedIndex.semanticSettings, }; } @@ -464,14 +464,14 @@ export function generatedSearchResultToPublicSearchResult( const returnValues: SearchResult[] = results.map>((result) => { const { _score, _highlights, rerankerScore, captions, ...restProps } = result; const doc: { [key: string]: any } = { - ...restProps + ...restProps, }; const obj = { score: _score, highlights: _highlights, rerankerScore, captions, - document: doc + document: doc, }; return obj as SearchResult; }); @@ -485,12 +485,12 @@ export function generatedSuggestDocumentsResultToPublicSuggestDocumentsResult const { _text, ...restProps } = element; const doc: { [key: string]: any } = { - ...restProps + ...restProps, }; const obj = { text: _text, - document: doc + document: doc, }; return obj as SuggestResult; @@ -498,7 +498,7 @@ export function generatedSuggestDocumentsResultToPublicSuggestDocumentsResult const result: SuggestDocumentsResult = { results: results, - coverage: searchDocumentsResult.coverage + coverage: searchDocumentsResult.coverage, }; return result; @@ -520,7 +520,7 @@ export function publicIndexToGeneratedIndex(index: SearchIndex): GeneratedSearch tokenizers: convertTokenizersToGenerated(index.tokenizers), fields: convertFieldsToGenerated(index.fields), similarity: convertSimilarityToGenerated(index.similarity), - semanticSettings: index.semanticSettings + semanticSettings: index.semanticSettings, }; } @@ -536,7 +536,7 @@ export function generatedSkillsetToPublicSkillset( ), knowledgeStore: generatedSkillset.knowledgeStore, etag: generatedSkillset.etag, - encryptionKey: convertEncryptionKeyToPublic(generatedSkillset.encryptionKey) + encryptionKey: convertEncryptionKeyToPublic(generatedSkillset.encryptionKey), }; } @@ -552,7 +552,7 @@ export function publicSkillsetToGeneratedSkillset( skillset.cognitiveServicesAccount ), knowledgeStore: skillset.knowledgeStore, - encryptionKey: convertEncryptionKeyToGenerated(skillset.encryptionKey) + encryptionKey: convertEncryptionKeyToGenerated(skillset.encryptionKey), }; } @@ -561,7 +561,7 @@ export function generatedSynonymMapToPublicSynonymMap(synonymMap: GeneratedSynon name: synonymMap.name, encryptionKey: convertEncryptionKeyToPublic(synonymMap.encryptionKey), etag: synonymMap.etag, - synonyms: [] + synonyms: [], }; if (synonymMap.synonyms) { @@ -577,7 +577,7 @@ export function publicSynonymMapToGeneratedSynonymMap(synonymMap: SynonymMap): G format: "solr", encryptionKey: convertEncryptionKeyToGenerated(synonymMap.encryptionKey), etag: synonymMap.etag, - synonyms: synonymMap.synonyms.join("\n") + synonyms: synonymMap.synonyms.join("\n"), }; result.encryptionKey = convertEncryptionKeyToGenerated(synonymMap.encryptionKey); @@ -590,7 +590,7 @@ export function publicSearchIndexerToGeneratedSearchIndexer( ): GeneratedSearchIndexer { return { ...indexer, - encryptionKey: convertEncryptionKeyToGenerated(indexer.encryptionKey) + encryptionKey: convertEncryptionKeyToGenerated(indexer.encryptionKey), }; } @@ -599,7 +599,7 @@ export function generatedSearchIndexerToPublicSearchIndexer( ): SearchIndexer { return { ...indexer, - encryptionKey: convertEncryptionKeyToPublic(indexer.encryptionKey) + encryptionKey: convertEncryptionKeyToPublic(indexer.encryptionKey), }; } @@ -611,14 +611,14 @@ export function publicDataSourceToGeneratedDataSource( description: dataSource.description, type: dataSource.type, credentials: { - connectionString: dataSource.connectionString + connectionString: dataSource.connectionString, }, container: dataSource.container, identity: dataSource.identity, etag: dataSource.etag, dataChangeDetectionPolicy: dataSource.dataChangeDetectionPolicy, dataDeletionDetectionPolicy: dataSource.dataDeletionDetectionPolicy, - encryptionKey: convertEncryptionKeyToGenerated(dataSource.encryptionKey) + encryptionKey: convertEncryptionKeyToGenerated(dataSource.encryptionKey), }; } @@ -639,7 +639,7 @@ export function generatedDataSourceToPublicDataSource( dataDeletionDetectionPolicy: convertDataDeletionDetectionPolicyToPublic( dataSource.dataDeletionDetectionPolicy ), - encryptionKey: convertEncryptionKeyToPublic(dataSource.encryptionKey) + encryptionKey: convertEncryptionKeyToPublic(dataSource.encryptionKey), }; } diff --git a/sdk/search/search-documents/src/synonymMapHelper.ts b/sdk/search/search-documents/src/synonymMapHelper.ts index a01bf5f58f6d..220dc79fae7e 100644 --- a/sdk/search/search-documents/src/synonymMapHelper.ts +++ b/sdk/search/search-documents/src/synonymMapHelper.ts @@ -25,6 +25,6 @@ export async function createSynonymMapFromFile( return { name, - synonyms + synonyms, }; } diff --git a/sdk/search/search-documents/src/tracing.ts b/sdk/search/search-documents/src/tracing.ts index 0392b0a03cbe..317e59544fdd 100644 --- a/sdk/search/search-documents/src/tracing.ts +++ b/sdk/search/search-documents/src/tracing.ts @@ -9,5 +9,5 @@ import { createSpanFunction } from "@azure/core-tracing"; */ export const createSpan = createSpanFunction({ packagePrefix: "Azure.Search", - namespace: "Microsoft.Search" + namespace: "Microsoft.Search", }); diff --git a/sdk/search/search-documents/test/internal/browser/synonymMap.browser.spec.ts b/sdk/search/search-documents/test/internal/browser/synonymMap.browser.spec.ts index fc1d7a7a135c..fd5cc7638eeb 100644 --- a/sdk/search/search-documents/test/internal/browser/synonymMap.browser.spec.ts +++ b/sdk/search/search-documents/test/internal/browser/synonymMap.browser.spec.ts @@ -5,7 +5,7 @@ import { assert } from "chai"; import { createSynonymMapFromFile } from "../../../src/synonymMapHelper.browser"; describe("synonymmap", () => { - it("create synonymmap from file(browser)", async function() { + it("create synonymmap from file(browser)", async function () { let errorThrown = false; try { await createSynonymMapFromFile("my-synonym-map-1", "./test/internal/synonymMap.txt"); diff --git a/sdk/search/search-documents/test/internal/geographyPoint.spec.ts b/sdk/search/search-documents/test/internal/geographyPoint.spec.ts index 88a10f66bab9..44e57e120a34 100644 --- a/sdk/search/search-documents/test/internal/geographyPoint.spec.ts +++ b/sdk/search/search-documents/test/internal/geographyPoint.spec.ts @@ -9,13 +9,13 @@ describe("geographyPoint", () => { it("JSON.stringify", () => { const geoPoint = new GeographyPoint({ longitude: -122.123889, - latitude: 47.669444 + latitude: 47.669444, }); const result = JSON.parse(JSON.stringify(geoPoint)); assert.deepEqual(result, { type: "Point", coordinates: [-122.123889, 47.669444], - crs: { type: "name", properties: { name: "EPSG:4326" } } + crs: { type: "name", properties: { name: "EPSG:4326" } }, }); }); diff --git a/sdk/search/search-documents/test/internal/node/synonymMap.node.spec.ts b/sdk/search/search-documents/test/internal/node/synonymMap.node.spec.ts index 66b613005365..7d517903a60b 100644 --- a/sdk/search/search-documents/test/internal/node/synonymMap.node.spec.ts +++ b/sdk/search/search-documents/test/internal/node/synonymMap.node.spec.ts @@ -6,7 +6,7 @@ import { createSynonymMapFromFile } from "../../../src"; import { SynonymMap } from "../../../src/serviceModels"; describe("synonymmap", () => { - it("create synonymmap from file(node)", async function() { + it("create synonymmap from file(node)", async function () { const synonymMap: SynonymMap = await createSynonymMapFromFile( "my-synonym-map-1", "./test/internal/synonymMap.txt" diff --git a/sdk/search/search-documents/test/internal/serialization.spec.ts b/sdk/search/search-documents/test/internal/serialization.spec.ts index 14c97b75e13a..26ebbe095f08 100644 --- a/sdk/search/search-documents/test/internal/serialization.spec.ts +++ b/sdk/search/search-documents/test/internal/serialization.spec.ts @@ -24,7 +24,7 @@ describe("serialization.serialize", () => { const child = { hello: "world" }; const documents = [ { id: "1", children: [child] }, - { id: "2", children: [child] } + { id: "2", children: [child] }, ]; const result = serialize(documents); assert.deepEqual(documents, result); @@ -35,7 +35,7 @@ describe("serialization.serialize", () => { const documents = [ { id: "1", children: [child] }, { id: "2", children: [child] }, - { id: "3", children: [child] } + { id: "3", children: [child] }, ]; const result = serialize(documents); assert.deepEqual(documents, result); @@ -79,7 +79,7 @@ describe("serialization.deserialize", () => { const child = { hello: "world" }; const documents = [ { id: "1", children: [child] }, - { id: "2", children: [child] } + { id: "2", children: [child] }, ]; const result = deserialize(documents); assert.deepEqual(documents, result); @@ -90,7 +90,7 @@ describe("serialization.deserialize", () => { const documents = [ { id: "1", children: [child] }, { id: "2", children: [child] }, - { id: "3", children: [child] } + { id: "3", children: [child] }, ]; const result = deserialize(documents); assert.deepEqual(documents, result); @@ -139,8 +139,8 @@ describe("serialization.deserialize", () => { location: { type: "Point", coordinates: [-84.527771, 37.989769], - crs: { type: "name", properties: { name: "EPSG:4326" } } - } + crs: { type: "name", properties: { name: "EPSG:4326" } }, + }, }); assert.instanceOf(result.location, GeographyPoint); assert.equal(result.location.latitude, 37.989769); diff --git a/sdk/search/search-documents/test/internal/serviceUtils.spec.ts b/sdk/search/search-documents/test/internal/serviceUtils.spec.ts index c078f8b527ef..febe1d4b650c 100644 --- a/sdk/search/search-documents/test/internal/serviceUtils.spec.ts +++ b/sdk/search/search-documents/test/internal/serviceUtils.spec.ts @@ -23,8 +23,8 @@ describe("serviceUtils", () => { indexAnalyzer: KnownLexicalAnalyzerName.ArLucene, normalizer: KnownLexicalAnalyzerName.BgLucene, searchAnalyzer: KnownLexicalAnalyzerName.CaLucene, - synonymMaps: undefined - } + synonymMaps: undefined, + }, ]); assert.include(publicFields[0], { @@ -40,7 +40,7 @@ describe("serviceUtils", () => { indexAnalyzerName: KnownLexicalAnalyzerName.ArLucene, normalizerName: KnownLexicalAnalyzerName.BgLucene, searchAnalyzerName: KnownLexicalAnalyzerName.CaLucene, - synonymMapNames: undefined + synonymMapNames: undefined, }); }); @@ -63,15 +63,15 @@ describe("serviceUtils", () => { indexAnalyzer: KnownLexicalAnalyzerName.ArLucene, normalizer: KnownLexicalAnalyzerName.BgLucene, searchAnalyzer: KnownLexicalAnalyzerName.CaLucene, - synonymMaps: undefined - } - ] - } + synonymMaps: undefined, + }, + ], + }, ]); assert.include(publicFields[0], { name: "ComplexObj", - type: "Edm.ComplexType" + type: "Edm.ComplexType", }); assert.include((publicFields[0] as ComplexField).fields![0], { @@ -87,7 +87,7 @@ describe("serviceUtils", () => { indexAnalyzerName: KnownLexicalAnalyzerName.ArLucene, normalizerName: KnownLexicalAnalyzerName.BgLucene, searchAnalyzerName: KnownLexicalAnalyzerName.CaLucene, - synonymMapNames: undefined + synonymMapNames: undefined, }); }); @@ -106,8 +106,8 @@ describe("serviceUtils", () => { indexAnalyzerName: KnownLexicalAnalyzerName.ArLucene, normalizerName: KnownLexicalAnalyzerName.BgLucene, searchAnalyzerName: KnownLexicalAnalyzerName.CaLucene, - synonymMapNames: undefined - } + synonymMapNames: undefined, + }, ]); assert.include(generatedFields[0], { @@ -123,7 +123,7 @@ describe("serviceUtils", () => { indexAnalyzer: KnownLexicalAnalyzerName.ArLucene, normalizer: KnownLexicalAnalyzerName.BgLucene, searchAnalyzer: KnownLexicalAnalyzerName.CaLucene, - synonymMaps: undefined + synonymMaps: undefined, }); }); @@ -146,15 +146,15 @@ describe("serviceUtils", () => { indexAnalyzerName: KnownLexicalAnalyzerName.ArLucene, normalizerName: KnownLexicalAnalyzerName.BgLucene, searchAnalyzerName: KnownLexicalAnalyzerName.CaLucene, - synonymMapNames: undefined - } - ] - } + synonymMapNames: undefined, + }, + ], + }, ]); assert.include(generatedFields[0], { name: "ComplexObj", - type: "Edm.ComplexType" + type: "Edm.ComplexType", }); assert.include(generatedFields[0].fields![0], { @@ -170,7 +170,7 @@ describe("serviceUtils", () => { indexAnalyzer: KnownLexicalAnalyzerName.ArLucene, normalizer: KnownLexicalAnalyzerName.BgLucene, searchAnalyzer: KnownLexicalAnalyzerName.CaLucene, - synonymMaps: undefined + synonymMaps: undefined, }); }); }); diff --git a/sdk/search/search-documents/test/public/node/searchClient.spec.ts b/sdk/search/search-documents/test/public/node/searchClient.spec.ts index f56bee91c935..94ec7bdc4d84 100644 --- a/sdk/search/search-documents/test/public/node/searchClient.spec.ts +++ b/sdk/search/search-documents/test/public/node/searchClient.spec.ts @@ -15,7 +15,7 @@ import { IndexDocumentsBatch, KnownSpeller, KnownQueryLanguage, - AzureKeyCredential + AzureKeyCredential, } from "../../../src"; import { Hotel } from "../utils/interfaces"; import { createIndex, populateIndex, WAIT_TIME, createRandomIndexName } from "../utils/setup"; @@ -23,14 +23,14 @@ import { delay } from "../../../src/serviceUtils"; const TEST_INDEX_NAME = isLiveMode() ? createRandomIndexName() : "hotel-live-test1"; -describe("SearchClient", function(this: Suite) { +describe("SearchClient", function (this: Suite) { let recorder: Recorder; let searchClient: SearchClient; let indexClient: SearchIndexClient; this.timeout(99999); - beforeEach(async function(this: Context) { + beforeEach(async function (this: Context) { ({ searchClient, indexClient } = createClients(TEST_INDEX_NAME)); if (!isPlaybackMode()) { await createIndex(indexClient, TEST_INDEX_NAME); @@ -42,7 +42,7 @@ describe("SearchClient", function(this: Suite) { ({ searchClient, indexClient } = createClients(TEST_INDEX_NAME)); }); - afterEach(async function() { + afterEach(async function () { if (recorder) { await recorder.stop(); } @@ -52,41 +52,41 @@ describe("SearchClient", function(this: Suite) { } }); - it("count returns the correct document count", async function() { + it("count returns the correct document count", async function () { const documentCount = await searchClient.getDocumentsCount(); assert.equal(documentCount, 10); }); - it("autocomplete returns the correct autocomplete result", async function() { + it("autocomplete returns the correct autocomplete result", async function () { const autoCompleteResult: AutocompleteResult = await searchClient.autocomplete("sec", "sg"); assert.equal(autoCompleteResult.results.length, 1); assert.equal(autoCompleteResult.results[0].text, "secret"); }); - it("autocomplete returns zero results for invalid query", async function() { + it("autocomplete returns zero results for invalid query", async function () { const autoCompleteResult: AutocompleteResult = await searchClient.autocomplete("garbxyz", "sg"); assert.isTrue(autoCompleteResult.results.length === 0); }); - it("search returns the correct search result", async function() { + it("search returns the correct search result", async function () { const searchResults = await searchClient.search("budget", { skip: 0, top: 5, - includeTotalCount: true + includeTotalCount: true, }); assert.equal(searchResults.count, 6); }); - it("search returns zero results for invalid query", async function() { + it("search returns zero results for invalid query", async function () { const searchResults = await searchClient.search("garbxyz", { skip: 0, top: 5, - includeTotalCount: true + includeTotalCount: true, }); assert.equal(searchResults.count, 0); }); - it("suggest returns the correct suggestions", async function() { + it("suggest returns the correct suggestions", async function () { const suggestResult = await searchClient.suggest("WiFi", "sg"); assert.equal(suggestResult.results.length, 1); assert.isTrue( @@ -94,12 +94,12 @@ describe("SearchClient", function(this: Suite) { ); }); - it("suggest returns zero suggestions for invalid input", async function() { + it("suggest returns zero suggestions for invalid input", async function () { const suggestResult = await searchClient.suggest("garbxyz", "sg"); assert.equal(suggestResult.results.length, 0); }); - it("getDocument returns the correct document result", async function() { + it("getDocument returns the correct document result", async function () { const getDocumentResult = await searchClient.getDocument("8"); assert.equal( getDocumentResult.description, @@ -112,7 +112,7 @@ describe("SearchClient", function(this: Suite) { assert.equal(getDocumentResult.hotelId, "8"); }); - it("getDocument throws error for invalid getDocument Value", async function() { + it("getDocument throws error for invalid getDocument Value", async function () { let errorThrown = false; try { await searchClient.getDocument("garbxyz"); @@ -122,7 +122,7 @@ describe("SearchClient", function(this: Suite) { assert.isTrue(errorThrown, "Expected getDocument to fail with an exception"); }); - it("deleteDocuments delete a document by documents", async function() { + it("deleteDocuments delete a document by documents", async function () { const getDocumentResult = await searchClient.getDocument("8"); await searchClient.deleteDocuments([getDocumentResult]); await delay(WAIT_TIME); @@ -130,14 +130,14 @@ describe("SearchClient", function(this: Suite) { assert.equal(documentCount, 9); }); - it("deleteDocuments delete a document by key/keyNames", async function() { + it("deleteDocuments delete a document by key/keyNames", async function () { await searchClient.deleteDocuments("hotelId", ["9", "10"]); await delay(WAIT_TIME); const documentCount = await searchClient.getDocumentsCount(); assert.equal(documentCount, 8); }); - it("mergeOrUploadDocuments modify & merge an existing document", async function() { + it("mergeOrUploadDocuments modify & merge an existing document", async function () { let getDocumentResult = await searchClient.getDocument("6"); getDocumentResult.description = "Modified Description"; await searchClient.mergeOrUploadDocuments([getDocumentResult]); @@ -146,11 +146,11 @@ describe("SearchClient", function(this: Suite) { assert.equal(getDocumentResult.description, "Modified Description"); }); - it("mergeOrUploadDocuments merge a new document", async function() { + it("mergeOrUploadDocuments merge a new document", async function () { const document = { hotelId: "11", description: "New Hotel Description", - lastRenovationDate: null + lastRenovationDate: null, }; await searchClient.mergeOrUploadDocuments([document]); await delay(WAIT_TIME); @@ -158,7 +158,7 @@ describe("SearchClient", function(this: Suite) { assert.equal(documentCount, 11); }); - it("mergeDocuments modify & merge an existing document", async function() { + it("mergeDocuments modify & merge an existing document", async function () { let getDocumentResult = await searchClient.getDocument("6"); getDocumentResult.description = "Modified Description"; await searchClient.mergeDocuments([getDocumentResult]); @@ -167,18 +167,18 @@ describe("SearchClient", function(this: Suite) { assert.equal(getDocumentResult.description, "Modified Description"); }); - it("uploadDocuments upload a set of documents", async function() { + it("uploadDocuments upload a set of documents", async function () { const documents = [ { hotelId: "11", description: "New Hotel Description", - lastRenovationDate: null + lastRenovationDate: null, }, { hotelId: "12", description: "New Hotel II Description", - lastRenovationDate: null - } + lastRenovationDate: null, + }, ]; await searchClient.uploadDocuments(documents); await delay(WAIT_TIME); @@ -186,14 +186,14 @@ describe("SearchClient", function(this: Suite) { assert.equal(documentCount, 12); }); - it("indexDocuments upload a new document", async function() { + it("indexDocuments upload a new document", async function () { const batch: IndexDocumentsBatch = new IndexDocumentsBatch(); batch.upload([ { hotelId: "11", description: "New Hotel Description", - lastRenovationDate: null - } + lastRenovationDate: null, + }, ]); await searchClient.indexDocuments(batch); await delay(WAIT_TIME); @@ -201,15 +201,15 @@ describe("SearchClient", function(this: Suite) { assert.equal(documentCount, 11); }); - it("indexDocuments deletes existing documents", async function() { + it("indexDocuments deletes existing documents", async function () { const batch: IndexDocumentsBatch = new IndexDocumentsBatch(); batch.delete([ { - hotelId: "9" + hotelId: "9", }, { - hotelId: "10" - } + hotelId: "10", + }, ]); await searchClient.indexDocuments(batch); @@ -218,13 +218,13 @@ describe("SearchClient", function(this: Suite) { assert.equal(documentCount, 8); }); - it("indexDocuments merges an existing document", async function() { + it("indexDocuments merges an existing document", async function () { const batch: IndexDocumentsBatch = new IndexDocumentsBatch(); batch.merge([ { hotelId: "8", - description: "Modified Description" - } + description: "Modified Description", + }, ]); await searchClient.indexDocuments(batch); @@ -233,18 +233,18 @@ describe("SearchClient", function(this: Suite) { assert.equal(getDocumentResult.description, "Modified Description"); }); - it("indexDocuments merge/upload documents", async function() { + it("indexDocuments merge/upload documents", async function () { const batch: IndexDocumentsBatch = new IndexDocumentsBatch(); batch.mergeOrUpload([ { hotelId: "8", - description: "Modified Description" + description: "Modified Description", }, { hotelId: "11", description: "New Hotel Description", - lastRenovationDate: null - } + lastRenovationDate: null, + }, ]); await searchClient.indexDocuments(batch); @@ -258,13 +258,13 @@ describe("SearchClient", function(this: Suite) { // Fails in CI because the CI search service was created on or before 2019 // which does not have search 'speller' feature. Will resolve the // resource issue and then add this test back. - it.skip("search with speller", async function() { + it.skip("search with speller", async function () { const searchResults = await searchClient.search("budjet", { skip: 0, top: 5, includeTotalCount: true, queryLanguage: KnownQueryLanguage.EnUs, - speller: KnownSpeller.Lexicon + speller: KnownSpeller.Lexicon, }); assert.equal(searchResults.count, 6); }); @@ -272,13 +272,13 @@ describe("SearchClient", function(this: Suite) { // Currently semantic search is available only with // certain subscriptions and could not be tested in CI. // So, skipping this test for now. - it.skip("search with semantic ranking", async function() { + it.skip("search with semantic ranking", async function () { const searchResults = await searchClient.search("luxury", { skip: 0, top: 5, includeTotalCount: true, queryLanguage: KnownQueryLanguage.EnUs, - queryType: "semantic" + queryType: "semantic", }); assert.equal(searchResults.count, 1); }); @@ -290,7 +290,7 @@ describe("SearchClient-local", () => { describe("Passing serviceVersion", () => { it("supports passing serviceVersion", () => { const client = new SearchClient("", "", credential, { - serviceVersion: "2020-06-30" + serviceVersion: "2020-06-30", }); assert.equal("2020-06-30", client.serviceVersion); assert.equal("2020-06-30", client.apiVersion); @@ -301,7 +301,7 @@ describe("SearchClient-local", () => { try { new SearchClient("", "", credential, { serviceVersion: "2020-06-30", - apiVersion: "foo" + apiVersion: "foo", }); } catch (ex) { errorThrown = true; @@ -314,7 +314,7 @@ describe("SearchClient-local", () => { try { new SearchClient("", "", credential, { apiVersion: "2020-06-30", - serviceVersion: "foo" + serviceVersion: "foo", }); } catch (ex) { errorThrown = true; @@ -324,7 +324,7 @@ describe("SearchClient-local", () => { it("supports passing the deprecated apiVersion", () => { const client = new SearchClient("", "", credential, { - apiVersion: "2020-06-30" + apiVersion: "2020-06-30", }); assert.equal("2020-06-30", client.serviceVersion); assert.equal("2020-06-30", client.apiVersion); diff --git a/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts b/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts index 41384e71c986..2d889c3b477a 100644 --- a/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts +++ b/sdk/search/search-documents/test/public/node/searchIndexClient.spec.ts @@ -13,19 +13,19 @@ import { createSynonymMaps, deleteSynonymMaps, WAIT_TIME, - createRandomIndexName + createRandomIndexName, } from "../utils/setup"; import { delay } from "../../../src/serviceUtils"; const TEST_INDEX_NAME = isLiveMode() ? createRandomIndexName() : "hotel-live-test3"; -describe("SearchIndexClient", function(this: Suite) { +describe("SearchIndexClient", function (this: Suite) { let recorder: Recorder; let indexClient: SearchIndexClient; this.timeout(99999); - beforeEach(async function(this: Context) { + beforeEach(async function (this: Context) { ({ indexClient } = createClients(TEST_INDEX_NAME)); if (!isPlaybackMode()) { await createSynonymMaps(indexClient); @@ -37,7 +37,7 @@ describe("SearchIndexClient", function(this: Suite) { ({ indexClient } = createClients(TEST_INDEX_NAME)); }); - afterEach(async function() { + afterEach(async function () { if (recorder) { await recorder.stop(); } @@ -48,13 +48,13 @@ describe("SearchIndexClient", function(this: Suite) { } }); - describe("#synonymmaps", function() { - it("gets the list of synonymmaps", async function() { + describe("#synonymmaps", function () { + it("gets the list of synonymmaps", async function () { const synonymMaps = await indexClient.listSynonymMaps(); assert.isAtLeast(synonymMaps.length, 2); }); - it("gets the list of synonymmaps names", async function() { + it("gets the list of synonymmaps names", async function () { const synonymMapNames = await indexClient.listSynonymMapsNames(); assert.isAtLeast(synonymMapNames.length, 2); for (let i = 1; i <= 2; i++) { @@ -62,19 +62,19 @@ describe("SearchIndexClient", function(this: Suite) { } }); - it("gets the correct synonymmap object", async function() { + it("gets the correct synonymmap object", async function () { const synonymMap = await indexClient.getSynonymMap("my-azure-synonymmap-1"); assert.equal(synonymMap.name, "my-azure-synonymmap-1"); assert.equal(synonymMap.synonyms.length, 2); const synonyms = [ "United States, United States of America => USA", - "Washington, Wash. => WA" + "Washington, Wash. => WA", ]; assert.include(synonyms, synonymMap.synonyms[0]); assert.include(synonyms, synonymMap.synonyms[1]); }); - it("throws error for invalid synonymmap object", async function() { + it("throws error for invalid synonymmap object", async function () { let retrievalError: boolean = false; try { await indexClient.getSynonymMap("garbxyz"); @@ -84,10 +84,10 @@ describe("SearchIndexClient", function(this: Suite) { assert.isTrue(retrievalError); }); - it("creates the synonymmap object using createOrUpdateSynonymMap", async function() { + it("creates the synonymmap object using createOrUpdateSynonymMap", async function () { let synonymMap: SynonymMap = { name: `my-azure-synonymmap-3`, - synonyms: ["United States, United States of America => USA", "Washington, Wash. => WA"] + synonyms: ["United States, United States of America => USA", "Washington, Wash. => WA"], }; await indexClient.createOrUpdateSynonymMap(synonymMap); try { @@ -96,7 +96,7 @@ describe("SearchIndexClient", function(this: Suite) { assert.equal(synonymMap.synonyms.length, 2); const synonyms = [ "United States, United States of America => USA", - "Washington, Wash. => WA" + "Washington, Wash. => WA", ]; assert.include(synonyms, synonymMap.synonyms[0]); assert.include(synonyms, synonymMap.synonyms[1]); @@ -105,7 +105,7 @@ describe("SearchIndexClient", function(this: Suite) { } }); - it("modify and updates the synonymmap object", async function() { + it("modify and updates the synonymmap object", async function () { let synonymMap = await indexClient.getSynonymMap("my-azure-synonymmap-1"); synonymMap.synonyms.push("California, Clif. => CA"); await indexClient.createOrUpdateSynonymMap(synonymMap); @@ -114,7 +114,7 @@ describe("SearchIndexClient", function(this: Suite) { const synonyms = [ "United States, United States of America => USA", "Washington, Wash. => WA", - "California, Clif. => CA" + "California, Clif. => CA", ]; assert.include(synonyms, synonymMap.synonyms[0]); assert.include(synonyms, synonymMap.synonyms[1]); @@ -122,8 +122,8 @@ describe("SearchIndexClient", function(this: Suite) { }); }); - describe("#indexes", function() { - it("gets the list of indexes", async function() { + describe("#indexes", function () { + it("gets the list of indexes", async function () { const result = await indexClient.listIndexes(); let listOfIndexes = await result.next(); const indexNames: string[] = []; @@ -134,7 +134,7 @@ describe("SearchIndexClient", function(this: Suite) { assert.include(indexNames, TEST_INDEX_NAME); }); - it("gets the list of indexes names", async function() { + it("gets the list of indexes names", async function () { const result = await indexClient.listIndexesNames(); let listOfIndexNames = await result.next(); const indexNames: string[] = []; @@ -145,13 +145,13 @@ describe("SearchIndexClient", function(this: Suite) { assert.include(indexNames, TEST_INDEX_NAME); }); - it("gets the correct index object", async function() { + it("gets the correct index object", async function () { const index = await indexClient.getIndex(TEST_INDEX_NAME); assert.equal(index.name, TEST_INDEX_NAME); assert.equal(index.fields.length, 5); }); - it("throws error for invalid index object", async function() { + it("throws error for invalid index object", async function () { let retrievalError: boolean = false; try { await indexClient.getIndex("garbxyz"); @@ -161,7 +161,7 @@ describe("SearchIndexClient", function(this: Suite) { assert.isTrue(retrievalError); }); - it("creates the index object using createOrUpdateIndex", async function() { + it("creates the index object using createOrUpdateIndex", async function () { const indexName: string = isLiveMode() ? createRandomIndexName() : "hotel-live-test4"; let index: SearchIndex = { name: indexName, @@ -169,19 +169,19 @@ describe("SearchIndexClient", function(this: Suite) { { type: "Edm.String", name: "id", - key: true + key: true, }, { type: "Edm.Double", name: "awesomenessLevel", sortable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.String", name: "description", - searchable: true + searchable: true, }, { type: "Edm.ComplexType", @@ -190,16 +190,16 @@ describe("SearchIndexClient", function(this: Suite) { { type: "Collection(Edm.String)", name: "tags", - searchable: true - } - ] + searchable: true, + }, + ], }, { type: "Edm.Int32", name: "hiddenWeight", - hidden: true - } - ] + hidden: true, + }, + ], }; await indexClient.createOrUpdateIndex(index); try { @@ -211,12 +211,12 @@ describe("SearchIndexClient", function(this: Suite) { } }); - it("modify and updates the index object", async function() { + it("modify and updates the index object", async function () { let index = await indexClient.getIndex(TEST_INDEX_NAME); index.fields.push({ type: "Edm.DateTimeOffset", name: "lastUpdatedOn", - filterable: true + filterable: true, }); await indexClient.createOrUpdateIndex(index); index = await indexClient.getIndex(TEST_INDEX_NAME); diff --git a/sdk/search/search-documents/test/public/utils/recordedClient.ts b/sdk/search/search-documents/test/public/utils/recordedClient.ts index bf60851b416e..6d3b96dc49f1 100644 --- a/sdk/search/search-documents/test/public/utils/recordedClient.ts +++ b/sdk/search/search-documents/test/public/utils/recordedClient.ts @@ -9,7 +9,7 @@ import { AzureKeyCredential, SearchClient, SearchIndexerClient, - SearchIndexClient + SearchIndexClient, } from "../../../src"; const isNode = @@ -31,13 +31,13 @@ export interface Clients { const replaceableVariables: { [k: string]: string } = { SEARCH_API_ADMIN_KEY: "admin_key", SEARCH_API_ADMIN_KEY_ALT: "admin_key_alt", - ENDPOINT: "https://endpoint" + ENDPOINT: "https://endpoint", }; export const testEnv = new Proxy(replaceableVariables, { get: (target, key: string) => { return env[key] || target[key]; - } + }, }); export const environmentSetup: RecorderEnvironmentSetup = { @@ -52,9 +52,9 @@ export const environmentSetup: RecorderEnvironmentSetup = { (recording: string): string => { const match = testEnv.ENDPOINT.replace(/^https:\/\//, "").replace(/\/$/, ""); return recording.replace(match, "endpoint"); - } + }, ], - queryParametersToSkip: [] + queryParametersToSkip: [], }; export function createClients(indexName: string): Clients { @@ -75,6 +75,6 @@ export function createClients(indexName: string): Clients): Promise rating: 5, location: new GeographyPoint({ longitude: -122.131577, - latitude: 47.678581 - }) + latitude: 47.678581, + }), }, { hotelId: "2", @@ -268,8 +268,8 @@ export async function populateIndex(client: SearchClient): Promise rating: 1, location: new GeographyPoint({ longitude: -122.131577, - latitude: 49.678581 - }) + latitude: 49.678581, + }), }, { hotelId: "3", @@ -284,8 +284,8 @@ export async function populateIndex(client: SearchClient): Promise rating: 4, location: new GeographyPoint({ longitude: -122.131577, - latitude: 46.678581 - }) + latitude: 46.678581, + }), }, { hotelId: "4", @@ -300,8 +300,8 @@ export async function populateIndex(client: SearchClient): Promise rating: 4, location: new GeographyPoint({ longitude: -122.131577, - latitude: 46.678581 - }) + latitude: 46.678581, + }), }, { hotelId: "5", @@ -316,26 +316,26 @@ export async function populateIndex(client: SearchClient): Promise rating: 4, location: new GeographyPoint({ longitude: -122.131577, - latitude: 48.678581 - }) + latitude: 48.678581, + }), }, { hotelId: "6", description: "Surprisingly expensive. Model suites have an ocean-view.", - lastRenovationDate: null + lastRenovationDate: null, }, { hotelId: "7", description: "Modern architecture, very polite staff and very clean. Also very affordable.", descriptionFr: "Architecture moderne, personnel poli et très propre. Aussi très abordable.", - hotelName: "Modern Stay" + hotelName: "Modern Stay", }, { hotelId: "8", description: "Has some road noise and is next to the very police station. Bathrooms had morel coverings.", descriptionFr: - "Il y a du bruit de la route et se trouve à côté de la station de police. Les salles de bain avaient des revêtements de morilles." + "Il y a du bruit de la route et se trouve à côté de la station de police. Les salles de bain avaient des revêtements de morilles.", }, { hotelId: "9", @@ -352,14 +352,14 @@ export async function populateIndex(client: SearchClient): Promise rating: 4, location: new GeographyPoint({ longitude: -73.975403, - latitude: 40.760586 + latitude: 40.760586, }), address: { streetAddress: "677 5th Ave", city: "New York", stateProvince: "NY", country: "USA", - postalCode: "10022" + postalCode: "10022", }, rooms: [ { @@ -370,7 +370,7 @@ export async function populateIndex(client: SearchClient): Promise bedOptions: "1 Queen Bed", sleepsCount: 2, smokingAllowed: true, - tags: ["vcr/dvd"] + tags: ["vcr/dvd"], }, { description: "Budget Room, 1 King Bed (Mountain View)", @@ -380,9 +380,9 @@ export async function populateIndex(client: SearchClient): Promise bedOptions: "1 King Bed", sleepsCount: 2, smokingAllowed: true, - tags: ["vcr/dvd", "jacuzzi tub"] - } - ] + tags: ["vcr/dvd", "jacuzzi tub"], + }, + ], }, { hotelId: "10", @@ -399,14 +399,14 @@ export async function populateIndex(client: SearchClient): Promise rating: 3, location: new GeographyPoint({ longitude: -78.940483, - latitude: 35.90416 + latitude: 35.90416, }), address: { streetAddress: "6910 Fayetteville Rd", city: "Durham", stateProvince: "NC", country: "USA", - postalCode: "27713" + postalCode: "27713", }, rooms: [ { @@ -417,7 +417,7 @@ export async function populateIndex(client: SearchClient): Promise bedOptions: "1 King Bed", sleepsCount: 2, smokingAllowed: true, - tags: ["coffee maker"] + tags: ["coffee maker"], }, { description: "Budget Room, 1 Queen Bed (Amenities)", @@ -427,10 +427,10 @@ export async function populateIndex(client: SearchClient): Promise bedOptions: "1 Queen Bed", sleepsCount: 2, smokingAllowed: false, - tags: ["coffee maker"] - } - ] - } + tags: ["coffee maker"], + }, + ], + }, ]; await client.uploadDocuments(testDocuments); @@ -480,25 +480,25 @@ export async function createSkillsets(client: SearchIndexerClient): Promise USA", "Washington, Wash. => WA"] + synonyms: ["United States, United States of America => USA", "Washington, Wash. => WA"], }); } } @@ -588,19 +588,19 @@ export async function createSimpleIndex(client: SearchIndexClient, name: string) { type: "Edm.String", name: "id", - key: true + key: true, }, { type: "Edm.Double", name: "awesomenessLevel", sortable: true, filterable: true, - facetable: true + facetable: true, }, { type: "Edm.String", name: "description", - searchable: true + searchable: true, }, { type: "Edm.ComplexType", @@ -609,16 +609,16 @@ export async function createSimpleIndex(client: SearchIndexClient, name: string) { type: "Collection(Edm.String)", name: "tags", - searchable: true - } - ] + searchable: true, + }, + ], }, { type: "Edm.Int32", name: "hiddenWeight", - hidden: true - } - ] + hidden: true, + }, + ], }; await client.createIndex(index); }