@carto/api-client 0.5.2 → 0.5.4-alpha.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.
@@ -109,6 +109,7 @@ __export(src_exports, {
109
109
  OPACITY_MAP: () => OPACITY_MAP,
110
110
  Provider: () => Provider,
111
111
  SOURCE_DEFAULTS: () => SOURCE_DEFAULTS,
112
+ SchemaFieldType: () => SchemaFieldType,
112
113
  SpatialIndex: () => SpatialIndex,
113
114
  SpatialIndexColumn: () => SpatialIndexColumn,
114
115
  TEXT_LABEL_INDEX: () => TEXT_LABEL_INDEX,
@@ -5704,6 +5705,23 @@ function isValidBandValue(value, nodata) {
5704
5705
 
5705
5706
  // src/utils.ts
5706
5707
  init_cjs_shims();
5708
+
5709
+ // src/types.ts
5710
+ init_cjs_shims();
5711
+ var SchemaFieldType = /* @__PURE__ */ ((SchemaFieldType2) => {
5712
+ SchemaFieldType2["Number"] = "number";
5713
+ SchemaFieldType2["Bigint"] = "bigint";
5714
+ SchemaFieldType2["String"] = "string";
5715
+ SchemaFieldType2["Geometry"] = "geometry";
5716
+ SchemaFieldType2["Timestamp"] = "timestamp";
5717
+ SchemaFieldType2["Object"] = "object";
5718
+ SchemaFieldType2["Boolean"] = "boolean";
5719
+ SchemaFieldType2["Variant"] = "variant";
5720
+ SchemaFieldType2["Unknown"] = "unknown";
5721
+ return SchemaFieldType2;
5722
+ })(SchemaFieldType || {});
5723
+
5724
+ // src/utils.ts
5707
5725
  var FILTER_TYPES = new Set(Object.values(FilterType));
5708
5726
  function normalizeObjectKeys(el) {
5709
5727
  if (Array.isArray(el)) {
@@ -5753,6 +5771,13 @@ function assignOptional(target, ...sources) {
5753
5771
  }
5754
5772
  return target;
5755
5773
  }
5774
+ function getWidgetSpatialDataType(spatialDataType, spatialDataColumn, schema) {
5775
+ const field = schema.find((field2) => field2.name === spatialDataColumn);
5776
+ if (field && field.type === "geometry" /* Geometry */) {
5777
+ return "geo";
5778
+ }
5779
+ return spatialDataType;
5780
+ }
5756
5781
 
5757
5782
  // src/filters/tileFeatures.ts
5758
5783
  function tileFeatures({
@@ -7916,7 +7941,11 @@ var h3QuerySource = async function(options) {
7916
7941
  ...options,
7917
7942
  // NOTE: Parameters with default values above must be explicitly passed here.
7918
7943
  spatialDataColumn,
7919
- spatialDataType
7944
+ spatialDataType: getWidgetSpatialDataType(
7945
+ spatialDataType,
7946
+ spatialDataColumn,
7947
+ result.schema
7948
+ )
7920
7949
  })
7921
7950
  })
7922
7951
  );
@@ -7952,7 +7981,11 @@ var h3TableSource = async function(options) {
7952
7981
  ...options,
7953
7982
  // NOTE: Parameters with default values above must be explicitly passed here.
7954
7983
  spatialDataColumn,
7955
- spatialDataType
7984
+ spatialDataType: getWidgetSpatialDataType(
7985
+ spatialDataType,
7986
+ spatialDataColumn,
7987
+ result.schema
7988
+ )
7956
7989
  })
7957
7990
  })
7958
7991
  );
@@ -8041,7 +8074,11 @@ var quadbinQuerySource = async function(options) {
8041
8074
  ...options,
8042
8075
  // NOTE: Parameters with default values above must be explicitly passed here.
8043
8076
  spatialDataColumn,
8044
- spatialDataType
8077
+ spatialDataType: getWidgetSpatialDataType(
8078
+ spatialDataType,
8079
+ spatialDataColumn,
8080
+ result.schema
8081
+ )
8045
8082
  })
8046
8083
  })
8047
8084
  );
@@ -8077,7 +8114,11 @@ var quadbinTableSource = async function(options) {
8077
8114
  ...options,
8078
8115
  // NOTE: Parameters with default values above must be explicitly passed here.
8079
8116
  spatialDataColumn,
8080
- spatialDataType
8117
+ spatialDataType: getWidgetSpatialDataType(
8118
+ spatialDataType,
8119
+ spatialDataColumn,
8120
+ result.schema
8121
+ )
8081
8122
  })
8082
8123
  })
8083
8124
  );
@@ -10409,6 +10450,7 @@ function _getHexagonResolution(viewport, tileSize) {
10409
10450
  OPACITY_MAP,
10410
10451
  Provider,
10411
10452
  SOURCE_DEFAULTS,
10453
+ SchemaFieldType,
10412
10454
  SpatialIndex,
10413
10455
  SpatialIndexColumn,
10414
10456
  TEXT_LABEL_INDEX,