Skip to content

Commit 7c858c1

Browse files
committed
chore: Update npm dependencies to latest versions
1 parent 3cdc058 commit 7c858c1

File tree

8 files changed

+63
-30
lines changed

8 files changed

+63
-30
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@nestjs/passport": "^10.0.3",
5959
"@nestjs/platform-express": "^10.3.1",
6060
"@nestjs/swagger": "^7.1.16",
61-
"@streamkits/nestjs_module_scrud": "^0.0.18",
61+
"@the-software-compagny/nestjs_module_restools": "^0.0.5",
6262
"ajv": "^8.12.0",
6363
"ajv-errors": "^3.0.0",
6464
"argon2": "^0.40.1",
@@ -151,4 +151,4 @@
151151
"downloadUrl": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian10-5.0.22.tgz"
152152
}
153153
}
154-
}
154+
}

src/app.controller.ts

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
import { Controller, Get, Res } from '@nestjs/common';
1+
import { BadRequestException, Controller, Get, Param, Query, Res } from '@nestjs/common';
22
import { AppService } from './app.service';
33
import { Response } from 'express';
44
import { AbstractController } from '~/_common/abstracts/abstract.controller';
55
import { Public } from './_common/decorators/public.decorator';
6-
import { ApiBasicAuth, ApiBearerAuth, ApiOperation, ApiResponse } from '@nestjs/swagger';
6+
import { ApiBearerAuth, ApiOperation, ApiResponse } from '@nestjs/swagger';
7+
8+
interface GithubUpdate {
9+
name?: string;
10+
commit?: {
11+
sha?: string;
12+
url?: string;
13+
};
14+
zipball_url?: string;
15+
tarball_url?: string;
16+
node_id?: string;
17+
}
718

819
@Public()
920
@Controller()
@@ -22,4 +33,34 @@ export class AppController extends AbstractController {
2233
...this.appService.getInfo(),
2334
});
2435
}
36+
37+
@Get('/get-update/:project(sesame-orchestrator|sesame-daemon|sesame-app-manager)')
38+
public async update(
39+
@Res() res: Response,
40+
@Param('project') project: string,
41+
@Query('current') current: string,
42+
): Promise<Response> {
43+
const update = await fetch(`https://api.github.com/repos/Libertech-FR/${project}/tags`)
44+
const data: GithubUpdate = await update.json()
45+
const lastVersion = data[0].name.replace(/^v/, '')
46+
const pkgInfo = this.appService.getInfo()
47+
const currentVersion = current || pkgInfo.version
48+
49+
if (project !== pkgInfo.name) {
50+
if (!/[0-9]+\.[0-9]+\.[0-9]+/.test(current)) {
51+
throw new BadRequestException('Invalid version for current parameter')
52+
}
53+
}
54+
55+
const [currentMajor, currentMinor, currentPatch] = lastVersion.split('.').map(Number)
56+
const [lastMajor, lastMinor, lastPatch] = currentVersion.split('.').map(Number)
57+
const updateAvailable = currentMajor > lastMajor || currentMinor > lastMinor || currentPatch > lastPatch
58+
59+
return res.json({
60+
project,
61+
updateAvailable,
62+
currentVersion,
63+
lastVersion,
64+
});
65+
}
2566
}

src/core/agents/agents.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Body, Controller, Delete, Get, HttpStatus, Param, Patch, Post, Res } from '@nestjs/common';
22
import { ApiParam, ApiTags } from '@nestjs/swagger';
3-
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@streamkits/nestjs_module_scrud';
3+
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@the-software-compagny/nestjs_module_restools';
44
import { Response } from 'express';
55
import { Types } from 'mongoose';
66
import { AbstractController } from '~/_common/abstracts/abstract.controller';

src/core/form/form.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
SearchFilterOptions,
1010
FilterOptions,
1111
ObjectIdValidationPipe,
12-
} from '@streamkits/nestjs_module_scrud';
12+
} from '@the-software-compagny/nestjs_module_restools';
1313
import { Types } from 'mongoose';
1414
import { ApiCreateDecorator } from '~/_common/decorators/api-create.decorator';
1515
import { ApiDeletedResponseDecorator } from '~/_common/decorators/api-deleted-response.decorator';

src/core/jobs/jobs.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Controller, Get, HttpStatus, Param, Req, Res } from '@nestjs/common';
22
import { ApiParam, ApiTags } from '@nestjs/swagger';
3-
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@streamkits/nestjs_module_scrud';
3+
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@the-software-compagny/nestjs_module_restools';
44
import { Request, Response } from 'express';
55
import { Types } from 'mongoose';
66
import { AbstractController } from '~/_common/abstracts/abstract.controller';

src/core/keyrings/keyrings.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ObjectIdValidationPipe } from '~/_common/pipes/object-id-validation.pip
77
import { Response } from 'express';
88
import { ApiReadResponseDecorator } from '~/_common/decorators/api-read-response.decorator';
99
import { PickProjectionHelper } from '~/_common/helpers/pick-projection.helper';
10-
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@streamkits/nestjs_module_scrud';
10+
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@the-software-compagny/nestjs_module_restools';
1111
import { ApiCreateDecorator } from '~/_common/decorators/api-create.decorator';
1212
import { ApiPaginatedDecorator } from '~/_common/decorators/api-paginated.decorator';
1313
import { PartialProjectionType } from '~/_common/types/partial-projection.type';

