@carto/api-client 0.5.6-alpha.bundle.3 → 0.5.6

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/build/worker.js CHANGED
@@ -90,6 +90,14 @@ var SpatialIndexColumn = Object.freeze({
90
90
  ["h3" /* H3 */]: ["h3", "hex", "h3id", "hex_id", "h3hex"],
91
91
  ["quadbin" /* QUADBIN */]: ["quadbin"]
92
92
  });
93
+ var AggregationTypes = {
94
+ Count: "count",
95
+ Avg: "avg",
96
+ Min: "min",
97
+ Max: "max",
98
+ Sum: "sum",
99
+ Custom: "custom"
100
+ };
93
101
 
94
102
  // src/utils.ts
95
103
  var FILTER_TYPES = new Set(Object.values(FilterType));
@@ -6215,7 +6223,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
6215
6223
  }
6216
6224
  async getFormula({
6217
6225
  column = "*",
6218
- operation: operation2 = "count",
6226
+ operation: operation2 = AggregationTypes.Count,
6219
6227
  joinOperation,
6220
6228
  filters,
6221
6229
  filterOwner,
@@ -6226,13 +6234,13 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
6226
6234
  filters,
6227
6235
  filterOwner
6228
6236
  );
6229
- if (filteredFeatures.length === 0 && operation2 !== "count") {
6237
+ if (filteredFeatures.length === 0 && operation2 !== AggregationTypes.Count) {
6230
6238
  return { value: null };
6231
6239
  }
6232
- if (operation2 === "custom") {
6240
+ if (operation2 === AggregationTypes.Custom) {
6233
6241
  throw new Error("Custom aggregation not supported for tilesets");
6234
6242
  }
6235
- if (column && column !== "*" || operation2 !== "count") {
6243
+ if (column && column !== "*" || operation2 !== AggregationTypes.Count) {
6236
6244
  assertColumn(this._features, column);
6237
6245
  }
6238
6246
  const targetOperation = aggregationFunctions[operation2];
@@ -6241,7 +6249,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
6241
6249
  };
6242
6250
  }
6243
6251
  async getHistogram({
6244
- operation: operation2 = "count",
6252
+ operation: operation2 = AggregationTypes.Count,
6245
6253
  ticks,
6246
6254
  column,
6247
6255
  joinOperation,
@@ -6268,7 +6276,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
6268
6276
  }
6269
6277
  async getCategories({
6270
6278
  column,
6271
- operation: operation2 = "count",
6279
+ operation: operation2 = AggregationTypes.Count,
6272
6280
  operationColumn,
6273
6281
  joinOperation,
6274
6282
  filters,