@carto/api-client 0.5.2-alpha.0 → 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.
Files changed (65) hide show
  1. package/build/api-client.cjs +125 -14
  2. package/build/api-client.cjs.map +1 -1
  3. package/build/api-client.d.cts +47 -1
  4. package/build/api-client.d.ts +47 -1
  5. package/build/api-client.js +119 -14
  6. package/build/api-client.js.map +1 -1
  7. package/build/worker.js +28 -19
  8. package/build/worker.js.map +1 -1
  9. package/package.json +5 -4
  10. package/src/api/carto-api-error.ts +1 -1
  11. package/src/api/endpoints.ts +1 -1
  12. package/src/api/index.ts +2 -2
  13. package/src/api/query.ts +1 -1
  14. package/src/api/request-with-parameters.ts +2 -2
  15. package/src/deck/get-data-filter-extension-props.ts +3 -3
  16. package/src/fetch-map/basemap-styles.ts +2 -2
  17. package/src/fetch-map/basemap.ts +2 -2
  18. package/src/fetch-map/fetch-map.ts +3 -3
  19. package/src/fetch-map/layer-map.ts +82 -5
  20. package/src/fetch-map/parse-map.ts +71 -7
  21. package/src/fetch-map/source.ts +10 -10
  22. package/src/fetch-map/types.ts +7 -3
  23. package/src/filters/Filter.ts +4 -4
  24. package/src/filters/FilterTypes.ts +1 -1
  25. package/src/filters/geosjonFeatures.ts +3 -3
  26. package/src/filters/tileFeatures.ts +8 -3
  27. package/src/filters/tileFeaturesGeometries.ts +5 -5
  28. package/src/filters/tileFeaturesRaster.ts +3 -3
  29. package/src/filters/tileFeaturesSpatialIndex.ts +4 -4
  30. package/src/filters.ts +1 -1
  31. package/src/geo.ts +1 -1
  32. package/src/index.ts +3 -3
  33. package/src/models/model.ts +6 -3
  34. package/src/operations/aggregation.ts +14 -4
  35. package/src/operations/applySorting.ts +2 -2
  36. package/src/operations/groupBy.ts +2 -2
  37. package/src/operations/groupByDate.ts +2 -2
  38. package/src/operations/histogram.ts +2 -2
  39. package/src/operations/scatterPlot.ts +2 -2
  40. package/src/sources/base-source.ts +7 -4
  41. package/src/sources/boundary-query-source.ts +1 -1
  42. package/src/sources/h3-query-source.ts +1 -1
  43. package/src/sources/h3-table-source.ts +1 -1
  44. package/src/sources/h3-tileset-source.ts +1 -1
  45. package/src/sources/quadbin-query-source.ts +1 -1
  46. package/src/sources/quadbin-table-source.ts +1 -1
  47. package/src/sources/quadbin-tileset-source.ts +1 -1
  48. package/src/sources/raster-source.ts +1 -1
  49. package/src/sources/types.ts +7 -3
  50. package/src/sources/vector-query-source.ts +1 -1
  51. package/src/sources/vector-table-source.ts +1 -1
  52. package/src/sources/vector-tileset-source.ts +1 -1
  53. package/src/utils/getTileFormat.ts +1 -1
  54. package/src/utils/makeIntervalComplete.ts +1 -1
  55. package/src/utils/transformTileCoordsToWGS84.ts +1 -1
  56. package/src/utils/transformToTileCoords.ts +1 -1
  57. package/src/utils.ts +35 -0
  58. package/src/widget-sources/types.ts +5 -2
  59. package/src/widget-sources/widget-query-source.ts +4 -4
  60. package/src/widget-sources/widget-raster-source.ts +2 -2
  61. package/src/widget-sources/widget-remote-source.ts +4 -4
  62. package/src/widget-sources/widget-source.ts +3 -3
  63. package/src/widget-sources/widget-table-source.ts +4 -4
  64. package/src/widget-sources/widget-tileset-source-impl.ts +6 -5
  65. package/src/widget-sources/widget-tileset-source.ts +7 -7
