@carto/api-client 0.5.9-alpha.PR193.3 → 0.5.9-alpha.orderby.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.
@@ -388,8 +388,6 @@ type SourceOptionalOptions = {
388
388
  * By default, local in-memory caching is enabled.
389
389
  */
390
390
  localCache?: LocalCacheOptions;
391
- /** Additional tags appended to HTTP requests, available for analytics and audits. */
392
- tags?: Record<string, string>;
393
391
  };
394
392
  type LocalCacheOptions = {
395
393
  /**
@@ -689,26 +687,16 @@ type QueryResult = {
689
687
  }[];
690
688
  };
691
689
 
692
- type QueryOptions = SourceOptions & QuerySourceOptions & {
693
- /**
694
- * @internal
695
- * @experimental
696
- * Used to append additional parameters to the SQL API request for features specific to providers or integrations.
697
- */
698
- internalParameters?: Record<string, string | boolean | number>;
699
- /** Used to abort the request. */
700
- signal?: AbortSignal;
701
- };
690
+ type QueryOptions = SourceOptions & QuerySourceOptions;
702
691
  declare const query: (options: QueryOptions) => Promise<QueryResult>;
703
692
 
704
- declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, signal, }: {
693
+ declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, }: {
705
694
  baseUrl: string;
706
695
  parameters?: Record<string, unknown>;
707
696
  headers?: Record<string, string>;
708
697
  errorContext: APIErrorContext;
709
698
  maxLengthURL?: number;
710
699
  localCache?: LocalCacheOptions;
711
- signal?: AbortSignal;
712
700
  }): Promise<T>;
713
701
  /**
714
702
  * Clears the HTTP response cache for all requests using the default cache.
@@ -1177,6 +1165,7 @@ interface BaseRequestOptions {
1177
1165
  filters?: Filters;
1178
1166
  filterOwner?: string;
1179
1167
  }
1168
+ type CategoryOrderBy = 'frequency_asc' | 'frequency_desc' | 'alphabetical_asc' | 'alphabetical_desc';
1180
1169
  /**
1181
1170
  * Examples:
1182
1171
  * * population by state
@@ -1207,6 +1196,11 @@ interface CategoryRequestOptions extends BaseRequestOptions {
1207
1196
  joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
1208
1197
  /** Calculate `_carto_others` category for all categories after first N (N is threshold). */
1209
1198
  othersThreshold?: number;
1199
+ /**
1200
+ * Order categories by frequency or alphabetically.
1201
+ * @default 'frequency_desc'
1202
+ */
1203
+ orderBy?: CategoryOrderBy;
1210
1204
  /** Return raw result (CategoryResponseRaw). */
1211
1205
  rawResult?: boolean;
1212
1206
  }
