@azure/cosmos 3.16.4 → 3.17.1-alpha.20220822.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,28 +1,52 @@
1
1
  # Release History
2
2
 
3
- ## 3.16.4 (2022-08-05)
3
+ ## 3.17.1 (Unreleased)
4
+
5
+ ### Features Added
6
+
7
+ ### Breaking Changes
8
+
9
+ ### Bugs Fixed
10
+
11
+ ### Other Changes
12
+
13
+ ## 3.17.0 (2022-08-19)
14
+
15
+ ### Features Added
16
+
17
+ #### GA: Azure Cosmos DB Integrated Cache
18
+
19
+ - Support DedicatedGatewayRequestOptions and MaxIntegratedCacheStaleness [#21240](https://github.com/Azure/azure-sdk-for-js/pull/21240)
20
+ - Upgrade cosmos with azure core tracing [#22284](https://github.com/Azure/azure-sdk-for-js/pull/22284)
21
+ - Removed old logging and implement Azure core logging coverage [#18723](https://github.com/Azure/azure-sdk-for-js/pull/18723?)
4
22
 
5
23
  ### Bugs Fixed
6
- - Reverts changes of [PR 22548](https://github.com/Azure/azure-sdk-for-js/pull/22548) to avoid possible regression when customers use id with special characters and their account is on ComputeGateway already. - See [PR 22818](https://github.com/Azure/azure-sdk-for-js/pull/22818)
24
+
25
+ - ParallelQueryExecutionContextBase breaks use of abortSignal [#18544](https://github.com/Azure/azure-sdk-for-js/pull/18544)
26
+ - Fixes id encoding issues when using special characters fo RoutingGateway
7
27
 
8
28
  ## 3.16.3 (2022-07-13)
9
29
 
10
30
  ### Bugs Fixed
11
- - 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)
31
+
32
+ - 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
33
 
13
34
  ## 3.16.2 (2022-06-24)
14
35
 
15
36
  ### Bugs Fixed
16
- - 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)
37
+
38
+ - 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
39
 
18
40
  ## 3.16.1 (2022-05-31)
19
41
 
20
42
  ### Bugs Fixed
43
+
21
44
  - 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
45
 
23
46
  ## 3.16.0 (2022-05-23)
24
47
 
25
48
  ### Features Added
49
+
26
50
  - Allow users like cosmos-explorer to specify hierarchical partition keys. https://github.com/Azure/azure-sdk-for-js/pull/21934
27
51
  - Support Dedicated Gateway RequestOptions and Max Integrated Cache Staleness. https://github.com/Azure/azure-sdk-for-js/pull/21240
28
52
 
@@ -112,8 +136,8 @@ const client = new CosmosClient({
112
136
  connectionPolicy: {
113
137
  ...defaultConnectionPolicy,
114
138
  endpointRefreshRateInMs: 700,
115
- enableBackgroundEndpointRefreshing: true
116
- }
139
+ enableBackgroundEndpointRefreshing: true,
140
+ },
117
141
  });
118
142
  ```
119
143
 
@@ -258,17 +282,17 @@ database.container.create(containerDefinition)
258
282
  const operations: OperationInput[] = [
259
283
  {
260
284
  operationType: "Create",
261
- resourceBody: { id: "doc1", name: "sample", key: "A" }
285
+ resourceBody: { id: "doc1", name: "sample", key: "A" },
262
286
  },
263
287
  {
264
288
  operationType: "Upsert",
265
- resourceBody: { id: "doc2", name: "other", key: "A" }
289
+ resourceBody: { id: "doc2", name: "other", key: "A" },
266
290
  },
267
291
  {
268
292
  operationType: "Read",
269
293
  id: "readItemId",
270
- partitionKey: "key"
271
- }
294
+ partitionKey: "key",
295
+ },
272
296
  ];
273
297
 
274
298
  await database.container.items.bulk(operations);
@@ -485,14 +509,14 @@ Constructor options have been simplified:
485
509
  const client = new CosmosClient({
486
510
  endpoint: "https://your-database.cosmos.azure.com",
487
511
  auth: {
488
- masterKey: "your-primary-key"
489
- }
512
+ masterKey: "your-primary-key",
513
+ },
490
514
  });
491
515
 
492
516
  // v3
493
517
  const client = new CosmosClient({
494
518
  endpoint: "https://your-database.cosmos.azure.com",
495
- key: "your-primary-key"
519
+ key: "your-primary-key",
496
520
  });
497
521
  ```
498
522
 
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.16.4",
183
+ SDKVersion: "3.17.1",
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
- headers[Constants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness] =
7338
- options.maxIntegratedCacheStalenessInMs;
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;