Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions workers/email/src/templates/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ Twig.extendFilter('prettyPath', (value = ''): string => {
* @param {number} maxLen - max length of string
* @returns {string}
*/
Twig.extendFilter('leftTrim', (value: string, maxLen: number): string => {
Twig.extendFilter('leftTrim', ((value: string, maxLen: number): string => {
if (value.length > maxLen) {
return '…' + value.slice(value.length - maxLen);
}

return value;
});
}) as unknown as (value: any, params: false | any[]) => string); // tmp case. We need to check if TS says correct types or our implementation is correct

/**
* Prettify time to show in 'DD days HH hours MM minutes"
Expand Down
5 changes: 4 additions & 1 deletion workers/limiter/tests/plans.mock.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { PlanDBScheme } from '@hawk.so/types';
import { ObjectId } from 'mongodb';

/**
* Mocked plans with different events limits
*/
export const mockedPlans = {
export const mockedPlans: { [key: string]: PlanDBScheme } = {
/**
* Plan #1 with small limit
*/
eventsLimit10: {
_id: new ObjectId('5e4ff528628a6c714515f4dc'),
name: 'Test plan #1',
monthlyCharge: 10,
monthlyChargeCurrency: 'RUB',
eventsLimit: 10,
isDefault: true,
},
Expand All @@ -22,6 +24,7 @@ export const mockedPlans = {
_id: new ObjectId('5e4ff528738a6c714515f4dc'),
name: 'Test plan #2',
monthlyCharge: 10,
monthlyChargeCurrency: 'RUB',
eventsLimit: 10000,
isDefault: false,
},
Expand Down
2 changes: 2 additions & 0 deletions workers/notifier/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Url for connecting to Redis
REDIS_URL=redis://redis:6379
6 changes: 5 additions & 1 deletion workers/notifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
"version": "1.0.0",
"main": "src/index.ts",
"license": "MIT",
"workerType": "notifier"
"workerType": "notifier",
"dependencies": {
"@types/redis": "^2.8.28",
"redis": "^4.7.0"
}
}
270 changes: 0 additions & 270 deletions workers/notifier/src/buffer.ts

This file was deleted.

Loading
Loading