@carto/api-client 0.5.5 → 0.5.6-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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## 0.5
4
4
 
5
+ ### 0.5.6
6
+
7
+ - feat(widgets): WidgetRemoteSource: custom aggregations for category, timeseries models (#174)
8
+
5
9
  ### 0.5.5
6
10
 
7
11
  - feat(fetchmap): Expose legend info from fetchMap (#179)
@@ -6519,7 +6519,10 @@ var WidgetRemoteSource = class extends WidgetSource {
6519
6519
  spatialFiltersMode,
6520
6520
  ...params
6521
6521
  } = options;
6522
- const { column, operation: operation2, operationColumn } = params;
6522
+ const { column, operation: operation2, operationColumn, operationExp } = params;
6523
+ if (operation2 === "custom") {
6524
+ assert2(operationExp, "operationExp is required for custom operation");
6525
+ }
6523
6526
  return executeModel({
6524
6527
  model: "category",
6525
6528
  source: {
@@ -6530,6 +6533,7 @@ var WidgetRemoteSource = class extends WidgetSource {
6530
6533
  params: {
6531
6534
  column,
6532
6535
  operation: operation2,
6536
+ operationExp,
6533
6537
  operationColumn: operationColumn || column
6534
6538
  },
6535
6539
  opts: { signal, headers: this.props.headers }
@@ -6575,6 +6579,9 @@ var WidgetRemoteSource = class extends WidgetSource {
6575
6579
  ...params
6576
6580
  } = options;
6577
6581
  const { column, operation: operation2 } = params;
6582
+ if (operation2 === "custom") {
6583
+ assert2(operationExp, "operationExp is required for custom operation");
6584
+ }
6578
6585
  return executeModel({
6579
6586
  model: "formula",
6580
6587
  source: {
@@ -6713,12 +6720,16 @@ var WidgetRemoteSource = class extends WidgetSource {
6713
6720
  operationColumn,
6714
6721
  joinOperation,
6715
6722
  operation: operation2,
6723
+ operationExp,
6716
6724
  stepSize,
6717
6725
  stepMultiplier,
6718
6726
  splitByCategory,
6719
6727
  splitByCategoryLimit,
6720
6728
  splitByCategoryValues
6721
6729
  } = params;
6730
+ if (operation2 === "custom") {
6731
+ assert2(operationExp, "operationExp is required for custom operation");
6732
+ }
6722
6733
  return executeModel({
6723
6734
  model: "timeseries",
6724
6735
  source: {
@@ -6733,6 +6744,7 @@ var WidgetRemoteSource = class extends WidgetSource {
6733
6744
  operationColumn: operationColumn || column,
6734
6745
  joinOperation,
6735
6746
  operation: operation2,
6747
+ operationExp,
6736
6748
  splitByCategory,
6737
6749
  splitByCategoryLimit,
6738
6750
  splitByCategoryValues
@@ -7641,6 +7653,10 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
7641
7653
  return { rows: [] };
7642
7654
  }
7643
7655
  assertColumn(this._features, column, operationColumn);
7656
+ assert2(
7657
+ operation2 !== "custom",
7658
+ "Custom operation not supported for tilesets"
7659
+ );
7644
7660
  const rows = groupValuesByDateColumn({
7645
7661
  data: filteredFeatures,
7646
7662
  valuesColumns: normalizeColumns(operationColumn || column),