@azure/data-tables 13.0.2-alpha.20220208.1 → 13.0.2-alpha.20220211.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/dist/index.js +5 -18
- package/dist/index.js.map +1 -1
- package/dist-esm/src/TableClient.js +2 -1
- package/dist-esm/src/TableClient.js.map +1 -1
- package/dist-esm/src/TableTransaction.js +4 -22
- package/dist-esm/src/TableTransaction.js.map +1 -1
- package/package.json +7 -6
- package/types/3.1/data-tables.d.ts +1 -0
- package/types/latest/data-tables.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -3874,9 +3874,8 @@ class InternalTableTransaction {
|
|
|
3874
3874
|
* @param partitionKey - partition key
|
|
3875
3875
|
* @param credential - credential to authenticate the transaction request
|
|
3876
3876
|
*/
|
|
3877
|
-
constructor(url, partitionKey, transactionId, changesetId,
|
|
3878
|
-
this.
|
|
3879
|
-
this.credential = credential;
|
|
3877
|
+
constructor(url, partitionKey, transactionId, changesetId, client, interceptClient, credential, allowInsecureConnection = false) {
|
|
3878
|
+
this.client = client;
|
|
3880
3879
|
this.url = url;
|
|
3881
3880
|
this.interceptClient = interceptClient;
|
|
3882
3881
|
this.allowInsecureConnection = allowInsecureConnection;
|
|
@@ -3970,12 +3969,6 @@ class InternalTableTransaction {
|
|
|
3970
3969
|
async submitTransaction() {
|
|
3971
3970
|
await Promise.all(this.resetableState.pendingOperations);
|
|
3972
3971
|
const body = getTransactionHttpRequestBody(this.resetableState.bodyParts, this.resetableState.transactionId, this.resetableState.changesetId);
|
|
3973
|
-
const options = this.clientOptions;
|
|
3974
|
-
if (coreAuth.isTokenCredential(this.credential)) {
|
|
3975
|
-
options.credentialScopes = STORAGE_SCOPE;
|
|
3976
|
-
options.credential = this.credential;
|
|
3977
|
-
}
|
|
3978
|
-
const client = new coreClient.ServiceClient(options);
|
|
3979
3972
|
const headers = getTransactionHeaders(this.resetableState.transactionId);
|
|
3980
3973
|
const { span, updatedOptions } = createSpan("TableTransaction-submitTransaction", {});
|
|
3981
3974
|
const request = coreRestPipeline.createPipelineRequest({
|
|
@@ -3986,15 +3979,8 @@ class InternalTableTransaction {
|
|
|
3986
3979
|
tracingOptions: updatedOptions.tracingOptions,
|
|
3987
3980
|
allowInsecureConnection: this.allowInsecureConnection,
|
|
3988
3981
|
});
|
|
3989
|
-
if (coreAuth.isNamedKeyCredential(this.credential)) {
|
|
3990
|
-
const authHeader = getAuthorizationHeader(request, this.credential);
|
|
3991
|
-
request.headers.set("Authorization", authHeader);
|
|
3992
|
-
}
|
|
3993
|
-
else if (coreAuth.isSASCredential(this.credential)) {
|
|
3994
|
-
signURLWithSAS(request, this.credential);
|
|
3995
|
-
}
|
|
3996
3982
|
try {
|
|
3997
|
-
const rawTransactionResponse = await client.sendRequest(request);
|
|
3983
|
+
const rawTransactionResponse = await this.client.sendRequest(request);
|
|
3998
3984
|
return parseTransactionResponse(rawTransactionResponse);
|
|
3999
3985
|
}
|
|
4000
3986
|
catch (error) {
|
|
@@ -4438,6 +4424,7 @@ class TableClient {
|
|
|
4438
4424
|
if (isCosmosEndpoint(this.url)) {
|
|
4439
4425
|
generatedClient.pipeline.addPolicy(cosmosPatchPolicy());
|
|
4440
4426
|
}
|
|
4427
|
+
this.generatedClient = generatedClient;
|
|
4441
4428
|
this.table = generatedClient.table;
|
|
4442
4429
|
this.pipeline = generatedClient.pipeline;
|
|
4443
4430
|
}
|
|
@@ -4974,7 +4961,7 @@ class TableClient {
|
|
|
4974
4961
|
const changesetId = Uuid.generateUuid();
|
|
4975
4962
|
if (!this.transactionClient) {
|
|
4976
4963
|
// Add pipeline
|
|
4977
|
-
this.transactionClient = new InternalTableTransaction(this.url, partitionKey, transactionId, changesetId, this.
|
|
4964
|
+
this.transactionClient = new InternalTableTransaction(this.url, partitionKey, transactionId, changesetId, this.generatedClient, new TableClient(this.url, this.tableName), this.credential, this.allowInsecureConnection);
|
|
4978
4965
|
}
|
|
4979
4966
|
else {
|
|
4980
4967
|
this.transactionClient.reset(transactionId, changesetId, partitionKey);
|