@carto/api-client 0.5.23-alpha.fill-data.0 → 0.5.23
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 +5 -0
- package/build/api-client.cjs +20 -4
- 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 +19 -4
- package/build/api-client.js.map +1 -1
- package/build/worker-compat.js.map +1 -1
- package/build/worker.js.map +1 -1
- package/package.json +2 -5
- package/src/constants.ts +4 -0
- package/src/fetch-map/fetch-map.ts +16 -4
- package/src/fetch-map/source.ts +3 -0
package/CHANGELOG.md
CHANGED
package/build/api-client.cjs
CHANGED
|
@@ -99,6 +99,7 @@ var require_thenBy_module = __commonJS({
|
|
|
99
99
|
// src/index.ts
|
|
100
100
|
var src_exports = {};
|
|
101
101
|
__export(src_exports, {
|
|
102
|
+
AUDIT_TAGS: () => AUDIT_TAGS,
|
|
102
103
|
AggregationTypes: () => AggregationTypes,
|
|
103
104
|
ApiVersion: () => ApiVersion,
|
|
104
105
|
BASEMAP: () => basemap_styles_default,
|
|
@@ -237,6 +238,9 @@ var ApiVersion = /* @__PURE__ */ ((ApiVersion2) => {
|
|
|
237
238
|
return ApiVersion2;
|
|
238
239
|
})(ApiVersion || {});
|
|
239
240
|
var DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
|
|
241
|
+
var AUDIT_TAGS = {
|
|
242
|
+
mapId: "tag-mapId"
|
|
243
|
+
};
|
|
240
244
|
var TileFormat = /* @__PURE__ */ ((TileFormat2) => {
|
|
241
245
|
TileFormat2["MVT"] = "mvt";
|
|
242
246
|
TileFormat2["JSON"] = "json";
|
|
@@ -11144,7 +11148,8 @@ function getSourceOptions({
|
|
|
11144
11148
|
apiBaseUrl,
|
|
11145
11149
|
connection,
|
|
11146
11150
|
headers,
|
|
11147
|
-
maxLengthURL
|
|
11151
|
+
maxLengthURL,
|
|
11152
|
+
tags
|
|
11148
11153
|
}) {
|
|
11149
11154
|
return {
|
|
11150
11155
|
accessToken,
|
|
@@ -11156,7 +11161,8 @@ function getSourceOptions({
|
|
|
11156
11161
|
localCache: {
|
|
11157
11162
|
cacheControl: ["no-cache"]
|
|
11158
11163
|
}
|
|
11159
|
-
}
|
|
11164
|
+
},
|
|
11165
|
+
tags
|
|
11160
11166
|
};
|
|
11161
11167
|
}
|
|
11162
11168
|
function getDynamicTileResolution(spatialIndex) {
|
|
@@ -11192,14 +11198,19 @@ async function _fetchMapDataset(dataset, filters, context) {
|
|
|
11192
11198
|
const cache = {};
|
|
11193
11199
|
const configuredSource = configureSource({
|
|
11194
11200
|
dataset,
|
|
11195
|
-
filters: isRemoteCalculationSupported(dataset) ? filters : void 0,
|
|
11201
|
+
filters: !isEmptyObject(filters) && isRemoteCalculationSupported(dataset) ? filters : void 0,
|
|
11196
11202
|
options: {
|
|
11197
11203
|
...context,
|
|
11198
11204
|
connection: connectionName,
|
|
11199
11205
|
headers: context.headers,
|
|
11200
11206
|
accessToken: context.accessToken,
|
|
11201
11207
|
apiBaseUrl: context.apiBaseUrl,
|
|
11202
|
-
maxLengthURL: context.maxLengthURL
|
|
11208
|
+
maxLengthURL: context.maxLengthURL,
|
|
11209
|
+
...context.mapId && {
|
|
11210
|
+
tags: {
|
|
11211
|
+
[AUDIT_TAGS.mapId]: context.mapId
|
|
11212
|
+
}
|
|
11213
|
+
}
|
|
11203
11214
|
}
|
|
11204
11215
|
});
|
|
11205
11216
|
dataset.data = await configuredSource;
|
|
@@ -11232,6 +11243,9 @@ async function _fetchTilestats(attribute, dataset, context) {
|
|
|
11232
11243
|
if (client2) {
|
|
11233
11244
|
parameters.client = client2;
|
|
11234
11245
|
}
|
|
11246
|
+
if (context.mapId) {
|
|
11247
|
+
parameters[AUDIT_TAGS.mapId] = context.mapId;
|
|
11248
|
+
}
|
|
11235
11249
|
if (type === "query") {
|
|
11236
11250
|
parameters.q = source;
|
|
11237
11251
|
if (queryParameters) {
|
|
@@ -11321,6 +11335,7 @@ async function fetchMap({
|
|
|
11321
11335
|
maxLengthURL
|
|
11322
11336
|
});
|
|
11323
11337
|
const context = {
|
|
11338
|
+
mapId: cartoMapId,
|
|
11324
11339
|
accessToken: map.token || accessToken,
|
|
11325
11340
|
apiBaseUrl,
|
|
11326
11341
|
clientId,
|
|
@@ -11582,6 +11597,7 @@ function hashBuckets(initialCount) {
|
|
|
11582
11597
|
}
|
|
11583
11598
|
// Annotate the CommonJS export names for ESM import in node:
|
|
11584
11599
|
0 && (module.exports = {
|
|
11600
|
+
AUDIT_TAGS,
|
|
11585
11601
|
AggregationTypes,
|
|
11586
11602
|
ApiVersion,
|
|
11587
11603
|
BASEMAP,
|