@carto/api-client 0.5.12 → 0.5.14
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 +8 -0
- package/build/api-client.cjs +78 -8
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +28 -9
- package/build/api-client.d.ts +28 -9
- package/build/api-client.js +76 -8
- package/build/api-client.js.map +1 -1
- package/build/worker-compat.js +4 -0
- package/build/worker-compat.js.map +1 -1
- package/build/worker.js +4 -0
- package/build/worker.js.map +1 -1
- package/package.json +3 -3
- package/src/sources/constants.ts +8 -0
- package/src/sources/h3-tileset-source.ts +1 -0
- package/src/sources/index.ts +1 -1
- package/src/sources/quadbin-tileset-source.ts +1 -0
- package/src/sources/raster-source.ts +1 -0
- package/src/sources/types.ts +1 -9
- package/src/sources/vector-tileset-source.ts +1 -0
- package/src/widget-sources/types.ts +7 -0
- package/src/widget-sources/widget-remote-source.ts +64 -0
- package/src/widget-sources/widget-source.ts +5 -0
- package/src/widget-sources/widget-tileset-source-impl.ts +6 -0
- package/src/widget-sources/widget-tileset-source.ts +13 -1
package/build/api-client.d.cts
CHANGED
|
@@ -325,6 +325,15 @@ declare function buildStatsUrl({ attribute, apiBaseUrl, connectionName, source,
|
|
|
325
325
|
type: MapType;
|
|
326
326
|
}): string;
|
|
327
327
|
|
|
328
|
+
declare enum RasterBandColorinterp {
|
|
329
|
+
Gray = "gray",
|
|
330
|
+
Red = "red",
|
|
331
|
+
Green = "green",
|
|
332
|
+
Blue = "blue",
|
|
333
|
+
Alpha = "alpha",
|
|
334
|
+
Palette = "palette"
|
|
335
|
+
}
|
|
336
|
+
|
|
328
337
|
type SourceRequiredOptions = {
|
|
329
338
|
/** Carto platform access token. */
|
|
330
339
|
accessToken: string;
|
|
@@ -624,14 +633,6 @@ type RasterMetadataBandStats = {
|
|
|
624
633
|
*/
|
|
625
634
|
version?: string;
|
|
626
635
|
};
|
|
627
|
-
declare enum RasterBandColorinterp {
|
|
628
|
-
Gray = "gray",
|
|
629
|
-
Red = "red",
|
|
630
|
-
Green = "green",
|
|
631
|
-
Blue = "blue",
|
|
632
|
-
Alpha = "alpha",
|
|
633
|
-
Palette = "palette"
|
|
634
|
-
}
|
|
635
636
|
type RasterBandType = 'uint8' | 'int8' | 'uint16' | 'int16' | 'uint32' | 'int32' | 'uint64' | 'int64' | 'float32' | 'float64';
|
|
636
637
|
type RasterMetadataBand = {
|
|
637
638
|
type: RasterBandType;
|
|
@@ -1340,6 +1341,8 @@ interface TimeSeriesRequestOptions extends BaseRequestOptions {
|
|
|
1340
1341
|
splitByCategoryLimit?: number;
|
|
1341
1342
|
splitByCategoryValues?: string[];
|
|
1342
1343
|
}
|
|
1344
|
+
/** @experimental */
|
|
1345
|
+
type ExtentRequestOptions = BaseRequestOptions;
|
|
1343
1346
|
/******************************************************************************
|
|
1344
1347
|
* WIDGET API RESPONSES
|
|
1345
1348
|
*/
|
|
@@ -1390,6 +1393,10 @@ type TimeSeriesResponse = {
|
|
|
1390
1393
|
};
|
|
1391
1394
|
/** Response from {@link WidgetRemoteSource#getHistogram}. */
|
|
1392
1395
|
type HistogramResponse = number[];
|
|
1396
|
+
/** @experimental */
|
|
1397
|
+
type ExtentResponse = {
|
|
1398
|
+
bbox: BBox;
|
|
1399
|
+
};
|
|
1393
1400
|
|
|
1394
1401
|
interface WidgetSourceProps extends Omit<SourceOptions, 'filters'> {
|
|
1395
1402
|
apiVersion?: ApiVersion;
|
|
@@ -1458,6 +1465,8 @@ declare abstract class WidgetSource<Props extends WidgetSourceProps = WidgetSour
|
|
|
1458
1465
|
* time intervals. Suitable for rendering time series charts.
|
|
1459
1466
|
*/
|
|
1460
1467
|
abstract getTimeSeries(options: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1468
|
+
/** @experimental */
|
|
1469
|
+
abstract getExtent(options?: ExtentRequestOptions): Promise<ExtentResponse>;
|
|
1461
1470
|
}
|
|
1462
1471
|
|
|
1463
1472
|
interface ModelSource {
|
|
@@ -1501,6 +1510,8 @@ declare abstract class WidgetRemoteSource<Props extends WidgetRemoteSourceProps>
|
|
|
1501
1510
|
getScatter(options: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
1502
1511
|
getTable(options: TableRequestOptions): Promise<TableResponse>;
|
|
1503
1512
|
getTimeSeries(options: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1513
|
+
/** @experimental */
|
|
1514
|
+
getExtent(options?: ExtentRequestOptions): Promise<ExtentResponse>;
|
|
1504
1515
|
}
|
|
1505
1516
|
|
|
1506
1517
|
type LayerQuerySourceOptions = Omit<VectorQuerySourceOptions, 'filters'> | Omit<H3QuerySourceOptions, 'filters'> | Omit<QuadbinQuerySourceOptions, 'filters'>;
|
|
@@ -1655,6 +1666,8 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
|
|
|
1655
1666
|
getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
|
|
1656
1667
|
getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1657
1668
|
getRange({ column, filters, filterOwner, spatialFilter, }: RangeRequestOptions): Promise<RangeResponse>;
|
|
1669
|
+
/** @experimental */
|
|
1670
|
+
getExtent(): Promise<ExtentResponse>;
|
|
1658
1671
|
/****************************************************************************
|
|
1659
1672
|
* INTERNAL
|
|
1660
1673
|
*/
|
|
@@ -1664,6 +1677,10 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
|
|
|
1664
1677
|
type WidgetTilesetSourceProps = WidgetSourceProps & Omit<TilesetSourceOptions, 'filters'> & {
|
|
1665
1678
|
tileFormat: TileFormat;
|
|
1666
1679
|
spatialDataType: SpatialDataType;
|
|
1680
|
+
/**
|
|
1681
|
+
* Extent of spatial data, typically from TileJSON. Does not include filters.
|
|
1682
|
+
*/
|
|
1683
|
+
spatialDataBounds: BBox;
|
|
1667
1684
|
};
|
|
1668
1685
|
type WidgetTilesetSourceResult = {
|
|
1669
1686
|
widgetSource: WidgetTilesetSource;
|
|
@@ -1729,6 +1746,8 @@ declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = Widge
|
|
|
1729
1746
|
getTable({ signal, ...options }: TableRequestOptions): Promise<TableResponse>;
|
|
1730
1747
|
getTimeSeries({ signal, ...options }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1731
1748
|
getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
|
|
1749
|
+
/** @experimental */
|
|
1750
|
+
getExtent(): Promise<ExtentResponse>;
|
|
1732
1751
|
}
|
|
1733
1752
|
|
|
1734
1753
|
type WidgetRasterSourceProps = WidgetTilesetSourceProps & {
|
|
@@ -1968,4 +1987,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
1968
1987
|
*/
|
|
1969
1988
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
1970
1989
|
|
|
1971
|
-
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 };
|
|
1990
|
+
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, type ExtentRequestOptions, type ExtentResponse, 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 };
|
package/build/api-client.d.ts
CHANGED
|
@@ -325,6 +325,15 @@ declare function buildStatsUrl({ attribute, apiBaseUrl, connectionName, source,
|
|
|
325
325
|
type: MapType;
|
|
326
326
|
}): string;
|
|
327
327
|
|
|
328
|
+
declare enum RasterBandColorinterp {
|
|
329
|
+
Gray = "gray",
|
|
330
|
+
Red = "red",
|
|
331
|
+
Green = "green",
|
|
332
|
+
Blue = "blue",
|
|
333
|
+
Alpha = "alpha",
|
|
334
|
+
Palette = "palette"
|
|
335
|
+
}
|
|
336
|
+
|
|
328
337
|
type SourceRequiredOptions = {
|
|
329
338
|
/** Carto platform access token. */
|
|
330
339
|
accessToken: string;
|
|
@@ -624,14 +633,6 @@ type RasterMetadataBandStats = {
|
|
|
624
633
|
*/
|
|
625
634
|
version?: string;
|
|
626
635
|
};
|
|
627
|
-
declare enum RasterBandColorinterp {
|
|
628
|
-
Gray = "gray",
|
|
629
|
-
Red = "red",
|
|
630
|
-
Green = "green",
|
|
631
|
-
Blue = "blue",
|
|
632
|
-
Alpha = "alpha",
|
|
633
|
-
Palette = "palette"
|
|
634
|
-
}
|
|
635
636
|
type RasterBandType = 'uint8' | 'int8' | 'uint16' | 'int16' | 'uint32' | 'int32' | 'uint64' | 'int64' | 'float32' | 'float64';
|
|
636
637
|
type RasterMetadataBand = {
|
|
637
638
|
type: RasterBandType;
|
|
@@ -1340,6 +1341,8 @@ interface TimeSeriesRequestOptions extends BaseRequestOptions {
|
|
|
1340
1341
|
splitByCategoryLimit?: number;
|
|
1341
1342
|
splitByCategoryValues?: string[];
|
|
1342
1343
|
}
|
|
1344
|
+
/** @experimental */
|
|
1345
|
+
type ExtentRequestOptions = BaseRequestOptions;
|
|
1343
1346
|
/******************************************************************************
|
|
1344
1347
|
* WIDGET API RESPONSES
|
|
1345
1348
|
*/
|
|
@@ -1390,6 +1393,10 @@ type TimeSeriesResponse = {
|
|
|
1390
1393
|
};
|
|
1391
1394
|
/** Response from {@link WidgetRemoteSource#getHistogram}. */
|
|
1392
1395
|
type HistogramResponse = number[];
|
|
1396
|
+
/** @experimental */
|
|
1397
|
+
type ExtentResponse = {
|
|
1398
|
+
bbox: BBox;
|
|
1399
|
+
};
|
|
1393
1400
|
|
|
1394
1401
|
interface WidgetSourceProps extends Omit<SourceOptions, 'filters'> {
|
|
1395
1402
|
apiVersion?: ApiVersion;
|
|
@@ -1458,6 +1465,8 @@ declare abstract class WidgetSource<Props extends WidgetSourceProps = WidgetSour
|
|
|
1458
1465
|
* time intervals. Suitable for rendering time series charts.
|
|
1459
1466
|
*/
|
|
1460
1467
|
abstract getTimeSeries(options: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1468
|
+
/** @experimental */
|
|
1469
|
+
abstract getExtent(options?: ExtentRequestOptions): Promise<ExtentResponse>;
|
|
1461
1470
|
}
|
|
1462
1471
|
|
|
1463
1472
|
interface ModelSource {
|
|
@@ -1501,6 +1510,8 @@ declare abstract class WidgetRemoteSource<Props extends WidgetRemoteSourceProps>
|
|
|
1501
1510
|
getScatter(options: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
1502
1511
|
getTable(options: TableRequestOptions): Promise<TableResponse>;
|
|
1503
1512
|
getTimeSeries(options: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1513
|
+
/** @experimental */
|
|
1514
|
+
getExtent(options?: ExtentRequestOptions): Promise<ExtentResponse>;
|
|
1504
1515
|
}
|
|
1505
1516
|
|
|
1506
1517
|
type LayerQuerySourceOptions = Omit<VectorQuerySourceOptions, 'filters'> | Omit<H3QuerySourceOptions, 'filters'> | Omit<QuadbinQuerySourceOptions, 'filters'>;
|
|
@@ -1655,6 +1666,8 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
|
|
|
1655
1666
|
getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
|
|
1656
1667
|
getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1657
1668
|
getRange({ column, filters, filterOwner, spatialFilter, }: RangeRequestOptions): Promise<RangeResponse>;
|
|
1669
|
+
/** @experimental */
|
|
1670
|
+
getExtent(): Promise<ExtentResponse>;
|
|
1658
1671
|
/****************************************************************************
|
|
1659
1672
|
* INTERNAL
|
|
1660
1673
|
*/
|
|
@@ -1664,6 +1677,10 @@ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourcePr
|
|
|
1664
1677
|
type WidgetTilesetSourceProps = WidgetSourceProps & Omit<TilesetSourceOptions, 'filters'> & {
|
|
1665
1678
|
tileFormat: TileFormat;
|
|
1666
1679
|
spatialDataType: SpatialDataType;
|
|
1680
|
+
/**
|
|
1681
|
+
* Extent of spatial data, typically from TileJSON. Does not include filters.
|
|
1682
|
+
*/
|
|
1683
|
+
spatialDataBounds: BBox;
|
|
1667
1684
|
};
|
|
1668
1685
|
type WidgetTilesetSourceResult = {
|
|
1669
1686
|
widgetSource: WidgetTilesetSource;
|
|
@@ -1729,6 +1746,8 @@ declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = Widge
|
|
|
1729
1746
|
getTable({ signal, ...options }: TableRequestOptions): Promise<TableResponse>;
|
|
1730
1747
|
getTimeSeries({ signal, ...options }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
1731
1748
|
getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
|
|
1749
|
+
/** @experimental */
|
|
1750
|
+
getExtent(): Promise<ExtentResponse>;
|
|
1732
1751
|
}
|
|
1733
1752
|
|
|
1734
1753
|
type WidgetRasterSourceProps = WidgetTilesetSourceProps & {
|
|
@@ -1968,4 +1987,4 @@ declare function getColumnNameFromGeoColumn(geoColumn: string | null | undefined
|
|
|
1968
1987
|
*/
|
|
1969
1988
|
declare function getSpatialIndexFromGeoColumn(geoColumn: string): SpatialIndex | null;
|
|
1970
1989
|
|
|
1971
|
-
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 };
|
|
1990
|
+
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, type ExtentRequestOptions, type ExtentResponse, 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 };
|
package/build/api-client.js
CHANGED
|
@@ -94,11 +94,11 @@ var FilterType = /* @__PURE__ */ ((FilterType2) => {
|
|
|
94
94
|
FilterType2["STRING_SEARCH"] = "stringSearch";
|
|
95
95
|
return FilterType2;
|
|
96
96
|
})(FilterType || {});
|
|
97
|
-
var ApiVersion = /* @__PURE__ */ ((
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return
|
|
97
|
+
var ApiVersion = /* @__PURE__ */ ((ApiVersion2) => {
|
|
98
|
+
ApiVersion2["V1"] = "v1";
|
|
99
|
+
ApiVersion2["V2"] = "v2";
|
|
100
|
+
ApiVersion2["V3"] = "v3";
|
|
101
|
+
return ApiVersion2;
|
|
102
102
|
})(ApiVersion || {});
|
|
103
103
|
var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
|
|
104
104
|
var TileFormat = /* @__PURE__ */ ((TileFormat2) => {
|
|
@@ -6006,6 +6006,17 @@ async function baseSource(endpoint, options, urlParameters) {
|
|
|
6006
6006
|
return json;
|
|
6007
6007
|
}
|
|
6008
6008
|
|
|
6009
|
+
// src/sources/constants.ts
|
|
6010
|
+
var RasterBandColorinterp = /* @__PURE__ */ ((RasterBandColorinterp2) => {
|
|
6011
|
+
RasterBandColorinterp2["Gray"] = "gray";
|
|
6012
|
+
RasterBandColorinterp2["Red"] = "red";
|
|
6013
|
+
RasterBandColorinterp2["Green"] = "green";
|
|
6014
|
+
RasterBandColorinterp2["Blue"] = "blue";
|
|
6015
|
+
RasterBandColorinterp2["Alpha"] = "alpha";
|
|
6016
|
+
RasterBandColorinterp2["Palette"] = "palette";
|
|
6017
|
+
return RasterBandColorinterp2;
|
|
6018
|
+
})(RasterBandColorinterp || {});
|
|
6019
|
+
|
|
6009
6020
|
// src/sources/boundary-query-source.ts
|
|
6010
6021
|
var boundaryQuerySource = async function(options) {
|
|
6011
6022
|
const {
|
|
@@ -6582,6 +6593,48 @@ var WidgetRemoteSource = class extends WidgetSource {
|
|
|
6582
6593
|
categories: res.metadata?.categories
|
|
6583
6594
|
}));
|
|
6584
6595
|
}
|
|
6596
|
+
/** @experimental */
|
|
6597
|
+
async getExtent(options = {}) {
|
|
6598
|
+
const { signal, filters = this.props.filters, filterOwner } = options;
|
|
6599
|
+
const {
|
|
6600
|
+
type,
|
|
6601
|
+
data,
|
|
6602
|
+
apiBaseUrl,
|
|
6603
|
+
apiVersion,
|
|
6604
|
+
connectionName,
|
|
6605
|
+
spatialDataColumn,
|
|
6606
|
+
spatialDataType,
|
|
6607
|
+
queryParameters
|
|
6608
|
+
} = this.getModelSource(filters, filterOwner);
|
|
6609
|
+
assert2(apiVersion === "v3" /* V3 */, "Stats API requires CARTO 3+");
|
|
6610
|
+
let url;
|
|
6611
|
+
const parameters = { filters, spatialDataType };
|
|
6612
|
+
if (type === "query") {
|
|
6613
|
+
url = `${apiBaseUrl}/${apiVersion}/stats/${connectionName}/${spatialDataColumn}`;
|
|
6614
|
+
parameters.q = data;
|
|
6615
|
+
parameters.queryParameters = queryParameters;
|
|
6616
|
+
} else {
|
|
6617
|
+
url = `${apiBaseUrl}/${apiVersion}/stats/${connectionName}/${data}/${spatialDataColumn}`;
|
|
6618
|
+
}
|
|
6619
|
+
const headers = {
|
|
6620
|
+
Authorization: `Bearer ${this.props.accessToken}`,
|
|
6621
|
+
...this.props.headers
|
|
6622
|
+
};
|
|
6623
|
+
const errorContext = {
|
|
6624
|
+
requestType: "Tile stats",
|
|
6625
|
+
connection: connectionName,
|
|
6626
|
+
type
|
|
6627
|
+
};
|
|
6628
|
+
return requestWithParameters({
|
|
6629
|
+
baseUrl: url,
|
|
6630
|
+
headers,
|
|
6631
|
+
signal,
|
|
6632
|
+
errorContext,
|
|
6633
|
+
parameters
|
|
6634
|
+
}).then(({ extent: { xmin, ymin, xmax, ymax } }) => ({
|
|
6635
|
+
bbox: [xmin, ymin, xmax, ymax]
|
|
6636
|
+
}));
|
|
6637
|
+
}
|
|
6585
6638
|
};
|
|
6586
6639
|
|
|
6587
6640
|
// src/widget-sources/widget-query-source.ts
|
|
@@ -7537,6 +7590,10 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
7537
7590
|
max: aggregationFunctions.max(filteredFeatures, column)
|
|
7538
7591
|
};
|
|
7539
7592
|
}
|
|
7593
|
+
/** @experimental */
|
|
7594
|
+
async getExtent() {
|
|
7595
|
+
return Promise.reject(new Error("not implemented"));
|
|
7596
|
+
}
|
|
7540
7597
|
/****************************************************************************
|
|
7541
7598
|
* INTERNAL
|
|
7542
7599
|
*/
|
|
@@ -7767,6 +7824,12 @@ var WidgetTilesetSource = class extends WidgetSource {
|
|
|
7767
7824
|
}) {
|
|
7768
7825
|
return this._executeWorkerMethod("getRange" /* GET_RANGE */, [options], signal);
|
|
7769
7826
|
}
|
|
7827
|
+
/** @experimental */
|
|
7828
|
+
async getExtent() {
|
|
7829
|
+
return Promise.resolve({
|
|
7830
|
+
bbox: this.props.spatialDataBounds
|
|
7831
|
+
});
|
|
7832
|
+
}
|
|
7770
7833
|
};
|
|
7771
7834
|
|
|
7772
7835
|
// src/widget-sources/widget-raster-source.ts
|
|
@@ -7883,7 +7946,8 @@ var h3TilesetSource = async function(options) {
|
|
|
7883
7946
|
...options,
|
|
7884
7947
|
tileFormat: getTileFormat(result),
|
|
7885
7948
|
spatialDataColumn,
|
|
7886
|
-
spatialDataType: "h3"
|
|
7949
|
+
spatialDataType: "h3",
|
|
7950
|
+
spatialDataBounds: result.bounds
|
|
7887
7951
|
})
|
|
7888
7952
|
})
|
|
7889
7953
|
);
|
|
@@ -7904,6 +7968,7 @@ var rasterSource = async function(options) {
|
|
|
7904
7968
|
tileFormat: getTileFormat(result),
|
|
7905
7969
|
spatialDataColumn: "quadbin",
|
|
7906
7970
|
spatialDataType: "quadbin",
|
|
7971
|
+
spatialDataBounds: result.bounds,
|
|
7907
7972
|
rasterMetadata: result.raster_metadata
|
|
7908
7973
|
})
|
|
7909
7974
|
})
|
|
@@ -8003,7 +8068,8 @@ var quadbinTilesetSource = async function(options) {
|
|
|
8003
8068
|
...options,
|
|
8004
8069
|
tileFormat: getTileFormat(result),
|
|
8005
8070
|
spatialDataColumn,
|
|
8006
|
-
spatialDataType: "quadbin"
|
|
8071
|
+
spatialDataType: "quadbin",
|
|
8072
|
+
spatialDataBounds: result.bounds
|
|
8007
8073
|
})
|
|
8008
8074
|
})
|
|
8009
8075
|
);
|
|
@@ -8104,7 +8170,8 @@ var vectorTilesetSource = async function(options) {
|
|
|
8104
8170
|
...options,
|
|
8105
8171
|
tileFormat: getTileFormat(result),
|
|
8106
8172
|
spatialDataColumn,
|
|
8107
|
-
spatialDataType: "geo"
|
|
8173
|
+
spatialDataType: "geo",
|
|
8174
|
+
spatialDataBounds: result.bounds
|
|
8108
8175
|
})
|
|
8109
8176
|
})
|
|
8110
8177
|
);
|
|
@@ -10163,6 +10230,7 @@ export {
|
|
|
10163
10230
|
OPACITY_MAP,
|
|
10164
10231
|
OTHERS_CATEGORY_NAME,
|
|
10165
10232
|
Provider,
|
|
10233
|
+
RasterBandColorinterp,
|
|
10166
10234
|
SOURCE_DEFAULTS,
|
|
10167
10235
|
SchemaFieldType,
|
|
10168
10236
|
SpatialIndex,
|