@carto/api-client 0.5.15 → 0.5.16
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 +70 -1
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +33 -2
- package/build/api-client.d.ts +33 -2
- package/build/api-client.js +70 -1
- package/build/api-client.js.map +1 -1
- package/build/worker-compat.js +1395 -1276
- package/build/worker-compat.js.map +1 -1
- package/build/worker.js +34 -0
- package/build/worker.js.map +1 -1
- package/package.json +2 -2
- package/src/models/model.ts +1 -0
- package/src/widget-sources/types.ts +25 -0
- package/src/widget-sources/widget-remote-source.ts +30 -0
- package/src/widget-sources/widget-source.ts +11 -0
- package/src/widget-sources/widget-tileset-source-impl.ts +49 -0
- package/src/widget-sources/widget-tileset-source.ts +13 -0
- package/src/workers/constants.ts +1 -0
package/build/worker.js
CHANGED
|
@@ -6323,6 +6323,7 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
6323
6323
|
assertColumn(this._features, column);
|
|
6324
6324
|
}
|
|
6325
6325
|
const targetOperation = aggregationFunctions[operation2];
|
|
6326
|
+
assert(targetOperation, `Unsupported aggregation operation: ${operation2}`);
|
|
6326
6327
|
return {
|
|
6327
6328
|
value: targetOperation(filteredFeatures, column, joinOperation)
|
|
6328
6329
|
};
|
|
@@ -6521,6 +6522,39 @@ var WidgetTilesetSourceImpl = class extends WidgetSource {
|
|
|
6521
6522
|
max: aggregationFunctions.max(filteredFeatures, column)
|
|
6522
6523
|
};
|
|
6523
6524
|
}
|
|
6525
|
+
async getAggregations({
|
|
6526
|
+
aggregations,
|
|
6527
|
+
filters,
|
|
6528
|
+
filterOwner,
|
|
6529
|
+
spatialFilter
|
|
6530
|
+
}) {
|
|
6531
|
+
const filteredFeatures = this._getFilteredFeatures(
|
|
6532
|
+
spatialFilter,
|
|
6533
|
+
filters,
|
|
6534
|
+
filterOwner
|
|
6535
|
+
);
|
|
6536
|
+
if (!this._features.length) {
|
|
6537
|
+
return { rows: [] };
|
|
6538
|
+
}
|
|
6539
|
+
assert(
|
|
6540
|
+
typeof aggregations !== "string",
|
|
6541
|
+
"Unsupported tileset SQL aggregation"
|
|
6542
|
+
);
|
|
6543
|
+
const result = {};
|
|
6544
|
+
const usedAliases = /* @__PURE__ */ new Set();
|
|
6545
|
+
for (const { column, operation: operation2, alias } of aggregations) {
|
|
6546
|
+
if (column && column !== "*" || operation2 !== AggregationTypes.Count) {
|
|
6547
|
+
assertColumn(this._features, column);
|
|
6548
|
+
}
|
|
6549
|
+
const aliasKey = alias.toLowerCase();
|
|
6550
|
+
assert(!usedAliases.has(aliasKey), `Duplicate alias: ${aliasKey}`);
|
|
6551
|
+
usedAliases.add(aliasKey);
|
|
6552
|
+
const targetOperation = aggregationFunctions[operation2];
|
|
6553
|
+
assert(targetOperation, `Unsupported operation: ${operation2}`);
|
|
6554
|
+
result[alias] = targetOperation(filteredFeatures, column);
|
|
6555
|
+
}
|
|
6556
|
+
return { rows: [result] };
|
|
6557
|
+
}
|
|
6524
6558
|
/** @experimental */
|
|
6525
6559
|
async getExtent() {
|
|
6526
6560
|
return Promise.reject(new Error("not implemented"));
|