diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index dde760827160..6a1a6ea8241d 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: @@ -10507,7 +10508,7 @@ packages: dev: false file:projects/data-tables.tgz: - resolution: {integrity: sha512-15oV7/MZhi1cfaumGp/t5wNZmDQdkURPM0DjX7nV5sNY+oELwhEE+r3FzcsQNHPr59wIEinsUGEaUtqZ+vXc7A==, tarball: file:projects/data-tables.tgz} + resolution: {integrity: sha512-dnf1y2tJ2689eFPRET57b+iam8W0ziMjdROpGLFCtfwCZxqp406rPrqo7Mj7BwNjzFppRQbn/o9oOQtc+u/MhQ==, tarball: file:projects/data-tables.tgz} name: '@rush-temp/data-tables' version: 0.0.0 dependencies: @@ -10544,7 +10545,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 rollup-plugin-shim: 1.0.0 @@ -11721,7 +11722,7 @@ packages: dev: false file:projects/perf-data-tables.tgz: - resolution: {integrity: sha512-apNC948J1ppaBLAz9gNALEAzb0aMyos+Gnbe9UfU/arGRMnraju1PKslj3867fbC8um2V+Z3W/TWJhsF45dBOw==, tarball: file:projects/perf-data-tables.tgz} + resolution: {integrity: sha512-PgjuJKqYgdWR6o7kB/EjjXwR5RMIYgjZMHBwucULF8XfMytM6SBiWpqG72edRxEFo66OxmlLR3ByLfsjUNr+Xg==, tarball: file:projects/perf-data-tables.tgz} name: '@rush-temp/perf-data-tables' version: 0.0.0 dependencies: @@ -11730,7 +11731,7 @@ packages: '@types/uuid': 8.3.3 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 diff --git a/sdk/tables/data-tables/karma.conf.js b/sdk/tables/data-tables/karma.conf.js index e2bfce253a31..f11cf12de3ff 100644 --- a/sdk/tables/data-tables/karma.conf.js +++ b/sdk/tables/data-tables/karma.conf.js @@ -5,10 +5,10 @@ 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: "./", @@ -29,7 +29,7 @@ module.exports = function(config) { "karma-sourcemap-loader", "karma-junit-reporter", "karma-json-preprocessor", - "karma-json-to-file-reporter" + "karma-json-to-file-reporter", ], // list of files / patterns to load in the browser @@ -39,8 +39,8 @@ module.exports = function(config) { pattern: `pattern: "dist-test/index.browser.js.map`, type: "html", included: false, - served: true - } + served: true, + }, ].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []), // list of files / patterns to exclude @@ -50,7 +50,7 @@ module.exports = function(config) { // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { "**/*.js": ["sourcemap", "env"], - "recordings/browsers/**/*.json": ["json"] + "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/${testMode}.index.browser.js`]: ["coverage"] @@ -69,7 +69,7 @@ module.exports = function(config) { "ACCOUNT_CONNECTION_STRING", "AZURE_TENANT_ID", "AZURE_CLIENT_ID", - "AZURE_CLIENT_SECRET" + "AZURE_CLIENT_SECRET", ], // test results reporter to use @@ -84,8 +84,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: { @@ -95,12 +95,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 @@ -125,8 +125,8 @@ module.exports = function(config) { base: "ChromeHeadless", //--no-sandbox allows our tests to run in Linux without having to change the system. // --disable-web-security allows us to authenticate from the browser without setting up special CORS configuration - flags: ["--no-sandbox", "--disable-web-security"] - } + flags: ["--no-sandbox", "--disable-web-security"], + }, }, // Continuous Integration mode @@ -141,16 +141,16 @@ module.exports = function(config) { browserDisconnectTimeout: 10000, 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", + }, }, - args: config.testMode ? ["--testMode"] : [] + args: config.testMode ? ["--testMode"] : [], }); }; diff --git a/sdk/tables/data-tables/package.json b/sdk/tables/data-tables/package.json index 8662bb80bce4..7a9a313e796a 100644 --- a/sdk/tables/data-tables/package.json +++ b/sdk/tables/data-tables/package.json @@ -118,7 +118,7 @@ "karma-sourcemap-loader": "^0.3.8", "mocha": "^7.1.1", "mocha-junit-reporter": "^2.0.0", - "prettier": "^1.16.4", + "prettier": "^2.5.1", "nyc": "^15.0.0", "rimraf": "^3.0.0", "rollup": "^1.16.3", diff --git a/sdk/tables/data-tables/samples-dev/authenticationMethods.ts b/sdk/tables/data-tables/samples-dev/authenticationMethods.ts index e4a118f11ad0..0aadd9210838 100644 --- a/sdk/tables/data-tables/samples-dev/authenticationMethods.ts +++ b/sdk/tables/data-tables/samples-dev/authenticationMethods.ts @@ -11,7 +11,7 @@ import { TableServiceClient, AzureNamedKeyCredential, - AzureSASCredential + AzureSASCredential, } from "@azure/data-tables"; import { DefaultAzureCredential } from "@azure/identity"; diff --git a/sdk/tables/data-tables/samples-dev/createAndDeleteEntities.ts b/sdk/tables/data-tables/samples-dev/createAndDeleteEntities.ts index f79fae6283d9..c65b783a88c2 100644 --- a/sdk/tables/data-tables/samples-dev/createAndDeleteEntities.ts +++ b/sdk/tables/data-tables/samples-dev/createAndDeleteEntities.ts @@ -31,7 +31,7 @@ async function createSimpleDateEntity() { const entity = { partitionKey: "p1", rowKey: "r1", - date: new Date() + date: new Date(), }; await client.createEntity(entity); @@ -55,7 +55,7 @@ async function createComplexDateEntity() { const entity = { partitionKey: "p2", rowKey: "r2", - date + date, }; await client.createEntity(entity); @@ -81,7 +81,7 @@ async function createAndDeleteEntities() { rowKey: "A1", name: "Marker Set", price: 5.0, - quantity: 21 + quantity: 21, }; // Create the new entity diff --git a/sdk/tables/data-tables/samples-dev/generateTableSAS.ts b/sdk/tables/data-tables/samples-dev/generateTableSAS.ts index 54007fa0a29e..c295a35be130 100644 --- a/sdk/tables/data-tables/samples-dev/generateTableSAS.ts +++ b/sdk/tables/data-tables/samples-dev/generateTableSAS.ts @@ -15,7 +15,7 @@ import { TableClient, TableServiceClient, AccountSasPermissions, - TableSasPermissions + TableSasPermissions, } from "@azure/data-tables"; import { AzureNamedKeyCredential, AzureSASCredential } from "@azure/core-auth"; @@ -45,14 +45,14 @@ async function generateTableSasSample() { // Grants permission to query entities query: true, // Grants permission to delete tables and entities - delete: true + delete: true, }; // Generate an account SAS with the NamedKeyCredential and the permissions set previously // by default, expiration is set an hour after the SAS is created. Expiration can be // set explicitly by passing expiresOn with the desired expiration Date const accountSas = generateAccountSas(cred, { - permissions + permissions, }); const tableService = new TableServiceClient(tablesUrl, new AzureSASCredential(accountSas)); @@ -77,13 +77,13 @@ async function generateTableSasSample() { // Allows deleting entities delete: true, // Allows updating entities - update: true + update: true, }; // Create the table SAS token const tableSas = generateTableSas(tableName, cred, { expiresOn: new Date("2021-12-12"), - permissions: tablePermissions + permissions: tablePermissions, }); // Create a new client for the table we just created. Alternatively the Table Account SAS token could be used here as well @@ -94,7 +94,7 @@ async function generateTableSasSample() { await table.createEntity({ partitionKey: "test", rowKey: "1", - foo: "bar" + foo: "bar", }); // List all the entities in the table diff --git a/sdk/tables/data-tables/samples-dev/queryEntities.ts b/sdk/tables/data-tables/samples-dev/queryEntities.ts index a8dd6172abd9..f32e1b0b3ef2 100644 --- a/sdk/tables/data-tables/samples-dev/queryEntities.ts +++ b/sdk/tables/data-tables/samples-dev/queryEntities.ts @@ -34,7 +34,7 @@ async function listEntities() { rowKey: "1", name: "Markers", price: 5.0, - quantity: 34 + quantity: 34, }; const planner: Entity = { @@ -42,7 +42,7 @@ async function listEntities() { rowKey: "2", name: "Planner", price: 7.0, - quantity: 34 + quantity: 34, }; // create entities for marker and planner @@ -51,7 +51,7 @@ async function listEntities() { // List all entities with PartitionKey "Stationery" const listResults = client.listEntities({ - queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` }, }); for await (const product of listResults) { @@ -60,7 +60,7 @@ async function listEntities() { // List all entities with a price less than 6.0 const priceListResults = client.listEntities({ - queryOptions: { filter: odata`price le 6` } + queryOptions: { filter: odata`price le 6` }, }); console.log("-- Products with a price less or equals to 6.00"); @@ -84,8 +84,8 @@ async function listTopNEntities() { // List all entities with PartitionKey "Stationery" const listResults = client.listEntities({ queryOptions: { - filter: odata`PartitionKey eq ${partitionKey}` - } + filter: odata`PartitionKey eq ${partitionKey}`, + }, }); let topEntities = []; diff --git a/sdk/tables/data-tables/samples-dev/queryTables.ts b/sdk/tables/data-tables/samples-dev/queryTables.ts index 1cf84f3b8232..22dd277cb61a 100644 --- a/sdk/tables/data-tables/samples-dev/queryTables.ts +++ b/sdk/tables/data-tables/samples-dev/queryTables.ts @@ -29,7 +29,7 @@ async function queryTables() { // odata is a helper function that takes care of encoding the query // filter, in this sample it will add quotes around tableName const queryTableResults = serviceClient.listTables({ - queryOptions: { filter: odata`TableName eq ${tableName}` } + queryOptions: { filter: odata`TableName eq ${tableName}` }, }); // Iterate the results diff --git a/sdk/tables/data-tables/samples-dev/transactionOperations.ts b/sdk/tables/data-tables/samples-dev/transactionOperations.ts index fb3bc792745b..ea2175a15562 100644 --- a/sdk/tables/data-tables/samples-dev/transactionOperations.ts +++ b/sdk/tables/data-tables/samples-dev/transactionOperations.ts @@ -36,8 +36,8 @@ async function batchOperations() { rowKey: "A1", name: "Marker Set", price: 5.0, - quantity: 21 - } + quantity: 21, + }, ], [ "create", @@ -46,8 +46,8 @@ async function batchOperations() { rowKey: "A2", name: "Pen Set", price: 2.0, - quantity: 6 - } + quantity: 6, + }, ], [ "create", @@ -56,9 +56,9 @@ async function batchOperations() { rowKey: "A3", name: "Pencil", price: 1.5, - quantity: 100 - } - ] + quantity: 100, + }, + ], ]; // Submit the transaction with the list of actions. @@ -95,8 +95,8 @@ async function batchOperations() { [ "update", { partitionKey, rowKey: "A2", name: "[Updated - Replace] Pen Set", price: 99, quantity: 33 }, - "Replace" - ] + "Replace", + ], ]; const updateResult = await client.submitTransaction(updateTransaction); diff --git a/sdk/tables/data-tables/samples-dev/transactionWithHelper.ts b/sdk/tables/data-tables/samples-dev/transactionWithHelper.ts index 168334274bd0..c9662146b3f3 100644 --- a/sdk/tables/data-tables/samples-dev/transactionWithHelper.ts +++ b/sdk/tables/data-tables/samples-dev/transactionWithHelper.ts @@ -37,21 +37,21 @@ async function batchOperations() { rowKey: "A1", name: "Marker Set", price: 5.0, - quantity: 21 + quantity: 21, }); transaction.createEntity({ partitionKey, rowKey: "A2", name: "Pen Set", price: 2.0, - quantity: 6 + quantity: 6, }); transaction.createEntity({ partitionKey, rowKey: "A3", name: "Pencil", price: 1.5, - quantity: 100 + quantity: 100, }); // Submit the transaction using the actions list built by the helper diff --git a/sdk/tables/data-tables/samples-dev/updateAndUpsertEntities.ts b/sdk/tables/data-tables/samples-dev/updateAndUpsertEntities.ts index 434705afab61..654411f62196 100644 --- a/sdk/tables/data-tables/samples-dev/updateAndUpsertEntities.ts +++ b/sdk/tables/data-tables/samples-dev/updateAndUpsertEntities.ts @@ -33,7 +33,7 @@ async function updateAndUpsertEntities() { rowKey: "A1", name: "Marker Set", price: 5.0, - brand: "myCompany" + brand: "myCompany", }; // Entity doesn't exist in table, so calling upsertEntity will simply insert the entity. @@ -48,7 +48,7 @@ async function updateAndUpsertEntities() { name: "Marker Set", price: 5.0, // Replace with the same entity but without a brand - brand: undefined + brand: undefined, }, "Replace" ); @@ -63,7 +63,7 @@ async function updateAndUpsertEntities() { await client.updateEntity({ partitionKey: noBrandEntity.partitionKey, rowKey: noBrandEntity.rowKey, - price: 7.0 + price: 7.0, }); // Getting the entity should gice us an entity like the original, but without a brand and with a price of 7 diff --git a/sdk/tables/data-tables/samples-dev/workingWithInt64.ts b/sdk/tables/data-tables/samples-dev/workingWithInt64.ts index e15fb6ca4433..367b2bfb0bf5 100644 --- a/sdk/tables/data-tables/samples-dev/workingWithInt64.ts +++ b/sdk/tables/data-tables/samples-dev/workingWithInt64.ts @@ -37,7 +37,7 @@ async function workingWithInt64() { rowKey: "1", // To work with Int64 we need to use an object that includes // the value as a string and a notation of the type, in this case Int64 - foo: { value: "12345", type: "Int64" } + foo: { value: "12345", type: "Int64" }, }); const entity = await client.getEntity("p1", "1", { disableTypeConversion: true }); diff --git a/sdk/tables/data-tables/src/TableClient.ts b/sdk/tables/data-tables/src/TableClient.ts index c62c5c449a23..45b2c781c813 100644 --- a/sdk/tables/data-tables/src/TableClient.ts +++ b/sdk/tables/data-tables/src/TableClient.ts @@ -18,18 +18,18 @@ import { TableTransactionResponse, TransactionAction, UpdateMode, - UpdateTableEntityOptions + UpdateTableEntityOptions, } from "./models"; import { DeleteTableEntityResponse, SetAccessPolicyResponse, UpdateEntityResponse, - UpsertEntityResponse + UpsertEntityResponse, } from "./generatedModels"; import { FullOperationResponse, InternalClientPipelineOptions, - OperationOptions + OperationOptions, } from "@azure/core-client"; import { GeneratedClient, TableDeleteEntityOptionalParams } from "./generated"; import { @@ -38,7 +38,7 @@ import { TokenCredential, isNamedKeyCredential, isSASCredential, - isTokenCredential + isTokenCredential, } from "@azure/core-auth"; import { STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from "./utils/constants"; import { decodeContinuationToken, encodeContinuationToken } from "./utils/continuationToken"; @@ -48,7 +48,7 @@ import { deserializeSignedIdentifier, serialize, serializeQueryOptions, - serializeSignedIdentifiers + serializeSignedIdentifiers, } from "./serialization"; import { parseXML, stringifyXML } from "@azure/core-xml"; import { InternalTableTransaction } from "./TableTransaction"; @@ -234,18 +234,18 @@ export class TableClient { ...this.clientOptions, loggingOptions: { logger: logger.info, - additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames] + additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames], }, deserializationOptions: { - parseXML + parseXML, }, serializationOptions: { - stringifyXML + stringifyXML, }, ...(isTokenCredential(this.credential) && { credential: this.credential, - credentialScopes: STORAGE_SCOPE - }) + credentialScopes: STORAGE_SCOPE, + }), }; const generatedClient = new GeneratedClient(this.url, internalPipelineOptions); @@ -393,7 +393,7 @@ export class TableClient { { ...getEntityOptions, queryOptions: serializeQueryOptions(queryOptions || {}), - onResponse + onResponse, } ); const tableEntity = deserialize>( @@ -457,7 +457,7 @@ export class TableClient { byPage: (settings) => { const pageOptions: InternalListTableEntitiesOptions = { ...options, - queryOptions: { ...options.queryOptions, top: settings?.maxPageSize } + queryOptions: { ...options.queryOptions, top: settings?.maxPageSize }, }; if (settings?.continuationToken) { @@ -465,7 +465,7 @@ export class TableClient { } return this.listEntitiesPage(tableName, pageOptions); - } + }, }; } @@ -478,7 +478,7 @@ export class TableClient { if (firstPage.continuationToken) { const optionsWithContinuation: InternalListTableEntitiesOptions = { ...options, - continuationToken: firstPage.continuationToken + continuationToken: firstPage.continuationToken, }; for await (const page of this.listEntitiesPage(tableName, optionsWithContinuation)) { yield* page; @@ -500,7 +500,7 @@ export class TableClient { while (result.continuationToken) { const optionsWithContinuation: InternalListTableEntitiesOptions = { ...updatedOptions, - continuationToken: result.continuationToken + continuationToken: result.continuationToken, }; result = await this._listEntities(tableName, optionsWithContinuation); @@ -510,7 +510,7 @@ export class TableClient { } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, - message: e.message + message: e.message, }); throw e; } finally { @@ -526,7 +526,7 @@ export class TableClient { const queryOptions = serializeQueryOptions(options.queryOptions || {}); const listEntitiesOptions: TableQueryEntitiesOptionalParams = { ...options, - queryOptions + queryOptions, }; // If a continuation token is used, decode it and set the next row and partition key @@ -539,7 +539,7 @@ export class TableClient { const { xMsContinuationNextPartitionKey: nextPartitionKey, xMsContinuationNextRowKey: nextRowKey, - value + value, } = await this.table.queryEntities(tableName, listEntitiesOptions); const tableEntities = deserializeObjectsArray>( @@ -551,7 +551,7 @@ export class TableClient { // property to the page. const continuationToken = encodeContinuationToken(nextPartitionKey, nextRowKey); const page: TableEntityResultPage = Object.assign([...tableEntities], { - continuationToken + continuationToken, }); return page; @@ -593,7 +593,7 @@ export class TableClient { return await this.table.insertEntity(this.tableName, { ...createTableEntity, tableEntityProperties: serialize(entity), - responsePreference: "return-no-content" + responsePreference: "return-no-content", }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, message: e.message }); @@ -639,7 +639,7 @@ export class TableClient { try { const { etag = "*", ...rest } = updatedOptions || {}; const deleteOptions: TableDeleteEntityOptionalParams = { - ...rest + ...rest, }; return await this.table.deleteEntity( this.tableName, @@ -712,14 +712,14 @@ export class TableClient { return await this.table.mergeEntity(this.tableName, partitionKey, rowKey, { tableEntityProperties: serialize(entity), ifMatch: etag, - ...updateEntityOptions + ...updateEntityOptions, }); } if (mode === "Replace") { return await this.table.updateEntity(this.tableName, partitionKey, rowKey, { tableEntityProperties: serialize(entity), ifMatch: etag, - ...updateEntityOptions + ...updateEntityOptions, }); } @@ -782,14 +782,14 @@ export class TableClient { if (mode === "Merge") { return await this.table.mergeEntity(this.tableName, partitionKey, rowKey, { tableEntityProperties: serialize(entity), - ...updatedOptions + ...updatedOptions, }); } if (mode === "Replace") { return await this.table.updateEntity(this.tableName, partitionKey, rowKey, { tableEntityProperties: serialize(entity), - ...updatedOptions + ...updatedOptions, }); } throw new Error(`Unexpected value for update mode: ${mode}`); @@ -833,7 +833,7 @@ export class TableClient { const serlializedAcl = serializeSignedIdentifiers(tableAcl); return await this.table.setAccessPolicy(this.tableName, { ...updatedOptions, - tableAcl: serlializedAcl + tableAcl: serlializedAcl, }); } catch (e) { span.setStatus({ code: SpanStatusCode.ERROR, message: e.message }); @@ -938,10 +938,11 @@ export class TableClient { // eslint-disable-next-line @azure/azure-sdk/ts-naming-options options?: TableClientOptions ): TableClient { - const { url, options: clientOptions, credential } = getClientParamsFromConnectionString( - connectionString, - options - ); + const { + url, + options: clientOptions, + credential, + } = getClientParamsFromConnectionString(connectionString, options); if (credential) { return new TableClient(url, tableName, credential, clientOptions); } else { diff --git a/sdk/tables/data-tables/src/TablePolicies.ts b/sdk/tables/data-tables/src/TablePolicies.ts index b41fc01366ed..d14a2d2dd795 100644 --- a/sdk/tables/data-tables/src/TablePolicies.ts +++ b/sdk/tables/data-tables/src/TablePolicies.ts @@ -4,7 +4,7 @@ import { HeaderConstants, TRANSACTION_HTTP_LINE_ENDING, - TRANSACTION_HTTP_VERSION_1_1 + TRANSACTION_HTTP_VERSION_1_1, } from "./utils/constants"; import { PipelinePolicy, @@ -12,7 +12,7 @@ import { PipelineResponse, SendRequest, createHttpHeaders, - createPipelineRequest + createPipelineRequest, } from "@azure/core-rest-pipeline"; import { URL } from "./utils/url"; import { getChangeSetBoundary } from "./utils/transactionHelpers"; @@ -22,7 +22,7 @@ export const transactionRequestAssemblePolicyName = "transactionRequestAssembleP const dummyResponse: PipelineResponse = { request: createPipelineRequest({ url: "FAKE" }), status: 200, - headers: createHttpHeaders() + headers: createHttpHeaders(), }; export function transactionRequestAssemblePolicy( @@ -36,7 +36,7 @@ export function transactionRequestAssemblePolicy( bodyParts.push(subRequest); // Intercept request from going to wire return dummyResponse; - } + }, }; } @@ -49,7 +49,7 @@ export function transactionHeaderFilterPolicy(): PipelinePolicy { // The subrequests should not have the x-ms-version header. request.headers.delete(HeaderConstants.X_MS_VERSION); return next(request); - } + }, }; } @@ -69,7 +69,7 @@ function getNextSubrequestBodyPart(request: PipelineRequest, changesetId: string const subRequest = [ subRequestPrefix, // sub request constant prefix "", // empty line after sub request's content ID - `${request.method.toString()} ${subRequestUrl} ${TRANSACTION_HTTP_VERSION_1_1}` // sub request start line with method, + `${request.method.toString()} ${subRequestUrl} ${TRANSACTION_HTTP_VERSION_1_1}`, // sub request start line with method, ]; // Add required headers diff --git a/sdk/tables/data-tables/src/TableServiceClient.ts b/sdk/tables/data-tables/src/TableServiceClient.ts index 9b784b9510c3..c40af8f3fe03 100644 --- a/sdk/tables/data-tables/src/TableServiceClient.ts +++ b/sdk/tables/data-tables/src/TableServiceClient.ts @@ -7,14 +7,14 @@ import { GetStatisticsResponse, ServiceProperties, SetPropertiesOptions, - SetPropertiesResponse + SetPropertiesResponse, } from "./generatedModels"; import { InternalClientPipelineOptions, OperationOptions } from "@azure/core-client"; import { ListTableItemsOptions, TableItem, TableQueryOptions, - TableServiceClientOptions + TableServiceClientOptions, } from "./models"; import { NamedKeyCredential, @@ -22,7 +22,7 @@ import { TokenCredential, isNamedKeyCredential, isSASCredential, - isTokenCredential + isTokenCredential, } from "@azure/core-auth"; import { STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from "./utils/constants"; import { Service, Table } from "./generated"; @@ -161,16 +161,16 @@ export class TableServiceClient { ...{ loggingOptions: { logger: logger.info, - additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames] + additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames], }, deserializationOptions: { - parseXML + parseXML, }, serializationOptions: { - stringifyXML - } + stringifyXML, + }, }, - ...(isTokenCredential(credential) && { credential, credentialScopes: STORAGE_SCOPE }) + ...(isTokenCredential(credential) && { credential, credentialScopes: STORAGE_SCOPE }), }; const client = new GeneratedClient(this.url, internalPipelineOptions); if (isNamedKeyCredential(credential)) { @@ -296,7 +296,7 @@ export class TableServiceClient { byPage: (settings) => { const pageOptions: InternalListTablesOptions = { ...options, - queryOptions: { top: settings?.maxPageSize } + queryOptions: { top: settings?.maxPageSize }, }; if (settings?.continuationToken) { @@ -304,7 +304,7 @@ export class TableServiceClient { } return this.listTablesPage(pageOptions); - } + }, }; } @@ -317,7 +317,7 @@ export class TableServiceClient { if (continuationToken) { const optionsWithContinuation: InternalListTablesOptions = { ...options, - continuationToken + continuationToken, }; for await (const page of this.listTablesPage(optionsWithContinuation)) { yield* page; @@ -338,7 +338,7 @@ export class TableServiceClient { while (result.continuationToken) { const optionsWithContinuation: InternalListTablesOptions = { ...updatedOptions, - continuationToken: result.continuationToken + continuationToken: result.continuationToken, }; result = await this._listTables(optionsWithContinuation); yield result; @@ -355,7 +355,7 @@ export class TableServiceClient { const { continuationToken: nextTableName, ...listOptions } = options; const { xMsContinuationNextTableName: continuationToken, value = [] } = await this.table.query({ ...listOptions, - nextTableName + nextTableName, }); return Object.assign([...value], { continuationToken }); } @@ -378,10 +378,11 @@ export class TableServiceClient { // eslint-disable-next-line @azure/azure-sdk/ts-naming-options options?: TableServiceClientOptions ): TableServiceClient { - const { url, options: clientOptions, credential } = getClientParamsFromConnectionString( - connectionString, - options - ); + const { + url, + options: clientOptions, + credential, + } = getClientParamsFromConnectionString(connectionString, options); if (credential) { return new TableServiceClient(url, credential, clientOptions); diff --git a/sdk/tables/data-tables/src/TableTransaction.ts b/sdk/tables/data-tables/src/TableTransaction.ts index d0cbe1008f0b..ddd20d58a738 100644 --- a/sdk/tables/data-tables/src/TableTransaction.ts +++ b/sdk/tables/data-tables/src/TableTransaction.ts @@ -9,7 +9,7 @@ import { TransactionAction, UpdateMode, UpdateTableEntityOptions, - TableServiceClientOptions + TableServiceClientOptions, } from "./models"; import { NamedKeyCredential, @@ -17,14 +17,14 @@ import { TokenCredential, isNamedKeyCredential, isSASCredential, - isTokenCredential + isTokenCredential, } from "@azure/core-auth"; import { OperationOptions, ServiceClient, serializationPolicy, serializationPolicyName, - ServiceClientOptions + ServiceClientOptions, } from "@azure/core-client"; import { Pipeline, @@ -32,17 +32,17 @@ import { PipelineResponse, RestError, createHttpHeaders, - createPipelineRequest + createPipelineRequest, } from "@azure/core-rest-pipeline"; import { getInitialTransactionBody, - getTransactionHttpRequestBody + getTransactionHttpRequestBody, } from "./utils/transactionHelpers"; import { transactionHeaderFilterPolicy, transactionHeaderFilterPolicyName, transactionRequestAssemblePolicy, - transactionRequestAssemblePolicyName + transactionRequestAssemblePolicyName, } from "./TablePolicies"; import { SpanStatusCode } from "@azure/core-tracing"; import { TableClientLike } from "./utils/internalModels"; @@ -191,7 +191,7 @@ export class InternalTableTransaction { changesetId, partitionKey, pendingOperations, - bodyParts + bodyParts, }; } @@ -300,7 +300,7 @@ export class InternalTableTransaction { body, headers: createHttpHeaders(headers), tracingOptions: updatedOptions.tracingOptions, - allowInsecureConnection: this.allowInsecureConnection + allowInsecureConnection: this.allowInsecureConnection, }); if (isNamedKeyCredential(this.credential)) { @@ -316,7 +316,7 @@ export class InternalTableTransaction { } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, - message: error.message + message: error.message, }); throw error; } finally { @@ -378,14 +378,14 @@ export function parseTransactionResponse( return { status: subResponseStatus, ...(rowKeyMatch?.length === 2 && { rowKey: rowKeyMatch[1] }), - ...(etagMatch?.length === 2 && { etag: etagMatch[1] }) + ...(etagMatch?.length === 2 && { etag: etagMatch[1] }), }; }); return { status, subResponses: responses, - getResponseForEntity: (rowKey: string) => responses.find((r) => r.rowKey === rowKey) + getResponseForEntity: (rowKey: string) => responses.find((r) => r.rowKey === rowKey), }; } @@ -416,7 +416,7 @@ function handleBodyError( code, statusCode, request, - response + response, }); } @@ -435,7 +435,7 @@ export function prepateTransactionPipeline( const policies = pipeline.getOrderedPolicies(); for (const policy of policies) { pipeline.removePolicy({ - name: policy.name + name: policy.name, }); } @@ -448,7 +448,7 @@ export function prepateTransactionPipeline( if (isCosmos) { pipeline.addPolicy(cosmosPatchPolicy(), { afterPolicies: [transactionHeaderFilterPolicyName], - beforePolicies: [serializationPolicyName, transactionRequestAssemblePolicyName] + beforePolicies: [serializationPolicyName, transactionRequestAssemblePolicyName], }); } } diff --git a/sdk/tables/data-tables/src/cosmosPathPolicy.ts b/sdk/tables/data-tables/src/cosmosPathPolicy.ts index 76b0710fec19..765bfab196b2 100644 --- a/sdk/tables/data-tables/src/cosmosPathPolicy.ts +++ b/sdk/tables/data-tables/src/cosmosPathPolicy.ts @@ -15,6 +15,6 @@ export function cosmosPatchPolicy(): PipelinePolicy { } return next(request); - } + }, }; } diff --git a/sdk/tables/data-tables/src/generatedModels.ts b/sdk/tables/data-tables/src/generatedModels.ts index af22de40511f..4247a92b0778 100644 --- a/sdk/tables/data-tables/src/generatedModels.ts +++ b/sdk/tables/data-tables/src/generatedModels.ts @@ -29,5 +29,5 @@ export { Logging, TableSetAccessPolicyHeaders, ServiceSetPropertiesHeaders, - TableUpdateEntityHeaders + TableUpdateEntityHeaders, } from "./generated/models"; diff --git a/sdk/tables/data-tables/src/sas/accountSasSignatureValues.ts b/sdk/tables/data-tables/src/sas/accountSasSignatureValues.ts index 6d7f43ed4108..2bda8f34b5f5 100644 --- a/sdk/tables/data-tables/src/sas/accountSasSignatureValues.ts +++ b/sdk/tables/data-tables/src/sas/accountSasSignatureValues.ts @@ -6,7 +6,7 @@ import { SasIPRange, ipRangeToString } from "./sasIPRange"; import { SasProtocol, SasQueryParameters } from "./sasQueryParameters"; import { accountSasResourceTypesFromString, - accountSasResourceTypesToString + accountSasResourceTypesToString, } from "./accountSasResourceTypes"; import { accountSasServicesFromString, accountSasServicesToString } from "./accountSasServices"; import { NamedKeyCredential } from "@azure/core-auth"; @@ -114,7 +114,7 @@ export function generateAccountSasQueryParameters( accountSasSignatureValues.ipRange ? ipRangeToString(accountSasSignatureValues.ipRange) : "", accountSasSignatureValues.protocol ? accountSasSignatureValues.protocol : "", version, - "" // Account SAS requires an additional newline character + "", // Account SAS requires an additional newline character ].join("\n"); const signature: string = computeHMACSHA256(stringToSign, credential.key); @@ -126,6 +126,6 @@ export function generateAccountSasQueryParameters( protocol: accountSasSignatureValues.protocol, startsOn: accountSasSignatureValues.startsOn, expiresOn: accountSasSignatureValues.expiresOn, - ipRange: accountSasSignatureValues.ipRange + ipRange: accountSasSignatureValues.ipRange, }); } diff --git a/sdk/tables/data-tables/src/sas/generateAccountSas.ts b/sdk/tables/data-tables/src/sas/generateAccountSas.ts index 84b855879429..18bf2444411a 100644 --- a/sdk/tables/data-tables/src/sas/generateAccountSas.ts +++ b/sdk/tables/data-tables/src/sas/generateAccountSas.ts @@ -5,7 +5,7 @@ import { AccountSasPermissions, accountSasPermissionsFromString } from "./accoun import { AccountSasServices, accountSasServicesFromString, - accountSasServicesToString + accountSasServicesToString, } from "./accountSasServices"; import { NamedKeyCredential, isNamedKeyCredential } from "@azure/core-auth"; import { SasIPRange } from "./sasIPRange"; @@ -51,7 +51,7 @@ export function generateAccountSas( expiresOn: expiry, resourceTypes, services: accountSasServicesToString(services), - ...rest + ...rest, }, credential ).toString(); diff --git a/sdk/tables/data-tables/src/sas/generateTableSas.ts b/sdk/tables/data-tables/src/sas/generateTableSas.ts index f1c83bb7c529..9516f416d40b 100644 --- a/sdk/tables/data-tables/src/sas/generateTableSas.ts +++ b/sdk/tables/data-tables/src/sas/generateTableSas.ts @@ -4,7 +4,7 @@ import { NamedKeyCredential, isNamedKeyCredential } from "@azure/core-auth"; import { TableSasSignatureValues, - generateTableSasQueryParameters + generateTableSasQueryParameters, } from "./tableSasSignatureValues"; import { tableSasPermissionsFromString } from "./tableSasPermisions"; @@ -46,7 +46,7 @@ export function generateTableSas( const sas = generateTableSasQueryParameters(tableName, credential, { ...options, expiresOn, - permissions + permissions, }).toString(); return sas; diff --git a/sdk/tables/data-tables/src/sas/sasQueryParameters.ts b/sdk/tables/data-tables/src/sas/sasQueryParameters.ts index cf52ca6b8751..6545992a2464 100644 --- a/sdk/tables/data-tables/src/sas/sasQueryParameters.ts +++ b/sdk/tables/data-tables/src/sas/sasQueryParameters.ts @@ -140,7 +140,7 @@ export class SasQueryParameters { if (this.ipRangeInner) { return { end: this.ipRangeInner.end, - start: this.ipRangeInner.start + start: this.ipRangeInner.start, }; } return undefined; @@ -210,7 +210,7 @@ export class SasQueryParameters { "rsct", "saoid", "scid", - "tn" // TableName + "tn", // TableName ]; const queries: string[] = []; diff --git a/sdk/tables/data-tables/src/sas/tableSasSignatureValues.ts b/sdk/tables/data-tables/src/sas/tableSasSignatureValues.ts index 6db4ab9370fa..df1e4156fa1b 100644 --- a/sdk/tables/data-tables/src/sas/tableSasSignatureValues.ts +++ b/sdk/tables/data-tables/src/sas/tableSasSignatureValues.ts @@ -141,7 +141,7 @@ export function generateTableSasQueryParameters( startingPartitionKey, startingRowKey, endingPartitionKey, - endingRowKey + endingRowKey, ].join("\n"); const signature = computeHMACSHA256(stringToSign, credential.key); @@ -153,7 +153,7 @@ export function generateTableSasQueryParameters( expiresOn: tableSasSignatureValues.expiresOn, ipRange: tableSasSignatureValues.ipRange, identifier: tableSasSignatureValues.identifier, - tableName + tableName, }); } diff --git a/sdk/tables/data-tables/src/serialization.ts b/sdk/tables/data-tables/src/serialization.ts index f4de0990139d..ac168dc992ac 100644 --- a/sdk/tables/data-tables/src/serialization.ts +++ b/sdk/tables/data-tables/src/serialization.ts @@ -4,7 +4,7 @@ import { EdmTypes, SignedIdentifier, TableEntityQueryOptions } from "./models"; import { QueryOptions as GeneratedQueryOptions, - SignedIdentifier as GeneratedSignedIdentifier + SignedIdentifier as GeneratedSignedIdentifier, } from "./generated/models"; import { base64Decode, base64Encode } from "./utils/bufferSerializer"; import { truncatedISO8061Date } from "./utils/truncateISO8061Date"; @@ -13,7 +13,7 @@ const propertyCaseMap: Map = new Map([ ["PartitionKey", "partitionKey"], ["RowKey", "rowKey"], ["odata.etag", "etag"], - ["Timestamp", "timestamp"] + ["Timestamp", "timestamp"], ]); const Edm = { @@ -24,7 +24,7 @@ const Edm = { Guid: "Edm.Guid", Int32: "Edm.Int32", Int64: "Edm.Int64", - String: "Edm.String" + String: "Edm.String", } as const; type supportedTypes = boolean | string | number | Date | Uint8Array | bigint; @@ -220,8 +220,8 @@ export function serializeSignedIdentifiers( accessPolicy: { ...(serializedExpiry && { expiry: serializedExpiry }), ...(serializedStart && { start: serializedStart }), - ...rest - } + ...rest, + }, }; }); } @@ -240,8 +240,8 @@ export function deserializeSignedIdentifier( accessPolicy: { ...(deserializedExpiry && { expiry: deserializedExpiry }), ...(deserializedStart && { start: deserializedStart }), - ...restAcl - } + ...restAcl, + }, }; }); } diff --git a/sdk/tables/data-tables/src/tablesNamedCredentialPolicy.ts b/sdk/tables/data-tables/src/tablesNamedCredentialPolicy.ts index 467c661db19d..50d6a2d92216 100644 --- a/sdk/tables/data-tables/src/tablesNamedCredentialPolicy.ts +++ b/sdk/tables/data-tables/src/tablesNamedCredentialPolicy.ts @@ -5,7 +5,7 @@ import { PipelinePolicy, PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import { HeaderConstants } from "./utils/constants"; import { NamedKeyCredential } from "@azure/core-auth"; @@ -31,7 +31,7 @@ export function tablesNamedKeyCredentialPolicy(credential: NamedKeyCredential): async sendRequest(request: PipelineRequest, next: SendRequest): Promise { signRequest(request); return next(request); - } + }, }; } @@ -56,7 +56,7 @@ export function getAuthorizationHeader( const stringToSign: string = [ dateHeader, - getCanonicalizedResourceString(request, credential) + getCanonicalizedResourceString(request, credential), ].join("\n"); const signature = computeHMACSHA256(stringToSign, credential.key); diff --git a/sdk/tables/data-tables/src/tablesSASTokenPolicy.ts b/sdk/tables/data-tables/src/tablesSASTokenPolicy.ts index 51ae76337922..fef974d0f8cc 100644 --- a/sdk/tables/data-tables/src/tablesSASTokenPolicy.ts +++ b/sdk/tables/data-tables/src/tablesSASTokenPolicy.ts @@ -5,7 +5,7 @@ import { PipelinePolicy, PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import { URL, URLSearchParams } from "./utils/url"; import { SASCredential } from "@azure/core-auth"; @@ -24,7 +24,7 @@ export function tablesSASTokenPolicy(credential: SASCredential): PipelinePolicy async sendRequest(request: PipelineRequest, next: SendRequest): Promise { signURLWithSAS(request, credential); return next(request); - } + }, }; } diff --git a/sdk/tables/data-tables/src/utils/accountConnectionString.ts b/sdk/tables/data-tables/src/utils/accountConnectionString.ts index a041ecbe695e..8afb710e9ef7 100644 --- a/sdk/tables/data-tables/src/utils/accountConnectionString.ts +++ b/sdk/tables/data-tables/src/utils/accountConnectionString.ts @@ -23,7 +23,7 @@ export function fromAccountConnectionString( return { url: extractedCreds.url, options, - credential: sharedKeyCredential + credential: sharedKeyCredential, }; } @@ -59,6 +59,6 @@ export function getAccountConnectionString( kind: "AccountConnString", url: tableEndpoint, accountName, - accountKey + accountKey, }; } diff --git a/sdk/tables/data-tables/src/utils/baseTransactionHeaders.ts b/sdk/tables/data-tables/src/utils/baseTransactionHeaders.ts index adf1ce374b1a..c0b5354a0032 100644 --- a/sdk/tables/data-tables/src/utils/baseTransactionHeaders.ts +++ b/sdk/tables/data-tables/src/utils/baseTransactionHeaders.ts @@ -13,6 +13,6 @@ export function getBaseTransactionHeaders(transactionGuid: string): RawHttpHeade "x-ms-version": "2019-02-02", DataServiceVersion: "3.0;", MaxDataServiceVersion: "3.0;NetFx", - "Content-Type": `multipart/mixed; boundary=batch_${transactionGuid}` + "Content-Type": `multipart/mixed; boundary=batch_${transactionGuid}`, }; } diff --git a/sdk/tables/data-tables/src/utils/computeHMACSHA256.ts b/sdk/tables/data-tables/src/utils/computeHMACSHA256.ts index 46e1b617f47e..d46e2ccdcc6f 100644 --- a/sdk/tables/data-tables/src/utils/computeHMACSHA256.ts +++ b/sdk/tables/data-tables/src/utils/computeHMACSHA256.ts @@ -5,7 +5,5 @@ import { createHmac } from "crypto"; export function computeHMACSHA256(stringToSign: string, accountKey: string): string { const key = Buffer.from(accountKey, "base64"); - return createHmac("sha256", key) - .update(stringToSign, "utf8") - .digest("base64"); + return createHmac("sha256", key).update(stringToSign, "utf8").digest("base64"); } diff --git a/sdk/tables/data-tables/src/utils/connectionString.ts b/sdk/tables/data-tables/src/utils/connectionString.ts index 1b8d99e3426a..4f504b0de6d4 100644 --- a/sdk/tables/data-tables/src/utils/connectionString.ts +++ b/sdk/tables/data-tables/src/utils/connectionString.ts @@ -33,7 +33,7 @@ export function getClientParamsFromConnectionString( } else if (extractedCreds.kind === "SASConnString") { return { url: `${extractedCreds.url}?${extractedCreds.accountSas}`, - options + options, }; } else { throw new Error( diff --git a/sdk/tables/data-tables/src/utils/constants.ts b/sdk/tables/data-tables/src/utils/constants.ts index 01f30724bfea..f525083399e2 100644 --- a/sdk/tables/data-tables/src/utils/constants.ts +++ b/sdk/tables/data-tables/src/utils/constants.ts @@ -15,7 +15,7 @@ export const HeaderConstants = { CONTENT_TRANSFER_ENCODING: "content-transfer-encoding", DATE: "date", X_MS_DATE: "x-ms-date", - X_MS_VERSION: "x-ms-version" + X_MS_VERSION: "x-ms-version", }; export const TablesLoggingAllowedHeaderNames = [ @@ -99,5 +99,5 @@ export const TablesLoggingAllowedHeaderNames = [ "x-ms-source-if-none-match", "x-ms-source-if-unmodified-since", "x-ms-tag-count", - "x-ms-encryption-key-sha256" + "x-ms-encryption-key-sha256", ]; diff --git a/sdk/tables/data-tables/src/utils/continuationToken.ts b/sdk/tables/data-tables/src/utils/continuationToken.ts index cb6884bbe364..90426a77c649 100644 --- a/sdk/tables/data-tables/src/utils/continuationToken.ts +++ b/sdk/tables/data-tables/src/utils/continuationToken.ts @@ -21,7 +21,7 @@ export function encodeContinuationToken( const continuationToken = JSON.stringify({ nextPartitionKey, - nextRowKey + nextRowKey, }); return base64Encode(continuationToken); diff --git a/sdk/tables/data-tables/src/utils/internalModels.ts b/sdk/tables/data-tables/src/utils/internalModels.ts index 7dc9b14b9197..89b2c1b3a6dd 100644 --- a/sdk/tables/data-tables/src/utils/internalModels.ts +++ b/sdk/tables/data-tables/src/utils/internalModels.ts @@ -14,7 +14,7 @@ import { TableTransactionResponse, TransactionAction, UpdateMode, - UpdateTableEntityOptions + UpdateTableEntityOptions, } from "../models"; import { DeleteTableEntityResponse, UpdateEntityResponse, UpsertEntityResponse } from ".."; import { Pipeline, PipelineRequest } from "@azure/core-rest-pipeline"; diff --git a/sdk/tables/data-tables/src/utils/isCredential.ts b/sdk/tables/data-tables/src/utils/isCredential.ts index 0c26c2faeaec..d1963a05a875 100644 --- a/sdk/tables/data-tables/src/utils/isCredential.ts +++ b/sdk/tables/data-tables/src/utils/isCredential.ts @@ -7,7 +7,7 @@ import { TokenCredential, isNamedKeyCredential, isSASCredential, - isTokenCredential + isTokenCredential, } from "@azure/core-auth"; export function isCredential( diff --git a/sdk/tables/data-tables/src/utils/tracing.ts b/sdk/tables/data-tables/src/utils/tracing.ts index 842b41f1d24d..52a69c0edcc4 100644 --- a/sdk/tables/data-tables/src/utils/tracing.ts +++ b/sdk/tables/data-tables/src/utils/tracing.ts @@ -9,5 +9,5 @@ import { createSpanFunction } from "@azure/core-tracing"; */ export const createSpan = createSpanFunction({ packagePrefix: "Azure.Data.Tables", - namespace: "Microsoft.Data.Tables" + namespace: "Microsoft.Data.Tables", }); diff --git a/sdk/tables/data-tables/src/utils/transactionHeaders.ts b/sdk/tables/data-tables/src/utils/transactionHeaders.ts index bd4b9c151550..d9ca071f8146 100644 --- a/sdk/tables/data-tables/src/utils/transactionHeaders.ts +++ b/sdk/tables/data-tables/src/utils/transactionHeaders.ts @@ -14,6 +14,6 @@ export function getTransactionHeaders(transactionGuid: string): RawHttpHeaders { ...baseHeaders, // The below headers are not supported in the browser as they are flagged as "unsafe headers" "Accept-Charset": "UTF-8", - Connection: "Keep-Alive" + Connection: "Keep-Alive", }; } diff --git a/sdk/tables/data-tables/src/utils/transactionHelpers.ts b/sdk/tables/data-tables/src/utils/transactionHelpers.ts index 59c9889d5333..df52312e79ff 100644 --- a/sdk/tables/data-tables/src/utils/transactionHelpers.ts +++ b/sdk/tables/data-tables/src/utils/transactionHelpers.ts @@ -27,7 +27,7 @@ export function getTransactionBoundary(transactionId: string): string { export function getInitialTransactionBody(transactionId: string, changesetId: string): string[] { const transactionBoundary = `batch_${transactionId}`; return [ - `--${transactionBoundary}${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: multipart/mixed; boundary=changeset_${changesetId}${TRANSACTION_HTTP_LINE_ENDING}${TRANSACTION_HTTP_LINE_ENDING}` + `--${transactionBoundary}${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: multipart/mixed; boundary=changeset_${changesetId}${TRANSACTION_HTTP_LINE_ENDING}${TRANSACTION_HTTP_LINE_ENDING}`, ]; } diff --git a/sdk/tables/data-tables/test/internal/browser/generateSas.browser.spec.ts b/sdk/tables/data-tables/test/internal/browser/generateSas.browser.spec.ts index 9742ff3f4562..ca956f7d7237 100644 --- a/sdk/tables/data-tables/test/internal/browser/generateSas.browser.spec.ts +++ b/sdk/tables/data-tables/test/internal/browser/generateSas.browser.spec.ts @@ -6,7 +6,7 @@ import { AzureNamedKeyCredential, generateTableSas } from "../../../src"; // This file is empty as sas generation is not supported in browsers describe("generateSas Browser", () => { - it("should throw", function() { + it("should throw", function () { try { generateTableSas("testTable", new AzureNamedKeyCredential("keyName", "keySecret")); assert.fail("`Expected generateTableSas to throw when running in the browser"); diff --git a/sdk/tables/data-tables/test/internal/node/generateSas.spec.ts b/sdk/tables/data-tables/test/internal/node/generateSas.spec.ts index 94535ce83a61..ad59b180454a 100644 --- a/sdk/tables/data-tables/test/internal/node/generateSas.spec.ts +++ b/sdk/tables/data-tables/test/internal/node/generateSas.spec.ts @@ -5,7 +5,7 @@ import { assert } from "chai"; import { AzureNamedKeyCredential, generateAccountSas, generateTableSas } from "../../../src"; import * as sinon from "sinon"; -describe("SAS generation", function() { +describe("SAS generation", function () { describe("generateTableSAS", () => { let clock: sinon.SinonFakeTimers; beforeEach(() => { @@ -39,8 +39,8 @@ describe("SAS generation", function() { { permissions: { add: true, - delete: true - } + delete: true, + }, } ); @@ -56,7 +56,7 @@ describe("SAS generation", function() { "testTable", new AzureNamedKeyCredential("keyName", "keySecret"), { - expiresOn: new Date("2022-12-12") + expiresOn: new Date("2022-12-12"), } ); @@ -73,7 +73,7 @@ describe("SAS generation", function() { new AzureNamedKeyCredential("keyName", "keySecret"), { identifier: "MyAccessPolicy", - version: "2019-02-02" + version: "2019-02-02", } ); @@ -111,8 +111,8 @@ describe("SAS generation", function() { const tableSas = generateAccountSas(new AzureNamedKeyCredential("keyName", "keySecret"), { permissions: { add: true, - delete: true - } + delete: true, + }, }); assert.equal( @@ -124,7 +124,7 @@ describe("SAS generation", function() { it("should generate a SAS token with explicit expiry", async () => { // Create the table SAS token const tableSas = generateAccountSas(new AzureNamedKeyCredential("keyName", "keySecret"), { - expiresOn: new Date("2022-12-12") + expiresOn: new Date("2022-12-12"), }); assert.equal( diff --git a/sdk/tables/data-tables/test/internal/serialization.spec.ts b/sdk/tables/data-tables/test/internal/serialization.spec.ts index ed3222f10688..c48b0a0a540d 100644 --- a/sdk/tables/data-tables/test/internal/serialization.spec.ts +++ b/sdk/tables/data-tables/test/internal/serialization.spec.ts @@ -5,7 +5,7 @@ import { deserialize, deserializeSignedIdentifier, serialize, - serializeSignedIdentifiers + serializeSignedIdentifiers, } from "../../src/serialization"; import { Edm } from "../../src"; import { assert } from "chai"; @@ -35,7 +35,7 @@ describe("Serializer", () => { const boolValue = true; const serialized: any = serialize({ boolProp: boolValue, - boolObjProp: { value: boolValue, type: "Boolean" } + boolObjProp: { value: boolValue, type: "Boolean" }, }); assert.strictEqual(serialized.boolProp, boolValue); assert.strictEqual(serialized.boolObjProp, boolValue); @@ -45,7 +45,7 @@ describe("Serializer", () => { it("should serialize null and undefined values", () => { const serialized: any = serialize({ nullProp: null, - undefinedProp: undefined + undefinedProp: undefined, }); assert.strictEqual(serialized.nullProp, null); assert.strictEqual(serialized.undefinedProp, undefined); @@ -55,7 +55,7 @@ describe("Serializer", () => { const strValue = "Test String"; const serialized: any = serialize({ strProp: strValue, - strObjProp: { value: strValue, type: "String" } + strObjProp: { value: strValue, type: "String" }, }); assert.strictEqual(serialized.strProp, strValue); assert.strictEqual(serialized.strObjProp, strValue); @@ -66,7 +66,7 @@ describe("Serializer", () => { const doubleValue = 3.1415; const serialized: any = serialize({ doubleProp: doubleValue, - doubleObjProp: { value: doubleValue, type: "Double" } + doubleObjProp: { value: doubleValue, type: "Double" }, }); assert.strictEqual(serialized.doubleProp, doubleValue); assert.strictEqual(serialized.doubleObjProp, doubleValue); @@ -77,7 +77,7 @@ describe("Serializer", () => { const int32Value = 123; const serialized: any = serialize({ int32Prop: int32Value, - int32ObjProp: { value: int32Value, type: "Int32" } + int32ObjProp: { value: int32Value, type: "Int32" }, }); assert.strictEqual(serialized.int32Prop, int32Value); assert.strictEqual(serialized.int32ObjProp, int32Value); @@ -87,7 +87,7 @@ describe("Serializer", () => { it("should serialize an Int64 value", () => { const int64Value = "12345678910"; const serialized: any = serialize({ - int64ObjProp: { value: int64Value, type: "Int64" } + int64ObjProp: { value: int64Value, type: "Int64" }, }); assert.strictEqual(serialized.int64ObjProp, int64Value); assert.strictEqual(serialized["int64ObjProp@odata.type"], "Edm.Int64"); @@ -97,7 +97,7 @@ describe("Serializer", () => { const dateValue = new Date(); const serialized: any = serialize({ dateProp: dateValue, - dateObjProp: { value: dateValue, type: "DateTime" } + dateObjProp: { value: dateValue, type: "DateTime" }, }); assert.strictEqual(serialized.dateProp, dateValue); assert.strictEqual(serialized.dateObjProp, dateValue); @@ -107,7 +107,7 @@ describe("Serializer", () => { it("should serialize a Guid value", () => { const guidValue = "123e4567-e89b-12d3-a456-426614174000"; const serialized: any = serialize({ - guidObjProp: { value: guidValue, type: "Guid" } + guidObjProp: { value: guidValue, type: "Guid" }, }); assert.strictEqual(serialized.guidObjProp, guidValue); assert.strictEqual(serialized["guidObjProp@odata.type"], "Edm.Guid"); @@ -118,7 +118,7 @@ describe("Serializer", () => { const base64Encoded = "VGVzdDEyMw=="; const serialized: any = serialize({ binProp: binValue, - binObjProp: { value: base64Encoded, type: "Binary" } + binObjProp: { value: base64Encoded, type: "Binary" }, }); assert.strictEqual(serialized.binProp, base64Encoded); assert.strictEqual(serialized.binObjProp, base64Encoded); @@ -130,7 +130,7 @@ describe("Deserializer", () => { it("should deserialize a null and undefined values", () => { const deserialized: Entity = deserialize({ nullProp: null, - undefinedProp: undefined + undefinedProp: undefined, }); assert.strictEqual(deserialized.nullProp, null); assert.strictEqual(deserialized.undefinedProp, undefined); @@ -139,7 +139,7 @@ describe("Deserializer", () => { it("should deserialize a Boolean value", () => { const boolValue = true; const deserialized: Entity = deserialize({ - boolProp: boolValue + boolProp: boolValue, }); assert.strictEqual(deserialized.boolProp, boolValue); }); @@ -147,7 +147,7 @@ describe("Deserializer", () => { it("should deserialize a String value", () => { const strValue = "Test String"; const deserialized: Entity = deserialize({ - strProp: strValue + strProp: strValue, }); assert.strictEqual(deserialized.strProp, strValue); }); @@ -155,7 +155,7 @@ describe("Deserializer", () => { it("should deserialize a Double value", () => { const doubleValue = 3.1415; const deserialized: Entity = deserialize({ - doubleProp: doubleValue + doubleProp: doubleValue, }); assert.strictEqual(deserialized.doubleProp, doubleValue); }); @@ -163,19 +163,19 @@ describe("Deserializer", () => { it("should deserialize an Int32 value", () => { const int32Value = 123; const deserialized: Entity = deserialize({ - int32Prop: int32Value + int32Prop: int32Value, }); assert.strictEqual(deserialized.int32Prop, int32Value); }); - it("should deserialize an Int64 value to bigint", function(this: Mocha.Context) { + it("should deserialize an Int64 value to bigint", function (this: Mocha.Context) { if (isNode8) { this.skip(); } const int64Value = "12345678910"; const deserialized = deserialize({ int64ObjProp: int64Value, - "int64ObjProp@odata.type": "Edm.Int64" + "int64ObjProp@odata.type": "Edm.Int64", }); assert.strictEqual(deserialized.int64ObjProp, BigInt(int64Value)); }); @@ -185,7 +185,7 @@ describe("Deserializer", () => { const deserialized = deserialize( { int64ObjProp: int64Value, - "int64ObjProp@odata.type": "Edm.Int64" + "int64ObjProp@odata.type": "Edm.Int64", }, true ); @@ -197,7 +197,7 @@ describe("Deserializer", () => { const intValue = 123; const deserialized = deserialize( { - intValue: intValue + intValue: intValue, }, true ); @@ -209,7 +209,7 @@ describe("Deserializer", () => { const boolValue = true; const deserialized = deserialize( { - boolValue + boolValue, }, true ); @@ -223,7 +223,7 @@ describe("Deserializer", () => { const stringValue = "foo"; const deserialized = deserialize( { - stringValue + stringValue, }, true ); @@ -237,7 +237,7 @@ describe("Deserializer", () => { const doubleValue = 123.0; const deserialized = deserialize( { - intValue: doubleValue + intValue: doubleValue, }, true ); @@ -251,7 +251,7 @@ describe("Deserializer", () => { const doubleValue = 123.01; const deserialized = deserialize( { - intValue: doubleValue + intValue: doubleValue, }, true ); @@ -263,7 +263,7 @@ describe("Deserializer", () => { const intValue = 123; const deserialized = deserialize( { - intValue: intValue + intValue: intValue, }, false ); @@ -274,7 +274,7 @@ describe("Deserializer", () => { const decimalValue = 123.0; const deserialized = deserialize( { - intValue: decimalValue + intValue: decimalValue, }, false ); @@ -285,7 +285,7 @@ describe("Deserializer", () => { const dateValue = new Date(); const deserialized = deserialize({ dateProp: dateValue.toJSON(), - "dateProp@odata.type": "Edm.DateTime" + "dateProp@odata.type": "Edm.DateTime", }); assert.deepEqual(deserialized.dateProp, dateValue); }); @@ -295,7 +295,7 @@ describe("Deserializer", () => { const deserialized = deserialize<{ dateProp: Edm<"DateTime"> }>( { dateProp: dateValue.toJSON(), - "dateProp@odata.type": "Edm.DateTime" + "dateProp@odata.type": "Edm.DateTime", }, true ); @@ -306,7 +306,7 @@ describe("Deserializer", () => { const guidValue = "123e4567-e89b-12d3-a456-426614174000"; const deserialized: Entity = deserialize({ guidObjProp: guidValue, - "guidObjProp@odata.type": "Edm.Guid" + "guidObjProp@odata.type": "Edm.Guid", }); assert.strictEqual(deserialized.guidObjProp?.value, guidValue); assert.strictEqual(deserialized.guidObjProp?.type, "Guid"); @@ -317,7 +317,7 @@ describe("Deserializer", () => { const base64Encoded = "VGVzdDEyMw=="; const deserialized: Entity = deserialize({ binProp: base64Encoded, - "binProp@odata.type": "Edm.Binary" + "binProp@odata.type": "Edm.Binary", }); assert.deepEqual(deserialized.binProp, binValue); }); @@ -329,7 +329,7 @@ describe("SignedIdentifier serialization", () => { const expectedDate = "2021-06-09T16:34:29Z"; const serialized = serializeSignedIdentifiers([ - { id: "test", accessPolicy: { start: date, expiry: date } } + { id: "test", accessPolicy: { start: date, expiry: date } }, ]); assert.lengthOf(serialized, 1); @@ -342,7 +342,7 @@ describe("SignedIdentifier serialization", () => { const date = "2021-06-09T16:34:29Z"; const serialized = deserializeSignedIdentifier([ - { id: "test", accessPolicy: { start: date, expiry: date } } + { id: "test", accessPolicy: { start: date, expiry: date } }, ]); assert.lengthOf(serialized, 1); diff --git a/sdk/tables/data-tables/test/internal/sharedKeyCredential.spec.ts b/sdk/tables/data-tables/test/internal/sharedKeyCredential.spec.ts index c73e4f232a2a..9e501f7fc836 100644 --- a/sdk/tables/data-tables/test/internal/sharedKeyCredential.spec.ts +++ b/sdk/tables/data-tables/test/internal/sharedKeyCredential.spec.ts @@ -6,7 +6,7 @@ import { PipelineResponse, SendRequest, createHttpHeaders, - createPipelineRequest + createPipelineRequest, } from "@azure/core-rest-pipeline"; import { AzureNamedKeyCredential } from "@azure/core-auth"; import { Context } from "mocha"; @@ -26,7 +26,7 @@ describe("TablesSharedKeyCredential", () => { Date.prototype.toUTCString = originalToUTCString; }); - it("It should sign", async function(this: Context) { + it("It should sign", async function (this: Context) { if (!isNode) { // AzureNamedKeyCredential auth is not supported in Browser this.skip(); @@ -34,11 +34,11 @@ describe("TablesSharedKeyCredential", () => { const url = "https://testaccount.table.core.windows.net/tablename(PartitionKey='p1',RowKey='r1')"; const requestToSign = createPipelineRequest({ url }); - const next: SendRequest = function(request: PipelineRequest): Promise { + const next: SendRequest = function (request: PipelineRequest): Promise { return Promise.resolve({ status: 200, request, - headers: createHttpHeaders() + headers: createHttpHeaders(), }); }; const cred = new AzureNamedKeyCredential("accountName", "accountKey"); diff --git a/sdk/tables/data-tables/test/internal/tableTransaction.spec.ts b/sdk/tables/data-tables/test/internal/tableTransaction.spec.ts index 20e0c4419809..db2a98643505 100644 --- a/sdk/tables/data-tables/test/internal/tableTransaction.spec.ts +++ b/sdk/tables/data-tables/test/internal/tableTransaction.spec.ts @@ -5,7 +5,7 @@ import { PipelineResponse, createHttpHeaders, createPipelineRequest, - HttpClient + HttpClient, } from "@azure/core-rest-pipeline"; import { assert } from "chai"; import { TableClient } from "../../src/TableClient"; @@ -17,7 +17,7 @@ describe("TableTransaction", () => { const testResponse: PipelineResponse = { headers: createHttpHeaders(), request: createPipelineRequest({ url: "https://example.org" }), - status: 400 + status: 400, }; try { @@ -36,9 +36,9 @@ describe("TableTransaction", () => { bodyAsText: JSON.stringify({ "odata.error": { code: "123", - message: { value: "Test message" } - } - }) + message: { value: "Test message" }, + }, + }), }; try { @@ -56,10 +56,10 @@ describe("TableTransaction", () => { sendRequest: async (request) => { isProxy = true; return { status: 200, headers: createHttpHeaders(), request }; - } + }, }; const client = new TableClient("https://example.org", "TestTable", { - httpClient: proxyHttpClient + httpClient: proxyHttpClient, }); const transaction = new TableTransaction(); transaction.createEntity({ partitionKey: "helper", rowKey: "1", value: "t1" }); diff --git a/sdk/tables/data-tables/test/internal/utils.spec.ts b/sdk/tables/data-tables/test/internal/utils.spec.ts index 9b963374fa88..a2a2dfeb78ac 100644 --- a/sdk/tables/data-tables/test/internal/utils.spec.ts +++ b/sdk/tables/data-tables/test/internal/utils.spec.ts @@ -11,7 +11,7 @@ import { isNode } from "@azure/test-utils"; describe("Utility Helpers", () => { describe("extractConnectionStringParts", () => { describe("Account Connection String", () => { - beforeEach(function(this: Context) { + beforeEach(function (this: Context) { if (!isNode) { // Account connection string is not supported for Browsers this.skip(); @@ -25,7 +25,7 @@ describe("Utility Helpers", () => { accountName: "testaccount", accountKey: "REDACTED", kind: "AccountConnString", - url: "https://testaccount.table.core.windows.net" + url: "https://testaccount.table.core.windows.net", }); }); @@ -37,7 +37,7 @@ describe("Utility Helpers", () => { accountName: "testaccount", accountKey: "REDACTED", kind: "AccountConnString", - url: "https://testaccount.table.core.windows.net" + url: "https://testaccount.table.core.windows.net", }); }); @@ -49,7 +49,7 @@ describe("Utility Helpers", () => { accountName: "testaccount", accountKey: "REDACTED", kind: "AccountConnString", - url: "https://myAccount.table.core.windows.net" + url: "https://myAccount.table.core.windows.net", }); }); @@ -73,7 +73,7 @@ describe("Utility Helpers", () => { accountName: "teststorageaccount", accountSas: "REDACTED", kind: "SASConnString", - url: "https://teststorageaccount.table.core.windows.net" + url: "https://teststorageaccount.table.core.windows.net", }; it("should handle format 'protocol://accountName.table.endpointSuffix'", () => { @@ -82,7 +82,7 @@ describe("Utility Helpers", () => { const connectionStringParts = extractConnectionStringParts(validSAS); assert.deepEqual(connectionStringParts, { ...expectedConenctionStringParts, - accountSas: "sv=2020-02-10&ss=bfqt" + accountSas: "sv=2020-02-10&ss=bfqt", }); }); @@ -92,7 +92,7 @@ describe("Utility Helpers", () => { const connectionStringParts = extractConnectionStringParts(validIPSAS); assert.deepEqual(connectionStringParts, { ...expectedConenctionStringParts, - url: "https://127.0.0.1/teststorageaccount" + url: "https://127.0.0.1/teststorageaccount", }); }); diff --git a/sdk/tables/data-tables/test/public/accessPolicy.spec.ts b/sdk/tables/data-tables/test/public/accessPolicy.spec.ts index d1f64c78d0e1..7da57c91fc63 100644 --- a/sdk/tables/data-tables/test/public/accessPolicy.spec.ts +++ b/sdk/tables/data-tables/test/public/accessPolicy.spec.ts @@ -13,7 +13,7 @@ describe(`Access Policy operations`, () => { let recorder: Recorder; const tableName = `AccessPolicy`; - beforeEach(async function(this: Context) { + beforeEach(async function (this: Context) { recorder = record(this, recordedEnvironmentSetup); if (!isNode) { @@ -31,7 +31,7 @@ describe(`Access Policy operations`, () => { } }); - afterEach(async function() { + afterEach(async function () { await recorder.stop(); }); @@ -45,13 +45,13 @@ describe(`Access Policy operations`, () => { } }); - it("should send a null AP", async function() { + it("should send a null AP", async function () { const date = new Date("2021-07-08T09:10:09Z"); await client.setAccessPolicy([ { id: "null" }, { id: "empty", accessPolicy: {} }, { id: "partial", accessPolicy: { permission: "r" } }, - { id: "full", accessPolicy: { start: date, expiry: date, permission: "r" } } + { id: "full", accessPolicy: { start: date, expiry: date, permission: "r" } }, ]); const acl = await client.getAccessPolicy(); diff --git a/sdk/tables/data-tables/test/public/createTable.spec.ts b/sdk/tables/data-tables/test/public/createTable.spec.ts index 7edeb168b9d6..fd06354f6116 100644 --- a/sdk/tables/data-tables/test/public/createTable.spec.ts +++ b/sdk/tables/data-tables/test/public/createTable.spec.ts @@ -10,11 +10,11 @@ import { createHttpHeaders } from "@azure/core-rest-pipeline"; describe("TableClient CreationHandling", () => { let client: TableClient; - beforeEach(function(this: Context) { + beforeEach(function (this: Context) { client = createTableClient("testTable"); }); - it("should not thorw if table already exists", async function() { + it("should not thorw if table already exists", async function () { // Mock core-client throwing on error to verify consistenty that don't throw the error client.pipeline.addPolicy({ name: "TableAlreadyExists", @@ -26,25 +26,25 @@ describe("TableClient CreationHandling", () => { bodyAsText: "", parsedBody: { odataError: { - code: "TableAlreadyExists" - } - } + code: "TableAlreadyExists", + }, + }, }; throw new RestError("TableAlreadyExists", { statusCode: 409, - response: mockedResponse + response: mockedResponse, }); - } + }, }); await client.createTable({ onResponse: (response) => { assert.equal(response.status, 409); - } + }, }); }); - it("should throw when 409 and not TableAlreadyExists", async function() { + it("should throw when 409 and not TableAlreadyExists", async function () { // Mock core-client throwing on error to verify consistenty that we surface the error client.pipeline.addPolicy({ name: "Other409Error", @@ -54,10 +54,10 @@ describe("TableClient CreationHandling", () => { request: req, status: 409, bodyAsText: "", - parsedBody: { odataError: { code: "TableBeingDeleted" } } + parsedBody: { odataError: { code: "TableBeingDeleted" } }, }; throw new RestError("TableBeingDeleted", { statusCode: 409, response: mockedResponse }); - } + }, }); try { @@ -71,11 +71,11 @@ describe("TableClient CreationHandling", () => { describe("TableServiceClient CreationHandling", () => { let client: TableServiceClient; - beforeEach(function(this: Context) { + beforeEach(function (this: Context) { client = createTableServiceClient(); }); - it("should not thorw if table already exists", async function() { + it("should not thorw if table already exists", async function () { const tableName = `tableExists`; // Mock core-client throwing on error to verify consistenty that don't throw the error client.pipeline.addPolicy({ @@ -88,25 +88,25 @@ describe("TableServiceClient CreationHandling", () => { bodyAsText: "", parsedBody: { odataError: { - code: "TableAlreadyExists" - } - } + code: "TableAlreadyExists", + }, + }, }; throw new RestError("TableAlreadyExists", { statusCode: 409, - response: mockedResponse + response: mockedResponse, }); - } + }, }); await client.createTable(tableName, { onResponse: (response) => { assert.equal(response.status, 409); - } + }, }); }); - it("should throw when 409 and not TableAlreadyExists", async function() { + it("should throw when 409 and not TableAlreadyExists", async function () { const tableName = `throwError`; // Mock core-client throwing on error to verify consistenty that we surface the error client.pipeline.addPolicy({ @@ -119,15 +119,15 @@ describe("TableServiceClient CreationHandling", () => { bodyAsText: "", parsedBody: { odataError: { - code: "TableBeingDeleted" - } - } + code: "TableBeingDeleted", + }, + }, }; throw new RestError("TableBeingDeleted", { statusCode: 409, - response: mockedResponse + response: mockedResponse, }); - } + }, }); try { await client.createTable(tableName); diff --git a/sdk/tables/data-tables/test/public/specialCharacters.spec.ts b/sdk/tables/data-tables/test/public/specialCharacters.spec.ts index 6b0f8e6219b8..28c92020b05d 100644 --- a/sdk/tables/data-tables/test/public/specialCharacters.spec.ts +++ b/sdk/tables/data-tables/test/public/specialCharacters.spec.ts @@ -8,8 +8,8 @@ import { Context } from "mocha"; import { assert } from "chai"; import { isNode } from "@azure/test-utils"; -describe("SpecialCharacters", function() { - before(function(this: Context) { +describe("SpecialCharacters", function () { + before(function (this: Context) { if (!isLiveMode()) { // Currently the recorder is having issues with the encoding of single qoutes in the // query request and generates invalid JS code. Disabling this test on playback mode @@ -42,16 +42,16 @@ describe("SpecialCharacters", function() { { char: `^`, name: "hat" }, { char: `!`, name: "bang" }, { char: `%`, name: "percentage" }, - { char: `*`, name: "star" } + { char: `*`, name: "star" }, ]; describe("Single operations", () => { - beforeEach(function(this: Context) { + beforeEach(function (this: Context) { recorder = record(this, recordedEnvironmentSetup); client = createTableClient(tableName, "TokenCredential"); }); - afterEach(async function() { + afterEach(async function () { await recorder.stop(); }); @@ -97,7 +97,7 @@ describe("SpecialCharacters", function() { it("should filter entity by partition key", async () => { const entities = client.listEntities({ - queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` }, }); for await (const entity of entities) { @@ -109,7 +109,7 @@ describe("SpecialCharacters", function() { it("should filter entity by row key", async () => { const entities = client.listEntities({ - queryOptions: { filter: odata`RowKey eq ${rowKey}` } + queryOptions: { filter: odata`RowKey eq ${rowKey}` }, }); for await (const entity of entities) { @@ -132,12 +132,12 @@ describe("SpecialCharacters", function() { }); describe("Batch", () => { - beforeEach(function(this: Context) { + beforeEach(function (this: Context) { recorder = record(this, recordedEnvironmentSetup); client = createTableClient(`${tableName}Batch`, "TokenCredential"); }); - afterEach(async function() { + afterEach(async function () { await recorder.stop(); }); const partitionKey = `foo'`; @@ -199,7 +199,7 @@ describe("SpecialCharacters", function() { it(`should filter entity by partition key`, async () => { const entities = client.listEntities({ - queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` }, }); const results = []; @@ -224,7 +224,7 @@ describe("SpecialCharacters", function() { it(`should filter entity by row key with ${name}`, async () => { const entities = client.listEntities({ - queryOptions: { filter: odata`RowKey eq ${rowKey}` } + queryOptions: { filter: odata`RowKey eq ${rowKey}` }, }); const results: TableEntityResult>[] = []; diff --git a/sdk/tables/data-tables/test/public/tableclient.spec.ts b/sdk/tables/data-tables/test/public/tableclient.spec.ts index 359cc9b16b3c..de06130f668f 100644 --- a/sdk/tables/data-tables/test/public/tableclient.spec.ts +++ b/sdk/tables/data-tables/test/public/tableclient.spec.ts @@ -4,7 +4,7 @@ import { CreateClientMode, createTableClient, - recordedEnvironmentSetup + recordedEnvironmentSetup, } from "./utils/recordedClient"; import { Edm, TableClient, TableEntity, TableEntityResult, odata } from "../../src"; import { Recorder, isLiveMode, isPlaybackMode, record } from "@azure-tools/test-recorder"; @@ -26,7 +26,7 @@ if (isLiveMode()) { } describe("special characters", () => { - it("should handle partition and row keys with special chars", async function(this: Context) { + it("should handle partition and row keys with special chars", async function (this: Context) { if (!isLiveMode()) { // Currently the recorder is having issues with the encoding of single qoutes in the // query request and generates invalid JS code. Disabling this test on playback mode @@ -43,7 +43,7 @@ describe("special characters", () => { await client.createEntity({ partitionKey, rowKey, - test: expectedValue + test: expectedValue, }); const entity = await client.getEntity(partitionKey, rowKey); @@ -65,7 +65,7 @@ authModes.forEach((authMode) => { const tableName = `tableClientTest${authMode}${suffix}`; const listPartitionKey = "listEntitiesTest"; - beforeEach(function(this: Context) { + beforeEach(function (this: Context) { recorder = record(this, recordedEnvironmentSetup); client = createTableClient(tableName, authMode); @@ -78,7 +78,7 @@ authModes.forEach((authMode) => { } }); - afterEach(async function() { + afterEach(async function () { await recorder.stop(); }); @@ -90,20 +90,20 @@ authModes.forEach((authMode) => { describe("listEntities", () => { // Create required entities for testing list operations - before(async function(this: Context) { + before(async function (this: Context) { if (!isPlaybackMode()) { this.timeout(10000); await client.createEntity({ partitionKey: listPartitionKey, rowKey: "binary1", - foo: new Uint8Array([66, 97, 114]) + foo: new Uint8Array([66, 97, 114]), }); for (let i = 0; i < 20; i++) { await client.createEntity({ partitionKey: listPartitionKey, rowKey: `${i}`, - foo: "testEntity" + foo: "testEntity", }); } } @@ -124,10 +124,10 @@ authModes.forEach((authMode) => { | TableEntity | TableEntity; - it("should list all", async function() { + it("should list all", async function () { const totalItems = 21; const entities = client.listEntities({ - queryOptions: { filter: odata`PartitionKey eq ${listPartitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${listPartitionKey}` }, }); const all: TestEntity[] = []; for await (const entity of entities) { @@ -137,15 +137,15 @@ authModes.forEach((authMode) => { assert.lengthOf(all, totalItems); }).timeout(10000); - it("should list by page", async function() { + it("should list by page", async function () { const barItems = 20; const maxPageSize = 5; const entities = client.listEntities({ - queryOptions: { filter: odata`PartitionKey eq ${listPartitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${listPartitionKey}` }, }); let all: TestEntity[] = []; for await (const entity of entities.byPage({ - maxPageSize + maxPageSize, })) { all = [...all, ...entity]; } @@ -162,11 +162,11 @@ authModes.forEach((authMode) => { ); }); - it("should list with filter", async function() { + it("should list with filter", async function () { const barItems = 20; const strValue = "testEntity"; const entities = client.listEntities>({ - queryOptions: { filter: odata`foo eq ${strValue}` } + queryOptions: { filter: odata`foo eq ${strValue}` }, }); let all: TableEntity[] = []; for await (const entity of entities) { @@ -181,10 +181,10 @@ authModes.forEach((authMode) => { } }); - it("should list binary with filter", async function() { + it("should list binary with filter", async function () { const strValue = "binary1"; const entities = client.listEntities>({ - queryOptions: { filter: odata`RowKey eq ${strValue}` } + queryOptions: { filter: odata`RowKey eq ${strValue}` }, }); let all: TableEntity[] = []; for await (const entity of entities) { @@ -209,14 +209,14 @@ authModes.forEach((authMode) => { const testEntity: TableEntity = { partitionKey: `P2_${suffix}`, rowKey: "R1", - testField: "testEntity" + testField: "testEntity", }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; await client.createEntity(testEntity, { onResponse: (res) => (createResult = res) }); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -231,14 +231,14 @@ authModes.forEach((authMode) => { const testEntity: TableEntity = { partitionKey: "", rowKey: "", - testField: "testEntity" + testField: "testEntity", }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; await client.createEntity(testEntity, { onResponse: (res) => (createResult = res) }); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -266,8 +266,8 @@ authModes.forEach((authMode) => { binary: primitive, binaryMetadata: { type: "Binary", - value: "QmFy" - } + value: "QmFy", + }, }; await client.createEntity(expected); @@ -304,14 +304,14 @@ authModes.forEach((authMode) => { binary: primitive, binaryMetadata: { type: "Binary", - value: base64Value - } + value: base64Value, + }, }; await client.createEntity(expected); const result = await client.getEntity(expected.partitionKey, expected.rowKey, { - disableTypeConversion: true + disableTypeConversion: true, }); assert.deepEqual(result.binary.value, base64Value); @@ -324,13 +324,13 @@ authModes.forEach((authMode) => { rowKey: "R1", foo: "testEntity", bar: 123, - baz: true + baz: true, }; await client.createEntity(testEntity); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey, { - queryOptions: { select: ["baz", "partitionKey", "rowKey", "etag"] } + queryOptions: { select: ["baz", "partitionKey", "rowKey", "etag"] }, }); assert.isDefined(result.etag); @@ -348,14 +348,14 @@ authModes.forEach((authMode) => { const testEntity = { partitionKey: `P2_${suffix}`, rowKey: "R2", - testField: new Date(testDate) + testField: new Date(testDate), }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; await client.createEntity(testEntity, { onResponse: (res) => (createResult = res) }); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -372,19 +372,19 @@ authModes.forEach((authMode) => { const testGuid: Edm<"Guid"> = { value: "cf8ef051-1b7d-4e93-a1e5-a3944d7e441c", - type: "Guid" + type: "Guid", }; const testEntity: TableEntity = { partitionKey: `P3_${suffix}`, rowKey: "R3", - testField: testGuid + testField: testGuid, }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; await client.createEntity(testEntity, { onResponse: (res) => (createResult = res) }); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -394,7 +394,7 @@ authModes.forEach((authMode) => { assert.deepEqual(result.testField, testGuid); }); - it("should createEntity with Int64", async function(this: Mocha.Context) { + it("should createEntity with Int64", async function (this: Mocha.Context) { if (isNode8) { this.skip(); } @@ -403,19 +403,19 @@ authModes.forEach((authMode) => { }; const testInt64: Edm<"Int64"> = { value: "12345543221", - type: "Int64" + type: "Int64", }; const testEntity: TableEntity = { partitionKey: `P4_${suffix}`, rowKey: "R4", - testField: testInt64 + testField: testInt64, }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; await client.createEntity(testEntity, { onResponse: (res) => (createResult = res) }); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -436,12 +436,12 @@ authModes.forEach((authMode) => { const testInt32: Edm<"Int32"> = { value: 123, - type: "Int32" + type: "Int32", }; const testEntity: TableEntity = { partitionKey: `P5_${suffix}`, rowKey: "R5", - testField: testInt32 + testField: testInt32, }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; @@ -451,7 +451,7 @@ authModes.forEach((authMode) => { testEntity.rowKey ); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -473,13 +473,13 @@ authModes.forEach((authMode) => { const testBoolean: Edm<"Boolean"> = { value: true, - type: "Boolean" + type: "Boolean", }; // Check this API interaction! const testEntity: TableEntity = { partitionKey: `P6_${suffix}`, rowKey: "R6", - testField: testBoolean + testField: testBoolean, }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; @@ -489,7 +489,7 @@ authModes.forEach((authMode) => { testEntity.rowKey ); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -505,13 +505,13 @@ authModes.forEach((authMode) => { const testDate = "2020-09-17T00:00:00.99999Z"; const testDateTime: Edm<"DateTime"> = { value: testDate, - type: "DateTime" + type: "DateTime", }; // Check this API interaction! const testEntity: TableEntity = { partitionKey: `P7_${suffix}`, rowKey: "R7", - testField: testDateTime + testField: testDateTime, }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; @@ -520,11 +520,11 @@ authModes.forEach((authMode) => { testEntity.partitionKey, testEntity.rowKey, { - disableTypeConversion: true + disableTypeConversion: true, } ); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -539,14 +539,14 @@ authModes.forEach((authMode) => { partitionKey: `P8_${suffix}`, rowKey: "R8", integerNumber: 3, - floatingPointNumber: 3.14 + floatingPointNumber: 3.14, }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; await client.createEntity(testEntity, { onResponse: (res) => (createResult = res) }); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -561,13 +561,13 @@ authModes.forEach((authMode) => { const inputEntity = { partitionKey: "doubleSci", rowKey: "0", - Value: { value: "1.23456789012346e+24", type: "Double" } + Value: { value: "1.23456789012346e+24", type: "Double" }, }; await client.createEntity(inputEntity); const result = await client.getEntity(inputEntity.partitionKey, inputEntity.rowKey, { - disableTypeConversion: true + disableTypeConversion: true, }); assert.deepEqual(result.Value, inputEntity.Value); @@ -577,13 +577,13 @@ authModes.forEach((authMode) => { const inputEntity = { partitionKey: "emptyString", rowKey: "0", - value: { value: "", type: "String" } + value: { value: "", type: "String" }, }; await client.createEntity(inputEntity); const result = await client.getEntity(inputEntity.partitionKey, inputEntity.rowKey, { - disableTypeConversion: true + disableTypeConversion: true, }); assert.deepEqual(result.value, inputEntity.value); @@ -600,18 +600,18 @@ authModes.forEach((authMode) => { rowKey: "R8", integerNumber: 3, floatingPointNumber: 3.14, - booleanValue: true + booleanValue: true, }; let createResult: FullOperationResponse | undefined; let deleteResult: FullOperationResponse | undefined; await client.createEntity(testEntity, { - onResponse: (res) => (createResult = res) + onResponse: (res) => (createResult = res), }); const result = await client.getEntity(testEntity.partitionKey, testEntity.rowKey, { - disableTypeConversion: true + disableTypeConversion: true, }); await client.deleteEntity(testEntity.partitionKey, testEntity.rowKey, { - onResponse: (res) => (deleteResult = res) + onResponse: (res) => (deleteResult = res), }); assert.equal(deleteResult?.status, 204); @@ -620,15 +620,15 @@ authModes.forEach((authMode) => { assert.equal(result.rowKey, testEntity.rowKey); assert.deepEqual(result.integerNumber, { value: "3", - type: "Int32" + type: "Int32", }); assert.deepEqual(result.floatingPointNumber, { value: "3.14", - type: "Double" + type: "Double", }); assert.deepEqual(result.booleanValue, { value: "true", - type: "Boolean" + type: "Boolean", }); }); }); diff --git a/sdk/tables/data-tables/test/public/tableserviceclient.spec.ts b/sdk/tables/data-tables/test/public/tableserviceclient.spec.ts index b099425a878b..a84f0d7595fa 100644 --- a/sdk/tables/data-tables/test/public/tableserviceclient.spec.ts +++ b/sdk/tables/data-tables/test/public/tableserviceclient.spec.ts @@ -4,7 +4,7 @@ import { CreateClientMode, createTableServiceClient, - recordedEnvironmentSetup + recordedEnvironmentSetup, } from "./utils/recordedClient"; import { Recorder, isLiveMode, isPlaybackMode, record } from "@azure-tools/test-recorder"; import { TableItem, TableItemResultPage, TableServiceClient } from "../../src"; @@ -31,12 +31,12 @@ authModes.forEach((authMode) => { let recorder: Recorder; const suffix = isNode ? `${authMode}node` : `${authMode}browser`; - beforeEach(function(this: Context) { + beforeEach(function (this: Context) { recorder = record(this, recordedEnvironmentSetup); client = createTableServiceClient(authMode); }); - afterEach(async function() { + afterEach(async function () { await recorder.stop(); }); @@ -66,7 +66,7 @@ authModes.forEach((authMode) => { describe("listTables", () => { const tableNames: string[] = []; const expectedTotalItems = 20; - before(async function(this: Context) { + before(async function (this: Context) { // Create tables to be listed if (!isPlaybackMode()) { this.timeout(10000); @@ -78,7 +78,7 @@ authModes.forEach((authMode) => { } }); - after(async function(this: Context) { + after(async function (this: Context) { // Cleanup tables if (!isPlaybackMode()) { this.timeout(10000); @@ -106,12 +106,12 @@ authModes.forEach((authMode) => { } }); - it("should list by page", async function() { + it("should list by page", async function () { let all: TableItem[] = []; const maxPageSize = 5; const tables = client.listTables(); for await (const page of tables.byPage({ - maxPageSize + maxPageSize, })) { all = [...all, ...page]; assert.isTrue(page.length <= 5); @@ -125,13 +125,13 @@ authModes.forEach((authMode) => { } }); - it("should list a specific page with continuationToken", async function() { + it("should list a specific page with continuationToken", async function () { const entities = client.listTables(); let lastPage: TableItemResultPage | undefined; let lastContinuationToken: string | undefined; for await (const page of entities.byPage({ - maxPageSize: 2 + maxPageSize: 2, })) { if (page.continuationToken) { lastContinuationToken = page.continuationToken; @@ -145,7 +145,7 @@ authModes.forEach((authMode) => { let result: TableItemResultPage | undefined; for await (const page of client.listTables().byPage({ maxPageSize: 2, - continuationToken: lastContinuationToken + continuationToken: lastContinuationToken, })) { result = page; break; diff --git a/sdk/tables/data-tables/test/public/transaction.spec.ts b/sdk/tables/data-tables/test/public/transaction.spec.ts index a86ef1269bb6..915d0ff5ecd8 100644 --- a/sdk/tables/data-tables/test/public/transaction.spec.ts +++ b/sdk/tables/data-tables/test/public/transaction.spec.ts @@ -5,7 +5,7 @@ import * as sinon from "sinon"; import { CreateClientMode, createTableClient, - recordedEnvironmentSetup + recordedEnvironmentSetup, } from "./utils/recordedClient"; import { Recorder, isLiveMode, isPlaybackMode, record } from "@azure-tools/test-recorder"; import { TableClient, TableTransaction, TransactionAction, odata } from "../../src"; @@ -37,10 +37,10 @@ authModes.forEach((authMode) => { const testEntities = [ { partitionKey, rowKey: "1", name: "first" }, { partitionKey, rowKey: "2", name: "second" }, - { partitionKey, rowKey: "3", name: "third" } + { partitionKey, rowKey: "3", name: "third" }, ]; - beforeEach(async function(this: Context) { + beforeEach(async function (this: Context) { sinon.stub(Uuid, "generateUuid").returns("fakeId"); recorder = record(this, recordedEnvironmentSetup); client = createTableClient(tableName, authMode); @@ -54,7 +54,7 @@ authModes.forEach((authMode) => { } }); - afterEach(async function() { + afterEach(async function () { sinon.restore(); await recorder.stop(); }); @@ -110,7 +110,7 @@ authModes.forEach((authMode) => { const batchResult = await client.submitTransaction(actions); const updatedEntities = client.listEntities<{ name: string }>({ - queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` }, }); assert.equal(batchResult.status, 202); @@ -137,7 +137,7 @@ authModes.forEach((authMode) => { const batchResult = await client.submitTransaction(actions); const updatedEntities = client.listEntities<{ name: string }>({ - queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${partitionKey}` }, }); assert.equal(batchResult.status, 202); @@ -195,7 +195,7 @@ authModes.forEach((authMode) => { const actions1: TransactionAction[] = [ ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r1", value: "1" }], ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r2", value: "2" }], - ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r3", value: "3" }] + ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r3", value: "3" }], ]; await client.submitTransaction(actions1); @@ -203,13 +203,13 @@ authModes.forEach((authMode) => { const actions2: TransactionAction[] = [ ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r4", value: "4" }], ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r5", value: "5" }], - ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r6", value: "6" }] + ["create", { partitionKey: multiBatchPartitionKey, rowKey: "r6", value: "6" }], ]; await client.submitTransaction(actions2); const entities = client.listEntities<{ name: string }>({ - queryOptions: { filter: odata`PartitionKey eq ${multiBatchPartitionKey}` } + queryOptions: { filter: odata`PartitionKey eq ${multiBatchPartitionKey}` }, }); let entityCount = 0; @@ -228,19 +228,19 @@ authModes.forEach((authMode) => { it("should support empty partition and row keys", async () => { const actions1: TransactionAction[] = [ - ["create", { partitionKey: "", rowKey: "", value: "" }] + ["create", { partitionKey: "", rowKey: "", value: "" }], ]; await client.submitTransaction(actions1); await client.submitTransaction([ - ["update", { partitionKey: "", rowKey: "", value: "updated" }] + ["update", { partitionKey: "", rowKey: "", value: "updated" }], ]); let entity = await client.getEntity("", ""); assert.equal(entity.value, "updated"); await client.submitTransaction([ - ["upsert", { partitionKey: "", rowKey: "", value: "upserted" }] + ["upsert", { partitionKey: "", rowKey: "", value: "upserted" }], ]); entity = await client.getEntity("", ""); diff --git a/sdk/tables/data-tables/test/public/utils/recordedClient.ts b/sdk/tables/data-tables/test/public/utils/recordedClient.ts index d5e953887116..a5a411e5c083 100644 --- a/sdk/tables/data-tables/test/public/utils/recordedClient.ts +++ b/sdk/tables/data-tables/test/public/utils/recordedClient.ts @@ -23,7 +23,7 @@ const replaceableVariables: { [k: string]: string } = { SAS_CONNECTION_STRING: `${mockSasConnectionString}`, AZURE_CLIENT_ID: "azure_client_id", AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888" + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", }; export const recordedEnvironmentSetup: RecorderEnvironmentSetup = { @@ -38,7 +38,7 @@ export const recordedEnvironmentSetup: RecorderEnvironmentSetup = { new RegExp(env.ACCOUNT_SAS.match("(.*)&sig=(.*)")[2], "g"), `${mockAccountKey}` ) - : recording + : recording, ], // SAS token may contain sensitive information queryParametersToSkip: [ @@ -50,8 +50,8 @@ export const recordedEnvironmentSetup: RecorderEnvironmentSetup = { "srt", "ss", "st", - "sv" - ] + "sv", + ], }; export type CreateClientMode = diff --git a/sdk/tables/perf-tests/data-tables/package.json b/sdk/tables/perf-tests/data-tables/package.json index 7dcf010983f8..fafc38c09514 100644 --- a/sdk/tables/perf-tests/data-tables/package.json +++ b/sdk/tables/perf-tests/data-tables/package.json @@ -17,7 +17,7 @@ "@types/node": "^12.0.0", "@types/uuid": "^8.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", @@ -30,9 +30,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/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts index 48b9bcb516f0..317637e6a890 100644 --- a/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts @@ -7,16 +7,14 @@ interface TablesCreateComplexEntityBatchTestOptions { batchSize: number; } -export class CreateComplexEntityBatchTest extends TablesTest< - TablesCreateComplexEntityBatchTestOptions -> { +export class CreateComplexEntityBatchTest extends TablesTest { public options: PerfOptionDictionary = { batchSize: { defaultValue: 100, longName: "batchSize", shortName: "s", - description: "Number of entities to batch create. Defaults to 100" - } + description: "Number of entities to batch create. Defaults to 100", + }, }; constructor() { diff --git a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts index 5b35bd79d6a2..c2aa9cf591c6 100644 --- a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts @@ -7,16 +7,14 @@ interface TablesCreateSimpleEntityBatchTestOptions { batchSize: number; } -export class CreateSimpleEntityBatchTest extends TablesTest< - TablesCreateSimpleEntityBatchTestOptions -> { +export class CreateSimpleEntityBatchTest extends TablesTest { public options: PerfOptionDictionary = { batchSize: { defaultValue: 100, longName: "batchSize", shortName: "s", - description: "Number of entities to batch create. Defaults to 100" - } + description: "Number of entities to batch create. Defaults to 100", + }, }; constructor() { diff --git a/sdk/tables/perf-tests/data-tables/test/index.spec.ts b/sdk/tables/perf-tests/data-tables/test/index.spec.ts index 16ec1671af6f..f6465afbce3f 100644 --- a/sdk/tables/perf-tests/data-tables/test/index.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/index.spec.ts @@ -20,7 +20,7 @@ const perfProgram = new PerfProgram( CreateComplexEntityTest, CreateComplexEntityBatchTest, ListSimpleEntitiesTest, - ListComplexEntitiesTest + ListComplexEntitiesTest, ]) ); diff --git a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts index 1da0068a5153..31a7ee9e07e3 100644 --- a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts @@ -13,8 +13,8 @@ export class ListComplexEntitiesTest extends TablesTest((entity) => ["create", entity]) - ); + batches.push(entityChunk.map((entity) => ["create", entity])); } return batches; }