@@ -1343,6 +1337,7 @@ type FeaturesResponse = {
1343
1337
  type FormulaResponse = {
1344
1338
  value: number | null;
1345
1339
  };
1340
+ /** Entry in the category widget response, see {@link WidgetRemoteSource#getCategories}. */
1346
1341
  type CategoryResponseEntry = {
1347
1342
  name: string | null;
1348
1343
  value: number;
@@ -1462,7 +1457,6 @@ interface ModelSource {
1462
1457
  spatialDataColumn?: string;
1463
1458
  spatialDataType?: SpatialDataType;
1464
1459
  spatialFiltersMode?: SpatialFilterPolyfillMode;
1465
- tags?: Record<string, string>;
1466
1460
  }
1467
1461
 
1468
1462
  type WidgetRemoteSourceProps = WidgetSourceProps;
@@ -1637,7 +1631,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1637
1631
  getFeatures(): Promise<FeaturesResponse>;
1638
1632
  getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
1639
1633
  getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
1640
- getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
1634
+ getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, orderBy, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
1641
1635
  getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
1642
1636
  getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
1643
1637
  getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
@@ -1843,14 +1837,16 @@ interface SortOptions {
1843
1837
  declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
1844
1838
 
1845
1839
  /** @privateRemarks Source: @carto/react-core */
1846
- declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, }: {
1840
+ declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, orderBy, }: {
1847
1841
  data: FeatureData[];
1848
1842
  valuesColumns?: string[];
1849
1843
  joinOperation?: AggregationType;
1850
1844
  keysColumn: string;
1851
1845
  operation: AggregationType;
1852
1846
  othersThreshold?: number;
1847
+ orderBy?: CategoryOrderBy;
1853
1848
  }): CategoryResponseRaw | null;
1849
+ declare function getSorter(orderBy: CategoryOrderBy): (a: CategoryResponseEntry, b: CategoryResponseEntry) => number;
1854
1850
 
1855
1851
  /** @privateRemarks Source: @carto/react-core */
1856
1852
  type GroupByFeature = {
@@ -1953,4 +1949,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
1953
1949
  */
1954
1950
  declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
1955
1951
 
1956
- export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
1952
+ export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
@@ -388,8 +388,6 @@ type SourceOptionalOptions = {
388
388
  * By default, local in-memory caching is enabled.
389
389
  */
390
390
  localCache?: LocalCacheOptions;
391
- /** Additional tags appended to HTTP requests, available for analytics and audits. */
392
- tags?: Record<string, string>;
393
391
  };
394
392
  type LocalCacheOptions = {
395
393
  /**
@@ -689,26 +687,16 @@ type QueryResult = {
689
687
  }[];
690
688
  };
691
689
 
692
- type QueryOptions = SourceOptions & QuerySourceOptions & {
693
- /**
694
- * @internal
695
- * @experimental
696
- * Used to append additional parameters to the SQL API request for features specific to providers or integrations.
697
- */
698
- internalParameters?: Record<string, string | boolean | number>;
699
- /** Used to abort the request. */
700
- signal?: AbortSignal;
701
- };
690
+ type QueryOptions = SourceOptions & QuerySourceOptions;
702
691
  declare const query: (options: QueryOptions) => Promise<QueryResult>;
703
692
 
704
- declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, signal, }: {
693
+ declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, }: {
705
694
  baseUrl: string;
706
695
  parameters?: Record<string, unknown>;
707
696
  headers?: Record<string, string>;
708
697
  errorContext: APIErrorContext;
709
698
  maxLengthURL?: number;
710
699
  localCache?: LocalCacheOptions;
711
- signal?: AbortSignal;
712
700
  }): Promise<T>;
713
701
  /**
714
702
  * Clears the HTTP response cache for all requests using the default cache.
@@ -1177,6 +1165,7 @@ interface BaseRequestOptions {
1177
1165
  filters?: Filters;
1178
1166
  filterOwner?: string;
1179
1167
  }
1168
+ type CategoryOrderBy = 'frequency_asc' | 'frequency_desc' | 'alphabetical_asc' | 'alphabetical_desc';
1180
1169
  /**
1181
1170
  * Examples:
1182
1171
  * * population by state
@@ -1207,6 +1196,11 @@ interface CategoryRequestOptions extends BaseRequestOptions {
1207
1196
  joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
1208
1197
  /** Calculate `_carto_others` category for all categories after first N (N is threshold). */
1209
1198
  othersThreshold?: number;
1199
+ /**
1200
+ * Order categories by frequency or alphabetically.
1201
+ * @default 'frequency_desc'
1202
+ */
1203
+ orderBy?: CategoryOrderBy;
1210
1204
  /** Return raw result (CategoryResponseRaw). */
1211
1205
  rawResult?: boolean;
1212
1206
  }
@@ -1343,6 +1337,7 @@ type FeaturesResponse = {
1343
1337
  type FormulaResponse = {
1344
1338
  value: number | null;
1345
1339
  };
1340
+ /** Entry in the category widget response, see {@link WidgetRemoteSource#getCategories}. */
1346
1341
  type CategoryResponseEntry = {
1347
1342
  name: string | null;
1348
1343
  value: number;
@@ -1462,7 +1457,6 @@ interface ModelSource {
1462
1457
  spatialDataColumn?: string;
1463
1458
  spatialDataType?: SpatialDataType;
1464
1459
  spatialFiltersMode?: SpatialFilterPolyfillMode;
1465
- tags?: Record<string, string>;
1466
1460
  }
1467
1461
 
1468
1462
  type WidgetRemoteSourceProps = WidgetSourceProps;
@@ -1637,7 +1631,7 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
1637
1631
  getFeatures(): Promise<FeaturesResponse>;
1638
1632
  getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
1639
1633
  getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
1640
- getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
1634
+ getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, othersThreshold, orderBy, rawResult, }: CategoryRequestOptions): Promise<CategoryResponse>;
1641
1635
  getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
