diff --git a/rollup.config.mjs b/rollup.config.mjs index e0a46f1..26ab5a4 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -37,6 +37,7 @@ export default { if (/\/mathjs\//.test(id)) { code = code.replace('export const path = "expression.transform"', ''); } + code = code.replace(/\/\*\*.*?\*\//gms, ''); // strip comments since they can have stray imports/exports return code; }, }, diff --git a/src/schema/data-types.ts b/src/schema/data-types.ts index aee9a2c..f36320a 100644 --- a/src/schema/data-types.ts +++ b/src/schema/data-types.ts @@ -103,17 +103,17 @@ export function convertMatomoTypeToLooker(value: any, matomoType: string) { export function mapMatomoAggregationTypeToLooker(matomoAggregation: string): AggregationType|undefined { switch (matomoAggregation.toLowerCase()) { case 'avg': - return AggregationType.AVG; + return cc.AggregationType.AVG; case 'count': // TODO: do we really need to support count and count_distinct? does not seem to apply to matomo - return AggregationType.COUNT; + return cc.AggregationType.COUNT; case 'count_distinct': - return AggregationType.COUNT_DISTINCT; + return cc.AggregationType.COUNT_DISTINCT; case 'max': - return AggregationType.SUM; + return cc.AggregationType.SUM; case 'min': - return AggregationType.MIN; + return cc.AggregationType.MIN; case 'sum': - return AggregationType.SUM; + return cc.AggregationType.SUM; default: log(`unknown matomo aggregation type encountered: ${matomoAggregation}`); return undefined; diff --git a/src/schema/report-metadata.ts b/src/schema/report-metadata.ts index d70a2d8..de68086 100644 --- a/src/schema/report-metadata.ts +++ b/src/schema/report-metadata.ts @@ -111,7 +111,7 @@ function addMetric( if (lookerFormula) { field .setFormula(lookerFormula) - .setAggregation(AggregationType.AUTO); + .setAggregation(cc.AggregationType.AUTO); } else if (aggregationType) { field.setAggregation(aggregationType); } else {