-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: connection list from agent (#578)
* feat: added connection list from agent Signed-off-by: tipusinghaw <[email protected]> * feat: agent connection list API Signed-off-by: tipusinghaw <[email protected]> --------- Signed-off-by: tipusinghaw <[email protected]> Signed-off-by: KulkarniShashank <[email protected]>
- Loading branch information
1 parent
d1f09a5
commit df101fe
Showing
10 changed files
with
321 additions
and
148 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
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
94 changes: 57 additions & 37 deletions
94
apps/api-gateway/src/connection/dtos/get-all-connections.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,61 @@ | ||
import { ApiProperty } from "@nestjs/swagger"; | ||
import { Transform, Type } from "class-transformer"; | ||
import { IsEnum, IsOptional } from "class-validator"; | ||
import { SortValue } from "../../enum"; | ||
import { trim } from "@credebl/common/cast.helper"; | ||
import { SortFields } from "apps/connection/src/enum/connection.enum"; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Transform, Type } from 'class-transformer'; | ||
import { IsEnum, IsOptional } from 'class-validator'; | ||
import { SortValue } from '../../enum'; | ||
import { trim } from '@credebl/common/cast.helper'; | ||
import { SortFields } from 'apps/connection/src/enum/connection.enum'; | ||
|
||
export class GetAllConnectionsDto { | ||
|
||
@ApiProperty({ required: false, example: '1' }) | ||
@IsOptional() | ||
pageNumber: number = 1; | ||
|
||
@ApiProperty({ required: false, example: '10' }) | ||
@IsOptional() | ||
pageSize: number = 10; | ||
|
||
@ApiProperty({ required: false }) | ||
@IsOptional() | ||
@Transform(({ value }) => trim(value)) | ||
@Type(() => String) | ||
searchByText: string = ''; | ||
|
||
@ApiProperty({ | ||
required: false | ||
}) | ||
@Transform(({ value }) => trim(value)) | ||
@IsOptional() | ||
@IsEnum(SortFields) | ||
sortField: string = SortFields.CREATED_DATE_TIME; | ||
|
||
@ApiProperty({ | ||
enum: [SortValue.DESC, SortValue.ASC], | ||
required: false | ||
}) | ||
@Transform(({ value }) => trim(value)) | ||
@IsOptional() | ||
@IsEnum(SortValue) | ||
sortBy: string = SortValue.DESC; | ||
@ApiProperty({ required: false, example: '1' }) | ||
@IsOptional() | ||
pageNumber: number = 1; | ||
|
||
@ApiProperty({ required: false, example: '10' }) | ||
@IsOptional() | ||
pageSize: number = 10; | ||
|
||
@ApiProperty({ required: false }) | ||
@IsOptional() | ||
@Transform(({ value }) => trim(value)) | ||
@Type(() => String) | ||
searchByText: string = ''; | ||
|
||
@ApiProperty({ | ||
required: false | ||
}) | ||
@Transform(({ value }) => trim(value)) | ||
@IsOptional() | ||
@IsEnum(SortFields) | ||
sortField: string = SortFields.CREATED_DATE_TIME; | ||
|
||
@ApiProperty({ | ||
enum: [SortValue.DESC, SortValue.ASC], | ||
required: false | ||
}) | ||
@Transform(({ value }) => trim(value)) | ||
@IsOptional() | ||
@IsEnum(SortValue) | ||
sortBy: string = SortValue.DESC; | ||
} | ||
|
||
export class GetAllAgentConnectionsDto { | ||
@ApiProperty({ required: false, example: 'e315f30d-9beb-4068-aea4-abb5fe5eecb1' }) | ||
@IsOptional() | ||
outOfBandId: string = ''; | ||
|
||
@ApiProperty({ required: false, example: 'Test' }) | ||
@IsOptional() | ||
alias: string = ''; | ||
|
||
@ApiProperty({ required: false, example: 'did:example:e315f30d-9beb-4068-aea4-abb5fe5eecb1' }) | ||
@IsOptional() | ||
myDid: string = ''; | ||
|
||
@ApiProperty({ required: false, example: 'did:example:e315f30d-9beb-4068-aea4-abb5fe5eecb1' }) | ||
@IsOptional() | ||
theirDid: string = ''; | ||
|
||
@ApiProperty({ required: false, example: 'Bob' }) | ||
@IsOptional() | ||
theirLabel: string = ''; | ||
} |
47 changes: 28 additions & 19 deletions
47
apps/api-gateway/src/interfaces/IConnectionSearch.interface.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 |
---|---|---|
@@ -1,25 +1,34 @@ | ||
import { IUserRequestInterface } from './IUserRequestInterface'; | ||
|
||
export interface IConnectionSearchCriteria { | ||
pageNumber: number; | ||
pageSize: number; | ||
sortField: string; | ||
sortBy: string; | ||
searchByText: string; | ||
user?: IUserRequestInterface | ||
pageNumber: number; | ||
pageSize: number; | ||
sortField: string; | ||
sortBy: string; | ||
searchByText: string; | ||
user?: IUserRequestInterface; | ||
} | ||
|
||
export interface IConnectionDetailsById { | ||
id: string; | ||
createdAt: string; | ||
did: string; | ||
theirDid: string; | ||
theirLabel: string; | ||
state: string; | ||
role: string; | ||
autoAcceptConnection: boolean; | ||
threadId: string; | ||
protocol: string; | ||
outOfBandId: string; | ||
updatedAt: string; | ||
} | ||
id: string; | ||
createdAt: string; | ||
did: string; | ||
theirDid: string; | ||
theirLabel: string; | ||
state: string; | ||
role: string; | ||
autoAcceptConnection: boolean; | ||
threadId: string; | ||
protocol: string; | ||
outOfBandId: string; | ||
updatedAt: string; | ||
} | ||
|
||
export interface AgentConnectionSearchCriteria { | ||
outOfBandId?: string; | ||
alias?: string; | ||
state?: string; | ||
myDid?: string; | ||
theirDid?: string; | ||
theirLabel?: string; | ||
} |
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.