@carto/api-client 0.5.7-alpha.1 → 0.5.7-alpha.2
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-client.cjs +8 -2
- package/build/api-client.cjs.map +1 -1
- package/build/api-client.d.cts +10 -3
- package/build/api-client.d.ts +10 -3
- package/build/api-client.js +6 -2
- package/build/api-client.js.map +1 -1
- package/package.json +1 -1
- package/src/widget-sources/constants.ts +6 -0
- package/src/widget-sources/index.ts +1 -0
- package/src/widget-sources/types.ts +2 -2
- package/src/widget-sources/widget-remote-source.ts +3 -2
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.7-alpha.
|
|
11
|
+
"version": "0.5.7-alpha.2",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
@@ -59,8 +59,8 @@ export interface CategoryRequestOptions extends BaseRequestOptions {
|
|
|
59
59
|
operationColumn?: string;
|
|
60
60
|
/** Local only. */
|
|
61
61
|
joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
|
|
62
|
-
/**
|
|
63
|
-
|
|
62
|
+
/** Calculate `_carto_others` category for all categories after first N (N is threshold). Remote only. */
|
|
63
|
+
othersThreshold?: boolean;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -74,7 +74,8 @@ export abstract class WidgetRemoteSource<
|
|
|
74
74
|
spatialFiltersMode,
|
|
75
75
|
...params
|
|
76
76
|
} = options;
|
|
77
|
-
const {column, operation, operationColumn, operationExp,
|
|
77
|
+
const {column, operation, operationColumn, operationExp, othersThreshold} =
|
|
78
|
+
params;
|
|
78
79
|
|
|
79
80
|
if (operation === AggregationTypes.Custom) {
|
|
80
81
|
assert(operationExp, 'operationExp is required for custom operation');
|
|
@@ -94,7 +95,7 @@ export abstract class WidgetRemoteSource<
|
|
|
94
95
|
operation,
|
|
95
96
|
operationExp,
|
|
96
97
|
operationColumn: operationColumn || column,
|
|
97
|
-
|
|
98
|
+
othersThreshold,
|
|
98
99
|
},
|
|
99
100
|
opts: {signal, headers: this.props.headers},
|
|
100
101
|
}).then((res: CategoriesModelResponse) => normalizeObjectKeys(res.rows));
|