Skip to content

Commit e837f20

Browse files
committed
chore(): fix lint
1 parent b5f3b4e commit e837f20

4 files changed

Lines changed: 32 additions & 32 deletions

File tree

migrations/20250707160120-move-timestamp-to-event-level.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ module.exports = {
2626
[
2727
{
2828
$set: {
29-
timestamp: { $toDouble: "$payload.timestamp" },
29+
timestamp: { $toDouble: '$payload.timestamp' },
3030
},
3131
},
3232
{
33-
$unset: "payload.timestamp",
33+
$unset: 'payload.timestamp',
3434
},
3535
]
3636
);
@@ -47,64 +47,64 @@ module.exports = {
4747
[
4848
{
4949
$set: {
50-
timestamp: { $toDouble: "$payload.timestamp" }, // Convert payload.timestamp to number
50+
timestamp: { $toDouble: '$payload.timestamp' }, // Convert payload.timestamp to number
5151
},
5252
},
5353
{
54-
$unset: "payload.timestamp", // Remove payload.timestamp
54+
$unset: 'payload.timestamp', // Remove payload.timestamp
5555
},
5656
]
5757
);
58-
58+
5959
const pipeline = [
6060
{
6161
$match: {
62-
$or : [
63-
{ "payload.timestamp": { $exists: false } },
62+
$or: [
63+
{ 'payload.timestamp': { $exists: false } },
6464
{ payload: { $exists: false } },
6565
],
6666
timestamp: { $exists: false },
67-
groupHash: { $exists: true }
68-
}
67+
groupHash: { $exists: true },
68+
},
6969
},
7070
{
7171
$lookup: {
7272
from: `events:${projectId}`, // dynamically referencing the events collection
73-
localField: "groupHash", // field from repetitions collection
74-
foreignField: "groupHash", // field in the events collection
75-
as: "eventData" // alias for the matched data
76-
}
73+
localField: 'groupHash', // field from repetitions collection
74+
foreignField: 'groupHash', // field in the events collection
75+
as: 'eventData', // alias for the matched data
76+
},
7777
},
7878
{
7979
$unwind: {
80-
path: "$eventData", // we expect only one match per groupHash
81-
preserveNullAndEmptyArrays: true // allow documents with no matching event
82-
}
80+
path: '$eventData', // we expect only one match per groupHash
81+
preserveNullAndEmptyArrays: true, // allow documents with no matching event
82+
},
8383
},
8484
{
8585
$match: {
86-
"eventData.timestamp": { $exists: true } // only proceed if event.timestamp exists
87-
}
86+
'eventData.timestamp': { $exists: true }, // only proceed if event.timestamp exists
87+
},
8888
},
8989
{
9090
$project: {
9191
_id: 1,
92-
eventTimestamp: { $toDouble: "$eventData.timestamp"}
93-
}
94-
}
92+
eventTimestamp: { $toDouble: '$eventData.timestamp' },
93+
},
94+
},
9595
];
96-
96+
9797
const matchedDocs = await collection.aggregate(pipeline).toArray();
9898

9999
const bulkOps = matchedDocs.map(doc => ({
100100
updateOne: {
101101
filter: { _id: doc._id },
102102
update: {
103-
$set: { timestamp: doc.eventTimestamp } // Set the timestamp from the event
104-
}
105-
}
103+
$set: { timestamp: doc.eventTimestamp }, // Set the timestamp from the event
104+
},
105+
},
106106
}));
107-
107+
108108
if (bulkOps.length > 0) {
109109
await collection.bulkWrite(bulkOps);
110110
}
@@ -136,7 +136,7 @@ module.exports = {
136136
},
137137
},
138138
{
139-
$unset: { 'timestamp': "" },
139+
$unset: { timestamp: '' },
140140
},
141141
]
142142
);
@@ -153,7 +153,7 @@ module.exports = {
153153
},
154154
},
155155
{
156-
$unset: { 'timestamp': "" },
156+
$unset: { timestamp: '' },
157157
},
158158
]
159159
);

workers/default/types/default-event-worker-task.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { CatcherMessageAccepted, CatcherMessagePayload, ErrorsCatcherType } from '@hawk.so/types';
1+
import { CatcherMessageAccepted, ErrorsCatcherType } from '@hawk.so/types';
22

33
/**
44
* Default Event Worker can process events with all types except 'errors/javascript'
55
* because it is handled by JavaScript Event Worker.
66
*/
7-
export type DefaultCatcherMessageType = Exclude<ErrorsCatcherType, 'errors/javascript'>
7+
export type DefaultCatcherMessageType = Exclude<ErrorsCatcherType, 'errors/javascript'>;
88

99
/**
1010
* Format of task for Default Event Worker

workers/grouper/tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { RedisClientType } from 'redis';
55
import { createClient } from 'redis';
66
import type { Collection } from 'mongodb';
77
import { MongoClient } from 'mongodb';
8-
import type { CatcherMessagePayload, ErrorsCatcherType, EventAddons, EventData } from '@hawk.so/types';
8+
import type { ErrorsCatcherType, EventAddons, EventData } from '@hawk.so/types';
99
import { MS_IN_SEC } from '../../../lib/utils/consts';
1010
import * as mongodb from 'mongodb';
1111
import { patch } from '@n1ru4l/json-patch-plus';

workers/javascript/types/javascript-event-worker-task.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CatcherMessageAccepted, CatcherMessagePayload } from '@hawk.so/types';
1+
import { CatcherMessageAccepted } from '@hawk.so/types';
22

33
/**
44
* Format of task for JavaScript Event Worker

0 commit comments

Comments
 (0)