@azure/data-tables 12.2.0-alpha.20211027.1 → 13.0.0-alpha.20211109.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,7 @@ import { tablesSASTokenPolicy } from "./tablesSASTokenPolicy";
19
19
  import { isCosmosEndpoint } from "./utils/isCosmosEndpoint";
20
20
  import { cosmosPatchPolicy } from "./cosmosPathPolicy";
21
21
  import { decodeContinuationToken, encodeContinuationToken } from "./utils/continuationToken";
22
+ import { escapeQuotes } from "./odata";
22
23
  /**
23
24
  * A TableClient represents a Client to the Azure Tables service allowing you
24
25
  * to perform operations on a single table.
@@ -184,7 +185,7 @@ export class TableClient {
184
185
  }
185
186
  try {
186
187
  const _a = updatedOptions || {}, { disableTypeConversion, queryOptions } = _a, getEntityOptions = __rest(_a, ["disableTypeConversion", "queryOptions"]);
187
- await this.table.queryEntitiesWithPartitionAndRowKey(this.tableName, partitionKey, rowKey, Object.assign(Object.assign({}, getEntityOptions), { queryOptions: serializeQueryOptions(queryOptions || {}), onResponse }));
188
+ await this.table.queryEntitiesWithPartitionAndRowKey(this.tableName, escapeQuotes(partitionKey), escapeQuotes(rowKey), Object.assign(Object.assign({}, getEntityOptions), { queryOptions: serializeQueryOptions(queryOptions || {}), onResponse }));
188
189
  const tableEntity = deserialize(parsedBody, disableTypeConversion !== null && disableTypeConversion !== void 0 ? disableTypeConversion : false);
189
190
  return tableEntity;
190
191
  }
@@ -386,7 +387,7 @@ export class TableClient {
386
387
  try {
387
388
  const _a = updatedOptions || {}, { etag = "*" } = _a, rest = __rest(_a, ["etag"]);
388
389
  const deleteOptions = Object.assign({}, rest);
389
- return await this.table.deleteEntity(this.tableName, partitionKey, rowKey, etag, deleteOptions);
390
+ return await this.table.deleteEntity(this.tableName, escapeQuotes(partitionKey), escapeQuotes(rowKey), etag, deleteOptions);
390
391
  }
391
392
  catch (e) {
392
393
  span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });
@@ -440,15 +441,14 @@ export class TableClient {
440
441
  options = {}) {
441
442
  const { span, updatedOptions } = createSpan(`TableClient-updateEntity-${mode}`, options);
442
443
  try {
443
- if (!entity.partitionKey || !entity.rowKey) {
444
- throw new Error("partitionKey and rowKey must be defined");
445
- }
444
+ const partitionKey = escapeQuotes(entity.partitionKey);
445
+ const rowKey = escapeQuotes(entity.rowKey);
446
446
  const _a = updatedOptions || {}, { etag = "*" } = _a, updateEntityOptions = __rest(_a, ["etag"]);
447
447
  if (mode === "Merge") {
448
- return await this.table.mergeEntity(this.tableName, entity.partitionKey, entity.rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
448
+ return await this.table.mergeEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
449
449
  }
450
450
  if (mode === "Replace") {
451
- return await this.table.updateEntity(this.tableName, entity.partitionKey, entity.rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
451
+ return await this.table.updateEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
452
452
  }
453
453
  throw new Error(`Unexpected value for update mode: ${mode}`);
454
454
  }
@@ -500,14 +500,13 @@ export class TableClient {
500
500
  options = {}) {
501
501
  const { span, updatedOptions } = createSpan(`TableClient-upsertEntity-${mode}`, options);
502
502
  try {
503
- if (!entity.partitionKey || !entity.rowKey) {
504
- throw new Error("partitionKey and rowKey must be defined");
505
- }
503
+ const partitionKey = escapeQuotes(entity.partitionKey);
504
+ const rowKey = escapeQuotes(entity.rowKey);
506
505
  if (mode === "Merge") {
507
- return await this.table.mergeEntity(this.tableName, entity.partitionKey, entity.rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
506
+ return await this.table.mergeEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
508
507
  }
509
508
  if (mode === "Replace") {
510
- return await this.table.updateEntity(this.tableName, entity.partitionKey, entity.rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
509
+ return await this.table.updateEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
511
510
  }
512
511
  throw new Error(`Unexpected value for update mode: ${mode}`);
513
512
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TableClient.js","sourceRoot":"","sources":["../../src/TableClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AA2BlC,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EAIlB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAmC,MAAM,aAAa,CAAC;AAC/E,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,2BAA2B,EAC3B,SAAS,EACT,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAMnF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,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,CAAC;oBACxE,MAAM;gBACR,KAAK,QAAQ;oBACX,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;oBACxD,MAAM;gBACR,KAAK,QAAQ;oBACX,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;aAC3D;SACF;QAED,OAAO,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB,EACxB,SAAiB;IACjB,8DAA8D;IAC9D,OAA4B;QAE5B,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,mCAAmC,CACrF,gBAAgB,EAChB,OAAO,CACR,CAAC;QACF,IAAI,UAAU,EAAE;YACd,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;SACnE;aAAM;YACL,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;SACvD;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TableEntity,\n ListTableEntitiesOptions,\n GetTableEntityResponse,\n UpdateTableEntityOptions,\n DeleteTableEntityOptions,\n GetTableEntityOptions,\n UpdateMode,\n CreateTableEntityResponse,\n TableEntityQueryOptions,\n TableServiceClientOptions as TableClientOptions,\n TableEntityResult,\n TransactionAction,\n TableTransactionResponse,\n SignedIdentifier,\n GetAccessPolicyResponse,\n TableEntityResultPage\n} from \"./models\";\nimport {\n UpdateEntityResponse,\n UpsertEntityResponse,\n DeleteTableEntityResponse,\n SetAccessPolicyResponse\n} from \"./generatedModels\";\nimport { TableQueryEntitiesOptionalParams } from \"./generated/models\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString\";\nimport {\n isNamedKeyCredential,\n isSASCredential,\n isTokenCredential,\n NamedKeyCredential,\n SASCredential,\n TokenCredential\n} from \"@azure/core-auth\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy\";\nimport \"@azure/core-paging\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { GeneratedClient, TableDeleteEntityOptionalParams } from \"./generated\";\nimport {\n deserialize,\n deserializeObjectsArray,\n deserializeSignedIdentifier,\n serialize,\n serializeQueryOptions,\n serializeSignedIdentifiers\n} from \"./serialization\";\nimport { Table } from \"./generated/operationsInterfaces\";\nimport { STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants\";\nimport {\n FullOperationResponse,\n InternalClientPipelineOptions,\n OperationOptions\n} from \"@azure/core-client\";\nimport { logger } from \"./logger\";\nimport { createSpan } from \"./utils/tracing\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { InternalTableTransaction } from \"./TableTransaction\";\nimport { ListEntitiesResponse } from \"./utils/internalModels\";\nimport { Uuid } from \"./utils/uuid\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { isCredential } from \"./utils/isCredential\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy\";\nimport { isCosmosEndpoint } from \"./utils/isCosmosEndpoint\";\nimport { cosmosPatchPolicy } from \"./cosmosPathPolicy\";\nimport { decodeContinuationToken, encodeContinuationToken } from \"./utils/continuationToken\";\n\n/**\n * A TableClient represents a Client to the Azure Tables service allowing you\n * to perform operations on a single table.\n */\nexport class TableClient {\n /**\n * Table Account URL\n */\n public url: string;\n /**\n * Represents a pipeline for making a HTTP request to a URL.\n * Pipelines can have multiple policies to manage manipulating each request before and after it is made to the server.\n */\n public pipeline: Pipeline;\n private table: Table;\n private credential?: NamedKeyCredential | SASCredential | TokenCredential;\n private transactionClient?: InternalTableTransaction;\n private readonly allowInsecureConnection: boolean;\n\n /**\n * Name of the table to perform operations on.\n */\n public readonly tableName: string;\n\n /**\n * Creates a new instance of the TableClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation, such as \"https://myaccount.table.core.windows.net\".\n * @param tableName - the name of the table\n * @param credential - NamedKeyCredential used to authenticate requests. Only Supported for Node\n * @param options - Optional. Options to configure the HTTP pipeline.\n *\n *\n * ### Example using an account name/key:\n *\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * sharedKeyCredential\n * );\n * ```\n */\n constructor(\n url: string,\n tableName: string,\n credential: NamedKeyCredential,\n options?: TableClientOptions\n );\n /**\n * Creates a new instance of the TableClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation, such as \"https://myaccount.table.core.windows.net\".\n * @param tableName - the name of the table\n * @param credential - SASCredential used to authenticate requests\n * @param options - Optional. Options to configure the HTTP pipeline.\n *\n *\n * ### Example using a SAS Token:\n *\n * ```js\n * const { AzureSASCredential, TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const sasToken = \"<sas-token>\";\n * const tableName = \"<table name>\";\n * const sasCredential = new AzureSASCredential(sasToken);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * sasCredential\n * );\n * ```\n */\n constructor(\n url: string,\n tableName: string,\n credential: SASCredential,\n options?: TableClientOptions\n );\n /**\n * Creates a new instance of the TableClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation, such as \"https://myaccount.table.core.windows.net\".\n * @param tableName - the name of the table\n * @param credential - Azure Active Directory credential used to authenticate requests\n * @param options - Optional. Options to configure the HTTP pipeline.\n *\n *\n * ### Example using an Azure Active Directory credential:\n *\n * ```js\n * cons { DefaultAzureCredential } = require(\"@azure/identity\");\n * const { AzureSASCredential, TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const sasToken = \"<sas-token>\";\n * const tableName = \"<table name>\";\n * const credential = new DefaultAzureCredential();\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * credential\n * );\n * ```\n */\n constructor(\n url: string,\n tableName: string,\n credential: TokenCredential,\n options?: TableClientOptions\n );\n /**\n * Creates an instance of TableClient.\n *\n * @param url - A Client string pointing to Azure Storage table service, such as\n * \"https://myaccount.table.core.windows.net\". You can append a SAS,\n * such as \"https://myaccount.table.core.windows.net?sasString\".\n * @param tableName - the name of the table\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example appending a SAS token:\n *\n * ```js\n * const { TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const sasToken = \"<SAS token>\";\n * const tableName = \"<table name>\";\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net?${sasToken}`,\n * `${tableName}`\n * );\n * ```\n */\n constructor(url: string, tableName: string, options?: TableClientOptions);\n constructor(\n url: string,\n tableName: string,\n credentialOrOptions?: NamedKeyCredential | SASCredential | TableClientOptions | TokenCredential,\n options: TableClientOptions = {}\n ) {\n this.url = url;\n this.tableName = tableName;\n\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n this.credential = credential;\n\n const clientOptions =\n (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n this.allowInsecureConnection = clientOptions.allowInsecureConnection ?? false;\n clientOptions.endpoint = clientOptions.endpoint || this.url;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...clientOptions,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]\n },\n deserializationOptions: {\n parseXML\n },\n serializationOptions: {\n stringifyXML\n },\n ...(isTokenCredential(this.credential) && {\n credential: this.credential,\n credentialScopes: STORAGE_SCOPE\n })\n };\n\n const generatedClient = new GeneratedClient(this.url, internalPipelineOptions);\n if (isNamedKeyCredential(credential)) {\n generatedClient.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));\n } else if (isSASCredential(credential)) {\n generatedClient.pipeline.addPolicy(tablesSASTokenPolicy(credential));\n }\n\n if (isCosmosEndpoint(this.url)) {\n generatedClient.pipeline.addPolicy(cosmosPatchPolicy());\n }\n\n this.table = generatedClient.table;\n this.pipeline = generatedClient.pipeline;\n }\n\n /**\n * Permanently deletes the current table with all of its entities.\n * @param options - The options parameters.\n *\n * ### Example deleting a table\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // calling deleteTable will delete the table used\n * // to instantiate the TableClient.\n * // Note: If the table doesn't exist this function doesn't fail.\n * await client.deleteTable();\n * ```\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public async deleteTable(options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableClient-deleteTable\", options);\n try {\n await this.table.delete(this.tableName, updatedOptions);\n } catch (e) {\n if (e.statusCode === 404) {\n logger.info(\"TableClient-deleteTable: Table doesn't exist\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a table with the tableName passed to the client constructor\n * @param options - The options parameters.\n *\n * ### Example creating a table\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // calling create table will create the table used\n * // to instantiate the TableClient.\n * // Note: If the table already\n * // exists this function doesn't fail.\n * await client.createTable();\n * ```\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public async createTable(options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableClient-createTable\", options);\n try {\n await this.table.create({ name: this.tableName }, updatedOptions);\n } catch (e) {\n if (e.statusCode === 409) {\n logger.info(\"TableClient-createTable: Table Already Exists\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns a single entity in the table.\n * @param partitionKey - The partition key of the entity.\n * @param rowKey - The row key of the entity.\n * @param options - The options parameters.\n *\n * ### Example getting an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // getEntity will get a single entity stored in the service that\n * // matches exactly the partitionKey and rowKey used as parameters\n * // to the method.\n * const entity = await client.getEntity(\"<partitionKey>\", \"<rowKey>\");\n * console.log(entity);\n * ```\n */\n public async getEntity<T extends object = Record<string, unknown>>(\n partitionKey: string,\n rowKey: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: GetTableEntityOptions = {}\n ): Promise<GetTableEntityResponse<TableEntityResult<T>>> {\n const { span, updatedOptions } = createSpan(\"TableClient-getEntity\", options);\n\n let parsedBody: any;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n parsedBody = rawResponse.parsedBody;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n const { disableTypeConversion, queryOptions, ...getEntityOptions } = updatedOptions || {};\n await this.table.queryEntitiesWithPartitionAndRowKey(this.tableName, partitionKey, rowKey, {\n ...getEntityOptions,\n queryOptions: serializeQueryOptions(queryOptions || {}),\n onResponse\n });\n const tableEntity = deserialize<TableEntityResult<T>>(\n parsedBody,\n disableTypeConversion ?? false\n );\n\n return tableEntity;\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Queries entities in a table.\n * @param options - The options parameters.\n *\n * Example listing entities\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // list entities returns a AsyncIterableIterator\n * // this helps consuming paginated responses by\n * // automatically handling getting the next pages\n * const entities = client.listEntities();\n *\n * // this loop will get all the entities from all the pages\n * // returned by the service\n * for await (const entity of entities) {\n * console.log(entity);\n * }\n * ```\n */\n public listEntities<T extends object = Record<string, unknown>>(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ListTableEntitiesOptions = {}\n ): PagedAsyncIterableIterator<TableEntityResult<T>, TableEntityResultPage<T>> {\n const tableName = this.tableName;\n const iter = this.listEntitiesAll<T>(tableName, options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings) => {\n const pageOptions: InternalListTableEntitiesOptions = {\n ...options,\n queryOptions: { ...options.queryOptions, top: settings?.maxPageSize }\n };\n\n if (settings?.continuationToken) {\n pageOptions.continuationToken = settings.continuationToken;\n }\n\n return this.listEntitiesPage(tableName, pageOptions);\n }\n };\n }\n\n private async *listEntitiesAll<T extends object>(\n tableName: string,\n options?: InternalListTableEntitiesOptions\n ): AsyncIterableIterator<TableEntityResult<T>> {\n const firstPage = await this._listEntities<T>(tableName, options);\n yield* firstPage;\n if (firstPage.continuationToken) {\n const optionsWithContinuation: InternalListTableEntitiesOptions = {\n ...options,\n continuationToken: firstPage.continuationToken\n };\n for await (const page of this.listEntitiesPage<T>(tableName, optionsWithContinuation)) {\n yield* page;\n }\n }\n }\n\n private async *listEntitiesPage<T extends object>(\n tableName: string,\n options: InternalListTableEntitiesOptions = {}\n ): AsyncIterableIterator<ListEntitiesResponse<TableEntityResult<T>>> {\n const { span, updatedOptions } = createSpan(\"TableClient-listEntitiesPage\", options);\n\n try {\n let result = await this._listEntities<T>(tableName, updatedOptions);\n\n yield result;\n\n while (result.continuationToken) {\n const optionsWithContinuation: InternalListTableEntitiesOptions = {\n ...updatedOptions,\n continuationToken: result.continuationToken\n };\n\n result = await this._listEntities(tableName, optionsWithContinuation);\n\n yield result;\n }\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async _listEntities<T extends object>(\n tableName: string,\n options: InternalListTableEntitiesOptions = {}\n ): Promise<TableEntityResultPage<T>> {\n const { disableTypeConversion = false } = options;\n const queryOptions = serializeQueryOptions(options.queryOptions || {});\n const listEntitiesOptions: TableQueryEntitiesOptionalParams = {\n ...options,\n queryOptions\n };\n\n // If a continuation token is used, decode it and set the next row and partition key\n if (options.continuationToken) {\n const continuationToken = decodeContinuationToken(options.continuationToken);\n listEntitiesOptions.nextRowKey = continuationToken.nextRowKey;\n listEntitiesOptions.nextPartitionKey = continuationToken.nextPartitionKey;\n }\n\n const {\n xMsContinuationNextPartitionKey: nextPartitionKey,\n xMsContinuationNextRowKey: nextRowKey,\n value\n } = await this.table.queryEntities(tableName, listEntitiesOptions);\n\n const tableEntities = deserializeObjectsArray<TableEntityResult<T>>(\n value ?? [],\n disableTypeConversion\n );\n\n // Encode nextPartitionKey and nextRowKey as a single continuation token and add it as a\n // property to the page.\n const continuationToken = encodeContinuationToken(nextPartitionKey, nextRowKey);\n const page: TableEntityResultPage<T> = Object.assign([...tableEntities], {\n continuationToken\n });\n\n return page;\n }\n\n /**\n * Insert entity in the table.\n * @param entity - The properties for the table entity.\n * @param options - The options parameters.\n *\n * ### Example creating an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // partitionKey and rowKey are required properties of the entity to create\n * // and accepts any other properties\n * await client.createEntity({partitionKey: \"p1\", rowKey: \"r1\", foo: \"Hello!\"});\n * ```\n */\n public async createEntity<T extends object>(\n entity: TableEntity<T>,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: OperationOptions = {}\n ): Promise<CreateTableEntityResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-createEntity\", options);\n\n try {\n const { ...createTableEntity } = updatedOptions || {};\n return await this.table.insertEntity(this.tableName, {\n ...createTableEntity,\n tableEntityProperties: serialize(entity),\n responsePreference: \"return-no-content\"\n });\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes the specified entity in the table.\n * @param partitionKey - The partition key of the entity.\n * @param rowKey - The row key of the entity.\n * @param options - The options parameters.\n *\n * ### Example deleting an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // deleteEntity deletes the entity that matches\n * // exactly the partitionKey and rowKey passed as parameters\n * await client.deleteEntity(\"<partitionKey>\", \"<rowKey>\")\n * ```\n */\n public async deleteEntity(\n partitionKey: string,\n rowKey: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: DeleteTableEntityOptions = {}\n ): Promise<DeleteTableEntityResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-deleteEntity\", options);\n\n try {\n const { etag = \"*\", ...rest } = updatedOptions || {};\n const deleteOptions: TableDeleteEntityOptionalParams = {\n ...rest\n };\n return await this.table.deleteEntity(\n this.tableName,\n partitionKey,\n rowKey,\n etag,\n deleteOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Update an entity in the table.\n * @param entity - The properties of the entity to be updated.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n *\n * ### Example updating an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * const entity = {partitionKey: \"p1\", rowKey: \"r1\", bar: \"updatedBar\"};\n *\n * // Update uses update mode \"Merge\" as default\n * // merge means that update will match a stored entity\n * // that has the same partitionKey and rowKey as the entity\n * // passed to the method and then will only update the properties present in it.\n * // Any other properties that are not defined in the entity passed to updateEntity\n * // will remain as they are in the service\n * await client.updateEntity(entity)\n *\n * // We can also set the update mode to Replace, which will match the entity passed\n * // to updateEntity with one stored in the service and replace with the new one.\n * // If there are any missing properties in the entity passed to updateEntity, they\n * // will be removed from the entity stored in the service\n * await client.updateEntity(entity, \"Replace\")\n * ```\n */\n public async updateEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode = \"Merge\",\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpdateTableEntityOptions = {}\n ): Promise<UpdateEntityResponse> {\n const { span, updatedOptions } = createSpan(`TableClient-updateEntity-${mode}`, options);\n\n try {\n if (!entity.partitionKey || !entity.rowKey) {\n throw new Error(\"partitionKey and rowKey must be defined\");\n }\n\n const { etag = \"*\", ...updateEntityOptions } = updatedOptions || {};\n if (mode === \"Merge\") {\n return await this.table.mergeEntity(this.tableName, entity.partitionKey, entity.rowKey, {\n tableEntityProperties: serialize(entity),\n ifMatch: etag,\n ...updateEntityOptions\n });\n }\n if (mode === \"Replace\") {\n return await this.table.updateEntity(this.tableName, entity.partitionKey, entity.rowKey, {\n tableEntityProperties: serialize(entity),\n ifMatch: etag,\n ...updateEntityOptions\n });\n }\n\n throw new Error(`Unexpected value for update mode: ${mode}`);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Upsert an entity in the table.\n * @param entity - The properties for the table entity.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n *\n * ### Example upserting an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * const entity = {partitionKey: \"p1\", rowKey: \"r1\", bar: \"updatedBar\"};\n *\n * // Upsert uses update mode \"Merge\" as default.\n * // This behaves similarly to update but creates the entity\n * // if it doesn't exist in the service\n * await client.upsertEntity(entity)\n *\n * // We can also set the update mode to Replace.\n * // This behaves similarly to update but creates the entity\n * // if it doesn't exist in the service\n * await client.upsertEntity(entity, \"Replace\")\n * ```\n */\n public async upsertEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode = \"Merge\",\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: OperationOptions = {}\n ): Promise<UpsertEntityResponse> {\n const { span, updatedOptions } = createSpan(`TableClient-upsertEntity-${mode}`, options);\n\n try {\n if (!entity.partitionKey || !entity.rowKey) {\n throw new Error(\"partitionKey and rowKey must be defined\");\n }\n\n if (mode === \"Merge\") {\n return await this.table.mergeEntity(this.tableName, entity.partitionKey, entity.rowKey, {\n tableEntityProperties: serialize(entity),\n ...updatedOptions\n });\n }\n\n if (mode === \"Replace\") {\n return await this.table.updateEntity(this.tableName, entity.partitionKey, entity.rowKey, {\n tableEntityProperties: serialize(entity),\n ...updatedOptions\n });\n }\n throw new Error(`Unexpected value for update mode: ${mode}`);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves details about any stored access policies specified on the table that may be used with\n * Shared Access Signatures.\n * @param options - The options parameters.\n */\n public async getAccessPolicy(options: OperationOptions = {}): Promise<GetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-getAccessPolicy\", options);\n try {\n const signedIdentifiers = await this.table.getAccessPolicy(this.tableName, updatedOptions);\n return deserializeSignedIdentifier(signedIdentifiers);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets stored access policies for the table that may be used with Shared Access Signatures.\n * @param tableAcl - The Access Control List for the table.\n * @param options - The options parameters.\n */\n public async setAccessPolicy(\n tableAcl: SignedIdentifier[],\n options: OperationOptions = {}\n ): Promise<SetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-setAccessPolicy\", options);\n try {\n const serlializedAcl = serializeSignedIdentifiers(tableAcl);\n return await this.table.setAccessPolicy(this.tableName, {\n ...updatedOptions,\n tableAcl: serlializedAcl\n });\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Submits a Transaction which is composed of a set of actions. You can provide the actions as a list\n * or you can use {@link TableTransaction} to help building the transaction.\n *\n * Example usage:\n * ```typescript\n * const { TableClient } = require(\"@azure/data-tables\");\n * const connectionString = \"<connection-string>\"\n * const tableName = \"<tableName>\"\n * const client = TableClient.fromConnectionString(connectionString, tableName);\n * const actions = [\n * [\"create\", {partitionKey: \"p1\", rowKey: \"1\", data: \"test1\"}],\n * [\"delete\", {partitionKey: \"p1\", rowKey: \"2\"}],\n * [\"update\", {partitionKey: \"p1\", rowKey: \"3\", data: \"newTest\"}, \"Merge\"]\n * ]\n * const result = await client.submitTransaction(actions);\n * ```\n *\n * Example usage with TableTransaction:\n * ```js\n * const { TableClient } = require(\"@azure/data-tables\");\n * const connectionString = \"<connection-string>\"\n * const tableName = \"<tableName>\"\n * const client = TableClient.fromConnectionString(connectionString, tableName);\n * const transaction = new TableTransaction();\n * // Call the available action in the TableTransaction object\n * transaction.create({partitionKey: \"p1\", rowKey: \"1\", data: \"test1\"});\n * transaction.delete(\"p1\", \"2\");\n * transaction.update({partitionKey: \"p1\", rowKey: \"3\", data: \"newTest\"}, \"Merge\")\n * // submitTransaction with the actions list on the transaction.\n * const result = await client.submitTransaction(transaction.actions);\n * ```\n *\n * @param actions - tuple that contains the action to perform, and the entity to perform the action with\n */\n public async submitTransaction(actions: TransactionAction[]): Promise<TableTransactionResponse> {\n const partitionKey = actions[0][1].partitionKey;\n const transactionId = Uuid.generateUuid();\n const changesetId = Uuid.generateUuid();\n\n if (!this.transactionClient) {\n // Add pipeline\n this.transactionClient = new InternalTableTransaction(\n this.url,\n partitionKey,\n transactionId,\n changesetId,\n new TableClient(this.url, this.tableName),\n this.credential,\n this.allowInsecureConnection\n );\n } else {\n this.transactionClient.reset(transactionId, changesetId, partitionKey);\n }\n\n for (const item of actions) {\n const [action, entity, updateMode = \"Merge\"] = item;\n switch (action) {\n case \"create\":\n this.transactionClient.createEntity(entity);\n break;\n case \"delete\":\n this.transactionClient.deleteEntity(entity.partitionKey, entity.rowKey);\n break;\n case \"update\":\n this.transactionClient.updateEntity(entity, updateMode);\n break;\n case \"upsert\":\n this.transactionClient.upsertEntity(entity, updateMode);\n }\n }\n\n return this.transactionClient.submitTransaction();\n }\n\n /**\n *\n * Creates an instance of TableClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.table.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new TableClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n tableName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: TableClientOptions\n ): TableClient {\n const { url, options: clientOptions, credential } = getClientParamsFromConnectionString(\n connectionString,\n options\n );\n if (credential) {\n return new TableClient(url, tableName, credential, clientOptions);\n } else {\n return new TableClient(url, tableName, clientOptions);\n }\n }\n}\n\ntype InternalQueryOptions = TableEntityQueryOptions & { top?: number };\ninterface InternalListTableEntitiesOptions extends ListTableEntitiesOptions {\n queryOptions?: InternalQueryOptions;\n /**\n * An entity query continuation token from a previous call.\n */\n continuationToken?: string;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n}\n"]}
1
+ {"version":3,"file":"Table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AED,OAAO,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,CAAC;IACpD,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB,EACxB,SAAiB;IACjB,8DAA8D;IAC9D,OAA4B;QAE5B,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,mCAAmC,CACrF,gBAAgB,EAChB,OAAO,CACR,CAAC;QACF,IAAI,UAAU,EAAE;YACd,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;SACnE;aAAM;YACL,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;SACvD;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n TableEntity,\n ListTableEntitiesOptions,\n GetTableEntityResponse,\n UpdateTableEntityOptions,\n DeleteTableEntityOptions,\n GetTableEntityOptions,\n UpdateMode,\n CreateTableEntityResponse,\n TableEntityQueryOptions,\n TableServiceClientOptions as TableClientOptions,\n TableEntityResult,\n TransactionAction,\n TableTransactionResponse,\n SignedIdentifier,\n GetAccessPolicyResponse,\n TableEntityResultPage\n} from \"./models\";\nimport {\n UpdateEntityResponse,\n UpsertEntityResponse,\n DeleteTableEntityResponse,\n SetAccessPolicyResponse\n} from \"./generatedModels\";\nimport { TableQueryEntitiesOptionalParams } from \"./generated/models\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString\";\nimport {\n isNamedKeyCredential,\n isSASCredential,\n isTokenCredential,\n NamedKeyCredential,\n SASCredential,\n TokenCredential\n} from \"@azure/core-auth\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy\";\nimport \"@azure/core-paging\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { GeneratedClient, TableDeleteEntityOptionalParams } from \"./generated\";\nimport {\n deserialize,\n deserializeObjectsArray,\n deserializeSignedIdentifier,\n serialize,\n serializeQueryOptions,\n serializeSignedIdentifiers\n} from \"./serialization\";\nimport { Table } from \"./generated/operationsInterfaces\";\nimport { STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants\";\nimport {\n FullOperationResponse,\n InternalClientPipelineOptions,\n OperationOptions\n} from \"@azure/core-client\";\nimport { logger } from \"./logger\";\nimport { createSpan } from \"./utils/tracing\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { InternalTableTransaction } from \"./TableTransaction\";\nimport { ListEntitiesResponse } from \"./utils/internalModels\";\nimport { Uuid } from \"./utils/uuid\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { isCredential } from \"./utils/isCredential\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy\";\nimport { isCosmosEndpoint } from \"./utils/isCosmosEndpoint\";\nimport { cosmosPatchPolicy } from \"./cosmosPathPolicy\";\nimport { decodeContinuationToken, encodeContinuationToken } from \"./utils/continuationToken\";\nimport { escapeQuotes } from \"./odata\";\n\n/**\n * A TableClient represents a Client to the Azure Tables service allowing you\n * to perform operations on a single table.\n */\nexport class TableClient {\n /**\n * Table Account URL\n */\n public url: string;\n /**\n * Represents a pipeline for making a HTTP request to a URL.\n * Pipelines can have multiple policies to manage manipulating each request before and after it is made to the server.\n */\n public pipeline: Pipeline;\n private table: Table;\n private credential?: NamedKeyCredential | SASCredential | TokenCredential;\n private transactionClient?: InternalTableTransaction;\n private readonly allowInsecureConnection: boolean;\n\n /**\n * Name of the table to perform operations on.\n */\n public readonly tableName: string;\n\n /**\n * Creates a new instance of the TableClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation, such as \"https://myaccount.table.core.windows.net\".\n * @param tableName - the name of the table\n * @param credential - NamedKeyCredential used to authenticate requests. Only Supported for Node\n * @param options - Optional. Options to configure the HTTP pipeline.\n *\n *\n * ### Example using an account name/key:\n *\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * sharedKeyCredential\n * );\n * ```\n */\n constructor(\n url: string,\n tableName: string,\n credential: NamedKeyCredential,\n options?: TableClientOptions\n );\n /**\n * Creates a new instance of the TableClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation, such as \"https://myaccount.table.core.windows.net\".\n * @param tableName - the name of the table\n * @param credential - SASCredential used to authenticate requests\n * @param options - Optional. Options to configure the HTTP pipeline.\n *\n *\n * ### Example using a SAS Token:\n *\n * ```js\n * const { AzureSASCredential, TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const sasToken = \"<sas-token>\";\n * const tableName = \"<table name>\";\n * const sasCredential = new AzureSASCredential(sasToken);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * sasCredential\n * );\n * ```\n */\n constructor(\n url: string,\n tableName: string,\n credential: SASCredential,\n options?: TableClientOptions\n );\n /**\n * Creates a new instance of the TableClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation, such as \"https://myaccount.table.core.windows.net\".\n * @param tableName - the name of the table\n * @param credential - Azure Active Directory credential used to authenticate requests\n * @param options - Optional. Options to configure the HTTP pipeline.\n *\n *\n * ### Example using an Azure Active Directory credential:\n *\n * ```js\n * cons { DefaultAzureCredential } = require(\"@azure/identity\");\n * const { AzureSASCredential, TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const sasToken = \"<sas-token>\";\n * const tableName = \"<table name>\";\n * const credential = new DefaultAzureCredential();\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * credential\n * );\n * ```\n */\n constructor(\n url: string,\n tableName: string,\n credential: TokenCredential,\n options?: TableClientOptions\n );\n /**\n * Creates an instance of TableClient.\n *\n * @param url - A Client string pointing to Azure Storage table service, such as\n * \"https://myaccount.table.core.windows.net\". You can append a SAS,\n * such as \"https://myaccount.table.core.windows.net?sasString\".\n * @param tableName - the name of the table\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example appending a SAS token:\n *\n * ```js\n * const { TableClient } = require(\"@azure/data-tables\");\n * const account = \"<storage account name>\";\n * const sasToken = \"<SAS token>\";\n * const tableName = \"<table name>\";\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net?${sasToken}`,\n * `${tableName}`\n * );\n * ```\n */\n constructor(url: string, tableName: string, options?: TableClientOptions);\n constructor(\n url: string,\n tableName: string,\n credentialOrOptions?: NamedKeyCredential | SASCredential | TableClientOptions | TokenCredential,\n options: TableClientOptions = {}\n ) {\n this.url = url;\n this.tableName = tableName;\n\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n this.credential = credential;\n\n const clientOptions =\n (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n this.allowInsecureConnection = clientOptions.allowInsecureConnection ?? false;\n clientOptions.endpoint = clientOptions.endpoint || this.url;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...clientOptions,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]\n },\n deserializationOptions: {\n parseXML\n },\n serializationOptions: {\n stringifyXML\n },\n ...(isTokenCredential(this.credential) && {\n credential: this.credential,\n credentialScopes: STORAGE_SCOPE\n })\n };\n\n const generatedClient = new GeneratedClient(this.url, internalPipelineOptions);\n if (isNamedKeyCredential(credential)) {\n generatedClient.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));\n } else if (isSASCredential(credential)) {\n generatedClient.pipeline.addPolicy(tablesSASTokenPolicy(credential));\n }\n\n if (isCosmosEndpoint(this.url)) {\n generatedClient.pipeline.addPolicy(cosmosPatchPolicy());\n }\n\n this.table = generatedClient.table;\n this.pipeline = generatedClient.pipeline;\n }\n\n /**\n * Permanently deletes the current table with all of its entities.\n * @param options - The options parameters.\n *\n * ### Example deleting a table\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // calling deleteTable will delete the table used\n * // to instantiate the TableClient.\n * // Note: If the table doesn't exist this function doesn't fail.\n * await client.deleteTable();\n * ```\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public async deleteTable(options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableClient-deleteTable\", options);\n try {\n await this.table.delete(this.tableName, updatedOptions);\n } catch (e) {\n if (e.statusCode === 404) {\n logger.info(\"TableClient-deleteTable: Table doesn't exist\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a table with the tableName passed to the client constructor\n * @param options - The options parameters.\n *\n * ### Example creating a table\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // calling create table will create the table used\n * // to instantiate the TableClient.\n * // Note: If the table already\n * // exists this function doesn't fail.\n * await client.createTable();\n * ```\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public async createTable(options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableClient-createTable\", options);\n try {\n await this.table.create({ name: this.tableName }, updatedOptions);\n } catch (e) {\n if (e.statusCode === 409) {\n logger.info(\"TableClient-createTable: Table Already Exists\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Returns a single entity in the table.\n * @param partitionKey - The partition key of the entity.\n * @param rowKey - The row key of the entity.\n * @param options - The options parameters.\n *\n * ### Example getting an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // getEntity will get a single entity stored in the service that\n * // matches exactly the partitionKey and rowKey used as parameters\n * // to the method.\n * const entity = await client.getEntity(\"<partitionKey>\", \"<rowKey>\");\n * console.log(entity);\n * ```\n */\n public async getEntity<T extends object = Record<string, unknown>>(\n partitionKey: string,\n rowKey: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: GetTableEntityOptions = {}\n ): Promise<GetTableEntityResponse<TableEntityResult<T>>> {\n const { span, updatedOptions } = createSpan(\"TableClient-getEntity\", options);\n\n let parsedBody: any;\n function onResponse(rawResponse: FullOperationResponse, flatResponse: unknown): void {\n parsedBody = rawResponse.parsedBody;\n if (updatedOptions.onResponse) {\n updatedOptions.onResponse(rawResponse, flatResponse);\n }\n }\n\n try {\n const { disableTypeConversion, queryOptions, ...getEntityOptions } = updatedOptions || {};\n await this.table.queryEntitiesWithPartitionAndRowKey(\n this.tableName,\n escapeQuotes(partitionKey),\n escapeQuotes(rowKey),\n {\n ...getEntityOptions,\n queryOptions: serializeQueryOptions(queryOptions || {}),\n onResponse\n }\n );\n const tableEntity = deserialize<TableEntityResult<T>>(\n parsedBody,\n disableTypeConversion ?? false\n );\n\n return tableEntity;\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Queries entities in a table.\n * @param options - The options parameters.\n *\n * Example listing entities\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // list entities returns a AsyncIterableIterator\n * // this helps consuming paginated responses by\n * // automatically handling getting the next pages\n * const entities = client.listEntities();\n *\n * // this loop will get all the entities from all the pages\n * // returned by the service\n * for await (const entity of entities) {\n * console.log(entity);\n * }\n * ```\n */\n public listEntities<T extends object = Record<string, unknown>>(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: ListTableEntitiesOptions = {}\n ): PagedAsyncIterableIterator<TableEntityResult<T>, TableEntityResultPage<T>> {\n const tableName = this.tableName;\n const iter = this.listEntitiesAll<T>(tableName, options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings) => {\n const pageOptions: InternalListTableEntitiesOptions = {\n ...options,\n queryOptions: { ...options.queryOptions, top: settings?.maxPageSize }\n };\n\n if (settings?.continuationToken) {\n pageOptions.continuationToken = settings.continuationToken;\n }\n\n return this.listEntitiesPage(tableName, pageOptions);\n }\n };\n }\n\n private async *listEntitiesAll<T extends object>(\n tableName: string,\n options?: InternalListTableEntitiesOptions\n ): AsyncIterableIterator<TableEntityResult<T>> {\n const firstPage = await this._listEntities<T>(tableName, options);\n yield* firstPage;\n if (firstPage.continuationToken) {\n const optionsWithContinuation: InternalListTableEntitiesOptions = {\n ...options,\n continuationToken: firstPage.continuationToken\n };\n for await (const page of this.listEntitiesPage<T>(tableName, optionsWithContinuation)) {\n yield* page;\n }\n }\n }\n\n private async *listEntitiesPage<T extends object>(\n tableName: string,\n options: InternalListTableEntitiesOptions = {}\n ): AsyncIterableIterator<ListEntitiesResponse<TableEntityResult<T>>> {\n const { span, updatedOptions } = createSpan(\"TableClient-listEntitiesPage\", options);\n\n try {\n let result = await this._listEntities<T>(tableName, updatedOptions);\n\n yield result;\n\n while (result.continuationToken) {\n const optionsWithContinuation: InternalListTableEntitiesOptions = {\n ...updatedOptions,\n continuationToken: result.continuationToken\n };\n\n result = await this._listEntities(tableName, optionsWithContinuation);\n\n yield result;\n }\n } catch (e) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async _listEntities<T extends object>(\n tableName: string,\n options: InternalListTableEntitiesOptions = {}\n ): Promise<TableEntityResultPage<T>> {\n const { disableTypeConversion = false } = options;\n const queryOptions = serializeQueryOptions(options.queryOptions || {});\n const listEntitiesOptions: TableQueryEntitiesOptionalParams = {\n ...options,\n queryOptions\n };\n\n // If a continuation token is used, decode it and set the next row and partition key\n if (options.continuationToken) {\n const continuationToken = decodeContinuationToken(options.continuationToken);\n listEntitiesOptions.nextRowKey = continuationToken.nextRowKey;\n listEntitiesOptions.nextPartitionKey = continuationToken.nextPartitionKey;\n }\n\n const {\n xMsContinuationNextPartitionKey: nextPartitionKey,\n xMsContinuationNextRowKey: nextRowKey,\n value\n } = await this.table.queryEntities(tableName, listEntitiesOptions);\n\n const tableEntities = deserializeObjectsArray<TableEntityResult<T>>(\n value ?? [],\n disableTypeConversion\n );\n\n // Encode nextPartitionKey and nextRowKey as a single continuation token and add it as a\n // property to the page.\n const continuationToken = encodeContinuationToken(nextPartitionKey, nextRowKey);\n const page: TableEntityResultPage<T> = Object.assign([...tableEntities], {\n continuationToken\n });\n\n return page;\n }\n\n /**\n * Insert entity in the table.\n * @param entity - The properties for the table entity.\n * @param options - The options parameters.\n *\n * ### Example creating an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // partitionKey and rowKey are required properties of the entity to create\n * // and accepts any other properties\n * await client.createEntity({partitionKey: \"p1\", rowKey: \"r1\", foo: \"Hello!\"});\n * ```\n */\n public async createEntity<T extends object>(\n entity: TableEntity<T>,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: OperationOptions = {}\n ): Promise<CreateTableEntityResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-createEntity\", options);\n\n try {\n const { ...createTableEntity } = updatedOptions || {};\n return await this.table.insertEntity(this.tableName, {\n ...createTableEntity,\n tableEntityProperties: serialize(entity),\n responsePreference: \"return-no-content\"\n });\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Deletes the specified entity in the table.\n * @param partitionKey - The partition key of the entity.\n * @param rowKey - The row key of the entity.\n * @param options - The options parameters.\n *\n * ### Example deleting an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * // deleteEntity deletes the entity that matches\n * // exactly the partitionKey and rowKey passed as parameters\n * await client.deleteEntity(\"<partitionKey>\", \"<rowKey>\")\n * ```\n */\n public async deleteEntity(\n partitionKey: string,\n rowKey: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: DeleteTableEntityOptions = {}\n ): Promise<DeleteTableEntityResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-deleteEntity\", options);\n\n try {\n const { etag = \"*\", ...rest } = updatedOptions || {};\n const deleteOptions: TableDeleteEntityOptionalParams = {\n ...rest\n };\n return await this.table.deleteEntity(\n this.tableName,\n escapeQuotes(partitionKey),\n escapeQuotes(rowKey),\n etag,\n deleteOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Update an entity in the table.\n * @param entity - The properties of the entity to be updated.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n *\n * ### Example updating an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * const entity = {partitionKey: \"p1\", rowKey: \"r1\", bar: \"updatedBar\"};\n *\n * // Update uses update mode \"Merge\" as default\n * // merge means that update will match a stored entity\n * // that has the same partitionKey and rowKey as the entity\n * // passed to the method and then will only update the properties present in it.\n * // Any other properties that are not defined in the entity passed to updateEntity\n * // will remain as they are in the service\n * await client.updateEntity(entity)\n *\n * // We can also set the update mode to Replace, which will match the entity passed\n * // to updateEntity with one stored in the service and replace with the new one.\n * // If there are any missing properties in the entity passed to updateEntity, they\n * // will be removed from the entity stored in the service\n * await client.updateEntity(entity, \"Replace\")\n * ```\n */\n public async updateEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode = \"Merge\",\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpdateTableEntityOptions = {}\n ): Promise<UpdateEntityResponse> {\n const { span, updatedOptions } = createSpan(`TableClient-updateEntity-${mode}`, options);\n\n try {\n const partitionKey = escapeQuotes(entity.partitionKey);\n const rowKey = escapeQuotes(entity.rowKey);\n\n const { etag = \"*\", ...updateEntityOptions } = updatedOptions || {};\n if (mode === \"Merge\") {\n return await this.table.mergeEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ifMatch: etag,\n ...updateEntityOptions\n });\n }\n if (mode === \"Replace\") {\n return await this.table.updateEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ifMatch: etag,\n ...updateEntityOptions\n });\n }\n\n throw new Error(`Unexpected value for update mode: ${mode}`);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Upsert an entity in the table.\n * @param entity - The properties for the table entity.\n * @param mode - The different modes for updating the entity:\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n * @param options - The options parameters.\n *\n * ### Example upserting an entity\n * ```js\n * const { AzureNamedKeyCredential, TableClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\";\n * const accountKey = \"<account key>\"\n * const tableName = \"<table name>\";\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);\n *\n * const client = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * `${tableName}`,\n * sharedKeyCredential\n * );\n *\n * const entity = {partitionKey: \"p1\", rowKey: \"r1\", bar: \"updatedBar\"};\n *\n * // Upsert uses update mode \"Merge\" as default.\n * // This behaves similarly to update but creates the entity\n * // if it doesn't exist in the service\n * await client.upsertEntity(entity)\n *\n * // We can also set the update mode to Replace.\n * // This behaves similarly to update but creates the entity\n * // if it doesn't exist in the service\n * await client.upsertEntity(entity, \"Replace\")\n * ```\n */\n public async upsertEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode = \"Merge\",\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: OperationOptions = {}\n ): Promise<UpsertEntityResponse> {\n const { span, updatedOptions } = createSpan(`TableClient-upsertEntity-${mode}`, options);\n\n try {\n const partitionKey = escapeQuotes(entity.partitionKey);\n const rowKey = escapeQuotes(entity.rowKey);\n\n if (mode === \"Merge\") {\n return await this.table.mergeEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ...updatedOptions\n });\n }\n\n if (mode === \"Replace\") {\n return await this.table.updateEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ...updatedOptions\n });\n }\n throw new Error(`Unexpected value for update mode: ${mode}`);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves details about any stored access policies specified on the table that may be used with\n * Shared Access Signatures.\n * @param options - The options parameters.\n */\n public async getAccessPolicy(options: OperationOptions = {}): Promise<GetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-getAccessPolicy\", options);\n try {\n const signedIdentifiers = await this.table.getAccessPolicy(this.tableName, updatedOptions);\n return deserializeSignedIdentifier(signedIdentifiers);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets stored access policies for the table that may be used with Shared Access Signatures.\n * @param tableAcl - The Access Control List for the table.\n * @param options - The options parameters.\n */\n public async setAccessPolicy(\n tableAcl: SignedIdentifier[],\n options: OperationOptions = {}\n ): Promise<SetAccessPolicyResponse> {\n const { span, updatedOptions } = createSpan(\"TableClient-setAccessPolicy\", options);\n try {\n const serlializedAcl = serializeSignedIdentifiers(tableAcl);\n return await this.table.setAccessPolicy(this.tableName, {\n ...updatedOptions,\n tableAcl: serlializedAcl\n });\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Submits a Transaction which is composed of a set of actions. You can provide the actions as a list\n * or you can use {@link TableTransaction} to help building the transaction.\n *\n * Example usage:\n * ```typescript\n * const { TableClient } = require(\"@azure/data-tables\");\n * const connectionString = \"<connection-string>\"\n * const tableName = \"<tableName>\"\n * const client = TableClient.fromConnectionString(connectionString, tableName);\n * const actions = [\n * [\"create\", {partitionKey: \"p1\", rowKey: \"1\", data: \"test1\"}],\n * [\"delete\", {partitionKey: \"p1\", rowKey: \"2\"}],\n * [\"update\", {partitionKey: \"p1\", rowKey: \"3\", data: \"newTest\"}, \"Merge\"]\n * ]\n * const result = await client.submitTransaction(actions);\n * ```\n *\n * Example usage with TableTransaction:\n * ```js\n * const { TableClient } = require(\"@azure/data-tables\");\n * const connectionString = \"<connection-string>\"\n * const tableName = \"<tableName>\"\n * const client = TableClient.fromConnectionString(connectionString, tableName);\n * const transaction = new TableTransaction();\n * // Call the available action in the TableTransaction object\n * transaction.create({partitionKey: \"p1\", rowKey: \"1\", data: \"test1\"});\n * transaction.delete(\"p1\", \"2\");\n * transaction.update({partitionKey: \"p1\", rowKey: \"3\", data: \"newTest\"}, \"Merge\")\n * // submitTransaction with the actions list on the transaction.\n * const result = await client.submitTransaction(transaction.actions);\n * ```\n *\n * @param actions - tuple that contains the action to perform, and the entity to perform the action with\n */\n public async submitTransaction(actions: TransactionAction[]): Promise<TableTransactionResponse> {\n const partitionKey = actions[0][1].partitionKey;\n const transactionId = Uuid.generateUuid();\n const changesetId = Uuid.generateUuid();\n\n if (!this.transactionClient) {\n // Add pipeline\n this.transactionClient = new InternalTableTransaction(\n this.url,\n partitionKey,\n transactionId,\n changesetId,\n new TableClient(this.url, this.tableName),\n this.credential,\n this.allowInsecureConnection\n );\n } else {\n this.transactionClient.reset(transactionId, changesetId, partitionKey);\n }\n\n for (const item of actions) {\n const [action, entity, updateMode = \"Merge\"] = item;\n switch (action) {\n case \"create\":\n this.transactionClient.createEntity(entity);\n break;\n case \"delete\":\n this.transactionClient.deleteEntity(entity.partitionKey, entity.rowKey);\n break;\n case \"update\":\n this.transactionClient.updateEntity(entity, updateMode);\n break;\n case \"upsert\":\n this.transactionClient.upsertEntity(entity, updateMode);\n }\n }\n\n return this.transactionClient.submitTransaction();\n }\n\n /**\n *\n * Creates an instance of TableClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.table.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new TableClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n tableName: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: TableClientOptions\n ): TableClient {\n const { url, options: clientOptions, credential } = getClientParamsFromConnectionString(\n connectionString,\n options\n );\n if (credential) {\n return new TableClient(url, tableName, credential, clientOptions);\n } else {\n return new TableClient(url, tableName, clientOptions);\n }\n }\n}\n\ntype InternalQueryOptions = TableEntityQueryOptions & { top?: number };\ninterface InternalListTableEntitiesOptions extends ListTableEntitiesOptions {\n queryOptions?: InternalQueryOptions;\n /**\n * An entity query continuation token from a previous call.\n */\n continuationToken?: string;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
3
+ import { __asyncDelegator, __asyncGenerator, __asyncValues, __await, __rest } from "tslib";
4
4
  import { GeneratedClient } from "./generated/generatedClient";
5
5
  import { getClientParamsFromConnectionString } from "./utils/connectionString";
6
6
  import { isNamedKeyCredential, isSASCredential, isTokenCredential } from "@azure/core-auth";
@@ -164,6 +164,9 @@ export class TableServiceClient {
164
164
  },
165
165
  byPage: (settings) => {
166
166
  const pageOptions = Object.assign(Object.assign({}, options), { queryOptions: { top: settings === null || settings === void 0 ? void 0 : settings.maxPageSize } });
167
+ if (settings === null || settings === void 0 ? void 0 : settings.continuationToken) {
168
+ pageOptions.continuationToken = settings.continuationToken;
169
+ }
167
170
  return this.listTablesPage(pageOptions);
168
171
  }
169
172
  };