1642
1636
  getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
1643
1637
  getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
@@ -1843,14 +1837,16 @@ interface SortOptions {
1843
1837
  declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
1844
1838
 
1845
1839
  /** @privateRemarks Source: @carto/react-core */
1846
- declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, }: {
1840
+ declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, othersThreshold, orderBy, }: {
1847
1841
  data: FeatureData[];
1848
1842
  valuesColumns?: string[];
1849
1843
  joinOperation?: AggregationType;
1850
1844
  keysColumn: string;
1851
1845
  operation: AggregationType;
1852
1846
  othersThreshold?: number;
1847
+ orderBy?: CategoryOrderBy;
1853
1848
  }): CategoryResponseRaw | null;
1849
+ declare function getSorter(orderBy: CategoryOrderBy): (a: CategoryResponseEntry, b: CategoryResponseEntry) => number;
1854
1850
 
1855
1851
  /** @privateRemarks Source: @carto/react-core */
1856
1852
  type GroupByFeature = {
@@ -1953,4 +1949,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
1953
1949
  */
1954
1950
  declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
1955
1951
 
1956
- export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
1952
+ export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, AggregationTypes, ApiVersion, type Attribute, _default as BASEMAP, type BaseRequestOptions, type Basemap, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryOrderBy, type CategoryRequestOptions, type CategoryResponse, type CategoryResponseEntry, type CategoryResponseRaw, CellSet, type ColumnsOption, type D3Scale, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type FetchMapOptions, type FetchMapResult, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, type FilterOptions, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GetFilterOptions, type GoogleBasemap, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type KeplerMapConfig, type Layer, type LayerDescriptor, type LayerType, type MapLibreBasemap, type MapType, type NamedQueryParameter, OPACITY_MAP, OTHERS_CATEGORY_NAME, type ParseMapResult, type PositionalQueryParameter, Provider, type ProviderType, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterBandType, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RasterTile, type RemoveFilterOptions, SOURCE_DEFAULTS, type Scale, type ScaleKey, type ScaleType, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SchemaField, SchemaFieldType, type SortColumnType, type SortDirection, type SourceOptionalOptions, type SourceOptions, type SourceRequiredOptions, type SpatialDataType, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, SpatialIndexColumn, type SpatialIndexTile, type StringSearchOptions, TEXT_LABEL_INDEX, TEXT_NUMBER_FORMATTER, TEXT_OUTLINE_OPACITY, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type Tilejson, type TilejsonResult, type TilesetSourceOptions, type Tilestats, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, domainFromValues as _domainFromValues, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, calculateClusterRadius, calculateClusterTextFontSize, clearDefaultRequestCache, clearFilters, configureSource, createPolygonSpatialFilter, createViewportSpatialFilter, fetchBasemapProps, fetchMap, filterFunctions, geojsonFeatures, getApplicableFilters, getClient, getColorAccessor, getColumnNameFromGeoColumn, getDataFilterExtensionProps, getDefaultAggregationExpColumnAliasForLayerType, getFilter, getIconUrlAccessor, getLayerProps, getMaxMarkerSize, getSizeAccessor, getSorter, getSpatialIndexFromGeoColumn, getTextAccessor, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, negateAccessor, opacityToAlpha, parseMap, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scaleAggregationResLevel, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };
@@ -5839,8 +5839,7 @@ async function requestWithParameters({
5839
5839
  headers: customHeaders = {},
5840
5840
  errorContext,
5841
5841
  maxLengthURL = DEFAULT_MAX_LENGTH_URL,
5842
- localCache,
5843
- signal
5842
+ localCache
5844
5843
  }) {
5845
5844
  parameters = {
5846
5845
  v: V3_MINOR_VERSION,
@@ -5863,9 +5862,8 @@ async function requestWithParameters({
5863
5862
  const fetchPromise = url.length > maxLengthURL ? fetch(baseUrl, {
5864
5863
  method: "POST",
5865
5864
  body: JSON.stringify(parameters),
5866
- headers,
5867
- signal
5868
- }) : fetch(url, { headers, signal });
5865
+ headers
5866
+ }) : fetch(url, { headers });
5869
5867
  let response;
5870
5868
  let responseJson;
5871
5869
  const jsonPromise = fetchPromise.then((_response) => {
@@ -5917,12 +5915,10 @@ function createURLWithParameters(baseUrlString, parameters) {
5917
5915
  if (isPureObject(value) || Array.isArray(value)) {
5918
5916
  baseUrl.searchParams.set(key, JSON.stringify(value));
5919
5917
  } else {
5920
- if (value !== null && value !== void 0) {
5921
- baseUrl.searchParams.set(
5922
- key,
5923
- value.toString()
5924
- );
5925
- }
5918
+ baseUrl.searchParams.set(
5919
+ key,
5920
+ value.toString()
5921
+ );
5926
5922
  }
5927
5923
  }
5928
5924
  return baseUrl.toString();
@@ -5966,7 +5962,7 @@ async function baseSource(endpoint, options, urlParameters) {
5966
5962
  Authorization: `Bearer ${options.accessToken}`,
5967
5963
  ...options.headers
5968
5964
  };
5969
- const parameters = { client: clientId, ...options.tags, ...urlParameters };
5965
+ const parameters = { client: clientId, ...urlParameters };
5970
5966
  const errorContext = {
5971
5967
  requestType: "Map instantiation",
5972
5968
  connection: options.connectionName,
@@ -6168,8 +6164,7 @@ function executeModel(props) {
6168
6164
  filtersLogicalOperator = "and",
6169
6165
  spatialDataType = "geo",
6170
6166
  spatialDataColumn = DEFAULT_GEO_COLUMN,
6171
- spatialFiltersMode = "intersects",
6172
- tags
6167
+ spatialFiltersMode = "intersects"
6173
6168
  } = source;
6174
6169
  const queryParams = {
6175
6170
  type,
@@ -6178,8 +6173,7 @@ function executeModel(props) {
6178
6173
  params,
6179
6174
  queryParameters: source.queryParameters || "",
6180
6175
  filters,
6181
- filtersLogicalOperator,
6182
- ...tags ?? {}
6176
+ filtersLogicalOperator
6183
6177
  };
6184
6178
  queryParams.spatialDataType = spatialDataType;
6185
6179
  queryParams.spatialDataColumn = spatialDataColumn;
@@ -6312,8 +6306,7 @@ var WidgetRemoteSource = class extends WidgetSource {
6312
6306
  filters: getApplicableFilters(filterOwner, filters || props.filters),
6313
6307
  filtersLogicalOperator: props.filtersLogicalOperator,
6314
6308
  spatialDataType: props.spatialDataType,
6315
- spatialDataColumn: props.spatialDataColumn,
6316
- tags: props.tags
6309
+ spatialDataColumn: props.spatialDataColumn
6317
6310
  };
6318
6311
  }
6319
6312
  async getCategories(options) {
@@ -6326,7 +6319,14 @@ var WidgetRemoteSource = class extends WidgetSource {
6326
6319
  rawResult,
6327
6320
  ...params
6328
6321
  } = options;
6329
- const { column, operation: operation2, operationColumn, operationExp, othersThreshold } = params;
6322
+ const {
6323
+ column,
6324
+ operation: operation2,
6325
+ operationColumn,
6326
+ operationExp,
6327
+ othersThreshold,
6328
+ orderBy
6329
+ } = params;
6330
6330
  if (operation2 === AggregationTypes.Custom) {
6331
6331
  assert2(operationExp, "operationExp is required for custom operation");
6332
6332
  }
@@ -6342,7 +6342,8 @@ var WidgetRemoteSource = class extends WidgetSource {
6342
6342
  operation: operation2,
6343
6343
  operationExp,
6344
6344
  operationColumn: operationColumn || column,
6345
- othersThreshold
6345
+ othersThreshold,
6346
+ orderBy
6346
6347
  },
6347
6348
  opts: { signal, headers: this.props.headers }
6348
6349
  });
@@ -6750,7 +6751,8 @@ function groupValuesByColumn({
6750
6751
  joinOperation,
6751
6752
  keysColumn,
6752
6753
  operation: operation2,
6753
- othersThreshold
6754
+ othersThreshold,
6755
+ orderBy = "frequency_desc"
6754
6756
  }) {
6755
6757
  if (Array.isArray(data) && data.length === 0) {
6756
6758
  return { rows: null };
@@ -6774,7 +6776,7 @@ function groupValuesByColumn({
6774
6776
  const allCategories = Array.from(groups).map(([name, value]) => ({
6775
6777
  name,
6776
6778
  value: targetOperation(value)
6777
- })).sort((a, b) => b.value - a.value);
6779
+ })).sort(getSorter(orderBy));
6778
6780
  if (othersThreshold && allCategories.length > othersThreshold) {
6779
6781
  const otherValue = allCategories.slice(othersThreshold).flatMap(({ name }) => groups.get(name));
6780
6782
  return {
@@ -6788,6 +6790,21 @@ function groupValuesByColumn({
6788
6790
  rows: allCategories
6789
6791
  };
6790
6792
  }
6793
+ function getSorter(orderBy) {
6794
+ switch (orderBy) {
6795
+ case "frequency_asc":
6796
+ return (a, b) => a.value - b.value || localeCompare(a.name, b.name);
6797
+ case "frequency_desc":
6798
+ return (a, b) => b.value - a.value || localeCompare(a.name, b.name);
6799
+ case "alphabetical_asc":
6800
+ return (a, b) => localeCompare(a.name, b.name) || b.value - a.value;
6801
+ case "alphabetical_desc":
6802
+ return (a, b) => localeCompare(b.name, a.name) || b.value - a.value;
6803
+ }
6804
+ }
6805
+ function localeCompare(a, b) {
6806
+ return (a ?? "null").localeCompare(b ?? "null");
6807
+ }
6791
6808
 
6792
6809
  // src/utils/dateUtils.ts
6793
6810
  function getUTCMonday(date) {
@@ -7351,6 +7368,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
7351
7368
  filterOwner,
7352
7369
  spatialFilter,
7353
7370
  othersThreshold,
7371
+ orderBy = "frequency_desc",
7354
7372
  rawResult
7355
7373
  }) {
7356
7374
  const filteredFeatures = this._getFilteredFeatures(
@@ -7368,7 +7386,8 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
7368
7386
  joinOperation,
7369
7387
  keysColumn: column,
7370
7388
  operation: operation2,
7371
- othersThreshold
7389
+ othersThreshold,
7390
+ orderBy
7372
7391
  });
7373
7392
  if (rawResult) {
7374
7393
  return result;
@@ -8090,8 +8109,7 @@ var query = async function(options) {
8090
8109
  localCache,
8091
8110
  connectionName,
8092
8111
  sqlQuery,
8093
- queryParameters,
8094
- internalParameters
8112
+ queryParameters
8095
8113
  } = options;
8096
8114
  const urlParameters = { q: sqlQuery };
8097
8115
  if (queryParameters) {
@@ -8102,12 +8120,7 @@ var query = async function(options) {
8102
8120
  Authorization: `Bearer ${options.accessToken}`,
8103
8121
  ...options.headers
8104
8122
  };
8105
- const parameters = {
8106
- client: clientId,
8107
- ...options.tags,
8108
- ...internalParameters,
8109
- ...urlParameters
8110
- };
8123
+ const parameters = { client: clientId, ...urlParameters };
8111
8124
  const errorContext = {
8112
8125
  requestType: "SQL",
8113
8126
  connection: options.connectionName,
@@ -8120,8 +8133,7 @@ var query = async function(options) {
8120
8133
  headers,
8121
8134
  errorContext,
8122
8135
  maxLengthURL,
8123
- localCache,
8124
- signal: options.signal
8136
+ localCache
8125
8137
  });
8126
8138
  };
8127
8139
 
@@ -10183,6 +10195,7 @@ export {
10183
10195
  getLayerProps,
10184
10196
  getMaxMarkerSize,
10185
10197
  getSizeAccessor,
10198
+ getSorter,
10186
10199
  getSpatialIndexFromGeoColumn,
10187
10200
  getTextAccessor,
10188
10201
  groupValuesByColumn,