@carto/api-client 0.5.1 → 0.5.2-alpha.1

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 +194 -84
  2. package/build/api-client.cjs.map +1 -1
  3. package/build/api-client.d.cts +28 -1
  4. package/build/api-client.d.ts +28 -1
  5. package/build/api-client.js +186 -83
  6. package/build/api-client.js.map +1 -1
  7. package/build/worker.js +30 -19
  8. package/build/worker.js.map +1 -1
  9. package/package.json +5 -3
  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 +81 -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 +38 -3
  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 +2 -2
  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 +2 -2
  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 +1 -1
  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 +6 -5
  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 +8 -11
  65. package/src/widget-sources/widget-tileset-source.ts +7 -7
package/build/worker.js CHANGED
@@ -93,23 +93,6 @@ var SpatialIndexColumn = Object.freeze({
93
93
 
94
94
  // src/utils.ts
95
95
  var FILTER_TYPES = new Set(Object.values(FilterType));
96
- var isFilterType = (type) => FILTER_TYPES.has(type);
97
- function getApplicableFilters(owner, filters) {
98
- if (!filters) return {};
99
- const applicableFilters = {};
100
- for (const column in filters) {
101
- for (const type in filters[column]) {
102
- if (!isFilterType(type)) continue;
103
- const filter = filters[column][type];
104
- const isApplicable = !owner || !filter?.owner || filter?.owner !== owner;
105
- if (filter && isApplicable) {
106
- applicableFilters[column] || (applicableFilters[column] = {});
107
- applicableFilters[column][type] = filter;
108
- }
109
- }
110
- }
111
- return applicableFilters;
112
- }
113
96
  function assert(condition, message) {
114
97
  if (!condition) {
115
98
  throw new Error(message);
@@ -5548,7 +5531,11 @@ function min(values, keys, joinOperation) {
5548
5531
  Infinity
5549
5532
  );
5550
5533
  }
5551
- 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;
5552
5539
  }
5553
5540
  function max(values, keys, joinOperation) {
5554
5541
  const normalizedKeys = normalizeKeys(keys);
@@ -5558,7 +5545,11 @@ function max(values, keys, joinOperation) {
5558
5545
  -Infinity
5559
5546
  );
5560
5547
  }
5561
- 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;
5562
5553
  }
5563
5554
  function normalizeKeys(keys) {
5564
5555
  return Array.isArray(keys) ? keys : typeof keys === "string" ? [keys] : void 0;
@@ -6148,6 +6139,26 @@ function booleanEqual(feature1, feature2, options = {}) {
6148
6139
  });
6149
6140
  }
6150
6141
 
6142
+ // src/filters.ts
6143
+ var FILTER_TYPES2 = new Set(Object.values(FilterType));
6144
+ var isFilterType = (type) => FILTER_TYPES2.has(type);
6145
+ function getApplicableFilters(owner, filters) {
6146
+ if (!filters) return {};
6147
+ const applicableFilters = {};
6148
+ for (const column in filters) {
6149
+ for (const type in filters[column]) {
6150
+ if (!isFilterType(type)) continue;
6151
+ const filter = filters[column][type];
6152
+ const isApplicable = !owner || !filter?.owner || filter?.owner !== owner;
6153
+ if (filter && isApplicable) {
6154
+ applicableFilters[column] || (applicableFilters[column] = {});
6155
+ applicableFilters[column][type] = filter;
6156
+ }
6157
+ }
6158
+ }
6159
+ return applicableFilters;
6160
+ }
6161
+
6151
6162
  // src/widget-sources/widget-tileset-source-impl.ts
6152
6163
  var WidgetTilesetSourceImpl = class extends WidgetSource {
6153
6164
  constructor() {