@azure/data-tables 13.0.2-alpha.20220217.1 → 13.1.0-alpha.20220307.1
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/CHANGELOG.md +5 -1
- package/dist/index.js +129 -247
- package/dist/index.js.map +1 -1
- package/dist-esm/src/TableClient.js +71 -138
- package/dist-esm/src/TableClient.js.map +1 -1
- package/dist-esm/src/TableServiceClient.js +35 -78
- package/dist-esm/src/TableServiceClient.js.map +1 -1
- package/dist-esm/src/TableTransaction.js +11 -23
- package/dist-esm/src/TableTransaction.js.map +1 -1
- package/dist-esm/src/generated/generatedClientContext.js +1 -1
- package/dist-esm/src/generated/generatedClientContext.js.map +1 -1
- package/dist-esm/src/utils/errorHelpers.js +1 -3
- package/dist-esm/src/utils/errorHelpers.js.map +1 -1
- package/dist-esm/src/utils/tracing.js +5 -4
- package/dist-esm/src/utils/tracing.js.map +1 -1
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
-
## 13.0
|
|
3
|
+
## 13.1.0 (Unreleased)
|
|
4
4
|
|
|
5
5
|
### Features Added
|
|
6
6
|
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
### Other Changes
|
|
14
14
|
|
|
15
|
+
- Updated our `@azure/core-tracing` dependency to the latest version (1.0.0-preview.14)
|
|
16
|
+
- Notable changes include Removal of `@opentelemetry/api` as a transitive dependency and ensuring that the active context is properly propagated.
|
|
17
|
+
- Customers who would like to continue using OpenTelemetry driven tracing should visit our [OpenTelemetry Instrumentation](https://www.npmjs.com/package/@azure/opentelemetry-instrumentation-azure-sdk) package for instructions.
|
|
18
|
+
|
|
15
19
|
## 13.0.1 (2022-01-12)
|
|
16
20
|
|
|
17
21
|
### Bugs Fixed
|
package/dist/index.js
CHANGED
|
@@ -7,10 +7,10 @@ require('@azure/core-paging');
|
|
|
7
7
|
var coreAuth = require('@azure/core-auth');
|
|
8
8
|
var coreXml = require('@azure/core-xml');
|
|
9
9
|
var coreClient = require('@azure/core-client');
|
|
10
|
-
var coreTracing = require('@azure/core-tracing');
|
|
11
10
|
var url$1 = require('url');
|
|
12
11
|
var logger$1 = require('@azure/logger');
|
|
13
12
|
var crypto = require('crypto');
|
|
13
|
+
var coreTracing = require('@azure/core-tracing');
|
|
14
14
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
15
15
|
var uuid = require('uuid');
|
|
16
16
|
|
|
@@ -3136,7 +3136,7 @@ class GeneratedClientContext extends coreClient__namespace.ServiceClient {
|
|
|
3136
3136
|
const defaults = {
|
|
3137
3137
|
requestContentType: "application/json; charset=utf-8"
|
|
3138
3138
|
};
|
|
3139
|
-
const packageDetails = `azsdk-js-data-tables/13.0
|
|
3139
|
+
const packageDetails = `azsdk-js-data-tables/13.1.0`;
|
|
3140
3140
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
3141
3141
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
3142
3142
|
: `${packageDetails}`;
|
|
@@ -3172,16 +3172,6 @@ class GeneratedClient extends GeneratedClientContext {
|
|
|
3172
3172
|
}
|
|
3173
3173
|
}
|
|
3174
3174
|
|
|
3175
|
-
// Copyright (c) Microsoft Corporation.
|
|
3176
|
-
/**
|
|
3177
|
-
* Creates a span using the global tracer.
|
|
3178
|
-
* @internal
|
|
3179
|
-
*/
|
|
3180
|
-
const createSpan = coreTracing.createSpanFunction({
|
|
3181
|
-
packagePrefix: "Azure.Data.Tables",
|
|
3182
|
-
namespace: "Microsoft.Data.Tables",
|
|
3183
|
-
});
|
|
3184
|
-
|
|
3185
3175
|
// Copyright (c) Microsoft Corporation.
|
|
3186
3176
|
/**
|
|
3187
3177
|
* Gets client parameters from an Account Connection String
|
|
@@ -3354,8 +3344,9 @@ function getAccountNameFromUrl(url) {
|
|
|
3354
3344
|
}
|
|
3355
3345
|
|
|
3356
3346
|
// Copyright (c) Microsoft Corporation.
|
|
3347
|
+
// Licensed under the MIT license.
|
|
3357
3348
|
function handleTableAlreadyExists(error, options = {}) {
|
|
3358
|
-
var _a, _b
|
|
3349
|
+
var _a, _b;
|
|
3359
3350
|
const responseError = getErrorResponse(error);
|
|
3360
3351
|
if (responseError &&
|
|
3361
3352
|
responseError.status === 409 &&
|
|
@@ -3366,7 +3357,6 @@ function handleTableAlreadyExists(error, options = {}) {
|
|
|
3366
3357
|
}
|
|
3367
3358
|
}
|
|
3368
3359
|
else {
|
|
3369
|
-
options === null || options === void 0 ? void 0 : options.span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: (_c = error) === null || _c === void 0 ? void 0 : _c.message });
|
|
3370
3360
|
throw error;
|
|
3371
3361
|
}
|
|
3372
3362
|
}
|
|
@@ -3484,6 +3474,17 @@ function signURLWithSAS(request, credential) {
|
|
|
3484
3474
|
request.url = url.toString();
|
|
3485
3475
|
}
|
|
3486
3476
|
|
|
3477
|
+
// Copyright (c) Microsoft Corporation.
|
|
3478
|
+
/**
|
|
3479
|
+
* A tracing client that can be used to manage spans.
|
|
3480
|
+
* @internal
|
|
3481
|
+
*/
|
|
3482
|
+
const tracingClient = coreTracing.createTracingClient({
|
|
3483
|
+
namespace: "Microsoft.Data.Tables",
|
|
3484
|
+
packageName: "@azure/data-tables",
|
|
3485
|
+
packageVersion: "13.1.0",
|
|
3486
|
+
});
|
|
3487
|
+
|
|
3487
3488
|
// Copyright (c) Microsoft Corporation.
|
|
3488
3489
|
/**
|
|
3489
3490
|
* A TableServiceClient represents a Client to the Azure Tables service allowing you
|
|
@@ -3525,35 +3526,15 @@ class TableServiceClient {
|
|
|
3525
3526
|
* @param options - The options parameters.
|
|
3526
3527
|
*/
|
|
3527
3528
|
async getStatistics(options = {}) {
|
|
3528
|
-
|
|
3529
|
-
try {
|
|
3530
|
-
return await this.service.getStatistics(injectSecondaryEndpointHeader(updatedOptions));
|
|
3531
|
-
}
|
|
3532
|
-
catch (e) {
|
|
3533
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3534
|
-
throw e;
|
|
3535
|
-
}
|
|
3536
|
-
finally {
|
|
3537
|
-
span.end();
|
|
3538
|
-
}
|
|
3529
|
+
return tracingClient.withSpan("TableServiceClient.getStatistics", options, (updatedOptions) => this.service.getStatistics(injectSecondaryEndpointHeader(updatedOptions)));
|
|
3539
3530
|
}
|
|
3540
3531
|
/**
|
|
3541
3532
|
* Gets the properties of an account's Table service, including properties for Analytics and CORS
|
|
3542
3533
|
* (Cross-Origin Resource Sharing) rules.
|
|
3543
3534
|
* @param options - The options parameters.
|
|
3544
3535
|
*/
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
try {
|
|
3548
|
-
return await this.service.getProperties(updatedOptions);
|
|
3549
|
-
}
|
|
3550
|
-
catch (e) {
|
|
3551
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3552
|
-
throw e;
|
|
3553
|
-
}
|
|
3554
|
-
finally {
|
|
3555
|
-
span.end();
|
|
3556
|
-
}
|
|
3536
|
+
getProperties(options = {}) {
|
|
3537
|
+
return tracingClient.withSpan("TableServiceClient.getProperties", options, (updatedOptions) => this.service.getProperties(updatedOptions));
|
|
3557
3538
|
}
|
|
3558
3539
|
/**
|
|
3559
3540
|
* Sets properties for an account's Table service endpoint, including properties for Analytics and CORS
|
|
@@ -3561,58 +3542,43 @@ class TableServiceClient {
|
|
|
3561
3542
|
* @param properties - The Table Service properties.
|
|
3562
3543
|
* @param options - The options parameters.
|
|
3563
3544
|
*/
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
try {
|
|
3567
|
-
return await this.service.setProperties(properties, updatedOptions);
|
|
3568
|
-
}
|
|
3569
|
-
catch (e) {
|
|
3570
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3571
|
-
throw e;
|
|
3572
|
-
}
|
|
3573
|
-
finally {
|
|
3574
|
-
span.end();
|
|
3575
|
-
}
|
|
3545
|
+
setProperties(properties, options = {}) {
|
|
3546
|
+
return tracingClient.withSpan("TableServiceClient.setProperties", options, (updatedOptions) => this.service.setProperties(properties, updatedOptions));
|
|
3576
3547
|
}
|
|
3577
3548
|
/**
|
|
3578
3549
|
* Creates a new table under the given account.
|
|
3579
3550
|
* @param name - The name of the table.
|
|
3580
3551
|
* @param options - The options parameters.
|
|
3581
3552
|
*/
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
span.end();
|
|
3592
|
-
}
|
|
3553
|
+
createTable(name, options = {}) {
|
|
3554
|
+
return tracingClient.withSpan("TableServiceClient.createTable", options, async (updatedOptions) => {
|
|
3555
|
+
try {
|
|
3556
|
+
await this.table.create({ name }, updatedOptions);
|
|
3557
|
+
}
|
|
3558
|
+
catch (e) {
|
|
3559
|
+
handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger, tableName: name }));
|
|
3560
|
+
}
|
|
3561
|
+
});
|
|
3593
3562
|
}
|
|
3594
3563
|
/**
|
|
3595
3564
|
* Operation permanently deletes the specified table.
|
|
3596
3565
|
* @param name - The name of the table.
|
|
3597
3566
|
* @param options - The options parameters.
|
|
3598
3567
|
*/
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
}
|
|
3604
|
-
catch (e) {
|
|
3605
|
-
if (e.statusCode === 404) {
|
|
3606
|
-
logger.info("TableServiceClient-deleteTable: Table doesn't exist");
|
|
3568
|
+
deleteTable(name, options = {}) {
|
|
3569
|
+
return tracingClient.withSpan("TableServiceClient.deleteTable", options, async (updatedOptions) => {
|
|
3570
|
+
try {
|
|
3571
|
+
await this.table.delete(name, updatedOptions);
|
|
3607
3572
|
}
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3573
|
+
catch (e) {
|
|
3574
|
+
if (e.statusCode === 404) {
|
|
3575
|
+
logger.info("TableServiceClient.deleteTable: Table doesn't exist");
|
|
3576
|
+
}
|
|
3577
|
+
else {
|
|
3578
|
+
throw e;
|
|
3579
|
+
}
|
|
3611
3580
|
}
|
|
3612
|
-
}
|
|
3613
|
-
finally {
|
|
3614
|
-
span.end();
|
|
3615
|
-
}
|
|
3581
|
+
});
|
|
3616
3582
|
}
|
|
3617
3583
|
/**
|
|
3618
3584
|
* Queries tables under the given account.
|
|
@@ -3664,22 +3630,15 @@ class TableServiceClient {
|
|
|
3664
3630
|
}
|
|
3665
3631
|
listTablesPage(options = {}) {
|
|
3666
3632
|
return tslib.__asyncGenerator(this, arguments, function* listTablesPage_1() {
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3633
|
+
let result = yield tslib.__await(tracingClient.withSpan("TableServiceClient.listTablesPage", options, (updatedOptions) => this._listTables(updatedOptions)));
|
|
3634
|
+
yield yield tslib.__await(result);
|
|
3635
|
+
while (result.continuationToken) {
|
|
3636
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken: result.continuationToken });
|
|
3637
|
+
result = yield tslib.__await(tracingClient.withSpan("TableServiceClient.listTablesPage", optionsWithContinuation, async (updatedOptions, span) => {
|
|
3638
|
+
span.setAttribute("continuationToken", updatedOptions.continuationToken);
|
|
3639
|
+
return this._listTables(updatedOptions);
|
|
3640
|
+
}));
|
|
3670
3641
|
yield yield tslib.__await(result);
|
|
3671
|
-
while (result.continuationToken) {
|
|
3672
|
-
const optionsWithContinuation = Object.assign(Object.assign({}, updatedOptions), { continuationToken: result.continuationToken });
|
|
3673
|
-
result = yield tslib.__await(this._listTables(optionsWithContinuation));
|
|
3674
|
-
yield yield tslib.__await(result);
|
|
3675
|
-
}
|
|
3676
|
-
}
|
|
3677
|
-
catch (e) {
|
|
3678
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3679
|
-
throw e;
|
|
3680
|
-
}
|
|
3681
|
-
finally {
|
|
3682
|
-
span.end();
|
|
3683
3642
|
}
|
|
3684
3643
|
});
|
|
3685
3644
|
}
|
|
@@ -4017,29 +3976,18 @@ class InternalTableTransaction {
|
|
|
4017
3976
|
await Promise.all(this.resetableState.pendingOperations);
|
|
4018
3977
|
const body = getTransactionHttpRequestBody(this.resetableState.bodyParts, this.resetableState.transactionId, this.resetableState.changesetId);
|
|
4019
3978
|
const headers = getTransactionHeaders(this.resetableState.transactionId);
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
try {
|
|
3979
|
+
return tracingClient.withSpan("TableTransaction.submitTransaction", {}, async (updatedOptions) => {
|
|
3980
|
+
const request = coreRestPipeline.createPipelineRequest({
|
|
3981
|
+
url: this.url,
|
|
3982
|
+
method: "POST",
|
|
3983
|
+
body,
|
|
3984
|
+
headers: coreRestPipeline.createHttpHeaders(headers),
|
|
3985
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
3986
|
+
allowInsecureConnection: this.allowInsecureConnection,
|
|
3987
|
+
});
|
|
4030
3988
|
const rawTransactionResponse = await this.client.sendRequest(request);
|
|
4031
3989
|
return parseTransactionResponse(rawTransactionResponse);
|
|
4032
|
-
}
|
|
4033
|
-
catch (error) {
|
|
4034
|
-
span.setStatus({
|
|
4035
|
-
code: coreTracing.SpanStatusCode.ERROR,
|
|
4036
|
-
message: error.message,
|
|
4037
|
-
});
|
|
4038
|
-
throw error;
|
|
4039
|
-
}
|
|
4040
|
-
finally {
|
|
4041
|
-
span.end();
|
|
4042
|
-
}
|
|
3990
|
+
});
|
|
4043
3991
|
}
|
|
4044
3992
|
checkPartitionKey(partitionKey) {
|
|
4045
3993
|
if (this.resetableState.partitionKey !== partitionKey) {
|
|
@@ -4500,23 +4448,17 @@ class TableClient {
|
|
|
4500
4448
|
* ```
|
|
4501
4449
|
*/
|
|
4502
4450
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
}
|
|
4508
|
-
catch (e) {
|
|
4509
|
-
if (e.statusCode === 404) {
|
|
4510
|
-
logger.info("TableClient-deleteTable: Table doesn't exist");
|
|
4451
|
+
deleteTable(options = {}) {
|
|
4452
|
+
return tracingClient.withSpan("TableClient.deleteTable", options, async (updatedOptions) => {
|
|
4453
|
+
try {
|
|
4454
|
+
await this.table.delete(this.tableName, updatedOptions);
|
|
4511
4455
|
}
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4456
|
+
catch (e) {
|
|
4457
|
+
if (e.statusCode === 404) {
|
|
4458
|
+
logger.info("TableClient.deleteTable: Table doesn't exist");
|
|
4459
|
+
}
|
|
4515
4460
|
}
|
|
4516
|
-
}
|
|
4517
|
-
finally {
|
|
4518
|
-
span.end();
|
|
4519
|
-
}
|
|
4461
|
+
});
|
|
4520
4462
|
}
|
|
4521
4463
|
/**
|
|
4522
4464
|
* Creates a table with the tableName passed to the client constructor
|
|
@@ -4544,17 +4486,15 @@ class TableClient {
|
|
|
4544
4486
|
* ```
|
|
4545
4487
|
*/
|
|
4546
4488
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
span.end();
|
|
4557
|
-
}
|
|
4489
|
+
createTable(options = {}) {
|
|
4490
|
+
return tracingClient.withSpan("TableClient.createTable", options, async (updatedOptions) => {
|
|
4491
|
+
try {
|
|
4492
|
+
await this.table.create({ name: this.tableName }, updatedOptions);
|
|
4493
|
+
}
|
|
4494
|
+
catch (e) {
|
|
4495
|
+
handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger, tableName: this.tableName }));
|
|
4496
|
+
}
|
|
4497
|
+
});
|
|
4558
4498
|
}
|
|
4559
4499
|
/**
|
|
4560
4500
|
* Returns a single entity in the table.
|
|
@@ -4583,30 +4523,22 @@ class TableClient {
|
|
|
4583
4523
|
* console.log(entity);
|
|
4584
4524
|
* ```
|
|
4585
4525
|
*/
|
|
4586
|
-
|
|
4526
|
+
getEntity(partitionKey, rowKey,
|
|
4587
4527
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4588
4528
|
options = {}) {
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4529
|
+
return tracingClient.withSpan("TableClient.getEntity", options, async (updatedOptions) => {
|
|
4530
|
+
let parsedBody;
|
|
4531
|
+
function onResponse(rawResponse, flatResponse) {
|
|
4532
|
+
parsedBody = rawResponse.parsedBody;
|
|
4533
|
+
if (updatedOptions.onResponse) {
|
|
4534
|
+
updatedOptions.onResponse(rawResponse, flatResponse);
|
|
4535
|
+
}
|
|
4595
4536
|
}
|
|
4596
|
-
|
|
4597
|
-
try {
|
|
4598
|
-
const _a = updatedOptions || {}, { disableTypeConversion, queryOptions } = _a, getEntityOptions = tslib.__rest(_a, ["disableTypeConversion", "queryOptions"]);
|
|
4537
|
+
const { disableTypeConversion, queryOptions } = updatedOptions, getEntityOptions = tslib.__rest(updatedOptions, ["disableTypeConversion", "queryOptions"]);
|
|
4599
4538
|
await this.table.queryEntitiesWithPartitionAndRowKey(this.tableName, escapeQuotes(partitionKey), escapeQuotes(rowKey), Object.assign(Object.assign({}, getEntityOptions), { queryOptions: serializeQueryOptions(queryOptions || {}), onResponse }));
|
|
4600
4539
|
const tableEntity = deserialize(parsedBody, disableTypeConversion !== null && disableTypeConversion !== void 0 ? disableTypeConversion : false);
|
|
4601
4540
|
return tableEntity;
|
|
4602
|
-
}
|
|
4603
|
-
catch (e) {
|
|
4604
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4605
|
-
throw e;
|
|
4606
|
-
}
|
|
4607
|
-
finally {
|
|
4608
|
-
span.end();
|
|
4609
|
-
}
|
|
4541
|
+
});
|
|
4610
4542
|
}
|
|
4611
4543
|
/**
|
|
4612
4544
|
* Queries entities in a table.
|
|
@@ -4684,25 +4616,15 @@ class TableClient {
|
|
|
4684
4616
|
}
|
|
4685
4617
|
listEntitiesPage(tableName, options = {}) {
|
|
4686
4618
|
return tslib.__asyncGenerator(this, arguments, function* listEntitiesPage_1() {
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4619
|
+
let result = yield tslib.__await(tracingClient.withSpan("TableClient.listEntitiesPage", options, (updatedOptions) => this._listEntities(tableName, updatedOptions)));
|
|
4620
|
+
yield yield tslib.__await(result);
|
|
4621
|
+
while (result.continuationToken) {
|
|
4622
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken: result.continuationToken });
|
|
4623
|
+
result = yield tslib.__await(tracingClient.withSpan("TableClient.listEntitiesPage", optionsWithContinuation, (updatedOptions, span) => {
|
|
4624
|
+
span.setAttribute("continuationToken", result.continuationToken);
|
|
4625
|
+
return this._listEntities(tableName, updatedOptions);
|
|
4626
|
+
}));
|
|
4690
4627
|
yield yield tslib.__await(result);
|
|
4691
|
-
while (result.continuationToken) {
|
|
4692
|
-
const optionsWithContinuation = Object.assign(Object.assign({}, updatedOptions), { continuationToken: result.continuationToken });
|
|
4693
|
-
result = yield tslib.__await(this._listEntities(tableName, optionsWithContinuation));
|
|
4694
|
-
yield yield tslib.__await(result);
|
|
4695
|
-
}
|
|
4696
|
-
}
|
|
4697
|
-
catch (e) {
|
|
4698
|
-
span.setStatus({
|
|
4699
|
-
code: coreTracing.SpanStatusCode.ERROR,
|
|
4700
|
-
message: e.message,
|
|
4701
|
-
});
|
|
4702
|
-
throw e;
|
|
4703
|
-
}
|
|
4704
|
-
finally {
|
|
4705
|
-
span.end();
|
|
4706
4628
|
}
|
|
4707
4629
|
});
|
|
4708
4630
|
}
|
|
@@ -4750,21 +4672,13 @@ class TableClient {
|
|
|
4750
4672
|
* await client.createEntity({partitionKey: "p1", rowKey: "r1", foo: "Hello!"});
|
|
4751
4673
|
* ```
|
|
4752
4674
|
*/
|
|
4753
|
-
|
|
4675
|
+
createEntity(entity,
|
|
4754
4676
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4755
4677
|
options = {}) {
|
|
4756
|
-
|
|
4757
|
-
try {
|
|
4678
|
+
return tracingClient.withSpan("TableClient.createEntity", options, (updatedOptions) => {
|
|
4758
4679
|
const createTableEntity = tslib.__rest(updatedOptions || {}, []);
|
|
4759
|
-
return
|
|
4760
|
-
}
|
|
4761
|
-
catch (e) {
|
|
4762
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4763
|
-
throw e;
|
|
4764
|
-
}
|
|
4765
|
-
finally {
|
|
4766
|
-
span.end();
|
|
4767
|
-
}
|
|
4680
|
+
return this.table.insertEntity(this.tableName, Object.assign(Object.assign({}, createTableEntity), { tableEntityProperties: serialize(entity), responsePreference: "return-no-content" }));
|
|
4681
|
+
});
|
|
4768
4682
|
}
|
|
4769
4683
|
/**
|
|
4770
4684
|
* Deletes the specified entity in the table.
|
|
@@ -4791,22 +4705,14 @@ class TableClient {
|
|
|
4791
4705
|
* await client.deleteEntity("<partitionKey>", "<rowKey>")
|
|
4792
4706
|
* ```
|
|
4793
4707
|
*/
|
|
4794
|
-
|
|
4708
|
+
deleteEntity(partitionKey, rowKey,
|
|
4795
4709
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4796
4710
|
options = {}) {
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
const _a = updatedOptions || {}, { etag = "*" } = _a, rest = tslib.__rest(_a, ["etag"]);
|
|
4711
|
+
return tracingClient.withSpan("TableClient.deleteEntity", options, (updatedOptions) => {
|
|
4712
|
+
const { etag = "*" } = updatedOptions, rest = tslib.__rest(updatedOptions, ["etag"]);
|
|
4800
4713
|
const deleteOptions = Object.assign({}, rest);
|
|
4801
|
-
return
|
|
4802
|
-
}
|
|
4803
|
-
catch (e) {
|
|
4804
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4805
|
-
throw e;
|
|
4806
|
-
}
|
|
4807
|
-
finally {
|
|
4808
|
-
span.end();
|
|
4809
|
-
}
|
|
4714
|
+
return this.table.deleteEntity(this.tableName, escapeQuotes(partitionKey), escapeQuotes(rowKey), etag, deleteOptions);
|
|
4715
|
+
});
|
|
4810
4716
|
}
|
|
4811
4717
|
/**
|
|
4812
4718
|
* Update an entity in the table.
|
|
@@ -4847,29 +4753,25 @@ class TableClient {
|
|
|
4847
4753
|
* await client.updateEntity(entity, "Replace")
|
|
4848
4754
|
* ```
|
|
4849
4755
|
*/
|
|
4850
|
-
|
|
4756
|
+
updateEntity(entity, mode = "Merge",
|
|
4851
4757
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4852
4758
|
options = {}) {
|
|
4853
|
-
|
|
4854
|
-
try {
|
|
4759
|
+
return tracingClient.withSpan("TableClient.updateEntity", options, async (updatedOptions) => {
|
|
4855
4760
|
const partitionKey = escapeQuotes(entity.partitionKey);
|
|
4856
4761
|
const rowKey = escapeQuotes(entity.rowKey);
|
|
4857
4762
|
const _a = updatedOptions || {}, { etag = "*" } = _a, updateEntityOptions = tslib.__rest(_a, ["etag"]);
|
|
4858
4763
|
if (mode === "Merge") {
|
|
4859
|
-
return
|
|
4764
|
+
return this.table.mergeEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
|
|
4860
4765
|
}
|
|
4861
4766
|
if (mode === "Replace") {
|
|
4862
|
-
return
|
|
4767
|
+
return this.table.updateEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
|
|
4863
4768
|
}
|
|
4864
4769
|
throw new Error(`Unexpected value for update mode: ${mode}`);
|
|
4865
|
-
}
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
}
|
|
4870
|
-
finally {
|
|
4871
|
-
span.end();
|
|
4872
|
-
}
|
|
4770
|
+
}, {
|
|
4771
|
+
spanAttributes: {
|
|
4772
|
+
updateEntityMode: mode,
|
|
4773
|
+
},
|
|
4774
|
+
});
|
|
4873
4775
|
}
|
|
4874
4776
|
/**
|
|
4875
4777
|
* Upsert an entity in the table.
|
|
@@ -4906,66 +4808,46 @@ class TableClient {
|
|
|
4906
4808
|
* await client.upsertEntity(entity, "Replace")
|
|
4907
4809
|
* ```
|
|
4908
4810
|
*/
|
|
4909
|
-
|
|
4811
|
+
upsertEntity(entity, mode = "Merge",
|
|
4910
4812
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4911
4813
|
options = {}) {
|
|
4912
|
-
|
|
4913
|
-
try {
|
|
4814
|
+
return tracingClient.withSpan("TableClient.upsertEntity", options, async (updatedOptions) => {
|
|
4914
4815
|
const partitionKey = escapeQuotes(entity.partitionKey);
|
|
4915
4816
|
const rowKey = escapeQuotes(entity.rowKey);
|
|
4916
4817
|
if (mode === "Merge") {
|
|
4917
|
-
return
|
|
4818
|
+
return this.table.mergeEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
|
|
4918
4819
|
}
|
|
4919
4820
|
if (mode === "Replace") {
|
|
4920
|
-
return
|
|
4821
|
+
return this.table.updateEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
|
|
4921
4822
|
}
|
|
4922
4823
|
throw new Error(`Unexpected value for update mode: ${mode}`);
|
|
4923
|
-
}
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
}
|
|
4928
|
-
finally {
|
|
4929
|
-
span.end();
|
|
4930
|
-
}
|
|
4824
|
+
}, {
|
|
4825
|
+
spanAttributes: {
|
|
4826
|
+
upsertEntityMode: mode,
|
|
4827
|
+
},
|
|
4828
|
+
});
|
|
4931
4829
|
}
|
|
4932
4830
|
/**
|
|
4933
4831
|
* Retrieves details about any stored access policies specified on the table that may be used with
|
|
4934
4832
|
* Shared Access Signatures.
|
|
4935
4833
|
* @param options - The options parameters.
|
|
4936
4834
|
*/
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
try {
|
|
4835
|
+
getAccessPolicy(options = {}) {
|
|
4836
|
+
return tracingClient.withSpan("TableClient.getAccessPolicy", options, async (updatedOptions) => {
|
|
4940
4837
|
const signedIdentifiers = await this.table.getAccessPolicy(this.tableName, updatedOptions);
|
|
4941
4838
|
return deserializeSignedIdentifier(signedIdentifiers);
|
|
4942
|
-
}
|
|
4943
|
-
catch (e) {
|
|
4944
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4945
|
-
throw e;
|
|
4946
|
-
}
|
|
4947
|
-
finally {
|
|
4948
|
-
span.end();
|
|
4949
|
-
}
|
|
4839
|
+
});
|
|
4950
4840
|
}
|
|
4951
4841
|
/**
|
|
4952
4842
|
* Sets stored access policies for the table that may be used with Shared Access Signatures.
|
|
4953
4843
|
* @param tableAcl - The Access Control List for the table.
|
|
4954
4844
|
* @param options - The options parameters.
|
|
4955
4845
|
*/
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
try {
|
|
4846
|
+
setAccessPolicy(tableAcl, options = {}) {
|
|
4847
|
+
return tracingClient.withSpan("TableClient.setAccessPolicy", options, (updatedOptions) => {
|
|
4959
4848
|
const serlializedAcl = serializeSignedIdentifiers(tableAcl);
|
|
4960
|
-
return
|
|
4961
|
-
}
|
|
4962
|
-
catch (e) {
|
|
4963
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4964
|
-
throw e;
|
|
4965
|
-
}
|
|
4966
|
-
finally {
|
|
4967
|
-
span.end();
|
|
4968
|
-
}
|
|
4849
|
+
return this.table.setAccessPolicy(this.tableName, Object.assign(Object.assign({}, updatedOptions), { tableAcl: serlializedAcl }));
|
|
4850
|
+
});
|
|
4969
4851
|
}
|
|
4970
4852
|
/**
|
|
4971
4853
|
* Submits a Transaction which is composed of a set of actions. You can provide the actions as a list
|