@carto/api-client 0.5.4-alpha.1 → 0.5.5-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/CHANGELOG.md +10 -0
- package/build/api-client.cjs +13 -12
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +6 -1
- package/build/api-client.d.ts +6 -1
- package/build/api-client.js +12 -12
- package/build/api-client.js.map +1 -1
- package/package.json +2 -2
- package/src/api/index.ts +4 -1
- package/src/api/request-with-parameters.ts +8 -0
- package/src/index.ts +1 -0
- package/src/models/model.ts +9 -19
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.
|
|
11
|
+
"version": "0.5.5-alpha.0",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"@carto/api-client": "portal:./",
|
|
130
130
|
"rollup": "^4.20.0"
|
|
131
131
|
},
|
|
132
|
-
"stableVersion": "0.5.
|
|
132
|
+
"stableVersion": "0.5.4"
|
|
133
133
|
}
|
package/src/api/index.ts
CHANGED
|
@@ -11,4 +11,7 @@ export {
|
|
|
11
11
|
export {buildPublicMapUrl, buildStatsUrl} from './endpoints.js';
|
|
12
12
|
export {query} from './query.js';
|
|
13
13
|
export type {QueryOptions} from './query.js';
|
|
14
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
requestWithParameters,
|
|
16
|
+
clearDefaultRequestCache,
|
|
17
|
+
} from './request-with-parameters.js';
|
|
@@ -164,3 +164,11 @@ function excludeURLParameters(baseUrlString: string, parameters: string[]) {
|
|
|
164
164
|
}
|
|
165
165
|
return baseUrl.toString();
|
|
166
166
|
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Clears the HTTP response cache for all requests using the default cache.
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
export function clearDefaultRequestCache() {
|
|
173
|
+
DEFAULT_REQUEST_CACHE.clear();
|
|
174
|
+
}
|
package/src/index.ts
CHANGED
package/src/models/model.ts
CHANGED
|
@@ -85,6 +85,7 @@ export function executeModel(props: {
|
|
|
85
85
|
filters,
|
|
86
86
|
filtersLogicalOperator = 'and',
|
|
87
87
|
spatialDataType = 'geo',
|
|
88
|
+
spatialDataColumn = DEFAULT_GEO_COLUMN,
|
|
88
89
|
spatialFiltersMode = 'intersects',
|
|
89
90
|
} = source;
|
|
90
91
|
|
|
@@ -98,26 +99,15 @@ export function executeModel(props: {
|
|
|
98
99
|
filtersLogicalOperator,
|
|
99
100
|
};
|
|
100
101
|
|
|
101
|
-
|
|
102
|
+
queryParams.spatialDataType = spatialDataType;
|
|
103
|
+
queryParams.spatialDataColumn = spatialDataColumn;
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
queryParams.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const spatialFilters = source.spatialFilter
|
|
110
|
-
? {[spatialDataColumn]: source.spatialFilter}
|
|
111
|
-
: undefined;
|
|
112
|
-
|
|
113
|
-
if (spatialFilters) {
|
|
114
|
-
queryParams.spatialFilters = spatialFilters;
|
|
115
|
-
queryParams.spatialDataColumn = spatialDataColumn;
|
|
116
|
-
queryParams.spatialDataType = spatialDataType;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (spatialDataType !== 'geo') {
|
|
120
|
-
queryParams.spatialFiltersMode = spatialFiltersMode;
|
|
105
|
+
if (source.spatialFilter) {
|
|
106
|
+
// API supports multiple filters, we apply it only to spatialDataColumn
|
|
107
|
+
queryParams.spatialFilters = {[spatialDataColumn]: source.spatialFilter};
|
|
108
|
+
if (spatialDataType !== 'geo') {
|
|
109
|
+
queryParams.spatialFiltersMode = spatialFiltersMode;
|
|
110
|
+
}
|
|
121
111
|
}
|
|
122
112
|
|
|
123
113
|
const urlWithSearchParams =
|