src/management/identities/identities.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
Res
1313
} from '@nestjs/common';
1414
import { ApiOperation, ApiParam, ApiTags } from '@nestjs/swagger';
15-
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@streamkits/nestjs_module_scrud';
15+
import { FilterOptions, FilterSchema, SearchFilterOptions, SearchFilterSchema } from '@the-software-compagny/nestjs_module_restools';
1616
import { Response } from 'express';
1717
import { Document, Types, isValidObjectId } from 'mongoose';
1818
import { AbstractController } from '~/_common/abstracts/abstract.controller';

yarn.lock

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,18 +2047,6 @@
20472047
dependencies:
20482048
"@sinonjs/commons" "^3.0.0"
20492049

2050-
"@streamkits/nestjs_module_scrud@^0.0.18":
2051-
version "0.0.18"
2052-
resolved "https://registry.yarnpkg.com/@streamkits/nestjs_module_scrud/-/nestjs_module_scrud-0.0.18.tgz#bfc877f16791db9d9932ea509367fcb09c000580"
2053-
integrity sha512-32b7MJ8lYsldi5ucN+DXhBqsq+P6AqBUEl+Ncf8KasP0USVkaf1VnFc+wYPYHBBcXp/WlpTDcWmdAOOHi/ufLg==
2054-
dependencies:
2055-
class-transformer "^0.5.1"
2056-
class-validator "^0.14.0"
2057-
dayjs "^1.11.7"
2058-
decorator "^0.0.1"
2059-
deepmerge "^4.3.1"
2060-
is-plain-object "^5.0.0"
2061-
20622050
"@swc/cli@^0.3.10":
20632051
version "0.3.10"
20642052
resolved "https://registry.yarnpkg.com/@swc/cli/-/cli-0.3.10.tgz#ab84894e54762e1fafc51b1e66a75ad3319a479a"
@@ -2162,6 +2150,15 @@
21622150
dependencies:
21632151
defer-to-connect "^2.0.0"
21642152

2153+
"@the-software-compagny/nestjs_module_restools@^0.0.5":
2154+
version "0.0.5"
2155+
resolved "https://registry.yarnpkg.com/@the-software-compagny/nestjs_module_restools/-/nestjs_module_restools-0.0.5.tgz#9af0a5861de4eeb17f2e10f0dcc1509349e68663"
2156+
integrity sha512-PyjZ21xNWk0WhLjC13LI4nrmvqMzXdOBpfSK/3Um8WLmmvhcO9GofhQn59OgE8bExZzhcI6T+ti9sGg8Ha6hQw==
2157+
dependencies:
2158+
dayjs "^1.11.11"
2159+
deepmerge "^4.3.1"
2160+
is-plain-object "^5.0.0"
2161+
21652162
"@thednp/event-listener@^2.0.4":
21662163
version "2.0.4"
21672164
resolved "https://registry.yarnpkg.com/@thednp/event-listener/-/event-listener-2.0.4.tgz#76400393849e6e5d1e7cb8bcf23e3f184dfe1865"
@@ -4096,10 +4093,10 @@ dashify@^2.0.0:
40964093
resolved "https://registry.yarnpkg.com/dashify/-/dashify-2.0.0.tgz#fff270ca2868ca427fee571de35691d6e437a648"
40974094
integrity sha512-hpA5C/YrPjucXypHPPc0oJ1l9Hf6wWbiOL7Ik42cxnsUOhWiCB/fylKbKqqJalW9FgkNQCw16YO8uW9Hs0Iy1A==
40984095

4099-
dayjs@^1.11.7:
4100-
version "1.11.10"
4101-
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.10.tgz#68acea85317a6e164457d6d6947564029a6a16a0"
4102-
integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==
4096+
dayjs@^1.11.11:
4097+
version "1.11.11"
4098+
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.11.tgz#dfe0e9d54c5f8b68ccf8ca5f72ac603e7e5ed59e"
4099+
integrity sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==
41034100

41044101
debug@2.6.9:
41054102
version "2.6.9"
@@ -4136,11 +4133,6 @@ decompress-response@^6.0.0:
41364133
dependencies:
41374134
mimic-response "^3.1.0"
41384135

4139-
decorator@^0.0.1:
4140-
version "0.0.1"
4141-
resolved "https://registry.yarnpkg.com/decorator/-/decorator-0.0.1.tgz#84b26f2b688fe5f3fd33079b3df8d8c5f02b4eb4"
4142-
integrity sha512-IidwJWjzkth3WahRZECA8EuLJrHfwOqO/EXd6Sx3kLL90s1ZAtTc5YvusKG6cblHQenh+6UjO6ErZTCbzkr71w==
4143-
41444136
dedent@^1.0.0:
41454137
version "1.5.1"
41464138
resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff"

0 commit comments

Comments
 (0)