@azure/cosmos 3.16.4 → 3.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -13
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/types/3.1/cosmos.d.ts +11 -0
- package/dist/types/latest/cosmos.d.ts +11 -1
- package/dist-esm/src/common/constants.js +1 -1
- package/dist-esm/src/common/constants.js.map +1 -1
- package/dist-esm/src/request/SharedOptions.d.ts +1 -3
- package/dist-esm/src/request/SharedOptions.d.ts.map +1 -1
- package/dist-esm/src/request/SharedOptions.js.map +1 -1
- package/dist-esm/src/request/request.d.ts.map +1 -1
- package/dist-esm/src/request/request.js +9 -2
- package/dist-esm/src/request/request.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
3
|
+
## 3.17.0 (2022-08-19)
|
|
4
|
+
|
|
5
|
+
### Features Added
|
|
6
|
+
|
|
7
|
+
#### GA: Azure Cosmos DB Integrated Cache
|
|
8
|
+
|
|
9
|
+
- Support DedicatedGatewayRequestOptions and MaxIntegratedCacheStaleness [#21240](https://github.com/Azure/azure-sdk-for-js/pull/21240)
|
|
10
|
+
- Upgrade cosmos with azure core tracing [#22284](https://github.com/Azure/azure-sdk-for-js/pull/22284)
|
|
11
|
+
- Removed old logging and implement Azure core logging coverage [#18723](https://github.com/Azure/azure-sdk-for-js/pull/18723?)
|
|
4
12
|
|
|
5
13
|
### Bugs Fixed
|
|
6
|
-
|
|
14
|
+
|
|
15
|
+
- ParallelQueryExecutionContextBase breaks use of abortSignal [#18544](https://github.com/Azure/azure-sdk-for-js/pull/18544)
|
|
16
|
+
- Fixes id encoding issues when using special characters fo RoutingGateway
|
|
7
17
|
|
|
8
18
|
## 3.16.3 (2022-07-13)
|
|
9
19
|
|
|
10
20
|
### Bugs Fixed
|
|
11
|
-
|
|
21
|
+
|
|
22
|
+
- Fixes issues with "id" encoding when using special characters that should be allowed in the "id" property of a document. [#22548](https://github.com/Azure/azure-sdk-for-js/pull/22548)
|
|
12
23
|
|
|
13
24
|
## 3.16.2 (2022-06-24)
|
|
14
25
|
|
|
15
26
|
### Bugs Fixed
|
|
16
|
-
|
|
27
|
+
|
|
28
|
+
- Adds support to run queries with group by over a column with null values. [#22345](https://github.com/Azure/azure-sdk-for-js/pull/22345)
|
|
17
29
|
|
|
18
30
|
## 3.16.1 (2022-05-31)
|
|
19
31
|
|
|
20
32
|
### Bugs Fixed
|
|
33
|
+
|
|
21
34
|
- Fix [#22003](https://github.com/Azure/azure-sdk-for-js/issues/22003) missing interface error. [#22015](https://github.com/Azure/azure-sdk-for-js/pull/22015)
|
|
22
35
|
|
|
23
36
|
## 3.16.0 (2022-05-23)
|
|
24
37
|
|
|
25
38
|
### Features Added
|
|
39
|
+
|
|
26
40
|
- Allow users like cosmos-explorer to specify hierarchical partition keys. https://github.com/Azure/azure-sdk-for-js/pull/21934
|
|
27
41
|
- Support Dedicated Gateway RequestOptions and Max Integrated Cache Staleness. https://github.com/Azure/azure-sdk-for-js/pull/21240
|
|
28
42
|
|
|
@@ -112,8 +126,8 @@ const client = new CosmosClient({
|
|
|
112
126
|
connectionPolicy: {
|
|
113
127
|
...defaultConnectionPolicy,
|
|
114
128
|
endpointRefreshRateInMs: 700,
|
|
115
|
-
enableBackgroundEndpointRefreshing: true
|
|
116
|
-
}
|
|
129
|
+
enableBackgroundEndpointRefreshing: true,
|
|
130
|
+
},
|
|
117
131
|
});
|
|
118
132
|
```
|
|
119
133
|
|
|
@@ -258,17 +272,17 @@ database.container.create(containerDefinition)
|
|
|
258
272
|
const operations: OperationInput[] = [
|
|
259
273
|
{
|
|
260
274
|
operationType: "Create",
|
|
261
|
-
resourceBody: { id: "doc1", name: "sample", key: "A" }
|
|
275
|
+
resourceBody: { id: "doc1", name: "sample", key: "A" },
|
|
262
276
|
},
|
|
263
277
|
{
|
|
264
278
|
operationType: "Upsert",
|
|
265
|
-
resourceBody: { id: "doc2", name: "other", key: "A" }
|
|
279
|
+
resourceBody: { id: "doc2", name: "other", key: "A" },
|
|
266
280
|
},
|
|
267
281
|
{
|
|
268
282
|
operationType: "Read",
|
|
269
283
|
id: "readItemId",
|
|
270
|
-
partitionKey: "key"
|
|
271
|
-
}
|
|
284
|
+
partitionKey: "key",
|
|
285
|
+
},
|
|
272
286
|
];
|
|
273
287
|
|
|
274
288
|
await database.container.items.bulk(operations);
|
|
@@ -485,14 +499,14 @@ Constructor options have been simplified:
|
|
|
485
499
|
const client = new CosmosClient({
|
|
486
500
|
endpoint: "https://your-database.cosmos.azure.com",
|
|
487
501
|
auth: {
|
|
488
|
-
masterKey: "your-primary-key"
|
|
489
|
-
}
|
|
502
|
+
masterKey: "your-primary-key",
|
|
503
|
+
},
|
|
490
504
|
});
|
|
491
505
|
|
|
492
506
|
// v3
|
|
493
507
|
const client = new CosmosClient({
|
|
494
508
|
endpoint: "https://your-database.cosmos.azure.com",
|
|
495
|
-
key: "your-primary-key"
|
|
509
|
+
key: "your-primary-key",
|
|
496
510
|
});
|
|
497
511
|
```
|
|
498
512
|
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var stableStringify = require('fast-json-stable-stringify');
|
|
|
10
10
|
var PriorityQueue = require('priorityqueuejs');
|
|
11
11
|
var semaphore = require('semaphore');
|
|
12
12
|
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
13
|
+
var identity = require('@azure/identity');
|
|
13
14
|
var nodeAbortController = require('node-abort-controller');
|
|
14
15
|
var universalUserAgent = require('universal-user-agent');
|
|
15
16
|
var JSBI = require('jsbi');
|
|
@@ -179,7 +180,7 @@ const Constants = {
|
|
|
179
180
|
AzureNamespace: "Azure.Cosmos",
|
|
180
181
|
AzurePackageName: "@azure/cosmos",
|
|
181
182
|
SDKName: "azure-cosmos-js",
|
|
182
|
-
SDKVersion: "3.
|
|
183
|
+
SDKVersion: "3.17.0",
|
|
183
184
|
Quota: {
|
|
184
185
|
CollectionSize: "collectionSize",
|
|
185
186
|
},
|
|
@@ -7334,8 +7335,14 @@ async function getHeaders({ clientOptions, defaultHeaders, verb, path, resourceI
|
|
|
7334
7335
|
headers[Constants.HttpHeaders.ConsistencyLevel] = options.consistencyLevel;
|
|
7335
7336
|
}
|
|
7336
7337
|
if (options.maxIntegratedCacheStalenessInMs && resourceType === exports.ResourceType.item) {
|
|
7337
|
-
|
|
7338
|
-
|
|
7338
|
+
if (typeof options.maxIntegratedCacheStalenessInMs === "number") {
|
|
7339
|
+
headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] =
|
|
7340
|
+
options.maxIntegratedCacheStalenessInMs.toString();
|
|
7341
|
+
}
|
|
7342
|
+
else {
|
|
7343
|
+
identity.logger.error(`RangeError: maxIntegratedCacheStalenessInMs "${options.maxIntegratedCacheStalenessInMs}" is not a valid parameter.`);
|
|
7344
|
+
headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] = "null";
|
|
7345
|
+
}
|
|
7339
7346
|
}
|
|
7340
7347
|
if (options.resourceTokenExpirySeconds) {
|
|
7341
7348
|
headers[Constants.HttpHeaders.ResourceTokenExpiry] = options.resourceTokenExpirySeconds;
|