@azure/data-tables 13.0.2-alpha.20220214.1 → 13.1.0-alpha.20220216.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/CHANGELOG.md +5 -1
- package/dist/index.js +130 -248
- 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 +36 -79
- 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
|
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
### Other Changes
|
|
12
12
|
|
|
13
|
+
- Updated our `@azure/core-tracing` dependency to the latest version (1.0.0-preview.14)
|
|
14
|
+
- Notable changes include Removal of `@opentelemetry/api` as a transitive dependency and ensuring that the active context is properly propagated.
|
|
15
|
+
- 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.
|
|
16
|
+
|
|
13
17
|
## 13.0.1 (2022-01-12)
|
|
14
18
|
|
|
15
19
|
### 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
|
|
|
@@ -3090,7 +3090,7 @@ class GeneratedClientContext extends coreClient__namespace.ServiceClient {
|
|
|
3090
3090
|
const defaults = {
|
|
3091
3091
|
requestContentType: "application/json; charset=utf-8"
|
|
3092
3092
|
};
|
|
3093
|
-
const packageDetails = `azsdk-js-data-tables/13.0
|
|
3093
|
+
const packageDetails = `azsdk-js-data-tables/13.1.0`;
|
|
3094
3094
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
3095
3095
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
3096
3096
|
: `${packageDetails}`;
|
|
@@ -3126,16 +3126,6 @@ class GeneratedClient extends GeneratedClientContext {
|
|
|
3126
3126
|
}
|
|
3127
3127
|
}
|
|
3128
3128
|
|
|
3129
|
-
// Copyright (c) Microsoft Corporation.
|
|
3130
|
-
/**
|
|
3131
|
-
* Creates a span using the global tracer.
|
|
3132
|
-
* @internal
|
|
3133
|
-
*/
|
|
3134
|
-
const createSpan = coreTracing.createSpanFunction({
|
|
3135
|
-
packagePrefix: "Azure.Data.Tables",
|
|
3136
|
-
namespace: "Microsoft.Data.Tables",
|
|
3137
|
-
});
|
|
3138
|
-
|
|
3139
3129
|
// Copyright (c) Microsoft Corporation.
|
|
3140
3130
|
/**
|
|
3141
3131
|
* Gets client parameters from an Account Connection String
|
|
@@ -3308,8 +3298,9 @@ function getAccountNameFromUrl(url) {
|
|
|
3308
3298
|
}
|
|
3309
3299
|
|
|
3310
3300
|
// Copyright (c) Microsoft Corporation.
|
|
3301
|
+
// Licensed under the MIT license.
|
|
3311
3302
|
function handleTableAlreadyExists(error, options = {}) {
|
|
3312
|
-
var _a, _b
|
|
3303
|
+
var _a, _b;
|
|
3313
3304
|
const responseError = getErrorResponse(error);
|
|
3314
3305
|
if (responseError &&
|
|
3315
3306
|
responseError.status === 409 &&
|
|
@@ -3320,7 +3311,6 @@ function handleTableAlreadyExists(error, options = {}) {
|
|
|
3320
3311
|
}
|
|
3321
3312
|
}
|
|
3322
3313
|
else {
|
|
3323
|
-
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 });
|
|
3324
3314
|
throw error;
|
|
3325
3315
|
}
|
|
3326
3316
|
}
|
|
@@ -3438,6 +3428,17 @@ function signURLWithSAS(request, credential) {
|
|
|
3438
3428
|
request.url = url.toString();
|
|
3439
3429
|
}
|
|
3440
3430
|
|
|
3431
|
+
// Copyright (c) Microsoft Corporation.
|
|
3432
|
+
/**
|
|
3433
|
+
* A tracing client that can be used to manage spans.
|
|
3434
|
+
* @internal
|
|
3435
|
+
*/
|
|
3436
|
+
const tracingClient = coreTracing.createTracingClient({
|
|
3437
|
+
namespace: "Microsoft.Data.Tables",
|
|
3438
|
+
packageName: "@azure/data-tables",
|
|
3439
|
+
packageVersion: "13.1.0",
|
|
3440
|
+
});
|
|
3441
|
+
|
|
3441
3442
|
// Copyright (c) Microsoft Corporation.
|
|
3442
3443
|
/**
|
|
3443
3444
|
* A TableServiceClient represents a Client to the Azure Tables service allowing you
|
|
@@ -3477,36 +3478,16 @@ class TableServiceClient {
|
|
|
3477
3478
|
* secondary location endpoint when read-access geo-redundant replication is enabled for the account.
|
|
3478
3479
|
* @param options - The options parameters.
|
|
3479
3480
|
*/
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
try {
|
|
3483
|
-
return await this.service.getStatistics(updatedOptions);
|
|
3484
|
-
}
|
|
3485
|
-
catch (e) {
|
|
3486
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3487
|
-
throw e;
|
|
3488
|
-
}
|
|
3489
|
-
finally {
|
|
3490
|
-
span.end();
|
|
3491
|
-
}
|
|
3481
|
+
getStatistics(options = {}) {
|
|
3482
|
+
return tracingClient.withSpan("TableServiceClient.getStatistics", options, (updatedOptions) => this.service.getStatistics(updatedOptions));
|
|
3492
3483
|
}
|
|
3493
3484
|
/**
|
|
3494
3485
|
* Gets the properties of an account's Table service, including properties for Analytics and CORS
|
|
3495
3486
|
* (Cross-Origin Resource Sharing) rules.
|
|
3496
3487
|
* @param options - The options parameters.
|
|
3497
3488
|
*/
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
try {
|
|
3501
|
-
return await this.service.getProperties(updatedOptions);
|
|
3502
|
-
}
|
|
3503
|
-
catch (e) {
|
|
3504
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3505
|
-
throw e;
|
|
3506
|
-
}
|
|
3507
|
-
finally {
|
|
3508
|
-
span.end();
|
|
3509
|
-
}
|
|
3489
|
+
getProperties(options = {}) {
|
|
3490
|
+
return tracingClient.withSpan("TableServiceClient.getProperties", options, (updatedOptions) => this.service.getProperties(updatedOptions));
|
|
3510
3491
|
}
|
|
3511
3492
|
/**
|
|
3512
3493
|
* Sets properties for an account's Table service endpoint, including properties for Analytics and CORS
|
|
@@ -3514,58 +3495,43 @@ class TableServiceClient {
|
|
|
3514
3495
|
* @param properties - The Table Service properties.
|
|
3515
3496
|
* @param options - The options parameters.
|
|
3516
3497
|
*/
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
try {
|
|
3520
|
-
return await this.service.setProperties(properties, updatedOptions);
|
|
3521
|
-
}
|
|
3522
|
-
catch (e) {
|
|
3523
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3524
|
-
throw e;
|
|
3525
|
-
}
|
|
3526
|
-
finally {
|
|
3527
|
-
span.end();
|
|
3528
|
-
}
|
|
3498
|
+
setProperties(properties, options = {}) {
|
|
3499
|
+
return tracingClient.withSpan("TableServiceClient.setProperties", options, (updatedOptions) => this.service.setProperties(properties, updatedOptions));
|
|
3529
3500
|
}
|
|
3530
3501
|
/**
|
|
3531
3502
|
* Creates a new table under the given account.
|
|
3532
3503
|
* @param name - The name of the table.
|
|
3533
3504
|
* @param options - The options parameters.
|
|
3534
3505
|
*/
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
span.end();
|
|
3545
|
-
}
|
|
3506
|
+
createTable(name, options = {}) {
|
|
3507
|
+
return tracingClient.withSpan("TableServiceClient.createTable", options, async (updatedOptions) => {
|
|
3508
|
+
try {
|
|
3509
|
+
await this.table.create({ name }, updatedOptions);
|
|
3510
|
+
}
|
|
3511
|
+
catch (e) {
|
|
3512
|
+
handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger, tableName: name }));
|
|
3513
|
+
}
|
|
3514
|
+
});
|
|
3546
3515
|
}
|
|
3547
3516
|
/**
|
|
3548
3517
|
* Operation permanently deletes the specified table.
|
|
3549
3518
|
* @param name - The name of the table.
|
|
3550
3519
|
* @param options - The options parameters.
|
|
3551
3520
|
*/
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
}
|
|
3557
|
-
catch (e) {
|
|
3558
|
-
if (e.statusCode === 404) {
|
|
3559
|
-
logger.info("TableServiceClient-deleteTable: Table doesn't exist");
|
|
3521
|
+
deleteTable(name, options = {}) {
|
|
3522
|
+
return tracingClient.withSpan("TableServiceClient.deleteTable", options, async (updatedOptions) => {
|
|
3523
|
+
try {
|
|
3524
|
+
await this.table.delete(name, updatedOptions);
|
|
3560
3525
|
}
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3526
|
+
catch (e) {
|
|
3527
|
+
if (e.statusCode === 404) {
|
|
3528
|
+
logger.info("TableServiceClient-deleteTable: Table doesn't exist");
|
|
3529
|
+
}
|
|
3530
|
+
else {
|
|
3531
|
+
throw e;
|
|
3532
|
+
}
|
|
3564
3533
|
}
|
|
3565
|
-
}
|
|
3566
|
-
finally {
|
|
3567
|
-
span.end();
|
|
3568
|
-
}
|
|
3534
|
+
});
|
|
3569
3535
|
}
|
|
3570
3536
|
/**
|
|
3571
3537
|
* Queries tables under the given account.
|
|
@@ -3617,22 +3583,15 @@ class TableServiceClient {
|
|
|
3617
3583
|
}
|
|
3618
3584
|
listTablesPage(options = {}) {
|
|
3619
3585
|
return tslib.__asyncGenerator(this, arguments, function* listTablesPage_1() {
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3586
|
+
let result = yield tslib.__await(tracingClient.withSpan("TableServiceClient.listTablesPage", options, (updatedOptions) => this._listTables(updatedOptions)));
|
|
3587
|
+
yield yield tslib.__await(result);
|
|
3588
|
+
while (result.continuationToken) {
|
|
3589
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken: result.continuationToken });
|
|
3590
|
+
result = yield tslib.__await(tracingClient.withSpan("TableServiceClient.listTablesPage", optionsWithContinuation, async (updatedOptions, span) => {
|
|
3591
|
+
span.setAttribute("continuationToken", updatedOptions.continuationToken);
|
|
3592
|
+
return this._listTables(updatedOptions);
|
|
3593
|
+
}));
|
|
3623
3594
|
yield yield tslib.__await(result);
|
|
3624
|
-
while (result.continuationToken) {
|
|
3625
|
-
const optionsWithContinuation = Object.assign(Object.assign({}, updatedOptions), { continuationToken: result.continuationToken });
|
|
3626
|
-
result = yield tslib.__await(this._listTables(optionsWithContinuation));
|
|
3627
|
-
yield yield tslib.__await(result);
|
|
3628
|
-
}
|
|
3629
|
-
}
|
|
3630
|
-
catch (e) {
|
|
3631
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
3632
|
-
throw e;
|
|
3633
|
-
}
|
|
3634
|
-
finally {
|
|
3635
|
-
span.end();
|
|
3636
3595
|
}
|
|
3637
3596
|
});
|
|
3638
3597
|
}
|
|
@@ -3970,29 +3929,18 @@ class InternalTableTransaction {
|
|
|
3970
3929
|
await Promise.all(this.resetableState.pendingOperations);
|
|
3971
3930
|
const body = getTransactionHttpRequestBody(this.resetableState.bodyParts, this.resetableState.transactionId, this.resetableState.changesetId);
|
|
3972
3931
|
const headers = getTransactionHeaders(this.resetableState.transactionId);
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
try {
|
|
3932
|
+
return tracingClient.withSpan("TableTransaction.submitTransaction", {}, async (updatedOptions) => {
|
|
3933
|
+
const request = coreRestPipeline.createPipelineRequest({
|
|
3934
|
+
url: this.url,
|
|
3935
|
+
method: "POST",
|
|
3936
|
+
body,
|
|
3937
|
+
headers: coreRestPipeline.createHttpHeaders(headers),
|
|
3938
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
3939
|
+
allowInsecureConnection: this.allowInsecureConnection,
|
|
3940
|
+
});
|
|
3983
3941
|
const rawTransactionResponse = await this.client.sendRequest(request);
|
|
3984
3942
|
return parseTransactionResponse(rawTransactionResponse);
|
|
3985
|
-
}
|
|
3986
|
-
catch (error) {
|
|
3987
|
-
span.setStatus({
|
|
3988
|
-
code: coreTracing.SpanStatusCode.ERROR,
|
|
3989
|
-
message: error.message,
|
|
3990
|
-
});
|
|
3991
|
-
throw error;
|
|
3992
|
-
}
|
|
3993
|
-
finally {
|
|
3994
|
-
span.end();
|
|
3995
|
-
}
|
|
3943
|
+
});
|
|
3996
3944
|
}
|
|
3997
3945
|
checkPartitionKey(partitionKey) {
|
|
3998
3946
|
if (this.resetableState.partitionKey !== partitionKey) {
|
|
@@ -4453,23 +4401,17 @@ class TableClient {
|
|
|
4453
4401
|
* ```
|
|
4454
4402
|
*/
|
|
4455
4403
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
}
|
|
4461
|
-
catch (e) {
|
|
4462
|
-
if (e.statusCode === 404) {
|
|
4463
|
-
logger.info("TableClient-deleteTable: Table doesn't exist");
|
|
4404
|
+
deleteTable(options = {}) {
|
|
4405
|
+
return tracingClient.withSpan("TableClient.deleteTable", options, async (updatedOptions) => {
|
|
4406
|
+
try {
|
|
4407
|
+
await this.table.delete(this.tableName, updatedOptions);
|
|
4464
4408
|
}
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4409
|
+
catch (e) {
|
|
4410
|
+
if (e.statusCode === 404) {
|
|
4411
|
+
logger.info("TableClient.deleteTable: Table doesn't exist");
|
|
4412
|
+
}
|
|
4468
4413
|
}
|
|
4469
|
-
}
|
|
4470
|
-
finally {
|
|
4471
|
-
span.end();
|
|
4472
|
-
}
|
|
4414
|
+
});
|
|
4473
4415
|
}
|
|
4474
4416
|
/**
|
|
4475
4417
|
* Creates a table with the tableName passed to the client constructor
|
|
@@ -4497,17 +4439,15 @@ class TableClient {
|
|
|
4497
4439
|
* ```
|
|
4498
4440
|
*/
|
|
4499
4441
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
span.end();
|
|
4510
|
-
}
|
|
4442
|
+
createTable(options = {}) {
|
|
4443
|
+
return tracingClient.withSpan("TableClient.createTable", options, async (updatedOptions) => {
|
|
4444
|
+
try {
|
|
4445
|
+
await this.table.create({ name: this.tableName }, updatedOptions);
|
|
4446
|
+
}
|
|
4447
|
+
catch (e) {
|
|
4448
|
+
handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger, tableName: this.tableName }));
|
|
4449
|
+
}
|
|
4450
|
+
});
|
|
4511
4451
|
}
|
|
4512
4452
|
/**
|
|
4513
4453
|
* Returns a single entity in the table.
|
|
@@ -4536,30 +4476,22 @@ class TableClient {
|
|
|
4536
4476
|
* console.log(entity);
|
|
4537
4477
|
* ```
|
|
4538
4478
|
*/
|
|
4539
|
-
|
|
4479
|
+
getEntity(partitionKey, rowKey,
|
|
4540
4480
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4541
4481
|
options = {}) {
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4482
|
+
return tracingClient.withSpan("TableClient.getEntity", options, async (updatedOptions) => {
|
|
4483
|
+
let parsedBody;
|
|
4484
|
+
function onResponse(rawResponse, flatResponse) {
|
|
4485
|
+
parsedBody = rawResponse.parsedBody;
|
|
4486
|
+
if (updatedOptions.onResponse) {
|
|
4487
|
+
updatedOptions.onResponse(rawResponse, flatResponse);
|
|
4488
|
+
}
|
|
4548
4489
|
}
|
|
4549
|
-
|
|
4550
|
-
try {
|
|
4551
|
-
const _a = updatedOptions || {}, { disableTypeConversion, queryOptions } = _a, getEntityOptions = tslib.__rest(_a, ["disableTypeConversion", "queryOptions"]);
|
|
4490
|
+
const { disableTypeConversion, queryOptions } = updatedOptions, getEntityOptions = tslib.__rest(updatedOptions, ["disableTypeConversion", "queryOptions"]);
|
|
4552
4491
|
await this.table.queryEntitiesWithPartitionAndRowKey(this.tableName, escapeQuotes(partitionKey), escapeQuotes(rowKey), Object.assign(Object.assign({}, getEntityOptions), { queryOptions: serializeQueryOptions(queryOptions || {}), onResponse }));
|
|
4553
4492
|
const tableEntity = deserialize(parsedBody, disableTypeConversion !== null && disableTypeConversion !== void 0 ? disableTypeConversion : false);
|
|
4554
4493
|
return tableEntity;
|
|
4555
|
-
}
|
|
4556
|
-
catch (e) {
|
|
4557
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4558
|
-
throw e;
|
|
4559
|
-
}
|
|
4560
|
-
finally {
|
|
4561
|
-
span.end();
|
|
4562
|
-
}
|
|
4494
|
+
});
|
|
4563
4495
|
}
|
|
4564
4496
|
/**
|
|
4565
4497
|
* Queries entities in a table.
|
|
@@ -4637,25 +4569,15 @@ class TableClient {
|
|
|
4637
4569
|
}
|
|
4638
4570
|
listEntitiesPage(tableName, options = {}) {
|
|
4639
4571
|
return tslib.__asyncGenerator(this, arguments, function* listEntitiesPage_1() {
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4572
|
+
let result = yield tslib.__await(tracingClient.withSpan("TableClient.listEntitiesPage", options, (updatedOptions) => this._listEntities(tableName, updatedOptions)));
|
|
4573
|
+
yield yield tslib.__await(result);
|
|
4574
|
+
while (result.continuationToken) {
|
|
4575
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken: result.continuationToken });
|
|
4576
|
+
result = yield tslib.__await(tracingClient.withSpan("TableClient.listEntitiesPage", optionsWithContinuation, (updatedOptions, span) => {
|
|
4577
|
+
span.setAttribute("continuationToken", result.continuationToken);
|
|
4578
|
+
return this._listEntities(tableName, updatedOptions);
|
|
4579
|
+
}));
|
|
4643
4580
|
yield yield tslib.__await(result);
|
|
4644
|
-
while (result.continuationToken) {
|
|
4645
|
-
const optionsWithContinuation = Object.assign(Object.assign({}, updatedOptions), { continuationToken: result.continuationToken });
|
|
4646
|
-
result = yield tslib.__await(this._listEntities(tableName, optionsWithContinuation));
|
|
4647
|
-
yield yield tslib.__await(result);
|
|
4648
|
-
}
|
|
4649
|
-
}
|
|
4650
|
-
catch (e) {
|
|
4651
|
-
span.setStatus({
|
|
4652
|
-
code: coreTracing.SpanStatusCode.ERROR,
|
|
4653
|
-
message: e.message,
|
|
4654
|
-
});
|
|
4655
|
-
throw e;
|
|
4656
|
-
}
|
|
4657
|
-
finally {
|
|
4658
|
-
span.end();
|
|
4659
4581
|
}
|
|
4660
4582
|
});
|
|
4661
4583
|
}
|
|
@@ -4703,21 +4625,13 @@ class TableClient {
|
|
|
4703
4625
|
* await client.createEntity({partitionKey: "p1", rowKey: "r1", foo: "Hello!"});
|
|
4704
4626
|
* ```
|
|
4705
4627
|
*/
|
|
4706
|
-
|
|
4628
|
+
createEntity(entity,
|
|
4707
4629
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4708
4630
|
options = {}) {
|
|
4709
|
-
|
|
4710
|
-
try {
|
|
4631
|
+
return tracingClient.withSpan("TableClient.createEntity", options, (updatedOptions) => {
|
|
4711
4632
|
const createTableEntity = tslib.__rest(updatedOptions || {}, []);
|
|
4712
|
-
return
|
|
4713
|
-
}
|
|
4714
|
-
catch (e) {
|
|
4715
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4716
|
-
throw e;
|
|
4717
|
-
}
|
|
4718
|
-
finally {
|
|
4719
|
-
span.end();
|
|
4720
|
-
}
|
|
4633
|
+
return this.table.insertEntity(this.tableName, Object.assign(Object.assign({}, createTableEntity), { tableEntityProperties: serialize(entity), responsePreference: "return-no-content" }));
|
|
4634
|
+
});
|
|
4721
4635
|
}
|
|
4722
4636
|
/**
|
|
4723
4637
|
* Deletes the specified entity in the table.
|
|
@@ -4744,22 +4658,14 @@ class TableClient {
|
|
|
4744
4658
|
* await client.deleteEntity("<partitionKey>", "<rowKey>")
|
|
4745
4659
|
* ```
|
|
4746
4660
|
*/
|
|
4747
|
-
|
|
4661
|
+
deleteEntity(partitionKey, rowKey,
|
|
4748
4662
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4749
4663
|
options = {}) {
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
const _a = updatedOptions || {}, { etag = "*" } = _a, rest = tslib.__rest(_a, ["etag"]);
|
|
4664
|
+
return tracingClient.withSpan("TableClient.deleteEntity", options, (updatedOptions) => {
|
|
4665
|
+
const { etag = "*" } = updatedOptions, rest = tslib.__rest(updatedOptions, ["etag"]);
|
|
4753
4666
|
const deleteOptions = Object.assign({}, rest);
|
|
4754
|
-
return
|
|
4755
|
-
}
|
|
4756
|
-
catch (e) {
|
|
4757
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4758
|
-
throw e;
|
|
4759
|
-
}
|
|
4760
|
-
finally {
|
|
4761
|
-
span.end();
|
|
4762
|
-
}
|
|
4667
|
+
return this.table.deleteEntity(this.tableName, escapeQuotes(partitionKey), escapeQuotes(rowKey), etag, deleteOptions);
|
|
4668
|
+
});
|
|
4763
4669
|
}
|
|
4764
4670
|
/**
|
|
4765
4671
|
* Update an entity in the table.
|
|
@@ -4800,29 +4706,25 @@ class TableClient {
|
|
|
4800
4706
|
* await client.updateEntity(entity, "Replace")
|
|
4801
4707
|
* ```
|
|
4802
4708
|
*/
|
|
4803
|
-
|
|
4709
|
+
updateEntity(entity, mode = "Merge",
|
|
4804
4710
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4805
4711
|
options = {}) {
|
|
4806
|
-
|
|
4807
|
-
try {
|
|
4712
|
+
return tracingClient.withSpan("TableClient.updateEntity", options, async (updatedOptions) => {
|
|
4808
4713
|
const partitionKey = escapeQuotes(entity.partitionKey);
|
|
4809
4714
|
const rowKey = escapeQuotes(entity.rowKey);
|
|
4810
4715
|
const _a = updatedOptions || {}, { etag = "*" } = _a, updateEntityOptions = tslib.__rest(_a, ["etag"]);
|
|
4811
4716
|
if (mode === "Merge") {
|
|
4812
|
-
return
|
|
4717
|
+
return this.table.mergeEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
|
|
4813
4718
|
}
|
|
4814
4719
|
if (mode === "Replace") {
|
|
4815
|
-
return
|
|
4720
|
+
return this.table.updateEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
|
|
4816
4721
|
}
|
|
4817
4722
|
throw new Error(`Unexpected value for update mode: ${mode}`);
|
|
4818
|
-
}
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
}
|
|
4823
|
-
finally {
|
|
4824
|
-
span.end();
|
|
4825
|
-
}
|
|
4723
|
+
}, {
|
|
4724
|
+
spanAttributes: {
|
|
4725
|
+
updateEntityMode: mode,
|
|
4726
|
+
},
|
|
4727
|
+
});
|
|
4826
4728
|
}
|
|
4827
4729
|
/**
|
|
4828
4730
|
* Upsert an entity in the table.
|
|
@@ -4859,66 +4761,46 @@ class TableClient {
|
|
|
4859
4761
|
* await client.upsertEntity(entity, "Replace")
|
|
4860
4762
|
* ```
|
|
4861
4763
|
*/
|
|
4862
|
-
|
|
4764
|
+
upsertEntity(entity, mode = "Merge",
|
|
4863
4765
|
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4864
4766
|
options = {}) {
|
|
4865
|
-
|
|
4866
|
-
try {
|
|
4767
|
+
return tracingClient.withSpan("TableClient.upsertEntity", options, async (updatedOptions) => {
|
|
4867
4768
|
const partitionKey = escapeQuotes(entity.partitionKey);
|
|
4868
4769
|
const rowKey = escapeQuotes(entity.rowKey);
|
|
4869
4770
|
if (mode === "Merge") {
|
|
4870
|
-
return
|
|
4771
|
+
return this.table.mergeEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
|
|
4871
4772
|
}
|
|
4872
4773
|
if (mode === "Replace") {
|
|
4873
|
-
return
|
|
4774
|
+
return this.table.updateEntity(this.tableName, partitionKey, rowKey, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
|
|
4874
4775
|
}
|
|
4875
4776
|
throw new Error(`Unexpected value for update mode: ${mode}`);
|
|
4876
|
-
}
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
}
|
|
4881
|
-
finally {
|
|
4882
|
-
span.end();
|
|
4883
|
-
}
|
|
4777
|
+
}, {
|
|
4778
|
+
spanAttributes: {
|
|
4779
|
+
upsertEntityMode: mode,
|
|
4780
|
+
},
|
|
4781
|
+
});
|
|
4884
4782
|
}
|
|
4885
4783
|
/**
|
|
4886
4784
|
* Retrieves details about any stored access policies specified on the table that may be used with
|
|
4887
4785
|
* Shared Access Signatures.
|
|
4888
4786
|
* @param options - The options parameters.
|
|
4889
4787
|
*/
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
try {
|
|
4788
|
+
getAccessPolicy(options = {}) {
|
|
4789
|
+
return tracingClient.withSpan("TableClient.getAccessPolicy", options, async (updatedOptions) => {
|
|
4893
4790
|
const signedIdentifiers = await this.table.getAccessPolicy(this.tableName, updatedOptions);
|
|
4894
4791
|
return deserializeSignedIdentifier(signedIdentifiers);
|
|
4895
|
-
}
|
|
4896
|
-
catch (e) {
|
|
4897
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4898
|
-
throw e;
|
|
4899
|
-
}
|
|
4900
|
-
finally {
|
|
4901
|
-
span.end();
|
|
4902
|
-
}
|
|
4792
|
+
});
|
|
4903
4793
|
}
|
|
4904
4794
|
/**
|
|
4905
4795
|
* Sets stored access policies for the table that may be used with Shared Access Signatures.
|
|
4906
4796
|
* @param tableAcl - The Access Control List for the table.
|
|
4907
4797
|
* @param options - The options parameters.
|
|
4908
4798
|
*/
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
try {
|
|
4799
|
+
setAccessPolicy(tableAcl, options = {}) {
|
|
4800
|
+
return tracingClient.withSpan("TableClient.setAccessPolicy", options, (updatedOptions) => {
|
|
4912
4801
|
const serlializedAcl = serializeSignedIdentifiers(tableAcl);
|
|
4913
|
-
return
|
|
4914
|
-
}
|
|
4915
|
-
catch (e) {
|
|
4916
|
-
span.setStatus({ code: coreTracing.SpanStatusCode.ERROR, message: e.message });
|
|
4917
|
-
throw e;
|
|
4918
|
-
}
|
|
4919
|
-
finally {
|
|
4920
|
-
span.end();
|
|
4921
|
-
}
|
|
4802
|
+
return this.table.setAccessPolicy(this.tableName, Object.assign(Object.assign({}, updatedOptions), { tableAcl: serlializedAcl }));
|
|
4803
|
+
});
|
|
4922
4804
|
}
|
|
4923
4805
|
/**
|
|
4924
4806
|
* Submits a Transaction which is composed of a set of actions. You can provide the actions as a list
|