@@ -172,10 +175,10 @@ export class TableServiceClient {
172
175
  return __asyncGenerator(this, arguments, function* listTablesAll_1() {
173
176
  var e_1, _a;
174
177
  const firstPage = yield __await(this._listTables(options));
175
- const { nextTableName } = firstPage;
178
+ const { continuationToken } = firstPage;
176
179
  yield __await(yield* __asyncDelegator(__asyncValues(firstPage)));
177
- if (nextTableName) {
178
- const optionsWithContinuation = Object.assign(Object.assign({}, options), { nextTableName });
180
+ if (continuationToken) {
181
+ const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken });
179
182
  try {
180
183
  for (var _b = __asyncValues(this.listTablesPage(optionsWithContinuation)), _c; _c = yield __await(_b.next()), !_c.done;) {
181
184
  const page = _c.value;
@@ -198,8 +201,8 @@ export class TableServiceClient {
198
201
  try {
199
202
  let result = yield __await(this._listTables(updatedOptions));
200
203
  yield yield __await(result);
201
- while (result.nextTableName) {
202
- const optionsWithContinuation = Object.assign(Object.assign({}, updatedOptions), { nextTableName: result.nextTableName });
204
+ while (result.continuationToken) {
205
+ const optionsWithContinuation = Object.assign(Object.assign({}, updatedOptions), { continuationToken: result.continuationToken });
203
206
  result = yield __await(this._listTables(optionsWithContinuation));
204
207
  yield yield __await(result);
205
208
  }
@@ -213,9 +216,10 @@ export class TableServiceClient {
213
216
  }
214
217
  });
215
218
  }
216
- async _listTables(options) {
217
- const { xMsContinuationNextTableName: nextTableName, value = [] } = await this.table.query(options);
218
- return Object.assign([...value], { nextTableName });
219
+ async _listTables(options = {}) {
220
+ const { continuationToken: nextTableName } = options, listOptions = __rest(options, ["continuationToken"]);
221
+ const { xMsContinuationNextTableName: continuationToken, value = [] } = await this.table.query(Object.assign(Object.assign({}, listOptions), { nextTableName }));
222
+ return Object.assign([...value], { continuationToken });
219
223
  }
220
224
  /**
221
225
  *
@@ -1 +1 @@
1
- {"version":3,"file":"TableServiceClient.js","sourceRoot":"","sources":["../../src/TableServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAe9D,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EACL,oBAAoB,EAGpB,eAAe,EAEf,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAgG7B,YACE,GAAW,EACX,mBAI6B,EAC7B,OAAmC;QAEnC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,MAAM,UAAU,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CA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AAC;SAC/D;aAAM;YACL,OAAO,IAAI,kBAAkB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;SACnD;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { Service, Table } from \"./generated\";\nimport {\n ListTableItemsOptions,\n TableServiceClientOptions,\n TableQueryOptions,\n TableItem\n} from \"./models\";\nimport {\n GetStatisticsResponse,\n GetPropertiesResponse,\n SetPropertiesOptions,\n ServiceProperties,\n SetPropertiesResponse\n} from \"./generatedModels\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString\";\nimport {\n isNamedKeyCredential,\n NamedKeyCredential,\n SASCredential,\n isSASCredential,\n TokenCredential,\n isTokenCredential\n} from \"@azure/core-auth\";\nimport \"@azure/core-paging\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants\";\nimport { logger } from \"./logger\";\nimport { InternalClientPipelineOptions, OperationOptions } from \"@azure/core-client\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { createSpan } from \"./utils/tracing\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { ListTableItemsResponse } from \"./utils/internalModels\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { isCredential } from \"./utils/isCredential\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy\";\n\n/**\n * A TableServiceClient represents a Client to the Azure Tables service allowing you\n * to perform operations on the tables and the entities.\n */\nexport class TableServiceClient {\n /**\n * Table Account URL\n */\n public url: string;\n /**\n * Represents a pipeline for making a HTTP request to a URL.\n * Pipelines can have multiple policies to manage manipulating each request before and after it is made to the server.\n */\n public pipeline: Pipeline;\n private table: Table;\n private service: Service;\n\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as \"https://myaccount.table.core.windows.net\".\n * @param credential - NamedKeyCredential | SASCredential used to authenticate requests. Only Supported for Node\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example using an account name/key:\n *\n * ```js\n * const { AzureNamedKeyCredential, TableServiceClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\"\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, \"<account key>\");\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * sharedKeyCredential\n * );\n * ```\n */\n constructor(url: string, credential: NamedKeyCredential, options?: TableServiceClientOptions);\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as \"https://myaccount.table.core.windows.net\".\n * @param credential - SASCredential used to authenticate requests\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example using a SAS Token.\n *\n * ```js\n * const { AzureSASCredential, TableServiceClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\"\n * const sasCredential = new AzureSASCredential(account, \"<account key>\");\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * sasCredential\n * );\n * ```\n */\n constructor(url: string, credential: SASCredential, options?: TableServiceClientOptions);\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as \"https://myaccount.table.core.windows.net\".\n * @param credential - Azure Active Directory credential used to authenticate requests\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example using an Azure Active Directory credential:\n *\n * ```js\n * cons { DefaultAzureCredential } = require(\"@azure/identity\");\n * const { TableServiceClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\"\n * const credential = new DefaultAzureCredential();\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * credential\n * );\n * ```\n */\n constructor(url: string, credential: TokenCredential, options?: TableServiceClientOptions);\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as\n * \"https://myaccount.table.core.windows.net\". You can append a SAS,\n * such as \"https://myaccount.table.core.windows.net?sasString\".\n * @param options - Options to configure the HTTP pipeline.\n * Example appending a SAS token:\n *\n * ```js\n * const account = \"<storage account name>\";\n * const sasToken = \"<SAS token>\";\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net?${sasToken}`,\n * );\n * ```\n */\n constructor(url: string, options?: TableServiceClientOptions);\n constructor(\n url: string,\n credentialOrOptions?:\n | NamedKeyCredential\n | SASCredential\n | TokenCredential\n | TableServiceClientOptions,\n options?: TableServiceClientOptions\n ) {\n this.url = url;\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n const clientOptions =\n (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n clientOptions.endpoint = clientOptions.endpoint || this.url;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...clientOptions,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]\n },\n deserializationOptions: {\n parseXML\n },\n serializationOptions: {\n stringifyXML\n }\n },\n ...(isTokenCredential(credential) && { credential, credentialScopes: STORAGE_SCOPE })\n };\n const client = new GeneratedClient(this.url, internalPipelineOptions);\n if (isNamedKeyCredential(credential)) {\n client.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));\n } else if (isSASCredential(credential)) {\n client.pipeline.addPolicy(tablesSASTokenPolicy(credential));\n }\n\n this.pipeline = client.pipeline;\n this.table = client.table;\n this.service = client.service;\n }\n\n /**\n * Retrieves statistics related to replication for the Table service. It is only available on the\n * secondary location endpoint when read-access geo-redundant replication is enabled for the account.\n * @param options - The options parameters.\n */\n public async getStatistics(options: OperationOptions = {}): Promise<GetStatisticsResponse> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-getStatistics\", options);\n try {\n return await this.service.getStatistics(updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Gets the properties of an account's Table service, including properties for Analytics and CORS\n * (Cross-Origin Resource Sharing) rules.\n * @param options - The options parameters.\n */\n public async getProperties(options: OperationOptions = {}): Promise<GetPropertiesResponse> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-getProperties\", options);\n try {\n return await this.service.getProperties(updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets properties for an account's Table service endpoint, including properties for Analytics and CORS\n * (Cross-Origin Resource Sharing) rules.\n * @param properties - The Table Service properties.\n * @param options - The options parameters.\n */\n public async setProperties(\n properties: ServiceProperties,\n options: SetPropertiesOptions = {}\n ): Promise<SetPropertiesResponse> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-setProperties\", options);\n try {\n return await this.service.setProperties(properties, updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new table under the given account.\n * @param name - The name of the table.\n * @param options - The options parameters.\n */\n public async createTable(name: string, options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-createTable\", options);\n try {\n await this.table.create(\n { name },\n { ...updatedOptions, responsePreference: \"return-content\" }\n );\n } catch (e) {\n if (e.statusCode === 409) {\n logger.info(\"TableServiceClient-createTable: Table Already Exists\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Operation permanently deletes the specified table.\n * @param name - The name of the table.\n * @param options - The options parameters.\n */\n public async deleteTable(name: string, options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-deleteTable\", options);\n try {\n await this.table.delete(name, updatedOptions);\n } catch (e) {\n if (e.statusCode === 404) {\n logger.info(\"TableServiceClient-deleteTable: Table doesn't exist\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Queries tables under the given account.\n * @param options - The options parameters.\n */\n public listTables(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: ListTableItemsOptions\n ): PagedAsyncIterableIterator<TableItem, TableItem[]> {\n const iter = this.listTablesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings) => {\n const pageOptions = {\n ...options,\n queryOptions: { top: settings?.maxPageSize }\n };\n return this.listTablesPage(pageOptions);\n }\n };\n }\n\n private async *listTablesAll(\n options?: InternalListTablesOptions\n ): AsyncIterableIterator<TableItem> {\n const firstPage = await this._listTables(options);\n const { nextTableName } = firstPage;\n yield* firstPage;\n if (nextTableName) {\n const optionsWithContinuation: InternalListTablesOptions = {\n ...options,\n nextTableName\n };\n for await (const page of this.listTablesPage(optionsWithContinuation)) {\n yield* page;\n }\n }\n }\n\n private async *listTablesPage(\n options: InternalListTablesOptions = {}\n ): AsyncIterableIterator<TableItem[]> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-listTablesPage\", options);\n\n try {\n let result = await this._listTables(updatedOptions);\n\n yield result;\n\n while (result.nextTableName) {\n const optionsWithContinuation: InternalListTablesOptions = {\n ...updatedOptions,\n nextTableName: result.nextTableName\n };\n result = await this._listTables(optionsWithContinuation);\n yield result;\n }\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async _listTables(options?: InternalListTablesOptions): Promise<ListTableItemsResponse> {\n const { xMsContinuationNextTableName: nextTableName, value = [] } = await this.table.query(\n options\n );\n return Object.assign([...value], { nextTableName });\n }\n\n /**\n *\n * Creates an instance of TableServiceClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.table.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new TableServiceClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: TableServiceClientOptions\n ): TableServiceClient {\n const { url, options: clientOptions, credential } = getClientParamsFromConnectionString(\n connectionString,\n options\n );\n\n if (credential) {\n return new TableServiceClient(url, credential, clientOptions);\n } else {\n return new TableServiceClient(url, clientOptions);\n }\n }\n}\n\ntype InternalListTablesOptions = ListTableItemsOptions & {\n queryOptions?: TableQueryOptions & { top?: number };\n /**\n * A table query continuation token from a previous call.\n */\n nextTableName?: string;\n};\n"]}
1
+ {"version":3,"file":"TableServiceClient.js","sourceRoot":"","sources":["../../src/TableServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAe9D,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EACL,oBAAoB,EAGpB,eAAe,EAEf,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA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AC,WAAW,CAAC,UAAqC,EAAE;QAC/D,MAAM,EAAE,iBAAiB,EAAE,aAAa,KAAqB,OAAO,EAAvB,WAAW,UAAK,OAAO,EAA9D,qBAAoD,CAAU,CAAC;QACrE,MAAM,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,iCACzF,WAAW,KACd,aAAa,IACb,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB;IACxB,8DAA8D;IAC9D,OAAmC;QAEnC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,mCAAmC,CACrF,gBAAgB,EAChB,OAAO,CACR,CAAC;QAEF,IAAI,UAAU,EAAE;YACd,OAAO,IAAI,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;SAC/D;aAAM;YACL,OAAO,IAAI,kBAAkB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;SACnD;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { GeneratedClient } from \"./generated/generatedClient\";\nimport { Service, Table } from \"./generated\";\nimport {\n ListTableItemsOptions,\n TableServiceClientOptions,\n TableQueryOptions,\n TableItem\n} from \"./models\";\nimport {\n GetStatisticsResponse,\n GetPropertiesResponse,\n SetPropertiesOptions,\n ServiceProperties,\n SetPropertiesResponse\n} from \"./generatedModels\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString\";\nimport {\n isNamedKeyCredential,\n NamedKeyCredential,\n SASCredential,\n isSASCredential,\n TokenCredential,\n isTokenCredential\n} from \"@azure/core-auth\";\nimport \"@azure/core-paging\";\nimport { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants\";\nimport { logger } from \"./logger\";\nimport { InternalClientPipelineOptions, OperationOptions } from \"@azure/core-client\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport { createSpan } from \"./utils/tracing\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\nimport { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { isCredential } from \"./utils/isCredential\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy\";\nimport { TableItemResultPage } from \"./models\";\n\n/**\n * A TableServiceClient represents a Client to the Azure Tables service allowing you\n * to perform operations on the tables and the entities.\n */\nexport class TableServiceClient {\n /**\n * Table Account URL\n */\n public url: string;\n /**\n * Represents a pipeline for making a HTTP request to a URL.\n * Pipelines can have multiple policies to manage manipulating each request before and after it is made to the server.\n */\n public pipeline: Pipeline;\n private table: Table;\n private service: Service;\n\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as \"https://myaccount.table.core.windows.net\".\n * @param credential - NamedKeyCredential | SASCredential used to authenticate requests. Only Supported for Node\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example using an account name/key:\n *\n * ```js\n * const { AzureNamedKeyCredential, TableServiceClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\"\n * const sharedKeyCredential = new AzureNamedKeyCredential(account, \"<account key>\");\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * sharedKeyCredential\n * );\n * ```\n */\n constructor(url: string, credential: NamedKeyCredential, options?: TableServiceClientOptions);\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as \"https://myaccount.table.core.windows.net\".\n * @param credential - SASCredential used to authenticate requests\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example using a SAS Token.\n *\n * ```js\n * const { AzureSASCredential, TableServiceClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\"\n * const sasCredential = new AzureSASCredential(account, \"<account key>\");\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * sasCredential\n * );\n * ```\n */\n constructor(url: string, credential: SASCredential, options?: TableServiceClientOptions);\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as \"https://myaccount.table.core.windows.net\".\n * @param credential - Azure Active Directory credential used to authenticate requests\n * @param options - Options to configure the HTTP pipeline.\n *\n * ### Example using an Azure Active Directory credential:\n *\n * ```js\n * cons { DefaultAzureCredential } = require(\"@azure/identity\");\n * const { TableServiceClient } = require(\"@azure/data-tables\")\n * const account = \"<storage account name>\"\n * const credential = new DefaultAzureCredential();\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * credential\n * );\n * ```\n */\n constructor(url: string, credential: TokenCredential, options?: TableServiceClientOptions);\n /**\n * Creates a new instance of the TableServiceClient class.\n *\n * @param url - The URL of the service account that is the target of the desired operation., such as\n * \"https://myaccount.table.core.windows.net\". You can append a SAS,\n * such as \"https://myaccount.table.core.windows.net?sasString\".\n * @param options - Options to configure the HTTP pipeline.\n * Example appending a SAS token:\n *\n * ```js\n * const account = \"<storage account name>\";\n * const sasToken = \"<SAS token>\";\n *\n * const tableServiceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net?${sasToken}`,\n * );\n * ```\n */\n constructor(url: string, options?: TableServiceClientOptions);\n constructor(\n url: string,\n credentialOrOptions?:\n | NamedKeyCredential\n | SASCredential\n | TokenCredential\n | TableServiceClientOptions,\n options?: TableServiceClientOptions\n ) {\n this.url = url;\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n const clientOptions =\n (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n clientOptions.endpoint = clientOptions.endpoint || this.url;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...clientOptions,\n ...{\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]\n },\n deserializationOptions: {\n parseXML\n },\n serializationOptions: {\n stringifyXML\n }\n },\n ...(isTokenCredential(credential) && { credential, credentialScopes: STORAGE_SCOPE })\n };\n const client = new GeneratedClient(this.url, internalPipelineOptions);\n if (isNamedKeyCredential(credential)) {\n client.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));\n } else if (isSASCredential(credential)) {\n client.pipeline.addPolicy(tablesSASTokenPolicy(credential));\n }\n\n this.pipeline = client.pipeline;\n this.table = client.table;\n this.service = client.service;\n }\n\n /**\n * Retrieves statistics related to replication for the Table service. It is only available on the\n * secondary location endpoint when read-access geo-redundant replication is enabled for the account.\n * @param options - The options parameters.\n */\n public async getStatistics(options: OperationOptions = {}): Promise<GetStatisticsResponse> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-getStatistics\", options);\n try {\n return await this.service.getStatistics(updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Gets the properties of an account's Table service, including properties for Analytics and CORS\n * (Cross-Origin Resource Sharing) rules.\n * @param options - The options parameters.\n */\n public async getProperties(options: OperationOptions = {}): Promise<GetPropertiesResponse> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-getProperties\", options);\n try {\n return await this.service.getProperties(updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Sets properties for an account's Table service endpoint, including properties for Analytics and CORS\n * (Cross-Origin Resource Sharing) rules.\n * @param properties - The Table Service properties.\n * @param options - The options parameters.\n */\n public async setProperties(\n properties: ServiceProperties,\n options: SetPropertiesOptions = {}\n ): Promise<SetPropertiesResponse> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-setProperties\", options);\n try {\n return await this.service.setProperties(properties, updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Creates a new table under the given account.\n * @param name - The name of the table.\n * @param options - The options parameters.\n */\n public async createTable(name: string, options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-createTable\", options);\n try {\n await this.table.create(\n { name },\n { ...updatedOptions, responsePreference: \"return-content\" }\n );\n } catch (e) {\n if (e.statusCode === 409) {\n logger.info(\"TableServiceClient-createTable: Table Already Exists\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Operation permanently deletes the specified table.\n * @param name - The name of the table.\n * @param options - The options parameters.\n */\n public async deleteTable(name: string, options: OperationOptions = {}): Promise<void> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-deleteTable\", options);\n try {\n await this.table.delete(name, updatedOptions);\n } catch (e) {\n if (e.statusCode === 404) {\n logger.info(\"TableServiceClient-deleteTable: Table doesn't exist\");\n } else {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n }\n } finally {\n span.end();\n }\n }\n\n /**\n * Queries tables under the given account.\n * @param options - The options parameters.\n */\n public listTables(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: ListTableItemsOptions\n ): PagedAsyncIterableIterator<TableItem, TableItemResultPage> {\n const iter = this.listTablesAll(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings) => {\n const pageOptions: InternalListTablesOptions = {\n ...options,\n queryOptions: { top: settings?.maxPageSize }\n };\n\n if (settings?.continuationToken) {\n pageOptions.continuationToken = settings.continuationToken;\n }\n\n return this.listTablesPage(pageOptions);\n }\n };\n }\n\n private async *listTablesAll(\n options?: InternalListTablesOptions\n ): AsyncIterableIterator<TableItem> {\n const firstPage = await this._listTables(options);\n const { continuationToken } = firstPage;\n yield* firstPage;\n if (continuationToken) {\n const optionsWithContinuation: InternalListTablesOptions = {\n ...options,\n continuationToken\n };\n for await (const page of this.listTablesPage(optionsWithContinuation)) {\n yield* page;\n }\n }\n }\n\n private async *listTablesPage(\n options: InternalListTablesOptions = {}\n ): AsyncIterableIterator<TableItemResultPage> {\n const { span, updatedOptions } = createSpan(\"TableServiceClient-listTablesPage\", options);\n\n try {\n let result = await this._listTables(updatedOptions);\n\n yield result;\n\n while (result.continuationToken) {\n const optionsWithContinuation: InternalListTablesOptions = {\n ...updatedOptions,\n continuationToken: result.continuationToken\n };\n result = await this._listTables(optionsWithContinuation);\n yield result;\n }\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n private async _listTables(options: InternalListTablesOptions = {}): Promise<TableItemResultPage> {\n const { continuationToken: nextTableName, ...listOptions } = options;\n const { xMsContinuationNextTableName: continuationToken, value = [] } = await this.table.query({\n ...listOptions,\n nextTableName\n });\n return Object.assign([...value], { continuationToken });\n }\n\n /**\n *\n * Creates an instance of TableServiceClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.table.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Options to configure the HTTP pipeline.\n * @returns A new TableServiceClient from the given connection string.\n */\n public static fromConnectionString(\n connectionString: string,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options?: TableServiceClientOptions\n ): TableServiceClient {\n const { url, options: clientOptions, credential } = getClientParamsFromConnectionString(\n connectionString,\n options\n );\n\n if (credential) {\n return new TableServiceClient(url, credential, clientOptions);\n } else {\n return new TableServiceClient(url, clientOptions);\n }\n }\n}\n\ntype InternalListTablesOptions = ListTableItemsOptions & {\n queryOptions?: TableQueryOptions & { top?: number };\n /**\n * A table query continuation token from a previous call.\n */\n continuationToken?: string;\n};\n"]}
@@ -24,7 +24,7 @@ export class GeneratedClientContext extends coreClient.ServiceClient {
24
24
  const defaults = {
25
25
  requestContentType: "application/json; charset=utf-8"
26
26
  };
27
- const packageDetails = `azsdk-js-data-tables/12.2.0`;
27
+ const packageDetails = `azsdk-js-data-tables/13.0.0`;
28
28
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
29
29
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
30
30
  : `${packageDetails}`;
@@ -1 +1 @@
1
- {"version":3,"file":"generatedClientContext.js","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAIlE;;;;OAIG;IACH,YAAY,GAAW,EAAE,OAAuC;QAC9D,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;SACzC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,6BAA6B,CAAC;QACrD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,GACrC,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,0CAA0C;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n url: string;\n version: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param url The URL of the service account or table that is the target of the desired operation.\n * @param options The parameter options\n */\n constructor(url: string, options?: GeneratedClientOptionalParams) {\n if (url === undefined) {\n throw new Error(\"'url' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-data-tables/12.2.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{url}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.url = url;\n\n // Assigning values to Constant parameters\n this.version = options.version || \"2019-02-02\";\n }\n}\n"]}
1
+ {"version":3,"file":"generatedClientContext.js","sourceRoot":"","sources":["../../../src/generated/generatedClientContext.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAGjD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa;IAIlE;;;;OAIG;IACH,YAAY,GAAW,EAAE,OAAuC;QAC9D,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;SACzC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QACD,MAAM,QAAQ,GAAkC;YAC9C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,6BAA6B,CAAC;QACrD,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,GACrC,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,0CAA0C;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC;IACjD,CAAC;CACF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport { GeneratedClientOptionalParams } from \"./models\";\n\n/** @internal */\nexport class GeneratedClientContext extends coreClient.ServiceClient {\n url: string;\n version: string;\n\n /**\n * Initializes a new instance of the GeneratedClientContext class.\n * @param url The URL of the service account or table that is the target of the desired operation.\n * @param options The parameter options\n */\n constructor(url: string, options?: GeneratedClientOptionalParams) {\n if (url === undefined) {\n throw new Error(\"'url' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: GeneratedClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-data-tables/13.0.0`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n baseUri: options.endpoint || \"{url}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.url = url;\n\n // Assigning values to Constant parameters\n this.version = options.version || \"2019-02-02\";\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TableGetAccessPolicyHeaders, TableInsertEntityHeaders } from \"./generated/models\";\nimport { OperationOptions, CommonClientOptions } from \"@azure/core-client\";\n\n/**\n * Represents the Create or Delete Entity operation to be included in a Transaction request\n */\nexport type CreateDeleteEntityAction = [\"create\" | \"delete\", TableEntity];\n\n/**\n * Represents the Update or Upsert Entity operation to be included in a Transaction request\n */\nexport type UpdateEntityAction =\n | [\"update\" | \"upsert\", TableEntity]\n | [\"update\" | \"upsert\", TableEntity, \"Merge\" | \"Replace\"];\n\n/**\n * Represents the union of all the available transactional actions\n */\nexport type TransactionAction = CreateDeleteEntityAction | UpdateEntityAction;\n\n/**\n * Client options used to configure Tables Api requests\n */\nexport type TableServiceClientOptions = CommonClientOptions & {\n endpoint?: string;\n version?: string;\n};\n\n/**\n * Contains response data for the createEntity operation.\n */\nexport type CreateTableEntityResponse = TableInsertEntityHeaders;\n\n/**\n * Contains response data for the listEntities operation.\n */\nexport type GetTableEntityResponse<T extends object> = TableEntityResult<T>;\n\n/**\n * Optional parameters for DeleteTableEntity operation\n */\nexport type DeleteTableEntityOptions = OperationOptions & {\n /**\n * UTC date/time value generated by the service that indicates the time at which the response was initiated\n */\n etag?: string;\n};\n\n/** The properties for the table item. */\nexport interface TableItem {\n /** The name of the table. */\n name?: string;\n}\n\n/**\n * OData Query options to limit the set of tables returned.\n */\nexport interface TableQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n}\n\n/**\n * OData Query options to limit the set of entities returned.\n */\nexport interface TableEntityQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n /**\n * A select expression limits the properties on each entity to just those requested.\n */\n select?: string[];\n}\n\n/**\n * List tables optional parameters.\n */\nexport type ListTableItemsOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableQueryOptions;\n};\n\n/**\n * Output type for query operations\n */\nexport type TableEntityResult<T> = T & {\n /**\n * etag property. Always returned by the service\n */\n etag: string;\n /**\n * Partition key property. Omitted if a select filter is set and this property is not requested\n */\n partitionKey?: string;\n /**\n * Row key property. Omitted if a select filter is set and this property is not requested\n */\n rowKey?: string;\n /**\n * Timestamp property. This property is assinged by the service on entity creation\n * Omitted if a select filter is set and this property is not requested\n */\n timestamp?: string;\n};\n\n/**\n * Output page type for query operations\n */\nexport type TableEntityResultPage<T> = Array<TableEntityResult<T>> & {\n /**\n * Continuation token to get the next page\n */\n continuationToken?: string;\n};\n\n/**\n * List entities optional parameters.\n */\nexport type ListTableEntitiesOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * GetEntity optional parameters.\n */\nexport type GetTableEntityOptions = OperationOptions & {\n /**\n * Parameter group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * Update entity optional parameters.\n */\nexport type UpdateTableEntityOptions = OperationOptions & {\n /**\n * Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a replace will be performed if an existing entity is found.\n */\n etag?: string;\n};\n\n/**\n * A set of key-value pairs representing the table entity.\n */\nexport type TableEntity<T extends object = Record<string, unknown>> = T & {\n /**\n * The PartitionKey property of the entity.\n */\n partitionKey: string;\n /**\n * The RowKey property of the entity.\n */\n rowKey: string;\n};\n\n/**\n * Supported EDM Types by Azure Tables.\n */\nexport type EdmTypes =\n | \"Binary\"\n | \"Boolean\"\n | \"DateTime\"\n | \"Double\"\n | \"Guid\"\n | \"Int32\"\n | \"Int64\"\n | \"String\";\n\n/**\n * Entity Data Model representation for an entity property.\n */\nexport interface Edm<T extends EdmTypes> {\n /**\n * The value of the entity property\n */\n value: T extends \"Binary\"\n ? Uint8Array\n : T extends \"Boolean\"\n ? boolean\n : T extends \"Double\"\n ? number\n : T extends \"Int32\"\n ? number\n : string;\n /**\n * The type of the entity property\n */\n type: T;\n}\n\n/**\n * The different modes for Update and Upsert methods\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n */\nexport type UpdateMode = \"Merge\" | \"Replace\";\n\n/**\n * Represents the response of a Transaction operation\n */\nexport interface TableTransactionResponse {\n /**\n * Collection of sub responses\n */\n subResponses: TableTransactionEntityResponse[];\n /**\n * Main Transaction request status code\n */\n status: number;\n /**\n * Gets a specific response given a row key\n */\n getResponseForEntity: (rowKey: string) => TableTransactionEntityResponse | undefined;\n}\n\n/** The properties for the table query response. */\nexport interface TableQueryResponse {\n /** List of tables. */\n value?: TableItem[];\n}\n\n/**\n * Represents a sub-response of a Transaction operation\n */\nexport interface TableTransactionEntityResponse {\n /**\n * Entity's etag\n */\n etag?: string;\n /**\n * Entity's rowKey\n */\n rowKey?: string;\n /**\n * Sub-response status\n */\n status: number;\n}\n\n/** A signed identifier. */\nexport interface SignedIdentifier {\n /** A unique id. */\n id: string;\n /** The access policy. */\n accessPolicy?: AccessPolicy;\n}\n\n/** An Access policy. */\nexport interface AccessPolicy {\n /** The start datetime from which the policy is active. */\n start?: Date;\n /** The datetime that the policy expires. */\n expiry?: Date;\n /** The permissions for the acl policy. */\n permission?: string;\n}\n\n/** Contains response data for the getAccessPolicy operation. */\nexport type GetAccessPolicyResponse = TableGetAccessPolicyHeaders & SignedIdentifier[];\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TableGetAccessPolicyHeaders, TableInsertEntityHeaders } from \"./generated/models\";\nimport { OperationOptions, CommonClientOptions } from \"@azure/core-client\";\n\n/**\n * Represents the Create or Delete Entity operation to be included in a Transaction request\n */\nexport type CreateDeleteEntityAction = [\"create\" | \"delete\", TableEntity];\n\n/**\n * Represents the Update or Upsert Entity operation to be included in a Transaction request\n */\nexport type UpdateEntityAction =\n | [\"update\" | \"upsert\", TableEntity]\n | [\"update\" | \"upsert\", TableEntity, \"Merge\" | \"Replace\"];\n\n/**\n * Represents the union of all the available transactional actions\n */\nexport type TransactionAction = CreateDeleteEntityAction | UpdateEntityAction;\n\n/**\n * Client options used to configure Tables Api requests\n */\nexport type TableServiceClientOptions = CommonClientOptions & {\n endpoint?: string;\n version?: string;\n};\n\n/**\n * Contains response data for the createEntity operation.\n */\nexport type CreateTableEntityResponse = TableInsertEntityHeaders;\n\n/**\n * Contains response data for the listEntities operation.\n */\nexport type GetTableEntityResponse<T extends object> = TableEntityResult<T>;\n\n/**\n * Optional parameters for DeleteTableEntity operation\n */\nexport type DeleteTableEntityOptions = OperationOptions & {\n /**\n * UTC date/time value generated by the service that indicates the time at which the response was initiated\n */\n etag?: string;\n};\n\n/** The properties for the table item. */\nexport interface TableItem {\n /** The name of the table. */\n name?: string;\n}\n\n/**\n * OData Query options to limit the set of tables returned.\n */\nexport interface TableQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n}\n\n/**\n * OData Query options to limit the set of entities returned.\n */\nexport interface TableEntityQueryOptions {\n /**\n * OData filter expression.\n */\n filter?: string;\n /**\n * A select expression limits the properties on each entity to just those requested.\n */\n select?: string[];\n}\n\n/**\n * List tables optional parameters.\n */\nexport type ListTableItemsOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableQueryOptions;\n};\n\n/**\n * Output type for query operations\n */\nexport type TableEntityResult<T> = T & {\n /**\n * etag property. Always returned by the service\n */\n etag: string;\n /**\n * Partition key property. Omitted if a select filter is set and this property is not requested\n */\n partitionKey?: string;\n /**\n * Row key property. Omitted if a select filter is set and this property is not requested\n */\n rowKey?: string;\n /**\n * Timestamp property. This property is assinged by the service on entity creation\n * Omitted if a select filter is set and this property is not requested\n */\n timestamp?: string;\n};\n\n/**\n * Output page type for query operations\n */\nexport type TableEntityResultPage<T> = Array<TableEntityResult<T>> & {\n /**\n * Continuation token to get the next page\n */\n continuationToken?: string;\n};\n\n/**\n * List entities optional parameters.\n */\nexport type ListTableEntitiesOptions = OperationOptions & {\n /**\n * Query options group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * GetEntity optional parameters.\n */\nexport type GetTableEntityOptions = OperationOptions & {\n /**\n * Parameter group\n */\n queryOptions?: TableEntityQueryOptions;\n /**\n * If true, automatic type conversion will be disabled and entity properties will\n * be represented by full metadata types. For example, an Int32 value will be \\{value: \"123\", type: \"Int32\"\\} instead of 123.\n * This option applies for all the properties\n */\n disableTypeConversion?: boolean;\n};\n\n/**\n * Update entity optional parameters.\n */\nexport type UpdateTableEntityOptions = OperationOptions & {\n /**\n * Match condition for an entity to be updated. If specified and a matching entity is not found, an error will be raised. To force an unconditional update, set to the wildcard character (*). If not specified, an insert will be performed when no existing entity is found to update and a replace will be performed if an existing entity is found.\n */\n etag?: string;\n};\n\n/**\n * A set of key-value pairs representing the table entity.\n */\nexport type TableEntity<T extends object = Record<string, unknown>> = T & {\n /**\n * The PartitionKey property of the entity.\n */\n partitionKey: string;\n /**\n * The RowKey property of the entity.\n */\n rowKey: string;\n};\n\n/**\n * Supported EDM Types by Azure Tables.\n */\nexport type EdmTypes =\n | \"Binary\"\n | \"Boolean\"\n | \"DateTime\"\n | \"Double\"\n | \"Guid\"\n | \"Int32\"\n | \"Int64\"\n | \"String\";\n\n/**\n * Entity Data Model representation for an entity property.\n */\nexport interface Edm<T extends EdmTypes> {\n /**\n * The value of the entity property\n */\n value: T extends \"Binary\"\n ? string\n : T extends \"Boolean\"\n ? boolean\n : T extends \"Double\"\n ? number\n : T extends \"Int32\"\n ? number\n : string;\n /**\n * The type of the entity property\n */\n type: T;\n}\n\n/**\n * The different modes for Update and Upsert methods\n * - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.\n * - Replace: Updates an existing entity by replacing the entire entity.\n */\nexport type UpdateMode = \"Merge\" | \"Replace\";\n\n/**\n * Represents the response of a Transaction operation\n */\nexport interface TableTransactionResponse {\n /**\n * Collection of sub responses\n */\n subResponses: TableTransactionEntityResponse[];\n /**\n * Main Transaction request status code\n */\n status: number;\n /**\n * Gets a specific response given a row key\n */\n getResponseForEntity: (rowKey: string) => TableTransactionEntityResponse | undefined;\n}\n\n/** The properties for the table query response. */\nexport interface TableQueryResponse {\n /** List of tables. */\n value?: TableItem[];\n}\n\n/**\n * Output page type for table query operations\n */\nexport interface TableItemResultPage extends Array<TableItem> {\n /**\n * Continuation token to get the next TableItem page\n */\n continuationToken?: string;\n}\n\n/**\n * Represents a sub-response of a Transaction operation\n */\nexport interface TableTransactionEntityResponse {\n /**\n * Entity's etag\n */\n etag?: string;\n /**\n * Entity's rowKey\n */\n rowKey?: string;\n /**\n * Sub-response status\n */\n status: number;\n}\n\n/** A signed identifier. */\nexport interface SignedIdentifier {\n /** A unique id. */\n id: string;\n /** The access policy. */\n accessPolicy?: AccessPolicy;\n}\n\n/** An Access policy. */\nexport interface AccessPolicy {\n /** The start datetime from which the policy is active. */\n start?: Date;\n /** The datetime that the policy expires. */\n expiry?: Date;\n /** The permissions for the acl policy. */\n permission?: string;\n}\n\n/** Contains response data for the getAccessPolicy operation. */\nexport type GetAccessPolicyResponse = TableGetAccessPolicyHeaders & SignedIdentifier[];\n"]}
@@ -3,7 +3,7 @@
3
3
  function escapeQuotesIfString(input, previous) {
4
4
  let result = input;
5
5
  if (typeof input === "string") {
6
- result = input.replace(/'/g, "''");
6
+ result = escapeQuotes(input);
7
7
  // check if we need to escape this literal
8
8
  if (!previous.trim().endsWith("'")) {
9
9
  result = `'${result}'`;
@@ -11,6 +11,9 @@ function escapeQuotesIfString(input, previous) {
11
11
  }
12
12
  return result;
13
13
  }
14
+ export function escapeQuotes(input) {
15
+ return input.replace(/'/g, "''");
16
+ }
14
17
  /**
15
18
  * Escapes an odata filter expression to avoid errors with quoting string literals.
16
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"odata.js","sourceRoot":"","sources":["../../src/odata.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAgB;IAC5D,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACnC,0CAA0C;QAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAClC,MAAM,GAAG,IAAI,MAAM,GAAG,CAAC;SACxB;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACvE,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3D;KACF;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nfunction escapeQuotesIfString(input: unknown, previous: string): string | unknown {\n let result = input;\n\n if (typeof input === \"string\") {\n result = input.replace(/'/g, \"''\");\n // check if we need to escape this literal\n if (!previous.trim().endsWith(\"'\")) {\n result = `'${result}'`;\n }\n }\n return result;\n}\n\n/**\n * Escapes an odata filter expression to avoid errors with quoting string literals.\n */\nexport function odata(strings: TemplateStringsArray, ...values: unknown[]): string {\n const results = [];\n for (let i = 0; i < strings.length; i++) {\n results.push(strings[i]);\n if (i < values.length) {\n results.push(escapeQuotesIfString(values[i], strings[i]));\n }\n }\n return results.join(\"\");\n}\n"]}
1
+ {"version":3,"file":"odata.js","sourceRoot":"","sources":["../../src/odata.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,SAAS,oBAAoB,CAAC,KAAc,EAAE,QAAgB;IAC5D,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC7B,0CAA0C;QAC1C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAClC,MAAM,GAAG,IAAI,MAAM,GAAG,CAAC;SACxB;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,OAA6B,EAAE,GAAG,MAAiB;IACvE,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;YACrB,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3D;KACF;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nfunction escapeQuotesIfString(input: unknown, previous: string): string | unknown {\n let result = input;\n\n if (typeof input === \"string\") {\n result = escapeQuotes(input);\n // check if we need to escape this literal\n if (!previous.trim().endsWith(\"'\")) {\n result = `'${result}'`;\n }\n }\n return result;\n}\n\nexport function escapeQuotes(input: string): string {\n return input.replace(/'/g, \"''\");\n}\n\n/**\n * Escapes an odata filter expression to avoid errors with quoting string literals.\n */\nexport function odata(strings: TemplateStringsArray, ...values: unknown[]): string {\n const results = [];\n for (let i = 0; i < strings.length; i++) {\n results.push(strings[i]);\n if (i < values.length) {\n results.push(escapeQuotesIfString(values[i], strings[i]));\n }\n }\n return results.join(\"\");\n}\n"]}
@@ -53,14 +53,11 @@ function serializeObject(obj) {
53
53
  obj.type === "Guid" ||
54
54
  obj.type === "Int32" ||
55
55
  obj.type === "Int64" ||
56
- obj.type === "String") {
56
+ obj.type === "String" ||
57
+ obj.type === "Binary") {
57
58
  serializedValue.value = obj.value;
58
59
  serializedValue.type = Edm[obj.type];
59
60
  }
60
- else if (obj.type === "Binary") {
61
- serializedValue.value = base64Encode(obj.value);
62
- serializedValue.type = Edm.Binary;
63
- }
64
61
  else {
65
62
  throw new Error(`Unknown EDM type ${typeof obj.value}`);
66
63
  }