@carto/api-client 0.5.0-alpha.3 → 0.5.0-alpha.4
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 +4 -0
- package/build/api/carto-api-error.d.ts +1 -1
- package/build/api/query.d.ts +1 -1
- package/build/api/request-with-parameters.d.ts +2 -2
- package/build/api-client.cjs +2324 -2188
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.modern.js +2196 -2055
- package/build/api-client.modern.js.map +1 -1
- package/build/client.d.ts +2 -2
- package/build/constants-internal.d.ts +5 -5
- package/build/constants.d.ts +6 -6
- package/build/deck/get-data-filter-extension-props.d.ts +18 -0
- package/build/deck/index.d.ts +1 -0
- package/build/filters/Filter.d.ts +15 -3
- package/build/filters/FilterTypes.d.ts +1 -1
- package/build/filters/geosjonFeatures.d.ts +2 -2
- package/build/filters/tileFeatures.d.ts +8 -8
- package/build/filters/tileFeaturesRaster.d.ts +3 -3
- package/build/filters.d.ts +2 -2
- package/build/geo.d.ts +1 -1
- package/build/index.d.ts +1 -0
- package/build/models/common.d.ts +4 -3
- package/build/models/model.d.ts +2 -2
- package/build/operations/aggregation.d.ts +5 -5
- package/build/operations/applySorting.d.ts +3 -3
- package/build/operations/groupBy.d.ts +4 -4
- package/build/operations/groupByDate.d.ts +1 -1
- package/build/operations/histogram.d.ts +3 -3
- package/build/operations/scatterPlot.d.ts +3 -3
- package/build/sources/base-source.d.ts +2 -2
- package/build/sources/boundary-query-source.d.ts +1 -1
- package/build/sources/boundary-table-source.d.ts +1 -1
- package/build/sources/h3-query-source.d.ts +2 -2
- package/build/sources/h3-table-source.d.ts +2 -2
- package/build/sources/h3-tileset-source.d.ts +2 -2
- package/build/sources/index.d.ts +26 -26
- package/build/sources/quadbin-query-source.d.ts +2 -2
- package/build/sources/quadbin-table-source.d.ts +2 -2
- package/build/sources/quadbin-tileset-source.d.ts +2 -2
- package/build/sources/raster-source.d.ts +2 -2
- package/build/sources/types.d.ts +3 -3
- package/build/sources/vector-query-source.d.ts +1 -1
- package/build/sources/vector-table-source.d.ts +1 -1
- package/build/sources/vector-tileset-source.d.ts +2 -2
- package/build/spatial-index.d.ts +3 -3
- package/build/types-internal.d.ts +5 -5
- package/build/types.d.ts +15 -15
- package/build/utils/makeIntervalComplete.d.ts +1 -1
- package/build/utils.d.ts +3 -3
- package/build/widget-sources/types.d.ts +4 -2
- package/build/widget-sources/widget-query-source.d.ts +2 -1
- package/build/widget-sources/widget-remote-source.d.ts +3 -0
- package/build/widget-sources/widget-source.d.ts +3 -3
- package/build/widget-sources/widget-table-source.d.ts +2 -1
- package/build/widget-sources/widget-tileset-source.d.ts +22 -24
- package/package.json +36 -30
- package/src/api/carto-api-error.ts +1 -1
- package/src/api/query.ts +5 -5
- package/src/api/request-with-parameters.ts +6 -6
- package/src/client.ts +3 -3
- package/src/constants-internal.ts +5 -5
- package/src/constants.ts +6 -6
- package/src/deck/get-data-filter-extension-props.ts +146 -0
- package/src/deck/index.ts +1 -0
- package/src/filters/Filter.ts +18 -8
- package/src/filters/FilterTypes.ts +2 -2
- package/src/filters/geosjonFeatures.ts +2 -2
- package/src/filters/tileFeatures.ts +13 -19
- package/src/filters/tileFeaturesRaster.ts +7 -7
- package/src/filters.ts +4 -4
- package/src/geo.ts +12 -14
- package/src/index.ts +1 -0
- package/src/models/common.ts +9 -7
- package/src/models/model.ts +3 -4
- package/src/operations/aggregation.ts +5 -5
- package/src/operations/applySorting.ts +4 -4
- package/src/operations/groupBy.ts +4 -4
- package/src/operations/groupByDate.ts +1 -1
- package/src/operations/histogram.ts +4 -4
- package/src/operations/scatterPlot.ts +4 -4
- package/src/sources/base-source.ts +8 -8
- package/src/sources/boundary-query-source.ts +2 -2
- package/src/sources/boundary-table-source.ts +2 -2
- package/src/sources/h3-query-source.ts +7 -5
- package/src/sources/h3-table-source.ts +7 -5
- package/src/sources/h3-tileset-source.ts +4 -4
- package/src/sources/index.ts +26 -26
- package/src/sources/quadbin-query-source.ts +7 -5
- package/src/sources/quadbin-table-source.ts +7 -5
- package/src/sources/quadbin-tileset-source.ts +4 -4
- package/src/sources/raster-source.ts +8 -4
- package/src/sources/types.ts +3 -3
- package/src/sources/vector-query-source.ts +2 -3
- package/src/sources/vector-table-source.ts +2 -3
- package/src/sources/vector-tileset-source.ts +5 -5
- package/src/spatial-index.ts +4 -4
- package/src/types-internal.ts +5 -5
- package/src/types.ts +15 -15
- package/src/utils/makeIntervalComplete.ts +1 -1
- package/src/utils.ts +3 -3
- package/src/widget-sources/types.ts +5 -3
- package/src/widget-sources/widget-query-source.ts +6 -2
- package/src/widget-sources/widget-remote-source.ts +31 -16
- package/src/widget-sources/widget-source.ts +13 -4
- package/src/widget-sources/widget-table-source.ts +6 -2
- package/src/widget-sources/widget-tileset-source.ts +132 -81
package/build/types.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import type { BinaryFeature, BinaryFeatureCollection } from '@loaders.gl/schema'
|
|
|
4
4
|
/******************************************************************************
|
|
5
5
|
* MAPS AND TILES
|
|
6
6
|
*/
|
|
7
|
-
/** @
|
|
7
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
8
8
|
export type Format = 'json' | 'geojson' | 'tilejson';
|
|
9
|
-
/** @
|
|
9
|
+
/** @privateRemarks Source: @carto/constants, @deck.gl/carto */
|
|
10
10
|
export type MapType = 'boundary' | 'query' | 'table' | 'tileset' | 'raster';
|
|
11
11
|
/**
|
|
12
12
|
* Alias for GeoJSON 'BBox' type, semantically representing a viewport.
|
|
@@ -18,7 +18,7 @@ export type Viewport = [number, number, number, number];
|
|
|
18
18
|
* required for local widget calculations. Deeper dependencies on deck.gl
|
|
19
19
|
* APIs should be minimized within this library: @deck.gl/carto depends
|
|
20
20
|
* on the API client, not the other way around.
|
|
21
|
-
* @
|
|
21
|
+
* @privateRemarks Source: @deck.gl/geo-layers
|
|
22
22
|
*/
|
|
23
23
|
export type Tile = {
|
|
24
24
|
index: {
|
|
@@ -52,7 +52,7 @@ export type RasterTile = Tile & {
|
|
|
52
52
|
};
|
|
53
53
|
data?: Raster;
|
|
54
54
|
};
|
|
55
|
-
/** @
|
|
55
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
56
56
|
export type Raster = {
|
|
57
57
|
blockSize: number;
|
|
58
58
|
cells: {
|
|
@@ -66,20 +66,20 @@ export type Raster = {
|
|
|
66
66
|
/**
|
|
67
67
|
* Enum for the different types of aggregations available for widgets.
|
|
68
68
|
*
|
|
69
|
-
* @
|
|
70
|
-
* @
|
|
69
|
+
* @privateRemarks Source: @carto/constants
|
|
70
|
+
* @privateRemarks Converted from enum to type union, for improved declarative API.
|
|
71
71
|
*/
|
|
72
72
|
export type AggregationType = 'count' | 'avg' | 'min' | 'max' | 'sum' | 'custom';
|
|
73
73
|
/******************************************************************************
|
|
74
74
|
* FILTERS
|
|
75
75
|
*/
|
|
76
|
-
/** @
|
|
76
|
+
/** @privateRemarks Source: @carto/react-api */
|
|
77
77
|
export type SpatialFilter = Polygon | MultiPolygon;
|
|
78
|
-
/** @
|
|
78
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
79
79
|
export interface Filters {
|
|
80
80
|
[column: string]: Filter;
|
|
81
81
|
}
|
|
82
|
-
/** @
|
|
82
|
+
/** @privateRemarks Source: @carto/react-api, @deck.gl/carto */
|
|
83
83
|
export interface Filter {
|
|
84
84
|
[FilterType.IN]?: {
|
|
85
85
|
owner?: string;
|
|
@@ -105,7 +105,7 @@ export interface Filter {
|
|
|
105
105
|
params?: StringSearchOptions;
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
/** @
|
|
108
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
109
109
|
export type FilterLogicalOperator = 'and' | 'or';
|
|
110
110
|
/**
|
|
111
111
|
* Type for minimum or maximum value of an interval. Values 'null' and
|
|
@@ -127,7 +127,7 @@ export type StringSearchOptions = {
|
|
|
127
127
|
/**
|
|
128
128
|
* Defines a step size increment for use with {@link TimeSeriesRequestOptions}.
|
|
129
129
|
*
|
|
130
|
-
* @
|
|
130
|
+
* @privateRemarks Source: @carto/react-core
|
|
131
131
|
*/
|
|
132
132
|
export type GroupDateType = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
|
|
133
133
|
/******************************************************************************
|
|
@@ -138,11 +138,11 @@ export type SortColumnType = 'number' | 'string' | 'date';
|
|
|
138
138
|
/******************************************************************************
|
|
139
139
|
* SQL QUERY PARAMETERS
|
|
140
140
|
*/
|
|
141
|
-
/** @
|
|
141
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
142
142
|
export type QueryParameterValue = string | number | boolean | Array<QueryParameterValue> | object;
|
|
143
|
-
/** @
|
|
143
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
144
144
|
export type NamedQueryParameter = Record<string, QueryParameterValue>;
|
|
145
|
-
/** @
|
|
145
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
146
146
|
export type PositionalQueryParameter = QueryParameterValue[];
|
|
147
|
-
/** @
|
|
147
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
148
148
|
export type QueryParameters = NamedQueryParameter | PositionalQueryParameter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FilterInterval, FilterIntervalComplete } from '../types';
|
|
1
|
+
import { FilterInterval, FilterIntervalComplete } from '../types.js';
|
|
2
2
|
export declare function makeIntervalComplete(intervals: FilterInterval[]): FilterIntervalComplete[];
|
package/build/utils.d.ts
CHANGED
|
@@ -9,14 +9,14 @@ type Row<T> = Record<string, T> | Record<string, T>[] | T[] | T;
|
|
|
9
9
|
* Due to each data warehouse having its own behavior with columns,
|
|
10
10
|
* we need to normalize them and transform every key to lowercase.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @privateRemarks Source: @carto/react-widgets
|
|
13
13
|
* @internal
|
|
14
14
|
*/
|
|
15
15
|
export declare function normalizeObjectKeys<T, R extends Row<T>>(el: R): R;
|
|
16
|
-
/** @
|
|
16
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
17
17
|
export declare function assert(condition: unknown, message: string): asserts condition;
|
|
18
18
|
/**
|
|
19
|
-
* @
|
|
19
|
+
* @privateRemarks Source: @carto/react-core
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
22
|
export declare class InvalidColumnError extends Error {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SpatialFilterPolyfillMode, TileResolution } from '../sources/types';
|
|
2
|
-
import { GroupDateType, SortColumnType, SortDirection, SpatialFilter } from '../types';
|
|
1
|
+
import { SpatialFilterPolyfillMode, TileResolution } from '../sources/types.js';
|
|
2
|
+
import { Filters, GroupDateType, SortColumnType, SortDirection, SpatialFilter } from '../types.js';
|
|
3
3
|
/******************************************************************************
|
|
4
4
|
* WIDGET API REQUESTS
|
|
5
5
|
*/
|
|
@@ -15,6 +15,8 @@ interface BaseRequestOptions {
|
|
|
15
15
|
/** Required for table- and query-based spatial index sources (H3, Quadbin). */
|
|
16
16
|
spatialIndexReferenceViewState?: ViewState;
|
|
17
17
|
abortController?: AbortController;
|
|
18
|
+
/** Overrides source filters, if any. */
|
|
19
|
+
filters?: Filters;
|
|
18
20
|
filterOwner?: string;
|
|
19
21
|
}
|
|
20
22
|
/** Options for {@link WidgetRemoteSource#getCategories}. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { H3QuerySourceOptions, QuadbinQuerySourceOptions, VectorQuerySourceOptions } from '../sources/index.js';
|
|
2
2
|
import { WidgetRemoteSource, WidgetRemoteSourceProps } from './widget-remote-source.js';
|
|
3
3
|
import { ModelSource } from '../models/model.js';
|
|
4
|
+
import { Filters } from '../types.js';
|
|
4
5
|
type LayerQuerySourceOptions = Omit<VectorQuerySourceOptions, 'filters'> | Omit<H3QuerySourceOptions, 'filters'> | Omit<QuadbinQuerySourceOptions, 'filters'>;
|
|
5
6
|
export type WidgetQuerySourceResult = {
|
|
6
7
|
widgetSource: WidgetQuerySource;
|
|
@@ -28,6 +29,6 @@ export type WidgetQuerySourceResult = {
|
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
export declare class WidgetQuerySource extends WidgetRemoteSource<LayerQuerySourceOptions & WidgetRemoteSourceProps> {
|
|
31
|
-
protected getModelSource(
|
|
32
|
+
protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
|
|
32
33
|
}
|
|
33
34
|
export {};
|
|
@@ -7,6 +7,9 @@ export type WidgetRemoteSourceProps = WidgetSourceProps;
|
|
|
7
7
|
* Abstract class. Use {@link WidgetQuerySource} or {@link WidgetTableSource}.
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class WidgetRemoteSource<Props extends WidgetRemoteSourceProps> extends WidgetSource<Props> {
|
|
10
|
+
protected _headers: Record<string, string>;
|
|
11
|
+
/** Assigns HTTP headers to be included on API requests from this source. */
|
|
12
|
+
setRequestHeaders(headers: Record<string, string>): void;
|
|
10
13
|
getCategories(options: CategoryRequestOptions): Promise<CategoryResponse>;
|
|
11
14
|
getFeatures(options: FeaturesRequestOptions): Promise<FeaturesResponse>;
|
|
12
15
|
getFormula(options: FormulaRequestOptions): Promise<FormulaResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CategoryRequestOptions, CategoryResponse, FeaturesRequestOptions, FeaturesResponse, FormulaRequestOptions, FormulaResponse, HistogramRequestOptions, HistogramResponse, RangeRequestOptions, RangeResponse, ScatterRequestOptions, ScatterResponse, TableRequestOptions, TableResponse, TimeSeriesRequestOptions, TimeSeriesResponse, ViewState } from './types.js';
|
|
2
|
-
import { FilterLogicalOperator, Filter, SpatialFilter } from '../types.js';
|
|
2
|
+
import { FilterLogicalOperator, Filter, SpatialFilter, Filters } from '../types.js';
|
|
3
3
|
import { ModelSource } from '../models/model.js';
|
|
4
4
|
import { SourceOptions } from '../sources/index.js';
|
|
5
5
|
import { ApiVersion } from '../constants.js';
|
|
@@ -23,8 +23,8 @@ export declare abstract class WidgetSource<Props extends WidgetSourceProps> {
|
|
|
23
23
|
* properties, and adding additional required properties including 'type' and
|
|
24
24
|
* 'data'.
|
|
25
25
|
*/
|
|
26
|
-
protected abstract getModelSource(
|
|
27
|
-
protected _getModelSource(
|
|
26
|
+
protected abstract getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
|
|
27
|
+
protected _getModelSource(filters: Filters | undefined, filterOwner?: string): Omit<ModelSource, 'type' | 'data'>;
|
|
28
28
|
protected _getSpatialFiltersResolution(source: Omit<ModelSource, 'type' | 'data'>, spatialFilter?: SpatialFilter, referenceViewState?: ViewState): number | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* Returns a list of labeled datapoints for categorical data. Suitable for
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { H3TableSourceOptions, QuadbinTableSourceOptions, VectorTableSourceOptions } from '../sources/index.js';
|
|
2
2
|
import { WidgetRemoteSource, WidgetRemoteSourceProps } from './widget-remote-source.js';
|
|
3
3
|
import { ModelSource } from '../models/model.js';
|
|
4
|
+
import { Filters } from '../types.js';
|
|
4
5
|
type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
|
|
5
6
|
export type WidgetTableSourceResult = {
|
|
6
7
|
widgetSource: WidgetTableSource;
|
|
@@ -28,6 +29,6 @@ export type WidgetTableSourceResult = {
|
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
30
31
|
export declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
|
|
31
|
-
protected getModelSource(
|
|
32
|
+
protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
|
|
32
33
|
}
|
|
33
34
|
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { TilesetSourceOptions } from '../sources/index.js';
|
|
2
2
|
import type { ModelSource } from '../models/index.js';
|
|
3
|
-
import { CategoryRequestOptions, CategoryResponse,
|
|
3
|
+
import { CategoryRequestOptions, CategoryResponse, FeaturesResponse, FormulaRequestOptions, FormulaResponse, HistogramRequestOptions, HistogramResponse, RangeRequestOptions, RangeResponse, ScatterRequestOptions, ScatterResponse, TableRequestOptions, TableResponse, TimeSeriesRequestOptions, TimeSeriesResponse } from './types.js';
|
|
4
4
|
import { TileFormat } from '../constants.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Filters, SpatialFilter } from '../types.js';
|
|
6
6
|
import { TileFeatureExtractOptions } from '../filters/index.js';
|
|
7
|
-
import { FeatureData } from '../types-internal.js';
|
|
8
7
|
import { FeatureCollection } from 'geojson';
|
|
9
8
|
import { SpatialDataType } from '../sources/types.js';
|
|
10
9
|
import { WidgetSource, WidgetSourceProps } from './widget-source.js';
|
|
@@ -38,38 +37,37 @@ export type WidgetTilesetSourceResult = {
|
|
|
38
37
|
* ```
|
|
39
38
|
*/
|
|
40
39
|
export declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = WidgetTilesetSourceProps> extends WidgetSource<Props> {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
private _tiles;
|
|
41
|
+
private _features;
|
|
42
|
+
private _tileFeatureExtractOptions;
|
|
43
|
+
private _tileFeatureExtractPreviousInputs;
|
|
44
|
+
protected getModelSource(filters: Filters | undefined, filterOwner: string): ModelSource;
|
|
44
45
|
/**
|
|
45
46
|
* Loads features as a list of tiles (typically provided by deck.gl).
|
|
46
47
|
* After tiles are loaded, {@link extractTileFeatures} must be called
|
|
47
48
|
* before computing statistics on the tiles.
|
|
48
49
|
*/
|
|
49
50
|
loadTiles(tiles: unknown[]): void;
|
|
51
|
+
/** Configures options used to extract features from tiles. */
|
|
52
|
+
setTileFeatureExtractOptions(options: TileFeatureExtractOptions): void;
|
|
53
|
+
protected _extractTileFeatures(spatialFilter: SpatialFilter): void;
|
|
50
54
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
55
|
+
* Loads features as GeoJSON (used for testing).
|
|
56
|
+
* @experimental
|
|
57
|
+
* @internal Not for public use. Spatial filters in other method calls will be ignored.
|
|
53
58
|
*/
|
|
54
|
-
|
|
55
|
-
spatialFilter: SpatialFilter;
|
|
56
|
-
uniqueIdProperty?: string;
|
|
57
|
-
options?: TileFeatureExtractOptions;
|
|
58
|
-
}): void;
|
|
59
|
-
/** Loads features as GeoJSON (used for testing). */
|
|
60
|
-
loadGeoJSON({ geojson, spatialFilter, uniqueIdProperty, }: {
|
|
59
|
+
loadGeoJSON({ geojson, spatialFilter, }: {
|
|
61
60
|
geojson: FeatureCollection;
|
|
62
61
|
spatialFilter: SpatialFilter;
|
|
63
|
-
uniqueIdProperty?: string;
|
|
64
62
|
}): void;
|
|
65
|
-
getFeatures(
|
|
66
|
-
getFormula({ column, operation, joinOperation, filterOwner, }: FormulaRequestOptions): Promise<FormulaResponse>;
|
|
67
|
-
getHistogram({ operation, ticks, column, joinOperation, filterOwner, }: HistogramRequestOptions): Promise<HistogramResponse>;
|
|
68
|
-
getCategories({ column, operation, operationColumn, joinOperation, filterOwner, }: CategoryRequestOptions): Promise<CategoryResponse>;
|
|
69
|
-
getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filterOwner, }: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
70
|
-
getTable(
|
|
71
|
-
getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filterOwner, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
72
|
-
getRange({ column, filterOwner, }: RangeRequestOptions): Promise<RangeResponse>;
|
|
63
|
+
getFeatures(): Promise<FeaturesResponse>;
|
|
64
|
+
getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
|
|
65
|
+
getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
|
|
66
|
+
getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: CategoryRequestOptions): Promise<CategoryResponse>;
|
|
67
|
+
getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
|
|
68
|
+
getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
|
|
69
|
+
getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
|
|
70
|
+
getRange({ column, filters, filterOwner, spatialFilter, }: RangeRequestOptions): Promise<RangeResponse>;
|
|
73
71
|
/****************************************************************************
|
|
74
72
|
* INTERNAL
|
|
75
73
|
*/
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"homepage": "https://github.com/CartoDB/carto-api-client#readme",
|
|
9
9
|
"author": "Don McCurdy <donmccurdy@carto.com>",
|
|
10
10
|
"packageManager": "yarn@4.3.1",
|
|
11
|
-
"version": "0.5.0-alpha.
|
|
11
|
+
"version": "0.5.0-alpha.4",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public",
|
|
@@ -39,11 +39,12 @@
|
|
|
39
39
|
"test": "vitest run --typecheck",
|
|
40
40
|
"test:watch": "vitest watch --typecheck",
|
|
41
41
|
"coverage": "vitest run --coverage.enabled --coverage.all false",
|
|
42
|
-
"lint": "
|
|
43
|
-
"format": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"format": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --write",
|
|
44
|
+
"format:check": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --check",
|
|
44
45
|
"clean": "rimraf build/*",
|
|
45
46
|
"postversion": "yarn postversion:check && yarn postversion:commit && yarn postversion:push",
|
|
46
|
-
"postversion:check": "yarn lint && yarn test",
|
|
47
|
+
"postversion:check": "yarn lint && yarn format:check && yarn test",
|
|
47
48
|
"postversion:commit": "node scripts/postversion-commit.js",
|
|
48
49
|
"postversion:push": "git push && git push --tags",
|
|
49
50
|
"prepublish": "yarn lint && yarn test",
|
|
@@ -57,53 +58,58 @@
|
|
|
57
58
|
],
|
|
58
59
|
"dependencies": {
|
|
59
60
|
"@loaders.gl/schema": "^4.3.3",
|
|
60
|
-
"@turf/bbox-clip": "^7.
|
|
61
|
-
"@turf/bbox-polygon": "^7.
|
|
62
|
-
"@turf/boolean-
|
|
63
|
-
"@turf/boolean-
|
|
64
|
-
"@turf/
|
|
65
|
-
"@turf/
|
|
66
|
-
"@turf/
|
|
67
|
-
"@turf/
|
|
68
|
-
"@
|
|
61
|
+
"@turf/bbox-clip": "^7.2.0",
|
|
62
|
+
"@turf/bbox-polygon": "^7.2.0",
|
|
63
|
+
"@turf/boolean-equal": "^7.2.0",
|
|
64
|
+
"@turf/boolean-intersects": "^7.2.0",
|
|
65
|
+
"@turf/boolean-within": "^7.2.0",
|
|
66
|
+
"@turf/helpers": "^7.2.0",
|
|
67
|
+
"@turf/intersect": "^7.2.0",
|
|
68
|
+
"@turf/invariant": "^7.2.0",
|
|
69
|
+
"@turf/union": "^7.2.0",
|
|
70
|
+
"@types/geojson": "^7946.0.16",
|
|
69
71
|
"h3-js": "4.1.0",
|
|
70
72
|
"quadbin": "^0.4.0-alpha.2"
|
|
71
73
|
},
|
|
72
74
|
"devDependencies": {
|
|
73
|
-
"@deck.gl/aggregation-layers": "
|
|
74
|
-
"@deck.gl/carto": "
|
|
75
|
-
"@deck.gl/core": "
|
|
76
|
-
"@deck.gl/extensions": "
|
|
77
|
-
"@deck.gl/geo-layers": "
|
|
78
|
-
"@deck.gl/layers": "
|
|
79
|
-
"@deck.gl/mesh-layers": "
|
|
80
|
-
"@
|
|
81
|
-
"@lit/
|
|
75
|
+
"@deck.gl/aggregation-layers": "~9.1.0",
|
|
76
|
+
"@deck.gl/carto": "~9.1.0",
|
|
77
|
+
"@deck.gl/core": "~9.1.0",
|
|
78
|
+
"@deck.gl/extensions": "~9.1.0",
|
|
79
|
+
"@deck.gl/geo-layers": "~9.1.0",
|
|
80
|
+
"@deck.gl/layers": "~9.1.0",
|
|
81
|
+
"@deck.gl/mesh-layers": "~9.1.0",
|
|
82
|
+
"@eslint/js": "^9.20.0",
|
|
83
|
+
"@lit/react": "^1.0.7",
|
|
84
|
+
"@lit/task": "^1.0.2",
|
|
82
85
|
"@loaders.gl/core": "^4.3.3",
|
|
83
|
-
"@luma.gl/core": "~9.0
|
|
84
|
-
"@luma.gl/engine": "~9.0
|
|
86
|
+
"@luma.gl/core": "~9.1.0",
|
|
87
|
+
"@luma.gl/engine": "~9.1.0",
|
|
88
|
+
"@luma.gl/shadertools": "~9.1.0",
|
|
85
89
|
"@turf/buffer": "^7.2.0",
|
|
86
90
|
"@types/json-schema": "^7.0.15",
|
|
87
91
|
"@types/react": "^18.3.18",
|
|
88
92
|
"@types/semver": "^7.5.8",
|
|
89
|
-
"@vitest/coverage-istanbul": "^3.0.
|
|
93
|
+
"@vitest/coverage-istanbul": "^3.0.5",
|
|
90
94
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
91
95
|
"concurrently": "^9.1.2",
|
|
92
96
|
"echarts": "^5.6.0",
|
|
97
|
+
"eslint": "^9.20.1",
|
|
93
98
|
"lit": "^3.2.1",
|
|
94
99
|
"lit-analyzer": "^2.0.3",
|
|
95
|
-
"maplibre-gl": "^5.
|
|
100
|
+
"maplibre-gl": "^5.1.0",
|
|
96
101
|
"microbundle": "^0.15.1",
|
|
97
102
|
"prettier": "^3.4.2",
|
|
98
103
|
"rimraf": "^6.0.1",
|
|
99
|
-
"semver": "^7.
|
|
104
|
+
"semver": "^7.7.1",
|
|
100
105
|
"thenby": "^1.3.4",
|
|
101
106
|
"typescript": "~5.7.3",
|
|
102
|
-
"
|
|
103
|
-
"
|
|
107
|
+
"typescript-eslint": "^8.24.0",
|
|
108
|
+
"vite": "^6.1.0",
|
|
109
|
+
"vitest": "3.0.5"
|
|
104
110
|
},
|
|
105
111
|
"resolutions": {
|
|
106
112
|
"rollup": "^4.20.0"
|
|
107
113
|
},
|
|
108
|
-
"stableVersion": "0.4.
|
|
114
|
+
"stableVersion": "0.4.6"
|
|
109
115
|
}
|
package/src/api/query.ts
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {SOURCE_DEFAULTS} from '../sources/index';
|
|
5
|
+
import {SOURCE_DEFAULTS} from '../sources/index.js';
|
|
6
6
|
import type {
|
|
7
7
|
SourceOptions,
|
|
8
8
|
QuerySourceOptions,
|
|
9
9
|
QueryResult,
|
|
10
|
-
} from '../sources/types';
|
|
11
|
-
import {buildQueryUrl} from './endpoints';
|
|
12
|
-
import {requestWithParameters} from './request-with-parameters';
|
|
13
|
-
import {APIErrorContext} from './carto-api-error';
|
|
10
|
+
} from '../sources/types.js';
|
|
11
|
+
import {buildQueryUrl} from './endpoints.js';
|
|
12
|
+
import {requestWithParameters} from './request-with-parameters.js';
|
|
13
|
+
import {APIErrorContext} from './carto-api-error.js';
|
|
14
14
|
|
|
15
15
|
export type QueryOptions = SourceOptions & QuerySourceOptions;
|
|
16
16
|
type UrlParameters = {q: string; queryParameters?: string};
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {isPureObject} from '../utils';
|
|
6
|
-
import {CartoAPIError, APIErrorContext} from './carto-api-error';
|
|
7
|
-
import {V3_MINOR_VERSION} from '../constants-internal';
|
|
8
|
-
import {DEFAULT_MAX_LENGTH_URL} from '../constants-internal';
|
|
9
|
-
import {getClient} from '../client';
|
|
10
|
-
import {LocalCacheOptions} from '../sources/types';
|
|
5
|
+
import {isPureObject} from '../utils.js';
|
|
6
|
+
import {CartoAPIError, APIErrorContext} from './carto-api-error.js';
|
|
7
|
+
import {V3_MINOR_VERSION} from '../constants-internal.js';
|
|
8
|
+
import {DEFAULT_MAX_LENGTH_URL} from '../constants-internal.js';
|
|
9
|
+
import {getClient} from '../client.js';
|
|
10
|
+
import {LocalCacheOptions} from '../sources/types.js';
|
|
11
11
|
|
|
12
12
|
const DEFAULT_HEADERS = {
|
|
13
13
|
Accept: 'application/json',
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @internal
|
|
3
|
-
* @
|
|
3
|
+
* @privateRemarks Source: @carto/react-core, @carto/constants, @deck.gl/carto
|
|
4
4
|
*/
|
|
5
5
|
let client = 'deck-gl-carto';
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ let client = 'deck-gl-carto';
|
|
|
8
8
|
* Returns current client ID, used to categorize API requests. For internal use only.
|
|
9
9
|
*
|
|
10
10
|
* @internal
|
|
11
|
-
* @
|
|
11
|
+
* @privateRemarks Source: @carto/react-core
|
|
12
12
|
*/
|
|
13
13
|
export function getClient() {
|
|
14
14
|
return client;
|
|
@@ -18,7 +18,7 @@ export function getClient() {
|
|
|
18
18
|
* Sets current client ID, used to categorize API requests. For internal use only.
|
|
19
19
|
*
|
|
20
20
|
* @internal
|
|
21
|
-
* @
|
|
21
|
+
* @privateRemarks Source: @carto/react-core
|
|
22
22
|
*/
|
|
23
23
|
export function setClient(c: string) {
|
|
24
24
|
client = c;
|
|
@@ -7,26 +7,26 @@ export const API_CLIENT_VERSION = __CARTO_API_CLIENT_VERSION;
|
|
|
7
7
|
/** @internal */
|
|
8
8
|
export const V3_MINOR_VERSION = '3.4';
|
|
9
9
|
|
|
10
|
-
/** @
|
|
10
|
+
/** @privateRemarks Source: @carto/constants, @deck.gl/carto */
|
|
11
11
|
export const DEFAULT_GEO_COLUMN = 'geom';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Fastly default limit is 8192; leave some padding.
|
|
15
|
-
* @
|
|
15
|
+
* @privateRemarks Source: @deck.gl/carto
|
|
16
16
|
*/
|
|
17
17
|
export const DEFAULT_MAX_LENGTH_URL = 7000;
|
|
18
18
|
|
|
19
|
-
/** @
|
|
19
|
+
/** @privateRemarks Source: @deck.gl/carto */
|
|
20
20
|
export const DEFAULT_TILE_RESOLUTION = 0.5;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* @
|
|
23
|
+
* @privateRemarks Source: @deck.gl/carto
|
|
24
24
|
* @internal
|
|
25
25
|
*/
|
|
26
26
|
export const DEFAULT_AGGREGATION_RES_LEVEL_H3 = 4;
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* @
|
|
29
|
+
* @privateRemarks Source: @deck.gl/carto
|
|
30
30
|
* @internal
|
|
31
31
|
*/
|
|
32
32
|
export const DEFAULT_AGGREGATION_RES_LEVEL_QUADBIN = 6;
|
package/src/constants.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* };
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @privateRemarks Source: @carto/react-api, @deck.gl/carto
|
|
14
14
|
*/
|
|
15
15
|
export enum FilterType {
|
|
16
16
|
IN = 'in',
|
|
@@ -22,17 +22,17 @@ export enum FilterType {
|
|
|
22
22
|
STRING_SEARCH = 'stringSearch',
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/** @
|
|
25
|
+
/** @privateRemarks Source: @carto/constants */
|
|
26
26
|
export enum ApiVersion {
|
|
27
27
|
V1 = 'v1',
|
|
28
28
|
V2 = 'v2',
|
|
29
29
|
V3 = 'v3',
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
/** @
|
|
32
|
+
/** @privateRemarks Source: @carto/constants, @deck.gl/carto */
|
|
33
33
|
export const DEFAULT_API_BASE_URL = 'https://gcp-us-east1.api.carto.com';
|
|
34
34
|
|
|
35
|
-
/** @
|
|
35
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
36
36
|
export enum TileFormat {
|
|
37
37
|
MVT = 'mvt',
|
|
38
38
|
JSON = 'json',
|
|
@@ -40,14 +40,14 @@ export enum TileFormat {
|
|
|
40
40
|
BINARY = 'binary',
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
/** @
|
|
43
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
44
44
|
export enum SpatialIndex {
|
|
45
45
|
H3 = 'h3',
|
|
46
46
|
S2 = 's2',
|
|
47
47
|
QUADBIN = 'quadbin',
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/** @
|
|
50
|
+
/** @privateRemarks Source: @carto/react-core */
|
|
51
51
|
export enum Provider {
|
|
52
52
|
BIGQUERY = 'bigquery',
|
|
53
53
|
REDSHIFT = 'redshift',
|