From d732c1b190c2d4c156745cfbda36baa5351843b5 Mon Sep 17 00:00:00 2001 From: piraces Date: Sat, 3 Oct 2020 14:55:03 +0200 Subject: [PATCH 1/2] Fix typos in README.md and Javascript samples --- sdk/tables/data-tables/README.md | 4 ++-- .../samples/javascript/src/createAndDeleteEntities.js | 2 +- .../samples/javascript/src/createAndDeleteTable.js | 4 ++-- .../data-tables/samples/javascript/src/queryEntities.js | 2 +- sdk/tables/data-tables/samples/javascript/src/queryTables.js | 2 +- .../samples/javascript/src/updateAndUpsertEntities.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sdk/tables/data-tables/README.md b/sdk/tables/data-tables/README.md index 7520c98f509f..04365fd680b2 100644 --- a/sdk/tables/data-tables/README.md +++ b/sdk/tables/data-tables/README.md @@ -72,7 +72,7 @@ For example, you can create following CORS settings for debugging. But please cu ## Key concepts -- `TableServiceClient` - Client that provides functions to interact at a Table Service level sucn as create, list and delete tables +- `TableServiceClient` - Client that provides functions to interact at a Table Service level such as create, list and delete tables - `TableClient` - Client that provides functions to interact at an entity level such as create, list and delete entities within a table. @@ -275,7 +275,7 @@ async function main() { let entitiesIter = client.listEntities(); let i = 1; for await (const entity of entitiesIter) { - console.log(`Entity${i}: PartitionKey: ${entity.PartitionKey} RowKey: ${entity.RowKey}`); + console.log(`Entity${i}: PartitionKey: ${entity.partitionKey} RowKey: ${entity.rowKey}`); i++; // Output: // Entity1: PartitionKey: P1 RowKey: R1 diff --git a/sdk/tables/data-tables/samples/javascript/src/createAndDeleteEntities.js b/sdk/tables/data-tables/samples/javascript/src/createAndDeleteEntities.js index d99e382c4cbb..5cbdbeddc4db 100644 --- a/sdk/tables/data-tables/samples/javascript/src/createAndDeleteEntities.js +++ b/sdk/tables/data-tables/samples/javascript/src/createAndDeleteEntities.js @@ -11,7 +11,7 @@ const tablesUrl = process.env["TABLES_URL"] || ""; const accountName = process.env["ACCOUNT_NAME"] || ""; const accountKey = process.env["ACCOUNT_KEY"] || ""; -export async function createAndDeleteEntities() { +async function createAndDeleteEntities() { console.log("== Create and delete entities Sample =="); // Note that this sample assumes that a table with tableName exists diff --git a/sdk/tables/data-tables/samples/javascript/src/createAndDeleteTable.js b/sdk/tables/data-tables/samples/javascript/src/createAndDeleteTable.js index 7cbc07d001ca..be1629e5a6a0 100644 --- a/sdk/tables/data-tables/samples/javascript/src/createAndDeleteTable.js +++ b/sdk/tables/data-tables/samples/javascript/src/createAndDeleteTable.js @@ -9,7 +9,7 @@ dotenv.config(); const sasConnectionString = process.env["SAS_CONNECTION_STRING"] || ""; -export async function createAndDeleteTable() { +async function createAndDeleteTable() { console.log("== Delete and create table Sample =="); // See authenticationMethods sample for other options of creating a new client @@ -23,7 +23,7 @@ export async function createAndDeleteTable() { await serviceClient.deleteTable(tableName); } -export async function createAndDeleteTableWithTableClient() { +async function createAndDeleteTableWithTableClient() { // A table can also be created and deleted using a TableClient console.log("== Delete and create table with TableClient Sample =="); diff --git a/sdk/tables/data-tables/samples/javascript/src/queryEntities.js b/sdk/tables/data-tables/samples/javascript/src/queryEntities.js index 7c9d3bd65066..01be1ee7018e 100644 --- a/sdk/tables/data-tables/samples/javascript/src/queryEntities.js +++ b/sdk/tables/data-tables/samples/javascript/src/queryEntities.js @@ -10,7 +10,7 @@ dotenv.config(); const tablesUrl = process.env["TABLES_URL"] || ""; const sasToken = process.env["SAS_TOKEN"] || ""; -export async function createAndDeleteEntities() { +async function createAndDeleteEntities() { console.log("== Create and delete entities Sample =="); // Note that this sample assumes that a table with tableName exists diff --git a/sdk/tables/data-tables/samples/javascript/src/queryTables.js b/sdk/tables/data-tables/samples/javascript/src/queryTables.js index e214b3202429..6ff08a9e6810 100644 --- a/sdk/tables/data-tables/samples/javascript/src/queryTables.js +++ b/sdk/tables/data-tables/samples/javascript/src/queryTables.js @@ -9,7 +9,7 @@ dotenv.config(); const accountConnectionString = process.env["ACCOUNT_CONNECTION_STRING"] || ""; -export async function queryTables() { +async function queryTables() { console.log("== Query tables Sample =="); // See authenticationMethods sample for other options of creating a new client diff --git a/sdk/tables/data-tables/samples/javascript/src/updateAndUpsertEntities.js b/sdk/tables/data-tables/samples/javascript/src/updateAndUpsertEntities.js index f2215081c429..2a547517324a 100644 --- a/sdk/tables/data-tables/samples/javascript/src/updateAndUpsertEntities.js +++ b/sdk/tables/data-tables/samples/javascript/src/updateAndUpsertEntities.js @@ -10,7 +10,7 @@ dotenv.config(); const tablesUrl = process.env["TABLES_URL"] || ""; const sasToken = process.env["SAS_TOKEN"] || ""; -export async function createAndDeleteEntities() { +async function createAndDeleteEntities() { console.log("== Create and delete entities Sample =="); // Note that this sample assumes that a table with tableName exists From ce12db3e2f61bcba9c6b8d6ebc7d43e22da321fd Mon Sep 17 00:00:00 2001 From: piraces Date: Tue, 6 Oct 2020 18:45:24 +0200 Subject: [PATCH 2/2] Remove un-needed exports from Typescript samples --- .../samples/typescript/src/authenticationMethods.ts | 2 +- .../samples/typescript/src/createAndDeleteEntities.ts | 4 ++-- .../samples/typescript/src/createAndDeleteTable.ts | 6 +++--- .../data-tables/samples/typescript/src/queryEntities.ts | 4 ++-- .../data-tables/samples/typescript/src/queryTables.ts | 4 ++-- .../samples/typescript/src/updateAndUpsertEntities.ts | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sdk/tables/data-tables/samples/typescript/src/authenticationMethods.ts b/sdk/tables/data-tables/samples/typescript/src/authenticationMethods.ts index 5db92b4ea5a6..438dbc3f55a6 100644 --- a/sdk/tables/data-tables/samples/typescript/src/authenticationMethods.ts +++ b/sdk/tables/data-tables/samples/typescript/src/authenticationMethods.ts @@ -74,7 +74,7 @@ async function countTablesWithClient(client: TableServiceClient) { console.log(`Listed ${count} tables`); } -export async function main() { +async function main() { console.log("== Client Authentication Methods Sample =="); await tableServiceClientWithSasConnectionString(); diff --git a/sdk/tables/data-tables/samples/typescript/src/createAndDeleteEntities.ts b/sdk/tables/data-tables/samples/typescript/src/createAndDeleteEntities.ts index 07f5b785125e..15838e0671e2 100644 --- a/sdk/tables/data-tables/samples/typescript/src/createAndDeleteEntities.ts +++ b/sdk/tables/data-tables/samples/typescript/src/createAndDeleteEntities.ts @@ -11,7 +11,7 @@ const tablesUrl = process.env["TABLES_URL"] || ""; const accountName = process.env["ACCOUNT_NAME"] || ""; const accountKey = process.env["ACCOUNT_KEY"] || ""; -export async function createAndDeleteEntities() { +async function createAndDeleteEntities() { console.log("== Create and delete entities Sample =="); // Note that this sample assumes that a table with tableName exists @@ -44,7 +44,7 @@ interface Entity { quantity: number; } -export async function main() { +async function main() { await createAndDeleteEntities(); } diff --git a/sdk/tables/data-tables/samples/typescript/src/createAndDeleteTable.ts b/sdk/tables/data-tables/samples/typescript/src/createAndDeleteTable.ts index 598c43113424..530e53c58360 100644 --- a/sdk/tables/data-tables/samples/typescript/src/createAndDeleteTable.ts +++ b/sdk/tables/data-tables/samples/typescript/src/createAndDeleteTable.ts @@ -9,7 +9,7 @@ dotenv.config(); const sasConnectionString = process.env["SAS_CONNECTION_STRING"] || ""; -export async function createAndDeleteTable() { +async function createAndDeleteTable() { console.log("== Delete and create table Sample =="); // See authenticationMethods sample for other options of creating a new client @@ -25,7 +25,7 @@ export async function createAndDeleteTable() { await serviceClient.deleteTable(tableName); } -export async function createAndDeleteTableWithTableClient() { +async function createAndDeleteTableWithTableClient() { // A table can also be created and deleted using a TableClient console.log("== Delete and create table with TableClient Sample =="); @@ -44,7 +44,7 @@ export async function createAndDeleteTableWithTableClient() { await client.delete(); } -export async function main() { +async function main() { await createAndDeleteTable(); await createAndDeleteTableWithTableClient(); } diff --git a/sdk/tables/data-tables/samples/typescript/src/queryEntities.ts b/sdk/tables/data-tables/samples/typescript/src/queryEntities.ts index efa88778fec8..96a82f189927 100644 --- a/sdk/tables/data-tables/samples/typescript/src/queryEntities.ts +++ b/sdk/tables/data-tables/samples/typescript/src/queryEntities.ts @@ -10,7 +10,7 @@ dotenv.config(); const tablesUrl = process.env["TABLES_URL"] || ""; const sasToken = process.env["SAS_TOKEN"] || ""; -export async function createAndDeleteEntities() { +async function createAndDeleteEntities() { console.log("== Create and delete entities Sample =="); // Note that this sample assumes that a table with tableName exists @@ -68,7 +68,7 @@ interface Entity { quantity: number; } -export async function main() { +async function main() { await createAndDeleteEntities(); } diff --git a/sdk/tables/data-tables/samples/typescript/src/queryTables.ts b/sdk/tables/data-tables/samples/typescript/src/queryTables.ts index d5b0ba031e42..9766b93769d9 100644 --- a/sdk/tables/data-tables/samples/typescript/src/queryTables.ts +++ b/sdk/tables/data-tables/samples/typescript/src/queryTables.ts @@ -9,7 +9,7 @@ dotenv.config(); const accountConnectionString = process.env["ACCOUNT_CONNECTION_STRING"] || ""; -export async function queryTables() { +async function queryTables() { console.log("== Query tables Sample =="); // See authenticationMethods sample for other options of creating a new client @@ -37,7 +37,7 @@ export async function queryTables() { await serviceClient.deleteTable(tableName); } -export async function main() { +async function main() { await queryTables(); } diff --git a/sdk/tables/data-tables/samples/typescript/src/updateAndUpsertEntities.ts b/sdk/tables/data-tables/samples/typescript/src/updateAndUpsertEntities.ts index 4d5193f685ef..570a8a076b4d 100644 --- a/sdk/tables/data-tables/samples/typescript/src/updateAndUpsertEntities.ts +++ b/sdk/tables/data-tables/samples/typescript/src/updateAndUpsertEntities.ts @@ -10,7 +10,7 @@ dotenv.config(); const tablesUrl = process.env["TABLES_URL"] || ""; const sasToken = process.env["SAS_TOKEN"] || ""; -export async function createAndDeleteEntities() { +async function createAndDeleteEntities() { console.log("== Create and delete entities Sample =="); // Note that this sample assumes that a table with tableName exists @@ -57,7 +57,7 @@ interface Entity { brand?: string; } -export async function main() { +async function main() { await createAndDeleteEntities(); }