@azure/data-tables 13.0.2-alpha.20220118.1 → 13.0.2-alpha.20220214.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 +41 -38
- 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 +11 -21
- package/types/3.1/data-tables.d.ts +1 -0
- package/types/latest/data-tables.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -3,17 +3,37 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
|
-
var coreAuth = require('@azure/core-auth');
|
|
7
|
-
var crypto = require('crypto');
|
|
8
6
|
require('@azure/core-paging');
|
|
7
|
+
var coreAuth = require('@azure/core-auth');
|
|
9
8
|
var coreXml = require('@azure/core-xml');
|
|
10
9
|
var coreClient = require('@azure/core-client');
|
|
11
10
|
var coreTracing = require('@azure/core-tracing');
|
|
12
11
|
var url$1 = require('url');
|
|
13
12
|
var logger$1 = require('@azure/logger');
|
|
13
|
+
var crypto = require('crypto');
|
|
14
14
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
15
15
|
var uuid = require('uuid');
|
|
16
16
|
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
19
|
+
var n = Object.create(null);
|
|
20
|
+
if (e) {
|
|
21
|
+
Object.keys(e).forEach(function (k) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return e[k]; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
n["default"] = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
|
|
36
|
+
|
|
17
37
|
/*
|
|
18
38
|
* Copyright (c) Microsoft Corporation.
|
|
19
39
|
* Licensed under the MIT License.
|
|
@@ -34,6 +54,8 @@ var KnownResponseFormat;
|
|
|
34
54
|
KnownResponseFormat["ReturnNoContent"] = "return-no-content";
|
|
35
55
|
KnownResponseFormat["ReturnContent"] = "return-content";
|
|
36
56
|
})(KnownResponseFormat || (KnownResponseFormat = {}));
|
|
57
|
+
/** Known values of {@link GeoReplicationStatusType} that the service accepts. */
|
|
58
|
+
exports.KnownGeoReplicationStatusType = void 0;
|
|
37
59
|
(function (KnownGeoReplicationStatusType) {
|
|
38
60
|
KnownGeoReplicationStatusType["Live"] = "live";
|
|
39
61
|
KnownGeoReplicationStatusType["Bootstrap"] = "bootstrap";
|
|
@@ -2596,8 +2618,8 @@ class TableImpl {
|
|
|
2596
2618
|
}
|
|
2597
2619
|
}
|
|
2598
2620
|
// Operation Specifications
|
|
2599
|
-
const xmlSerializer =
|
|
2600
|
-
const serializer =
|
|
2621
|
+
const xmlSerializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ true);
|
|
2622
|
+
const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
|
|
2601
2623
|
const queryOperationSpec = {
|
|
2602
2624
|
path: "/Tables",
|
|
2603
2625
|
httpMethod: "GET",
|
|
@@ -2897,7 +2919,7 @@ const getAccessPolicyOperationSpec = {
|
|
|
2897
2919
|
accept2
|
|
2898
2920
|
],
|
|
2899
2921
|
isXML: true,
|
|
2900
|
-
serializer: xmlSerializer
|
|
2922
|
+
serializer: xmlSerializer$1
|
|
2901
2923
|
};
|
|
2902
2924
|
const setAccessPolicyOperationSpec = {
|
|
2903
2925
|
path: "/{table}",
|
|
@@ -2923,7 +2945,7 @@ const setAccessPolicyOperationSpec = {
|
|
|
2923
2945
|
isXML: true,
|
|
2924
2946
|
contentType: "application/xml; charset=utf-8",
|
|
2925
2947
|
mediaType: "xml",
|
|
2926
|
-
serializer: xmlSerializer
|
|
2948
|
+
serializer: xmlSerializer$1
|
|
2927
2949
|
};
|
|
2928
2950
|
|
|
2929
2951
|
/*
|
|
@@ -2969,7 +2991,7 @@ class ServiceImpl {
|
|
|
2969
2991
|
}
|
|
2970
2992
|
}
|
|
2971
2993
|
// Operation Specifications
|
|
2972
|
-
const xmlSerializer
|
|
2994
|
+
const xmlSerializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ true);
|
|
2973
2995
|
const setPropertiesOperationSpec = {
|
|
2974
2996
|
path: "/",
|
|
2975
2997
|
httpMethod: "PUT",
|
|
@@ -2994,7 +3016,7 @@ const setPropertiesOperationSpec = {
|
|
|
2994
3016
|
isXML: true,
|
|
2995
3017
|
contentType: "application/xml; charset=utf-8",
|
|
2996
3018
|
mediaType: "xml",
|
|
2997
|
-
serializer: xmlSerializer
|
|
3019
|
+
serializer: xmlSerializer
|
|
2998
3020
|
};
|
|
2999
3021
|
const getPropertiesOperationSpec = {
|
|
3000
3022
|
path: "/",
|
|
@@ -3017,7 +3039,7 @@ const getPropertiesOperationSpec = {
|
|
|
3017
3039
|
accept2
|
|
3018
3040
|
],
|
|
3019
3041
|
isXML: true,
|
|
3020
|
-
serializer: xmlSerializer
|
|
3042
|
+
serializer: xmlSerializer
|
|
3021
3043
|
};
|
|
3022
3044
|
const getStatisticsOperationSpec = {
|
|
3023
3045
|
path: "/",
|
|
@@ -3040,7 +3062,7 @@ const getStatisticsOperationSpec = {
|
|
|
3040
3062
|
accept2
|
|
3041
3063
|
],
|
|
3042
3064
|
isXML: true,
|
|
3043
|
-
serializer: xmlSerializer
|
|
3065
|
+
serializer: xmlSerializer
|
|
3044
3066
|
};
|
|
3045
3067
|
|
|
3046
3068
|
/*
|
|
@@ -3051,7 +3073,7 @@ const getStatisticsOperationSpec = {
|
|
|
3051
3073
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
3052
3074
|
*/
|
|
3053
3075
|
/** @internal */
|
|
3054
|
-
class GeneratedClientContext extends
|
|
3076
|
+
class GeneratedClientContext extends coreClient__namespace.ServiceClient {
|
|
3055
3077
|
/**
|
|
3056
3078
|
* Initializes a new instance of the GeneratedClientContext class.
|
|
3057
3079
|
* @param url The URL of the service account or table that is the target of the desired operation.
|
|
@@ -3852,9 +3874,8 @@ class InternalTableTransaction {
|
|
|
3852
3874
|
* @param partitionKey - partition key
|
|
3853
3875
|
* @param credential - credential to authenticate the transaction request
|
|
3854
3876
|
*/
|
|
3855
|
-
constructor(url, partitionKey, transactionId, changesetId,
|
|
3856
|
-
this.
|
|
3857
|
-
this.credential = credential;
|
|
3877
|
+
constructor(url, partitionKey, transactionId, changesetId, client, interceptClient, credential, allowInsecureConnection = false) {
|
|
3878
|
+
this.client = client;
|
|
3858
3879
|
this.url = url;
|
|
3859
3880
|
this.interceptClient = interceptClient;
|
|
3860
3881
|
this.allowInsecureConnection = allowInsecureConnection;
|
|
@@ -3948,12 +3969,6 @@ class InternalTableTransaction {
|
|
|
3948
3969
|
async submitTransaction() {
|
|
3949
3970
|
await Promise.all(this.resetableState.pendingOperations);
|
|
3950
3971
|
const body = getTransactionHttpRequestBody(this.resetableState.bodyParts, this.resetableState.transactionId, this.resetableState.changesetId);
|
|
3951
|
-
const options = this.clientOptions;
|
|
3952
|
-
if (coreAuth.isTokenCredential(this.credential)) {
|
|
3953
|
-
options.credentialScopes = STORAGE_SCOPE;
|
|
3954
|
-
options.credential = this.credential;
|
|
3955
|
-
}
|
|
3956
|
-
const client = new coreClient.ServiceClient(options);
|
|
3957
3972
|
const headers = getTransactionHeaders(this.resetableState.transactionId);
|
|
3958
3973
|
const { span, updatedOptions } = createSpan("TableTransaction-submitTransaction", {});
|
|
3959
3974
|
const request = coreRestPipeline.createPipelineRequest({
|
|
@@ -3964,15 +3979,8 @@ class InternalTableTransaction {
|
|
|
3964
3979
|
tracingOptions: updatedOptions.tracingOptions,
|
|
3965
3980
|
allowInsecureConnection: this.allowInsecureConnection,
|
|
3966
3981
|
});
|
|
3967
|
-
if (coreAuth.isNamedKeyCredential(this.credential)) {
|
|
3968
|
-
const authHeader = getAuthorizationHeader(request, this.credential);
|
|
3969
|
-
request.headers.set("Authorization", authHeader);
|
|
3970
|
-
}
|
|
3971
|
-
else if (coreAuth.isSASCredential(this.credential)) {
|
|
3972
|
-
signURLWithSAS(request, this.credential);
|
|
3973
|
-
}
|
|
3974
3982
|
try {
|
|
3975
|
-
const rawTransactionResponse = await client.sendRequest(request);
|
|
3983
|
+
const rawTransactionResponse = await this.client.sendRequest(request);
|
|
3976
3984
|
return parseTransactionResponse(rawTransactionResponse);
|
|
3977
3985
|
}
|
|
3978
3986
|
catch (error) {
|
|
@@ -4416,6 +4424,7 @@ class TableClient {
|
|
|
4416
4424
|
if (isCosmosEndpoint(this.url)) {
|
|
4417
4425
|
generatedClient.pipeline.addPolicy(cosmosPatchPolicy());
|
|
4418
4426
|
}
|
|
4427
|
+
this.generatedClient = generatedClient;
|
|
4419
4428
|
this.table = generatedClient.table;
|
|
4420
4429
|
this.pipeline = generatedClient.pipeline;
|
|
4421
4430
|
}
|
|
@@ -4952,7 +4961,7 @@ class TableClient {
|
|
|
4952
4961
|
const changesetId = Uuid.generateUuid();
|
|
4953
4962
|
if (!this.transactionClient) {
|
|
4954
4963
|
// Add pipeline
|
|
4955
|
-
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);
|
|
4956
4965
|
}
|
|
4957
4966
|
else {
|
|
4958
4967
|
this.transactionClient.reset(transactionId, changesetId, partitionKey);
|
|
@@ -5003,21 +5012,15 @@ class TableClient {
|
|
|
5003
5012
|
|
|
5004
5013
|
Object.defineProperty(exports, 'AzureNamedKeyCredential', {
|
|
5005
5014
|
enumerable: true,
|
|
5006
|
-
get: function () {
|
|
5007
|
-
return coreAuth.AzureNamedKeyCredential;
|
|
5008
|
-
}
|
|
5015
|
+
get: function () { return coreAuth.AzureNamedKeyCredential; }
|
|
5009
5016
|
});
|
|
5010
5017
|
Object.defineProperty(exports, 'AzureSASCredential', {
|
|
5011
5018
|
enumerable: true,
|
|
5012
|
-
get: function () {
|
|
5013
|
-
return coreAuth.AzureSASCredential;
|
|
5014
|
-
}
|
|
5019
|
+
get: function () { return coreAuth.AzureSASCredential; }
|
|
5015
5020
|
});
|
|
5016
5021
|
Object.defineProperty(exports, 'RestError', {
|
|
5017
5022
|
enumerable: true,
|
|
5018
|
-
get: function () {
|
|
5019
|
-
return coreRestPipeline.RestError;
|
|
5020
|
-
}
|
|
5023
|
+
get: function () { return coreRestPipeline.RestError; }
|
|
5021
5024
|
});
|
|
5022
5025
|
exports.TableClient = TableClient;
|
|
5023
5026
|
exports.TableServiceClient = TableServiceClient;
|