Compare commits

...

2 Commits

Author SHA1 Message Date
standardci
9492da6789 chore(release): publish new version
- @standardnotes/analytics@2.8.2
2022-11-10 10:54:18 +00:00
Karol Sójko
fce47a0a37 fix(analytics): add monthly mrr to the report 2022-11-10 11:52:24 +01:00
4 changed files with 26 additions and 4 deletions

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.8.2](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.8.1...@standardnotes/analytics@2.8.2) (2022-11-10)
### Bug Fixes
* **analytics:** add monthly mrr to the report ([fce47a0](https://github.com/standardnotes/server/commit/fce47a0a37a67b3edf3ea0b6ccda43c54dbd9870))
## [2.8.1](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.8.0...@standardnotes/analytics@2.8.1) (2022-11-10)
### Bug Fixes

View File

@@ -100,8 +100,6 @@ const requestReport = async (
})
}
const thirtyDaysStatisticsNames = [StatisticsMeasure.MRR]
const statisticsOverTime: Array<{
name: string
period: number
@@ -110,6 +108,8 @@ const requestReport = async (
totalCount: number
}>
}> = []
const thirtyDaysStatisticsNames = [StatisticsMeasure.MRR]
for (const statisticName of thirtyDaysStatisticsNames) {
statisticsOverTime.push({
name: statisticName,
@@ -118,6 +118,15 @@ const requestReport = async (
})
}
const monthlyStatisticsNames = [StatisticsMeasure.MRR]
for (const statisticName of monthlyStatisticsNames) {
statisticsOverTime.push({
name: statisticName,
period: Period.ThisYear,
counts: await statisticsStore.calculateTotalCountOverPeriod(statisticName, Period.ThisYear),
})
}
const statisticMeasureNames = [
StatisticsMeasure.Income,
StatisticsMeasure.PlusSubscriptionInitialAnnualPaymentsIncome,

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/analytics",
"version": "2.8.1",
"version": "2.8.2",
"engines": {
"node": ">=14.0.0 <17.0.0"
},

View File

@@ -14,7 +14,14 @@ export class RedisStatisticsStore implements StatisticsStoreInterface {
period: Period,
): Promise<{ periodKey: string; totalCount: number }[]> {
if (
![Period.Last30Days, Period.Q1ThisYear, Period.Q2ThisYear, Period.Q3ThisYear, Period.Q4ThisYear].includes(period)
![
Period.Last30Days,
Period.ThisYear,
Period.Q1ThisYear,
Period.Q2ThisYear,
Period.Q3ThisYear,
Period.Q4ThisYear,
].includes(period)
) {
throw new Error(`Unsuporrted period: ${period}`)
}