@carto/api-client 0.5.5 → 0.5.6-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.
@@ -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),
@@ -7730,13 +7746,20 @@ var WidgetTilesetSource = class extends WidgetSource {
7730
7746
  if (this._workerImpl) {
7731
7747
  return this._workerImpl;
7732
7748
  }
7733
- this._workerImpl = new Worker(
7734
- new URL("@carto/api-client/worker", importMetaUrl),
7735
- {
7749
+ if (this.props.widgetWorkerUrl) {
7750
+ this._workerImpl = new Worker(this.props.widgetWorkerUrl, {
7736
7751
  type: "module",
7737
7752
  name: "cartowidgettileset"
7738
- }
7739
- );
7753
+ });
7754
+ } else {
7755
+ this._workerImpl = new Worker(
7756
+ new URL("@carto/api-client/worker", importMetaUrl),
7757
+ {
7758
+ type: "module",
7759
+ name: "cartowidgettileset"
7760
+ }
7761
+ );
7762
+ }
7740
7763
  this._workerImpl.postMessage({
7741
7764
  method: "init" /* INIT */,
7742
7765
  params: [this.props]