2023-06-06 14:03:14 +00:00
|
|
|
import { legacyOverlayDefinitions } from './src/components/overlays/overlay-definitions';
|
2023-01-31 10:56:40 +00:00
|
|
|
|
|
|
|
let filters: any[] = ['any'];
|
|
|
|
|
2023-06-06 14:03:14 +00:00
|
|
|
Object.keys(legacyOverlayDefinitions).forEach((key) => {
|
|
|
|
const definition = legacyOverlayDefinitions[key];
|
2023-01-31 10:56:40 +00:00
|
|
|
let filter: any[] = ['in', key];
|
|
|
|
Object.keys(definition).forEach((subKey) => {
|
|
|
|
filter = [...filter, subKey];
|
|
|
|
});
|
|
|
|
filters = [...filters, filter];
|
|
|
|
});
|
|
|
|
|
2023-06-05 09:17:01 +00:00
|
|
|
// One timer
|
|
|
|
|
2023-06-09 10:21:11 +00:00
|
|
|
let tags = {};
|
2023-06-05 09:17:01 +00:00
|
|
|
let overlays = {};
|
|
|
|
|
2023-06-09 10:21:11 +00:00
|
|
|
for (const tagName of Object.keys(legacyOverlayDefinitions)) {
|
|
|
|
for (const tagValue of Object.keys(legacyOverlayDefinitions[tagName])) {
|
|
|
|
tags[tagValue] = { name: tagName, value: tagValue };
|
|
|
|
for (const activity of Object.keys(
|
|
|
|
legacyOverlayDefinitions[tagName][tagValue]
|
|
|
|
)) {
|
|
|
|
if (!overlays[activity]) {
|
|
|
|
overlays[activity] = {};
|
|
|
|
}
|
|
|
|
for (const category of Object.keys(
|
|
|
|
legacyOverlayDefinitions[tagName][tagValue][activity]
|
|
|
|
)) {
|
|
|
|
if (!overlays[activity][category]) {
|
|
|
|
overlays[activity][category] = [];
|
|
|
|
}
|
|
|
|
overlays[activity][category].push(tagValue);
|
2023-06-05 09:17:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log({
|
|
|
|
caller: 'onetimer / result',
|
2023-06-09 10:21:11 +00:00
|
|
|
tags: JSON.stringify(tags),
|
2023-06-05 09:17:01 +00:00
|
|
|
overlays: JSON.stringify(overlays),
|
|
|
|
});
|
|
|
|
|
|
|
|
// End of one timer
|
|
|
|
|
2023-06-09 10:21:11 +00:00
|
|
|
// console.log({
|
|
|
|
// legacyOverlayDefinitions,
|
|
|
|
// filters,
|
|
|
|
// json: JSON.stringify(filters),
|
|
|
|
// overlays: JSON.stringify(overlays),
|
|
|
|
// });
|