@ms-cloudpack/remote-cache 0.10.10 → 0.10.12
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/{AzureRemoteCacheClient-GTJWKYFP.js → AzureRemoteCacheClient-AY675HJK.js} +125 -80
- package/dist/{chunk-AAHKL65V.js → chunk-E464X2TG.js} +73 -52
- package/dist/{chunk-RCTPZOA2.js → chunk-EZBP4ZKN.js} +114 -111
- package/dist/{getCredential-GVAO2BWN.js → getCredential-OSAAVWZC.js} +112 -99
- package/dist/index.js +4804 -6
- package/lib/AzureAppRegistryClient.d.ts +19 -0
- package/lib/createAppRegistryClient.d.ts +24 -0
- package/lib/createStorageUrl.d.ts +3 -0
- package/lib/index.d.ts +5 -0
- package/lib/types/AppRegistration.d.ts +46 -0
- package/lib/types/AppRegistryClient.d.ts +28 -0
- package/lib/types/PagedResult.d.ts +5 -0
- package/lib/utils/getReverseSortedTimestamp.d.ts +2 -0
- package/lib/utils/safeDecodeURIComponent.d.ts +12 -0
- package/lib/utils/safeEncodeURIComponent.d.ts +12 -0
- package/package.json +5 -3
- package/lib/createBlobStorageUrl.d.ts +0 -2
package/dist/index.js
CHANGED
|
@@ -5,16 +5,4673 @@ const require = topLevelCreateRequire(import.meta.url);
|
|
|
5
5
|
const __filename = topLevelUrl.fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = topLevelPath.dirname(__filename);
|
|
7
7
|
import {
|
|
8
|
+
require_commonjs as require_commonjs5,
|
|
9
|
+
require_commonjs2 as require_commonjs7,
|
|
8
10
|
require_dist
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EZBP4ZKN.js";
|
|
10
12
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
init_tslib_es6,
|
|
14
|
+
require_commonjs,
|
|
15
|
+
require_commonjs3 as require_commonjs2,
|
|
16
|
+
require_commonjs4 as require_commonjs3,
|
|
17
|
+
require_commonjs5 as require_commonjs4,
|
|
18
|
+
require_commonjs6,
|
|
19
|
+
tslib_es6_exports
|
|
20
|
+
} from "./chunk-E464X2TG.js";
|
|
13
21
|
import {
|
|
22
|
+
__commonJS,
|
|
14
23
|
__name,
|
|
24
|
+
__require,
|
|
25
|
+
__toCommonJS,
|
|
15
26
|
__toESM
|
|
16
27
|
} from "./chunk-NFU5RQB4.js";
|
|
17
28
|
|
|
29
|
+
// ../../node_modules/.store/@azure-data-tables-npm-13.3.0-eaf9124dcc/package/dist/index.js
|
|
30
|
+
var require_dist2 = __commonJS({
|
|
31
|
+
"../../node_modules/.store/@azure-data-tables-npm-13.3.0-eaf9124dcc/package/dist/index.js"(exports) {
|
|
32
|
+
"use strict";
|
|
33
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
+
var tslib = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
35
|
+
var coreAuth = require_commonjs5();
|
|
36
|
+
var coreXml = require_commonjs7();
|
|
37
|
+
var coreClient = require_commonjs6();
|
|
38
|
+
var logger$1 = require_commonjs();
|
|
39
|
+
var coreRestPipeline = require_commonjs4();
|
|
40
|
+
var crypto = __require("crypto");
|
|
41
|
+
var coreTracing = require_commonjs3();
|
|
42
|
+
var coreUtil = require_commonjs2();
|
|
43
|
+
function _interopNamespaceDefault(e) {
|
|
44
|
+
var n = /* @__PURE__ */ Object.create(null);
|
|
45
|
+
if (e) {
|
|
46
|
+
Object.keys(e).forEach(function(k) {
|
|
47
|
+
if (k !== "default") {
|
|
48
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
49
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: /* @__PURE__ */ __name(function() {
|
|
52
|
+
return e[k];
|
|
53
|
+
}, "get")
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
n.default = e;
|
|
59
|
+
return Object.freeze(n);
|
|
60
|
+
}
|
|
61
|
+
__name(_interopNamespaceDefault, "_interopNamespaceDefault");
|
|
62
|
+
var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient);
|
|
63
|
+
var KnownOdataMetadataFormat;
|
|
64
|
+
(function(KnownOdataMetadataFormat2) {
|
|
65
|
+
KnownOdataMetadataFormat2["ApplicationJsonOdataNometadata"] = "application/json;odata=nometadata";
|
|
66
|
+
KnownOdataMetadataFormat2["ApplicationJsonOdataMinimalmetadata"] = "application/json;odata=minimalmetadata";
|
|
67
|
+
KnownOdataMetadataFormat2["ApplicationJsonOdataFullmetadata"] = "application/json;odata=fullmetadata";
|
|
68
|
+
})(KnownOdataMetadataFormat || (KnownOdataMetadataFormat = {}));
|
|
69
|
+
var KnownResponseFormat;
|
|
70
|
+
(function(KnownResponseFormat2) {
|
|
71
|
+
KnownResponseFormat2["ReturnNoContent"] = "return-no-content";
|
|
72
|
+
KnownResponseFormat2["ReturnContent"] = "return-content";
|
|
73
|
+
})(KnownResponseFormat || (KnownResponseFormat = {}));
|
|
74
|
+
exports.KnownGeoReplicationStatusType = void 0;
|
|
75
|
+
(function(KnownGeoReplicationStatusType) {
|
|
76
|
+
KnownGeoReplicationStatusType["Live"] = "live";
|
|
77
|
+
KnownGeoReplicationStatusType["Bootstrap"] = "bootstrap";
|
|
78
|
+
KnownGeoReplicationStatusType["Unavailable"] = "unavailable";
|
|
79
|
+
})(exports.KnownGeoReplicationStatusType || (exports.KnownGeoReplicationStatusType = {}));
|
|
80
|
+
function accountSasPermissionsFromString(permissions) {
|
|
81
|
+
const accountSasPermissions = {};
|
|
82
|
+
for (const c of permissions) {
|
|
83
|
+
switch (c) {
|
|
84
|
+
case "r":
|
|
85
|
+
accountSasPermissions.query = true;
|
|
86
|
+
break;
|
|
87
|
+
case "w":
|
|
88
|
+
accountSasPermissions.write = true;
|
|
89
|
+
break;
|
|
90
|
+
case "d":
|
|
91
|
+
accountSasPermissions.delete = true;
|
|
92
|
+
break;
|
|
93
|
+
case "l":
|
|
94
|
+
accountSasPermissions.list = true;
|
|
95
|
+
break;
|
|
96
|
+
case "a":
|
|
97
|
+
accountSasPermissions.add = true;
|
|
98
|
+
break;
|
|
99
|
+
case "u":
|
|
100
|
+
accountSasPermissions.update = true;
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
throw new RangeError(`Invalid permission character: ${c}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return accountSasPermissions;
|
|
107
|
+
}
|
|
108
|
+
__name(accountSasPermissionsFromString, "accountSasPermissionsFromString");
|
|
109
|
+
function accountSasPermissionsToString(permissions) {
|
|
110
|
+
const permissionString = [];
|
|
111
|
+
if (permissions.query) {
|
|
112
|
+
permissionString.push("r");
|
|
113
|
+
}
|
|
114
|
+
if (permissions.write) {
|
|
115
|
+
permissionString.push("w");
|
|
116
|
+
}
|
|
117
|
+
if (permissions.delete) {
|
|
118
|
+
permissionString.push("d");
|
|
119
|
+
}
|
|
120
|
+
if (permissions.list) {
|
|
121
|
+
permissionString.push("l");
|
|
122
|
+
}
|
|
123
|
+
if (permissions.add) {
|
|
124
|
+
permissionString.push("a");
|
|
125
|
+
}
|
|
126
|
+
if (permissions.update) {
|
|
127
|
+
permissionString.push("u");
|
|
128
|
+
}
|
|
129
|
+
return permissionString.join("");
|
|
130
|
+
}
|
|
131
|
+
__name(accountSasPermissionsToString, "accountSasPermissionsToString");
|
|
132
|
+
function accountSasServicesFromString(services) {
|
|
133
|
+
const accountSasServices = {};
|
|
134
|
+
for (const c of services) {
|
|
135
|
+
switch (c) {
|
|
136
|
+
case "b":
|
|
137
|
+
accountSasServices.blob = true;
|
|
138
|
+
break;
|
|
139
|
+
case "f":
|
|
140
|
+
accountSasServices.file = true;
|
|
141
|
+
break;
|
|
142
|
+
case "q":
|
|
143
|
+
accountSasServices.queue = true;
|
|
144
|
+
break;
|
|
145
|
+
case "t":
|
|
146
|
+
accountSasServices.table = true;
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
throw new RangeError(`Invalid service character: ${c}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return accountSasServices;
|
|
153
|
+
}
|
|
154
|
+
__name(accountSasServicesFromString, "accountSasServicesFromString");
|
|
155
|
+
function accountSasServicesToString(services = { table: true }) {
|
|
156
|
+
const servicesString = [];
|
|
157
|
+
if (services.blob) {
|
|
158
|
+
servicesString.push("b");
|
|
159
|
+
}
|
|
160
|
+
if (services.table) {
|
|
161
|
+
servicesString.push("t");
|
|
162
|
+
}
|
|
163
|
+
if (services.queue) {
|
|
164
|
+
servicesString.push("q");
|
|
165
|
+
}
|
|
166
|
+
if (services.file) {
|
|
167
|
+
servicesString.push("f");
|
|
168
|
+
}
|
|
169
|
+
return servicesString.join("");
|
|
170
|
+
}
|
|
171
|
+
__name(accountSasServicesToString, "accountSasServicesToString");
|
|
172
|
+
function ipRangeToString(ipRange) {
|
|
173
|
+
if (!ipRange) {
|
|
174
|
+
return "";
|
|
175
|
+
}
|
|
176
|
+
return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;
|
|
177
|
+
}
|
|
178
|
+
__name(ipRangeToString, "ipRangeToString");
|
|
179
|
+
function truncatedISO8061Date(date, withMilliseconds = true) {
|
|
180
|
+
const dateString = date.toISOString();
|
|
181
|
+
return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z";
|
|
182
|
+
}
|
|
183
|
+
__name(truncatedISO8061Date, "truncatedISO8061Date");
|
|
184
|
+
var _SasQueryParameters = class _SasQueryParameters {
|
|
185
|
+
/**
|
|
186
|
+
* Optional. IP range allowed for this SAS.
|
|
187
|
+
*
|
|
188
|
+
* @readonly
|
|
189
|
+
*/
|
|
190
|
+
get ipRange() {
|
|
191
|
+
if (this.ipRangeInner) {
|
|
192
|
+
return {
|
|
193
|
+
end: this.ipRangeInner.end,
|
|
194
|
+
start: this.ipRangeInner.start
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
return void 0;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Creates an instance of SASQueryParameters.
|
|
201
|
+
*
|
|
202
|
+
* @param version - Representing the table service version
|
|
203
|
+
* @param signature - Representing the signature for the SAS token
|
|
204
|
+
* @param options - Optional. Options to construct the SASQueryParameters.
|
|
205
|
+
*/
|
|
206
|
+
constructor(version2, signature, options = {}) {
|
|
207
|
+
this.version = version2;
|
|
208
|
+
this.signature = signature;
|
|
209
|
+
this.permissions = options.permissions;
|
|
210
|
+
this.services = options.services;
|
|
211
|
+
this.resourceTypes = options.resourceTypes;
|
|
212
|
+
this.protocol = options.protocol;
|
|
213
|
+
this.startsOn = options.startsOn;
|
|
214
|
+
this.expiresOn = options.expiresOn;
|
|
215
|
+
this.ipRangeInner = options.ipRange;
|
|
216
|
+
this.identifier = options.identifier;
|
|
217
|
+
this.tableName = options.tableName;
|
|
218
|
+
this.endPartitionKey = options.endPartitionKey;
|
|
219
|
+
this.endRowKey = options.endRowKey;
|
|
220
|
+
this.startPartitionKey = options.startPartitionKey;
|
|
221
|
+
this.startRowKey = options.startRowKey;
|
|
222
|
+
if (options.userDelegationKey) {
|
|
223
|
+
this.signedOid = options.userDelegationKey.signedObjectId;
|
|
224
|
+
this.signedTenantId = options.userDelegationKey.signedTenantId;
|
|
225
|
+
this.signedStartsOn = options.userDelegationKey.signedStartsOn;
|
|
226
|
+
this.signedExpiresOn = options.userDelegationKey.signedExpiresOn;
|
|
227
|
+
this.signedService = options.userDelegationKey.signedService;
|
|
228
|
+
this.signedVersion = options.userDelegationKey.signedVersion;
|
|
229
|
+
this.preauthorizedAgentObjectId = options.preauthorizedAgentObjectId;
|
|
230
|
+
this.correlationId = options.correlationId;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Encodes all SAS query parameters into a string that can be appended to a URL.
|
|
235
|
+
*
|
|
236
|
+
*/
|
|
237
|
+
toString() {
|
|
238
|
+
const params = [
|
|
239
|
+
"sv",
|
|
240
|
+
// SignedVersion
|
|
241
|
+
"ss",
|
|
242
|
+
// SignedServices
|
|
243
|
+
"srt",
|
|
244
|
+
// SignedResourceTypes
|
|
245
|
+
"spr",
|
|
246
|
+
// SignedProtocol
|
|
247
|
+
"st",
|
|
248
|
+
// SignedStart
|
|
249
|
+
"se",
|
|
250
|
+
// SignedExpiry
|
|
251
|
+
"sip",
|
|
252
|
+
// SignedIP
|
|
253
|
+
"si",
|
|
254
|
+
// SignedIdentifier
|
|
255
|
+
"skoid",
|
|
256
|
+
// Signed object ID
|
|
257
|
+
"sktid",
|
|
258
|
+
// Signed tenant ID
|
|
259
|
+
"skt",
|
|
260
|
+
// Signed key start time
|
|
261
|
+
"ske",
|
|
262
|
+
// Signed key expiry time
|
|
263
|
+
"sks",
|
|
264
|
+
// Signed key service
|
|
265
|
+
"skv",
|
|
266
|
+
// Signed key version
|
|
267
|
+
"sr",
|
|
268
|
+
// signedResource
|
|
269
|
+
"sp",
|
|
270
|
+
// SignedPermission
|
|
271
|
+
"sig",
|
|
272
|
+
// Signature
|
|
273
|
+
"rscc",
|
|
274
|
+
// Cache-Control
|
|
275
|
+
"rscd",
|
|
276
|
+
// Content-Disposition
|
|
277
|
+
"rsce",
|
|
278
|
+
// Content-Encoding
|
|
279
|
+
"rscl",
|
|
280
|
+
// Content-Language
|
|
281
|
+
"rsct",
|
|
282
|
+
// Content-Type
|
|
283
|
+
"saoid",
|
|
284
|
+
// signedAuthorizedObjectId
|
|
285
|
+
"scid",
|
|
286
|
+
// signedCorrelationId
|
|
287
|
+
"tn",
|
|
288
|
+
// TableName,
|
|
289
|
+
"srk",
|
|
290
|
+
// StartRowKey
|
|
291
|
+
"spk",
|
|
292
|
+
// StartPartitionKey
|
|
293
|
+
"epk",
|
|
294
|
+
// EndPartitionKey
|
|
295
|
+
"erk"
|
|
296
|
+
// EndRowKey
|
|
297
|
+
];
|
|
298
|
+
const queries = [];
|
|
299
|
+
for (const param of params) {
|
|
300
|
+
switch (param) {
|
|
301
|
+
case "sv":
|
|
302
|
+
this.tryAppendQueryParameter(queries, param, this.version);
|
|
303
|
+
break;
|
|
304
|
+
case "ss":
|
|
305
|
+
this.tryAppendQueryParameter(queries, param, this.services);
|
|
306
|
+
break;
|
|
307
|
+
case "srt":
|
|
308
|
+
this.tryAppendQueryParameter(queries, param, this.resourceTypes);
|
|
309
|
+
break;
|
|
310
|
+
case "spr":
|
|
311
|
+
this.tryAppendQueryParameter(queries, param, this.protocol);
|
|
312
|
+
break;
|
|
313
|
+
case "st":
|
|
314
|
+
this.tryAppendQueryParameter(queries, param, this.startsOn ? truncatedISO8061Date(this.startsOn, false) : void 0);
|
|
315
|
+
break;
|
|
316
|
+
case "se":
|
|
317
|
+
this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0);
|
|
318
|
+
break;
|
|
319
|
+
case "sip":
|
|
320
|
+
this.tryAppendQueryParameter(queries, param, this.ipRange ? ipRangeToString(this.ipRange) : void 0);
|
|
321
|
+
break;
|
|
322
|
+
case "si":
|
|
323
|
+
this.tryAppendQueryParameter(queries, param, this.identifier);
|
|
324
|
+
break;
|
|
325
|
+
case "skoid":
|
|
326
|
+
this.tryAppendQueryParameter(queries, param, this.signedOid);
|
|
327
|
+
break;
|
|
328
|
+
case "sktid":
|
|
329
|
+
this.tryAppendQueryParameter(queries, param, this.signedTenantId);
|
|
330
|
+
break;
|
|
331
|
+
case "skt":
|
|
332
|
+
this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : void 0);
|
|
333
|
+
break;
|
|
334
|
+
case "ske":
|
|
335
|
+
this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : void 0);
|
|
336
|
+
break;
|
|
337
|
+
case "sks":
|
|
338
|
+
this.tryAppendQueryParameter(queries, param, this.signedService);
|
|
339
|
+
break;
|
|
340
|
+
case "skv":
|
|
341
|
+
this.tryAppendQueryParameter(queries, param, this.signedVersion);
|
|
342
|
+
break;
|
|
343
|
+
case "sp":
|
|
344
|
+
this.tryAppendQueryParameter(queries, param, this.permissions);
|
|
345
|
+
break;
|
|
346
|
+
case "sig":
|
|
347
|
+
this.tryAppendQueryParameter(queries, param, this.signature);
|
|
348
|
+
break;
|
|
349
|
+
case "saoid":
|
|
350
|
+
this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);
|
|
351
|
+
break;
|
|
352
|
+
case "scid":
|
|
353
|
+
this.tryAppendQueryParameter(queries, param, this.correlationId);
|
|
354
|
+
break;
|
|
355
|
+
case "tn":
|
|
356
|
+
this.tryAppendQueryParameter(queries, param, this.tableName);
|
|
357
|
+
break;
|
|
358
|
+
case "spk":
|
|
359
|
+
this.tryAppendQueryParameter(queries, param, this.startPartitionKey);
|
|
360
|
+
break;
|
|
361
|
+
case "srk":
|
|
362
|
+
this.tryAppendQueryParameter(queries, param, this.startRowKey);
|
|
363
|
+
break;
|
|
364
|
+
case "epk":
|
|
365
|
+
this.tryAppendQueryParameter(queries, param, this.endPartitionKey);
|
|
366
|
+
break;
|
|
367
|
+
case "erk":
|
|
368
|
+
this.tryAppendQueryParameter(queries, param, this.endRowKey);
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return queries.join("&");
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* A private helper method used to filter and append query key/value pairs into an array.
|
|
376
|
+
*
|
|
377
|
+
* @param queries -
|
|
378
|
+
* @param key -
|
|
379
|
+
* @param value -
|
|
380
|
+
*/
|
|
381
|
+
tryAppendQueryParameter(queries, key, value) {
|
|
382
|
+
if (!value) {
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
key = encodeURIComponent(key);
|
|
386
|
+
value = encodeURIComponent(value);
|
|
387
|
+
if (key.length > 0 && value.length > 0) {
|
|
388
|
+
queries.push(`${key}=${value}`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
};
|
|
392
|
+
__name(_SasQueryParameters, "SasQueryParameters");
|
|
393
|
+
var SasQueryParameters = _SasQueryParameters;
|
|
394
|
+
function accountSasResourceTypesFromString(resourceTypes) {
|
|
395
|
+
const accountSasResourceTypes = {};
|
|
396
|
+
for (const c of resourceTypes) {
|
|
397
|
+
switch (c) {
|
|
398
|
+
case "s":
|
|
399
|
+
accountSasResourceTypes.service = true;
|
|
400
|
+
break;
|
|
401
|
+
case "c":
|
|
402
|
+
accountSasResourceTypes.container = true;
|
|
403
|
+
break;
|
|
404
|
+
case "o":
|
|
405
|
+
accountSasResourceTypes.object = true;
|
|
406
|
+
break;
|
|
407
|
+
default:
|
|
408
|
+
throw new RangeError(`Invalid resource type: ${c}`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
return accountSasResourceTypes;
|
|
412
|
+
}
|
|
413
|
+
__name(accountSasResourceTypesFromString, "accountSasResourceTypesFromString");
|
|
414
|
+
function accountSasResourceTypesToString(resourceTypes) {
|
|
415
|
+
const resourceTypesString = [];
|
|
416
|
+
if (resourceTypes.service) {
|
|
417
|
+
resourceTypesString.push("s");
|
|
418
|
+
}
|
|
419
|
+
if (resourceTypes.container) {
|
|
420
|
+
resourceTypesString.push("c");
|
|
421
|
+
}
|
|
422
|
+
if (resourceTypes.object) {
|
|
423
|
+
resourceTypesString.push("o");
|
|
424
|
+
}
|
|
425
|
+
return resourceTypesString.join("");
|
|
426
|
+
}
|
|
427
|
+
__name(accountSasResourceTypesToString, "accountSasResourceTypesToString");
|
|
428
|
+
var SERVICE_VERSION = "2019-02-02";
|
|
429
|
+
var TRANSACTION_HTTP_VERSION_1_1 = "HTTP/1.1";
|
|
430
|
+
var TRANSACTION_HTTP_LINE_ENDING = "\r\n";
|
|
431
|
+
var STORAGE_SCOPE = "https://storage.azure.com/.default";
|
|
432
|
+
var COSMOS_SCOPE = "https://cosmos.azure.com/.default";
|
|
433
|
+
var HeaderConstants = {
|
|
434
|
+
AUTHORIZATION: "authorization",
|
|
435
|
+
CONTENT_LENGTH: "content-length",
|
|
436
|
+
CONTENT_MD5: "content-md5",
|
|
437
|
+
CONTENT_TYPE: "content-type",
|
|
438
|
+
CONTENT_TRANSFER_ENCODING: "content-transfer-encoding",
|
|
439
|
+
DATE: "date",
|
|
440
|
+
X_MS_DATE: "x-ms-date",
|
|
441
|
+
X_MS_VERSION: "x-ms-version"
|
|
442
|
+
};
|
|
443
|
+
var TablesLoggingAllowedHeaderNames = [
|
|
444
|
+
"Access-Control-Allow-Origin",
|
|
445
|
+
"Cache-Control",
|
|
446
|
+
"Content-Length",
|
|
447
|
+
"Content-Type",
|
|
448
|
+
"Date",
|
|
449
|
+
"Prefer",
|
|
450
|
+
"Preference-Applied",
|
|
451
|
+
"Request-Id",
|
|
452
|
+
"traceparent",
|
|
453
|
+
"Transfer-Encoding",
|
|
454
|
+
"User-Agent",
|
|
455
|
+
"x-ms-client-request-id",
|
|
456
|
+
"x-ms-user-agent",
|
|
457
|
+
"x-ms-date",
|
|
458
|
+
"x-ms-error-code",
|
|
459
|
+
"x-ms-request-id",
|
|
460
|
+
"x-ms-return-client-request-id",
|
|
461
|
+
"x-ms-version",
|
|
462
|
+
"Accept-Ranges",
|
|
463
|
+
"Accept",
|
|
464
|
+
"Content-Disposition",
|
|
465
|
+
"Content-Encoding",
|
|
466
|
+
"Content-Language",
|
|
467
|
+
"Content-MD5",
|
|
468
|
+
"Content-Range",
|
|
469
|
+
"ETag",
|
|
470
|
+
"Last-Modified",
|
|
471
|
+
"Server",
|
|
472
|
+
"Vary",
|
|
473
|
+
"x-ms-content-crc64",
|
|
474
|
+
"x-ms-copy-action",
|
|
475
|
+
"x-ms-copy-completion-time",
|
|
476
|
+
"x-ms-copy-id",
|
|
477
|
+
"x-ms-copy-progress",
|
|
478
|
+
"x-ms-copy-status",
|
|
479
|
+
"x-ms-continuation-NextTableName",
|
|
480
|
+
"x-ms-continuation-NextPartitionKey",
|
|
481
|
+
"x-ms-continuation-NextRowKey",
|
|
482
|
+
"x-ms-has-immutability-policy",
|
|
483
|
+
"x-ms-has-legal-hold",
|
|
484
|
+
"x-ms-lease-state",
|
|
485
|
+
"x-ms-lease-status",
|
|
486
|
+
"x-ms-range",
|
|
487
|
+
"x-ms-request-server-encrypted",
|
|
488
|
+
"x-ms-server-encrypted",
|
|
489
|
+
"x-ms-snapshot",
|
|
490
|
+
"x-ms-source-range",
|
|
491
|
+
"If-Match",
|
|
492
|
+
"If-Modified-Since",
|
|
493
|
+
"If-None-Match",
|
|
494
|
+
"If-Unmodified-Since",
|
|
495
|
+
"x-ms-access-tier",
|
|
496
|
+
"x-ms-access-tier-change-time",
|
|
497
|
+
"x-ms-access-tier-inferred",
|
|
498
|
+
"x-ms-account-kind",
|
|
499
|
+
"x-ms-archive-status",
|
|
500
|
+
"x-ms-copy-destination-snapshot",
|
|
501
|
+
"x-ms-creation-time",
|
|
502
|
+
"x-ms-default-encryption-scope",
|
|
503
|
+
"x-ms-delete-type-permanent",
|
|
504
|
+
"x-ms-deny-encryption-scope-override",
|
|
505
|
+
"x-ms-encryption-algorithm",
|
|
506
|
+
"x-ms-incremental-copy",
|
|
507
|
+
"x-ms-lease-action",
|
|
508
|
+
"x-ms-lease-break-period",
|
|
509
|
+
"x-ms-lease-duration",
|
|
510
|
+
"x-ms-lease-id",
|
|
511
|
+
"x-ms-lease-time",
|
|
512
|
+
"x-ms-page-write",
|
|
513
|
+
"x-ms-proposed-lease-id",
|
|
514
|
+
"x-ms-range-get-content-md5",
|
|
515
|
+
"x-ms-rehydrate-priority",
|
|
516
|
+
"x-ms-sequence-number-action",
|
|
517
|
+
"x-ms-sku-name",
|
|
518
|
+
"x-ms-source-content-md5",
|
|
519
|
+
"x-ms-source-if-match",
|
|
520
|
+
"x-ms-source-if-modified-since",
|
|
521
|
+
"x-ms-source-if-none-match",
|
|
522
|
+
"x-ms-source-if-unmodified-since",
|
|
523
|
+
"x-ms-tag-count",
|
|
524
|
+
"x-ms-encryption-key-sha256"
|
|
525
|
+
];
|
|
526
|
+
function computeHMACSHA256(stringToSign, accountKey) {
|
|
527
|
+
const key = Buffer.from(accountKey, "base64");
|
|
528
|
+
return crypto.createHmac("sha256", key).update(stringToSign, "utf8").digest("base64");
|
|
529
|
+
}
|
|
530
|
+
__name(computeHMACSHA256, "computeHMACSHA256");
|
|
531
|
+
function generateAccountSasQueryParameters(accountSasSignatureValues, credential) {
|
|
532
|
+
const version2 = accountSasSignatureValues.version ? accountSasSignatureValues.version : SERVICE_VERSION;
|
|
533
|
+
const parsedPermissions = accountSasPermissionsToString(accountSasSignatureValues.permissions);
|
|
534
|
+
const parsedServices = accountSasServicesToString(accountSasServicesFromString(accountSasSignatureValues.services));
|
|
535
|
+
const parsedResourceTypes = accountSasResourceTypesToString(accountSasResourceTypesFromString(accountSasSignatureValues.resourceTypes));
|
|
536
|
+
const stringToSign = [
|
|
537
|
+
credential.name,
|
|
538
|
+
parsedPermissions,
|
|
539
|
+
parsedServices,
|
|
540
|
+
parsedResourceTypes,
|
|
541
|
+
accountSasSignatureValues.startsOn ? truncatedISO8061Date(accountSasSignatureValues.startsOn, false) : "",
|
|
542
|
+
truncatedISO8061Date(accountSasSignatureValues.expiresOn, false),
|
|
543
|
+
accountSasSignatureValues.ipRange ? ipRangeToString(accountSasSignatureValues.ipRange) : "",
|
|
544
|
+
accountSasSignatureValues.protocol ? accountSasSignatureValues.protocol : "",
|
|
545
|
+
version2,
|
|
546
|
+
""
|
|
547
|
+
// Account SAS requires an additional newline character
|
|
548
|
+
].join("\n");
|
|
549
|
+
const signature = computeHMACSHA256(stringToSign, credential.key);
|
|
550
|
+
return new SasQueryParameters(version2, signature, {
|
|
551
|
+
permissions: parsedPermissions.toString(),
|
|
552
|
+
services: parsedServices,
|
|
553
|
+
resourceTypes: parsedResourceTypes,
|
|
554
|
+
protocol: accountSasSignatureValues.protocol,
|
|
555
|
+
startsOn: accountSasSignatureValues.startsOn,
|
|
556
|
+
expiresOn: accountSasSignatureValues.expiresOn,
|
|
557
|
+
ipRange: accountSasSignatureValues.ipRange
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
__name(generateAccountSasQueryParameters, "generateAccountSasQueryParameters");
|
|
561
|
+
function generateAccountSas(credential, options = {}) {
|
|
562
|
+
const { expiresOn, permissions = accountSasPermissionsFromString("rl"), resourceTypes = "sco", services = accountSasServicesFromString("t") } = options, rest = tslib.__rest(options, ["expiresOn", "permissions", "resourceTypes", "services"]);
|
|
563
|
+
if (!coreAuth.isNamedKeyCredential(credential)) {
|
|
564
|
+
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
565
|
+
}
|
|
566
|
+
let expiry = expiresOn;
|
|
567
|
+
if (expiry === void 0) {
|
|
568
|
+
const now = /* @__PURE__ */ new Date();
|
|
569
|
+
expiry = new Date(now.getTime() + 3600 * 1e3);
|
|
570
|
+
}
|
|
571
|
+
const sas = generateAccountSasQueryParameters(Object.assign({ permissions, expiresOn: expiry, resourceTypes, services: accountSasServicesToString(services) }, rest), credential).toString();
|
|
572
|
+
return sas;
|
|
573
|
+
}
|
|
574
|
+
__name(generateAccountSas, "generateAccountSas");
|
|
575
|
+
function tableSasPermissionsFromString(permissions) {
|
|
576
|
+
const tableSasPermissions = {};
|
|
577
|
+
for (const char of permissions) {
|
|
578
|
+
switch (char) {
|
|
579
|
+
case "r":
|
|
580
|
+
tableSasPermissions.query = true;
|
|
581
|
+
break;
|
|
582
|
+
case "a":
|
|
583
|
+
tableSasPermissions.add = true;
|
|
584
|
+
break;
|
|
585
|
+
case "u":
|
|
586
|
+
tableSasPermissions.update = true;
|
|
587
|
+
break;
|
|
588
|
+
case "d":
|
|
589
|
+
tableSasPermissions.delete = true;
|
|
590
|
+
break;
|
|
591
|
+
default:
|
|
592
|
+
throw new RangeError(`Invalid permission: ${char}`);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return tableSasPermissions;
|
|
596
|
+
}
|
|
597
|
+
__name(tableSasPermissionsFromString, "tableSasPermissionsFromString");
|
|
598
|
+
function tableSasPermissionsToString(permissions) {
|
|
599
|
+
if (!permissions) {
|
|
600
|
+
return "";
|
|
601
|
+
}
|
|
602
|
+
const permissionsString = [];
|
|
603
|
+
if (permissions.query) {
|
|
604
|
+
permissionsString.push("r");
|
|
605
|
+
}
|
|
606
|
+
if (permissions.add) {
|
|
607
|
+
permissionsString.push("a");
|
|
608
|
+
}
|
|
609
|
+
if (permissions.update) {
|
|
610
|
+
permissionsString.push("u");
|
|
611
|
+
}
|
|
612
|
+
if (permissions.delete) {
|
|
613
|
+
permissionsString.push("d");
|
|
614
|
+
}
|
|
615
|
+
return permissionsString.join("");
|
|
616
|
+
}
|
|
617
|
+
__name(tableSasPermissionsToString, "tableSasPermissionsToString");
|
|
618
|
+
function generateTableSasQueryParameters(tableName, credential, tableSasSignatureValues) {
|
|
619
|
+
var _a, _b, _c, _d, _e, _f;
|
|
620
|
+
const version2 = (_a = tableSasSignatureValues.version) !== null && _a !== void 0 ? _a : SERVICE_VERSION;
|
|
621
|
+
if (credential === void 0) {
|
|
622
|
+
throw TypeError("Invalid NamedKeyCredential");
|
|
623
|
+
}
|
|
624
|
+
if (!tableName) {
|
|
625
|
+
throw new Error("Must provide a 'tableName'");
|
|
626
|
+
}
|
|
627
|
+
const signedPermissions = tableSasPermissionsToString(tableSasSignatureValues.permissions);
|
|
628
|
+
const signedStart = tableSasSignatureValues.startsOn ? truncatedISO8061Date(
|
|
629
|
+
tableSasSignatureValues.startsOn,
|
|
630
|
+
false
|
|
631
|
+
/** withMilliseconds */
|
|
632
|
+
) : "";
|
|
633
|
+
const signedExpiry = tableSasSignatureValues.expiresOn ? truncatedISO8061Date(
|
|
634
|
+
tableSasSignatureValues.expiresOn,
|
|
635
|
+
false
|
|
636
|
+
/** withMilliseconds */
|
|
637
|
+
) : "";
|
|
638
|
+
const canonicalizedResource = getCanonicalName(credential.name, tableName);
|
|
639
|
+
const signedIdentifier = (_b = tableSasSignatureValues.identifier) !== null && _b !== void 0 ? _b : "";
|
|
640
|
+
const signedIP = ipRangeToString(tableSasSignatureValues.ipRange);
|
|
641
|
+
const signedProtocol = tableSasSignatureValues.protocol || "";
|
|
642
|
+
const startingPartitionKey = (_c = tableSasSignatureValues.startPartitionKey) !== null && _c !== void 0 ? _c : "";
|
|
643
|
+
const startingRowKey = (_d = tableSasSignatureValues.startRowKey) !== null && _d !== void 0 ? _d : "";
|
|
644
|
+
const endingPartitionKey = (_e = tableSasSignatureValues.endPartitionKey) !== null && _e !== void 0 ? _e : "";
|
|
645
|
+
const endingRowKey = (_f = tableSasSignatureValues.endRowKey) !== null && _f !== void 0 ? _f : "";
|
|
646
|
+
const stringToSign = [
|
|
647
|
+
signedPermissions,
|
|
648
|
+
signedStart,
|
|
649
|
+
signedExpiry,
|
|
650
|
+
canonicalizedResource,
|
|
651
|
+
signedIdentifier,
|
|
652
|
+
signedIP,
|
|
653
|
+
signedProtocol,
|
|
654
|
+
version2,
|
|
655
|
+
startingPartitionKey,
|
|
656
|
+
startingRowKey,
|
|
657
|
+
endingPartitionKey,
|
|
658
|
+
endingRowKey
|
|
659
|
+
].join("\n");
|
|
660
|
+
const signature = computeHMACSHA256(stringToSign, credential.key);
|
|
661
|
+
return new SasQueryParameters(version2, signature, {
|
|
662
|
+
permissions: signedPermissions,
|
|
663
|
+
protocol: tableSasSignatureValues.protocol,
|
|
664
|
+
startsOn: tableSasSignatureValues.startsOn,
|
|
665
|
+
expiresOn: tableSasSignatureValues.expiresOn,
|
|
666
|
+
ipRange: tableSasSignatureValues.ipRange,
|
|
667
|
+
identifier: tableSasSignatureValues.identifier,
|
|
668
|
+
tableName,
|
|
669
|
+
startPartitionKey: tableSasSignatureValues.startPartitionKey,
|
|
670
|
+
startRowKey: tableSasSignatureValues.startRowKey,
|
|
671
|
+
endPartitionKey: tableSasSignatureValues.endPartitionKey,
|
|
672
|
+
endRowKey: tableSasSignatureValues.endRowKey
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
__name(generateTableSasQueryParameters, "generateTableSasQueryParameters");
|
|
676
|
+
function getCanonicalName(accountName, tableName) {
|
|
677
|
+
return `/table/${accountName}/${tableName.toLowerCase()}`;
|
|
678
|
+
}
|
|
679
|
+
__name(getCanonicalName, "getCanonicalName");
|
|
680
|
+
function generateTableSas(tableName, credential, options = {}) {
|
|
681
|
+
let { expiresOn, permissions } = options;
|
|
682
|
+
if (!coreAuth.isNamedKeyCredential(credential)) {
|
|
683
|
+
throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential");
|
|
684
|
+
}
|
|
685
|
+
if (!options.identifier) {
|
|
686
|
+
if (!permissions) {
|
|
687
|
+
permissions = tableSasPermissionsFromString("r");
|
|
688
|
+
}
|
|
689
|
+
if (expiresOn === void 0) {
|
|
690
|
+
const now = /* @__PURE__ */ new Date();
|
|
691
|
+
expiresOn = new Date(now.getTime() + 3600 * 1e3);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
const sas = generateTableSasQueryParameters(tableName, credential, Object.assign(Object.assign({}, options), {
|
|
695
|
+
expiresOn,
|
|
696
|
+
permissions
|
|
697
|
+
})).toString();
|
|
698
|
+
return sas;
|
|
699
|
+
}
|
|
700
|
+
__name(generateTableSas, "generateTableSas");
|
|
701
|
+
var tablesSecondaryEndpointPolicyName = "tablesSecondaryEndpointPolicy";
|
|
702
|
+
var SecondaryLocationHeaderName = "tables-secondary-endpoint";
|
|
703
|
+
var SecondaryLocationAccountSuffix = "-secondary";
|
|
704
|
+
var tablesSecondaryEndpointPolicy = {
|
|
705
|
+
name: tablesSecondaryEndpointPolicyName,
|
|
706
|
+
sendRequest: /* @__PURE__ */ __name(async (req, next) => {
|
|
707
|
+
if (req.headers.get(SecondaryLocationHeaderName)) {
|
|
708
|
+
req.headers.delete(SecondaryLocationHeaderName);
|
|
709
|
+
req.url = getSecondaryUrlFromPrimary(req.url);
|
|
710
|
+
}
|
|
711
|
+
return next(req);
|
|
712
|
+
}, "sendRequest")
|
|
713
|
+
};
|
|
714
|
+
function injectSecondaryEndpointHeader(options) {
|
|
715
|
+
var _a;
|
|
716
|
+
const headerToInject = { [SecondaryLocationHeaderName]: "true" };
|
|
717
|
+
return Object.assign(Object.assign({}, options), { requestOptions: Object.assign(Object.assign({}, options.requestOptions), { customHeaders: Object.assign(Object.assign({}, (_a = options.requestOptions) === null || _a === void 0 ? void 0 : _a.customHeaders), headerToInject) }) });
|
|
718
|
+
}
|
|
719
|
+
__name(injectSecondaryEndpointHeader, "injectSecondaryEndpointHeader");
|
|
720
|
+
function getSecondaryUrlFromPrimary(primaryUrl) {
|
|
721
|
+
const parsedPrimaryUrl = new URL(primaryUrl);
|
|
722
|
+
const host = parsedPrimaryUrl.hostname.split(".");
|
|
723
|
+
if (host.length > 1) {
|
|
724
|
+
host[0] = `${host[0]}${SecondaryLocationAccountSuffix}`;
|
|
725
|
+
}
|
|
726
|
+
parsedPrimaryUrl.hostname = host.join(".");
|
|
727
|
+
return parsedPrimaryUrl.toString();
|
|
728
|
+
}
|
|
729
|
+
__name(getSecondaryUrlFromPrimary, "getSecondaryUrlFromPrimary");
|
|
730
|
+
var TableQueryResponse = {
|
|
731
|
+
serializedName: "TableQueryResponse",
|
|
732
|
+
type: {
|
|
733
|
+
name: "Composite",
|
|
734
|
+
className: "TableQueryResponse",
|
|
735
|
+
modelProperties: {
|
|
736
|
+
odataMetadata: {
|
|
737
|
+
serializedName: "odata\\.metadata",
|
|
738
|
+
xmlName: "odata\\.metadata",
|
|
739
|
+
type: {
|
|
740
|
+
name: "String"
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
value: {
|
|
744
|
+
serializedName: "value",
|
|
745
|
+
xmlName: "value",
|
|
746
|
+
xmlElementName: "TableResponseProperties",
|
|
747
|
+
type: {
|
|
748
|
+
name: "Sequence",
|
|
749
|
+
element: {
|
|
750
|
+
type: {
|
|
751
|
+
name: "Composite",
|
|
752
|
+
className: "TableResponseProperties"
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
var TableResponseProperties = {
|
|
761
|
+
serializedName: "TableResponseProperties",
|
|
762
|
+
type: {
|
|
763
|
+
name: "Composite",
|
|
764
|
+
className: "TableResponseProperties",
|
|
765
|
+
modelProperties: {
|
|
766
|
+
name: {
|
|
767
|
+
serializedName: "TableName",
|
|
768
|
+
xmlName: "TableName",
|
|
769
|
+
type: {
|
|
770
|
+
name: "String"
|
|
771
|
+
}
|
|
772
|
+
},
|
|
773
|
+
odataType: {
|
|
774
|
+
serializedName: "odata\\.type",
|
|
775
|
+
xmlName: "odata\\.type",
|
|
776
|
+
type: {
|
|
777
|
+
name: "String"
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
odataId: {
|
|
781
|
+
serializedName: "odata\\.id",
|
|
782
|
+
xmlName: "odata\\.id",
|
|
783
|
+
type: {
|
|
784
|
+
name: "String"
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
odataEditLink: {
|
|
788
|
+
serializedName: "odata\\.editLink",
|
|
789
|
+
xmlName: "odata\\.editLink",
|
|
790
|
+
type: {
|
|
791
|
+
name: "String"
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
var TableServiceError = {
|
|
798
|
+
serializedName: "TableServiceError",
|
|
799
|
+
type: {
|
|
800
|
+
name: "Composite",
|
|
801
|
+
className: "TableServiceError",
|
|
802
|
+
modelProperties: {
|
|
803
|
+
odataError: {
|
|
804
|
+
serializedName: "odata\\.error",
|
|
805
|
+
xmlName: "odata\\.error",
|
|
806
|
+
type: {
|
|
807
|
+
name: "Composite",
|
|
808
|
+
className: "TableServiceErrorOdataError"
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
var TableServiceErrorOdataError = {
|
|
815
|
+
serializedName: "TableServiceErrorOdataError",
|
|
816
|
+
type: {
|
|
817
|
+
name: "Composite",
|
|
818
|
+
className: "TableServiceErrorOdataError",
|
|
819
|
+
modelProperties: {
|
|
820
|
+
code: {
|
|
821
|
+
serializedName: "code",
|
|
822
|
+
xmlName: "code",
|
|
823
|
+
type: {
|
|
824
|
+
name: "String"
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
message: {
|
|
828
|
+
serializedName: "message",
|
|
829
|
+
xmlName: "message",
|
|
830
|
+
type: {
|
|
831
|
+
name: "Composite",
|
|
832
|
+
className: "TableServiceErrorOdataErrorMessage"
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
var TableServiceErrorOdataErrorMessage = {
|
|
839
|
+
serializedName: "TableServiceErrorOdataErrorMessage",
|
|
840
|
+
type: {
|
|
841
|
+
name: "Composite",
|
|
842
|
+
className: "TableServiceErrorOdataErrorMessage",
|
|
843
|
+
modelProperties: {
|
|
844
|
+
lang: {
|
|
845
|
+
serializedName: "lang",
|
|
846
|
+
xmlName: "lang",
|
|
847
|
+
type: {
|
|
848
|
+
name: "String"
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
value: {
|
|
852
|
+
serializedName: "value",
|
|
853
|
+
xmlName: "value",
|
|
854
|
+
type: {
|
|
855
|
+
name: "String"
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
var TableProperties = {
|
|
862
|
+
serializedName: "TableProperties",
|
|
863
|
+
type: {
|
|
864
|
+
name: "Composite",
|
|
865
|
+
className: "TableProperties",
|
|
866
|
+
modelProperties: {
|
|
867
|
+
name: {
|
|
868
|
+
serializedName: "TableName",
|
|
869
|
+
xmlName: "TableName",
|
|
870
|
+
type: {
|
|
871
|
+
name: "String"
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
var TableEntityQueryResponse = {
|
|
878
|
+
serializedName: "TableEntityQueryResponse",
|
|
879
|
+
type: {
|
|
880
|
+
name: "Composite",
|
|
881
|
+
className: "TableEntityQueryResponse",
|
|
882
|
+
modelProperties: {
|
|
883
|
+
odataMetadata: {
|
|
884
|
+
serializedName: "odata\\.metadata",
|
|
885
|
+
xmlName: "odata\\.metadata",
|
|
886
|
+
type: {
|
|
887
|
+
name: "String"
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
value: {
|
|
891
|
+
serializedName: "value",
|
|
892
|
+
xmlName: "value",
|
|
893
|
+
xmlElementName: "TableEntityProperties",
|
|
894
|
+
type: {
|
|
895
|
+
name: "Sequence",
|
|
896
|
+
element: {
|
|
897
|
+
type: {
|
|
898
|
+
name: "Dictionary",
|
|
899
|
+
value: { type: { name: "any" } }
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
};
|
|
907
|
+
var SignedIdentifier = {
|
|
908
|
+
serializedName: "SignedIdentifier",
|
|
909
|
+
xmlName: "SignedIdentifier",
|
|
910
|
+
type: {
|
|
911
|
+
name: "Composite",
|
|
912
|
+
className: "SignedIdentifier",
|
|
913
|
+
modelProperties: {
|
|
914
|
+
id: {
|
|
915
|
+
serializedName: "Id",
|
|
916
|
+
required: true,
|
|
917
|
+
xmlName: "Id",
|
|
918
|
+
type: {
|
|
919
|
+
name: "String"
|
|
920
|
+
}
|
|
921
|
+
},
|
|
922
|
+
accessPolicy: {
|
|
923
|
+
serializedName: "AccessPolicy",
|
|
924
|
+
xmlName: "AccessPolicy",
|
|
925
|
+
type: {
|
|
926
|
+
name: "Composite",
|
|
927
|
+
className: "AccessPolicy"
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
};
|
|
933
|
+
var AccessPolicy = {
|
|
934
|
+
serializedName: "AccessPolicy",
|
|
935
|
+
xmlName: "AccessPolicy",
|
|
936
|
+
type: {
|
|
937
|
+
name: "Composite",
|
|
938
|
+
className: "AccessPolicy",
|
|
939
|
+
modelProperties: {
|
|
940
|
+
start: {
|
|
941
|
+
serializedName: "Start",
|
|
942
|
+
xmlName: "Start",
|
|
943
|
+
type: {
|
|
944
|
+
name: "String"
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
expiry: {
|
|
948
|
+
serializedName: "Expiry",
|
|
949
|
+
xmlName: "Expiry",
|
|
950
|
+
type: {
|
|
951
|
+
name: "String"
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
permission: {
|
|
955
|
+
serializedName: "Permission",
|
|
956
|
+
xmlName: "Permission",
|
|
957
|
+
type: {
|
|
958
|
+
name: "String"
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
var TableServiceProperties = {
|
|
965
|
+
serializedName: "TableServiceProperties",
|
|
966
|
+
xmlName: "StorageServiceProperties",
|
|
967
|
+
type: {
|
|
968
|
+
name: "Composite",
|
|
969
|
+
className: "TableServiceProperties",
|
|
970
|
+
modelProperties: {
|
|
971
|
+
logging: {
|
|
972
|
+
serializedName: "Logging",
|
|
973
|
+
xmlName: "Logging",
|
|
974
|
+
type: {
|
|
975
|
+
name: "Composite",
|
|
976
|
+
className: "Logging"
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
hourMetrics: {
|
|
980
|
+
serializedName: "HourMetrics",
|
|
981
|
+
xmlName: "HourMetrics",
|
|
982
|
+
type: {
|
|
983
|
+
name: "Composite",
|
|
984
|
+
className: "Metrics"
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
minuteMetrics: {
|
|
988
|
+
serializedName: "MinuteMetrics",
|
|
989
|
+
xmlName: "MinuteMetrics",
|
|
990
|
+
type: {
|
|
991
|
+
name: "Composite",
|
|
992
|
+
className: "Metrics"
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
cors: {
|
|
996
|
+
serializedName: "Cors",
|
|
997
|
+
xmlName: "Cors",
|
|
998
|
+
xmlIsWrapped: true,
|
|
999
|
+
xmlElementName: "CorsRule",
|
|
1000
|
+
type: {
|
|
1001
|
+
name: "Sequence",
|
|
1002
|
+
element: {
|
|
1003
|
+
type: {
|
|
1004
|
+
name: "Composite",
|
|
1005
|
+
className: "CorsRule"
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
var Logging = {
|
|
1014
|
+
serializedName: "Logging",
|
|
1015
|
+
xmlName: "Logging",
|
|
1016
|
+
type: {
|
|
1017
|
+
name: "Composite",
|
|
1018
|
+
className: "Logging",
|
|
1019
|
+
modelProperties: {
|
|
1020
|
+
version: {
|
|
1021
|
+
serializedName: "Version",
|
|
1022
|
+
required: true,
|
|
1023
|
+
xmlName: "Version",
|
|
1024
|
+
type: {
|
|
1025
|
+
name: "String"
|
|
1026
|
+
}
|
|
1027
|
+
},
|
|
1028
|
+
delete: {
|
|
1029
|
+
serializedName: "Delete",
|
|
1030
|
+
required: true,
|
|
1031
|
+
xmlName: "Delete",
|
|
1032
|
+
type: {
|
|
1033
|
+
name: "Boolean"
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
read: {
|
|
1037
|
+
serializedName: "Read",
|
|
1038
|
+
required: true,
|
|
1039
|
+
xmlName: "Read",
|
|
1040
|
+
type: {
|
|
1041
|
+
name: "Boolean"
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
write: {
|
|
1045
|
+
serializedName: "Write",
|
|
1046
|
+
required: true,
|
|
1047
|
+
xmlName: "Write",
|
|
1048
|
+
type: {
|
|
1049
|
+
name: "Boolean"
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
retentionPolicy: {
|
|
1053
|
+
serializedName: "RetentionPolicy",
|
|
1054
|
+
xmlName: "RetentionPolicy",
|
|
1055
|
+
type: {
|
|
1056
|
+
name: "Composite",
|
|
1057
|
+
className: "RetentionPolicy"
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
var RetentionPolicy = {
|
|
1064
|
+
serializedName: "RetentionPolicy",
|
|
1065
|
+
xmlName: "RetentionPolicy",
|
|
1066
|
+
type: {
|
|
1067
|
+
name: "Composite",
|
|
1068
|
+
className: "RetentionPolicy",
|
|
1069
|
+
modelProperties: {
|
|
1070
|
+
enabled: {
|
|
1071
|
+
serializedName: "Enabled",
|
|
1072
|
+
required: true,
|
|
1073
|
+
xmlName: "Enabled",
|
|
1074
|
+
type: {
|
|
1075
|
+
name: "Boolean"
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
days: {
|
|
1079
|
+
constraints: {
|
|
1080
|
+
InclusiveMinimum: 1
|
|
1081
|
+
},
|
|
1082
|
+
serializedName: "Days",
|
|
1083
|
+
xmlName: "Days",
|
|
1084
|
+
type: {
|
|
1085
|
+
name: "Number"
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
};
|
|
1091
|
+
var Metrics = {
|
|
1092
|
+
serializedName: "Metrics",
|
|
1093
|
+
type: {
|
|
1094
|
+
name: "Composite",
|
|
1095
|
+
className: "Metrics",
|
|
1096
|
+
modelProperties: {
|
|
1097
|
+
version: {
|
|
1098
|
+
serializedName: "Version",
|
|
1099
|
+
xmlName: "Version",
|
|
1100
|
+
type: {
|
|
1101
|
+
name: "String"
|
|
1102
|
+
}
|
|
1103
|
+
},
|
|
1104
|
+
enabled: {
|
|
1105
|
+
serializedName: "Enabled",
|
|
1106
|
+
required: true,
|
|
1107
|
+
xmlName: "Enabled",
|
|
1108
|
+
type: {
|
|
1109
|
+
name: "Boolean"
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
includeAPIs: {
|
|
1113
|
+
serializedName: "IncludeAPIs",
|
|
1114
|
+
xmlName: "IncludeAPIs",
|
|
1115
|
+
type: {
|
|
1116
|
+
name: "Boolean"
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
retentionPolicy: {
|
|
1120
|
+
serializedName: "RetentionPolicy",
|
|
1121
|
+
xmlName: "RetentionPolicy",
|
|
1122
|
+
type: {
|
|
1123
|
+
name: "Composite",
|
|
1124
|
+
className: "RetentionPolicy"
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
};
|
|
1130
|
+
var CorsRule = {
|
|
1131
|
+
serializedName: "CorsRule",
|
|
1132
|
+
xmlName: "CorsRule",
|
|
1133
|
+
type: {
|
|
1134
|
+
name: "Composite",
|
|
1135
|
+
className: "CorsRule",
|
|
1136
|
+
modelProperties: {
|
|
1137
|
+
allowedOrigins: {
|
|
1138
|
+
serializedName: "AllowedOrigins",
|
|
1139
|
+
required: true,
|
|
1140
|
+
xmlName: "AllowedOrigins",
|
|
1141
|
+
type: {
|
|
1142
|
+
name: "String"
|
|
1143
|
+
}
|
|
1144
|
+
},
|
|
1145
|
+
allowedMethods: {
|
|
1146
|
+
serializedName: "AllowedMethods",
|
|
1147
|
+
required: true,
|
|
1148
|
+
xmlName: "AllowedMethods",
|
|
1149
|
+
type: {
|
|
1150
|
+
name: "String"
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
allowedHeaders: {
|
|
1154
|
+
serializedName: "AllowedHeaders",
|
|
1155
|
+
required: true,
|
|
1156
|
+
xmlName: "AllowedHeaders",
|
|
1157
|
+
type: {
|
|
1158
|
+
name: "String"
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
exposedHeaders: {
|
|
1162
|
+
serializedName: "ExposedHeaders",
|
|
1163
|
+
required: true,
|
|
1164
|
+
xmlName: "ExposedHeaders",
|
|
1165
|
+
type: {
|
|
1166
|
+
name: "String"
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1169
|
+
maxAgeInSeconds: {
|
|
1170
|
+
constraints: {
|
|
1171
|
+
InclusiveMinimum: 0
|
|
1172
|
+
},
|
|
1173
|
+
serializedName: "MaxAgeInSeconds",
|
|
1174
|
+
required: true,
|
|
1175
|
+
xmlName: "MaxAgeInSeconds",
|
|
1176
|
+
type: {
|
|
1177
|
+
name: "Number"
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
var TableServiceStats = {
|
|
1184
|
+
serializedName: "TableServiceStats",
|
|
1185
|
+
xmlName: "StorageServiceStats",
|
|
1186
|
+
type: {
|
|
1187
|
+
name: "Composite",
|
|
1188
|
+
className: "TableServiceStats",
|
|
1189
|
+
modelProperties: {
|
|
1190
|
+
geoReplication: {
|
|
1191
|
+
serializedName: "GeoReplication",
|
|
1192
|
+
xmlName: "GeoReplication",
|
|
1193
|
+
type: {
|
|
1194
|
+
name: "Composite",
|
|
1195
|
+
className: "GeoReplication"
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
var GeoReplication = {
|
|
1202
|
+
serializedName: "GeoReplication",
|
|
1203
|
+
xmlName: "GeoReplication",
|
|
1204
|
+
type: {
|
|
1205
|
+
name: "Composite",
|
|
1206
|
+
className: "GeoReplication",
|
|
1207
|
+
modelProperties: {
|
|
1208
|
+
status: {
|
|
1209
|
+
serializedName: "Status",
|
|
1210
|
+
required: true,
|
|
1211
|
+
xmlName: "Status",
|
|
1212
|
+
type: {
|
|
1213
|
+
name: "String"
|
|
1214
|
+
}
|
|
1215
|
+
},
|
|
1216
|
+
lastSyncTime: {
|
|
1217
|
+
serializedName: "LastSyncTime",
|
|
1218
|
+
required: true,
|
|
1219
|
+
xmlName: "LastSyncTime",
|
|
1220
|
+
type: {
|
|
1221
|
+
name: "DateTimeRfc1123"
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
var TableResponse = {
|
|
1228
|
+
serializedName: "TableResponse",
|
|
1229
|
+
type: {
|
|
1230
|
+
name: "Composite",
|
|
1231
|
+
className: "TableResponse",
|
|
1232
|
+
modelProperties: Object.assign(Object.assign({}, TableResponseProperties.type.modelProperties), { odataMetadata: {
|
|
1233
|
+
serializedName: "odata\\.metadata",
|
|
1234
|
+
xmlName: "odata\\.metadata",
|
|
1235
|
+
type: {
|
|
1236
|
+
name: "String"
|
|
1237
|
+
}
|
|
1238
|
+
} })
|
|
1239
|
+
}
|
|
1240
|
+
};
|
|
1241
|
+
var TableQueryHeaders = {
|
|
1242
|
+
serializedName: "Table_queryHeaders",
|
|
1243
|
+
type: {
|
|
1244
|
+
name: "Composite",
|
|
1245
|
+
className: "TableQueryHeaders",
|
|
1246
|
+
modelProperties: {
|
|
1247
|
+
clientRequestId: {
|
|
1248
|
+
serializedName: "x-ms-client-request-id",
|
|
1249
|
+
xmlName: "x-ms-client-request-id",
|
|
1250
|
+
type: {
|
|
1251
|
+
name: "String"
|
|
1252
|
+
}
|
|
1253
|
+
},
|
|
1254
|
+
requestId: {
|
|
1255
|
+
serializedName: "x-ms-request-id",
|
|
1256
|
+
xmlName: "x-ms-request-id",
|
|
1257
|
+
type: {
|
|
1258
|
+
name: "String"
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
version: {
|
|
1262
|
+
serializedName: "x-ms-version",
|
|
1263
|
+
xmlName: "x-ms-version",
|
|
1264
|
+
type: {
|
|
1265
|
+
name: "String"
|
|
1266
|
+
}
|
|
1267
|
+
},
|
|
1268
|
+
date: {
|
|
1269
|
+
serializedName: "date",
|
|
1270
|
+
xmlName: "date",
|
|
1271
|
+
type: {
|
|
1272
|
+
name: "DateTimeRfc1123"
|
|
1273
|
+
}
|
|
1274
|
+
},
|
|
1275
|
+
xMsContinuationNextTableName: {
|
|
1276
|
+
serializedName: "x-ms-continuation-nexttablename",
|
|
1277
|
+
xmlName: "x-ms-continuation-nexttablename",
|
|
1278
|
+
type: {
|
|
1279
|
+
name: "String"
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1285
|
+
var TableQueryExceptionHeaders = {
|
|
1286
|
+
serializedName: "Table_queryExceptionHeaders",
|
|
1287
|
+
type: {
|
|
1288
|
+
name: "Composite",
|
|
1289
|
+
className: "TableQueryExceptionHeaders",
|
|
1290
|
+
modelProperties: {
|
|
1291
|
+
errorCode: {
|
|
1292
|
+
serializedName: "x-ms-error-code",
|
|
1293
|
+
xmlName: "x-ms-error-code",
|
|
1294
|
+
type: {
|
|
1295
|
+
name: "String"
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
var TableCreateHeaders = {
|
|
1302
|
+
serializedName: "Table_createHeaders",
|
|
1303
|
+
type: {
|
|
1304
|
+
name: "Composite",
|
|
1305
|
+
className: "TableCreateHeaders",
|
|
1306
|
+
modelProperties: {
|
|
1307
|
+
clientRequestId: {
|
|
1308
|
+
serializedName: "x-ms-client-request-id",
|
|
1309
|
+
xmlName: "x-ms-client-request-id",
|
|
1310
|
+
type: {
|
|
1311
|
+
name: "String"
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
requestId: {
|
|
1315
|
+
serializedName: "x-ms-request-id",
|
|
1316
|
+
xmlName: "x-ms-request-id",
|
|
1317
|
+
type: {
|
|
1318
|
+
name: "String"
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
version: {
|
|
1322
|
+
serializedName: "x-ms-version",
|
|
1323
|
+
xmlName: "x-ms-version",
|
|
1324
|
+
type: {
|
|
1325
|
+
name: "String"
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1328
|
+
date: {
|
|
1329
|
+
serializedName: "date",
|
|
1330
|
+
xmlName: "date",
|
|
1331
|
+
type: {
|
|
1332
|
+
name: "DateTimeRfc1123"
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
preferenceApplied: {
|
|
1336
|
+
serializedName: "preference-applied",
|
|
1337
|
+
xmlName: "preference-applied",
|
|
1338
|
+
type: {
|
|
1339
|
+
name: "String"
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
};
|
|
1345
|
+
var TableCreateExceptionHeaders = {
|
|
1346
|
+
serializedName: "Table_createExceptionHeaders",
|
|
1347
|
+
type: {
|
|
1348
|
+
name: "Composite",
|
|
1349
|
+
className: "TableCreateExceptionHeaders",
|
|
1350
|
+
modelProperties: {
|
|
1351
|
+
errorCode: {
|
|
1352
|
+
serializedName: "x-ms-error-code",
|
|
1353
|
+
xmlName: "x-ms-error-code",
|
|
1354
|
+
type: {
|
|
1355
|
+
name: "String"
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
var TableDeleteHeaders = {
|
|
1362
|
+
serializedName: "Table_deleteHeaders",
|
|
1363
|
+
type: {
|
|
1364
|
+
name: "Composite",
|
|
1365
|
+
className: "TableDeleteHeaders",
|
|
1366
|
+
modelProperties: {
|
|
1367
|
+
clientRequestId: {
|
|
1368
|
+
serializedName: "x-ms-client-request-id",
|
|
1369
|
+
xmlName: "x-ms-client-request-id",
|
|
1370
|
+
type: {
|
|
1371
|
+
name: "String"
|
|
1372
|
+
}
|
|
1373
|
+
},
|
|
1374
|
+
requestId: {
|
|
1375
|
+
serializedName: "x-ms-request-id",
|
|
1376
|
+
xmlName: "x-ms-request-id",
|
|
1377
|
+
type: {
|
|
1378
|
+
name: "String"
|
|
1379
|
+
}
|
|
1380
|
+
},
|
|
1381
|
+
version: {
|
|
1382
|
+
serializedName: "x-ms-version",
|
|
1383
|
+
xmlName: "x-ms-version",
|
|
1384
|
+
type: {
|
|
1385
|
+
name: "String"
|
|
1386
|
+
}
|
|
1387
|
+
},
|
|
1388
|
+
date: {
|
|
1389
|
+
serializedName: "date",
|
|
1390
|
+
xmlName: "date",
|
|
1391
|
+
type: {
|
|
1392
|
+
name: "DateTimeRfc1123"
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
};
|
|
1398
|
+
var TableDeleteExceptionHeaders = {
|
|
1399
|
+
serializedName: "Table_deleteExceptionHeaders",
|
|
1400
|
+
type: {
|
|
1401
|
+
name: "Composite",
|
|
1402
|
+
className: "TableDeleteExceptionHeaders",
|
|
1403
|
+
modelProperties: {
|
|
1404
|
+
errorCode: {
|
|
1405
|
+
serializedName: "x-ms-error-code",
|
|
1406
|
+
xmlName: "x-ms-error-code",
|
|
1407
|
+
type: {
|
|
1408
|
+
name: "String"
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1414
|
+
var TableQueryEntitiesHeaders = {
|
|
1415
|
+
serializedName: "Table_queryEntitiesHeaders",
|
|
1416
|
+
type: {
|
|
1417
|
+
name: "Composite",
|
|
1418
|
+
className: "TableQueryEntitiesHeaders",
|
|
1419
|
+
modelProperties: {
|
|
1420
|
+
clientRequestId: {
|
|
1421
|
+
serializedName: "x-ms-client-request-id",
|
|
1422
|
+
xmlName: "x-ms-client-request-id",
|
|
1423
|
+
type: {
|
|
1424
|
+
name: "String"
|
|
1425
|
+
}
|
|
1426
|
+
},
|
|
1427
|
+
requestId: {
|
|
1428
|
+
serializedName: "x-ms-request-id",
|
|
1429
|
+
xmlName: "x-ms-request-id",
|
|
1430
|
+
type: {
|
|
1431
|
+
name: "String"
|
|
1432
|
+
}
|
|
1433
|
+
},
|
|
1434
|
+
version: {
|
|
1435
|
+
serializedName: "x-ms-version",
|
|
1436
|
+
xmlName: "x-ms-version",
|
|
1437
|
+
type: {
|
|
1438
|
+
name: "String"
|
|
1439
|
+
}
|
|
1440
|
+
},
|
|
1441
|
+
date: {
|
|
1442
|
+
serializedName: "date",
|
|
1443
|
+
xmlName: "date",
|
|
1444
|
+
type: {
|
|
1445
|
+
name: "DateTimeRfc1123"
|
|
1446
|
+
}
|
|
1447
|
+
},
|
|
1448
|
+
xMsContinuationNextPartitionKey: {
|
|
1449
|
+
serializedName: "x-ms-continuation-nextpartitionkey",
|
|
1450
|
+
xmlName: "x-ms-continuation-nextpartitionkey",
|
|
1451
|
+
type: {
|
|
1452
|
+
name: "String"
|
|
1453
|
+
}
|
|
1454
|
+
},
|
|
1455
|
+
xMsContinuationNextRowKey: {
|
|
1456
|
+
serializedName: "x-ms-continuation-nextrowkey",
|
|
1457
|
+
xmlName: "x-ms-continuation-nextrowkey",
|
|
1458
|
+
type: {
|
|
1459
|
+
name: "String"
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
};
|
|
1465
|
+
var TableQueryEntitiesExceptionHeaders = {
|
|
1466
|
+
serializedName: "Table_queryEntitiesExceptionHeaders",
|
|
1467
|
+
type: {
|
|
1468
|
+
name: "Composite",
|
|
1469
|
+
className: "TableQueryEntitiesExceptionHeaders",
|
|
1470
|
+
modelProperties: {
|
|
1471
|
+
errorCode: {
|
|
1472
|
+
serializedName: "x-ms-error-code",
|
|
1473
|
+
xmlName: "x-ms-error-code",
|
|
1474
|
+
type: {
|
|
1475
|
+
name: "String"
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
};
|
|
1481
|
+
var TableQueryEntitiesWithPartitionAndRowKeyHeaders = {
|
|
1482
|
+
serializedName: "Table_queryEntitiesWithPartitionAndRowKeyHeaders",
|
|
1483
|
+
type: {
|
|
1484
|
+
name: "Composite",
|
|
1485
|
+
className: "TableQueryEntitiesWithPartitionAndRowKeyHeaders",
|
|
1486
|
+
modelProperties: {
|
|
1487
|
+
clientRequestId: {
|
|
1488
|
+
serializedName: "x-ms-client-request-id",
|
|
1489
|
+
xmlName: "x-ms-client-request-id",
|
|
1490
|
+
type: {
|
|
1491
|
+
name: "String"
|
|
1492
|
+
}
|
|
1493
|
+
},
|
|
1494
|
+
requestId: {
|
|
1495
|
+
serializedName: "x-ms-request-id",
|
|
1496
|
+
xmlName: "x-ms-request-id",
|
|
1497
|
+
type: {
|
|
1498
|
+
name: "String"
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
version: {
|
|
1502
|
+
serializedName: "x-ms-version",
|
|
1503
|
+
xmlName: "x-ms-version",
|
|
1504
|
+
type: {
|
|
1505
|
+
name: "String"
|
|
1506
|
+
}
|
|
1507
|
+
},
|
|
1508
|
+
date: {
|
|
1509
|
+
serializedName: "date",
|
|
1510
|
+
xmlName: "date",
|
|
1511
|
+
type: {
|
|
1512
|
+
name: "DateTimeRfc1123"
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
etag: {
|
|
1516
|
+
serializedName: "etag",
|
|
1517
|
+
xmlName: "etag",
|
|
1518
|
+
type: {
|
|
1519
|
+
name: "String"
|
|
1520
|
+
}
|
|
1521
|
+
},
|
|
1522
|
+
xMsContinuationNextPartitionKey: {
|
|
1523
|
+
serializedName: "x-ms-continuation-nextpartitionkey",
|
|
1524
|
+
xmlName: "x-ms-continuation-nextpartitionkey",
|
|
1525
|
+
type: {
|
|
1526
|
+
name: "String"
|
|
1527
|
+
}
|
|
1528
|
+
},
|
|
1529
|
+
xMsContinuationNextRowKey: {
|
|
1530
|
+
serializedName: "x-ms-continuation-nextrowkey",
|
|
1531
|
+
xmlName: "x-ms-continuation-nextrowkey",
|
|
1532
|
+
type: {
|
|
1533
|
+
name: "String"
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
};
|
|
1539
|
+
var TableQueryEntitiesWithPartitionAndRowKeyExceptionHeaders = {
|
|
1540
|
+
serializedName: "Table_queryEntitiesWithPartitionAndRowKeyExceptionHeaders",
|
|
1541
|
+
type: {
|
|
1542
|
+
name: "Composite",
|
|
1543
|
+
className: "TableQueryEntitiesWithPartitionAndRowKeyExceptionHeaders",
|
|
1544
|
+
modelProperties: {
|
|
1545
|
+
errorCode: {
|
|
1546
|
+
serializedName: "x-ms-error-code",
|
|
1547
|
+
xmlName: "x-ms-error-code",
|
|
1548
|
+
type: {
|
|
1549
|
+
name: "String"
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
};
|
|
1555
|
+
var TableUpdateEntityHeaders = {
|
|
1556
|
+
serializedName: "Table_updateEntityHeaders",
|
|
1557
|
+
type: {
|
|
1558
|
+
name: "Composite",
|
|
1559
|
+
className: "TableUpdateEntityHeaders",
|
|
1560
|
+
modelProperties: {
|
|
1561
|
+
clientRequestId: {
|
|
1562
|
+
serializedName: "x-ms-client-request-id",
|
|
1563
|
+
xmlName: "x-ms-client-request-id",
|
|
1564
|
+
type: {
|
|
1565
|
+
name: "String"
|
|
1566
|
+
}
|
|
1567
|
+
},
|
|
1568
|
+
requestId: {
|
|
1569
|
+
serializedName: "x-ms-request-id",
|
|
1570
|
+
xmlName: "x-ms-request-id",
|
|
1571
|
+
type: {
|
|
1572
|
+
name: "String"
|
|
1573
|
+
}
|
|
1574
|
+
},
|
|
1575
|
+
version: {
|
|
1576
|
+
serializedName: "x-ms-version",
|
|
1577
|
+
xmlName: "x-ms-version",
|
|
1578
|
+
type: {
|
|
1579
|
+
name: "String"
|
|
1580
|
+
}
|
|
1581
|
+
},
|
|
1582
|
+
date: {
|
|
1583
|
+
serializedName: "date",
|
|
1584
|
+
xmlName: "date",
|
|
1585
|
+
type: {
|
|
1586
|
+
name: "DateTimeRfc1123"
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
etag: {
|
|
1590
|
+
serializedName: "etag",
|
|
1591
|
+
xmlName: "etag",
|
|
1592
|
+
type: {
|
|
1593
|
+
name: "String"
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
};
|
|
1599
|
+
var TableUpdateEntityExceptionHeaders = {
|
|
1600
|
+
serializedName: "Table_updateEntityExceptionHeaders",
|
|
1601
|
+
type: {
|
|
1602
|
+
name: "Composite",
|
|
1603
|
+
className: "TableUpdateEntityExceptionHeaders",
|
|
1604
|
+
modelProperties: {
|
|
1605
|
+
errorCode: {
|
|
1606
|
+
serializedName: "x-ms-error-code",
|
|
1607
|
+
xmlName: "x-ms-error-code",
|
|
1608
|
+
type: {
|
|
1609
|
+
name: "String"
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
};
|
|
1615
|
+
var TableMergeEntityHeaders = {
|
|
1616
|
+
serializedName: "Table_mergeEntityHeaders",
|
|
1617
|
+
type: {
|
|
1618
|
+
name: "Composite",
|
|
1619
|
+
className: "TableMergeEntityHeaders",
|
|
1620
|
+
modelProperties: {
|
|
1621
|
+
clientRequestId: {
|
|
1622
|
+
serializedName: "x-ms-client-request-id",
|
|
1623
|
+
xmlName: "x-ms-client-request-id",
|
|
1624
|
+
type: {
|
|
1625
|
+
name: "String"
|
|
1626
|
+
}
|
|
1627
|
+
},
|
|
1628
|
+
requestId: {
|
|
1629
|
+
serializedName: "x-ms-request-id",
|
|
1630
|
+
xmlName: "x-ms-request-id",
|
|
1631
|
+
type: {
|
|
1632
|
+
name: "String"
|
|
1633
|
+
}
|
|
1634
|
+
},
|
|
1635
|
+
version: {
|
|
1636
|
+
serializedName: "x-ms-version",
|
|
1637
|
+
xmlName: "x-ms-version",
|
|
1638
|
+
type: {
|
|
1639
|
+
name: "String"
|
|
1640
|
+
}
|
|
1641
|
+
},
|
|
1642
|
+
date: {
|
|
1643
|
+
serializedName: "date",
|
|
1644
|
+
xmlName: "date",
|
|
1645
|
+
type: {
|
|
1646
|
+
name: "DateTimeRfc1123"
|
|
1647
|
+
}
|
|
1648
|
+
},
|
|
1649
|
+
etag: {
|
|
1650
|
+
serializedName: "etag",
|
|
1651
|
+
xmlName: "etag",
|
|
1652
|
+
type: {
|
|
1653
|
+
name: "String"
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
};
|
|
1659
|
+
var TableMergeEntityExceptionHeaders = {
|
|
1660
|
+
serializedName: "Table_mergeEntityExceptionHeaders",
|
|
1661
|
+
type: {
|
|
1662
|
+
name: "Composite",
|
|
1663
|
+
className: "TableMergeEntityExceptionHeaders",
|
|
1664
|
+
modelProperties: {
|
|
1665
|
+
errorCode: {
|
|
1666
|
+
serializedName: "x-ms-error-code",
|
|
1667
|
+
xmlName: "x-ms-error-code",
|
|
1668
|
+
type: {
|
|
1669
|
+
name: "String"
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
};
|
|
1675
|
+
var TableDeleteEntityHeaders = {
|
|
1676
|
+
serializedName: "Table_deleteEntityHeaders",
|
|
1677
|
+
type: {
|
|
1678
|
+
name: "Composite",
|
|
1679
|
+
className: "TableDeleteEntityHeaders",
|
|
1680
|
+
modelProperties: {
|
|
1681
|
+
clientRequestId: {
|
|
1682
|
+
serializedName: "x-ms-client-request-id",
|
|
1683
|
+
xmlName: "x-ms-client-request-id",
|
|
1684
|
+
type: {
|
|
1685
|
+
name: "String"
|
|
1686
|
+
}
|
|
1687
|
+
},
|
|
1688
|
+
requestId: {
|
|
1689
|
+
serializedName: "x-ms-request-id",
|
|
1690
|
+
xmlName: "x-ms-request-id",
|
|
1691
|
+
type: {
|
|
1692
|
+
name: "String"
|
|
1693
|
+
}
|
|
1694
|
+
},
|
|
1695
|
+
version: {
|
|
1696
|
+
serializedName: "x-ms-version",
|
|
1697
|
+
xmlName: "x-ms-version",
|
|
1698
|
+
type: {
|
|
1699
|
+
name: "String"
|
|
1700
|
+
}
|
|
1701
|
+
},
|
|
1702
|
+
date: {
|
|
1703
|
+
serializedName: "date",
|
|
1704
|
+
xmlName: "date",
|
|
1705
|
+
type: {
|
|
1706
|
+
name: "DateTimeRfc1123"
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
};
|
|
1712
|
+
var TableDeleteEntityExceptionHeaders = {
|
|
1713
|
+
serializedName: "Table_deleteEntityExceptionHeaders",
|
|
1714
|
+
type: {
|
|
1715
|
+
name: "Composite",
|
|
1716
|
+
className: "TableDeleteEntityExceptionHeaders",
|
|
1717
|
+
modelProperties: {
|
|
1718
|
+
errorCode: {
|
|
1719
|
+
serializedName: "x-ms-error-code",
|
|
1720
|
+
xmlName: "x-ms-error-code",
|
|
1721
|
+
type: {
|
|
1722
|
+
name: "String"
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
};
|
|
1728
|
+
var TableInsertEntityHeaders = {
|
|
1729
|
+
serializedName: "Table_insertEntityHeaders",
|
|
1730
|
+
type: {
|
|
1731
|
+
name: "Composite",
|
|
1732
|
+
className: "TableInsertEntityHeaders",
|
|
1733
|
+
modelProperties: {
|
|
1734
|
+
clientRequestId: {
|
|
1735
|
+
serializedName: "x-ms-client-request-id",
|
|
1736
|
+
xmlName: "x-ms-client-request-id",
|
|
1737
|
+
type: {
|
|
1738
|
+
name: "String"
|
|
1739
|
+
}
|
|
1740
|
+
},
|
|
1741
|
+
requestId: {
|
|
1742
|
+
serializedName: "x-ms-request-id",
|
|
1743
|
+
xmlName: "x-ms-request-id",
|
|
1744
|
+
type: {
|
|
1745
|
+
name: "String"
|
|
1746
|
+
}
|
|
1747
|
+
},
|
|
1748
|
+
version: {
|
|
1749
|
+
serializedName: "x-ms-version",
|
|
1750
|
+
xmlName: "x-ms-version",
|
|
1751
|
+
type: {
|
|
1752
|
+
name: "String"
|
|
1753
|
+
}
|
|
1754
|
+
},
|
|
1755
|
+
date: {
|
|
1756
|
+
serializedName: "date",
|
|
1757
|
+
xmlName: "date",
|
|
1758
|
+
type: {
|
|
1759
|
+
name: "DateTimeRfc1123"
|
|
1760
|
+
}
|
|
1761
|
+
},
|
|
1762
|
+
etag: {
|
|
1763
|
+
serializedName: "etag",
|
|
1764
|
+
xmlName: "etag",
|
|
1765
|
+
type: {
|
|
1766
|
+
name: "String"
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
preferenceApplied: {
|
|
1770
|
+
serializedName: "preference-applied",
|
|
1771
|
+
xmlName: "preference-applied",
|
|
1772
|
+
type: {
|
|
1773
|
+
name: "String"
|
|
1774
|
+
}
|
|
1775
|
+
},
|
|
1776
|
+
contentType: {
|
|
1777
|
+
serializedName: "content-type",
|
|
1778
|
+
xmlName: "content-type",
|
|
1779
|
+
type: {
|
|
1780
|
+
name: "String"
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
var TableInsertEntityExceptionHeaders = {
|
|
1787
|
+
serializedName: "Table_insertEntityExceptionHeaders",
|
|
1788
|
+
type: {
|
|
1789
|
+
name: "Composite",
|
|
1790
|
+
className: "TableInsertEntityExceptionHeaders",
|
|
1791
|
+
modelProperties: {
|
|
1792
|
+
errorCode: {
|
|
1793
|
+
serializedName: "x-ms-error-code",
|
|
1794
|
+
xmlName: "x-ms-error-code",
|
|
1795
|
+
type: {
|
|
1796
|
+
name: "String"
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
};
|
|
1802
|
+
var TableGetAccessPolicyHeaders = {
|
|
1803
|
+
serializedName: "Table_getAccessPolicyHeaders",
|
|
1804
|
+
type: {
|
|
1805
|
+
name: "Composite",
|
|
1806
|
+
className: "TableGetAccessPolicyHeaders",
|
|
1807
|
+
modelProperties: {
|
|
1808
|
+
clientRequestId: {
|
|
1809
|
+
serializedName: "x-ms-client-request-id",
|
|
1810
|
+
xmlName: "x-ms-client-request-id",
|
|
1811
|
+
type: {
|
|
1812
|
+
name: "String"
|
|
1813
|
+
}
|
|
1814
|
+
},
|
|
1815
|
+
requestId: {
|
|
1816
|
+
serializedName: "x-ms-request-id",
|
|
1817
|
+
xmlName: "x-ms-request-id",
|
|
1818
|
+
type: {
|
|
1819
|
+
name: "String"
|
|
1820
|
+
}
|
|
1821
|
+
},
|
|
1822
|
+
version: {
|
|
1823
|
+
serializedName: "x-ms-version",
|
|
1824
|
+
xmlName: "x-ms-version",
|
|
1825
|
+
type: {
|
|
1826
|
+
name: "String"
|
|
1827
|
+
}
|
|
1828
|
+
},
|
|
1829
|
+
date: {
|
|
1830
|
+
serializedName: "date",
|
|
1831
|
+
xmlName: "date",
|
|
1832
|
+
type: {
|
|
1833
|
+
name: "DateTimeRfc1123"
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
var TableGetAccessPolicyExceptionHeaders = {
|
|
1840
|
+
serializedName: "Table_getAccessPolicyExceptionHeaders",
|
|
1841
|
+
type: {
|
|
1842
|
+
name: "Composite",
|
|
1843
|
+
className: "TableGetAccessPolicyExceptionHeaders",
|
|
1844
|
+
modelProperties: {
|
|
1845
|
+
errorCode: {
|
|
1846
|
+
serializedName: "x-ms-error-code",
|
|
1847
|
+
xmlName: "x-ms-error-code",
|
|
1848
|
+
type: {
|
|
1849
|
+
name: "String"
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
var TableSetAccessPolicyHeaders = {
|
|
1856
|
+
serializedName: "Table_setAccessPolicyHeaders",
|
|
1857
|
+
type: {
|
|
1858
|
+
name: "Composite",
|
|
1859
|
+
className: "TableSetAccessPolicyHeaders",
|
|
1860
|
+
modelProperties: {
|
|
1861
|
+
clientRequestId: {
|
|
1862
|
+
serializedName: "x-ms-client-request-id",
|
|
1863
|
+
xmlName: "x-ms-client-request-id",
|
|
1864
|
+
type: {
|
|
1865
|
+
name: "String"
|
|
1866
|
+
}
|
|
1867
|
+
},
|
|
1868
|
+
requestId: {
|
|
1869
|
+
serializedName: "x-ms-request-id",
|
|
1870
|
+
xmlName: "x-ms-request-id",
|
|
1871
|
+
type: {
|
|
1872
|
+
name: "String"
|
|
1873
|
+
}
|
|
1874
|
+
},
|
|
1875
|
+
version: {
|
|
1876
|
+
serializedName: "x-ms-version",
|
|
1877
|
+
xmlName: "x-ms-version",
|
|
1878
|
+
type: {
|
|
1879
|
+
name: "String"
|
|
1880
|
+
}
|
|
1881
|
+
},
|
|
1882
|
+
date: {
|
|
1883
|
+
serializedName: "date",
|
|
1884
|
+
xmlName: "date",
|
|
1885
|
+
type: {
|
|
1886
|
+
name: "DateTimeRfc1123"
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
};
|
|
1892
|
+
var TableSetAccessPolicyExceptionHeaders = {
|
|
1893
|
+
serializedName: "Table_setAccessPolicyExceptionHeaders",
|
|
1894
|
+
type: {
|
|
1895
|
+
name: "Composite",
|
|
1896
|
+
className: "TableSetAccessPolicyExceptionHeaders",
|
|
1897
|
+
modelProperties: {
|
|
1898
|
+
errorCode: {
|
|
1899
|
+
serializedName: "x-ms-error-code",
|
|
1900
|
+
xmlName: "x-ms-error-code",
|
|
1901
|
+
type: {
|
|
1902
|
+
name: "String"
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
var ServiceSetPropertiesHeaders = {
|
|
1909
|
+
serializedName: "Service_setPropertiesHeaders",
|
|
1910
|
+
type: {
|
|
1911
|
+
name: "Composite",
|
|
1912
|
+
className: "ServiceSetPropertiesHeaders",
|
|
1913
|
+
modelProperties: {
|
|
1914
|
+
clientRequestId: {
|
|
1915
|
+
serializedName: "x-ms-client-request-id",
|
|
1916
|
+
xmlName: "x-ms-client-request-id",
|
|
1917
|
+
type: {
|
|
1918
|
+
name: "String"
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
requestId: {
|
|
1922
|
+
serializedName: "x-ms-request-id",
|
|
1923
|
+
xmlName: "x-ms-request-id",
|
|
1924
|
+
type: {
|
|
1925
|
+
name: "String"
|
|
1926
|
+
}
|
|
1927
|
+
},
|
|
1928
|
+
version: {
|
|
1929
|
+
serializedName: "x-ms-version",
|
|
1930
|
+
xmlName: "x-ms-version",
|
|
1931
|
+
type: {
|
|
1932
|
+
name: "String"
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
};
|
|
1938
|
+
var ServiceSetPropertiesExceptionHeaders = {
|
|
1939
|
+
serializedName: "Service_setPropertiesExceptionHeaders",
|
|
1940
|
+
type: {
|
|
1941
|
+
name: "Composite",
|
|
1942
|
+
className: "ServiceSetPropertiesExceptionHeaders",
|
|
1943
|
+
modelProperties: {
|
|
1944
|
+
errorCode: {
|
|
1945
|
+
serializedName: "x-ms-error-code",
|
|
1946
|
+
xmlName: "x-ms-error-code",
|
|
1947
|
+
type: {
|
|
1948
|
+
name: "String"
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
};
|
|
1954
|
+
var ServiceGetPropertiesHeaders = {
|
|
1955
|
+
serializedName: "Service_getPropertiesHeaders",
|
|
1956
|
+
type: {
|
|
1957
|
+
name: "Composite",
|
|
1958
|
+
className: "ServiceGetPropertiesHeaders",
|
|
1959
|
+
modelProperties: {
|
|
1960
|
+
clientRequestId: {
|
|
1961
|
+
serializedName: "x-ms-client-request-id",
|
|
1962
|
+
xmlName: "x-ms-client-request-id",
|
|
1963
|
+
type: {
|
|
1964
|
+
name: "String"
|
|
1965
|
+
}
|
|
1966
|
+
},
|
|
1967
|
+
requestId: {
|
|
1968
|
+
serializedName: "x-ms-request-id",
|
|
1969
|
+
xmlName: "x-ms-request-id",
|
|
1970
|
+
type: {
|
|
1971
|
+
name: "String"
|
|
1972
|
+
}
|
|
1973
|
+
},
|
|
1974
|
+
version: {
|
|
1975
|
+
serializedName: "x-ms-version",
|
|
1976
|
+
xmlName: "x-ms-version",
|
|
1977
|
+
type: {
|
|
1978
|
+
name: "String"
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1984
|
+
var ServiceGetPropertiesExceptionHeaders = {
|
|
1985
|
+
serializedName: "Service_getPropertiesExceptionHeaders",
|
|
1986
|
+
type: {
|
|
1987
|
+
name: "Composite",
|
|
1988
|
+
className: "ServiceGetPropertiesExceptionHeaders",
|
|
1989
|
+
modelProperties: {
|
|
1990
|
+
errorCode: {
|
|
1991
|
+
serializedName: "x-ms-error-code",
|
|
1992
|
+
xmlName: "x-ms-error-code",
|
|
1993
|
+
type: {
|
|
1994
|
+
name: "String"
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
};
|
|
2000
|
+
var ServiceGetStatisticsHeaders = {
|
|
2001
|
+
serializedName: "Service_getStatisticsHeaders",
|
|
2002
|
+
type: {
|
|
2003
|
+
name: "Composite",
|
|
2004
|
+
className: "ServiceGetStatisticsHeaders",
|
|
2005
|
+
modelProperties: {
|
|
2006
|
+
clientRequestId: {
|
|
2007
|
+
serializedName: "x-ms-client-request-id",
|
|
2008
|
+
xmlName: "x-ms-client-request-id",
|
|
2009
|
+
type: {
|
|
2010
|
+
name: "String"
|
|
2011
|
+
}
|
|
2012
|
+
},
|
|
2013
|
+
requestId: {
|
|
2014
|
+
serializedName: "x-ms-request-id",
|
|
2015
|
+
xmlName: "x-ms-request-id",
|
|
2016
|
+
type: {
|
|
2017
|
+
name: "String"
|
|
2018
|
+
}
|
|
2019
|
+
},
|
|
2020
|
+
version: {
|
|
2021
|
+
serializedName: "x-ms-version",
|
|
2022
|
+
xmlName: "x-ms-version",
|
|
2023
|
+
type: {
|
|
2024
|
+
name: "String"
|
|
2025
|
+
}
|
|
2026
|
+
},
|
|
2027
|
+
date: {
|
|
2028
|
+
serializedName: "date",
|
|
2029
|
+
xmlName: "date",
|
|
2030
|
+
type: {
|
|
2031
|
+
name: "DateTimeRfc1123"
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
}
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
var ServiceGetStatisticsExceptionHeaders = {
|
|
2038
|
+
serializedName: "Service_getStatisticsExceptionHeaders",
|
|
2039
|
+
type: {
|
|
2040
|
+
name: "Composite",
|
|
2041
|
+
className: "ServiceGetStatisticsExceptionHeaders",
|
|
2042
|
+
modelProperties: {
|
|
2043
|
+
errorCode: {
|
|
2044
|
+
serializedName: "x-ms-error-code",
|
|
2045
|
+
xmlName: "x-ms-error-code",
|
|
2046
|
+
type: {
|
|
2047
|
+
name: "String"
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
};
|
|
2053
|
+
var Mappers = /* @__PURE__ */ Object.freeze({
|
|
2054
|
+
__proto__: null,
|
|
2055
|
+
AccessPolicy,
|
|
2056
|
+
CorsRule,
|
|
2057
|
+
GeoReplication,
|
|
2058
|
+
Logging,
|
|
2059
|
+
Metrics,
|
|
2060
|
+
RetentionPolicy,
|
|
2061
|
+
ServiceGetPropertiesExceptionHeaders,
|
|
2062
|
+
ServiceGetPropertiesHeaders,
|
|
2063
|
+
ServiceGetStatisticsExceptionHeaders,
|
|
2064
|
+
ServiceGetStatisticsHeaders,
|
|
2065
|
+
ServiceSetPropertiesExceptionHeaders,
|
|
2066
|
+
ServiceSetPropertiesHeaders,
|
|
2067
|
+
SignedIdentifier,
|
|
2068
|
+
TableCreateExceptionHeaders,
|
|
2069
|
+
TableCreateHeaders,
|
|
2070
|
+
TableDeleteEntityExceptionHeaders,
|
|
2071
|
+
TableDeleteEntityHeaders,
|
|
2072
|
+
TableDeleteExceptionHeaders,
|
|
2073
|
+
TableDeleteHeaders,
|
|
2074
|
+
TableEntityQueryResponse,
|
|
2075
|
+
TableGetAccessPolicyExceptionHeaders,
|
|
2076
|
+
TableGetAccessPolicyHeaders,
|
|
2077
|
+
TableInsertEntityExceptionHeaders,
|
|
2078
|
+
TableInsertEntityHeaders,
|
|
2079
|
+
TableMergeEntityExceptionHeaders,
|
|
2080
|
+
TableMergeEntityHeaders,
|
|
2081
|
+
TableProperties,
|
|
2082
|
+
TableQueryEntitiesExceptionHeaders,
|
|
2083
|
+
TableQueryEntitiesHeaders,
|
|
2084
|
+
TableQueryEntitiesWithPartitionAndRowKeyExceptionHeaders,
|
|
2085
|
+
TableQueryEntitiesWithPartitionAndRowKeyHeaders,
|
|
2086
|
+
TableQueryExceptionHeaders,
|
|
2087
|
+
TableQueryHeaders,
|
|
2088
|
+
TableQueryResponse,
|
|
2089
|
+
TableResponse,
|
|
2090
|
+
TableResponseProperties,
|
|
2091
|
+
TableServiceError,
|
|
2092
|
+
TableServiceErrorOdataError,
|
|
2093
|
+
TableServiceErrorOdataErrorMessage,
|
|
2094
|
+
TableServiceProperties,
|
|
2095
|
+
TableServiceStats,
|
|
2096
|
+
TableSetAccessPolicyExceptionHeaders,
|
|
2097
|
+
TableSetAccessPolicyHeaders,
|
|
2098
|
+
TableUpdateEntityExceptionHeaders,
|
|
2099
|
+
TableUpdateEntityHeaders
|
|
2100
|
+
});
|
|
2101
|
+
var accept = {
|
|
2102
|
+
parameterPath: "accept",
|
|
2103
|
+
mapper: {
|
|
2104
|
+
defaultValue: "application/json;odata=minimalmetadata",
|
|
2105
|
+
isConstant: true,
|
|
2106
|
+
serializedName: "Accept",
|
|
2107
|
+
type: {
|
|
2108
|
+
name: "String"
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
};
|
|
2112
|
+
var url = {
|
|
2113
|
+
parameterPath: "url",
|
|
2114
|
+
mapper: {
|
|
2115
|
+
serializedName: "url",
|
|
2116
|
+
required: true,
|
|
2117
|
+
xmlName: "url",
|
|
2118
|
+
type: {
|
|
2119
|
+
name: "String"
|
|
2120
|
+
}
|
|
2121
|
+
},
|
|
2122
|
+
skipEncoding: true
|
|
2123
|
+
};
|
|
2124
|
+
var version = {
|
|
2125
|
+
parameterPath: "version",
|
|
2126
|
+
mapper: {
|
|
2127
|
+
defaultValue: "2019-02-02",
|
|
2128
|
+
isConstant: true,
|
|
2129
|
+
serializedName: "x-ms-version",
|
|
2130
|
+
type: {
|
|
2131
|
+
name: "String"
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
2135
|
+
var requestId = {
|
|
2136
|
+
parameterPath: ["options", "requestId"],
|
|
2137
|
+
mapper: {
|
|
2138
|
+
serializedName: "x-ms-client-request-id",
|
|
2139
|
+
xmlName: "x-ms-client-request-id",
|
|
2140
|
+
type: {
|
|
2141
|
+
name: "String"
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
};
|
|
2145
|
+
var dataServiceVersion = {
|
|
2146
|
+
parameterPath: "dataServiceVersion",
|
|
2147
|
+
mapper: {
|
|
2148
|
+
defaultValue: "3.0",
|
|
2149
|
+
isConstant: true,
|
|
2150
|
+
serializedName: "DataServiceVersion",
|
|
2151
|
+
type: {
|
|
2152
|
+
name: "String"
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
};
|
|
2156
|
+
var format = {
|
|
2157
|
+
parameterPath: ["options", "queryOptions", "format"],
|
|
2158
|
+
mapper: {
|
|
2159
|
+
serializedName: "$format",
|
|
2160
|
+
xmlName: "$format",
|
|
2161
|
+
type: {
|
|
2162
|
+
name: "String"
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
var top = {
|
|
2167
|
+
parameterPath: ["options", "queryOptions", "top"],
|
|
2168
|
+
mapper: {
|
|
2169
|
+
constraints: {
|
|
2170
|
+
InclusiveMinimum: 0
|
|
2171
|
+
},
|
|
2172
|
+
serializedName: "$top",
|
|
2173
|
+
xmlName: "$top",
|
|
2174
|
+
type: {
|
|
2175
|
+
name: "Number"
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
};
|
|
2179
|
+
var select = {
|
|
2180
|
+
parameterPath: ["options", "queryOptions", "select"],
|
|
2181
|
+
mapper: {
|
|
2182
|
+
serializedName: "$select",
|
|
2183
|
+
xmlName: "$select",
|
|
2184
|
+
type: {
|
|
2185
|
+
name: "String"
|
|
2186
|
+
}
|
|
2187
|
+
}
|
|
2188
|
+
};
|
|
2189
|
+
var filter = {
|
|
2190
|
+
parameterPath: ["options", "queryOptions", "filter"],
|
|
2191
|
+
mapper: {
|
|
2192
|
+
serializedName: "$filter",
|
|
2193
|
+
xmlName: "$filter",
|
|
2194
|
+
type: {
|
|
2195
|
+
name: "String"
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
};
|
|
2199
|
+
var nextTableName = {
|
|
2200
|
+
parameterPath: ["options", "nextTableName"],
|
|
2201
|
+
mapper: {
|
|
2202
|
+
serializedName: "NextTableName",
|
|
2203
|
+
xmlName: "NextTableName",
|
|
2204
|
+
type: {
|
|
2205
|
+
name: "String"
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
};
|
|
2209
|
+
var contentType = {
|
|
2210
|
+
parameterPath: ["options", "contentType"],
|
|
2211
|
+
mapper: {
|
|
2212
|
+
defaultValue: "application/json;odata=nometadata",
|
|
2213
|
+
isConstant: true,
|
|
2214
|
+
serializedName: "Content-Type",
|
|
2215
|
+
type: {
|
|
2216
|
+
name: "String"
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
};
|
|
2220
|
+
var tableProperties = {
|
|
2221
|
+
parameterPath: "tableProperties",
|
|
2222
|
+
mapper: TableProperties
|
|
2223
|
+
};
|
|
2224
|
+
var responsePreference = {
|
|
2225
|
+
parameterPath: ["options", "responsePreference"],
|
|
2226
|
+
mapper: {
|
|
2227
|
+
serializedName: "Prefer",
|
|
2228
|
+
xmlName: "Prefer",
|
|
2229
|
+
type: {
|
|
2230
|
+
name: "String"
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
};
|
|
2234
|
+
var accept1 = {
|
|
2235
|
+
parameterPath: "accept",
|
|
2236
|
+
mapper: {
|
|
2237
|
+
defaultValue: "application/json",
|
|
2238
|
+
isConstant: true,
|
|
2239
|
+
serializedName: "Accept",
|
|
2240
|
+
type: {
|
|
2241
|
+
name: "String"
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
2244
|
+
};
|
|
2245
|
+
var table = {
|
|
2246
|
+
parameterPath: "table",
|
|
2247
|
+
mapper: {
|
|
2248
|
+
serializedName: "table",
|
|
2249
|
+
required: true,
|
|
2250
|
+
xmlName: "table",
|
|
2251
|
+
type: {
|
|
2252
|
+
name: "String"
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
};
|
|
2256
|
+
var timeout = {
|
|
2257
|
+
parameterPath: ["options", "timeout"],
|
|
2258
|
+
mapper: {
|
|
2259
|
+
constraints: {
|
|
2260
|
+
InclusiveMinimum: 0
|
|
2261
|
+
},
|
|
2262
|
+
serializedName: "timeout",
|
|
2263
|
+
xmlName: "timeout",
|
|
2264
|
+
type: {
|
|
2265
|
+
name: "Number"
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
};
|
|
2269
|
+
var nextPartitionKey = {
|
|
2270
|
+
parameterPath: ["options", "nextPartitionKey"],
|
|
2271
|
+
mapper: {
|
|
2272
|
+
serializedName: "NextPartitionKey",
|
|
2273
|
+
xmlName: "NextPartitionKey",
|
|
2274
|
+
type: {
|
|
2275
|
+
name: "String"
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
};
|
|
2279
|
+
var nextRowKey = {
|
|
2280
|
+
parameterPath: ["options", "nextRowKey"],
|
|
2281
|
+
mapper: {
|
|
2282
|
+
serializedName: "NextRowKey",
|
|
2283
|
+
xmlName: "NextRowKey",
|
|
2284
|
+
type: {
|
|
2285
|
+
name: "String"
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
var partitionKey = {
|
|
2290
|
+
parameterPath: "partitionKey",
|
|
2291
|
+
mapper: {
|
|
2292
|
+
serializedName: "partitionKey",
|
|
2293
|
+
required: true,
|
|
2294
|
+
xmlName: "partitionKey",
|
|
2295
|
+
type: {
|
|
2296
|
+
name: "String"
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
};
|
|
2300
|
+
var rowKey = {
|
|
2301
|
+
parameterPath: "rowKey",
|
|
2302
|
+
mapper: {
|
|
2303
|
+
serializedName: "rowKey",
|
|
2304
|
+
required: true,
|
|
2305
|
+
xmlName: "rowKey",
|
|
2306
|
+
type: {
|
|
2307
|
+
name: "String"
|
|
2308
|
+
}
|
|
2309
|
+
}
|
|
2310
|
+
};
|
|
2311
|
+
var contentType1 = {
|
|
2312
|
+
parameterPath: ["options", "contentType"],
|
|
2313
|
+
mapper: {
|
|
2314
|
+
defaultValue: "application/json",
|
|
2315
|
+
isConstant: true,
|
|
2316
|
+
serializedName: "Content-Type",
|
|
2317
|
+
type: {
|
|
2318
|
+
name: "String"
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
};
|
|
2322
|
+
var tableEntityProperties = {
|
|
2323
|
+
parameterPath: ["options", "tableEntityProperties"],
|
|
2324
|
+
mapper: {
|
|
2325
|
+
serializedName: "tableEntityProperties",
|
|
2326
|
+
xmlName: "tableEntityProperties",
|
|
2327
|
+
type: {
|
|
2328
|
+
name: "Dictionary",
|
|
2329
|
+
value: { type: { name: "any" } }
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
var ifMatch = {
|
|
2334
|
+
parameterPath: ["options", "ifMatch"],
|
|
2335
|
+
mapper: {
|
|
2336
|
+
serializedName: "If-Match",
|
|
2337
|
+
xmlName: "If-Match",
|
|
2338
|
+
type: {
|
|
2339
|
+
name: "String"
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
};
|
|
2343
|
+
var ifMatch1 = {
|
|
2344
|
+
parameterPath: "ifMatch",
|
|
2345
|
+
mapper: {
|
|
2346
|
+
serializedName: "If-Match",
|
|
2347
|
+
required: true,
|
|
2348
|
+
xmlName: "If-Match",
|
|
2349
|
+
type: {
|
|
2350
|
+
name: "String"
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
};
|
|
2354
|
+
var accept2 = {
|
|
2355
|
+
parameterPath: "accept",
|
|
2356
|
+
mapper: {
|
|
2357
|
+
defaultValue: "application/xml",
|
|
2358
|
+
isConstant: true,
|
|
2359
|
+
serializedName: "Accept",
|
|
2360
|
+
type: {
|
|
2361
|
+
name: "String"
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
};
|
|
2365
|
+
var comp = {
|
|
2366
|
+
parameterPath: "comp",
|
|
2367
|
+
mapper: {
|
|
2368
|
+
defaultValue: "acl",
|
|
2369
|
+
isConstant: true,
|
|
2370
|
+
serializedName: "comp",
|
|
2371
|
+
type: {
|
|
2372
|
+
name: "String"
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2375
|
+
};
|
|
2376
|
+
var contentType2 = {
|
|
2377
|
+
parameterPath: ["options", "contentType"],
|
|
2378
|
+
mapper: {
|
|
2379
|
+
defaultValue: "application/xml",
|
|
2380
|
+
isConstant: true,
|
|
2381
|
+
serializedName: "Content-Type",
|
|
2382
|
+
type: {
|
|
2383
|
+
name: "String"
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
};
|
|
2387
|
+
var tableAcl = {
|
|
2388
|
+
parameterPath: ["options", "tableAcl"],
|
|
2389
|
+
mapper: {
|
|
2390
|
+
serializedName: "tableAcl",
|
|
2391
|
+
xmlName: "SignedIdentifiers",
|
|
2392
|
+
xmlIsWrapped: true,
|
|
2393
|
+
xmlElementName: "SignedIdentifier",
|
|
2394
|
+
type: {
|
|
2395
|
+
name: "Sequence",
|
|
2396
|
+
element: {
|
|
2397
|
+
type: {
|
|
2398
|
+
name: "Composite",
|
|
2399
|
+
className: "SignedIdentifier"
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
};
|
|
2405
|
+
var accept3 = {
|
|
2406
|
+
parameterPath: "accept",
|
|
2407
|
+
mapper: {
|
|
2408
|
+
defaultValue: "application/xml",
|
|
2409
|
+
isConstant: true,
|
|
2410
|
+
serializedName: "Accept",
|
|
2411
|
+
type: {
|
|
2412
|
+
name: "String"
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
};
|
|
2416
|
+
var tableServiceProperties = {
|
|
2417
|
+
parameterPath: "tableServiceProperties",
|
|
2418
|
+
mapper: TableServiceProperties
|
|
2419
|
+
};
|
|
2420
|
+
var restype = {
|
|
2421
|
+
parameterPath: "restype",
|
|
2422
|
+
mapper: {
|
|
2423
|
+
defaultValue: "service",
|
|
2424
|
+
isConstant: true,
|
|
2425
|
+
serializedName: "restype",
|
|
2426
|
+
type: {
|
|
2427
|
+
name: "String"
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
};
|
|
2431
|
+
var comp1 = {
|
|
2432
|
+
parameterPath: "comp",
|
|
2433
|
+
mapper: {
|
|
2434
|
+
defaultValue: "properties",
|
|
2435
|
+
isConstant: true,
|
|
2436
|
+
serializedName: "comp",
|
|
2437
|
+
type: {
|
|
2438
|
+
name: "String"
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
};
|
|
2442
|
+
var comp2 = {
|
|
2443
|
+
parameterPath: "comp",
|
|
2444
|
+
mapper: {
|
|
2445
|
+
defaultValue: "stats",
|
|
2446
|
+
isConstant: true,
|
|
2447
|
+
serializedName: "comp",
|
|
2448
|
+
type: {
|
|
2449
|
+
name: "String"
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
};
|
|
2453
|
+
var _TableImpl = class _TableImpl {
|
|
2454
|
+
/**
|
|
2455
|
+
* Initialize a new instance of the class Table class.
|
|
2456
|
+
* @param client Reference to the service client
|
|
2457
|
+
*/
|
|
2458
|
+
constructor(client) {
|
|
2459
|
+
this.client = client;
|
|
2460
|
+
}
|
|
2461
|
+
/**
|
|
2462
|
+
* Queries tables under the given account.
|
|
2463
|
+
* @param options The options parameters.
|
|
2464
|
+
*/
|
|
2465
|
+
query(options) {
|
|
2466
|
+
return this.client.sendOperationRequest({ options }, queryOperationSpec);
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* Creates a new table under the given account.
|
|
2470
|
+
* @param tableProperties The Table properties.
|
|
2471
|
+
* @param options The options parameters.
|
|
2472
|
+
*/
|
|
2473
|
+
create(tableProperties2, options) {
|
|
2474
|
+
return this.client.sendOperationRequest({ tableProperties: tableProperties2, options }, createOperationSpec);
|
|
2475
|
+
}
|
|
2476
|
+
/**
|
|
2477
|
+
* Operation permanently deletes the specified table.
|
|
2478
|
+
* @param table The name of the table.
|
|
2479
|
+
* @param options The options parameters.
|
|
2480
|
+
*/
|
|
2481
|
+
delete(table2, options) {
|
|
2482
|
+
return this.client.sendOperationRequest({ table: table2, options }, deleteOperationSpec);
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Queries entities in a table.
|
|
2486
|
+
* @param table The name of the table.
|
|
2487
|
+
* @param options The options parameters.
|
|
2488
|
+
*/
|
|
2489
|
+
queryEntities(table2, options) {
|
|
2490
|
+
return this.client.sendOperationRequest({ table: table2, options }, queryEntitiesOperationSpec);
|
|
2491
|
+
}
|
|
2492
|
+
/**
|
|
2493
|
+
* Queries entities in a table.
|
|
2494
|
+
* @param table The name of the table.
|
|
2495
|
+
* @param partitionKey The partition key of the entity.
|
|
2496
|
+
* @param rowKey The row key of the entity.
|
|
2497
|
+
* @param options The options parameters.
|
|
2498
|
+
*/
|
|
2499
|
+
queryEntitiesWithPartitionAndRowKey(table2, partitionKey2, rowKey2, options) {
|
|
2500
|
+
return this.client.sendOperationRequest({ table: table2, partitionKey: partitionKey2, rowKey: rowKey2, options }, queryEntitiesWithPartitionAndRowKeyOperationSpec);
|
|
2501
|
+
}
|
|
2502
|
+
/**
|
|
2503
|
+
* Update entity in a table.
|
|
2504
|
+
* @param table The name of the table.
|
|
2505
|
+
* @param partitionKey The partition key of the entity.
|
|
2506
|
+
* @param rowKey The row key of the entity.
|
|
2507
|
+
* @param options The options parameters.
|
|
2508
|
+
*/
|
|
2509
|
+
updateEntity(table2, partitionKey2, rowKey2, options) {
|
|
2510
|
+
return this.client.sendOperationRequest({ table: table2, partitionKey: partitionKey2, rowKey: rowKey2, options }, updateEntityOperationSpec);
|
|
2511
|
+
}
|
|
2512
|
+
/**
|
|
2513
|
+
* Merge entity in a table.
|
|
2514
|
+
* @param table The name of the table.
|
|
2515
|
+
* @param partitionKey The partition key of the entity.
|
|
2516
|
+
* @param rowKey The row key of the entity.
|
|
2517
|
+
* @param options The options parameters.
|
|
2518
|
+
*/
|
|
2519
|
+
mergeEntity(table2, partitionKey2, rowKey2, options) {
|
|
2520
|
+
return this.client.sendOperationRequest({ table: table2, partitionKey: partitionKey2, rowKey: rowKey2, options }, mergeEntityOperationSpec);
|
|
2521
|
+
}
|
|
2522
|
+
/**
|
|
2523
|
+
* Deletes the specified entity in a table.
|
|
2524
|
+
* @param table The name of the table.
|
|
2525
|
+
* @param partitionKey The partition key of the entity.
|
|
2526
|
+
* @param rowKey The row key of the entity.
|
|
2527
|
+
* @param ifMatch Match condition for an entity to be deleted. If specified and a matching entity is
|
|
2528
|
+
* not found, an error will be raised. To force an unconditional delete, set to the wildcard character
|
|
2529
|
+
* (*).
|
|
2530
|
+
* @param options The options parameters.
|
|
2531
|
+
*/
|
|
2532
|
+
deleteEntity(table2, partitionKey2, rowKey2, ifMatch2, options) {
|
|
2533
|
+
return this.client.sendOperationRequest({ table: table2, partitionKey: partitionKey2, rowKey: rowKey2, ifMatch: ifMatch2, options }, deleteEntityOperationSpec);
|
|
2534
|
+
}
|
|
2535
|
+
/**
|
|
2536
|
+
* Insert entity in a table.
|
|
2537
|
+
* @param table The name of the table.
|
|
2538
|
+
* @param options The options parameters.
|
|
2539
|
+
*/
|
|
2540
|
+
insertEntity(table2, options) {
|
|
2541
|
+
return this.client.sendOperationRequest({ table: table2, options }, insertEntityOperationSpec);
|
|
2542
|
+
}
|
|
2543
|
+
/**
|
|
2544
|
+
* Retrieves details about any stored access policies specified on the table that may be used with
|
|
2545
|
+
* Shared Access Signatures.
|
|
2546
|
+
* @param table The name of the table.
|
|
2547
|
+
* @param options The options parameters.
|
|
2548
|
+
*/
|
|
2549
|
+
getAccessPolicy(table2, options) {
|
|
2550
|
+
return this.client.sendOperationRequest({ table: table2, options }, getAccessPolicyOperationSpec);
|
|
2551
|
+
}
|
|
2552
|
+
/**
|
|
2553
|
+
* Sets stored access policies for the table that may be used with Shared Access Signatures.
|
|
2554
|
+
* @param table The name of the table.
|
|
2555
|
+
* @param options The options parameters.
|
|
2556
|
+
*/
|
|
2557
|
+
setAccessPolicy(table2, options) {
|
|
2558
|
+
return this.client.sendOperationRequest({ table: table2, options }, setAccessPolicyOperationSpec);
|
|
2559
|
+
}
|
|
2560
|
+
};
|
|
2561
|
+
__name(_TableImpl, "TableImpl");
|
|
2562
|
+
var TableImpl = _TableImpl;
|
|
2563
|
+
var xmlSerializer$1 = coreClient__namespace.createSerializer(
|
|
2564
|
+
Mappers,
|
|
2565
|
+
/* isXml */
|
|
2566
|
+
true
|
|
2567
|
+
);
|
|
2568
|
+
var serializer = coreClient__namespace.createSerializer(
|
|
2569
|
+
Mappers,
|
|
2570
|
+
/* isXml */
|
|
2571
|
+
false
|
|
2572
|
+
);
|
|
2573
|
+
var queryOperationSpec = {
|
|
2574
|
+
path: "/Tables",
|
|
2575
|
+
httpMethod: "GET",
|
|
2576
|
+
responses: {
|
|
2577
|
+
200: {
|
|
2578
|
+
bodyMapper: TableQueryResponse,
|
|
2579
|
+
headersMapper: TableQueryHeaders
|
|
2580
|
+
},
|
|
2581
|
+
default: {
|
|
2582
|
+
bodyMapper: TableServiceError,
|
|
2583
|
+
headersMapper: TableQueryExceptionHeaders
|
|
2584
|
+
}
|
|
2585
|
+
},
|
|
2586
|
+
queryParameters: [
|
|
2587
|
+
format,
|
|
2588
|
+
top,
|
|
2589
|
+
select,
|
|
2590
|
+
filter,
|
|
2591
|
+
nextTableName
|
|
2592
|
+
],
|
|
2593
|
+
urlParameters: [url],
|
|
2594
|
+
headerParameters: [
|
|
2595
|
+
accept,
|
|
2596
|
+
version,
|
|
2597
|
+
requestId,
|
|
2598
|
+
dataServiceVersion
|
|
2599
|
+
],
|
|
2600
|
+
serializer
|
|
2601
|
+
};
|
|
2602
|
+
var createOperationSpec = {
|
|
2603
|
+
path: "/Tables",
|
|
2604
|
+
httpMethod: "POST",
|
|
2605
|
+
responses: {
|
|
2606
|
+
201: {
|
|
2607
|
+
bodyMapper: TableResponse,
|
|
2608
|
+
headersMapper: TableCreateHeaders
|
|
2609
|
+
},
|
|
2610
|
+
204: {
|
|
2611
|
+
headersMapper: TableCreateHeaders
|
|
2612
|
+
},
|
|
2613
|
+
default: {
|
|
2614
|
+
bodyMapper: TableServiceError,
|
|
2615
|
+
headersMapper: TableCreateExceptionHeaders
|
|
2616
|
+
}
|
|
2617
|
+
},
|
|
2618
|
+
requestBody: tableProperties,
|
|
2619
|
+
queryParameters: [format],
|
|
2620
|
+
urlParameters: [url],
|
|
2621
|
+
headerParameters: [
|
|
2622
|
+
accept,
|
|
2623
|
+
version,
|
|
2624
|
+
requestId,
|
|
2625
|
+
dataServiceVersion,
|
|
2626
|
+
contentType,
|
|
2627
|
+
responsePreference
|
|
2628
|
+
],
|
|
2629
|
+
mediaType: "json",
|
|
2630
|
+
serializer
|
|
2631
|
+
};
|
|
2632
|
+
var deleteOperationSpec = {
|
|
2633
|
+
path: "/Tables('{table}')",
|
|
2634
|
+
httpMethod: "DELETE",
|
|
2635
|
+
responses: {
|
|
2636
|
+
204: {
|
|
2637
|
+
headersMapper: TableDeleteHeaders
|
|
2638
|
+
},
|
|
2639
|
+
default: {
|
|
2640
|
+
bodyMapper: TableServiceError,
|
|
2641
|
+
headersMapper: TableDeleteExceptionHeaders
|
|
2642
|
+
}
|
|
2643
|
+
},
|
|
2644
|
+
urlParameters: [url, table],
|
|
2645
|
+
headerParameters: [
|
|
2646
|
+
version,
|
|
2647
|
+
requestId,
|
|
2648
|
+
accept1
|
|
2649
|
+
],
|
|
2650
|
+
serializer
|
|
2651
|
+
};
|
|
2652
|
+
var queryEntitiesOperationSpec = {
|
|
2653
|
+
path: "/{table}()",
|
|
2654
|
+
httpMethod: "GET",
|
|
2655
|
+
responses: {
|
|
2656
|
+
200: {
|
|
2657
|
+
bodyMapper: TableEntityQueryResponse,
|
|
2658
|
+
headersMapper: TableQueryEntitiesHeaders
|
|
2659
|
+
},
|
|
2660
|
+
default: {
|
|
2661
|
+
bodyMapper: TableServiceError,
|
|
2662
|
+
headersMapper: TableQueryEntitiesExceptionHeaders
|
|
2663
|
+
}
|
|
2664
|
+
},
|
|
2665
|
+
queryParameters: [
|
|
2666
|
+
format,
|
|
2667
|
+
top,
|
|
2668
|
+
select,
|
|
2669
|
+
filter,
|
|
2670
|
+
timeout,
|
|
2671
|
+
nextPartitionKey,
|
|
2672
|
+
nextRowKey
|
|
2673
|
+
],
|
|
2674
|
+
urlParameters: [url, table],
|
|
2675
|
+
headerParameters: [
|
|
2676
|
+
accept,
|
|
2677
|
+
version,
|
|
2678
|
+
requestId,
|
|
2679
|
+
dataServiceVersion
|
|
2680
|
+
],
|
|
2681
|
+
serializer
|
|
2682
|
+
};
|
|
2683
|
+
var queryEntitiesWithPartitionAndRowKeyOperationSpec = {
|
|
2684
|
+
path: "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')",
|
|
2685
|
+
httpMethod: "GET",
|
|
2686
|
+
responses: {
|
|
2687
|
+
200: {
|
|
2688
|
+
bodyMapper: {
|
|
2689
|
+
type: { name: "Dictionary", value: { type: { name: "any" } } }
|
|
2690
|
+
},
|
|
2691
|
+
headersMapper: TableQueryEntitiesWithPartitionAndRowKeyHeaders
|
|
2692
|
+
},
|
|
2693
|
+
default: {
|
|
2694
|
+
bodyMapper: TableServiceError,
|
|
2695
|
+
headersMapper: TableQueryEntitiesWithPartitionAndRowKeyExceptionHeaders
|
|
2696
|
+
}
|
|
2697
|
+
},
|
|
2698
|
+
queryParameters: [
|
|
2699
|
+
format,
|
|
2700
|
+
select,
|
|
2701
|
+
filter,
|
|
2702
|
+
timeout
|
|
2703
|
+
],
|
|
2704
|
+
urlParameters: [
|
|
2705
|
+
url,
|
|
2706
|
+
table,
|
|
2707
|
+
partitionKey,
|
|
2708
|
+
rowKey
|
|
2709
|
+
],
|
|
2710
|
+
headerParameters: [
|
|
2711
|
+
accept,
|
|
2712
|
+
version,
|
|
2713
|
+
requestId,
|
|
2714
|
+
dataServiceVersion
|
|
2715
|
+
],
|
|
2716
|
+
serializer
|
|
2717
|
+
};
|
|
2718
|
+
var updateEntityOperationSpec = {
|
|
2719
|
+
path: "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')",
|
|
2720
|
+
httpMethod: "PUT",
|
|
2721
|
+
responses: {
|
|
2722
|
+
204: {
|
|
2723
|
+
headersMapper: TableUpdateEntityHeaders
|
|
2724
|
+
},
|
|
2725
|
+
default: {
|
|
2726
|
+
bodyMapper: TableServiceError,
|
|
2727
|
+
headersMapper: TableUpdateEntityExceptionHeaders
|
|
2728
|
+
}
|
|
2729
|
+
},
|
|
2730
|
+
requestBody: tableEntityProperties,
|
|
2731
|
+
queryParameters: [format, timeout],
|
|
2732
|
+
urlParameters: [
|
|
2733
|
+
url,
|
|
2734
|
+
table,
|
|
2735
|
+
partitionKey,
|
|
2736
|
+
rowKey
|
|
2737
|
+
],
|
|
2738
|
+
headerParameters: [
|
|
2739
|
+
version,
|
|
2740
|
+
requestId,
|
|
2741
|
+
dataServiceVersion,
|
|
2742
|
+
accept1,
|
|
2743
|
+
contentType1,
|
|
2744
|
+
ifMatch
|
|
2745
|
+
],
|
|
2746
|
+
mediaType: "json",
|
|
2747
|
+
serializer
|
|
2748
|
+
};
|
|
2749
|
+
var mergeEntityOperationSpec = {
|
|
2750
|
+
path: "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')",
|
|
2751
|
+
httpMethod: "PATCH",
|
|
2752
|
+
responses: {
|
|
2753
|
+
204: {
|
|
2754
|
+
headersMapper: TableMergeEntityHeaders
|
|
2755
|
+
},
|
|
2756
|
+
default: {
|
|
2757
|
+
bodyMapper: TableServiceError,
|
|
2758
|
+
headersMapper: TableMergeEntityExceptionHeaders
|
|
2759
|
+
}
|
|
2760
|
+
},
|
|
2761
|
+
requestBody: tableEntityProperties,
|
|
2762
|
+
queryParameters: [format, timeout],
|
|
2763
|
+
urlParameters: [
|
|
2764
|
+
url,
|
|
2765
|
+
table,
|
|
2766
|
+
partitionKey,
|
|
2767
|
+
rowKey
|
|
2768
|
+
],
|
|
2769
|
+
headerParameters: [
|
|
2770
|
+
version,
|
|
2771
|
+
requestId,
|
|
2772
|
+
dataServiceVersion,
|
|
2773
|
+
accept1,
|
|
2774
|
+
contentType1,
|
|
2775
|
+
ifMatch
|
|
2776
|
+
],
|
|
2777
|
+
mediaType: "json",
|
|
2778
|
+
serializer
|
|
2779
|
+
};
|
|
2780
|
+
var deleteEntityOperationSpec = {
|
|
2781
|
+
path: "/{table}(PartitionKey='{partitionKey}',RowKey='{rowKey}')",
|
|
2782
|
+
httpMethod: "DELETE",
|
|
2783
|
+
responses: {
|
|
2784
|
+
204: {
|
|
2785
|
+
headersMapper: TableDeleteEntityHeaders
|
|
2786
|
+
},
|
|
2787
|
+
default: {
|
|
2788
|
+
bodyMapper: TableServiceError,
|
|
2789
|
+
headersMapper: TableDeleteEntityExceptionHeaders
|
|
2790
|
+
}
|
|
2791
|
+
},
|
|
2792
|
+
queryParameters: [format, timeout],
|
|
2793
|
+
urlParameters: [
|
|
2794
|
+
url,
|
|
2795
|
+
table,
|
|
2796
|
+
partitionKey,
|
|
2797
|
+
rowKey
|
|
2798
|
+
],
|
|
2799
|
+
headerParameters: [
|
|
2800
|
+
accept,
|
|
2801
|
+
version,
|
|
2802
|
+
requestId,
|
|
2803
|
+
dataServiceVersion,
|
|
2804
|
+
ifMatch1
|
|
2805
|
+
],
|
|
2806
|
+
serializer
|
|
2807
|
+
};
|
|
2808
|
+
var insertEntityOperationSpec = {
|
|
2809
|
+
path: "/{table}",
|
|
2810
|
+
httpMethod: "POST",
|
|
2811
|
+
responses: {
|
|
2812
|
+
201: {
|
|
2813
|
+
bodyMapper: {
|
|
2814
|
+
type: { name: "Dictionary", value: { type: { name: "any" } } }
|
|
2815
|
+
},
|
|
2816
|
+
headersMapper: TableInsertEntityHeaders
|
|
2817
|
+
},
|
|
2818
|
+
204: {
|
|
2819
|
+
headersMapper: TableInsertEntityHeaders
|
|
2820
|
+
},
|
|
2821
|
+
default: {
|
|
2822
|
+
bodyMapper: TableServiceError,
|
|
2823
|
+
headersMapper: TableInsertEntityExceptionHeaders
|
|
2824
|
+
}
|
|
2825
|
+
},
|
|
2826
|
+
requestBody: tableEntityProperties,
|
|
2827
|
+
queryParameters: [format, timeout],
|
|
2828
|
+
urlParameters: [url, table],
|
|
2829
|
+
headerParameters: [
|
|
2830
|
+
accept,
|
|
2831
|
+
version,
|
|
2832
|
+
requestId,
|
|
2833
|
+
dataServiceVersion,
|
|
2834
|
+
contentType,
|
|
2835
|
+
responsePreference
|
|
2836
|
+
],
|
|
2837
|
+
mediaType: "json",
|
|
2838
|
+
serializer
|
|
2839
|
+
};
|
|
2840
|
+
var getAccessPolicyOperationSpec = {
|
|
2841
|
+
path: "/{table}",
|
|
2842
|
+
httpMethod: "GET",
|
|
2843
|
+
responses: {
|
|
2844
|
+
200: {
|
|
2845
|
+
bodyMapper: {
|
|
2846
|
+
type: {
|
|
2847
|
+
name: "Sequence",
|
|
2848
|
+
element: {
|
|
2849
|
+
type: { name: "Composite", className: "SignedIdentifier" }
|
|
2850
|
+
}
|
|
2851
|
+
},
|
|
2852
|
+
serializedName: "SignedIdentifiers",
|
|
2853
|
+
xmlName: "SignedIdentifiers",
|
|
2854
|
+
xmlIsWrapped: true,
|
|
2855
|
+
xmlElementName: "SignedIdentifier"
|
|
2856
|
+
},
|
|
2857
|
+
headersMapper: TableGetAccessPolicyHeaders
|
|
2858
|
+
},
|
|
2859
|
+
default: {
|
|
2860
|
+
bodyMapper: TableServiceError,
|
|
2861
|
+
headersMapper: TableGetAccessPolicyExceptionHeaders
|
|
2862
|
+
}
|
|
2863
|
+
},
|
|
2864
|
+
queryParameters: [timeout, comp],
|
|
2865
|
+
urlParameters: [url, table],
|
|
2866
|
+
headerParameters: [
|
|
2867
|
+
version,
|
|
2868
|
+
requestId,
|
|
2869
|
+
accept2
|
|
2870
|
+
],
|
|
2871
|
+
isXML: true,
|
|
2872
|
+
serializer: xmlSerializer$1
|
|
2873
|
+
};
|
|
2874
|
+
var setAccessPolicyOperationSpec = {
|
|
2875
|
+
path: "/{table}",
|
|
2876
|
+
httpMethod: "PUT",
|
|
2877
|
+
responses: {
|
|
2878
|
+
204: {
|
|
2879
|
+
headersMapper: TableSetAccessPolicyHeaders
|
|
2880
|
+
},
|
|
2881
|
+
default: {
|
|
2882
|
+
bodyMapper: TableServiceError,
|
|
2883
|
+
headersMapper: TableSetAccessPolicyExceptionHeaders
|
|
2884
|
+
}
|
|
2885
|
+
},
|
|
2886
|
+
requestBody: tableAcl,
|
|
2887
|
+
queryParameters: [timeout, comp],
|
|
2888
|
+
urlParameters: [url, table],
|
|
2889
|
+
headerParameters: [
|
|
2890
|
+
version,
|
|
2891
|
+
requestId,
|
|
2892
|
+
contentType2,
|
|
2893
|
+
accept3
|
|
2894
|
+
],
|
|
2895
|
+
isXML: true,
|
|
2896
|
+
contentType: "application/xml; charset=utf-8",
|
|
2897
|
+
mediaType: "xml",
|
|
2898
|
+
serializer: xmlSerializer$1
|
|
2899
|
+
};
|
|
2900
|
+
var _ServiceImpl = class _ServiceImpl {
|
|
2901
|
+
/**
|
|
2902
|
+
* Initialize a new instance of the class Service class.
|
|
2903
|
+
* @param client Reference to the service client
|
|
2904
|
+
*/
|
|
2905
|
+
constructor(client) {
|
|
2906
|
+
this.client = client;
|
|
2907
|
+
}
|
|
2908
|
+
/**
|
|
2909
|
+
* Sets properties for an account's Table service endpoint, including properties for Analytics and CORS
|
|
2910
|
+
* (Cross-Origin Resource Sharing) rules.
|
|
2911
|
+
* @param tableServiceProperties The Table Service properties.
|
|
2912
|
+
* @param options The options parameters.
|
|
2913
|
+
*/
|
|
2914
|
+
setProperties(tableServiceProperties2, options) {
|
|
2915
|
+
return this.client.sendOperationRequest({ tableServiceProperties: tableServiceProperties2, options }, setPropertiesOperationSpec);
|
|
2916
|
+
}
|
|
2917
|
+
/**
|
|
2918
|
+
* Gets the properties of an account's Table service, including properties for Analytics and CORS
|
|
2919
|
+
* (Cross-Origin Resource Sharing) rules.
|
|
2920
|
+
* @param options The options parameters.
|
|
2921
|
+
*/
|
|
2922
|
+
getProperties(options) {
|
|
2923
|
+
return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec);
|
|
2924
|
+
}
|
|
2925
|
+
/**
|
|
2926
|
+
* Retrieves statistics related to replication for the Table service. It is only available on the
|
|
2927
|
+
* secondary location endpoint when read-access geo-redundant replication is enabled for the account.
|
|
2928
|
+
* @param options The options parameters.
|
|
2929
|
+
*/
|
|
2930
|
+
getStatistics(options) {
|
|
2931
|
+
return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec);
|
|
2932
|
+
}
|
|
2933
|
+
};
|
|
2934
|
+
__name(_ServiceImpl, "ServiceImpl");
|
|
2935
|
+
var ServiceImpl = _ServiceImpl;
|
|
2936
|
+
var xmlSerializer = coreClient__namespace.createSerializer(
|
|
2937
|
+
Mappers,
|
|
2938
|
+
/* isXml */
|
|
2939
|
+
true
|
|
2940
|
+
);
|
|
2941
|
+
var setPropertiesOperationSpec = {
|
|
2942
|
+
path: "/",
|
|
2943
|
+
httpMethod: "PUT",
|
|
2944
|
+
responses: {
|
|
2945
|
+
202: {
|
|
2946
|
+
headersMapper: ServiceSetPropertiesHeaders
|
|
2947
|
+
},
|
|
2948
|
+
default: {
|
|
2949
|
+
bodyMapper: TableServiceError,
|
|
2950
|
+
headersMapper: ServiceSetPropertiesExceptionHeaders
|
|
2951
|
+
}
|
|
2952
|
+
},
|
|
2953
|
+
requestBody: tableServiceProperties,
|
|
2954
|
+
queryParameters: [timeout, restype, comp1],
|
|
2955
|
+
urlParameters: [url],
|
|
2956
|
+
headerParameters: [
|
|
2957
|
+
version,
|
|
2958
|
+
requestId,
|
|
2959
|
+
contentType2,
|
|
2960
|
+
accept3
|
|
2961
|
+
],
|
|
2962
|
+
isXML: true,
|
|
2963
|
+
contentType: "application/xml; charset=utf-8",
|
|
2964
|
+
mediaType: "xml",
|
|
2965
|
+
serializer: xmlSerializer
|
|
2966
|
+
};
|
|
2967
|
+
var getPropertiesOperationSpec = {
|
|
2968
|
+
path: "/",
|
|
2969
|
+
httpMethod: "GET",
|
|
2970
|
+
responses: {
|
|
2971
|
+
200: {
|
|
2972
|
+
bodyMapper: TableServiceProperties,
|
|
2973
|
+
headersMapper: ServiceGetPropertiesHeaders
|
|
2974
|
+
},
|
|
2975
|
+
default: {
|
|
2976
|
+
bodyMapper: TableServiceError,
|
|
2977
|
+
headersMapper: ServiceGetPropertiesExceptionHeaders
|
|
2978
|
+
}
|
|
2979
|
+
},
|
|
2980
|
+
queryParameters: [timeout, restype, comp1],
|
|
2981
|
+
urlParameters: [url],
|
|
2982
|
+
headerParameters: [
|
|
2983
|
+
version,
|
|
2984
|
+
requestId,
|
|
2985
|
+
accept2
|
|
2986
|
+
],
|
|
2987
|
+
isXML: true,
|
|
2988
|
+
serializer: xmlSerializer
|
|
2989
|
+
};
|
|
2990
|
+
var getStatisticsOperationSpec = {
|
|
2991
|
+
path: "/",
|
|
2992
|
+
httpMethod: "GET",
|
|
2993
|
+
responses: {
|
|
2994
|
+
200: {
|
|
2995
|
+
bodyMapper: TableServiceStats,
|
|
2996
|
+
headersMapper: ServiceGetStatisticsHeaders
|
|
2997
|
+
},
|
|
2998
|
+
default: {
|
|
2999
|
+
bodyMapper: TableServiceError,
|
|
3000
|
+
headersMapper: ServiceGetStatisticsExceptionHeaders
|
|
3001
|
+
}
|
|
3002
|
+
},
|
|
3003
|
+
queryParameters: [timeout, restype, comp2],
|
|
3004
|
+
urlParameters: [url],
|
|
3005
|
+
headerParameters: [
|
|
3006
|
+
version,
|
|
3007
|
+
requestId,
|
|
3008
|
+
accept2
|
|
3009
|
+
],
|
|
3010
|
+
isXML: true,
|
|
3011
|
+
serializer: xmlSerializer
|
|
3012
|
+
};
|
|
3013
|
+
var _GeneratedClient = class _GeneratedClient extends coreClient__namespace.ServiceClient {
|
|
3014
|
+
/**
|
|
3015
|
+
* Initializes a new instance of the GeneratedClient class.
|
|
3016
|
+
* @param url The URL of the service account or table that is the target of the desired operation.
|
|
3017
|
+
* @param options The parameter options
|
|
3018
|
+
*/
|
|
3019
|
+
constructor(url2, options) {
|
|
3020
|
+
var _a, _b;
|
|
3021
|
+
if (url2 === void 0) {
|
|
3022
|
+
throw new Error("'url' cannot be null");
|
|
3023
|
+
}
|
|
3024
|
+
if (!options) {
|
|
3025
|
+
options = {};
|
|
3026
|
+
}
|
|
3027
|
+
const defaults = {
|
|
3028
|
+
requestContentType: "application/json; charset=utf-8"
|
|
3029
|
+
};
|
|
3030
|
+
const packageDetails = `azsdk-js-data-tables/13.1.2`;
|
|
3031
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`;
|
|
3032
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
3033
|
+
userAgentPrefix
|
|
3034
|
+
}, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" });
|
|
3035
|
+
super(optionsWithDefaults);
|
|
3036
|
+
this.url = url2;
|
|
3037
|
+
this.version = options.version || "2019-02-02";
|
|
3038
|
+
this.table = new TableImpl(this);
|
|
3039
|
+
this.service = new ServiceImpl(this);
|
|
3040
|
+
}
|
|
3041
|
+
};
|
|
3042
|
+
__name(_GeneratedClient, "GeneratedClient");
|
|
3043
|
+
var GeneratedClient = _GeneratedClient;
|
|
3044
|
+
var apiVersionPolicyName = "apiVersionPolicy";
|
|
3045
|
+
var apiVersionPolicy = /* @__PURE__ */ __name((apiVersion) => {
|
|
3046
|
+
return {
|
|
3047
|
+
name: apiVersionPolicyName,
|
|
3048
|
+
sendRequest: /* @__PURE__ */ __name(async (req, next) => {
|
|
3049
|
+
req.headers.set("x-ms-version", apiVersion);
|
|
3050
|
+
return next(req);
|
|
3051
|
+
}, "sendRequest")
|
|
3052
|
+
};
|
|
3053
|
+
}, "apiVersionPolicy");
|
|
3054
|
+
function fromAccountConnectionString(extractedCreds, options = {}) {
|
|
3055
|
+
const sharedKeyCredential = new coreAuth.AzureNamedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);
|
|
3056
|
+
return {
|
|
3057
|
+
url: extractedCreds.url,
|
|
3058
|
+
options,
|
|
3059
|
+
credential: sharedKeyCredential
|
|
3060
|
+
};
|
|
3061
|
+
}
|
|
3062
|
+
__name(fromAccountConnectionString, "fromAccountConnectionString");
|
|
3063
|
+
function getAccountConnectionString(accountName, accountKey, defaultEndpointsProtocol, endpointSuffix, tableEndpoint) {
|
|
3064
|
+
if (!tableEndpoint) {
|
|
3065
|
+
const protocol = defaultEndpointsProtocol.toLowerCase();
|
|
3066
|
+
if (protocol !== "https" && protocol !== "http") {
|
|
3067
|
+
throw new Error("Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'");
|
|
3068
|
+
}
|
|
3069
|
+
if (!endpointSuffix) {
|
|
3070
|
+
throw new Error("Invalid EndpointSuffix in the provided Connection String");
|
|
3071
|
+
}
|
|
3072
|
+
tableEndpoint = `${defaultEndpointsProtocol}://${accountName}.table.${endpointSuffix}`;
|
|
3073
|
+
}
|
|
3074
|
+
if (!accountName) {
|
|
3075
|
+
throw new Error("Invalid AccountName in the provided Connection String");
|
|
3076
|
+
} else if (accountKey.length === 0) {
|
|
3077
|
+
throw new Error("Invalid AccountKey in the provided Connection String");
|
|
3078
|
+
}
|
|
3079
|
+
return {
|
|
3080
|
+
kind: "AccountConnString",
|
|
3081
|
+
url: tableEndpoint,
|
|
3082
|
+
accountName,
|
|
3083
|
+
accountKey
|
|
3084
|
+
};
|
|
3085
|
+
}
|
|
3086
|
+
__name(getAccountConnectionString, "getAccountConnectionString");
|
|
3087
|
+
var DevelopmentConnectionString = "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1";
|
|
3088
|
+
function getClientParamsFromConnectionString(connectionString, options = {}) {
|
|
3089
|
+
if (connectionString.toLowerCase().indexOf("usedevelopmentstorage=true") !== -1) {
|
|
3090
|
+
connectionString = DevelopmentConnectionString;
|
|
3091
|
+
options.allowInsecureConnection = true;
|
|
3092
|
+
}
|
|
3093
|
+
const extractedCreds = extractConnectionStringParts(connectionString);
|
|
3094
|
+
if (extractedCreds.kind === "AccountConnString") {
|
|
3095
|
+
return fromAccountConnectionString(extractedCreds, options);
|
|
3096
|
+
} else if (extractedCreds.kind === "SASConnString") {
|
|
3097
|
+
return {
|
|
3098
|
+
url: `${extractedCreds.url}?${extractedCreds.accountSas}`,
|
|
3099
|
+
options
|
|
3100
|
+
};
|
|
3101
|
+
} else {
|
|
3102
|
+
throw new Error("Connection string must be either an Account connection string or a SAS connection string");
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
__name(getClientParamsFromConnectionString, "getClientParamsFromConnectionString");
|
|
3106
|
+
function extractConnectionStringParts(connectionString) {
|
|
3107
|
+
let tableEndpoint = getValueInConnString(connectionString, "TableEndpoint");
|
|
3108
|
+
tableEndpoint = tableEndpoint.endsWith("/") ? tableEndpoint.slice(0, -1) : tableEndpoint;
|
|
3109
|
+
if (isAccountConnectionString(connectionString)) {
|
|
3110
|
+
return getAccountConnectionString(getValueInConnString(connectionString, "AccountName"), getValueInConnString(connectionString, "AccountKey"), getValueInConnString(connectionString, "DefaultEndpointsProtocol"), getValueInConnString(connectionString, "EndpointSuffix"), tableEndpoint);
|
|
3111
|
+
} else {
|
|
3112
|
+
return getSASConnectionString(connectionString, tableEndpoint);
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
__name(extractConnectionStringParts, "extractConnectionStringParts");
|
|
3116
|
+
function isAccountConnectionString(connectionString) {
|
|
3117
|
+
const lowercaseConnectionString = connectionString.toLowerCase();
|
|
3118
|
+
return lowercaseConnectionString.search("defaultendpointsprotocol=") !== -1 && lowercaseConnectionString.search("accountkey=") !== -1;
|
|
3119
|
+
}
|
|
3120
|
+
__name(isAccountConnectionString, "isAccountConnectionString");
|
|
3121
|
+
function getSASConnectionString(connectionString, tableEndpoint) {
|
|
3122
|
+
const accountName = getAccountNameFromUrl(tableEndpoint);
|
|
3123
|
+
const accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
|
|
3124
|
+
if (!tableEndpoint) {
|
|
3125
|
+
throw new Error("Invalid TableEndpoint in the provided SAS Connection String");
|
|
3126
|
+
} else if (!accountSas) {
|
|
3127
|
+
throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
|
|
3128
|
+
} else if (!accountName) {
|
|
3129
|
+
throw new Error("Invalid AccountName in the provided SAS Connection String");
|
|
3130
|
+
}
|
|
3131
|
+
return { kind: "SASConnString", url: tableEndpoint, accountName, accountSas };
|
|
3132
|
+
}
|
|
3133
|
+
__name(getSASConnectionString, "getSASConnectionString");
|
|
3134
|
+
function getValueInConnString(connectionString, argument) {
|
|
3135
|
+
const searchKey = argument.toLowerCase();
|
|
3136
|
+
const elements = connectionString.split(";").filter((e) => Boolean(e));
|
|
3137
|
+
for (const element of elements) {
|
|
3138
|
+
const trimmedElement = element.trim();
|
|
3139
|
+
const [elementKey, value] = getValuePair(trimmedElement);
|
|
3140
|
+
const key = elementKey.toLowerCase();
|
|
3141
|
+
if (key === searchKey) {
|
|
3142
|
+
return value;
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
return "";
|
|
3146
|
+
}
|
|
3147
|
+
__name(getValueInConnString, "getValueInConnString");
|
|
3148
|
+
function getValuePair(kvp) {
|
|
3149
|
+
if (!kvp || kvp.indexOf("=") === -1) {
|
|
3150
|
+
return [];
|
|
3151
|
+
}
|
|
3152
|
+
const key = kvp.substr(0, kvp.indexOf("="));
|
|
3153
|
+
const value = kvp.substr(kvp.indexOf("=") + 1);
|
|
3154
|
+
return [key, value];
|
|
3155
|
+
}
|
|
3156
|
+
__name(getValuePair, "getValuePair");
|
|
3157
|
+
function getAccountNameFromUrl(url2) {
|
|
3158
|
+
if (!url2) {
|
|
3159
|
+
return url2;
|
|
3160
|
+
}
|
|
3161
|
+
const parsedUrl = new URL(url2);
|
|
3162
|
+
let accountName;
|
|
3163
|
+
const host = parsedUrl.host || "";
|
|
3164
|
+
const path = parsedUrl.pathname || "";
|
|
3165
|
+
const hostParts = host.split(".");
|
|
3166
|
+
const pathParts = path.split("/");
|
|
3167
|
+
if (hostParts.length >= 1 && hostParts[1] === "table") {
|
|
3168
|
+
url2 = url2.endsWith("/") ? url2.slice(0, -1) : url2;
|
|
3169
|
+
accountName = host.split(".")[0];
|
|
3170
|
+
} else if (pathParts.length >= 1) {
|
|
3171
|
+
accountName = pathParts[1];
|
|
3172
|
+
} else {
|
|
3173
|
+
throw new Error("Unable to extract accountName with provided information.");
|
|
3174
|
+
}
|
|
3175
|
+
return accountName;
|
|
3176
|
+
}
|
|
3177
|
+
__name(getAccountNameFromUrl, "getAccountNameFromUrl");
|
|
3178
|
+
function handleTableAlreadyExists(error, options = {}) {
|
|
3179
|
+
var _a, _b;
|
|
3180
|
+
const responseError = getErrorResponse(error);
|
|
3181
|
+
if (responseError && responseError.status === 409 && ((_a = responseError.parsedBody.odataError) === null || _a === void 0 ? void 0 : _a.code) === "TableAlreadyExists") {
|
|
3182
|
+
(_b = options.logger) === null || _b === void 0 ? void 0 : _b.info(`Table ${options.tableName} already Exists`);
|
|
3183
|
+
if (options.onResponse) {
|
|
3184
|
+
options.onResponse(responseError, {});
|
|
3185
|
+
}
|
|
3186
|
+
} else {
|
|
3187
|
+
throw error;
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
__name(handleTableAlreadyExists, "handleTableAlreadyExists");
|
|
3191
|
+
function getErrorResponse(error) {
|
|
3192
|
+
if (!isRestError(error)) {
|
|
3193
|
+
return void 0;
|
|
3194
|
+
}
|
|
3195
|
+
const errorResponse = error.response;
|
|
3196
|
+
if (!errorResponse || !isTableServiceErrorResponse(errorResponse.parsedBody)) {
|
|
3197
|
+
return void 0;
|
|
3198
|
+
}
|
|
3199
|
+
return errorResponse;
|
|
3200
|
+
}
|
|
3201
|
+
__name(getErrorResponse, "getErrorResponse");
|
|
3202
|
+
function isRestError(error) {
|
|
3203
|
+
return error.name === "RestError";
|
|
3204
|
+
}
|
|
3205
|
+
__name(isRestError, "isRestError");
|
|
3206
|
+
function isTableServiceErrorResponse(errorResponseBody) {
|
|
3207
|
+
return Boolean(errorResponseBody === null || errorResponseBody === void 0 ? void 0 : errorResponseBody.odataError);
|
|
3208
|
+
}
|
|
3209
|
+
__name(isTableServiceErrorResponse, "isTableServiceErrorResponse");
|
|
3210
|
+
function isCredential(credential) {
|
|
3211
|
+
return coreAuth.isSASCredential(credential) || coreAuth.isNamedKeyCredential(credential) || coreAuth.isTokenCredential(credential);
|
|
3212
|
+
}
|
|
3213
|
+
__name(isCredential, "isCredential");
|
|
3214
|
+
var logger2 = logger$1.createClientLogger("data-tables");
|
|
3215
|
+
function setTokenChallengeAuthenticationPolicy(pipeline, credential, scopes) {
|
|
3216
|
+
pipeline.removePolicy({ name: "bearerTokenPolicy" });
|
|
3217
|
+
pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
3218
|
+
credential,
|
|
3219
|
+
scopes,
|
|
3220
|
+
challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge }
|
|
3221
|
+
}), {
|
|
3222
|
+
phase: "Sign"
|
|
3223
|
+
});
|
|
3224
|
+
}
|
|
3225
|
+
__name(setTokenChallengeAuthenticationPolicy, "setTokenChallengeAuthenticationPolicy");
|
|
3226
|
+
var tablesNamedKeyCredentialPolicyName = "tablesNamedKeyCredentialPolicy";
|
|
3227
|
+
function tablesNamedKeyCredentialPolicy(credential) {
|
|
3228
|
+
function signRequest(request) {
|
|
3229
|
+
const headerValue = getAuthorizationHeader(request, credential);
|
|
3230
|
+
request.headers.set(HeaderConstants.AUTHORIZATION, headerValue);
|
|
3231
|
+
}
|
|
3232
|
+
__name(signRequest, "signRequest");
|
|
3233
|
+
return {
|
|
3234
|
+
name: tablesNamedKeyCredentialPolicyName,
|
|
3235
|
+
async sendRequest(request, next) {
|
|
3236
|
+
signRequest(request);
|
|
3237
|
+
return next(request);
|
|
3238
|
+
}
|
|
3239
|
+
};
|
|
3240
|
+
}
|
|
3241
|
+
__name(tablesNamedKeyCredentialPolicy, "tablesNamedKeyCredentialPolicy");
|
|
3242
|
+
function getAuthorizationHeader(request, credential) {
|
|
3243
|
+
if (!request.headers.has(HeaderConstants.X_MS_DATE)) {
|
|
3244
|
+
request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString());
|
|
3245
|
+
}
|
|
3246
|
+
if (request.body && typeof request.body === "string" && request.body.length > 0) {
|
|
3247
|
+
request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));
|
|
3248
|
+
}
|
|
3249
|
+
const dateHeader = getHeaderValueToSign(request, HeaderConstants.X_MS_DATE);
|
|
3250
|
+
if (!dateHeader) {
|
|
3251
|
+
throw new Error("Failed to sign request: x-ms-date or date header must be present");
|
|
3252
|
+
}
|
|
3253
|
+
const stringToSign = [
|
|
3254
|
+
dateHeader,
|
|
3255
|
+
getCanonicalizedResourceString(request, credential)
|
|
3256
|
+
].join("\n");
|
|
3257
|
+
const signature = computeHMACSHA256(stringToSign, credential.key);
|
|
3258
|
+
return `SharedKeyLite ${credential.name}:${signature}`;
|
|
3259
|
+
}
|
|
3260
|
+
__name(getAuthorizationHeader, "getAuthorizationHeader");
|
|
3261
|
+
function getHeaderValueToSign(request, headerName) {
|
|
3262
|
+
const value = request.headers.get(headerName);
|
|
3263
|
+
if (!value) {
|
|
3264
|
+
return "";
|
|
3265
|
+
}
|
|
3266
|
+
return value;
|
|
3267
|
+
}
|
|
3268
|
+
__name(getHeaderValueToSign, "getHeaderValueToSign");
|
|
3269
|
+
function getCanonicalizedResourceString(request, credential) {
|
|
3270
|
+
const url2 = new URL(request.url);
|
|
3271
|
+
const path = url2.pathname || "/";
|
|
3272
|
+
let canonicalizedResourceString = "/" + credential.name + path;
|
|
3273
|
+
const comp3 = url2.searchParams.get("comp");
|
|
3274
|
+
if (comp3) {
|
|
3275
|
+
canonicalizedResourceString = `${canonicalizedResourceString}?comp=${comp3}`;
|
|
3276
|
+
}
|
|
3277
|
+
return canonicalizedResourceString;
|
|
3278
|
+
}
|
|
3279
|
+
__name(getCanonicalizedResourceString, "getCanonicalizedResourceString");
|
|
3280
|
+
var tablesSASTokenPolicyName = "tablesSASTokenPolicy";
|
|
3281
|
+
function tablesSASTokenPolicy(credential) {
|
|
3282
|
+
return {
|
|
3283
|
+
name: tablesSASTokenPolicyName,
|
|
3284
|
+
async sendRequest(request, next) {
|
|
3285
|
+
signURLWithSAS(request, credential);
|
|
3286
|
+
return next(request);
|
|
3287
|
+
}
|
|
3288
|
+
};
|
|
3289
|
+
}
|
|
3290
|
+
__name(tablesSASTokenPolicy, "tablesSASTokenPolicy");
|
|
3291
|
+
function signURLWithSAS(request, credential) {
|
|
3292
|
+
const sasParams = new URLSearchParams(credential.signature);
|
|
3293
|
+
const url2 = new URL(request.url);
|
|
3294
|
+
for (const [name, value] of sasParams) {
|
|
3295
|
+
url2.searchParams.append(name, value);
|
|
3296
|
+
}
|
|
3297
|
+
request.url = url2.toString();
|
|
3298
|
+
}
|
|
3299
|
+
__name(signURLWithSAS, "signURLWithSAS");
|
|
3300
|
+
var tracingClient = coreTracing.createTracingClient({
|
|
3301
|
+
namespace: "Microsoft.Data.Tables",
|
|
3302
|
+
packageName: "@azure/data-tables",
|
|
3303
|
+
packageVersion: "13.3.0"
|
|
3304
|
+
});
|
|
3305
|
+
function isCosmosEndpoint(url2) {
|
|
3306
|
+
const parsedURL = new URL(url2);
|
|
3307
|
+
if (parsedURL.hostname.indexOf(".table.cosmosdb.") !== -1) {
|
|
3308
|
+
return true;
|
|
3309
|
+
}
|
|
3310
|
+
if (parsedURL.hostname.indexOf(".table.cosmos.") !== -1) {
|
|
3311
|
+
return true;
|
|
3312
|
+
}
|
|
3313
|
+
if (parsedURL.hostname === "localhost" && parsedURL.port !== "10002") {
|
|
3314
|
+
return true;
|
|
3315
|
+
}
|
|
3316
|
+
return false;
|
|
3317
|
+
}
|
|
3318
|
+
__name(isCosmosEndpoint, "isCosmosEndpoint");
|
|
3319
|
+
var _TableServiceClient = class _TableServiceClient {
|
|
3320
|
+
constructor(url2, credentialOrOptions, options) {
|
|
3321
|
+
this.url = url2;
|
|
3322
|
+
const isCosmos = isCosmosEndpoint(this.url);
|
|
3323
|
+
const credential = isCredential(credentialOrOptions) ? credentialOrOptions : void 0;
|
|
3324
|
+
const clientOptions = (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};
|
|
3325
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, clientOptions), { endpoint: clientOptions.endpoint || this.url, loggingOptions: {
|
|
3326
|
+
logger: logger2.info,
|
|
3327
|
+
additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]
|
|
3328
|
+
}, deserializationOptions: {
|
|
3329
|
+
parseXML: coreXml.parseXML
|
|
3330
|
+
}, serializationOptions: {
|
|
3331
|
+
stringifyXML: coreXml.stringifyXML
|
|
3332
|
+
} });
|
|
3333
|
+
const client = new GeneratedClient(this.url, internalPipelineOptions);
|
|
3334
|
+
client.pipeline.addPolicy(tablesSecondaryEndpointPolicy);
|
|
3335
|
+
if (coreAuth.isNamedKeyCredential(credential)) {
|
|
3336
|
+
client.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));
|
|
3337
|
+
} else if (coreAuth.isSASCredential(credential)) {
|
|
3338
|
+
client.pipeline.addPolicy(tablesSASTokenPolicy(credential));
|
|
3339
|
+
}
|
|
3340
|
+
if (coreAuth.isTokenCredential(credential)) {
|
|
3341
|
+
const scope = isCosmos ? COSMOS_SCOPE : STORAGE_SCOPE;
|
|
3342
|
+
setTokenChallengeAuthenticationPolicy(client.pipeline, credential, scope);
|
|
3343
|
+
}
|
|
3344
|
+
if (options === null || options === void 0 ? void 0 : options.version) {
|
|
3345
|
+
client.pipeline.addPolicy(apiVersionPolicy(options.version));
|
|
3346
|
+
}
|
|
3347
|
+
this.pipeline = client.pipeline;
|
|
3348
|
+
this.table = client.table;
|
|
3349
|
+
this.service = client.service;
|
|
3350
|
+
}
|
|
3351
|
+
/**
|
|
3352
|
+
* Retrieves statistics related to replication for the Table service. It is only available on the
|
|
3353
|
+
* secondary location endpoint when read-access geo-redundant replication is enabled for the account.
|
|
3354
|
+
* @param options - The options parameters.
|
|
3355
|
+
*/
|
|
3356
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
3357
|
+
async getStatistics(options = {}) {
|
|
3358
|
+
return tracingClient.withSpan("TableServiceClient.getStatistics", options, (updatedOptions) => this.service.getStatistics(injectSecondaryEndpointHeader(updatedOptions)));
|
|
3359
|
+
}
|
|
3360
|
+
/**
|
|
3361
|
+
* Gets the properties of an account's Table service, including properties for Analytics and CORS
|
|
3362
|
+
* (Cross-Origin Resource Sharing) rules.
|
|
3363
|
+
* @param options - The options parameters.
|
|
3364
|
+
*/
|
|
3365
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
3366
|
+
getProperties(options = {}) {
|
|
3367
|
+
return tracingClient.withSpan("TableServiceClient.getProperties", options, (updatedOptions) => this.service.getProperties(updatedOptions));
|
|
3368
|
+
}
|
|
3369
|
+
/**
|
|
3370
|
+
* Sets properties for an account's Table service endpoint, including properties for Analytics and CORS
|
|
3371
|
+
* (Cross-Origin Resource Sharing) rules.
|
|
3372
|
+
* @param properties - The Table Service properties.
|
|
3373
|
+
* @param options - The options parameters.
|
|
3374
|
+
*/
|
|
3375
|
+
setProperties(properties, options = {}) {
|
|
3376
|
+
return tracingClient.withSpan("TableServiceClient.setProperties", options, (updatedOptions) => this.service.setProperties(properties, updatedOptions));
|
|
3377
|
+
}
|
|
3378
|
+
/**
|
|
3379
|
+
* Creates a new table under the given account.
|
|
3380
|
+
* @param name - The name of the table.
|
|
3381
|
+
* @param options - The options parameters.
|
|
3382
|
+
*/
|
|
3383
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
3384
|
+
createTable(name, options = {}) {
|
|
3385
|
+
return tracingClient.withSpan("TableServiceClient.createTable", options, async (updatedOptions) => {
|
|
3386
|
+
try {
|
|
3387
|
+
await this.table.create({ name }, updatedOptions);
|
|
3388
|
+
} catch (e) {
|
|
3389
|
+
handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger: logger2, tableName: name }));
|
|
3390
|
+
}
|
|
3391
|
+
});
|
|
3392
|
+
}
|
|
3393
|
+
/**
|
|
3394
|
+
* Operation permanently deletes the specified table.
|
|
3395
|
+
* @param name - The name of the table.
|
|
3396
|
+
* @param options - The options parameters.
|
|
3397
|
+
*/
|
|
3398
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
3399
|
+
deleteTable(name, options = {}) {
|
|
3400
|
+
return tracingClient.withSpan("TableServiceClient.deleteTable", options, async (updatedOptions) => {
|
|
3401
|
+
try {
|
|
3402
|
+
await this.table.delete(name, updatedOptions);
|
|
3403
|
+
} catch (e) {
|
|
3404
|
+
if (e.statusCode === 404) {
|
|
3405
|
+
logger2.info("TableServiceClient.deleteTable: Table doesn't exist");
|
|
3406
|
+
} else {
|
|
3407
|
+
throw e;
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
});
|
|
3411
|
+
}
|
|
3412
|
+
/**
|
|
3413
|
+
* Queries tables under the given account.
|
|
3414
|
+
* @param options - The options parameters.
|
|
3415
|
+
*/
|
|
3416
|
+
listTables(options) {
|
|
3417
|
+
const iter = this.listTablesAll(options);
|
|
3418
|
+
return {
|
|
3419
|
+
next() {
|
|
3420
|
+
return iter.next();
|
|
3421
|
+
},
|
|
3422
|
+
[Symbol.asyncIterator]() {
|
|
3423
|
+
return this;
|
|
3424
|
+
},
|
|
3425
|
+
byPage: /* @__PURE__ */ __name((settings) => {
|
|
3426
|
+
const pageOptions = Object.assign(Object.assign({}, options), { queryOptions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.queryOptions), { top: settings === null || settings === void 0 ? void 0 : settings.maxPageSize }) });
|
|
3427
|
+
if (settings === null || settings === void 0 ? void 0 : settings.continuationToken) {
|
|
3428
|
+
pageOptions.continuationToken = settings.continuationToken;
|
|
3429
|
+
}
|
|
3430
|
+
return this.listTablesPage(pageOptions);
|
|
3431
|
+
}, "byPage")
|
|
3432
|
+
};
|
|
3433
|
+
}
|
|
3434
|
+
listTablesAll(options) {
|
|
3435
|
+
return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listTablesAll_1() {
|
|
3436
|
+
var _a, e_1, _b, _c;
|
|
3437
|
+
const firstPage = yield tslib.__await(this._listTables(options));
|
|
3438
|
+
const { continuationToken } = firstPage;
|
|
3439
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(firstPage)));
|
|
3440
|
+
if (continuationToken) {
|
|
3441
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken });
|
|
3442
|
+
try {
|
|
3443
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listTablesPage(optionsWithContinuation)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
3444
|
+
_c = _f.value;
|
|
3445
|
+
_d = false;
|
|
3446
|
+
const page = _c;
|
|
3447
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
3448
|
+
}
|
|
3449
|
+
} catch (e_1_1) {
|
|
3450
|
+
e_1 = { error: e_1_1 };
|
|
3451
|
+
} finally {
|
|
3452
|
+
try {
|
|
3453
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
3454
|
+
} finally {
|
|
3455
|
+
if (e_1) throw e_1.error;
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
}, "listTablesAll_1"));
|
|
3460
|
+
}
|
|
3461
|
+
listTablesPage() {
|
|
3462
|
+
return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listTablesPage_1(options = {}) {
|
|
3463
|
+
let result = yield tslib.__await(tracingClient.withSpan("TableServiceClient.listTablesPage", options, (updatedOptions) => this._listTables(updatedOptions)));
|
|
3464
|
+
yield yield tslib.__await(result);
|
|
3465
|
+
while (result.continuationToken) {
|
|
3466
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken: result.continuationToken });
|
|
3467
|
+
result = yield tslib.__await(tracingClient.withSpan("TableServiceClient.listTablesPage", optionsWithContinuation, async (updatedOptions, span) => {
|
|
3468
|
+
span.setAttribute("continuationToken", updatedOptions.continuationToken);
|
|
3469
|
+
return this._listTables(updatedOptions);
|
|
3470
|
+
}));
|
|
3471
|
+
yield yield tslib.__await(result);
|
|
3472
|
+
}
|
|
3473
|
+
}, "listTablesPage_1"));
|
|
3474
|
+
}
|
|
3475
|
+
async _listTables(options = {}) {
|
|
3476
|
+
const { continuationToken: nextTableName2 } = options, listOptions = tslib.__rest(options, ["continuationToken"]);
|
|
3477
|
+
const { xMsContinuationNextTableName: continuationToken, value = [] } = await this.table.query(Object.assign(Object.assign({}, listOptions), { nextTableName: nextTableName2 }));
|
|
3478
|
+
return Object.assign([...value], { continuationToken });
|
|
3479
|
+
}
|
|
3480
|
+
/**
|
|
3481
|
+
*
|
|
3482
|
+
* Creates an instance of TableServiceClient from connection string.
|
|
3483
|
+
*
|
|
3484
|
+
* @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
|
|
3485
|
+
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
|
|
3486
|
+
* Account connection string example -
|
|
3487
|
+
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
|
|
3488
|
+
* SAS connection string example -
|
|
3489
|
+
* `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`
|
|
3490
|
+
* @param options - Options to configure the HTTP pipeline.
|
|
3491
|
+
* @returns A new TableServiceClient from the given connection string.
|
|
3492
|
+
*/
|
|
3493
|
+
static fromConnectionString(connectionString, options) {
|
|
3494
|
+
const { url: url2, options: clientOptions, credential } = getClientParamsFromConnectionString(connectionString, options);
|
|
3495
|
+
if (credential) {
|
|
3496
|
+
return new _TableServiceClient(url2, credential, clientOptions);
|
|
3497
|
+
} else {
|
|
3498
|
+
return new _TableServiceClient(url2, clientOptions);
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
};
|
|
3502
|
+
__name(_TableServiceClient, "TableServiceClient");
|
|
3503
|
+
var TableServiceClient = _TableServiceClient;
|
|
3504
|
+
function getChangeSetBoundary(changesetId) {
|
|
3505
|
+
return `changeset_${changesetId}`;
|
|
3506
|
+
}
|
|
3507
|
+
__name(getChangeSetBoundary, "getChangeSetBoundary");
|
|
3508
|
+
function getTransactionBoundary(transactionId) {
|
|
3509
|
+
return `batch_${transactionId}`;
|
|
3510
|
+
}
|
|
3511
|
+
__name(getTransactionBoundary, "getTransactionBoundary");
|
|
3512
|
+
function getInitialTransactionBody(transactionId, changesetId) {
|
|
3513
|
+
const transactionBoundary = `batch_${transactionId}`;
|
|
3514
|
+
return [
|
|
3515
|
+
`--${transactionBoundary}${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: multipart/mixed; boundary=changeset_${changesetId}${TRANSACTION_HTTP_LINE_ENDING}${TRANSACTION_HTTP_LINE_ENDING}`
|
|
3516
|
+
];
|
|
3517
|
+
}
|
|
3518
|
+
__name(getInitialTransactionBody, "getInitialTransactionBody");
|
|
3519
|
+
function getTransactionHttpRequestBody(bodyParts, transactionId, changesetId) {
|
|
3520
|
+
const transactionBoundary = getTransactionBoundary(transactionId);
|
|
3521
|
+
const changesetBoundary = getChangeSetBoundary(changesetId);
|
|
3522
|
+
const changesetEnding = `--${changesetBoundary}--`;
|
|
3523
|
+
const transactionEnding = `--${transactionBoundary}--`;
|
|
3524
|
+
const bodyContent = bodyParts.join(TRANSACTION_HTTP_LINE_ENDING);
|
|
3525
|
+
return `${bodyContent}${TRANSACTION_HTTP_LINE_ENDING}${changesetEnding}${TRANSACTION_HTTP_LINE_ENDING}${transactionEnding}${TRANSACTION_HTTP_LINE_ENDING}`;
|
|
3526
|
+
}
|
|
3527
|
+
__name(getTransactionHttpRequestBody, "getTransactionHttpRequestBody");
|
|
3528
|
+
var transactionRequestAssemblePolicyName = "transactionRequestAssemblePolicy";
|
|
3529
|
+
var dummyResponse = {
|
|
3530
|
+
request: coreRestPipeline.createPipelineRequest({ url: "FAKE" }),
|
|
3531
|
+
status: 200,
|
|
3532
|
+
headers: coreRestPipeline.createHttpHeaders()
|
|
3533
|
+
};
|
|
3534
|
+
function transactionRequestAssemblePolicy(bodyParts, changesetId) {
|
|
3535
|
+
return {
|
|
3536
|
+
name: transactionRequestAssemblePolicyName,
|
|
3537
|
+
async sendRequest(request) {
|
|
3538
|
+
const subRequest = getNextSubrequestBodyPart(request, changesetId);
|
|
3539
|
+
bodyParts.push(subRequest);
|
|
3540
|
+
return dummyResponse;
|
|
3541
|
+
}
|
|
3542
|
+
};
|
|
3543
|
+
}
|
|
3544
|
+
__name(transactionRequestAssemblePolicy, "transactionRequestAssemblePolicy");
|
|
3545
|
+
var transactionHeaderFilterPolicyName = "transactionHeaderFilterPolicy";
|
|
3546
|
+
function transactionHeaderFilterPolicy() {
|
|
3547
|
+
return {
|
|
3548
|
+
name: transactionHeaderFilterPolicyName,
|
|
3549
|
+
async sendRequest(request, next) {
|
|
3550
|
+
request.headers.delete(HeaderConstants.X_MS_VERSION);
|
|
3551
|
+
return next(request);
|
|
3552
|
+
}
|
|
3553
|
+
};
|
|
3554
|
+
}
|
|
3555
|
+
__name(transactionHeaderFilterPolicy, "transactionHeaderFilterPolicy");
|
|
3556
|
+
function getSubRequestUrl(url2) {
|
|
3557
|
+
const sasTokenParts = ["sv", "ss", "srt", "sp", "se", "st", "spr", "sig"];
|
|
3558
|
+
const urlParsed = new URL(url2);
|
|
3559
|
+
sasTokenParts.forEach((part) => urlParsed.searchParams.delete(part));
|
|
3560
|
+
return urlParsed.toString();
|
|
3561
|
+
}
|
|
3562
|
+
__name(getSubRequestUrl, "getSubRequestUrl");
|
|
3563
|
+
function getNextSubrequestBodyPart(request, changesetId) {
|
|
3564
|
+
const changesetBoundary = getChangeSetBoundary(changesetId);
|
|
3565
|
+
const subRequestPrefix = `--${changesetBoundary}${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${TRANSACTION_HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`;
|
|
3566
|
+
const subRequestUrl = getSubRequestUrl(request.url);
|
|
3567
|
+
const subRequest = [
|
|
3568
|
+
subRequestPrefix,
|
|
3569
|
+
// sub request constant prefix
|
|
3570
|
+
"",
|
|
3571
|
+
// empty line after sub request's content ID
|
|
3572
|
+
`${request.method.toString()} ${subRequestUrl} ${TRANSACTION_HTTP_VERSION_1_1}`
|
|
3573
|
+
// sub request start line with method,
|
|
3574
|
+
];
|
|
3575
|
+
for (const [name, value] of request.headers) {
|
|
3576
|
+
subRequest.push(`${name}: ${value}`);
|
|
3577
|
+
}
|
|
3578
|
+
subRequest.push(`${TRANSACTION_HTTP_LINE_ENDING}`);
|
|
3579
|
+
if (request.body) {
|
|
3580
|
+
subRequest.push(String(request.body));
|
|
3581
|
+
}
|
|
3582
|
+
return subRequest.join(TRANSACTION_HTTP_LINE_ENDING);
|
|
3583
|
+
}
|
|
3584
|
+
__name(getNextSubrequestBodyPart, "getNextSubrequestBodyPart");
|
|
3585
|
+
var cosmosPatchPolicyName = "cosmosPatchPolicy";
|
|
3586
|
+
function cosmosPatchPolicy() {
|
|
3587
|
+
return {
|
|
3588
|
+
name: cosmosPatchPolicyName,
|
|
3589
|
+
sendRequest: /* @__PURE__ */ __name((request, next) => {
|
|
3590
|
+
if (request.method === "PATCH") {
|
|
3591
|
+
request.method = "POST";
|
|
3592
|
+
request.headers.set("X-HTTP-Method", "MERGE");
|
|
3593
|
+
}
|
|
3594
|
+
return next(request);
|
|
3595
|
+
}, "sendRequest")
|
|
3596
|
+
};
|
|
3597
|
+
}
|
|
3598
|
+
__name(cosmosPatchPolicy, "cosmosPatchPolicy");
|
|
3599
|
+
function getBaseTransactionHeaders(transactionGuid) {
|
|
3600
|
+
return {
|
|
3601
|
+
accept: "application/json",
|
|
3602
|
+
"x-ms-version": "2019-02-02",
|
|
3603
|
+
DataServiceVersion: "3.0;",
|
|
3604
|
+
MaxDataServiceVersion: "3.0;NetFx",
|
|
3605
|
+
"Content-Type": `multipart/mixed; boundary=batch_${transactionGuid}`
|
|
3606
|
+
};
|
|
3607
|
+
}
|
|
3608
|
+
__name(getBaseTransactionHeaders, "getBaseTransactionHeaders");
|
|
3609
|
+
function getTransactionHeaders(transactionGuid) {
|
|
3610
|
+
const baseHeaders = getBaseTransactionHeaders(transactionGuid);
|
|
3611
|
+
return Object.assign(Object.assign({}, baseHeaders), {
|
|
3612
|
+
// The below headers are not supported in the browser as they are flagged as "unsafe headers"
|
|
3613
|
+
"Accept-Charset": "UTF-8",
|
|
3614
|
+
Connection: "Keep-Alive"
|
|
3615
|
+
});
|
|
3616
|
+
}
|
|
3617
|
+
__name(getTransactionHeaders, "getTransactionHeaders");
|
|
3618
|
+
var _TableTransaction = class _TableTransaction {
|
|
3619
|
+
constructor(actions) {
|
|
3620
|
+
this.actions = actions !== null && actions !== void 0 ? actions : [];
|
|
3621
|
+
}
|
|
3622
|
+
/**
|
|
3623
|
+
* Adds a create action to the transaction
|
|
3624
|
+
* @param entity - entity to create
|
|
3625
|
+
*/
|
|
3626
|
+
createEntity(entity) {
|
|
3627
|
+
this.actions.push(["create", entity]);
|
|
3628
|
+
}
|
|
3629
|
+
/**
|
|
3630
|
+
* Adds a delete action to the transaction
|
|
3631
|
+
* @param partitionKey - partition key of the entity to delete
|
|
3632
|
+
* @param rowKey - rowKey of the entity to delete
|
|
3633
|
+
*/
|
|
3634
|
+
deleteEntity(partitionKey2, rowKey2) {
|
|
3635
|
+
this.actions.push(["delete", { partitionKey: partitionKey2, rowKey: rowKey2 }]);
|
|
3636
|
+
}
|
|
3637
|
+
/**
|
|
3638
|
+
* Adds an update action to the transaction
|
|
3639
|
+
* @param entity - entity to update
|
|
3640
|
+
* @param updateModeOrOptions - update mode or update options
|
|
3641
|
+
* @param updateOptions - options for the update operation
|
|
3642
|
+
*/
|
|
3643
|
+
updateEntity(entity, updateModeOrOptions, updateOptions) {
|
|
3644
|
+
const realUpdateMode = typeof updateModeOrOptions === "string" ? updateModeOrOptions : void 0;
|
|
3645
|
+
const realUpdateOptions = typeof updateModeOrOptions === "object" ? updateModeOrOptions : updateOptions;
|
|
3646
|
+
this.actions.push(["update", entity, realUpdateMode !== null && realUpdateMode !== void 0 ? realUpdateMode : "Merge", realUpdateOptions !== null && realUpdateOptions !== void 0 ? realUpdateOptions : {}]);
|
|
3647
|
+
}
|
|
3648
|
+
/**
|
|
3649
|
+
* Adds an upsert action to the transaction, which inserts if the entity doesn't exist or updates the existing one
|
|
3650
|
+
* @param entity - entity to upsert
|
|
3651
|
+
* @param updateMode - update mode
|
|
3652
|
+
*/
|
|
3653
|
+
upsertEntity(entity, updateMode = "Merge") {
|
|
3654
|
+
this.actions.push(["upsert", entity, updateMode]);
|
|
3655
|
+
}
|
|
3656
|
+
};
|
|
3657
|
+
__name(_TableTransaction, "TableTransaction");
|
|
3658
|
+
var TableTransaction = _TableTransaction;
|
|
3659
|
+
var _InternalTableTransaction = class _InternalTableTransaction {
|
|
3660
|
+
/**
|
|
3661
|
+
* @param url - Tables account url
|
|
3662
|
+
* @param partitionKey - partition key
|
|
3663
|
+
* @param credential - credential to authenticate the transaction request
|
|
3664
|
+
*/
|
|
3665
|
+
constructor(url2, partitionKey2, transactionId, changesetId, client, interceptClient, credential, allowInsecureConnection = false) {
|
|
3666
|
+
this.client = client;
|
|
3667
|
+
this.url = url2;
|
|
3668
|
+
this.interceptClient = interceptClient;
|
|
3669
|
+
this.allowInsecureConnection = allowInsecureConnection;
|
|
3670
|
+
this.state = this.initializeState(transactionId, changesetId, partitionKey2);
|
|
3671
|
+
if (!credential) {
|
|
3672
|
+
const urlParts = url2.split("?");
|
|
3673
|
+
this.url = urlParts[0];
|
|
3674
|
+
const sas = urlParts.length > 1 ? `?${urlParts[1]}` : "";
|
|
3675
|
+
this.url = `${this.getUrlWithSlash()}$batch${sas}`;
|
|
3676
|
+
} else {
|
|
3677
|
+
this.url = `${this.getUrlWithSlash()}$batch`;
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
initializeState(transactionId, changesetId, partitionKey2) {
|
|
3681
|
+
const pendingOperations = [];
|
|
3682
|
+
const bodyParts = getInitialTransactionBody(transactionId, changesetId);
|
|
3683
|
+
const isCosmos = isCosmosEndpoint(this.url);
|
|
3684
|
+
prepateTransactionPipeline(this.interceptClient.pipeline, bodyParts, changesetId, isCosmos);
|
|
3685
|
+
return {
|
|
3686
|
+
transactionId,
|
|
3687
|
+
changesetId,
|
|
3688
|
+
partitionKey: partitionKey2,
|
|
3689
|
+
pendingOperations,
|
|
3690
|
+
bodyParts
|
|
3691
|
+
};
|
|
3692
|
+
}
|
|
3693
|
+
/**
|
|
3694
|
+
* Adds a createEntity operation to the transaction
|
|
3695
|
+
* @param entity - Entity to create
|
|
3696
|
+
*/
|
|
3697
|
+
createEntity(entity) {
|
|
3698
|
+
this.checkPartitionKey(entity.partitionKey);
|
|
3699
|
+
this.state.pendingOperations.push(this.interceptClient.createEntity(entity));
|
|
3700
|
+
}
|
|
3701
|
+
/**
|
|
3702
|
+
* Adds a createEntity operation to the transaction per each entity in the entities array
|
|
3703
|
+
* @param entities - Array of entities to create
|
|
3704
|
+
*/
|
|
3705
|
+
createEntities(entities) {
|
|
3706
|
+
for (const entity of entities) {
|
|
3707
|
+
this.checkPartitionKey(entity.partitionKey);
|
|
3708
|
+
this.state.pendingOperations.push(this.interceptClient.createEntity(entity));
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3711
|
+
/**
|
|
3712
|
+
* Adds a deleteEntity operation to the transaction
|
|
3713
|
+
* @param partitionKey - Partition key of the entity to delete
|
|
3714
|
+
* @param rowKey - Row key of the entity to delete
|
|
3715
|
+
* @param options - Options for the delete operation
|
|
3716
|
+
*/
|
|
3717
|
+
deleteEntity(partitionKey2, rowKey2, options) {
|
|
3718
|
+
this.checkPartitionKey(partitionKey2);
|
|
3719
|
+
this.state.pendingOperations.push(this.interceptClient.deleteEntity(partitionKey2, rowKey2, options));
|
|
3720
|
+
}
|
|
3721
|
+
/**
|
|
3722
|
+
* Adds an updateEntity operation to the transaction
|
|
3723
|
+
* @param entity - Entity to update
|
|
3724
|
+
* @param mode - Update mode (Merge or Replace)
|
|
3725
|
+
* @param options - Options for the update operation
|
|
3726
|
+
*/
|
|
3727
|
+
updateEntity(entity, mode, options) {
|
|
3728
|
+
this.checkPartitionKey(entity.partitionKey);
|
|
3729
|
+
this.state.pendingOperations.push(this.interceptClient.updateEntity(entity, mode, options));
|
|
3730
|
+
}
|
|
3731
|
+
/**
|
|
3732
|
+
* Adds an upsertEntity operation to the transaction
|
|
3733
|
+
* @param entity - The properties for the table entity.
|
|
3734
|
+
* @param mode - The different modes for updating the entity:
|
|
3735
|
+
* - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.
|
|
3736
|
+
* - Replace: Updates an existing entity by replacing the entire entity.
|
|
3737
|
+
* @param options - The options parameters.
|
|
3738
|
+
*/
|
|
3739
|
+
upsertEntity(entity, mode, options) {
|
|
3740
|
+
this.checkPartitionKey(entity.partitionKey);
|
|
3741
|
+
this.state.pendingOperations.push(this.interceptClient.upsertEntity(entity, mode, options));
|
|
3742
|
+
}
|
|
3743
|
+
/**
|
|
3744
|
+
* Submits the operations in the transaction
|
|
3745
|
+
*/
|
|
3746
|
+
async submitTransaction() {
|
|
3747
|
+
await Promise.all(this.state.pendingOperations);
|
|
3748
|
+
const body = getTransactionHttpRequestBody(this.state.bodyParts, this.state.transactionId, this.state.changesetId);
|
|
3749
|
+
const headers = getTransactionHeaders(this.state.transactionId);
|
|
3750
|
+
return tracingClient.withSpan("TableTransaction.submitTransaction", {}, async (updatedOptions) => {
|
|
3751
|
+
const request = coreRestPipeline.createPipelineRequest({
|
|
3752
|
+
url: this.url,
|
|
3753
|
+
method: "POST",
|
|
3754
|
+
body,
|
|
3755
|
+
headers: coreRestPipeline.createHttpHeaders(headers),
|
|
3756
|
+
tracingOptions: updatedOptions.tracingOptions,
|
|
3757
|
+
allowInsecureConnection: this.allowInsecureConnection
|
|
3758
|
+
});
|
|
3759
|
+
const rawTransactionResponse = await this.client.sendRequest(request);
|
|
3760
|
+
return parseTransactionResponse(rawTransactionResponse);
|
|
3761
|
+
});
|
|
3762
|
+
}
|
|
3763
|
+
checkPartitionKey(partitionKey2) {
|
|
3764
|
+
if (this.state.partitionKey !== partitionKey2) {
|
|
3765
|
+
throw new Error("All operations in a transaction must target the same partitionKey");
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
getUrlWithSlash() {
|
|
3769
|
+
return this.url.endsWith("/") ? this.url : `${this.url}/`;
|
|
3770
|
+
}
|
|
3771
|
+
};
|
|
3772
|
+
__name(_InternalTableTransaction, "InternalTableTransaction");
|
|
3773
|
+
var InternalTableTransaction = _InternalTableTransaction;
|
|
3774
|
+
function parseTransactionResponse(transactionResponse) {
|
|
3775
|
+
const subResponsePrefix = `--changesetresponse_`;
|
|
3776
|
+
const status = transactionResponse.status;
|
|
3777
|
+
const rawBody = transactionResponse.bodyAsText || "";
|
|
3778
|
+
const splitBody = rawBody.split(subResponsePrefix);
|
|
3779
|
+
const isSuccessByStatus = 200 <= status && status < 300;
|
|
3780
|
+
if (!isSuccessByStatus) {
|
|
3781
|
+
handleBodyError(rawBody, status, transactionResponse.request, transactionResponse);
|
|
3782
|
+
}
|
|
3783
|
+
const subResponses = splitBody.slice(1, splitBody.length - 1);
|
|
3784
|
+
const responses = subResponses.map((subResponse) => {
|
|
3785
|
+
const statusMatch = subResponse.match(/HTTP\/1.1 ([0-9]*)/);
|
|
3786
|
+
if ((statusMatch === null || statusMatch === void 0 ? void 0 : statusMatch.length) !== 2) {
|
|
3787
|
+
throw new Error(`Couldn't extract status from sub-response:
|
|
3788
|
+
${subResponse}`);
|
|
3789
|
+
}
|
|
3790
|
+
const subResponseStatus = Number.parseInt(statusMatch[1]);
|
|
3791
|
+
if (!Number.isInteger(subResponseStatus)) {
|
|
3792
|
+
throw new Error(`Expected sub-response status to be an integer ${subResponseStatus}`);
|
|
3793
|
+
}
|
|
3794
|
+
const bodyMatch = subResponse.match(/\{(.*)\}/);
|
|
3795
|
+
if ((bodyMatch === null || bodyMatch === void 0 ? void 0 : bodyMatch.length) === 2) {
|
|
3796
|
+
handleBodyError(bodyMatch[0], subResponseStatus, transactionResponse.request, transactionResponse);
|
|
3797
|
+
}
|
|
3798
|
+
const etagMatch = subResponse.match(/ETag: (.*)/);
|
|
3799
|
+
const rowKeyMatch = subResponse.match(/RowKey='(.*)'/);
|
|
3800
|
+
return Object.assign(Object.assign({ status: subResponseStatus }, (rowKeyMatch === null || rowKeyMatch === void 0 ? void 0 : rowKeyMatch.length) === 2 && { rowKey: rowKeyMatch[1] }), (etagMatch === null || etagMatch === void 0 ? void 0 : etagMatch.length) === 2 && { etag: etagMatch[1] });
|
|
3801
|
+
});
|
|
3802
|
+
return {
|
|
3803
|
+
status,
|
|
3804
|
+
subResponses: responses,
|
|
3805
|
+
getResponseForEntity: /* @__PURE__ */ __name((rowKey2) => responses.find((r) => r.rowKey === rowKey2), "getResponseForEntity")
|
|
3806
|
+
};
|
|
3807
|
+
}
|
|
3808
|
+
__name(parseTransactionResponse, "parseTransactionResponse");
|
|
3809
|
+
function handleBodyError(bodyAsText, statusCode, request, response) {
|
|
3810
|
+
var _a, _b;
|
|
3811
|
+
let parsedError;
|
|
3812
|
+
try {
|
|
3813
|
+
parsedError = JSON.parse(bodyAsText);
|
|
3814
|
+
} catch (_c) {
|
|
3815
|
+
parsedError = {};
|
|
3816
|
+
}
|
|
3817
|
+
let message = "Transaction Failed";
|
|
3818
|
+
let code;
|
|
3819
|
+
if (parsedError && parsedError["odata.error"]) {
|
|
3820
|
+
const error = parsedError["odata.error"];
|
|
3821
|
+
message = (_b = (_a = error.message) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : message;
|
|
3822
|
+
code = error.code;
|
|
3823
|
+
}
|
|
3824
|
+
throw new coreRestPipeline.RestError(message, {
|
|
3825
|
+
code,
|
|
3826
|
+
statusCode,
|
|
3827
|
+
request,
|
|
3828
|
+
response
|
|
3829
|
+
});
|
|
3830
|
+
}
|
|
3831
|
+
__name(handleBodyError, "handleBodyError");
|
|
3832
|
+
function prepateTransactionPipeline(pipeline, bodyParts, changesetId, isCosmos) {
|
|
3833
|
+
const policies = pipeline.getOrderedPolicies();
|
|
3834
|
+
for (const policy of policies) {
|
|
3835
|
+
pipeline.removePolicy({
|
|
3836
|
+
name: policy.name
|
|
3837
|
+
});
|
|
3838
|
+
}
|
|
3839
|
+
pipeline.addPolicy(coreClient.serializationPolicy(), { phase: "Serialize" });
|
|
3840
|
+
pipeline.addPolicy(transactionHeaderFilterPolicy());
|
|
3841
|
+
pipeline.addPolicy(transactionRequestAssemblePolicy(bodyParts, changesetId));
|
|
3842
|
+
if (isCosmos) {
|
|
3843
|
+
pipeline.addPolicy(cosmosPatchPolicy(), {
|
|
3844
|
+
afterPolicies: [transactionHeaderFilterPolicyName],
|
|
3845
|
+
beforePolicies: [coreClient.serializationPolicyName, transactionRequestAssemblePolicyName]
|
|
3846
|
+
});
|
|
3847
|
+
}
|
|
3848
|
+
}
|
|
3849
|
+
__name(prepateTransactionPipeline, "prepateTransactionPipeline");
|
|
3850
|
+
function base64Encode(value) {
|
|
3851
|
+
if (value instanceof Uint8Array) {
|
|
3852
|
+
const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer);
|
|
3853
|
+
return bufferValue.toString("base64");
|
|
3854
|
+
} else {
|
|
3855
|
+
return Buffer.from(value).toString("base64");
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
__name(base64Encode, "base64Encode");
|
|
3859
|
+
function base64Decode(value) {
|
|
3860
|
+
return Buffer.from(value, "base64");
|
|
3861
|
+
}
|
|
3862
|
+
__name(base64Decode, "base64Decode");
|
|
3863
|
+
function encodeContinuationToken(nextPartitionKey2, nextRowKey2) {
|
|
3864
|
+
if (!nextPartitionKey2) {
|
|
3865
|
+
return void 0;
|
|
3866
|
+
}
|
|
3867
|
+
const continuationToken = Object.assign({ nextPartitionKey: nextPartitionKey2 }, nextRowKey2 && { nextRowKey: nextRowKey2 });
|
|
3868
|
+
return base64Encode(JSON.stringify(continuationToken));
|
|
3869
|
+
}
|
|
3870
|
+
__name(encodeContinuationToken, "encodeContinuationToken");
|
|
3871
|
+
function decodeContinuationToken(encodedToken) {
|
|
3872
|
+
const decodedToken = base64Decode(encodedToken);
|
|
3873
|
+
let tokenStr = "";
|
|
3874
|
+
for (const byte of decodedToken) {
|
|
3875
|
+
tokenStr += String.fromCharCode(byte);
|
|
3876
|
+
}
|
|
3877
|
+
const continuationToken = JSON.parse(tokenStr);
|
|
3878
|
+
return continuationToken;
|
|
3879
|
+
}
|
|
3880
|
+
__name(decodeContinuationToken, "decodeContinuationToken");
|
|
3881
|
+
var propertyCaseMap = /* @__PURE__ */ new Map([
|
|
3882
|
+
["PartitionKey", "partitionKey"],
|
|
3883
|
+
["RowKey", "rowKey"],
|
|
3884
|
+
["odata.etag", "etag"],
|
|
3885
|
+
["Timestamp", "timestamp"]
|
|
3886
|
+
]);
|
|
3887
|
+
var Edm = {
|
|
3888
|
+
Binary: "Edm.Binary",
|
|
3889
|
+
Boolean: "Edm.Boolean",
|
|
3890
|
+
DateTime: "Edm.DateTime",
|
|
3891
|
+
Double: "Edm.Double",
|
|
3892
|
+
Guid: "Edm.Guid",
|
|
3893
|
+
Int32: "Edm.Int32",
|
|
3894
|
+
Int64: "Edm.Int64",
|
|
3895
|
+
String: "Edm.String"
|
|
3896
|
+
};
|
|
3897
|
+
function serializePrimitive(value) {
|
|
3898
|
+
const serializedValue = { value };
|
|
3899
|
+
if (value === void 0 || value === null || typeof value === "boolean" || typeof value === "string" || typeof value === "number") {
|
|
3900
|
+
serializedValue.value = value;
|
|
3901
|
+
} else if (typeof value === "bigint") {
|
|
3902
|
+
serializedValue.value = value.toString();
|
|
3903
|
+
serializedValue.type = Edm.Int64;
|
|
3904
|
+
} else if (value instanceof Date) {
|
|
3905
|
+
serializedValue.value = value;
|
|
3906
|
+
serializedValue.type = Edm.DateTime;
|
|
3907
|
+
} else if (value instanceof Uint8Array) {
|
|
3908
|
+
serializedValue.value = base64Encode(value);
|
|
3909
|
+
serializedValue.type = Edm.Binary;
|
|
3910
|
+
} else {
|
|
3911
|
+
throw new Error(`Unknown EDM type ${typeof value}`);
|
|
3912
|
+
}
|
|
3913
|
+
return serializedValue;
|
|
3914
|
+
}
|
|
3915
|
+
__name(serializePrimitive, "serializePrimitive");
|
|
3916
|
+
function serializeObject(obj) {
|
|
3917
|
+
const serializedValue = { value: obj.value };
|
|
3918
|
+
if (obj.type === "Boolean" || obj.type === "DateTime" || obj.type === "Double" || obj.type === "Guid" || obj.type === "Int32" || obj.type === "Int64" || obj.type === "String" || obj.type === "Binary") {
|
|
3919
|
+
serializedValue.value = obj.value;
|
|
3920
|
+
serializedValue.type = Edm[obj.type];
|
|
3921
|
+
} else {
|
|
3922
|
+
throw new Error(`Unknown EDM type ${typeof obj.value}`);
|
|
3923
|
+
}
|
|
3924
|
+
return serializedValue;
|
|
3925
|
+
}
|
|
3926
|
+
__name(serializeObject, "serializeObject");
|
|
3927
|
+
function getSerializedValue(value) {
|
|
3928
|
+
if (typeof value === "object" && (value === null || value === void 0 ? void 0 : value.value) !== void 0 && (value === null || value === void 0 ? void 0 : value.type) !== void 0) {
|
|
3929
|
+
return serializeObject(value);
|
|
3930
|
+
} else {
|
|
3931
|
+
return serializePrimitive(value);
|
|
3932
|
+
}
|
|
3933
|
+
}
|
|
3934
|
+
__name(getSerializedValue, "getSerializedValue");
|
|
3935
|
+
function translatePropertyNameForSerialization(propertyName) {
|
|
3936
|
+
for (const [original, internal] of propertyCaseMap) {
|
|
3937
|
+
if (internal === propertyName) {
|
|
3938
|
+
return original;
|
|
3939
|
+
}
|
|
3940
|
+
}
|
|
3941
|
+
return propertyName;
|
|
3942
|
+
}
|
|
3943
|
+
__name(translatePropertyNameForSerialization, "translatePropertyNameForSerialization");
|
|
3944
|
+
function serialize(obj) {
|
|
3945
|
+
const serialized = {};
|
|
3946
|
+
for (const [propertyName, propertyValue] of Object.entries(obj)) {
|
|
3947
|
+
const transformedKey = translatePropertyNameForSerialization(propertyName);
|
|
3948
|
+
const serializedVal = getSerializedValue(propertyValue);
|
|
3949
|
+
serialized[transformedKey] = serializedVal.value;
|
|
3950
|
+
if (serializedVal.type) {
|
|
3951
|
+
serialized[`${transformedKey}@odata.type`] = serializedVal.type;
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3954
|
+
return serialized;
|
|
3955
|
+
}
|
|
3956
|
+
__name(serialize, "serialize");
|
|
3957
|
+
function getTypedObject(value, type, disableTypeConversion) {
|
|
3958
|
+
switch (type) {
|
|
3959
|
+
case Edm.Boolean:
|
|
3960
|
+
return disableTypeConversion ? { value, type: "Boolean" } : value;
|
|
3961
|
+
case Edm.Double:
|
|
3962
|
+
return disableTypeConversion ? { value, type: "Double" } : value;
|
|
3963
|
+
case Edm.Int32:
|
|
3964
|
+
return disableTypeConversion ? { value, type: "Int32" } : value;
|
|
3965
|
+
case Edm.String:
|
|
3966
|
+
return disableTypeConversion ? { value, type: "String" } : value;
|
|
3967
|
+
case Edm.DateTime:
|
|
3968
|
+
return disableTypeConversion ? { value, type: "DateTime" } : new Date(value);
|
|
3969
|
+
case Edm.Int64:
|
|
3970
|
+
return disableTypeConversion ? { value, type: "Int64" } : BigInt(value);
|
|
3971
|
+
case Edm.Guid:
|
|
3972
|
+
return { value, type: "Guid" };
|
|
3973
|
+
case Edm.Binary:
|
|
3974
|
+
return disableTypeConversion ? { value, type: "Binary" } : base64Decode(value);
|
|
3975
|
+
default:
|
|
3976
|
+
throw new Error(`Unknown EDM type ${type}`);
|
|
3977
|
+
}
|
|
3978
|
+
}
|
|
3979
|
+
__name(getTypedObject, "getTypedObject");
|
|
3980
|
+
function deserialize(obj, disableTypeConversion = false) {
|
|
3981
|
+
var _a;
|
|
3982
|
+
const deserialized = {};
|
|
3983
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
3984
|
+
if (key.indexOf("@odata.type") === -1) {
|
|
3985
|
+
const transformedKey = (_a = propertyCaseMap.get(key)) !== null && _a !== void 0 ? _a : key;
|
|
3986
|
+
let typedValue = value;
|
|
3987
|
+
if (`${key}@odata.type` in obj) {
|
|
3988
|
+
const type = obj[`${key}@odata.type`];
|
|
3989
|
+
typedValue = getTypedObject(value, type, disableTypeConversion);
|
|
3990
|
+
} else if (disableTypeConversion && ["number", "string", "boolean"].includes(typeof value)) {
|
|
3991
|
+
typedValue = inferTypedObject(key, value);
|
|
3992
|
+
}
|
|
3993
|
+
deserialized[transformedKey] = typedValue;
|
|
3994
|
+
}
|
|
3995
|
+
}
|
|
3996
|
+
return deserialized;
|
|
3997
|
+
}
|
|
3998
|
+
__name(deserialize, "deserialize");
|
|
3999
|
+
function inferTypedObject(propertyName, value) {
|
|
4000
|
+
if (propertyCaseMap.has(propertyName)) {
|
|
4001
|
+
return value;
|
|
4002
|
+
}
|
|
4003
|
+
switch (typeof value) {
|
|
4004
|
+
case "boolean":
|
|
4005
|
+
return { value: String(value), type: "Boolean" };
|
|
4006
|
+
case "number":
|
|
4007
|
+
return getTypedNumber(value);
|
|
4008
|
+
case "string":
|
|
4009
|
+
return { value, type: "String" };
|
|
4010
|
+
default:
|
|
4011
|
+
return value;
|
|
4012
|
+
}
|
|
4013
|
+
}
|
|
4014
|
+
__name(inferTypedObject, "inferTypedObject");
|
|
4015
|
+
function getTypedNumber(value) {
|
|
4016
|
+
const valueStr = String(value);
|
|
4017
|
+
if (Number.isSafeInteger(value)) {
|
|
4018
|
+
return { value: valueStr, type: "Int32" };
|
|
4019
|
+
} else {
|
|
4020
|
+
return { value: valueStr, type: "Double" };
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
__name(getTypedNumber, "getTypedNumber");
|
|
4024
|
+
function deserializeObjectsArray(objArray, disableTypeConversion) {
|
|
4025
|
+
return objArray.map((obj) => deserialize(obj, disableTypeConversion));
|
|
4026
|
+
}
|
|
4027
|
+
__name(deserializeObjectsArray, "deserializeObjectsArray");
|
|
4028
|
+
function serializeSignedIdentifiers(signedIdentifiers) {
|
|
4029
|
+
return signedIdentifiers.map((acl) => {
|
|
4030
|
+
const { id, accessPolicy } = acl;
|
|
4031
|
+
const _a = accessPolicy !== null && accessPolicy !== void 0 ? accessPolicy : {}, { start, expiry } = _a, rest = tslib.__rest(_a, ["start", "expiry"]);
|
|
4032
|
+
const serializedStart = start ? truncatedISO8061Date(
|
|
4033
|
+
start,
|
|
4034
|
+
false
|
|
4035
|
+
/** withMilliseconds */
|
|
4036
|
+
) : void 0;
|
|
4037
|
+
const serializedExpiry = expiry ? truncatedISO8061Date(
|
|
4038
|
+
expiry,
|
|
4039
|
+
false
|
|
4040
|
+
/** withMilliseconds */
|
|
4041
|
+
) : void 0;
|
|
4042
|
+
return {
|
|
4043
|
+
id,
|
|
4044
|
+
accessPolicy: Object.assign(Object.assign(Object.assign({}, serializedExpiry && { expiry: serializedExpiry }), serializedStart && { start: serializedStart }), rest)
|
|
4045
|
+
};
|
|
4046
|
+
});
|
|
4047
|
+
}
|
|
4048
|
+
__name(serializeSignedIdentifiers, "serializeSignedIdentifiers");
|
|
4049
|
+
function deserializeSignedIdentifier(signedIdentifiers) {
|
|
4050
|
+
return signedIdentifiers.map((si) => {
|
|
4051
|
+
const { id, accessPolicy } = si;
|
|
4052
|
+
const _a = accessPolicy !== null && accessPolicy !== void 0 ? accessPolicy : {}, { start, expiry } = _a, restAcl = tslib.__rest(_a, ["start", "expiry"]);
|
|
4053
|
+
const deserializedStart = start ? new Date(start) : void 0;
|
|
4054
|
+
const deserializedExpiry = expiry ? new Date(expiry) : void 0;
|
|
4055
|
+
return {
|
|
4056
|
+
id,
|
|
4057
|
+
accessPolicy: Object.assign(Object.assign(Object.assign({}, deserializedExpiry && { expiry: deserializedExpiry }), deserializedStart && { start: deserializedStart }), restAcl)
|
|
4058
|
+
};
|
|
4059
|
+
});
|
|
4060
|
+
}
|
|
4061
|
+
__name(deserializeSignedIdentifier, "deserializeSignedIdentifier");
|
|
4062
|
+
function serializeQueryOptions(query) {
|
|
4063
|
+
const { select: select2 } = query, queryOptions = tslib.__rest(query, ["select"]);
|
|
4064
|
+
const mappedQuery = Object.assign({}, queryOptions);
|
|
4065
|
+
const excludeFromSelect = ["etag", "odata.etag"];
|
|
4066
|
+
if (select2) {
|
|
4067
|
+
mappedQuery.select = select2.filter((p) => !excludeFromSelect.includes(p)).map(translatePropertyNameForSerialization).join(",");
|
|
4068
|
+
}
|
|
4069
|
+
return mappedQuery;
|
|
4070
|
+
}
|
|
4071
|
+
__name(serializeQueryOptions, "serializeQueryOptions");
|
|
4072
|
+
var _Uuid = class _Uuid {
|
|
4073
|
+
static generateUuid() {
|
|
4074
|
+
return coreUtil.randomUUID();
|
|
4075
|
+
}
|
|
4076
|
+
};
|
|
4077
|
+
__name(_Uuid, "Uuid");
|
|
4078
|
+
var Uuid = _Uuid;
|
|
4079
|
+
function escapeQuotesIfString(input, previous) {
|
|
4080
|
+
let result = input;
|
|
4081
|
+
if (typeof input === "string") {
|
|
4082
|
+
result = escapeQuotes(input);
|
|
4083
|
+
if (previous !== "" && !previous.trim().endsWith("'")) {
|
|
4084
|
+
result = `'${result}'`;
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
4087
|
+
return result;
|
|
4088
|
+
}
|
|
4089
|
+
__name(escapeQuotesIfString, "escapeQuotesIfString");
|
|
4090
|
+
function escapeQuotes(input) {
|
|
4091
|
+
return input.replace(/'/g, "''");
|
|
4092
|
+
}
|
|
4093
|
+
__name(escapeQuotes, "escapeQuotes");
|
|
4094
|
+
function encodeDate(input) {
|
|
4095
|
+
return input instanceof Date ? `datetime'${input.toISOString()}'` : input;
|
|
4096
|
+
}
|
|
4097
|
+
__name(encodeDate, "encodeDate");
|
|
4098
|
+
function odata(strings, ...values) {
|
|
4099
|
+
const fixEncoding = /* @__PURE__ */ __name((value, string) => {
|
|
4100
|
+
return encodeDate(escapeQuotesIfString(value, string));
|
|
4101
|
+
}, "fixEncoding");
|
|
4102
|
+
const results = [];
|
|
4103
|
+
for (let i = 0; i < strings.length; i++) {
|
|
4104
|
+
results.push(strings[i]);
|
|
4105
|
+
if (i < values.length) {
|
|
4106
|
+
results.push(fixEncoding(values[i], strings[i]));
|
|
4107
|
+
}
|
|
4108
|
+
}
|
|
4109
|
+
return results.join("");
|
|
4110
|
+
}
|
|
4111
|
+
__name(odata, "odata");
|
|
4112
|
+
var _TableClient = class _TableClient {
|
|
4113
|
+
constructor(url2, tableName, credentialOrOptions, options = {}) {
|
|
4114
|
+
var _a;
|
|
4115
|
+
this.url = url2;
|
|
4116
|
+
this.tableName = tableName;
|
|
4117
|
+
const isCosmos = isCosmosEndpoint(this.url);
|
|
4118
|
+
const credential = isCredential(credentialOrOptions) ? credentialOrOptions : void 0;
|
|
4119
|
+
this.credential = credential;
|
|
4120
|
+
this.clientOptions = (!isCredential(credentialOrOptions) ? credentialOrOptions : options) || {};
|
|
4121
|
+
this.allowInsecureConnection = (_a = this.clientOptions.allowInsecureConnection) !== null && _a !== void 0 ? _a : false;
|
|
4122
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, this.clientOptions), { endpoint: this.clientOptions.endpoint || this.url, loggingOptions: {
|
|
4123
|
+
logger: logger2.info,
|
|
4124
|
+
additionalAllowedHeaderNames: [...TablesLoggingAllowedHeaderNames]
|
|
4125
|
+
}, deserializationOptions: {
|
|
4126
|
+
parseXML: coreXml.parseXML
|
|
4127
|
+
}, serializationOptions: {
|
|
4128
|
+
stringifyXML: coreXml.stringifyXML
|
|
4129
|
+
} });
|
|
4130
|
+
const generatedClient = new GeneratedClient(this.url, internalPipelineOptions);
|
|
4131
|
+
if (coreAuth.isNamedKeyCredential(credential)) {
|
|
4132
|
+
generatedClient.pipeline.addPolicy(tablesNamedKeyCredentialPolicy(credential));
|
|
4133
|
+
} else if (coreAuth.isSASCredential(credential)) {
|
|
4134
|
+
generatedClient.pipeline.addPolicy(tablesSASTokenPolicy(credential));
|
|
4135
|
+
}
|
|
4136
|
+
if (coreAuth.isTokenCredential(credential)) {
|
|
4137
|
+
const scope = isCosmos ? COSMOS_SCOPE : STORAGE_SCOPE;
|
|
4138
|
+
setTokenChallengeAuthenticationPolicy(generatedClient.pipeline, credential, scope);
|
|
4139
|
+
}
|
|
4140
|
+
if (isCosmos) {
|
|
4141
|
+
generatedClient.pipeline.addPolicy(cosmosPatchPolicy());
|
|
4142
|
+
}
|
|
4143
|
+
if (options.version) {
|
|
4144
|
+
generatedClient.pipeline.addPolicy(apiVersionPolicy(options.version));
|
|
4145
|
+
}
|
|
4146
|
+
this.generatedClient = generatedClient;
|
|
4147
|
+
this.table = generatedClient.table;
|
|
4148
|
+
this.pipeline = generatedClient.pipeline;
|
|
4149
|
+
}
|
|
4150
|
+
/**
|
|
4151
|
+
* Permanently deletes the current table with all of its entities.
|
|
4152
|
+
* @param options - The options parameters.
|
|
4153
|
+
*
|
|
4154
|
+
* ### Example deleting a table
|
|
4155
|
+
* ```js
|
|
4156
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4157
|
+
* const account = "<storage account name>";
|
|
4158
|
+
* const accountKey = "<account key>"
|
|
4159
|
+
* const tableName = "<table name>";
|
|
4160
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4161
|
+
*
|
|
4162
|
+
* const client = new TableClient(
|
|
4163
|
+
* `https://${account}.table.core.windows.net`,
|
|
4164
|
+
* `${tableName}`,
|
|
4165
|
+
* sharedKeyCredential
|
|
4166
|
+
* );
|
|
4167
|
+
*
|
|
4168
|
+
* // calling deleteTable will delete the table used
|
|
4169
|
+
* // to instantiate the TableClient.
|
|
4170
|
+
* // Note: If the table doesn't exist this function doesn't fail.
|
|
4171
|
+
* await client.deleteTable();
|
|
4172
|
+
* ```
|
|
4173
|
+
*/
|
|
4174
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4175
|
+
deleteTable(options = {}) {
|
|
4176
|
+
return tracingClient.withSpan("TableClient.deleteTable", options, async (updatedOptions) => {
|
|
4177
|
+
try {
|
|
4178
|
+
await this.table.delete(this.tableName, updatedOptions);
|
|
4179
|
+
} catch (e) {
|
|
4180
|
+
if (e.statusCode === 404) {
|
|
4181
|
+
logger2.info("TableClient.deleteTable: Table doesn't exist");
|
|
4182
|
+
} else {
|
|
4183
|
+
throw e;
|
|
4184
|
+
}
|
|
4185
|
+
}
|
|
4186
|
+
});
|
|
4187
|
+
}
|
|
4188
|
+
/**
|
|
4189
|
+
* Creates a table with the tableName passed to the client constructor
|
|
4190
|
+
* @param options - The options parameters.
|
|
4191
|
+
*
|
|
4192
|
+
* ### Example creating a table
|
|
4193
|
+
* ```js
|
|
4194
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4195
|
+
* const account = "<storage account name>";
|
|
4196
|
+
* const accountKey = "<account key>"
|
|
4197
|
+
* const tableName = "<table name>";
|
|
4198
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4199
|
+
*
|
|
4200
|
+
* const client = new TableClient(
|
|
4201
|
+
* `https://${account}.table.core.windows.net`,
|
|
4202
|
+
* `${tableName}`,
|
|
4203
|
+
* sharedKeyCredential
|
|
4204
|
+
* );
|
|
4205
|
+
*
|
|
4206
|
+
* // calling create table will create the table used
|
|
4207
|
+
* // to instantiate the TableClient.
|
|
4208
|
+
* // Note: If the table already
|
|
4209
|
+
* // exists this function doesn't throw.
|
|
4210
|
+
* await client.createTable();
|
|
4211
|
+
* ```
|
|
4212
|
+
*/
|
|
4213
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4214
|
+
createTable(options = {}) {
|
|
4215
|
+
return tracingClient.withSpan("TableClient.createTable", options, async (updatedOptions) => {
|
|
4216
|
+
try {
|
|
4217
|
+
await this.table.create({ name: this.tableName }, updatedOptions);
|
|
4218
|
+
} catch (e) {
|
|
4219
|
+
handleTableAlreadyExists(e, Object.assign(Object.assign({}, updatedOptions), { logger: logger2, tableName: this.tableName }));
|
|
4220
|
+
}
|
|
4221
|
+
});
|
|
4222
|
+
}
|
|
4223
|
+
/**
|
|
4224
|
+
* Returns a single entity in the table.
|
|
4225
|
+
* @param partitionKey - The partition key of the entity.
|
|
4226
|
+
* @param rowKey - The row key of the entity.
|
|
4227
|
+
* @param options - The options parameters.
|
|
4228
|
+
*
|
|
4229
|
+
* ### Example getting an entity
|
|
4230
|
+
* ```js
|
|
4231
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4232
|
+
* const account = "<storage account name>";
|
|
4233
|
+
* const accountKey = "<account key>"
|
|
4234
|
+
* const tableName = "<table name>";
|
|
4235
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4236
|
+
*
|
|
4237
|
+
* const client = new TableClient(
|
|
4238
|
+
* `https://${account}.table.core.windows.net`,
|
|
4239
|
+
* `${tableName}`,
|
|
4240
|
+
* sharedKeyCredential
|
|
4241
|
+
* );
|
|
4242
|
+
*
|
|
4243
|
+
* // getEntity will get a single entity stored in the service that
|
|
4244
|
+
* // matches exactly the partitionKey and rowKey used as parameters
|
|
4245
|
+
* // to the method.
|
|
4246
|
+
* const entity = await client.getEntity("<partitionKey>", "<rowKey>");
|
|
4247
|
+
* console.log(entity);
|
|
4248
|
+
* ```
|
|
4249
|
+
*/
|
|
4250
|
+
getEntity(partitionKey2, rowKey2, options = {}) {
|
|
4251
|
+
return tracingClient.withSpan("TableClient.getEntity", options, async (updatedOptions) => {
|
|
4252
|
+
let parsedBody;
|
|
4253
|
+
function onResponse(rawResponse, flatResponse) {
|
|
4254
|
+
parsedBody = rawResponse.parsedBody;
|
|
4255
|
+
if (updatedOptions.onResponse) {
|
|
4256
|
+
updatedOptions.onResponse(rawResponse, flatResponse);
|
|
4257
|
+
}
|
|
4258
|
+
}
|
|
4259
|
+
__name(onResponse, "onResponse");
|
|
4260
|
+
const { disableTypeConversion, queryOptions } = updatedOptions, getEntityOptions = tslib.__rest(updatedOptions, ["disableTypeConversion", "queryOptions"]);
|
|
4261
|
+
await this.table.queryEntitiesWithPartitionAndRowKey(this.tableName, escapeQuotes(partitionKey2), escapeQuotes(rowKey2), Object.assign(Object.assign({}, getEntityOptions), { queryOptions: serializeQueryOptions(queryOptions || {}), onResponse }));
|
|
4262
|
+
const tableEntity = deserialize(parsedBody, disableTypeConversion !== null && disableTypeConversion !== void 0 ? disableTypeConversion : false);
|
|
4263
|
+
return tableEntity;
|
|
4264
|
+
});
|
|
4265
|
+
}
|
|
4266
|
+
/**
|
|
4267
|
+
* Queries entities in a table.
|
|
4268
|
+
* @param options - The options parameters.
|
|
4269
|
+
*
|
|
4270
|
+
* Example listing entities
|
|
4271
|
+
* ```js
|
|
4272
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4273
|
+
* const account = "<storage account name>";
|
|
4274
|
+
* const accountKey = "<account key>"
|
|
4275
|
+
* const tableName = "<table name>";
|
|
4276
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4277
|
+
*
|
|
4278
|
+
* const client = new TableClient(
|
|
4279
|
+
* `https://${account}.table.core.windows.net`,
|
|
4280
|
+
* `${tableName}`,
|
|
4281
|
+
* sharedKeyCredential
|
|
4282
|
+
* );
|
|
4283
|
+
*
|
|
4284
|
+
* // list entities returns a AsyncIterableIterator
|
|
4285
|
+
* // this helps consuming paginated responses by
|
|
4286
|
+
* // automatically handling getting the next pages
|
|
4287
|
+
* const entities = client.listEntities();
|
|
4288
|
+
*
|
|
4289
|
+
* // this loop will get all the entities from all the pages
|
|
4290
|
+
* // returned by the service
|
|
4291
|
+
* for await (const entity of entities) {
|
|
4292
|
+
* console.log(entity);
|
|
4293
|
+
* }
|
|
4294
|
+
* ```
|
|
4295
|
+
*/
|
|
4296
|
+
listEntities(options = {}) {
|
|
4297
|
+
const tableName = this.tableName;
|
|
4298
|
+
const iter = this.listEntitiesAll(tableName, options);
|
|
4299
|
+
return {
|
|
4300
|
+
next() {
|
|
4301
|
+
return iter.next();
|
|
4302
|
+
},
|
|
4303
|
+
[Symbol.asyncIterator]() {
|
|
4304
|
+
return this;
|
|
4305
|
+
},
|
|
4306
|
+
byPage: /* @__PURE__ */ __name((settings) => {
|
|
4307
|
+
const pageOptions = Object.assign(Object.assign({}, options), { queryOptions: Object.assign(Object.assign({}, options.queryOptions), { top: settings === null || settings === void 0 ? void 0 : settings.maxPageSize }) });
|
|
4308
|
+
if (settings === null || settings === void 0 ? void 0 : settings.continuationToken) {
|
|
4309
|
+
pageOptions.continuationToken = settings.continuationToken;
|
|
4310
|
+
}
|
|
4311
|
+
return this.listEntitiesPage(tableName, pageOptions);
|
|
4312
|
+
}, "byPage")
|
|
4313
|
+
};
|
|
4314
|
+
}
|
|
4315
|
+
listEntitiesAll(tableName, options) {
|
|
4316
|
+
return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listEntitiesAll_1() {
|
|
4317
|
+
var _a, e_1, _b, _c;
|
|
4318
|
+
const firstPage = yield tslib.__await(this._listEntities(tableName, options));
|
|
4319
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(firstPage)));
|
|
4320
|
+
if (firstPage.continuationToken) {
|
|
4321
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken: firstPage.continuationToken });
|
|
4322
|
+
try {
|
|
4323
|
+
for (var _d = true, _e = tslib.__asyncValues(this.listEntitiesPage(tableName, optionsWithContinuation)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
4324
|
+
_c = _f.value;
|
|
4325
|
+
_d = false;
|
|
4326
|
+
const page = _c;
|
|
4327
|
+
yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
|
|
4328
|
+
}
|
|
4329
|
+
} catch (e_1_1) {
|
|
4330
|
+
e_1 = { error: e_1_1 };
|
|
4331
|
+
} finally {
|
|
4332
|
+
try {
|
|
4333
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e));
|
|
4334
|
+
} finally {
|
|
4335
|
+
if (e_1) throw e_1.error;
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
}, "listEntitiesAll_1"));
|
|
4340
|
+
}
|
|
4341
|
+
listEntitiesPage(tableName_1) {
|
|
4342
|
+
return tslib.__asyncGenerator(this, arguments, /* @__PURE__ */ __name(function* listEntitiesPage_1(tableName, options = {}) {
|
|
4343
|
+
let result = yield tslib.__await(tracingClient.withSpan("TableClient.listEntitiesPage", options, (updatedOptions) => this._listEntities(tableName, updatedOptions)));
|
|
4344
|
+
yield yield tslib.__await(result);
|
|
4345
|
+
while (result.continuationToken) {
|
|
4346
|
+
const optionsWithContinuation = Object.assign(Object.assign({}, options), { continuationToken: result.continuationToken });
|
|
4347
|
+
result = yield tslib.__await(tracingClient.withSpan("TableClient.listEntitiesPage", optionsWithContinuation, (updatedOptions, span) => {
|
|
4348
|
+
span.setAttribute("continuationToken", result.continuationToken);
|
|
4349
|
+
return this._listEntities(tableName, updatedOptions);
|
|
4350
|
+
}));
|
|
4351
|
+
yield yield tslib.__await(result);
|
|
4352
|
+
}
|
|
4353
|
+
}, "listEntitiesPage_1"));
|
|
4354
|
+
}
|
|
4355
|
+
async _listEntities(tableName, options = {}) {
|
|
4356
|
+
const { disableTypeConversion = false } = options;
|
|
4357
|
+
const queryOptions = serializeQueryOptions(options.queryOptions || {});
|
|
4358
|
+
const listEntitiesOptions = Object.assign(Object.assign({}, options), { queryOptions });
|
|
4359
|
+
if (options.continuationToken) {
|
|
4360
|
+
const continuationToken2 = decodeContinuationToken(options.continuationToken);
|
|
4361
|
+
listEntitiesOptions.nextRowKey = continuationToken2.nextRowKey;
|
|
4362
|
+
listEntitiesOptions.nextPartitionKey = continuationToken2.nextPartitionKey;
|
|
4363
|
+
}
|
|
4364
|
+
const { xMsContinuationNextPartitionKey: nextPartitionKey2, xMsContinuationNextRowKey: nextRowKey2, value } = await this.table.queryEntities(tableName, listEntitiesOptions);
|
|
4365
|
+
const tableEntities = deserializeObjectsArray(value !== null && value !== void 0 ? value : [], disableTypeConversion);
|
|
4366
|
+
const continuationToken = encodeContinuationToken(nextPartitionKey2, nextRowKey2);
|
|
4367
|
+
const page = Object.assign([...tableEntities], {
|
|
4368
|
+
continuationToken
|
|
4369
|
+
});
|
|
4370
|
+
return page;
|
|
4371
|
+
}
|
|
4372
|
+
/**
|
|
4373
|
+
* Insert entity in the table.
|
|
4374
|
+
* @param entity - The properties for the table entity.
|
|
4375
|
+
* @param options - The options parameters.
|
|
4376
|
+
*
|
|
4377
|
+
* ### Example creating an entity
|
|
4378
|
+
* ```js
|
|
4379
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4380
|
+
* const account = "<storage account name>";
|
|
4381
|
+
* const accountKey = "<account key>"
|
|
4382
|
+
* const tableName = "<table name>";
|
|
4383
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4384
|
+
*
|
|
4385
|
+
* const client = new TableClient(
|
|
4386
|
+
* `https://${account}.table.core.windows.net`,
|
|
4387
|
+
* `${tableName}`,
|
|
4388
|
+
* sharedKeyCredential
|
|
4389
|
+
* );
|
|
4390
|
+
*
|
|
4391
|
+
* // partitionKey and rowKey are required properties of the entity to create
|
|
4392
|
+
* // and accepts any other properties
|
|
4393
|
+
* await client.createEntity({partitionKey: "p1", rowKey: "r1", foo: "Hello!"});
|
|
4394
|
+
* ```
|
|
4395
|
+
*/
|
|
4396
|
+
createEntity(entity, options = {}) {
|
|
4397
|
+
return tracingClient.withSpan("TableClient.createEntity", options, (updatedOptions) => {
|
|
4398
|
+
const createTableEntity = tslib.__rest(updatedOptions || {}, []);
|
|
4399
|
+
return this.table.insertEntity(this.tableName, Object.assign(Object.assign({}, createTableEntity), { tableEntityProperties: serialize(entity), responsePreference: "return-no-content" }));
|
|
4400
|
+
});
|
|
4401
|
+
}
|
|
4402
|
+
/**
|
|
4403
|
+
* Deletes the specified entity in the table.
|
|
4404
|
+
* @param partitionKey - The partition key of the entity.
|
|
4405
|
+
* @param rowKey - The row key of the entity.
|
|
4406
|
+
* @param options - The options parameters.
|
|
4407
|
+
*
|
|
4408
|
+
* ### Example deleting an entity
|
|
4409
|
+
* ```js
|
|
4410
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4411
|
+
* const account = "<storage account name>";
|
|
4412
|
+
* const accountKey = "<account key>"
|
|
4413
|
+
* const tableName = "<table name>";
|
|
4414
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4415
|
+
*
|
|
4416
|
+
* const client = new TableClient(
|
|
4417
|
+
* `https://${account}.table.core.windows.net`,
|
|
4418
|
+
* `${tableName}`,
|
|
4419
|
+
* sharedKeyCredential
|
|
4420
|
+
* );
|
|
4421
|
+
*
|
|
4422
|
+
* // deleteEntity deletes the entity that matches
|
|
4423
|
+
* // exactly the partitionKey and rowKey passed as parameters
|
|
4424
|
+
* await client.deleteEntity("<partitionKey>", "<rowKey>")
|
|
4425
|
+
* ```
|
|
4426
|
+
*/
|
|
4427
|
+
deleteEntity(partitionKey2, rowKey2, options = {}) {
|
|
4428
|
+
return tracingClient.withSpan("TableClient.deleteEntity", options, (updatedOptions) => {
|
|
4429
|
+
const { etag = "*" } = updatedOptions, rest = tslib.__rest(updatedOptions, ["etag"]);
|
|
4430
|
+
const deleteOptions = Object.assign({}, rest);
|
|
4431
|
+
return this.table.deleteEntity(this.tableName, escapeQuotes(partitionKey2), escapeQuotes(rowKey2), etag, deleteOptions);
|
|
4432
|
+
});
|
|
4433
|
+
}
|
|
4434
|
+
/**
|
|
4435
|
+
* Update an entity in the table.
|
|
4436
|
+
* @param entity - The properties of the entity to be updated.
|
|
4437
|
+
* @param mode - The different modes for updating the entity:
|
|
4438
|
+
* - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.
|
|
4439
|
+
* - Replace: Updates an existing entity by replacing the entire entity.
|
|
4440
|
+
* @param options - The options parameters.
|
|
4441
|
+
*
|
|
4442
|
+
* ### Example updating an entity
|
|
4443
|
+
* ```js
|
|
4444
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4445
|
+
* const account = "<storage account name>";
|
|
4446
|
+
* const accountKey = "<account key>"
|
|
4447
|
+
* const tableName = "<table name>";
|
|
4448
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4449
|
+
*
|
|
4450
|
+
* const client = new TableClient(
|
|
4451
|
+
* `https://${account}.table.core.windows.net`,
|
|
4452
|
+
* `${tableName}`,
|
|
4453
|
+
* sharedKeyCredential
|
|
4454
|
+
* );
|
|
4455
|
+
*
|
|
4456
|
+
* const entity = {partitionKey: "p1", rowKey: "r1", bar: "updatedBar"};
|
|
4457
|
+
*
|
|
4458
|
+
* // Update uses update mode "Merge" as default
|
|
4459
|
+
* // merge means that update will match a stored entity
|
|
4460
|
+
* // that has the same partitionKey and rowKey as the entity
|
|
4461
|
+
* // passed to the method and then will only update the properties present in it.
|
|
4462
|
+
* // Any other properties that are not defined in the entity passed to updateEntity
|
|
4463
|
+
* // will remain as they are in the service
|
|
4464
|
+
* await client.updateEntity(entity)
|
|
4465
|
+
*
|
|
4466
|
+
* // We can also set the update mode to Replace, which will match the entity passed
|
|
4467
|
+
* // to updateEntity with one stored in the service and replace with the new one.
|
|
4468
|
+
* // If there are any missing properties in the entity passed to updateEntity, they
|
|
4469
|
+
* // will be removed from the entity stored in the service
|
|
4470
|
+
* await client.updateEntity(entity, "Replace")
|
|
4471
|
+
* ```
|
|
4472
|
+
*/
|
|
4473
|
+
updateEntity(entity, mode = "Merge", options = {}) {
|
|
4474
|
+
return tracingClient.withSpan("TableClient.updateEntity", options, async (updatedOptions) => {
|
|
4475
|
+
const partitionKey2 = escapeQuotes(entity.partitionKey);
|
|
4476
|
+
const rowKey2 = escapeQuotes(entity.rowKey);
|
|
4477
|
+
const _a = updatedOptions || {}, { etag = "*" } = _a, updateEntityOptions = tslib.__rest(_a, ["etag"]);
|
|
4478
|
+
if (mode === "Merge") {
|
|
4479
|
+
return this.table.mergeEntity(this.tableName, partitionKey2, rowKey2, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
|
|
4480
|
+
}
|
|
4481
|
+
if (mode === "Replace") {
|
|
4482
|
+
return this.table.updateEntity(this.tableName, partitionKey2, rowKey2, Object.assign({ tableEntityProperties: serialize(entity), ifMatch: etag }, updateEntityOptions));
|
|
4483
|
+
}
|
|
4484
|
+
throw new Error(`Unexpected value for update mode: ${mode}`);
|
|
4485
|
+
}, {
|
|
4486
|
+
spanAttributes: {
|
|
4487
|
+
updateEntityMode: mode
|
|
4488
|
+
}
|
|
4489
|
+
});
|
|
4490
|
+
}
|
|
4491
|
+
/**
|
|
4492
|
+
* Upsert an entity in the table.
|
|
4493
|
+
* @param entity - The properties for the table entity.
|
|
4494
|
+
* @param mode - The different modes for updating the entity:
|
|
4495
|
+
* - Merge: Updates an entity by updating the entity's properties without replacing the existing entity.
|
|
4496
|
+
* - Replace: Updates an existing entity by replacing the entire entity.
|
|
4497
|
+
* @param options - The options parameters.
|
|
4498
|
+
*
|
|
4499
|
+
* ### Example upserting an entity
|
|
4500
|
+
* ```js
|
|
4501
|
+
* const { AzureNamedKeyCredential, TableClient } = require("@azure/data-tables")
|
|
4502
|
+
* const account = "<storage account name>";
|
|
4503
|
+
* const accountKey = "<account key>"
|
|
4504
|
+
* const tableName = "<table name>";
|
|
4505
|
+
* const sharedKeyCredential = new AzureNamedKeyCredential(account, accountKey);
|
|
4506
|
+
*
|
|
4507
|
+
* const client = new TableClient(
|
|
4508
|
+
* `https://${account}.table.core.windows.net`,
|
|
4509
|
+
* `${tableName}`,
|
|
4510
|
+
* sharedKeyCredential
|
|
4511
|
+
* );
|
|
4512
|
+
*
|
|
4513
|
+
* const entity = {partitionKey: "p1", rowKey: "r1", bar: "updatedBar"};
|
|
4514
|
+
*
|
|
4515
|
+
* // Upsert uses update mode "Merge" as default.
|
|
4516
|
+
* // This behaves similarly to update but creates the entity
|
|
4517
|
+
* // if it doesn't exist in the service
|
|
4518
|
+
* await client.upsertEntity(entity)
|
|
4519
|
+
*
|
|
4520
|
+
* // We can also set the update mode to Replace.
|
|
4521
|
+
* // This behaves similarly to update but creates the entity
|
|
4522
|
+
* // if it doesn't exist in the service
|
|
4523
|
+
* await client.upsertEntity(entity, "Replace")
|
|
4524
|
+
* ```
|
|
4525
|
+
*/
|
|
4526
|
+
upsertEntity(entity, mode = "Merge", options = {}) {
|
|
4527
|
+
return tracingClient.withSpan("TableClient.upsertEntity", options, async (updatedOptions) => {
|
|
4528
|
+
const partitionKey2 = escapeQuotes(entity.partitionKey);
|
|
4529
|
+
const rowKey2 = escapeQuotes(entity.rowKey);
|
|
4530
|
+
if (mode === "Merge") {
|
|
4531
|
+
return this.table.mergeEntity(this.tableName, partitionKey2, rowKey2, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
|
|
4532
|
+
}
|
|
4533
|
+
if (mode === "Replace") {
|
|
4534
|
+
return this.table.updateEntity(this.tableName, partitionKey2, rowKey2, Object.assign({ tableEntityProperties: serialize(entity) }, updatedOptions));
|
|
4535
|
+
}
|
|
4536
|
+
throw new Error(`Unexpected value for update mode: ${mode}`);
|
|
4537
|
+
}, {
|
|
4538
|
+
spanAttributes: {
|
|
4539
|
+
upsertEntityMode: mode
|
|
4540
|
+
}
|
|
4541
|
+
});
|
|
4542
|
+
}
|
|
4543
|
+
/**
|
|
4544
|
+
* Retrieves details about any stored access policies specified on the table that may be used with
|
|
4545
|
+
* Shared Access Signatures.
|
|
4546
|
+
* @param options - The options parameters.
|
|
4547
|
+
*/
|
|
4548
|
+
// eslint-disable-next-line @azure/azure-sdk/ts-naming-options
|
|
4549
|
+
getAccessPolicy(options = {}) {
|
|
4550
|
+
return tracingClient.withSpan("TableClient.getAccessPolicy", options, async (updatedOptions) => {
|
|
4551
|
+
const signedIdentifiers = await this.table.getAccessPolicy(this.tableName, updatedOptions);
|
|
4552
|
+
return deserializeSignedIdentifier(signedIdentifiers);
|
|
4553
|
+
});
|
|
4554
|
+
}
|
|
4555
|
+
/**
|
|
4556
|
+
* Sets stored access policies for the table that may be used with Shared Access Signatures.
|
|
4557
|
+
* @param tableAcl - The Access Control List for the table.
|
|
4558
|
+
* @param options - The options parameters.
|
|
4559
|
+
*/
|
|
4560
|
+
setAccessPolicy(tableAcl2, options = {}) {
|
|
4561
|
+
return tracingClient.withSpan("TableClient.setAccessPolicy", options, (updatedOptions) => {
|
|
4562
|
+
const serlializedAcl = serializeSignedIdentifiers(tableAcl2);
|
|
4563
|
+
return this.table.setAccessPolicy(this.tableName, Object.assign(Object.assign({}, updatedOptions), { tableAcl: serlializedAcl }));
|
|
4564
|
+
});
|
|
4565
|
+
}
|
|
4566
|
+
/**
|
|
4567
|
+
* Submits a Transaction which is composed of a set of actions. You can provide the actions as a list
|
|
4568
|
+
* or you can use {@link TableTransaction} to help building the transaction.
|
|
4569
|
+
*
|
|
4570
|
+
* Example usage:
|
|
4571
|
+
* ```typescript
|
|
4572
|
+
* const { TableClient } = require("@azure/data-tables");
|
|
4573
|
+
* const connectionString = "<connection-string>"
|
|
4574
|
+
* const tableName = "<tableName>"
|
|
4575
|
+
* const client = TableClient.fromConnectionString(connectionString, tableName);
|
|
4576
|
+
* const actions = [
|
|
4577
|
+
* ["create", {partitionKey: "p1", rowKey: "1", data: "test1"}],
|
|
4578
|
+
* ["delete", {partitionKey: "p1", rowKey: "2"}],
|
|
4579
|
+
* ["update", {partitionKey: "p1", rowKey: "3", data: "newTest"}, "Merge"]
|
|
4580
|
+
* ]
|
|
4581
|
+
* const result = await client.submitTransaction(actions);
|
|
4582
|
+
* ```
|
|
4583
|
+
*
|
|
4584
|
+
* Example usage with TableTransaction:
|
|
4585
|
+
* ```js
|
|
4586
|
+
* const { TableClient } = require("@azure/data-tables");
|
|
4587
|
+
* const connectionString = "<connection-string>"
|
|
4588
|
+
* const tableName = "<tableName>"
|
|
4589
|
+
* const client = TableClient.fromConnectionString(connectionString, tableName);
|
|
4590
|
+
* const transaction = new TableTransaction();
|
|
4591
|
+
* // Call the available action in the TableTransaction object
|
|
4592
|
+
* transaction.create({partitionKey: "p1", rowKey: "1", data: "test1"});
|
|
4593
|
+
* transaction.delete("p1", "2");
|
|
4594
|
+
* transaction.update({partitionKey: "p1", rowKey: "3", data: "newTest"}, "Merge")
|
|
4595
|
+
* // submitTransaction with the actions list on the transaction.
|
|
4596
|
+
* const result = await client.submitTransaction(transaction.actions);
|
|
4597
|
+
* ```
|
|
4598
|
+
*
|
|
4599
|
+
* @param actions - tuple that contains the action to perform, and the entity to perform the action with
|
|
4600
|
+
*/
|
|
4601
|
+
async submitTransaction(actions) {
|
|
4602
|
+
const partitionKey2 = actions[0][1].partitionKey;
|
|
4603
|
+
const transactionId = Uuid.generateUuid();
|
|
4604
|
+
const changesetId = Uuid.generateUuid();
|
|
4605
|
+
const transactionClient = new InternalTableTransaction(this.url, partitionKey2, transactionId, changesetId, this.generatedClient, new _TableClient(this.url, this.tableName), this.credential, this.allowInsecureConnection);
|
|
4606
|
+
for (const item of actions) {
|
|
4607
|
+
const [action, entity, updateMode = "Merge", updateOptions] = item;
|
|
4608
|
+
switch (action) {
|
|
4609
|
+
case "create":
|
|
4610
|
+
transactionClient.createEntity(entity);
|
|
4611
|
+
break;
|
|
4612
|
+
case "delete":
|
|
4613
|
+
transactionClient.deleteEntity(entity.partitionKey, entity.rowKey);
|
|
4614
|
+
break;
|
|
4615
|
+
case "update":
|
|
4616
|
+
transactionClient.updateEntity(entity, updateMode, updateOptions);
|
|
4617
|
+
break;
|
|
4618
|
+
case "upsert":
|
|
4619
|
+
transactionClient.upsertEntity(entity, updateMode);
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
return transactionClient.submitTransaction();
|
|
4623
|
+
}
|
|
4624
|
+
/**
|
|
4625
|
+
*
|
|
4626
|
+
* Creates an instance of TableClient from connection string.
|
|
4627
|
+
*
|
|
4628
|
+
* @param connectionString - Account connection string or a SAS connection string of an Azure storage account.
|
|
4629
|
+
* [ Note - Account connection string can only be used in NODE.JS runtime. ]
|
|
4630
|
+
* Account connection string example -
|
|
4631
|
+
* `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`
|
|
4632
|
+
* SAS connection string example -
|
|
4633
|
+
* `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`
|
|
4634
|
+
* @param options - Options to configure the HTTP pipeline.
|
|
4635
|
+
* @returns A new TableClient from the given connection string.
|
|
4636
|
+
*/
|
|
4637
|
+
static fromConnectionString(connectionString, tableName, options) {
|
|
4638
|
+
const { url: url2, options: clientOptions, credential } = getClientParamsFromConnectionString(connectionString, options);
|
|
4639
|
+
if (credential) {
|
|
4640
|
+
return new _TableClient(url2, tableName, credential, clientOptions);
|
|
4641
|
+
} else {
|
|
4642
|
+
return new _TableClient(url2, tableName, clientOptions);
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
};
|
|
4646
|
+
__name(_TableClient, "TableClient");
|
|
4647
|
+
var TableClient2 = _TableClient;
|
|
4648
|
+
Object.defineProperty(exports, "AzureNamedKeyCredential", {
|
|
4649
|
+
enumerable: true,
|
|
4650
|
+
get: /* @__PURE__ */ __name(function() {
|
|
4651
|
+
return coreAuth.AzureNamedKeyCredential;
|
|
4652
|
+
}, "get")
|
|
4653
|
+
});
|
|
4654
|
+
Object.defineProperty(exports, "AzureSASCredential", {
|
|
4655
|
+
enumerable: true,
|
|
4656
|
+
get: /* @__PURE__ */ __name(function() {
|
|
4657
|
+
return coreAuth.AzureSASCredential;
|
|
4658
|
+
}, "get")
|
|
4659
|
+
});
|
|
4660
|
+
Object.defineProperty(exports, "RestError", {
|
|
4661
|
+
enumerable: true,
|
|
4662
|
+
get: /* @__PURE__ */ __name(function() {
|
|
4663
|
+
return coreRestPipeline.RestError;
|
|
4664
|
+
}, "get")
|
|
4665
|
+
});
|
|
4666
|
+
exports.TableClient = TableClient2;
|
|
4667
|
+
exports.TableServiceClient = TableServiceClient;
|
|
4668
|
+
exports.TableTransaction = TableTransaction;
|
|
4669
|
+
exports.generateAccountSas = generateAccountSas;
|
|
4670
|
+
exports.generateTableSas = generateTableSas;
|
|
4671
|
+
exports.odata = odata;
|
|
4672
|
+
}
|
|
4673
|
+
});
|
|
4674
|
+
|
|
18
4675
|
// src/registerAzureLogger.ts
|
|
19
4676
|
import EventEmitter from "events";
|
|
20
4677
|
var logger = require_commonjs();
|
|
@@ -99,11 +4756,15 @@ var blockListIsInvalidRetryPolicy = {
|
|
|
99
4756
|
// src/createRemoteCacheClient.ts
|
|
100
4757
|
import { RetryManager } from "@ms-cloudpack/retry";
|
|
101
4758
|
|
|
102
|
-
// src/
|
|
4759
|
+
// src/createStorageUrl.ts
|
|
103
4760
|
function createBlobStorageUrl(storageAccount) {
|
|
104
4761
|
return `https://${storageAccount}.blob.core.windows.net`;
|
|
105
4762
|
}
|
|
106
4763
|
__name(createBlobStorageUrl, "createBlobStorageUrl");
|
|
4764
|
+
function createTableStorageUrl(storageAccount) {
|
|
4765
|
+
return `https://${storageAccount}.table.core.windows.net`;
|
|
4766
|
+
}
|
|
4767
|
+
__name(createTableStorageUrl, "createTableStorageUrl");
|
|
107
4768
|
|
|
108
4769
|
// src/createRemoteCacheClient.ts
|
|
109
4770
|
var import_storage_blob = __toESM(require_dist(), 1);
|
|
@@ -111,8 +4772,8 @@ async function createRemoteCacheClient(params) {
|
|
|
111
4772
|
const azureLogEventHandler = registerAzureLogger();
|
|
112
4773
|
const { context, options } = params;
|
|
113
4774
|
const { container, loginMethod, storageAccount, cachePath, tenantId } = options;
|
|
114
|
-
const { getCredential } = await import("./getCredential-
|
|
115
|
-
const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-
|
|
4775
|
+
const { getCredential } = await import("./getCredential-OSAAVWZC.js");
|
|
4776
|
+
const { AzureRemoteCacheClient } = await import("./AzureRemoteCacheClient-AY675HJK.js");
|
|
116
4777
|
const { ReporterDecorator } = await import("./ReporterDecorator-VYNWC6CL.js");
|
|
117
4778
|
const { getListOfBlobs } = await import("./getListOfBlobs-EY2E5AZT.js");
|
|
118
4779
|
const credential = await getCredential(
|
|
@@ -135,6 +4796,143 @@ async function createRemoteCacheClient(params) {
|
|
|
135
4796
|
return client;
|
|
136
4797
|
}
|
|
137
4798
|
__name(createRemoteCacheClient, "createRemoteCacheClient");
|
|
4799
|
+
|
|
4800
|
+
// src/AzureAppRegistryClient.ts
|
|
4801
|
+
var import_data_tables = __toESM(require_dist2(), 1);
|
|
4802
|
+
|
|
4803
|
+
// src/utils/safeEncodeURIComponent.ts
|
|
4804
|
+
function safeEncodeURIComponent(value) {
|
|
4805
|
+
try {
|
|
4806
|
+
return decodeURIComponent(value) !== value ? value : encodeURIComponent(value);
|
|
4807
|
+
} catch (e) {
|
|
4808
|
+
return encodeURIComponent(value);
|
|
4809
|
+
}
|
|
4810
|
+
}
|
|
4811
|
+
__name(safeEncodeURIComponent, "safeEncodeURIComponent");
|
|
4812
|
+
|
|
4813
|
+
// src/utils/safeDecodeURIComponent.ts
|
|
4814
|
+
function safeDecodeURIComponent(value) {
|
|
4815
|
+
try {
|
|
4816
|
+
return encodeURIComponent(decodeURIComponent(value)) === value ? decodeURIComponent(value) : value;
|
|
4817
|
+
} catch (e) {
|
|
4818
|
+
return value;
|
|
4819
|
+
}
|
|
4820
|
+
}
|
|
4821
|
+
__name(safeDecodeURIComponent, "safeDecodeURIComponent");
|
|
4822
|
+
|
|
4823
|
+
// src/utils/getReverseSortedTimestamp.ts
|
|
4824
|
+
function getReverseSortedTimestamp() {
|
|
4825
|
+
const maxTimestamp = 9999999999999;
|
|
4826
|
+
const currentTimestamp = Math.floor(Date.now() / 1e3);
|
|
4827
|
+
const reverseTimestamp = maxTimestamp - currentTimestamp;
|
|
4828
|
+
return reverseTimestamp.toString().padStart(13, "0");
|
|
4829
|
+
}
|
|
4830
|
+
__name(getReverseSortedTimestamp, "getReverseSortedTimestamp");
|
|
4831
|
+
|
|
4832
|
+
// src/AzureAppRegistryClient.ts
|
|
4833
|
+
var _AzureAppRegistryClient = class _AzureAppRegistryClient {
|
|
4834
|
+
constructor(storageUrl, credential) {
|
|
4835
|
+
this.storageUrl = storageUrl;
|
|
4836
|
+
this.credential = credential;
|
|
4837
|
+
this.appsTableClient = new import_data_tables.TableClient(storageUrl, "apps", credential);
|
|
4838
|
+
this.appVersionsTableClient = new import_data_tables.TableClient(storageUrl, "appVersions", credential);
|
|
4839
|
+
}
|
|
4840
|
+
/**
|
|
4841
|
+
* Registers an application and its version details in the table storage.
|
|
4842
|
+
*/
|
|
4843
|
+
async registerApp({
|
|
4844
|
+
name,
|
|
4845
|
+
version,
|
|
4846
|
+
description,
|
|
4847
|
+
...rest
|
|
4848
|
+
}) {
|
|
4849
|
+
await Promise.all([
|
|
4850
|
+
// Register the app
|
|
4851
|
+
this.appsTableClient.upsertEntity(
|
|
4852
|
+
{
|
|
4853
|
+
partitionKey: "apps",
|
|
4854
|
+
rowKey: safeEncodeURIComponent(name),
|
|
4855
|
+
latestVersion: safeDecodeURIComponent(version),
|
|
4856
|
+
description
|
|
4857
|
+
},
|
|
4858
|
+
"Replace"
|
|
4859
|
+
),
|
|
4860
|
+
// Register the app version details
|
|
4861
|
+
this.appVersionsTableClient.upsertEntity(
|
|
4862
|
+
{
|
|
4863
|
+
partitionKey: safeEncodeURIComponent(name),
|
|
4864
|
+
// Using a reverse-sorted timestamp as the RowKey ensures newer items appear first,
|
|
4865
|
+
// since Azure Table Storage only sorts by PartitionKey/RowKey and lacks custom ordering capabilities.
|
|
4866
|
+
rowKey: safeEncodeURIComponent(getReverseSortedTimestamp()),
|
|
4867
|
+
...rest,
|
|
4868
|
+
version
|
|
4869
|
+
},
|
|
4870
|
+
"Replace"
|
|
4871
|
+
)
|
|
4872
|
+
]);
|
|
4873
|
+
}
|
|
4874
|
+
async getApps(appName, pageSettings) {
|
|
4875
|
+
const pages = this.appsTableClient.listEntities({
|
|
4876
|
+
queryOptions: appName ? {
|
|
4877
|
+
filter: `RowKey eq '${safeEncodeURIComponent(appName)}'`
|
|
4878
|
+
} : void 0
|
|
4879
|
+
}).byPage(pageSettings);
|
|
4880
|
+
const pageResult = await pages.next();
|
|
4881
|
+
if (pageResult.done || !pageResult.value) {
|
|
4882
|
+
return { items: [] };
|
|
4883
|
+
}
|
|
4884
|
+
const items = pageResult.value;
|
|
4885
|
+
const continuationToken = pageResult.value.continuationToken;
|
|
4886
|
+
return {
|
|
4887
|
+
items: items.map(({ partitionKey, rowKey, ...rest }) => ({
|
|
4888
|
+
...rest,
|
|
4889
|
+
name: safeDecodeURIComponent(rowKey)
|
|
4890
|
+
})),
|
|
4891
|
+
continuationToken
|
|
4892
|
+
};
|
|
4893
|
+
}
|
|
4894
|
+
async getVersions(appName, pageSettings) {
|
|
4895
|
+
const pages = this.appVersionsTableClient.listEntities({
|
|
4896
|
+
queryOptions: {
|
|
4897
|
+
filter: `PartitionKey eq '${safeEncodeURIComponent(appName)}'`
|
|
4898
|
+
}
|
|
4899
|
+
}).byPage(pageSettings);
|
|
4900
|
+
const pageResult = await pages.next();
|
|
4901
|
+
if (pageResult.done || !pageResult.value) {
|
|
4902
|
+
return { items: [] };
|
|
4903
|
+
}
|
|
4904
|
+
const items = pageResult.value;
|
|
4905
|
+
const continuationToken = pageResult.value.continuationToken;
|
|
4906
|
+
return {
|
|
4907
|
+
items: items.map(({ partitionKey, ...rest }) => ({
|
|
4908
|
+
name: safeDecodeURIComponent(partitionKey),
|
|
4909
|
+
...rest
|
|
4910
|
+
})),
|
|
4911
|
+
continuationToken
|
|
4912
|
+
};
|
|
4913
|
+
}
|
|
4914
|
+
};
|
|
4915
|
+
__name(_AzureAppRegistryClient, "AzureAppRegistryClient");
|
|
4916
|
+
var AzureAppRegistryClient = _AzureAppRegistryClient;
|
|
4917
|
+
|
|
4918
|
+
// src/createAppRegistryClient.ts
|
|
4919
|
+
var defaultTenantId = "72f988bf-86f1-41af-91ab-2d7cd011db47";
|
|
4920
|
+
var defaultStorageAccount = "cloudpackstorage";
|
|
4921
|
+
async function createAppRegistryClient(params) {
|
|
4922
|
+
const { context, options } = params;
|
|
4923
|
+
const { loginMethod, cachePath, tenantId = defaultTenantId, storageAccount = defaultStorageAccount } = options;
|
|
4924
|
+
const azureLogEventHandler = registerAzureLogger();
|
|
4925
|
+
const { getCredential } = await import("./getCredential-OSAAVWZC.js");
|
|
4926
|
+
const credential = await getCredential(
|
|
4927
|
+
{ loginMethod, cachePath, tenantId },
|
|
4928
|
+
{ ...context, azureLogger: azureLogEventHandler }
|
|
4929
|
+
);
|
|
4930
|
+
const url = createTableStorageUrl(storageAccount);
|
|
4931
|
+
const client = new AzureAppRegistryClient(url, credential);
|
|
4932
|
+
return client;
|
|
4933
|
+
}
|
|
4934
|
+
__name(createAppRegistryClient, "createAppRegistryClient");
|
|
138
4935
|
export {
|
|
4936
|
+
createAppRegistryClient,
|
|
139
4937
|
createRemoteCacheClient
|
|
140
4938
|
};
|