@azure/data-tables 13.3.1 → 13.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/TableClient.js +105 -61
- package/dist/browser/TableClient.js.map +1 -1
- package/dist/browser/TableServiceClient.js +59 -48
- package/dist/browser/TableServiceClient.js.map +1 -1
- package/dist/browser/TableTransaction.js +34 -9
- package/dist/browser/TableTransaction.js.map +1 -1
- package/dist/browser/generated/generatedClient.js +11 -3
- package/dist/browser/generated/generatedClient.js.map +1 -1
- package/dist/browser/generated/generatedClientContext.js +10 -3
- package/dist/browser/generated/generatedClientContext.js.map +1 -1
- package/dist/browser/generated/models/mappers.js +5 -2
- package/dist/browser/generated/models/mappers.js.map +1 -1
- package/dist/browser/generated/operations/service.js +1 -0
- package/dist/browser/generated/operations/service.js.map +1 -1
- package/dist/browser/generated/operations/table.js +1 -0
- package/dist/browser/generated/operations/table.js.map +1 -1
- package/dist/browser/sas/accountSasPermissions.d.ts +1 -1
- package/dist/browser/sas/accountSasPermissions.js +2 -2
- package/dist/browser/sas/accountSasPermissions.js.map +1 -1
- package/dist/browser/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/browser/sas/accountSasResourceTypes.js +1 -1
- package/dist/browser/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/browser/sas/accountSasSignatureValues.d.ts +1 -1
- package/dist/browser/sas/accountSasSignatureValues.js +1 -1
- package/dist/browser/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/browser/sas/generateAccountSas.d.ts +1 -1
- package/dist/browser/sas/generateAccountSas.js +9 -4
- package/dist/browser/sas/generateAccountSas.js.map +1 -1
- package/dist/browser/sas/generateTableSas.d.ts +1 -1
- package/dist/browser/sas/generateTableSas.js +6 -3
- package/dist/browser/sas/generateTableSas.js.map +1 -1
- package/dist/browser/sas/sasQueryParameters.d.ts +1 -1
- package/dist/browser/sas/sasQueryParameters.js +112 -0
- package/dist/browser/sas/sasQueryParameters.js.map +1 -1
- package/dist/browser/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/browser/sas/tableSasSignatureValues.js +6 -7
- package/dist/browser/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/browser/secondaryEndpointPolicy.js +10 -2
- package/dist/browser/secondaryEndpointPolicy.js.map +1 -1
- package/dist/browser/serialization.js +16 -10
- package/dist/browser/serialization.js.map +1 -1
- package/dist/browser/utils/continuationToken.js +5 -1
- package/dist/browser/utils/continuationToken.js.map +1 -1
- package/dist/browser/utils/errorHelpers.js +3 -4
- package/dist/browser/utils/errorHelpers.js.map +1 -1
- package/dist/browser/utils/isCosmosEndpoint.js +2 -3
- package/dist/browser/utils/isCosmosEndpoint.js.map +1 -1
- package/dist/browser/utils/tracing.js +1 -1
- package/dist/browser/utils/tracing.js.map +1 -1
- package/dist/commonjs/TableClient.js +105 -61
- package/dist/commonjs/TableClient.js.map +1 -1
- package/dist/commonjs/TableServiceClient.js +59 -48
- package/dist/commonjs/TableServiceClient.js.map +1 -1
- package/dist/commonjs/TableTransaction.js +34 -9
- package/dist/commonjs/TableTransaction.js.map +1 -1
- package/dist/commonjs/generated/generatedClient.js +11 -3
- package/dist/commonjs/generated/generatedClient.js.map +1 -1
- package/dist/commonjs/generated/generatedClientContext.js +10 -3
- package/dist/commonjs/generated/generatedClientContext.js.map +1 -1
- package/dist/commonjs/generated/models/mappers.js +5 -2
- package/dist/commonjs/generated/models/mappers.js.map +1 -1
- package/dist/commonjs/generated/operations/service.js +1 -0
- package/dist/commonjs/generated/operations/service.js.map +1 -1
- package/dist/commonjs/generated/operations/table.js +1 -0
- package/dist/commonjs/generated/operations/table.js.map +1 -1
- package/dist/commonjs/sas/accountSasPermissions.d.ts +1 -1
- package/dist/commonjs/sas/accountSasPermissions.js +2 -2
- package/dist/commonjs/sas/accountSasPermissions.js.map +1 -1
- package/dist/commonjs/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/commonjs/sas/accountSasResourceTypes.js +1 -1
- package/dist/commonjs/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/commonjs/sas/accountSasSignatureValues.d.ts +1 -1
- package/dist/commonjs/sas/accountSasSignatureValues.js +1 -1
- package/dist/commonjs/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/commonjs/sas/generateAccountSas.d.ts +1 -1
- package/dist/commonjs/sas/generateAccountSas.js +9 -4
- package/dist/commonjs/sas/generateAccountSas.js.map +1 -1
- package/dist/commonjs/sas/generateTableSas.d.ts +1 -1
- package/dist/commonjs/sas/generateTableSas.js +6 -3
- package/dist/commonjs/sas/generateTableSas.js.map +1 -1
- package/dist/commonjs/sas/sasQueryParameters.d.ts +1 -1
- package/dist/commonjs/sas/sasQueryParameters.js +112 -0
- package/dist/commonjs/sas/sasQueryParameters.js.map +1 -1
- package/dist/commonjs/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/commonjs/sas/tableSasSignatureValues.js +6 -7
- package/dist/commonjs/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/commonjs/secondaryEndpointPolicy.js +10 -2
- package/dist/commonjs/secondaryEndpointPolicy.js.map +1 -1
- package/dist/commonjs/serialization.js +16 -10
- package/dist/commonjs/serialization.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/continuationToken.js +5 -1
- package/dist/commonjs/utils/continuationToken.js.map +1 -1
- package/dist/commonjs/utils/errorHelpers.js +3 -4
- package/dist/commonjs/utils/errorHelpers.js.map +1 -1
- package/dist/commonjs/utils/isCosmosEndpoint.js +2 -3
- package/dist/commonjs/utils/isCosmosEndpoint.js.map +1 -1
- package/dist/commonjs/utils/tracing.js +1 -1
- package/dist/commonjs/utils/tracing.js.map +1 -1
- package/dist/commonjs/utils/transactionHeaders.js +5 -2
- package/dist/commonjs/utils/transactionHeaders.js.map +1 -1
- package/dist/esm/TableClient.js +105 -61
- package/dist/esm/TableClient.js.map +1 -1
- package/dist/esm/TableServiceClient.js +59 -48
- package/dist/esm/TableServiceClient.js.map +1 -1
- package/dist/esm/TableTransaction.js +34 -9
- package/dist/esm/TableTransaction.js.map +1 -1
- package/dist/esm/generated/generatedClient.js +11 -3
- package/dist/esm/generated/generatedClient.js.map +1 -1
- package/dist/esm/generated/generatedClientContext.js +10 -3
- package/dist/esm/generated/generatedClientContext.js.map +1 -1
- package/dist/esm/generated/models/mappers.js +5 -2
- package/dist/esm/generated/models/mappers.js.map +1 -1
- package/dist/esm/generated/operations/service.js +1 -0
- package/dist/esm/generated/operations/service.js.map +1 -1
- package/dist/esm/generated/operations/table.js +1 -0
- package/dist/esm/generated/operations/table.js.map +1 -1
- package/dist/esm/sas/accountSasPermissions.d.ts +1 -1
- package/dist/esm/sas/accountSasPermissions.js +2 -2
- package/dist/esm/sas/accountSasPermissions.js.map +1 -1
- package/dist/esm/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/esm/sas/accountSasResourceTypes.js +1 -1
- package/dist/esm/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/esm/sas/accountSasSignatureValues.d.ts +1 -1
- package/dist/esm/sas/accountSasSignatureValues.js +1 -1
- package/dist/esm/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/esm/sas/generateAccountSas.d.ts +1 -1
- package/dist/esm/sas/generateAccountSas.js +9 -4
- package/dist/esm/sas/generateAccountSas.js.map +1 -1
- package/dist/esm/sas/generateTableSas.d.ts +1 -1
- package/dist/esm/sas/generateTableSas.js +6 -3
- package/dist/esm/sas/generateTableSas.js.map +1 -1
- package/dist/esm/sas/sasQueryParameters.d.ts +1 -1
- package/dist/esm/sas/sasQueryParameters.js +112 -0
- package/dist/esm/sas/sasQueryParameters.js.map +1 -1
- package/dist/esm/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/esm/sas/tableSasSignatureValues.js +6 -7
- package/dist/esm/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/esm/secondaryEndpointPolicy.js +10 -2
- package/dist/esm/secondaryEndpointPolicy.js.map +1 -1
- package/dist/esm/serialization.js +16 -10
- package/dist/esm/serialization.js.map +1 -1
- package/dist/esm/utils/continuationToken.js +5 -1
- package/dist/esm/utils/continuationToken.js.map +1 -1
- package/dist/esm/utils/errorHelpers.js +3 -4
- package/dist/esm/utils/errorHelpers.js.map +1 -1
- package/dist/esm/utils/isCosmosEndpoint.js +2 -3
- package/dist/esm/utils/isCosmosEndpoint.js.map +1 -1
- package/dist/esm/utils/tracing.js +1 -1
- package/dist/esm/utils/tracing.js.map +1 -1
- package/dist/esm/utils/transactionHeaders.js +5 -2
- package/dist/esm/utils/transactionHeaders.js.map +1 -1
- package/dist/react-native/TableClient.js +105 -61
- package/dist/react-native/TableClient.js.map +1 -1
- package/dist/react-native/TableServiceClient.js +59 -48
- package/dist/react-native/TableServiceClient.js.map +1 -1
- package/dist/react-native/TableTransaction.js +34 -9
- package/dist/react-native/TableTransaction.js.map +1 -1
- package/dist/react-native/generated/generatedClient.js +11 -3
- package/dist/react-native/generated/generatedClient.js.map +1 -1
- package/dist/react-native/generated/generatedClientContext.js +10 -3
- package/dist/react-native/generated/generatedClientContext.js.map +1 -1
- package/dist/react-native/generated/models/mappers.js +5 -2
- package/dist/react-native/generated/models/mappers.js.map +1 -1
- package/dist/react-native/generated/operations/service.js +1 -0
- package/dist/react-native/generated/operations/service.js.map +1 -1
- package/dist/react-native/generated/operations/table.js +1 -0
- package/dist/react-native/generated/operations/table.js.map +1 -1
- package/dist/react-native/sas/accountSasPermissions.d.ts +1 -1
- package/dist/react-native/sas/accountSasPermissions.js +2 -2
- package/dist/react-native/sas/accountSasPermissions.js.map +1 -1
- package/dist/react-native/sas/accountSasResourceTypes.d.ts +1 -1
- package/dist/react-native/sas/accountSasResourceTypes.js +1 -1
- package/dist/react-native/sas/accountSasResourceTypes.js.map +1 -1
- package/dist/react-native/sas/accountSasSignatureValues.d.ts +1 -1
- package/dist/react-native/sas/accountSasSignatureValues.js +1 -1
- package/dist/react-native/sas/accountSasSignatureValues.js.map +1 -1
- package/dist/react-native/sas/generateAccountSas.d.ts +1 -1
- package/dist/react-native/sas/generateAccountSas.js +9 -4
- package/dist/react-native/sas/generateAccountSas.js.map +1 -1
- package/dist/react-native/sas/generateTableSas.d.ts +1 -1
- package/dist/react-native/sas/generateTableSas.js +6 -3
- package/dist/react-native/sas/generateTableSas.js.map +1 -1
- package/dist/react-native/sas/sasQueryParameters.d.ts +1 -1
- package/dist/react-native/sas/sasQueryParameters.js +112 -0
- package/dist/react-native/sas/sasQueryParameters.js.map +1 -1
- package/dist/react-native/sas/tableSasSignatureValues.d.ts +1 -1
- package/dist/react-native/sas/tableSasSignatureValues.js +6 -7
- package/dist/react-native/sas/tableSasSignatureValues.js.map +1 -1
- package/dist/react-native/secondaryEndpointPolicy.js +10 -2
- package/dist/react-native/secondaryEndpointPolicy.js.map +1 -1
- package/dist/react-native/serialization.js +16 -10
- package/dist/react-native/serialization.js.map +1 -1
- package/dist/react-native/utils/continuationToken.js +5 -1
- package/dist/react-native/utils/continuationToken.js.map +1 -1
- package/dist/react-native/utils/errorHelpers.js +3 -4
- package/dist/react-native/utils/errorHelpers.js.map +1 -1
- package/dist/react-native/utils/isCosmosEndpoint.js +2 -3
- package/dist/react-native/utils/isCosmosEndpoint.js.map +1 -1
- package/dist/react-native/utils/tracing.js +1 -1
- package/dist/react-native/utils/tracing.js.map +1 -1
- package/dist/react-native/utils/transactionHeaders.js +5 -2
- package/dist/react-native/utils/transactionHeaders.js.map +1 -1
- package/package.json +34 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableClient.js","sourceRoot":"","sources":["../../src/TableClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAkClC,mDAAuD;AAEvD,gDAA4F;AAC5F,uDAAoG;AACpG,uEAAgG;AAChG,yDAO4B;AAC5B,8CAAyD;AAEzD,+DAAiE;AAMjE,6CAAuC;AACvC,qEAA+D;AAC/D,+DAA0D;AAC1D,yCAA0C;AAC1C,qEAAkF;AAClF,6DAAmE;AACnE,qEAA+D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AAC;QACH,CAAC;QAED,OAAO,iBAAiB,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB,EACxB,SAAiB;IACjB,8DAA8D;IAC9D,OAA4B;QAE5B,MAAM,EACJ,GAAG,EACH,OAAO,EAAE,aAAa,EACtB,UAAU,GACX,GAAG,IAAA,yDAAmC,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACnE,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;CACF;AA71BD,kCA61BC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CreateTableEntityResponse,\n DeleteTableEntityOptions,\n GetAccessPolicyResponse,\n GetTableEntityOptions,\n GetTableEntityResponse,\n ListTableEntitiesOptions,\n SignedIdentifier,\n TableServiceClientOptions as TableClientOptions,\n TableEntity,\n TableEntityQueryOptions,\n TableEntityResult,\n TableEntityResultPage,\n TableTransactionResponse,\n TransactionAction,\n UpdateMode,\n UpdateTableEntityOptions,\n} from \"./models.js\";\nimport type {\n DeleteTableEntityResponse,\n SetAccessPolicyResponse,\n UpdateEntityResponse,\n UpsertEntityResponse,\n} from \"./generatedModels.js\";\nimport type {\n FullOperationResponse,\n InternalClientPipelineOptions,\n OperationOptions,\n ServiceClient,\n ServiceClientOptions,\n} from \"@azure/core-client\";\nimport type { TableDeleteEntityOptionalParams } from \"./generated/index.js\";\nimport { GeneratedClient } from \"./generated/index.js\";\nimport type { NamedKeyCredential, SASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isNamedKeyCredential, isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { COSMOS_SCOPE, STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants.js\";\nimport { decodeContinuationToken, encodeContinuationToken } from \"./utils/continuationToken.js\";\nimport {\n deserialize,\n deserializeObjectsArray,\n deserializeSignedIdentifier,\n serialize,\n serializeQueryOptions,\n serializeSignedIdentifiers,\n} from \"./serialization.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\n\nimport { InternalTableTransaction } from \"./TableTransaction.js\";\nimport type { ListEntitiesResponse } from \"./utils/internalModels.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport type { Table } from \"./generated/operationsInterfaces/index.js\";\nimport type { TableQueryEntitiesOptionalParams } from \"./generated/models/index.js\";\nimport { Uuid } from \"./utils/uuid.js\";\nimport { apiVersionPolicy } from \"./utils/apiVersionPolicy.js\";\nimport { cosmosPatchPolicy } from \"./cosmosPathPolicy.js\";\nimport { escapeQuotes } from \"./odata.js\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString.js\";\nimport { handleTableAlreadyExists } from \"./utils/errorHelpers.js\";\nimport { isCosmosEndpoint } from \"./utils/isCosmosEndpoint.js\";\nimport { isCredential } from \"./utils/isCredential.js\";\nimport { logger } from \"./logger.js\";\nimport { setTokenChallengeAuthenticationPolicy } from \"./utils/challengeAuthenticationUtils.js\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy.js\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\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 generatedClient: ServiceClient;\n private credential?: NamedKeyCredential | SASCredential | TokenCredential;\n private clientOptions: TableClientOptions;\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 * ```ts snippet:ReadmeSampleCreateTableClient_NamedKeyCredential\n * import { AzureNamedKeyCredential, TableClient } from \"@azure/data-tables\";\n *\n * // Enter your storage account name and shared key\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * // Use AzureNamedKeyCredential with storage account and account key\n * // AzureNamedKeyCredential is only available in Node.js runtime, not in browsers\n * const credential = new AzureNamedKeyCredential(account, accountKey);\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\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 * ```ts snippet:ReadmeSampleCreateTableClient_SASToken\n * import { TableClient, AzureSASCredential } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sas = \"<service Shared Access Signature Token>\";\n * const tableName = \"<tableName>\";\n *\n * const clientWithSAS = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * new AzureSASCredential(sas),\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 * ```ts snippet:ReadmeSampleCreateTableClient_TokenCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const credential = new DefaultAzureCredential();\n * const account = \"<account name>\";\n * const tableName = \"<tableName>\";\n *\n * const clientWithAAD = 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 * ```ts snippet:ReadmeSampleCreateTableClient_SASTokenURL\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sasToken = \"<SAS token>\";\n * const tableName = \"<tableName>\";\n *\n * const clientWithSAS = 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 const isCosmos = isCosmosEndpoint(this.url);\n\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n this.credential = credential;\n\n this.clientOptions = (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n this.allowInsecureConnection = this.clientOptions.allowInsecureConnection ?? false;\n\n const internalPipelineOptions: ServiceClientOptions & InternalClientPipelineOptions = {\n ...this.clientOptions,\n endpoint: this.clientOptions.endpoint || this.url,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames],\n },\n deserializationOptions: {\n parseXML,\n },\n serializationOptions: {\n stringifyXML,\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 (isTokenCredential(credential)) {\n const scope = isCosmos ? COSMOS_SCOPE : STORAGE_SCOPE;\n setTokenChallengeAuthenticationPolicy(generatedClient.pipeline, credential, scope);\n }\n\n if (isCosmos) {\n generatedClient.pipeline.addPolicy(cosmosPatchPolicy());\n }\n\n if (options.version) {\n generatedClient.pipeline.addPolicy(apiVersionPolicy(options.version));\n }\n\n this.generatedClient = generatedClient;\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 * ```ts snippet:ReadmeSampleDeleteTable\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * await client.deleteTable();\n * ```\n */\n public deleteTable(options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\"TableClient.deleteTable\", options, async (updatedOptions) => {\n try {\n await this.table.delete(this.tableName, updatedOptions);\n } catch (e: any) {\n if (e.statusCode === 404) {\n logger.info(\"TableClient.deleteTable: Table doesn't exist\");\n } else {\n throw e;\n }\n }\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 * ```ts snippet:ReadmeSampleTableClientCreateTable\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * // If the table 'newTable' already exists, createTable doesn't throw\n * await client.createTable();\n * ```\n */\n public createTable(options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\"TableClient.createTable\", options, async (updatedOptions) => {\n try {\n await this.table.create({ name: this.tableName }, updatedOptions);\n } catch (e: any) {\n handleTableAlreadyExists(e, { ...updatedOptions, logger, tableName: this.tableName });\n }\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 * ```ts snippet:ReadmeSampleGetEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const entity = await client.getEntity(\"<partitionKey>\", \"<rowKey>\");\n * console.log(`Entity: PartitionKey: ${entity.partitionKey} RowKey: ${entity.rowKey}`);\n * ```\n */\n public 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 if (partitionKey === undefined || partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (rowKey === undefined || rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n return tracingClient.withSpan(\"TableClient.getEntity\", options, async (updatedOptions) => {\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 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 });\n }\n\n /**\n * Queries entities in a table.\n * @param options - The options parameters.\n *\n * Example listing entities\n * ```ts snippet:ReadmeSampleListEntities\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * let i = 0;\n * const entities = client.listEntities();\n * for await (const entity of entities) {\n * console.log(`Entity${++i}: PartitionKey: ${entity.partitionKey} RowKey: ${entity.rowKey}`);\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 let result = await tracingClient.withSpan(\n \"TableClient.listEntitiesPage\",\n options,\n (updatedOptions) => this._listEntities<T>(tableName, updatedOptions),\n );\n\n yield result;\n\n while (result.continuationToken) {\n const optionsWithContinuation: InternalListTableEntitiesOptions = {\n ...options,\n continuationToken: result.continuationToken,\n };\n\n result = await tracingClient.withSpan(\n \"TableClient.listEntitiesPage\",\n optionsWithContinuation,\n (updatedOptions, span) => {\n span.setAttribute(\"continuationToken\", result.continuationToken);\n return this._listEntities<T>(tableName, updatedOptions);\n },\n );\n yield result;\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 * ```ts snippet:ReadmeSampleCreateEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const testEntity = {\n * partitionKey: \"P1\",\n * rowKey: \"R1\",\n * foo: \"foo\",\n * bar: 123,\n * };\n * await client.createEntity(testEntity);\n * ```\n */\n public createEntity<T extends object>(\n entity: TableEntity<T>,\n options: OperationOptions = {},\n ): Promise<CreateTableEntityResponse> {\n return tracingClient.withSpan(\"TableClient.createEntity\", options, (updatedOptions) => {\n const { ...createTableEntity } = updatedOptions || {};\n return this.table.insertEntity(this.tableName, {\n ...createTableEntity,\n tableEntityProperties: serialize(entity),\n responsePreference: \"return-no-content\",\n });\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 * ```ts snippet:ReadmeSampleDeleteEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * // deleteEntity deletes the entity that matches exactly the partitionKey and rowKey\n * await client.deleteEntity(\"<partitionKey>\", \"<rowKey>\");\n * ```\n */\n public 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 if (partitionKey === undefined || partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (rowKey === undefined || rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n return tracingClient.withSpan(\"TableClient.deleteEntity\", options, (updatedOptions) => {\n const { etag = \"*\", ...rest } = updatedOptions;\n const deleteOptions: TableDeleteEntityOptionalParams = {\n ...rest,\n };\n return this.table.deleteEntity(\n this.tableName,\n escapeQuotes(partitionKey),\n escapeQuotes(rowKey),\n etag,\n deleteOptions,\n );\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 * ```ts snippet:ReadmeSampleUpdateEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\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 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 if (entity.partitionKey === undefined || entity.partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (entity.rowKey === undefined || entity.rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n return tracingClient.withSpan(\n \"TableClient.updateEntity\",\n options,\n async (updatedOptions) => {\n const partitionKey = escapeQuotes(entity.partitionKey);\n const rowKey = escapeQuotes(entity.rowKey);\n\n const { etag = \"*\", ...updateEntityOptions } = updatedOptions || {};\n if (mode === \"Merge\") {\n return this.table.mergeEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ifMatch: etag,\n ...updateEntityOptions,\n });\n }\n if (mode === \"Replace\") {\n return 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 },\n {\n spanAttributes: {\n updateEntityMode: mode,\n },\n },\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 * ```ts snippet:ReadmeSampleUpsertEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\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 upsertEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode = \"Merge\",\n options: OperationOptions = {},\n ): Promise<UpsertEntityResponse> {\n return tracingClient.withSpan(\n \"TableClient.upsertEntity\",\n options,\n async (updatedOptions) => {\n if (entity.partitionKey === undefined || entity.partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (entity.rowKey === undefined || entity.rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n\n const partitionKey = escapeQuotes(entity.partitionKey);\n const rowKey = escapeQuotes(entity.rowKey);\n\n if (mode === \"Merge\") {\n return this.table.mergeEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ...updatedOptions,\n });\n }\n\n if (mode === \"Replace\") {\n return 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 },\n {\n spanAttributes: {\n upsertEntityMode: mode,\n },\n },\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 getAccessPolicy(options: OperationOptions = {}): Promise<GetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"TableClient.getAccessPolicy\",\n options,\n async (updatedOptions) => {\n const signedIdentifiers = await this.table.getAccessPolicy(this.tableName, updatedOptions);\n return deserializeSignedIdentifier(signedIdentifiers);\n },\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 setAccessPolicy(\n tableAcl: SignedIdentifier[],\n options: OperationOptions = {},\n ): Promise<SetAccessPolicyResponse> {\n return tracingClient.withSpan(\"TableClient.setAccessPolicy\", options, (updatedOptions) => {\n const serlializedAcl = serializeSignedIdentifiers(tableAcl);\n return this.table.setAccessPolicy(this.tableName, {\n ...updatedOptions,\n tableAcl: serlializedAcl,\n });\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 * ```ts snippet:ReadmeSampleSubmitTransaction\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient, TransactionAction } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const actions: TransactionAction[] = [\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 * ```ts snippet:ReadmeSampleSubmitTransactionWithTableTransaction\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient, TableTransaction } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const transaction = new TableTransaction();\n *\n * // Call the available action in the TableTransaction object\n * transaction.createEntity({ partitionKey: \"p1\", rowKey: \"1\", data: \"test1\" });\n * transaction.deleteEntity(\"p1\", \"2\");\n * transaction.updateEntity({ partitionKey: \"p1\", rowKey: \"3\", data: \"newTest\" }, \"Merge\");\n *\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 * @param options - Options for the request.\n */\n public async submitTransaction(\n actions: TransactionAction[],\n\n options: OperationOptions = {},\n ): Promise<TableTransactionResponse> {\n const partitionKey = actions[0][1].partitionKey;\n const transactionId = Uuid.generateUuid();\n const changesetId = Uuid.generateUuid();\n\n // Add pipeline\n const transactionClient = new InternalTableTransaction(\n this.url,\n partitionKey,\n transactionId,\n changesetId,\n this.generatedClient,\n new TableClient(this.url, this.tableName),\n this.credential,\n this.allowInsecureConnection,\n );\n\n for (const item of actions) {\n const [action, entity, updateMode = \"Merge\", updateOptions] = item;\n switch (action) {\n case \"create\":\n transactionClient.createEntity(entity);\n break;\n case \"delete\":\n transactionClient.deleteEntity(entity.partitionKey, entity.rowKey);\n break;\n case \"update\":\n transactionClient.updateEntity(entity, updateMode, updateOptions);\n break;\n case \"upsert\":\n transactionClient.upsertEntity(entity, updateMode);\n }\n }\n\n return transactionClient.submitTransaction(options);\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 {\n url,\n options: clientOptions,\n credential,\n } = getClientParamsFromConnectionString(connectionString, options);\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":"TableClient.js","sourceRoot":"","sources":["../../src/TableClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAkClC,mDAAuD;AAEvD,gDAA4F;AAC5F,uDAAoG;AACpG,uEAAgG;AAChG,yDAO4B;AAC5B,8CAAyD;AAEzD,+DAAiE;AAMjE,6CAAuC;AACvC,qEAA+D;AAC/D,+DAA0D;AAC1D,yCAA0C;AAC1C,qEAAkF;AAClF,6DAAmE;AACnE,qEAA+D;AAC/D,6DAAuD;AACvD,2CAAqC;AACrC,6FAAgG;AAChG,qFAAkF;AAClF,uEAAiE;AACjE,mDAAmD;AAEnD;;;GAGG;AACH,MAAa,WAAW;IACtB;;OAEG;IACI,GAAG,CAAS;IACnB;;;OAGG;IACI,QAAQ,CAAW;IAClB,KAAK,CAAQ;IACb,eAAe,CAAgB;IAC/B,UAAU,CAAwD;IAClE,aAAa,CAAqB;IACzB,uBAAuB,CAAU;IAElD;;OAEG;IACa,SAAS,CAAS;IAyHlC,YACE,GAAW,EACX,SAAiB,EACjB,mBAA+F,EAC/F,UAA8B,EAAE;QAEhC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,MAAM,QAAQ,GAAG,I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,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;CACF;AA71BD,kCA61BC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n CreateTableEntityResponse,\n DeleteTableEntityOptions,\n GetAccessPolicyResponse,\n GetTableEntityOptions,\n GetTableEntityResponse,\n ListTableEntitiesOptions,\n SignedIdentifier,\n TableServiceClientOptions as TableClientOptions,\n TableEntity,\n TableEntityQueryOptions,\n TableEntityResult,\n TableEntityResultPage,\n TableTransactionResponse,\n TransactionAction,\n UpdateMode,\n UpdateTableEntityOptions,\n} from \"./models.js\";\nimport type {\n DeleteTableEntityResponse,\n SetAccessPolicyResponse,\n UpdateEntityResponse,\n UpsertEntityResponse,\n} from \"./generatedModels.js\";\nimport type {\n FullOperationResponse,\n InternalClientPipelineOptions,\n OperationOptions,\n ServiceClient,\n ServiceClientOptions,\n} from \"@azure/core-client\";\nimport type { TableDeleteEntityOptionalParams } from \"./generated/index.js\";\nimport { GeneratedClient } from \"./generated/index.js\";\nimport type { NamedKeyCredential, SASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isNamedKeyCredential, isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { COSMOS_SCOPE, STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants.js\";\nimport { decodeContinuationToken, encodeContinuationToken } from \"./utils/continuationToken.js\";\nimport {\n deserialize,\n deserializeObjectsArray,\n deserializeSignedIdentifier,\n serialize,\n serializeQueryOptions,\n serializeSignedIdentifiers,\n} from \"./serialization.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\n\nimport { InternalTableTransaction } from \"./TableTransaction.js\";\nimport type { ListEntitiesResponse } from \"./utils/internalModels.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport type { Table } from \"./generated/operationsInterfaces/index.js\";\nimport type { TableQueryEntitiesOptionalParams } from \"./generated/models/index.js\";\nimport { Uuid } from \"./utils/uuid.js\";\nimport { apiVersionPolicy } from \"./utils/apiVersionPolicy.js\";\nimport { cosmosPatchPolicy } from \"./cosmosPathPolicy.js\";\nimport { escapeQuotes } from \"./odata.js\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString.js\";\nimport { handleTableAlreadyExists } from \"./utils/errorHelpers.js\";\nimport { isCosmosEndpoint } from \"./utils/isCosmosEndpoint.js\";\nimport { isCredential } from \"./utils/isCredential.js\";\nimport { logger } from \"./logger.js\";\nimport { setTokenChallengeAuthenticationPolicy } from \"./utils/challengeAuthenticationUtils.js\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy.js\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\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 generatedClient: ServiceClient;\n private credential?: NamedKeyCredential | SASCredential | TokenCredential;\n private clientOptions: TableClientOptions;\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 * ```ts snippet:ReadmeSampleCreateTableClient_NamedKeyCredential\n * import { AzureNamedKeyCredential, TableClient } from \"@azure/data-tables\";\n *\n * // Enter your storage account name and shared key\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * // Use AzureNamedKeyCredential with storage account and account key\n * // AzureNamedKeyCredential is only available in Node.js runtime, not in browsers\n * const credential = new AzureNamedKeyCredential(account, accountKey);\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\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 * ```ts snippet:ReadmeSampleCreateTableClient_SASToken\n * import { TableClient, AzureSASCredential } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sas = \"<service Shared Access Signature Token>\";\n * const tableName = \"<tableName>\";\n *\n * const clientWithSAS = new TableClient(\n * `https://${account}.table.core.windows.net`,\n * tableName,\n * new AzureSASCredential(sas),\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 * ```ts snippet:ReadmeSampleCreateTableClient_TokenCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const credential = new DefaultAzureCredential();\n * const account = \"<account name>\";\n * const tableName = \"<tableName>\";\n *\n * const clientWithAAD = 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 * ```ts snippet:ReadmeSampleCreateTableClient_SASTokenURL\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sasToken = \"<SAS token>\";\n * const tableName = \"<tableName>\";\n *\n * const clientWithSAS = 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 const isCosmos = isCosmosEndpoint(this.url);\n\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n this.credential = credential;\n\n this.clientOptions = (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n this.allowInsecureConnection = this.clientOptions.allowInsecureConnection ?? false;\n\n const internalPipelineOptions: ServiceClientOptions & InternalClientPipelineOptions = {\n ...this.clientOptions,\n endpoint: this.clientOptions.endpoint || this.url,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames],\n },\n deserializationOptions: {\n parseXML,\n },\n serializationOptions: {\n stringifyXML,\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 (isTokenCredential(credential)) {\n const scope = isCosmos ? COSMOS_SCOPE : STORAGE_SCOPE;\n setTokenChallengeAuthenticationPolicy(generatedClient.pipeline, credential, scope);\n }\n\n if (isCosmos) {\n generatedClient.pipeline.addPolicy(cosmosPatchPolicy());\n }\n\n if (options.version) {\n generatedClient.pipeline.addPolicy(apiVersionPolicy(options.version));\n }\n\n this.generatedClient = generatedClient;\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 * ```ts snippet:ReadmeSampleDeleteTable\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * await client.deleteTable();\n * ```\n */\n public deleteTable(options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\"TableClient.deleteTable\", options, async (updatedOptions) => {\n try {\n await this.table.delete(this.tableName, updatedOptions);\n } catch (e: any) {\n if (e.statusCode === 404) {\n logger.info(\"TableClient.deleteTable: Table doesn't exist\");\n } else {\n throw e;\n }\n }\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 * ```ts snippet:ReadmeSampleTableClientCreateTable\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * // If the table 'newTable' already exists, createTable doesn't throw\n * await client.createTable();\n * ```\n */\n public createTable(options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\"TableClient.createTable\", options, async (updatedOptions) => {\n try {\n await this.table.create({ name: this.tableName }, updatedOptions);\n } catch (e: any) {\n handleTableAlreadyExists(e, { ...updatedOptions, logger, tableName: this.tableName });\n }\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 * ```ts snippet:ReadmeSampleGetEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const entity = await client.getEntity(\"<partitionKey>\", \"<rowKey>\");\n * console.log(`Entity: PartitionKey: ${entity.partitionKey} RowKey: ${entity.rowKey}`);\n * ```\n */\n public 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 if (partitionKey === undefined || partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (rowKey === undefined || rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n return tracingClient.withSpan(\"TableClient.getEntity\", options, async (updatedOptions) => {\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 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 });\n }\n\n /**\n * Queries entities in a table.\n * @param options - The options parameters.\n *\n * Example listing entities\n * ```ts snippet:ReadmeSampleListEntities\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * let i = 0;\n * const entities = client.listEntities();\n * for await (const entity of entities) {\n * console.log(`Entity${++i}: PartitionKey: ${entity.partitionKey} RowKey: ${entity.rowKey}`);\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 let result = await tracingClient.withSpan(\n \"TableClient.listEntitiesPage\",\n options,\n (updatedOptions) => this._listEntities<T>(tableName, updatedOptions),\n );\n\n yield result;\n\n while (result.continuationToken) {\n const optionsWithContinuation: InternalListTableEntitiesOptions = {\n ...options,\n continuationToken: result.continuationToken,\n };\n\n result = await tracingClient.withSpan(\n \"TableClient.listEntitiesPage\",\n optionsWithContinuation,\n (updatedOptions, span) => {\n span.setAttribute(\"continuationToken\", result.continuationToken);\n return this._listEntities<T>(tableName, updatedOptions);\n },\n );\n yield result;\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 * ```ts snippet:ReadmeSampleCreateEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const testEntity = {\n * partitionKey: \"P1\",\n * rowKey: \"R1\",\n * foo: \"foo\",\n * bar: 123,\n * };\n * await client.createEntity(testEntity);\n * ```\n */\n public createEntity<T extends object>(\n entity: TableEntity<T>,\n options: OperationOptions = {},\n ): Promise<CreateTableEntityResponse> {\n return tracingClient.withSpan(\"TableClient.createEntity\", options, (updatedOptions) => {\n const { ...createTableEntity } = updatedOptions || {};\n return this.table.insertEntity(this.tableName, {\n ...createTableEntity,\n tableEntityProperties: serialize(entity),\n responsePreference: \"return-no-content\",\n });\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 * ```ts snippet:ReadmeSampleDeleteEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * // deleteEntity deletes the entity that matches exactly the partitionKey and rowKey\n * await client.deleteEntity(\"<partitionKey>\", \"<rowKey>\");\n * ```\n */\n public 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 if (partitionKey === undefined || partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (rowKey === undefined || rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n return tracingClient.withSpan(\"TableClient.deleteEntity\", options, (updatedOptions) => {\n const { etag = \"*\", ...rest } = updatedOptions;\n const deleteOptions: TableDeleteEntityOptionalParams = {\n ...rest,\n };\n return this.table.deleteEntity(\n this.tableName,\n escapeQuotes(partitionKey),\n escapeQuotes(rowKey),\n etag,\n deleteOptions,\n );\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 * ```ts snippet:ReadmeSampleUpdateEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\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 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 if (entity.partitionKey === undefined || entity.partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (entity.rowKey === undefined || entity.rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n return tracingClient.withSpan(\n \"TableClient.updateEntity\",\n options,\n async (updatedOptions) => {\n const partitionKey = escapeQuotes(entity.partitionKey);\n const rowKey = escapeQuotes(entity.rowKey);\n\n const { etag = \"*\", ...updateEntityOptions } = updatedOptions || {};\n if (mode === \"Merge\") {\n return this.table.mergeEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ifMatch: etag,\n ...updateEntityOptions,\n });\n }\n if (mode === \"Replace\") {\n return 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 },\n {\n spanAttributes: {\n updateEntityMode: mode,\n },\n },\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 * ```ts snippet:ReadmeSampleUpsertEntity\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\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 upsertEntity<T extends object>(\n entity: TableEntity<T>,\n mode: UpdateMode = \"Merge\",\n options: OperationOptions = {},\n ): Promise<UpsertEntityResponse> {\n return tracingClient.withSpan(\n \"TableClient.upsertEntity\",\n options,\n async (updatedOptions) => {\n if (entity.partitionKey === undefined || entity.partitionKey === null) {\n throw new Error(\"The entity's partitionKey cannot be undefined or null.\");\n }\n if (entity.rowKey === undefined || entity.rowKey === null) {\n throw new Error(\"The entity's rowKey cannot be undefined or null.\");\n }\n\n const partitionKey = escapeQuotes(entity.partitionKey);\n const rowKey = escapeQuotes(entity.rowKey);\n\n if (mode === \"Merge\") {\n return this.table.mergeEntity(this.tableName, partitionKey, rowKey, {\n tableEntityProperties: serialize(entity),\n ...updatedOptions,\n });\n }\n\n if (mode === \"Replace\") {\n return 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 },\n {\n spanAttributes: {\n upsertEntityMode: mode,\n },\n },\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 getAccessPolicy(options: OperationOptions = {}): Promise<GetAccessPolicyResponse> {\n return tracingClient.withSpan(\n \"TableClient.getAccessPolicy\",\n options,\n async (updatedOptions) => {\n const signedIdentifiers = await this.table.getAccessPolicy(this.tableName, updatedOptions);\n return deserializeSignedIdentifier(signedIdentifiers);\n },\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 setAccessPolicy(\n tableAcl: SignedIdentifier[],\n options: OperationOptions = {},\n ): Promise<SetAccessPolicyResponse> {\n return tracingClient.withSpan(\"TableClient.setAccessPolicy\", options, (updatedOptions) => {\n const serlializedAcl = serializeSignedIdentifiers(tableAcl);\n return this.table.setAccessPolicy(this.tableName, {\n ...updatedOptions,\n tableAcl: serlializedAcl,\n });\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 * ```ts snippet:ReadmeSampleSubmitTransaction\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient, TransactionAction } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const actions: TransactionAction[] = [\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 * ```ts snippet:ReadmeSampleSubmitTransactionWithTableTransaction\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableClient, TableTransaction } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n * const tableName = \"<tableName>\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);\n *\n * const transaction = new TableTransaction();\n *\n * // Call the available action in the TableTransaction object\n * transaction.createEntity({ partitionKey: \"p1\", rowKey: \"1\", data: \"test1\" });\n * transaction.deleteEntity(\"p1\", \"2\");\n * transaction.updateEntity({ partitionKey: \"p1\", rowKey: \"3\", data: \"newTest\" }, \"Merge\");\n *\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 * @param options - Options for the request.\n */\n public async submitTransaction(\n actions: TransactionAction[],\n\n options: OperationOptions = {},\n ): Promise<TableTransactionResponse> {\n const partitionKey = actions[0][1].partitionKey;\n const transactionId = Uuid.generateUuid();\n const changesetId = Uuid.generateUuid();\n\n // Add pipeline\n const transactionClient = new InternalTableTransaction(\n this.url,\n partitionKey,\n transactionId,\n changesetId,\n this.generatedClient,\n new TableClient(this.url, this.tableName),\n this.credential,\n this.allowInsecureConnection,\n );\n\n for (const item of actions) {\n const [action, entity, updateMode = \"Merge\", updateOptions] = item;\n switch (action) {\n case \"create\":\n transactionClient.createEntity(entity);\n break;\n case \"delete\":\n transactionClient.deleteEntity(entity.partitionKey, entity.rowKey);\n break;\n case \"update\":\n transactionClient.updateEntity(entity, updateMode, updateOptions);\n break;\n case \"upsert\":\n transactionClient.upsertEntity(entity, updateMode);\n }\n }\n\n return transactionClient.submitTransaction(options);\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 {\n url,\n options: clientOptions,\n credential,\n } = getClientParamsFromConnectionString(connectionString, options);\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"]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.TableServiceClient = void 0;
|
|
6
|
-
const tslib_1 = require("tslib");
|
|
7
6
|
const core_auth_1 = require("@azure/core-auth");
|
|
8
7
|
const constants_js_1 = require("./utils/constants.js");
|
|
9
8
|
const secondaryEndpointPolicy_js_1 = require("./secondaryEndpointPolicy.js");
|
|
@@ -24,19 +23,36 @@ const isCosmosEndpoint_js_1 = require("./utils/isCosmosEndpoint.js");
|
|
|
24
23
|
* to perform operations on the tables and the entities.
|
|
25
24
|
*/
|
|
26
25
|
class TableServiceClient {
|
|
26
|
+
/**
|
|
27
|
+
* Table Account URL
|
|
28
|
+
*/
|
|
29
|
+
url;
|
|
30
|
+
/**
|
|
31
|
+
* Represents a pipeline for making a HTTP request to a URL.
|
|
32
|
+
* Pipelines can have multiple policies to manage manipulating each request before and after it is made to the server.
|
|
33
|
+
*/
|
|
34
|
+
pipeline;
|
|
35
|
+
table;
|
|
36
|
+
service;
|
|
27
37
|
constructor(url, credentialOrOptions, options) {
|
|
28
38
|
this.url = url;
|
|
29
39
|
const isCosmos = (0, isCosmosEndpoint_js_1.isCosmosEndpoint)(this.url);
|
|
30
40
|
const credential = (0, isCredential_js_1.isCredential)(credentialOrOptions) ? credentialOrOptions : undefined;
|
|
31
41
|
const clientOptions = (!(0, isCredential_js_1.isCredential)(credentialOrOptions) ? credentialOrOptions : options) || {};
|
|
32
|
-
const internalPipelineOptions =
|
|
42
|
+
const internalPipelineOptions = {
|
|
43
|
+
...clientOptions,
|
|
44
|
+
endpoint: clientOptions.endpoint || this.url,
|
|
45
|
+
loggingOptions: {
|
|
33
46
|
logger: logger_js_1.logger.info,
|
|
34
47
|
additionalAllowedHeaderNames: [...constants_js_1.TablesLoggingAllowedHeaderNames],
|
|
35
|
-
},
|
|
48
|
+
},
|
|
49
|
+
deserializationOptions: {
|
|
36
50
|
parseXML: core_xml_1.parseXML,
|
|
37
|
-
},
|
|
51
|
+
},
|
|
52
|
+
serializationOptions: {
|
|
38
53
|
stringifyXML: core_xml_1.stringifyXML,
|
|
39
|
-
}
|
|
54
|
+
},
|
|
55
|
+
};
|
|
40
56
|
const client = new generatedClient_js_1.GeneratedClient(this.url, internalPipelineOptions);
|
|
41
57
|
client.pipeline.addPolicy(secondaryEndpointPolicy_js_1.tablesSecondaryEndpointPolicy);
|
|
42
58
|
if ((0, core_auth_1.isNamedKeyCredential)(credential)) {
|
|
@@ -49,7 +65,7 @@ class TableServiceClient {
|
|
|
49
65
|
const scope = isCosmos ? constants_js_1.COSMOS_SCOPE : constants_js_1.STORAGE_SCOPE;
|
|
50
66
|
(0, challengeAuthenticationUtils_js_1.setTokenChallengeAuthenticationPolicy)(client.pipeline, credential, scope);
|
|
51
67
|
}
|
|
52
|
-
if (options
|
|
68
|
+
if (options?.version) {
|
|
53
69
|
client.pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options.version));
|
|
54
70
|
}
|
|
55
71
|
this.pipeline = client.pipeline;
|
|
@@ -92,7 +108,7 @@ class TableServiceClient {
|
|
|
92
108
|
await this.table.create({ name }, updatedOptions);
|
|
93
109
|
}
|
|
94
110
|
catch (e) {
|
|
95
|
-
(0, errorHelpers_js_1.handleTableAlreadyExists)(e,
|
|
111
|
+
(0, errorHelpers_js_1.handleTableAlreadyExists)(e, { ...updatedOptions, logger: logger_js_1.logger, tableName: name });
|
|
96
112
|
}
|
|
97
113
|
});
|
|
98
114
|
}
|
|
@@ -132,57 +148,52 @@ class TableServiceClient {
|
|
|
132
148
|
return this;
|
|
133
149
|
},
|
|
134
150
|
byPage: (settings) => {
|
|
135
|
-
const pageOptions =
|
|
136
|
-
|
|
151
|
+
const pageOptions = {
|
|
152
|
+
...options,
|
|
153
|
+
queryOptions: { ...options?.queryOptions, top: settings?.maxPageSize },
|
|
154
|
+
};
|
|
155
|
+
if (settings?.continuationToken) {
|
|
137
156
|
pageOptions.continuationToken = settings.continuationToken;
|
|
138
157
|
}
|
|
139
158
|
return this.listTablesPage(pageOptions);
|
|
140
159
|
},
|
|
141
160
|
};
|
|
142
161
|
}
|
|
143
|
-
listTablesAll(options) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
_d = false;
|
|
155
|
-
const page = _c;
|
|
156
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
160
|
-
finally {
|
|
161
|
-
try {
|
|
162
|
-
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
163
|
-
}
|
|
164
|
-
finally { if (e_1) throw e_1.error; }
|
|
165
|
-
}
|
|
162
|
+
async *listTablesAll(options) {
|
|
163
|
+
const firstPage = await this._listTables(options);
|
|
164
|
+
const { continuationToken } = firstPage;
|
|
165
|
+
yield* firstPage;
|
|
166
|
+
if (continuationToken) {
|
|
167
|
+
const optionsWithContinuation = {
|
|
168
|
+
...options,
|
|
169
|
+
continuationToken,
|
|
170
|
+
};
|
|
171
|
+
for await (const page of this.listTablesPage(optionsWithContinuation)) {
|
|
172
|
+
yield* page;
|
|
166
173
|
}
|
|
167
|
-
}
|
|
174
|
+
}
|
|
168
175
|
}
|
|
169
|
-
listTablesPage() {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
result
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
|
|
176
|
+
async *listTablesPage(options = {}) {
|
|
177
|
+
let result = await tracing_js_1.tracingClient.withSpan("TableServiceClient.listTablesPage", options, (updatedOptions) => this._listTables(updatedOptions));
|
|
178
|
+
yield result;
|
|
179
|
+
while (result.continuationToken) {
|
|
180
|
+
const optionsWithContinuation = {
|
|
181
|
+
...options,
|
|
182
|
+
continuationToken: result.continuationToken,
|
|
183
|
+
};
|
|
184
|
+
result = await tracing_js_1.tracingClient.withSpan("TableServiceClient.listTablesPage", optionsWithContinuation, async (updatedOptions, span) => {
|
|
185
|
+
span.setAttribute("continuationToken", updatedOptions.continuationToken);
|
|
186
|
+
return this._listTables(updatedOptions);
|
|
187
|
+
});
|
|
188
|
+
yield result;
|
|
189
|
+
}
|
|
182
190
|
}
|
|
183
191
|
async _listTables(options = {}) {
|
|
184
|
-
const { continuationToken: nextTableName
|
|
185
|
-
const { xMsContinuationNextTableName: continuationToken, value = [] } = await this.table.query(
|
|
192
|
+
const { continuationToken: nextTableName, ...listOptions } = options;
|
|
193
|
+
const { xMsContinuationNextTableName: continuationToken, value = [] } = await this.table.query({
|
|
194
|
+
...listOptions,
|
|
195
|
+
nextTableName,
|
|
196
|
+
});
|
|
186
197
|
return Object.assign([...value], { continuationToken });
|
|
187
198
|
}
|
|
188
199
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableServiceClient.js","sourceRoot":"","sources":["../../src/TableServiceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAqBlC,gDAA4F;AAC5F,uDAAoG;AAEpG,6EAGsC;AACtC,8CAAyD;AAEzD,uEAAiE;AAIjE,qEAA+D;AAC/D,qEAAkF;AAClF,6DAAmE;AACnE,6DAAuD;AACvD,2CAAqC;AACrC,6FAAgG;AAChG,qFAAkF;AAClF,uEAAiE;AACjE,mDAAmD;AACnD,qEAA+D;AAE/D;;;GAGG;AACH,MAAa,kBAAkB;IAuG7B,YACE,GAAW,EACX,mBAI6B,EAC7B,OAAmC;QAEnC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,MAAM,QAAQ,GAAG,IAAA,sCAAgB,EAAC,IAAI,CAAC,G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B,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACF;AA9VD,gDA8VC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetPropertiesResponse,\n GetStatisticsResponse,\n ServiceProperties,\n SetPropertiesOptions,\n SetPropertiesResponse,\n} from \"./generatedModels.js\";\nimport type {\n InternalClientPipelineOptions,\n OperationOptions,\n ServiceClientOptions,\n} from \"@azure/core-client\";\nimport type {\n ListTableItemsOptions,\n TableItem,\n TableQueryOptions,\n TableServiceClientOptions,\n} from \"./models.js\";\nimport type { NamedKeyCredential, SASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isNamedKeyCredential, isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { COSMOS_SCOPE, STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants.js\";\nimport type { Service, Table } from \"./generated/index.js\";\nimport {\n injectSecondaryEndpointHeader,\n tablesSecondaryEndpointPolicy,\n} from \"./secondaryEndpointPolicy.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\n\nimport { GeneratedClient } from \"./generated/generatedClient.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport type { TableItemResultPage } from \"./models.js\";\nimport { apiVersionPolicy } from \"./utils/apiVersionPolicy.js\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString.js\";\nimport { handleTableAlreadyExists } from \"./utils/errorHelpers.js\";\nimport { isCredential } from \"./utils/isCredential.js\";\nimport { logger } from \"./logger.js\";\nimport { setTokenChallengeAuthenticationPolicy } from \"./utils/challengeAuthenticationUtils.js\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy.js\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport { isCosmosEndpoint } from \"./utils/isCosmosEndpoint.js\";\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 * ```ts snippet:ReadmeSampleCreateClient_NamedKeyCredential\n * import { AzureNamedKeyCredential, TableServiceClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new AzureNamedKeyCredential(account, accountKey);\n * const serviceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * credential,\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 * ```ts snippet:ReadmeSampleCreateClient_SASToken\n * import { TableServiceClient, AzureSASCredential } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sas = \"<service Shared Access Signature Token>\";\n *\n * const serviceClientWithSAS = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * new AzureSASCredential(sas),\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 * ```ts snippet:ReadmeSampleCreateClient_TokenCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableServiceClient } from \"@azure/data-tables\";\n *\n * const credential = new DefaultAzureCredential();\n * const account = \"<account name>\";\n *\n * const clientWithAAD = 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 * ```ts snippet:ReadmeSampleCreateClient_SASTokenURL\n * import { TableServiceClient } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sasToken = \"<SAS token>\";\n * const tableName = \"<tableName>\";\n *\n * const serviceClientWithSASURL = 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 isCosmos = isCosmosEndpoint(this.url);\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n const clientOptions =\n (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n const internalPipelineOptions: ServiceClientOptions & InternalClientPipelineOptions = {\n ...clientOptions,\n endpoint: clientOptions.endpoint || this.url,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames],\n },\n deserializationOptions: {\n parseXML,\n },\n serializationOptions: {\n stringifyXML,\n },\n };\n const client = new GeneratedClient(this.url, internalPipelineOptions);\n client.pipeline.addPolicy(tablesSecondaryEndpointPolicy);\n\n if (isNamedKeyCredential(credential)) {\n client.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));\n } else if (isSASCredential(credential)) {\n client.pipeline.addPolicy(tablesSASTokenPolicy(credential));\n }\n\n if (isTokenCredential(credential)) {\n const scope = isCosmos ? COSMOS_SCOPE : STORAGE_SCOPE;\n setTokenChallengeAuthenticationPolicy(client.pipeline, credential, scope);\n }\n\n if (options?.version) {\n client.pipeline.addPolicy(apiVersionPolicy(options.version));\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 return tracingClient.withSpan(\"TableServiceClient.getStatistics\", options, (updatedOptions) =>\n this.service.getStatistics(injectSecondaryEndpointHeader(updatedOptions)),\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 getProperties(options: OperationOptions = {}): Promise<GetPropertiesResponse> {\n return tracingClient.withSpan(\"TableServiceClient.getProperties\", options, (updatedOptions) =>\n this.service.getProperties(updatedOptions),\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 setProperties(\n properties: ServiceProperties,\n options: SetPropertiesOptions = {},\n ): Promise<SetPropertiesResponse> {\n return tracingClient.withSpan(\"TableServiceClient.setProperties\", options, (updatedOptions) =>\n this.service.setProperties(properties, updatedOptions),\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 createTable(name: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"TableServiceClient.createTable\",\n options,\n async (updatedOptions) => {\n try {\n await this.table.create({ name }, updatedOptions);\n } catch (e: any) {\n handleTableAlreadyExists(e, { ...updatedOptions, logger, tableName: name });\n }\n },\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 deleteTable(name: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"TableServiceClient.deleteTable\",\n options,\n async (updatedOptions) => {\n try {\n await this.table.delete(name, updatedOptions);\n } catch (e: any) {\n if (e.statusCode === 404) {\n logger.info(\"TableServiceClient.deleteTable: Table doesn't exist\");\n } else {\n throw e;\n }\n }\n },\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: { ...options?.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 let result = await tracingClient.withSpan(\n \"TableServiceClient.listTablesPage\",\n options,\n (updatedOptions) => this._listTables(updatedOptions),\n );\n\n yield result;\n\n while (result.continuationToken) {\n const optionsWithContinuation: InternalListTablesOptions = {\n ...options,\n continuationToken: result.continuationToken,\n };\n result = await tracingClient.withSpan(\n \"TableServiceClient.listTablesPage\",\n optionsWithContinuation,\n async (updatedOptions, span) => {\n span.setAttribute(\"continuationToken\", updatedOptions.continuationToken);\n return this._listTables(updatedOptions);\n },\n );\n yield result;\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 {\n url,\n options: clientOptions,\n credential,\n } = getClientParamsFromConnectionString(connectionString, options);\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"]}
|
|
1
|
+
{"version":3,"file":"TableServiceClient.js","sourceRoot":"","sources":["../../src/TableServiceClient.ts"],"names":[],"mappings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AAM,CAAC,oBAAoB,CAChC,gBAAwB;IACxB,8DAA8D;IAC9D,OAAmC;QAEnC,MAAM,EACJ,GAAG,EACH,OAAO,EAAE,aAAa,EACtB,UAAU,GACX,GAAG,IAAA,yDAAmC,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QAEnE,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,IAAI,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,kBAAkB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACF;AA9VD,gDA8VC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetPropertiesResponse,\n GetStatisticsResponse,\n ServiceProperties,\n SetPropertiesOptions,\n SetPropertiesResponse,\n} from \"./generatedModels.js\";\nimport type {\n InternalClientPipelineOptions,\n OperationOptions,\n ServiceClientOptions,\n} from \"@azure/core-client\";\nimport type {\n ListTableItemsOptions,\n TableItem,\n TableQueryOptions,\n TableServiceClientOptions,\n} from \"./models.js\";\nimport type { NamedKeyCredential, SASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isNamedKeyCredential, isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { COSMOS_SCOPE, STORAGE_SCOPE, TablesLoggingAllowedHeaderNames } from \"./utils/constants.js\";\nimport type { Service, Table } from \"./generated/index.js\";\nimport {\n injectSecondaryEndpointHeader,\n tablesSecondaryEndpointPolicy,\n} from \"./secondaryEndpointPolicy.js\";\nimport { parseXML, stringifyXML } from \"@azure/core-xml\";\n\nimport { GeneratedClient } from \"./generated/generatedClient.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport type { TableItemResultPage } from \"./models.js\";\nimport { apiVersionPolicy } from \"./utils/apiVersionPolicy.js\";\nimport { getClientParamsFromConnectionString } from \"./utils/connectionString.js\";\nimport { handleTableAlreadyExists } from \"./utils/errorHelpers.js\";\nimport { isCredential } from \"./utils/isCredential.js\";\nimport { logger } from \"./logger.js\";\nimport { setTokenChallengeAuthenticationPolicy } from \"./utils/challengeAuthenticationUtils.js\";\nimport { tablesNamedKeyCredentialPolicy } from \"./tablesNamedCredentialPolicy.js\";\nimport { tablesSASTokenPolicy } from \"./tablesSASTokenPolicy.js\";\nimport { tracingClient } from \"./utils/tracing.js\";\nimport { isCosmosEndpoint } from \"./utils/isCosmosEndpoint.js\";\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 * ```ts snippet:ReadmeSampleCreateClient_NamedKeyCredential\n * import { AzureNamedKeyCredential, TableServiceClient } from \"@azure/data-tables\";\n *\n * const account = \"<account>\";\n * const accountKey = \"<accountkey>\";\n *\n * const credential = new AzureNamedKeyCredential(account, accountKey);\n * const serviceClient = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * credential,\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 * ```ts snippet:ReadmeSampleCreateClient_SASToken\n * import { TableServiceClient, AzureSASCredential } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sas = \"<service Shared Access Signature Token>\";\n *\n * const serviceClientWithSAS = new TableServiceClient(\n * `https://${account}.table.core.windows.net`,\n * new AzureSASCredential(sas),\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 * ```ts snippet:ReadmeSampleCreateClient_TokenCredential\n * import { DefaultAzureCredential } from \"@azure/identity\";\n * import { TableServiceClient } from \"@azure/data-tables\";\n *\n * const credential = new DefaultAzureCredential();\n * const account = \"<account name>\";\n *\n * const clientWithAAD = 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 * ```ts snippet:ReadmeSampleCreateClient_SASTokenURL\n * import { TableServiceClient } from \"@azure/data-tables\";\n *\n * const account = \"<account name>\";\n * const sasToken = \"<SAS token>\";\n * const tableName = \"<tableName>\";\n *\n * const serviceClientWithSASURL = 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 isCosmos = isCosmosEndpoint(this.url);\n const credential = isCredential(credentialOrOptions) ? credentialOrOptions : undefined;\n const clientOptions =\n (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};\n\n const internalPipelineOptions: ServiceClientOptions & InternalClientPipelineOptions = {\n ...clientOptions,\n endpoint: clientOptions.endpoint || this.url,\n loggingOptions: {\n logger: logger.info,\n additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames],\n },\n deserializationOptions: {\n parseXML,\n },\n serializationOptions: {\n stringifyXML,\n },\n };\n const client = new GeneratedClient(this.url, internalPipelineOptions);\n client.pipeline.addPolicy(tablesSecondaryEndpointPolicy);\n\n if (isNamedKeyCredential(credential)) {\n client.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));\n } else if (isSASCredential(credential)) {\n client.pipeline.addPolicy(tablesSASTokenPolicy(credential));\n }\n\n if (isTokenCredential(credential)) {\n const scope = isCosmos ? COSMOS_SCOPE : STORAGE_SCOPE;\n setTokenChallengeAuthenticationPolicy(client.pipeline, credential, scope);\n }\n\n if (options?.version) {\n client.pipeline.addPolicy(apiVersionPolicy(options.version));\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 return tracingClient.withSpan(\"TableServiceClient.getStatistics\", options, (updatedOptions) =>\n this.service.getStatistics(injectSecondaryEndpointHeader(updatedOptions)),\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 getProperties(options: OperationOptions = {}): Promise<GetPropertiesResponse> {\n return tracingClient.withSpan(\"TableServiceClient.getProperties\", options, (updatedOptions) =>\n this.service.getProperties(updatedOptions),\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 setProperties(\n properties: ServiceProperties,\n options: SetPropertiesOptions = {},\n ): Promise<SetPropertiesResponse> {\n return tracingClient.withSpan(\"TableServiceClient.setProperties\", options, (updatedOptions) =>\n this.service.setProperties(properties, updatedOptions),\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 createTable(name: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"TableServiceClient.createTable\",\n options,\n async (updatedOptions) => {\n try {\n await this.table.create({ name }, updatedOptions);\n } catch (e: any) {\n handleTableAlreadyExists(e, { ...updatedOptions, logger, tableName: name });\n }\n },\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 deleteTable(name: string, options: OperationOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"TableServiceClient.deleteTable\",\n options,\n async (updatedOptions) => {\n try {\n await this.table.delete(name, updatedOptions);\n } catch (e: any) {\n if (e.statusCode === 404) {\n logger.info(\"TableServiceClient.deleteTable: Table doesn't exist\");\n } else {\n throw e;\n }\n }\n },\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: { ...options?.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 let result = await tracingClient.withSpan(\n \"TableServiceClient.listTablesPage\",\n options,\n (updatedOptions) => this._listTables(updatedOptions),\n );\n\n yield result;\n\n while (result.continuationToken) {\n const optionsWithContinuation: InternalListTablesOptions = {\n ...options,\n continuationToken: result.continuationToken,\n };\n result = await tracingClient.withSpan(\n \"TableServiceClient.listTablesPage\",\n optionsWithContinuation,\n async (updatedOptions, span) => {\n span.setAttribute(\"continuationToken\", updatedOptions.continuationToken);\n return this._listTables(updatedOptions);\n },\n );\n yield result;\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 {\n url,\n options: clientOptions,\n credential,\n } = getClientParamsFromConnectionString(connectionString, options);\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"]}
|
|
@@ -17,8 +17,12 @@ const tracing_js_1 = require("./utils/tracing.js");
|
|
|
17
17
|
* Helper to build a list of transaction actions
|
|
18
18
|
*/
|
|
19
19
|
class TableTransaction {
|
|
20
|
+
/**
|
|
21
|
+
* List of actions to perform in a transaction
|
|
22
|
+
*/
|
|
23
|
+
actions;
|
|
20
24
|
constructor(actions) {
|
|
21
|
-
this.actions = actions
|
|
25
|
+
this.actions = actions ?? [];
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* Adds a create action to the transaction
|
|
@@ -45,7 +49,7 @@ class TableTransaction {
|
|
|
45
49
|
// UpdateMode is a string union
|
|
46
50
|
const realUpdateMode = typeof updateModeOrOptions === "string" ? updateModeOrOptions : undefined;
|
|
47
51
|
const realUpdateOptions = typeof updateModeOrOptions === "object" ? updateModeOrOptions : updateOptions;
|
|
48
|
-
this.actions.push(["update", entity, realUpdateMode
|
|
52
|
+
this.actions.push(["update", entity, realUpdateMode ?? "Merge", realUpdateOptions ?? {}]);
|
|
49
53
|
}
|
|
50
54
|
/**
|
|
51
55
|
* Adds an upsert action to the transaction, which inserts if the entity doesn't exist or updates the existing one
|
|
@@ -61,6 +65,17 @@ exports.TableTransaction = TableTransaction;
|
|
|
61
65
|
* TableTransaction collects sub-operations that can be submitted together via submitTransaction
|
|
62
66
|
*/
|
|
63
67
|
class InternalTableTransaction {
|
|
68
|
+
/**
|
|
69
|
+
* Table Account URL
|
|
70
|
+
*/
|
|
71
|
+
url;
|
|
72
|
+
/**
|
|
73
|
+
* State that holds the information about a particular transation
|
|
74
|
+
*/
|
|
75
|
+
state;
|
|
76
|
+
interceptClient;
|
|
77
|
+
allowInsecureConnection;
|
|
78
|
+
client;
|
|
64
79
|
/**
|
|
65
80
|
* @param url - Tables account url
|
|
66
81
|
* @param partitionKey - partition key
|
|
@@ -160,7 +175,14 @@ class InternalTableTransaction {
|
|
|
160
175
|
const body = (0, transactionHelpers_js_1.getTransactionHttpRequestBody)(this.state.bodyParts, this.state.transactionId, this.state.changesetId);
|
|
161
176
|
const headers = (0, transactionHeaders_js_1.getTransactionHeaders)(this.state.transactionId);
|
|
162
177
|
return tracing_js_1.tracingClient.withSpan("TableTransaction.submitTransaction", options, async (updatedOptions) => {
|
|
163
|
-
const request = (0, core_rest_pipeline_1.createPipelineRequest)(
|
|
178
|
+
const request = (0, core_rest_pipeline_1.createPipelineRequest)({
|
|
179
|
+
...updatedOptions,
|
|
180
|
+
url: this.url,
|
|
181
|
+
method: "POST",
|
|
182
|
+
body,
|
|
183
|
+
headers: (0, core_rest_pipeline_1.createHttpHeaders)(headers),
|
|
184
|
+
allowInsecureConnection: this.allowInsecureConnection,
|
|
185
|
+
});
|
|
164
186
|
const rawTransactionResponse = await this.client.sendRequest(request);
|
|
165
187
|
return parseTransactionResponse(rawTransactionResponse);
|
|
166
188
|
});
|
|
@@ -189,7 +211,7 @@ function parseTransactionResponse(transactionResponse) {
|
|
|
189
211
|
const subResponses = splitBody.slice(1, splitBody.length - 1);
|
|
190
212
|
const responses = subResponses.map((subResponse) => {
|
|
191
213
|
const statusMatch = subResponse.match(/HTTP\/1.1 ([0-9]*)/);
|
|
192
|
-
if (
|
|
214
|
+
if (statusMatch?.length !== 2) {
|
|
193
215
|
throw new Error(`Couldn't extract status from sub-response:\n ${subResponse}`);
|
|
194
216
|
}
|
|
195
217
|
const subResponseStatus = Number.parseInt(statusMatch[1]);
|
|
@@ -197,12 +219,16 @@ function parseTransactionResponse(transactionResponse) {
|
|
|
197
219
|
throw new Error(`Expected sub-response status to be an integer ${subResponseStatus}`);
|
|
198
220
|
}
|
|
199
221
|
const bodyMatch = subResponse.match(/\{(.*)\}/);
|
|
200
|
-
if (
|
|
222
|
+
if (bodyMatch?.length === 2) {
|
|
201
223
|
handleBodyError(bodyMatch[0], subResponseStatus, transactionResponse.request, transactionResponse);
|
|
202
224
|
}
|
|
203
225
|
const etagMatch = subResponse.match(/ETag: (.*)/);
|
|
204
226
|
const rowKeyMatch = subResponse.match(/RowKey='(.*)'/);
|
|
205
|
-
return
|
|
227
|
+
return {
|
|
228
|
+
status: subResponseStatus,
|
|
229
|
+
...(rowKeyMatch?.length === 2 && { rowKey: rowKeyMatch[1] }),
|
|
230
|
+
...(etagMatch?.length === 2 && { etag: etagMatch[1] }),
|
|
231
|
+
};
|
|
206
232
|
});
|
|
207
233
|
return {
|
|
208
234
|
status,
|
|
@@ -211,12 +237,11 @@ function parseTransactionResponse(transactionResponse) {
|
|
|
211
237
|
};
|
|
212
238
|
}
|
|
213
239
|
function handleBodyError(bodyAsText, statusCode, request, response) {
|
|
214
|
-
var _a, _b;
|
|
215
240
|
let parsedError;
|
|
216
241
|
try {
|
|
217
242
|
parsedError = JSON.parse(bodyAsText);
|
|
218
243
|
}
|
|
219
|
-
catch
|
|
244
|
+
catch {
|
|
220
245
|
parsedError = {};
|
|
221
246
|
}
|
|
222
247
|
let message = "Transaction Failed";
|
|
@@ -224,7 +249,7 @@ function handleBodyError(bodyAsText, statusCode, request, response) {
|
|
|
224
249
|
// Only transaction sub-responses return body
|
|
225
250
|
if (parsedError && parsedError["odata.error"]) {
|
|
226
251
|
const error = parsedError["odata.error"];
|
|
227
|
-
message =
|
|
252
|
+
message = error.message?.value ?? message;
|
|
228
253
|
code = error.code;
|
|
229
254
|
}
|
|
230
255
|
throw new core_rest_pipeline_1.RestError(message, {
|