feat: adjust to changes of SCFacet in core v0.12.0

Closes #30
This commit is contained in:
Sebastian Lange
2019-03-20 14:32:06 +01:00
committed by Rainer Killinger
parent 6f7e23df20
commit 2f13010480
3 changed files with 15 additions and 9 deletions

14
package-lock.json generated
View File

@@ -27,14 +27,15 @@
}
},
"@openstapps/core": {
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.11.0.tgz",
"integrity": "sha512-vCT09LVDRcSELK/F5RBe6IqXWow7kolkWMADXRIW5YqvAy/BpfUhta/v+YxFk/dp+umzMmCv9tRgZRxrznStGw==",
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/@openstapps/core/-/core-0.12.0.tgz",
"integrity": "sha512-msSsSQmZOzvcUbJZDZDefFuT2MOpnHo/1Q7f1kMtjsyJaLo0oZHxQq98RUjpecXy+fW+0Vjonkrpg33hr5Xgaw==",
"requires": {
"@types/geojson": "1.0.6",
"@types/json-patch": "0.0.30",
"json-patch": "0.7.0",
"jsonschema": "1.2.4"
"jsonschema": "1.2.4",
"ts-optchain": "0.1.2"
}
},
"@openstapps/core-tools": {
@@ -3268,6 +3269,11 @@
}
}
},
"ts-optchain": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ts-optchain/-/ts-optchain-0.1.2.tgz",
"integrity": "sha512-Xs1/xpXgTQhvgjP1qLIm5LWsgwAdpRnlfrHvMTyMPCNb4MP0WgYGCnK4xJBx0l4ZM+//IDubrmHkvp6BWfZfCg=="
},
"tslib": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz",

View File

@@ -20,7 +20,7 @@
"tslint": "tslint 'src/**/*.ts'"
},
"dependencies": {
"@openstapps/core": "0.11.0",
"@openstapps/core": "0.12.0",
"@openstapps/core-tools": "0.3.0",
"@openstapps/logger": "0.0.5",
"config": "3.0.1",

View File

@@ -72,12 +72,12 @@ export function parseAggregations(
aggregationNames.forEach((aggregationName) => {
const buckets = aggregations[aggregationName].buckets;
const facet: SCFacet = {
buckets: buckets.map((bucket) => {
const facetBucket: { [value: string]: number } = {};
facetBucket[bucket.key] = bucket.doc_count;
return facetBucket;
return {
count: bucket.doc_count,
key: bucket.key,
};
}),
field: aggregationSchema[aggregationName].terms.field + '.raw',
};