@carto/api-client 0.5.19 → 0.5.21

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
@@ -4,6 +4,14 @@
4
4
 
5
5
  ## 0.5
6
6
 
7
+ ### 0.5.21
8
+
9
+ - fix(query,fetchMap): Fix queryParameter encoding for POST requests. (#247)
10
+
11
+ ### 0.5.20
12
+
13
+ - fix(fetchMap): support quantile color scale with 2 ranges (#241)
14
+
7
15
  ### 0.5.19
8
16
 
9
17
  - fix(fetchMap): support point radius aggregation (#242)
@@ -8695,7 +8695,7 @@ var query = async function(options) {
8695
8695
  } = options;
8696
8696
  const urlParameters = { q: sqlQuery };
8697
8697
  if (queryParameters) {
8698
- urlParameters.queryParameters = JSON.stringify(queryParameters);
8698
+ urlParameters.queryParameters = queryParameters;
8699
8699
  }
8700
8700
  const baseUrl = buildQueryUrl({ apiBaseUrl, connectionName });
8701
8701
  const headers = {
@@ -9857,7 +9857,13 @@ function domainFromAttribute(attribute, scaleType, scaleLength) {
9857
9857
  return attribute.categories.map((c) => c.category).filter((c) => c !== void 0 && c !== null);
9858
9858
  }
9859
9859
  if (scaleType === "quantile" && attribute.quantiles) {
9860
- return "global" in attribute.quantiles ? attribute.quantiles.global[scaleLength] : attribute.quantiles[scaleLength];
9860
+ const quantiles = "global" in attribute.quantiles ? attribute.quantiles.global : attribute.quantiles;
9861
+ if (scaleLength === 2 && !quantiles[2] && quantiles[4]?.length === 5) {
9862
+ return [quantiles[4][0], quantiles[4][2], quantiles[4][4]];
9863
+ }
9864
+ if (quantiles[scaleLength]) {
9865
+ return quantiles[scaleLength];
9866
+ }
9861
9867
  }
9862
9868
  let { min: min2 } = attribute;
9863
9869
  if (scaleType === "log" && min2 === 0) {
@@ -11212,7 +11218,7 @@ async function _fetchTilestats(attribute, dataset, context) {
11212
11218
  if (type === "query") {
11213
11219
  parameters.q = source;
11214
11220
  if (queryParameters) {
11215
- parameters.queryParameters = JSON.stringify(queryParameters);
11221
+ parameters.queryParameters = queryParameters;
11216
11222
  }
11217
11223
  }
11218
11224
  const stats = await requestWithParameters({