@carto/api-client 0.3.1 → 0.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api/carto-api-error.d.ts +18 -0
- package/build/api/endpoints.d.ts +22 -0
- package/build/api/index.d.ts +4 -0
- package/build/api/query.d.ts +3 -0
- package/build/api/request-with-parameters.d.ts +8 -0
- package/build/api/types.d.ts +227 -0
- package/build/api-client.cjs +484 -22
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.modern.js +413 -19
- package/build/api-client.modern.js.map +1 -1
- package/build/constants.d.ts +8 -0
- package/build/index.d.ts +6 -1
- package/build/sources/base-source.d.ts +4 -0
- package/build/sources/boundary-query-source.d.ts +9 -0
- package/build/sources/boundary-table-source.d.ts +7 -0
- package/build/sources/h3-query-source.d.ts +3 -0
- package/build/sources/h3-table-source.d.ts +3 -0
- package/build/sources/h3-tileset-source.d.ts +3 -0
- package/build/sources/index.d.ts +27 -5
- package/build/sources/quadbin-query-source.d.ts +3 -0
- package/build/sources/quadbin-table-source.d.ts +3 -0
- package/build/sources/quadbin-tileset-source.d.ts +3 -0
- package/build/sources/raster-source.d.ts +3 -0
- package/build/sources/types.d.ts +208 -85
- package/build/sources/vector-query-source.d.ts +3 -0
- package/build/sources/vector-table-source.d.ts +3 -0
- package/build/sources/vector-tileset-source.d.ts +3 -0
- package/build/utils.d.ts +4 -0
- package/build/widget-sources/index.d.ts +5 -0
- package/build/widget-sources/types.d.ts +95 -0
- package/build/{sources → widget-sources}/widget-base-source.d.ts +1 -1
- package/build/{sources → widget-sources}/widget-query-source.d.ts +1 -1
- package/build/{sources → widget-sources}/widget-table-source.d.ts +1 -1
- package/build/{sources → widget-sources}/wrappers.d.ts +1 -1
- package/package.json +4 -3
- package/src/api/carto-api-error.ts +72 -0
- package/src/api/endpoints.ts +82 -0
- package/src/api/index.ts +17 -0
- package/src/api/query.ts +56 -0
- package/src/api/request-with-parameters.ts +139 -0
- package/src/api/types.ts +301 -0
- package/src/constants.ts +13 -0
- package/src/global.d.ts +3 -0
- package/src/index.ts +10 -1
- package/src/sources/base-source.ts +100 -0
- package/src/sources/boundary-query-source.ts +53 -0
- package/src/sources/boundary-table-source.ts +41 -0
- package/src/sources/h3-query-source.ts +63 -0
- package/src/sources/h3-table-source.ts +59 -0
- package/src/sources/h3-tileset-source.ts +26 -0
- package/src/sources/index.ts +49 -5
- package/src/sources/quadbin-query-source.ts +64 -0
- package/src/sources/quadbin-table-source.ts +60 -0
- package/src/sources/quadbin-tileset-source.ts +26 -0
- package/src/sources/raster-source.ts +34 -0
- package/src/sources/types.ts +226 -90
- package/src/sources/vector-query-source.ts +65 -0
- package/src/sources/vector-table-source.ts +59 -0
- package/src/sources/vector-tileset-source.ts +26 -0
- package/src/utils.ts +8 -0
- package/src/widget-sources/index.ts +5 -0
- package/src/widget-sources/types.ts +105 -0
- package/src/{sources → widget-sources}/widget-base-source.ts +1 -1
- package/src/{sources → widget-sources}/widget-query-source.ts +1 -1
- package/src/{sources → widget-sources}/widget-table-source.ts +1 -1
- package/src/{sources → widget-sources}/wrappers.ts +1 -21
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
QuadbinTableSourceOptions as _QuadbinTableSourceOptions,
|
|
13
13
|
QuadbinQuerySourceOptions as _QuadbinQuerySourceOptions,
|
|
14
14
|
SourceOptions,
|
|
15
|
-
} from '
|
|
15
|
+
} from '../sources/index.js';
|
|
16
16
|
import {WidgetBaseSourceProps} from './widget-base-source.js';
|
|
17
17
|
import {WidgetQuerySource} from './widget-query-source.js';
|
|
18
18
|
import {WidgetTableSource} from './widget-table-source.js';
|
|
@@ -55,7 +55,6 @@ export type VectorQuerySourceOptions =
|
|
|
55
55
|
export async function vectorTableSource(
|
|
56
56
|
props: VectorTableSourceOptions
|
|
57
57
|
): Promise<VectorTableSourceResponse> {
|
|
58
|
-
assignDefaultProps(props);
|
|
59
58
|
const response = await _vectorTableSource(props as _VectorTableSourceOptions);
|
|
60
59
|
return {...response, widgetSource: new WidgetTableSource(props)};
|
|
61
60
|
}
|
|
@@ -64,7 +63,6 @@ export async function vectorTableSource(
|
|
|
64
63
|
export async function vectorQuerySource(
|
|
65
64
|
props: VectorQuerySourceOptions
|
|
66
65
|
): Promise<VectorQuerySourceResponse> {
|
|
67
|
-
assignDefaultProps(props);
|
|
68
66
|
const response = await _vectorQuerySource(props as _VectorQuerySourceOptions);
|
|
69
67
|
return {...response, widgetSource: new WidgetQuerySource(props)};
|
|
70
68
|
}
|
|
@@ -80,7 +78,6 @@ export type H3QuerySourceOptions = WrappedSourceOptions<_H3QuerySourceOptions>;
|
|
|
80
78
|
export async function h3TableSource(
|
|
81
79
|
props: H3TableSourceOptions
|
|
82
80
|
): Promise<H3TableSourceResponse> {
|
|
83
|
-
assignDefaultProps(props);
|
|
84
81
|
const response = await _h3TableSource(props as _H3TableSourceOptions);
|
|
85
82
|
return {...response, widgetSource: new WidgetTableSource(props)};
|
|
86
83
|
}
|
|
@@ -89,7 +86,6 @@ export async function h3TableSource(
|
|
|
89
86
|
export async function h3QuerySource(
|
|
90
87
|
props: H3QuerySourceOptions
|
|
91
88
|
): Promise<H3QuerySourceResponse> {
|
|
92
|
-
assignDefaultProps(props);
|
|
93
89
|
const response = await _h3QuerySource(props as _H3QuerySourceOptions);
|
|
94
90
|
return {...response, widgetSource: new WidgetQuerySource(props)};
|
|
95
91
|
}
|
|
@@ -108,7 +104,6 @@ export type QuadbinQuerySourceOptions =
|
|
|
108
104
|
export async function quadbinTableSource(
|
|
109
105
|
props: QuadbinTableSourceOptions & WidgetBaseSourceProps
|
|
110
106
|
): Promise<QuadbinTableSourceResponse> {
|
|
111
|
-
assignDefaultProps(props);
|
|
112
107
|
const response = await _quadbinTableSource(
|
|
113
108
|
props as _QuadbinTableSourceOptions
|
|
114
109
|
);
|
|
@@ -119,23 +114,8 @@ export async function quadbinTableSource(
|
|
|
119
114
|
export async function quadbinQuerySource(
|
|
120
115
|
props: QuadbinQuerySourceOptions & WidgetBaseSourceProps
|
|
121
116
|
): Promise<QuadbinQuerySourceResponse> {
|
|
122
|
-
assignDefaultProps(props);
|
|
123
117
|
const response = await _quadbinQuerySource(
|
|
124
118
|
props as _QuadbinQuerySourceOptions
|
|
125
119
|
);
|
|
126
120
|
return {...response, widgetSource: new WidgetQuerySource(props)};
|
|
127
121
|
}
|
|
128
|
-
|
|
129
|
-
/******************************************************************************
|
|
130
|
-
* DEFAULT PROPS
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
declare const deck: {VERSION?: string} | undefined;
|
|
134
|
-
function assignDefaultProps<T extends SourceOptions>(props: T): void {
|
|
135
|
-
if (typeof deck !== 'undefined' && deck && deck.VERSION) {
|
|
136
|
-
props.clientId ||= 'deck-gl-carto';
|
|
137
|
-
// TODO: Uncomment if/when `@deck.gl/carto` devDependency is removed,
|
|
138
|
-
// and source functions are moved here rather than wrapped.
|
|
139
|
-
// props.deckglVersion ||= deck.VERSION;
|
|
140
|
-
}
|
|
141
|
-
}
|