@carto/api-client 0.5.2-alpha.1 → 0.5.2-alpha.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.
@@ -11525,7 +11525,7 @@ async function baseSource(endpoint, options, urlParameters) {
11525
11525
  type: endpoint,
11526
11526
  source: JSON.stringify(parameters, void 0, 2)
11527
11527
  };
11528
- const mapInstantiation = await requestWithParameters({
11528
+ const { tilejson, schema } = await requestWithParameters({
11529
11529
  baseUrl,
11530
11530
  parameters,
11531
11531
  headers,
@@ -11533,7 +11533,7 @@ async function baseSource(endpoint, options, urlParameters) {
11533
11533
  maxLengthURL,
11534
11534
  localCache
11535
11535
  });
11536
- const dataUrl = mapInstantiation.tilejson.url[0];
11536
+ const dataUrl = tilejson.url[0];
11537
11537
  if (cache) {
11538
11538
  cache.value = parseInt(
11539
11539
  new URL(dataUrl).searchParams.get("cache") || "",
@@ -11552,6 +11552,9 @@ async function baseSource(endpoint, options, urlParameters) {
11552
11552
  if (accessToken) {
11553
11553
  json.accessToken = accessToken;
11554
11554
  }
11555
+ if (schema) {
11556
+ json.schema = schema;
11557
+ }
11555
11558
  return json;
11556
11559
  }
11557
11560
 
@@ -14825,10 +14828,10 @@ function calculateClusterRadius(properties, stats, radiusRange, column) {
14825
14828
  const normalizedValue = (value - min3) / (max3 - min3);
14826
14829
  return radiusRange[0] + normalizedValue * (radiusRange[1] - radiusRange[0]);
14827
14830
  }
14828
- function getDefaultAggregationExpColumnAliasForLayerType(layerType, provider, columns) {
14829
- if (columns && layerType === "clusterTile") {
14831
+ function getDefaultAggregationExpColumnAliasForLayerType(layerType, provider, schema) {
14832
+ if (schema && layerType === "clusterTile") {
14830
14833
  return getColumnAliasForAggregationExp(
14831
- getDefaultColumnFromSchemaForAggregationExp(columns),
14834
+ getDefaultColumnFromSchemaForAggregationExp(schema),
14832
14835
  "count",
14833
14836
  provider
14834
14837
  );
@@ -14840,8 +14843,8 @@ function getColumnAliasForAggregationExp(name, aggregation, provider) {
14840
14843
  const columnAlias = `${name}_${aggregation}`;
14841
14844
  return provider === "snowflake" ? columnAlias.toUpperCase() : columnAlias;
14842
14845
  }
14843
- function getDefaultColumnFromSchemaForAggregationExp(columns) {
14844
- return columns ? columns[0] : "";
14846
+ function getDefaultColumnFromSchemaForAggregationExp(schema) {
14847
+ return schema ? schema[0].name : "";
14845
14848
  }
14846
14849
  function calculateClusterTextFontSize(radius) {
14847
14850
  if (radius >= 80) return 24;
@@ -15038,7 +15041,7 @@ function createChannelProps(id, type, config2, visualChannels, data, dataset) {
15038
15041
  const aggregationExpAlias = getDefaultAggregationExpColumnAliasForLayerType(
15039
15042
  type,
15040
15043
  dataset.providerId,
15041
- dataset.columns
15044
+ data.schema
15042
15045
  );
15043
15046
  result.pointType = visConfig.isTextVisible ? "circle+text" : "circle";
15044
15047
  result.clusterLevel = visConfig.clusterLevel;