@azure/data-tables 13.3.1-alpha.20250402.1 → 13.3.1-alpha.20250407.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/README.md +15 -18
- package/dist/browser/TableClient.d.ts +30 -24
- package/dist/browser/TableClient.d.ts.map +1 -1
- package/dist/browser/TableClient.js +30 -20
- package/dist/browser/TableClient.js.map +1 -1
- package/dist/browser/TableServiceClient.d.ts +0 -4
- package/dist/browser/TableServiceClient.d.ts.map +1 -1
- package/dist/browser/TableServiceClient.js.map +1 -1
- package/dist/commonjs/TableClient.d.ts +30 -24
- package/dist/commonjs/TableClient.d.ts.map +1 -1
- package/dist/commonjs/TableClient.js +30 -20
- package/dist/commonjs/TableClient.js.map +1 -1
- package/dist/commonjs/TableServiceClient.d.ts +0 -4
- package/dist/commonjs/TableServiceClient.d.ts.map +1 -1
- package/dist/commonjs/TableServiceClient.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/TableClient.d.ts +30 -24
- package/dist/esm/TableClient.d.ts.map +1 -1
- package/dist/esm/TableClient.js +30 -20
- package/dist/esm/TableClient.js.map +1 -1
- package/dist/esm/TableServiceClient.d.ts +0 -4
- package/dist/esm/TableServiceClient.d.ts.map +1 -1
- package/dist/esm/TableServiceClient.js.map +1 -1
- package/dist/react-native/TableClient.d.ts +30 -24
- package/dist/react-native/TableClient.d.ts.map +1 -1
- package/dist/react-native/TableClient.js +30 -20
- package/dist/react-native/TableClient.js.map +1 -1
- package/dist/react-native/TableServiceClient.d.ts +0 -4
- package/dist/react-native/TableServiceClient.d.ts.map +1 -1
- package/dist/react-native/TableServiceClient.js.map +1 -1
- package/package.json +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableServiceClient.js","sourceRoot":"","sources":["../../src/TableServiceClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAqBlC,OAAO,EAAE,oBAAoB,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cAAc,CAAC,CAAC;gBAC1C,CAAC,CACF,CAAA,CAAC;gBACF,oBAAM,MAAM,CAAA,CAAC;YACf,CAAC;QACH,CAAC;KAAA;IAEO,KAAK,CAAC,WAAW,CAAC,UAAqC,EAAE;QAC/D,MAAM,EAAE,iBAAiB,EAAE,aAAa,KAAqB,OAAO,EAAvB,WAAW,UAAK,OAAO,EAA9D,qBAAoD,CAAU,CAAC;QACrE,MAAM,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,iCACzF,WAAW,KACd,aAAa,IACb,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB;IACxB,8DAA8D;IAC9D,OAAmC;QAEnC,MAAM,EACJ,GAAG,EACH,OAAO,EAAE,aAAa,EACtB,UAAU,GACX,GAAG,mCAAmC,CAAC,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","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 * // DefaultAzureCredential expects the following three environment variables:\n * // - AZURE_TENANT_ID: The tenant ID in Azure Active Directory\n * // - AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant\n * // - AZURE_CLIENT_SECRET: The client secret for the registered application\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":"AAAA,uCAAuC;AACvC,kCAAkC;;AAqBlC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAEpG,OAAO,EACL,6BAA6B,EA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AAM,EAAE,iBAAiB,EAAE,aAAa,KAAqB,OAAO,EAAvB,WAAW,UAAK,OAAO,EAA9D,qBAAoD,CAAU,CAAC;QACrE,MAAM,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,iCACzF,WAAW,KACd,aAAa,IACb,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,oBAAoB,CAChC,gBAAwB;IACxB,8DAA8D;IAC9D,OAAmC;QAEnC,MAAM,EACJ,GAAG,EACH,OAAO,EAAE,aAAa,EACtB,UAAU,GACX,GAAG,mCAAmC,CAAC,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","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"]}
|
|
@@ -94,10 +94,6 @@ export declare class TableClient {
|
|
|
94
94
|
* import { DefaultAzureCredential } from "@azure/identity";
|
|
95
95
|
* import { TableClient } from "@azure/data-tables";
|
|
96
96
|
*
|
|
97
|
-
* // DefaultAzureCredential expects the following three environment variables:
|
|
98
|
-
* // - AZURE_TENANT_ID: The tenant ID in Azure Active Directory
|
|
99
|
-
* // - AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant
|
|
100
|
-
* // - AZURE_CLIENT_SECRET: The client secret for the registered application
|
|
101
97
|
* const credential = new DefaultAzureCredential();
|
|
102
98
|
* const account = "<account name>";
|
|
103
99
|
* const tableName = "<tableName>";
|
|
@@ -141,13 +137,14 @@ export declare class TableClient {
|
|
|
141
137
|
*
|
|
142
138
|
* ### Example deleting a table
|
|
143
139
|
* ```ts snippet:ReadmeSampleDeleteTable
|
|
144
|
-
* import {
|
|
140
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
141
|
+
* import { TableClient } from "@azure/data-tables";
|
|
145
142
|
*
|
|
146
143
|
* const account = "<account>";
|
|
147
144
|
* const accountKey = "<accountkey>";
|
|
148
145
|
* const tableName = "<tableName>";
|
|
149
146
|
*
|
|
150
|
-
* const credential = new
|
|
147
|
+
* const credential = new DefaultAzureCredential();
|
|
151
148
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
152
149
|
*
|
|
153
150
|
* await client.deleteTable();
|
|
@@ -160,13 +157,14 @@ export declare class TableClient {
|
|
|
160
157
|
*
|
|
161
158
|
* ### Example creating a table
|
|
162
159
|
* ```ts snippet:ReadmeSampleTableClientCreateTable
|
|
163
|
-
* import {
|
|
160
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
161
|
+
* import { TableClient } from "@azure/data-tables";
|
|
164
162
|
*
|
|
165
163
|
* const account = "<account>";
|
|
166
164
|
* const accountKey = "<accountkey>";
|
|
167
165
|
* const tableName = "<tableName>";
|
|
168
166
|
*
|
|
169
|
-
* const credential = new
|
|
167
|
+
* const credential = new DefaultAzureCredential();
|
|
170
168
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
171
169
|
*
|
|
172
170
|
* // If the table 'newTable' already exists, createTable doesn't throw
|
|
@@ -182,13 +180,14 @@ export declare class TableClient {
|
|
|
182
180
|
*
|
|
183
181
|
* ### Example getting an entity
|
|
184
182
|
* ```ts snippet:ReadmeSampleGetEntity
|
|
185
|
-
* import {
|
|
183
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
184
|
+
* import { TableClient } from "@azure/data-tables";
|
|
186
185
|
*
|
|
187
186
|
* const account = "<account>";
|
|
188
187
|
* const accountKey = "<accountkey>";
|
|
189
188
|
* const tableName = "<tableName>";
|
|
190
189
|
*
|
|
191
|
-
* const credential = new
|
|
190
|
+
* const credential = new DefaultAzureCredential();
|
|
192
191
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
193
192
|
*
|
|
194
193
|
* const entity = await client.getEntity("<partitionKey>", "<rowKey>");
|
|
@@ -202,13 +201,14 @@ export declare class TableClient {
|
|
|
202
201
|
*
|
|
203
202
|
* Example listing entities
|
|
204
203
|
* ```ts snippet:ReadmeSampleListEntities
|
|
205
|
-
* import {
|
|
204
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
205
|
+
* import { TableClient } from "@azure/data-tables";
|
|
206
206
|
*
|
|
207
207
|
* const account = "<account>";
|
|
208
208
|
* const accountKey = "<accountkey>";
|
|
209
209
|
* const tableName = "<tableName>";
|
|
210
210
|
*
|
|
211
|
-
* const credential = new
|
|
211
|
+
* const credential = new DefaultAzureCredential();
|
|
212
212
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
213
213
|
*
|
|
214
214
|
* let i = 0;
|
|
@@ -229,13 +229,14 @@ export declare class TableClient {
|
|
|
229
229
|
*
|
|
230
230
|
* ### Example creating an entity
|
|
231
231
|
* ```ts snippet:ReadmeSampleCreateEntity
|
|
232
|
-
* import {
|
|
232
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
233
|
+
* import { TableClient } from "@azure/data-tables";
|
|
233
234
|
*
|
|
234
235
|
* const account = "<account>";
|
|
235
236
|
* const accountKey = "<accountkey>";
|
|
236
237
|
* const tableName = "<tableName>";
|
|
237
238
|
*
|
|
238
|
-
* const credential = new
|
|
239
|
+
* const credential = new DefaultAzureCredential();
|
|
239
240
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
240
241
|
*
|
|
241
242
|
* const testEntity = {
|
|
@@ -256,13 +257,14 @@ export declare class TableClient {
|
|
|
256
257
|
*
|
|
257
258
|
* ### Example deleting an entity
|
|
258
259
|
* ```ts snippet:ReadmeSampleDeleteEntity
|
|
259
|
-
* import {
|
|
260
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
261
|
+
* import { TableClient } from "@azure/data-tables";
|
|
260
262
|
*
|
|
261
263
|
* const account = "<account>";
|
|
262
264
|
* const accountKey = "<accountkey>";
|
|
263
265
|
* const tableName = "<tableName>";
|
|
264
266
|
*
|
|
265
|
-
* const credential = new
|
|
267
|
+
* const credential = new DefaultAzureCredential();
|
|
266
268
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
267
269
|
*
|
|
268
270
|
* // deleteEntity deletes the entity that matches exactly the partitionKey and rowKey
|
|
@@ -280,13 +282,14 @@ export declare class TableClient {
|
|
|
280
282
|
*
|
|
281
283
|
* ### Example updating an entity
|
|
282
284
|
* ```ts snippet:ReadmeSampleUpdateEntity
|
|
283
|
-
* import {
|
|
285
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
286
|
+
* import { TableClient } from "@azure/data-tables";
|
|
284
287
|
*
|
|
285
288
|
* const account = "<account>";
|
|
286
289
|
* const accountKey = "<accountkey>";
|
|
287
290
|
* const tableName = "<tableName>";
|
|
288
291
|
*
|
|
289
|
-
* const credential = new
|
|
292
|
+
* const credential = new DefaultAzureCredential();
|
|
290
293
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
291
294
|
*
|
|
292
295
|
* const entity = { partitionKey: "p1", rowKey: "r1", bar: "updatedBar" };
|
|
@@ -317,13 +320,14 @@ export declare class TableClient {
|
|
|
317
320
|
*
|
|
318
321
|
* ### Example upserting an entity
|
|
319
322
|
* ```ts snippet:ReadmeSampleUpsertEntity
|
|
320
|
-
* import {
|
|
323
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
324
|
+
* import { TableClient } from "@azure/data-tables";
|
|
321
325
|
*
|
|
322
326
|
* const account = "<account>";
|
|
323
327
|
* const accountKey = "<accountkey>";
|
|
324
328
|
* const tableName = "<tableName>";
|
|
325
329
|
*
|
|
326
|
-
* const credential = new
|
|
330
|
+
* const credential = new DefaultAzureCredential();
|
|
327
331
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
328
332
|
*
|
|
329
333
|
* const entity = { partitionKey: "p1", rowKey: "r1", bar: "updatedBar" };
|
|
@@ -358,13 +362,14 @@ export declare class TableClient {
|
|
|
358
362
|
*
|
|
359
363
|
* Example usage:
|
|
360
364
|
* ```ts snippet:ReadmeSampleSubmitTransaction
|
|
361
|
-
* import {
|
|
365
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
366
|
+
* import { TableClient, TransactionAction } from "@azure/data-tables";
|
|
362
367
|
*
|
|
363
368
|
* const account = "<account>";
|
|
364
369
|
* const accountKey = "<accountkey>";
|
|
365
370
|
* const tableName = "<tableName>";
|
|
366
371
|
*
|
|
367
|
-
* const credential = new
|
|
372
|
+
* const credential = new DefaultAzureCredential();
|
|
368
373
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
369
374
|
*
|
|
370
375
|
* const actions: TransactionAction[] = [
|
|
@@ -377,13 +382,14 @@ export declare class TableClient {
|
|
|
377
382
|
*
|
|
378
383
|
* Example usage with TableTransaction:
|
|
379
384
|
* ```ts snippet:ReadmeSampleSubmitTransactionWithTableTransaction
|
|
380
|
-
* import {
|
|
385
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
386
|
+
* import { TableClient, TableTransaction } from "@azure/data-tables";
|
|
381
387
|
*
|
|
382
388
|
* const account = "<account>";
|
|
383
389
|
* const accountKey = "<accountkey>";
|
|
384
390
|
* const tableName = "<tableName>";
|
|
385
391
|
*
|
|
386
|
-
* const credential = new
|
|
392
|
+
* const credential = new DefaultAzureCredential();
|
|
387
393
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
388
394
|
*
|
|
389
395
|
* const transaction = new TableTransaction();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableClient.d.ts","sourceRoot":"","sources":["../../src/TableClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,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
72
|
* ```ts snippet:ReadmeSampleDeleteTable
|
|
73
|
-
* import {
|
|
73
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
74
|
+
* import { TableClient } from "@azure/data-tables";
|
|
74
75
|
*
|
|
75
76
|
* const account = "<account>";
|
|
76
77
|
* const accountKey = "<accountkey>";
|
|
77
78
|
* const tableName = "<tableName>";
|
|
78
79
|
*
|
|
79
|
-
* const credential = new
|
|
80
|
+
* const credential = new DefaultAzureCredential();
|
|
80
81
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
81
82
|
*
|
|
82
83
|
* await client.deleteTable();
|
|
@@ -103,13 +104,14 @@ export class TableClient {
|
|
|
103
104
|
*
|
|
104
105
|
* ### Example creating a table
|
|
105
106
|
* ```ts snippet:ReadmeSampleTableClientCreateTable
|
|
106
|
-
* import {
|
|
107
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
108
|
+
* import { TableClient } from "@azure/data-tables";
|
|
107
109
|
*
|
|
108
110
|
* const account = "<account>";
|
|
109
111
|
* const accountKey = "<accountkey>";
|
|
110
112
|
* const tableName = "<tableName>";
|
|
111
113
|
*
|
|
112
|
-
* const credential = new
|
|
114
|
+
* const credential = new DefaultAzureCredential();
|
|
113
115
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
114
116
|
*
|
|
115
117
|
* // If the table 'newTable' already exists, createTable doesn't throw
|
|
@@ -134,13 +136,14 @@ export class TableClient {
|
|
|
134
136
|
*
|
|
135
137
|
* ### Example getting an entity
|
|
136
138
|
* ```ts snippet:ReadmeSampleGetEntity
|
|
137
|
-
* import {
|
|
139
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
140
|
+
* import { TableClient } from "@azure/data-tables";
|
|
138
141
|
*
|
|
139
142
|
* const account = "<account>";
|
|
140
143
|
* const accountKey = "<accountkey>";
|
|
141
144
|
* const tableName = "<tableName>";
|
|
142
145
|
*
|
|
143
|
-
* const credential = new
|
|
146
|
+
* const credential = new DefaultAzureCredential();
|
|
144
147
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
145
148
|
*
|
|
146
149
|
* const entity = await client.getEntity("<partitionKey>", "<rowKey>");
|
|
@@ -170,13 +173,14 @@ export class TableClient {
|
|
|
170
173
|
*
|
|
171
174
|
* Example listing entities
|
|
172
175
|
* ```ts snippet:ReadmeSampleListEntities
|
|
173
|
-
* import {
|
|
176
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
177
|
+
* import { TableClient } from "@azure/data-tables";
|
|
174
178
|
*
|
|
175
179
|
* const account = "<account>";
|
|
176
180
|
* const accountKey = "<accountkey>";
|
|
177
181
|
* const tableName = "<tableName>";
|
|
178
182
|
*
|
|
179
|
-
* const credential = new
|
|
183
|
+
* const credential = new DefaultAzureCredential();
|
|
180
184
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
181
185
|
*
|
|
182
186
|
* let i = 0;
|
|
@@ -273,13 +277,14 @@ export class TableClient {
|
|
|
273
277
|
*
|
|
274
278
|
* ### Example creating an entity
|
|
275
279
|
* ```ts snippet:ReadmeSampleCreateEntity
|
|
276
|
-
* import {
|
|
280
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
281
|
+
* import { TableClient } from "@azure/data-tables";
|
|
277
282
|
*
|
|
278
283
|
* const account = "<account>";
|
|
279
284
|
* const accountKey = "<accountkey>";
|
|
280
285
|
* const tableName = "<tableName>";
|
|
281
286
|
*
|
|
282
|
-
* const credential = new
|
|
287
|
+
* const credential = new DefaultAzureCredential();
|
|
283
288
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
284
289
|
*
|
|
285
290
|
* const testEntity = {
|
|
@@ -305,13 +310,14 @@ export class TableClient {
|
|
|
305
310
|
*
|
|
306
311
|
* ### Example deleting an entity
|
|
307
312
|
* ```ts snippet:ReadmeSampleDeleteEntity
|
|
308
|
-
* import {
|
|
313
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
314
|
+
* import { TableClient } from "@azure/data-tables";
|
|
309
315
|
*
|
|
310
316
|
* const account = "<account>";
|
|
311
317
|
* const accountKey = "<accountkey>";
|
|
312
318
|
* const tableName = "<tableName>";
|
|
313
319
|
*
|
|
314
|
-
* const credential = new
|
|
320
|
+
* const credential = new DefaultAzureCredential();
|
|
315
321
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
316
322
|
*
|
|
317
323
|
* // deleteEntity deletes the entity that matches exactly the partitionKey and rowKey
|
|
@@ -337,13 +343,14 @@ export class TableClient {
|
|
|
337
343
|
*
|
|
338
344
|
* ### Example updating an entity
|
|
339
345
|
* ```ts snippet:ReadmeSampleUpdateEntity
|
|
340
|
-
* import {
|
|
346
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
347
|
+
* import { TableClient } from "@azure/data-tables";
|
|
341
348
|
*
|
|
342
349
|
* const account = "<account>";
|
|
343
350
|
* const accountKey = "<accountkey>";
|
|
344
351
|
* const tableName = "<tableName>";
|
|
345
352
|
*
|
|
346
|
-
* const credential = new
|
|
353
|
+
* const credential = new DefaultAzureCredential();
|
|
347
354
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
348
355
|
*
|
|
349
356
|
* const entity = { partitionKey: "p1", rowKey: "r1", bar: "updatedBar" };
|
|
@@ -393,13 +400,14 @@ export class TableClient {
|
|
|
393
400
|
*
|
|
394
401
|
* ### Example upserting an entity
|
|
395
402
|
* ```ts snippet:ReadmeSampleUpsertEntity
|
|
396
|
-
* import {
|
|
403
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
404
|
+
* import { TableClient } from "@azure/data-tables";
|
|
397
405
|
*
|
|
398
406
|
* const account = "<account>";
|
|
399
407
|
* const accountKey = "<accountkey>";
|
|
400
408
|
* const tableName = "<tableName>";
|
|
401
409
|
*
|
|
402
|
-
* const credential = new
|
|
410
|
+
* const credential = new DefaultAzureCredential();
|
|
403
411
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
404
412
|
*
|
|
405
413
|
* const entity = { partitionKey: "p1", rowKey: "r1", bar: "updatedBar" };
|
|
@@ -460,13 +468,14 @@ export class TableClient {
|
|
|
460
468
|
*
|
|
461
469
|
* Example usage:
|
|
462
470
|
* ```ts snippet:ReadmeSampleSubmitTransaction
|
|
463
|
-
* import {
|
|
471
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
472
|
+
* import { TableClient, TransactionAction } from "@azure/data-tables";
|
|
464
473
|
*
|
|
465
474
|
* const account = "<account>";
|
|
466
475
|
* const accountKey = "<accountkey>";
|
|
467
476
|
* const tableName = "<tableName>";
|
|
468
477
|
*
|
|
469
|
-
* const credential = new
|
|
478
|
+
* const credential = new DefaultAzureCredential();
|
|
470
479
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
471
480
|
*
|
|
472
481
|
* const actions: TransactionAction[] = [
|
|
@@ -479,13 +488,14 @@ export class TableClient {
|
|
|
479
488
|
*
|
|
480
489
|
* Example usage with TableTransaction:
|
|
481
490
|
* ```ts snippet:ReadmeSampleSubmitTransactionWithTableTransaction
|
|
482
|
-
* import {
|
|
491
|
+
* import { DefaultAzureCredential } from "@azure/identity";
|
|
492
|
+
* import { TableClient, TableTransaction } from "@azure/data-tables";
|
|
483
493
|
*
|
|
484
494
|
* const account = "<account>";
|
|
485
495
|
* const accountKey = "<accountkey>";
|
|
486
496
|
* const tableName = "<tableName>";
|
|
487
497
|
*
|
|
488
|
-
* const credential = new
|
|
498
|
+
* const credential = new DefaultAzureCredential();
|
|
489
499
|
* const client = new TableClient(`https://${account}.table.core.windows.net`, tableName, credential);
|
|
490
500
|
*
|
|
491
501
|
* const transaction = new TableTransaction();
|