Skip to content

Commit c6dfb77

Browse files
committed
Merge branch 'master' of github.com:codex-team/hawk.api.nodejs into feat/openai-base
2 parents 349094c + 487a5a3 commit c6dfb77

File tree

7 files changed

+20
-24
lines changed

7 files changed

+20
-24
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16.16.0
1+
v22.12.0

docker/Dockerfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-alpine as builder
1+
FROM node:22-alpine as builder
22

33
WORKDIR /usr/src/app
44
RUN apk add --no-cache git gcc g++ python3 make musl-dev
@@ -7,7 +7,7 @@ COPY package.json yarn.lock ./
77

88
RUN yarn install
99

10-
FROM node:16-alpine
10+
FROM node:22-alpine
1111

1212
WORKDIR /usr/src/app
1313

docker/Dockerfile.prod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:16-alpine as builder
1+
FROM node:22-alpine as builder
22

33
WORKDIR /usr/src/app
44
RUN apk add --no-cache git gcc g++ python3 make musl-dev
@@ -11,7 +11,7 @@ COPY . .
1111

1212
RUN yarn build
1313

14-
FROM node:16-alpine
14+
FROM node:22-alpine
1515

1616
WORKDIR /usr/src/app
1717

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hawk.api",
3-
"version": "1.2.19",
3+
"version": "1.2.22",
44
"main": "index.ts",
55
"license": "BUSL-1.1",
66
"scripts": {

src/billing/cloudpayments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export default class CloudPaymentsWebhooks {
202202
return;
203203
}
204204

205-
telegram.sendMessage(` [Billing / Check] All checks passed successfully «${workspace.name}»`, TelegramBotURLs.Money)
205+
telegram.sendMessage(`🤗 [Billing / Check] All checks passed successfully «${workspace.name}»`, TelegramBotURLs.Money)
206206
.catch(e => console.error('Error while sending message to Telegram: ' + e));
207207

208208
HawkCatcher.send(new Error('[Billing / Check] All checks passed successfully'), body as any);

src/resolvers/billingNew.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export default {
156156
* Send info to Telegram (non-blocking)
157157
*/
158158
telegram
159-
.sendMessage(` [Billing / Compose payment]
159+
.sendMessage(`👀 [Billing / Compose payment]
160160
161161
card link operation: ${isCardLinkOperation}
162162
amount: ${+plan.monthlyCharge} RUB

src/resolvers/project.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const EVENTS_GROUP_HASH_INDEX_NAME = 'groupHashUnique';
1414
const REPETITIONS_GROUP_HASH_INDEX_NAME = 'groupHash_hashed';
1515
const REPETITIONS_USER_ID_INDEX_NAME = 'userId';
1616
const EVENTS_TIMESTAMP_INDEX_NAME = 'timestamp';
17+
const EVENTS_PAYLOAD_RELEASE_INDEX_NAME = 'payloadRelease';
1718
const GROUPING_TIMESTAMP_INDEX_NAME = 'groupingTimestamp';
1819
const GROUPING_TIMESTAMP_AND_LAST_REPETITION_TIME_AND_ID_INDEX_NAME = 'groupingTimestampAndLastRepetitionTimeAndId';
1920
const GROUPING_TIMESTAMP_AND_GROUP_HASH_INDEX_NAME = 'groupingTimestampAndGroupHash';
@@ -127,6 +128,15 @@ module.exports = {
127128
name: GROUPING_TIMESTAMP_AND_LAST_REPETITION_TIME_AND_ID_INDEX_NAME,
128129
});
129130

131+
await projectEventsCollection.createIndex({
132+
'payload.release': 1,
133+
},
134+
{
135+
name: EVENTS_PAYLOAD_RELEASE_INDEX_NAME,
136+
background: true,
137+
sparse: true,
138+
});
139+
130140
await projectEventsCollection.createIndex({
131141
groupHash: 1,
132142
},
@@ -503,14 +513,7 @@ module.exports = {
503513
{ $match: { projectId: project._id.toString() } },
504514
{
505515
$project: {
506-
release: {
507-
$convert: {
508-
input: '$release',
509-
to: 'string',
510-
onError: '',
511-
onNull: '',
512-
},
513-
},
516+
release: '$release',
514517
commitsCount: { $size: { $ifNull: ['$commits', [] ] } },
515518
filesCount: { $size: { $ifNull: ['$files', [] ] } },
516519
_releaseIdSec: { $floor: { $divide: [ { $toLong: { $toDate: '$_id' } }, 1000] } },
@@ -524,14 +527,7 @@ module.exports = {
524527
{
525528
$match: {
526529
$expr: {
527-
$eq: [ {
528-
$convert: {
529-
input: '$payload.release',
530-
to: 'string',
531-
onError: '',
532-
onNull: '',
533-
},
534-
}, '$$rel'],
530+
$eq: ['$payload.release', '$$rel'],
535531
},
536532
},
537533
},

0 commit comments

Comments
 (0)