-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more informative swagger
- Loading branch information
tal-rofe
committed
Jul 30, 2022
1 parent
63e06c6
commit b09928c
Showing
33 changed files
with
280 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apps/backend/src/modules/user/modules/auth/classes/responses.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ApiResponseProperty } from '@nestjs/swagger'; | ||
|
||
import type { IAutoAuthLoggedUser } from '../interfaces/user'; | ||
|
||
export class RefreshTokenResponse { | ||
@ApiResponseProperty({ | ||
type: String, | ||
example: | ||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', | ||
}) | ||
public accessToken!: string; | ||
} | ||
|
||
export class AutoLoginResponse implements IAutoAuthLoggedUser { | ||
@ApiResponseProperty({ | ||
type: String, | ||
example: | ||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c', | ||
}) | ||
public accessToken!: string; | ||
|
||
@ApiResponseProperty({ type: String, example: '62e5362119bea07115434f4a' }) | ||
public id!: string; | ||
|
||
@ApiResponseProperty({ type: String, example: 'Yazif' }) | ||
public name!: string; | ||
} |
6 changes: 6 additions & 0 deletions
6
apps/backend/src/modules/user/modules/auth/delete.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
apps/backend/src/modules/user/modules/auth/interfaces/responses.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
apps/backend/src/modules/user/modules/groups/classes/edit-label.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
apps/backend/src/modules/user/modules/groups/classes/responses.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { ApiResponseProperty } from '@nestjs/swagger'; | ||
import { PolicyLibrary } from '@prisma/client'; | ||
|
||
import type { IUserGroupGetAll, IUserGroupInlinePolicy } from '../interfaces/user-group'; | ||
|
||
class UserGroupInlinePolicyGetAll implements IUserGroupInlinePolicy { | ||
@ApiResponseProperty({ | ||
type: String, | ||
example: '62e5362119bea07115434f4a', | ||
}) | ||
public id!: string; | ||
|
||
@ApiResponseProperty({ | ||
type: String, | ||
example: 'Yazif Policy', | ||
}) | ||
public label!: string; | ||
|
||
@ApiResponseProperty({ | ||
enum: PolicyLibrary, | ||
}) | ||
public library!: PolicyLibrary; | ||
|
||
@ApiResponseProperty({ | ||
type: Number, | ||
example: 5, | ||
}) | ||
public rulesCount!: number; | ||
} | ||
|
||
class UserGroupGetAll implements IUserGroupGetAll { | ||
@ApiResponseProperty({ | ||
type: String, | ||
example: '62e5362119bea07115434f4a', | ||
}) | ||
public id!: string; | ||
|
||
@ApiResponseProperty({ | ||
type: String, | ||
example: 'Yazif Group', | ||
}) | ||
public label!: string; | ||
|
||
@ApiResponseProperty({ | ||
type: [UserGroupInlinePolicyGetAll], | ||
}) | ||
public inlinePolicies!: IUserGroupInlinePolicy[]; | ||
} | ||
|
||
export class CreateGroupResponse { | ||
@ApiResponseProperty({ | ||
type: String, | ||
example: '62e5362119bea07115434f4a', | ||
}) | ||
public groupId!: string; | ||
} | ||
|
||
export class GetAllGroupsResponse { | ||
@ApiResponseProperty({ | ||
type: [UserGroupGetAll], | ||
}) | ||
public groups!: IUserGroupGetAll[]; | ||
} |
24 changes: 18 additions & 6 deletions
24
apps/backend/src/modules/user/modules/groups/create.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
apps/backend/src/modules/user/modules/groups/delete.controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.