Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@standardnotes/analytics

Package Overview
Dependencies
Maintainers
6
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@standardnotes/analytics - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

1

dist/src/Domain/Analytics/AnalyticsStoreInterface.d.ts

@@ -13,2 +13,3 @@ import { Period } from '../Time/Period';

}>>;
calculateActivityTotalCountOverTime(activity: AnalyticsActivity, period: Period): Promise<number>;
}

@@ -10,2 +10,3 @@ import * as IORedis from 'ioredis';

constructor(periodKeyGenerator: PeriodKeyGeneratorInterface, redisClient: IORedis.Redis);
calculateActivityTotalCountOverTime(activity: AnalyticsActivity, period: Period): Promise<number>;
calculateActivityChangesTotalCount(activity: AnalyticsActivity, period: Period): Promise<Array<{

@@ -12,0 +13,0 @@ periodKey: string;

@@ -12,2 +12,16 @@ "use strict";

}
async calculateActivityTotalCountOverTime(activity, period) {
if (period !== Period_1.Period.Last30Days) {
throw new Error(`Unsuporrted period: ${period}`);
}
const periodKeys = this.periodKeyGenerator.getDiscretePeriodKeys(Period_1.Period.Last30Days);
let previousPeriodKey = periodKeys[0];
let intersectionPeriodKey = null;
for (let i = 0; i < periodKeys.length - 1; i++) {
intersectionPeriodKey = `${periodKeys[0]}-iteration-${i}`;
await this.redisClient.bitop('AND', `bitmap:action:${activity}:timespan:${intersectionPeriodKey}`, `bitmap:action:${activity}:timespan:${previousPeriodKey}`, `bitmap:action:${activity}:timespan:${periodKeys[i + 1]}`);
previousPeriodKey = intersectionPeriodKey;
}
return this.redisClient.bitcount(`bitmap:action:${activity}:timespan:${intersectionPeriodKey}`);
}
async calculateActivityChangesTotalCount(activity, period) {

@@ -14,0 +28,0 @@ if (period !== Period_1.Period.Last30Days) {

4

package.json
{
"name": "@standardnotes/analytics",
"version": "1.11.0",
"version": "1.12.0",
"engines": {

@@ -40,3 +40,3 @@ "node": ">=14.0.0 <17.0.0"

},
"gitHead": "a04ab5b0e8afae29be843034bc07357d824c04a8"
"gitHead": "becb386d1012b9fd33fbb143614497f899cfc10e"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc