Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit baedf53

Browse files
author
Дмитрий Фалько
committed
Update nest and other packages to latest versions
1 parent e5cb86e commit baedf53

File tree

9 files changed

+8673
-5457
lines changed

9 files changed

+8673
-5457
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ lerna-debug.log*
3434
!.vscode/extensions.json
3535

3636
# Local enviroment
37-
.env
37+
.env
38+
39+
# Coverage
40+
src/coverage/

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
- Перенести сюда скрипт сканирующий Yandex.
2+
- Переименовать provider -> service
3+
- Делать updateIndex на старте приложения, что бы работал неточный поиск
24
- Сделать индексы
35
- Индекс по name сериала
46
- ИНдекс по alias сериала

package-lock.json

Lines changed: 8620 additions & 5417 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,57 @@
2323
"migration": "ts-node src/script/migration.ts"
2424
},
2525
"dependencies": {
26-
"@nestjs/common": "^6.11.11",
27-
"@nestjs/config": "^0.2.4",
28-
"@nestjs/core": "^6.11.11",
29-
"@nestjs/microservices": "^6.11.11",
30-
"@nestjs/mongoose": "^6.4.0",
31-
"@nestjs/platform-express": "^6.11.11",
26+
"@nestjs/common": "^7.4.4",
27+
"@nestjs/config": "^0.5.0",
28+
"@nestjs/core": "^7.4.4",
29+
"@nestjs/microservices": "^7.4.4",
30+
"@nestjs/mongoose": "^7.0.2",
31+
"@nestjs/platform-express": "^7.4.4",
3232
"@nestjs/schedule": "^0.4.0",
33-
"@ntegral/nestjs-sentry": "^1.0.3",
34-
"@types/lodash.uniqwith": "^4.5.6",
35-
"@types/mongoose": "^5.7.34",
33+
"@ntegral/nestjs-sentry": "^1.0.4",
3634
"class-transformer": "^0.3.1",
37-
"class-validator": "^0.11.1",
38-
"escape-string-regexp": "^2.0.0",
39-
"fuse.js": "^3.6.1",
35+
"class-validator": "^0.12.2",
36+
"dotenv": "^8.2.0",
37+
"escape-string-regexp": "^4.0.0",
38+
"fuse.js": "^6.4.1",
4039
"lodash.uniqwith": "^4.5.0",
41-
"mongodb": "^3.6.0",
42-
"mongoose": "^5.9.27",
40+
"mongodb": "^3.6.1",
41+
"mongoose": "^5.10.3",
4342
"mongoose-autopopulate": "^0.12.2",
4443
"redis": "^3.0.2",
4544
"reflect-metadata": "^0.1.13",
4645
"rimraf": "^3.0.2",
47-
"rxjs": "^6.6.2"
46+
"rxjs": "^6.6.2",
47+
"yandex-money-sdk": "^0.1.7"
4848
},
4949
"devDependencies": {
50-
"@nestjs/cli": "^7.4.1",
51-
"@nestjs/schematics": "^7.0.1",
52-
"@nestjs/testing": "^6.11.11",
53-
"@types/express": "^4.17.7",
54-
"@types/jest": "^24.0.25",
55-
"@types/node": "^13.13.15",
50+
"@nestjs/cli": "^7.5.1",
51+
"@nestjs/schematics": "^7.1.1",
52+
"@nestjs/testing": "^7.4.4",
53+
"@sentry/types": "^5.22.3",
54+
"@types/express": "^4.17.8",
55+
"@types/jest": "^26.0.13",
56+
"@types/lodash.uniqwith": "^4.5.6",
57+
"@types/mongoose": "^5.7.36",
58+
"@types/node": "^14.6.4",
5659
"@types/supertest": "^2.0.10",
57-
"@typescript-eslint/eslint-plugin": "^2.34.0",
58-
"@typescript-eslint/parser": "^2.34.0",
60+
"@types/yandex-money-sdk": "0.0.28",
61+
"@typescript-eslint/eslint-plugin": "^4.0.1",
62+
"@typescript-eslint/parser": "^4.0.1",
5963
"coveralls": "^3.1.0",
60-
"eslint": "^6.7.2",
64+
"eslint": "^7.8.1",
6165
"eslint-config-prettier": "^6.7.0",
6266
"eslint-plugin-import": "^2.22.0",
6367
"eslint-plugin-prettier": "^3.1.4",
64-
"jest": "^24.9.0",
68+
"jest": "^26.4.2",
6569
"ora-progress-bar": "^1.2.1",
66-
"prettier": "^1.18.2",
70+
"prettier": "^2.1.1",
6771
"supertest": "^4.0.2",
68-
"ts-jest": "^24.3.0",
69-
"ts-loader": "^6.2.2",
70-
"ts-node": "^8.10.2",
72+
"ts-jest": "^26.3.0",
73+
"ts-loader": "^8.0.3",
74+
"ts-node": "^9.0.0",
7175
"tsconfig-paths": "^3.9.0",
72-
"typescript": "^3.9.7"
76+
"typescript": "^4.0.2"
7377
},
7478
"jest": {
7579
"moduleFileExtensions": [

src/application/ui/ui.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ import { SubscriptionModule } from '../../domains/subscription/subscription.modu
88
import { SerialModule } from '../../domains/serial/serial.module';
99
import { ContextModule } from '../../domains/context/context.module';
1010
import { ConfigService } from '@nestjs/config';
11-
import { RedisOptions } from '@nestjs/common/interfaces/microservices/microservice-configuration.interface';
1211

1312
@Module({
1413
imports: [UserModule, SubscriptionModule, SerialModule, ContextModule],
1514
providers: [
1615
{
1716
provide: TRANSPORT_SERVICE,
1817
useFactory: (config: ConfigService): ClientProxy => {
19-
const options: RedisOptions = {
18+
const options: any = {
2019
transport: Transport.REDIS,
2120
options: {
2221
url: config.get<string>('REDIS_URI'),

src/domains/serial/serial.provider.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ export class SerialService {
6363
}
6464

6565
const notExactMatch = this.fuse.search(name) as Array<{
66-
_id: Schema.Types.ObjectId;
67-
name: string;
66+
item: {
67+
_id: Schema.Types.ObjectId;
68+
name: string;
69+
},
70+
refIndex: number
6871
}>;
69-
const ids = notExactMatch.map((serial) => serial._id.toString());
72+
console.log(notExactMatch);
73+
const ids = notExactMatch.map((result) => result.item._id.toString());
7074

7175
return this.findByIds(ids);
7276
}

src/domains/user/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './user.module';
2+
export * from './user.provider';

src/domains/user/user.module.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { Module } from '@nestjs/common';
2+
import { ConfigService } from '@nestjs/config';
23
import { Transport, ClientProxyFactory } from '@nestjs/microservices';
34
import { MongooseModule } from '@nestjs/mongoose';
45
import { TRANSPORT_SERVICE, USER_COLLECTION } from '../../app.constants';
56
import { UserService } from './user.provider';
67
import { UserSchema } from '../../schemas';
78
import { SubscriptionModule } from '../subscription/subscription.module';
8-
import { ConfigService } from '@nestjs/config';
9-
import { RedisOptions } from '@nestjs/common/interfaces/microservices/microservice-configuration.interface';
109

1110
@Module({
1211
imports: [
@@ -17,7 +16,7 @@ import { RedisOptions } from '@nestjs/common/interfaces/microservices/microservi
1716
{
1817
provide: TRANSPORT_SERVICE,
1918
useFactory: (config: ConfigService) => {
20-
const options: RedisOptions = {
19+
const options: any = {
2120
transport: Transport.REDIS,
2221
options: {
2322
url: config.get<string>('REDIS_URI'),

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'reflect-metadata';
22
import { NestFactory } from '@nestjs/core';
33
import { AppModule } from './app.module';
4-
import { Transport } from '@nestjs/common/enums/transport.enum';
54
import { Logger } from '@nestjs/common';
5+
import { Transport } from '@nestjs/microservices';
66

77
async function bootstrap(): Promise<void> {
88
const app = await NestFactory.createMicroservice(AppModule, {

0 commit comments

Comments
 (0)