package/build/worker.js CHANGED
@@ -76,7 +76,23 @@ var require_thenBy_module = __commonJS({
76
76
  }
77
77
  });
78
78
 
79
+ // src/constants.ts
80
+ var FilterType = /* @__PURE__ */ ((FilterType2) => {
81
+ FilterType2["IN"] = "in";
82
+ FilterType2["BETWEEN"] = "between";
83
+ FilterType2["CLOSED_OPEN"] = "closed_open";
84
+ FilterType2["TIME"] = "time";
85
+ FilterType2["STRING_SEARCH"] = "stringSearch";
86
+ return FilterType2;
87
+ })(FilterType || {});
88
+ var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
89
+ var SpatialIndexColumn = Object.freeze({
90
+ ["h3" /* H3 */]: ["h3", "hex", "h3id", "hex_id", "h3hex"],
91
+ ["quadbin" /* QUADBIN */]: ["quadbin"]
92
+ });
93
+
79
94
  // src/utils.ts
95
+ var FILTER_TYPES = new Set(Object.values(FilterType));
80
96
  function assert(condition, message) {
81
97
  if (!condition) {
82
98
  throw new Error(message);
@@ -104,21 +120,6 @@ function assignOptional(target, ...sources) {
104
120
  return target;
105
121
  }
106
122
 
107
- // src/constants.ts
108
- var FilterType = /* @__PURE__ */ ((FilterType2) => {
109
- FilterType2["IN"] = "in";
110
- FilterType2["BETWEEN"] = "between";
111
- FilterType2["CLOSED_OPEN"] = "closed_open";
112
- FilterType2["TIME"] = "time";
113
- FilterType2["STRING_SEARCH"] = "stringSearch";
114
- return FilterType2;
115
- })(FilterType || {});
116
- var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
117
- var SpatialIndexColumn = Object.freeze({
118
- ["h3" /* H3 */]: ["h3", "hex", "h3id", "hex_id", "h3hex"],
119
- ["quadbin" /* QUADBIN */]: ["quadbin"]
120
- });
121
-
122
123
  // src/utils/makeIntervalComplete.ts
123
124
  function makeIntervalComplete(intervals) {
124
125
  return intervals.map((val) => {
@@ -5530,7 +5531,11 @@ function min(values, keys, joinOperation) {
5530
5531
  Infinity
5531
5532
  );
5532
5533
  }
5533
- return Math.min(...values);
5534
+ let min2 = Number.POSITIVE_INFINITY;
5535
+ for (const value of values) {
5536
+ min2 = Math.min(min2, value);
5537
+ }
5538
+ return min2;
5534
5539
  }
5535
5540
  function max(values, keys, joinOperation) {
5536
5541
  const normalizedKeys = normalizeKeys(keys);
@@ -5540,7 +5545,11 @@ function max(values, keys, joinOperation) {
5540
5545
  -Infinity
5541
5546
  );
5542
5547
  }
5543
- return Math.max(...values);
5548
+ let max2 = Number.NEGATIVE_INFINITY;
5549
+ for (const value of values) {
5550
+ max2 = Math.max(max2, value);
5551
+ }
5552
+ return max2;
5544
5553
  }
5545
5554
  function normalizeKeys(keys) {
5546
5555
  return Array.isArray(keys) ? keys : typeof keys === "string" ? [keys] : void 0;
@@ -6131,8 +6140,8 @@ function booleanEqual(feature1, feature2, options = {}) {
6131
6140
  }
6132
6141
 
6133
6142
  // src/filters.ts
6134
- var FILTER_TYPES = new Set(Object.values(FilterType));
6135
- var isFilterType = (type) => FILTER_TYPES.has(type);
6143
+ var FILTER_TYPES2 = new Set(Object.values(FilterType));
6144
+ var isFilterType = (type) => FILTER_TYPES2.has(type);
6136
6145
  function getApplicableFilters(owner, filters) {
6137
6146
  if (!filters) return {};
6138
6147
  const applicableFilters = {};