Skip to content

Commit

Permalink
chore: Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Sep 5, 2024
1 parent fa25866 commit c5f1330
Show file tree
Hide file tree
Showing 27 changed files with 2,512 additions and 221 deletions.
1,755 changes: 1,755 additions & 0 deletions apps/api/package-lock.json

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions apps/api/src/socket/change-notifier.socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export default class ChangeNotifier
)
}

async handleConnection(client: Socket, ...args: any[]) {
this.logger.log(`Client connected: ${client.id}. Data: ${args}`)
async handleConnection(client: Socket) {
this.logger.log(`Client connected: ${client.id}.`)
}

async handleDisconnect(client: Socket) {
Expand All @@ -102,7 +102,12 @@ export default class ChangeNotifier
// Check if the user has access to the workspace
const workspace = await this.prisma.workspace.findFirst({
where: {
name: data.workspaceName
name: data.workspaceName,
members: {
some: {
userId: user.id
}
}
}
})
await this.authorityCheckerService.checkAuthorityOverWorkspace({
Expand All @@ -115,7 +120,8 @@ export default class ChangeNotifier
// Check if the user has access to the project
const project = await this.prisma.project.findFirst({
where: {
name: data.projectName
name: data.projectName,
workspaceId: workspace.id
}
})
await this.authorityCheckerService.checkAuthorityOverProject({
Expand All @@ -128,7 +134,8 @@ export default class ChangeNotifier
// Check if the user has access to the environment
const environment = await this.prisma.environment.findFirst({
where: {
name: data.environmentName
name: data.environmentName,
projectId: project.id
}
})
await this.authorityCheckerService.checkAuthorityOverEnvironment({
Expand All @@ -151,7 +158,9 @@ export default class ChangeNotifier
client.emit('client-registered', clientRegisteredResponse)

this.logger.log(
`Client registered: ${client.id} for configuration: ${clientRegisteredResponse}`
`Client registered: ${client.id} for configuration: ${JSON.stringify(
clientRegisteredResponse
)}`
)
}

Expand Down
50 changes: 24 additions & 26 deletions apps/cli/.swcrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"dynamicImport": true,
"decorators": false
},
"transform": null,
"target": "es2016",
"loose": false,
"externalHelpers": false,
"keepClassNames": false,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false,
"dynamicImport": true
},
"module": {
"type": "commonjs",
"strict": false,
"strictMode": false,
"noInterop": false,
"lazy": false
},
"minify": true
}
"target": "es2022",
"loose": false,
"externalHelpers": false,
"keepClassNames": false,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"module": {
"type": "es6",
"strict": false,
"strictMode": false,
"noInterop": false,
"lazy": false
},
"minify": true
}
Loading

0 comments on commit c5f1330

Please sign in to comment.