Skip to content

Commit

Permalink
merge: DEV to QA (26/07/2024) (#877)
Browse files Browse the repository at this point in the history
* fix: create organisation changes and added geo-location attribute in response

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: send email verification issue (#823)

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: bulk issuance template list response changes (#824)

* refactor: updated schema response for get API

Signed-off-by: tipusinghaw <[email protected]>

* fix: schema already exist logic

Signed-off-by: tipusinghaw <[email protected]>

* fix: schema attribute while w3c schema creation

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* feat: batch bulk issunace (#826)

* feat: batch bulk issuance

Signed-off-by: tipusinghaw <[email protected]>

* stoped queue to remove issuance data

Signed-off-by: tipusinghaw <[email protected]>

* feat: added delay for 1 min

Signed-off-by: tipusinghaw <[email protected]>

* refactor: changed batch config

Signed-off-by: tipusinghaw <[email protected]>

* feat: changed delay time for batch

Signed-off-by: tipusinghaw <[email protected]>

* feat: added batch for retry

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added common constant in libs

Signed-off-by: tipusinghaw <[email protected]>

* refactor: removed duplicate value from schema DTO

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* fix: constant issue for bulk issunace (#827)

* feat: batch bulk issuance

Signed-off-by: tipusinghaw <[email protected]>

* stoped queue to remove issuance data

Signed-off-by: tipusinghaw <[email protected]>

* feat: added delay for 1 min

Signed-off-by: tipusinghaw <[email protected]>

* refactor: changed batch config

Signed-off-by: tipusinghaw <[email protected]>

* feat: changed delay time for batch

Signed-off-by: tipusinghaw <[email protected]>

* feat: added batch for retry

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added common constant in libs

Signed-off-by: tipusinghaw <[email protected]>

* refactor: removed duplicate value from schema DTO

Signed-off-by: tipusinghaw <[email protected]>

* fix: constent issue

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: schema endorsement flow (#828)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs (#829)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* feature:added schema details in file_upload data and fix minor changes

Signed-off-by: Ganesh Nawle <[email protected]>

* feature:added schema details in file_upload data,fix minor exception changes and resovle PR conflict

Signed-off-by: Ganesh Nawle <[email protected]>

* feat: added schema details in  table

Signed-off-by: Ganesh Nawle <[email protected]>

* refactor: endorsement flow for key and web method (#831)

* refactor: endorsement flow for key and web method

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: send email for issuance

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: prisma model issue and refactored file_upload model

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue (#835)

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: prisma migration issue

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: parameter and response related bugs (#837)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix:rollback statistics changes

Signed-off-by: Ganesh Nawle <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* Fix/bugs (#839)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue for verification process (#840)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made reuqest Id parameter optional (#841)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added templateId mapping in file upload functionality

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: interface types

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added temaplateId column in file_upload table (#842)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added templateId mapping in file upload functionality

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: interface types

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* feat: changed issuance email template for EDUCRED

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:refactored preview uploaded file api changed query Param to path param

Signed-off-by: Ganesh Nawle <[email protected]>

* added-logger statement

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:Minor fixes

Signed-off-by: Ganesh Nawle <[email protected]>

* fix:removed all console logs

Signed-off-by: Ganesh Nawle <[email protected]>

* feat:refactored  api to add dynamic support to email template

Signed-off-by: Ganesh Nawle <[email protected]>

* feat: added holder guard

Signed-off-by: KulkarniShashank <[email protected]>

* feat: error message changes in user dto

Signed-off-by: KulkarniShashank <[email protected]>

* feat: create cloud wallet (#852)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* fix: add validation in the user role guard (#854)

* fix: add validation in the user role guard

Signed-off-by: KulkarniShashank <[email protected]>

* fix: modify validation in the user role guard

Signed-off-by: KulkarniShashank <[email protected]>

* fix: modify validation and error message changes in the user role guard

Signed-off-by: KulkarniShashank <[email protected]>

---------

Signed-off-by: KulkarniShashank <[email protected]>

* refactor: store holder role in user role mapping table

Signed-off-by: KulkarniShashank <[email protected]>

* feat: configure cloud base wallet

Signed-off-by: KulkarniShashank <[email protected]>

* fix: remove holder guard for base wallet configure API

Signed-off-by: KulkarniShashank <[email protected]>

* feat: implement proof presentation for holder (#860)

* feat: accept proof request by holder API

Signed-off-by: KulkarniShashank <[email protected]>

* feat: holder get proof presentation and get proof presentation by id

Signed-off-by: KulkarniShashank <[email protected]>

* refactor: changes in accept proof request and get proof request

Signed-off-by: KulkarniShashank <[email protected]>

---------

Signed-off-by: KulkarniShashank <[email protected]>

* feat: Added DID creation method for cloud wallet (#861)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

* feat: creat DID for wallet

Signed-off-by: tipusinghaw <[email protected]>

* resolve conflicts

Signed-off-by: tipusinghaw <[email protected]>

* Resolve sonar cloud issue

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* feat: create connection for holder (#863)

* feat: connection invitaion creation

Signed-off-by: KulkarniShashank <[email protected]>

* Merge branch 'develop' of https://github.com/credebl/platform into feat/connection-holder

Signed-off-by: KulkarniShashank <[email protected]>

---------

Signed-off-by: KulkarniShashank <[email protected]>

* added cloud-wallet Dockerfile

Signed-off-by: [email protected] <[email protected]>

* feat: implement credential APIs for cloud wallet (#865)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

* feat: creat DID for wallet

Signed-off-by: tipusinghaw <[email protected]>

* resolve conflicts

Signed-off-by: tipusinghaw <[email protected]>

* feat: credential APIs for cloud-wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* feat: implemented prettyvc while bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* fix: issuance process

Signed-off-by: bhavanakarwade <[email protected]>

* feat: Added basic message on cloud wallet (#868)

* feat: creat cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: added error handling logic in common file

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed nkey veriable

Signed-off-by: tipusinghaw <[email protected]>

* feat: creat DID for wallet

Signed-off-by: tipusinghaw <[email protected]>

* resolve conflicts

Signed-off-by: tipusinghaw <[email protected]>

* feat: credential APIs for cloud-wallet

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

* fix: changed create DID route

Signed-off-by: tipusinghaw <[email protected]>

* feat: added baisc message implementation in cloud wallet

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>

* wip: pretty for bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* wip: made autoacceptcredential flag always

Signed-off-by: bhavanakarwade <[email protected]>

* fix: client id and client secret encrypt and decrypt

Signed-off-by: KulkarniShashank <[email protected]>

* fix: datatype issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: dcrypted the clientId and client secret

Signed-off-by: KulkarniShashank <[email protected]>

* feat: implement prettyVc in bulk issuance porcess (#869)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added templateId mapping in file upload functionality

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: interface types

Signed-off-by: bhavanakarwade <[email protected]>

* feat: implemented prettyvc while bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* fix: issuance process

Signed-off-by: bhavanakarwade <[email protected]>

* wip: pretty for bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* wip: made autoacceptcredential flag always

Signed-off-by: bhavanakarwade <[email protected]>

* fix: datatype issue

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added agent url

Signed-off-by: bhavanakarwade <[email protected]>

* Fix/bugs (#874)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added templateId mapping in file upload functionality

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: interface types

Signed-off-by: bhavanakarwade <[email protected]>

* feat: implemented prettyvc while bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* fix: issuance process

Signed-off-by: bhavanakarwade <[email protected]>

* wip: pretty for bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* wip: made autoacceptcredential flag always

Signed-off-by: bhavanakarwade <[email protected]>

* fix: datatype issue

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added agent url

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added logs to test bulk issuance payload

Signed-off-by: bhavanakarwade <[email protected]>

* Fix/bugs (#875)

* fix: send email verification issue

Signed-off-by: bhavanakarwade <[email protected]>

* refcator: schema endorsement flow

Signed-off-by: bhavanakarwade <[email protected]>

* fix: resolved sonar lint issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: worked on sonarcloud issues

Signed-off-by: bhavanakarwade <[email protected]>

* fix: delete organization bugs

Signed-off-by: bhavanakarwade <[email protected]>

* fix: cred def id space fixes

Signed-off-by: bhavanakarwade <[email protected]>

* fix: create organization bug

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue for preview file

Signed-off-by: bhavanakarwade <[email protected]>

* fix: pagination issue

Signed-off-by: bhavanakarwade <[email protected]>

* fix: imageurl issue in verification

Signed-off-by: bhavanakarwade <[email protected]>

* fix: made request if parameter optional

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added templateId mapping in file upload functionality

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: interface types

Signed-off-by: bhavanakarwade <[email protected]>

* feat: implemented prettyvc while bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* fix: issuance process

Signed-off-by: bhavanakarwade <[email protected]>

* wip: pretty for bulk issuance

Signed-off-by: bhavanakarwade <[email protected]>

* wip: made autoacceptcredential flag always

Signed-off-by: bhavanakarwade <[email protected]>

* fix: datatype issue

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added agent url

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: added logs to test bulk issuance payload

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: bhavanakarwade <[email protected]>

* refactor: remove unnecessary code

Signed-off-by: bhavanakarwade <[email protected]>

* fix: remove unnecessary logs

Signed-off-by: bhavanakarwade <[email protected]>

---------

Signed-off-by: Ganesh Nawle <[email protected]>
Signed-off-by: bhavanakarwade <[email protected]>
Signed-off-by: tipusinghaw <[email protected]>
Signed-off-by: KulkarniShashank <[email protected]>
Signed-off-by: [email protected] <[email protected]>
Co-authored-by: Ganesh Nawle <[email protected]>
Co-authored-by: ganesh_nawle <[email protected]>
Co-authored-by: tipusinghaw <[email protected]>
Co-authored-by: shitrerohit <[email protected]>
Co-authored-by: KulkarniShashank <[email protected]>
Co-authored-by: Shashank Kulkarni <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: KambleSahil3 <[email protected]>
Co-authored-by: pallavighule <[email protected]>
Signed-off-by: KulkarniShashank <[email protected]>
  • Loading branch information
10 people committed Sep 12, 2024
1 parent 28937b8 commit 52cfdb6
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 96 deletions.
118 changes: 82 additions & 36 deletions apps/api-gateway/src/issuance/dtos/issuance.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ class Issuer {
@Type(() => String)
id: string | { id?: string };
}

class PrettyVc {
@ApiPropertyOptional()
@IsOptional()
@Transform(({ value }) => trim(value))
@IsString({ message: 'Certificate must be in string format.' })
certificate: string;

@ApiPropertyOptional({example: 'a4'})
@IsOptional()
@Transform(({ value }) => trim(value))
@IsString({ message: 'Size must be in string format.' })
size: string;

@ApiPropertyOptional({example: 'landscape'})
@IsOptional()
@Transform(({ value }) => trim(value))
@IsString({ message: 'orientation must be in string format.' })
orientation: string;
}
export class Credential {
@ApiProperty()
@IsNotEmpty({ message: 'context is required' })
Expand All @@ -35,8 +55,7 @@ export class Credential {
@Type(() => String)
@IsOptional()
id?:string;



@ApiProperty()
@ValidateNested({ each: true })
@Type(() => Issuer)
Expand All @@ -48,17 +67,22 @@ export class Credential {
@Type(() => String)
issuanceDate:string;

@ApiPropertyOptional()
@IsOptional()
@Type(() => PrettyVc)
prettyVc?: PrettyVc;

@ApiProperty()
@IsString({ message: 'expiration date should be string' })
@IsNotEmpty({ message: 'expiration date is required' })
@Type(() => String)
@IsOptional()
expirationDate?:string;

@ApiProperty()
@IsNotEmpty({ message: ' credential subject required' })
credentialSubject: SingleOrArray<JsonObject>;
[key: string]: unknown
@ApiProperty()
@IsNotEmpty({ message: ' credential subject required' })
credentialSubject: SingleOrArray<JsonObject>;
[key: string]: unknown

}

Expand Down Expand Up @@ -458,16 +482,21 @@ export class OOBCredentialDtoWithEmail {
proofPurpose: 'assertionMethod'
}
}
]
})
@IsNotEmpty({ message: 'Please provide valid attributes' })
@IsArray({ message: 'attributes should be array' })
@ArrayMaxSize(Number(process.env.OOB_BATCH_SIZE), {
message: `Limit reached (${process.env.OOB_BATCH_SIZE} credentials max). Easily handle larger batches via seamless CSV file uploads`
})
@ValidateNested({ each: true })
@Type(() => CredentialOffer)
credentialOffer: CredentialOffer[];
]
})
@IsNotEmpty({ message: 'Please provide valid attributes' })
@IsArray({ message: 'attributes should be array' })
@ArrayMaxSize(Number(process.env.OOB_BATCH_SIZE), { message: `Limit reached (${process.env.OOB_BATCH_SIZE} credentials max). Easily handle larger batches via seamless CSV file uploads` })
@ValidateNested({ each: true })
@Type(() => CredentialOffer)
credentialOffer: CredentialOffer[];

@ApiProperty({ example: 'string' })
@IsNotEmpty({ message: 'Please provide valid credential definition id' })
@IsString({ message: 'credential definition id should be string' })
@IsOptional()
@Transform(({ value }) => value.trim())
credentialDefinitionId?: string;

@ApiProperty({ example: 'string' })
@IsNotEmpty({ message: 'Please provide valid credential definition id' })
Expand Down Expand Up @@ -559,26 +588,43 @@ export class ClientDetails {
@Type(() => Boolean)
isSelectiveIssuance?: boolean = false;

userId?: string;

@ApiPropertyOptional({ example: 'https://example.com/logo.png' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsUrl({
// eslint-disable-next-line camelcase
require_protocol: true,
// eslint-disable-next-line camelcase
require_tld: true
},
{ message: 'brandLogoUrl should be a valid URL' })
organizationLogoUrl?: string;

@ApiPropertyOptional({ example: 'MyPlatform' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'platformName should be string' })
platformName?: string;

userId?: string;

@ApiPropertyOptional({ example: 'https://example.com/logo.png' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsUrl({
// eslint-disable-next-line camelcase
require_protocol: true,
// eslint-disable-next-line camelcase
require_tld: true
},
{ message: 'brandLogoUrl should be a valid URL' })
organizationLogoUrl?: string;

@ApiPropertyOptional({ example: 'MyPlatform' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'platformName should be string' })
platformName?: string;

@ApiPropertyOptional()
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'Certificate should be string' })
certificate?: string;

@ApiPropertyOptional({ example: 'a4' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'Size should be string' })
size?: string;

@ApiPropertyOptional({ example: 'landscape' })
@Transform(({ value }) => trim(value))
@IsOptional()
@IsString({ message: 'Orientation should be string' })
orientation?: string;
}

export class TemplateDetails {
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/issuance/issuance.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ async downloadBulkIssuanceCSVTemplate(
@Param('orgId') orgId: string,
@User() user: user,
@Query(new ValidationPipe({ transform: true })) query: CredentialQuery,
@Res() res: Response,
@Body() fileDetails?: object,
@UploadedFile() file?: Express.Multer.File
): Promise<Response> {
Expand Down Expand Up @@ -737,7 +738,7 @@ if (id && 'default' === issueCredentialDto.contextCorrelationId) {

const webhookUrl = await this.issueCredentialService._getWebhookUrl(issueCredentialDto.contextCorrelationId, id).catch(error => {
this.logger.debug(`error in getting webhook url ::: ${JSON.stringify(error)}`);
});
});
if (webhookUrl) {
const plainIssuanceDto = JSON.parse(JSON.stringify(issueCredentialDto));

Expand Down
4 changes: 2 additions & 2 deletions apps/api-gateway/src/issuance/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ export class IssuanceService extends BaseService {
return this.sendNatsMessage(this.issuanceProxy, 'issue-bulk-credentials', payload);
}

async retryBulkCredential(fileId: string, orgId: string, clientDetails: ClientDetails): Promise<{ response: object }> {
async retryBulkCredential(fileId: string, orgId: string, clientDetails: ClientDetails): Promise<object> {
const payload = { fileId, orgId, clientDetails };
return this.sendNats(this.issuanceProxy, 'retry-bulk-credentials', payload);
return this.sendNatsMessage(this.issuanceProxy, 'retry-bulk-credentials', payload);
}

async _getWebhookUrl(tenantId?: string, orgId?: string): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion apps/api-gateway/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function bootstrap(): Promise<void> {
const expressApp = app.getHttpAdapter().getInstance();
expressApp.set('x-powered-by', false);
app.use(express.json({ limit: '50mb' }));
app.use(express.urlencoded({ limit: '50mb' }));
app.use(express.urlencoded({ limit: '50mb', extended: true }));

app.use(function (req, res, next) {
let err = null;
Expand Down
29 changes: 15 additions & 14 deletions apps/issuance/interfaces/issuance.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,6 @@ export interface ICredential{
'@context':[];
type: string[];
prettyVc?: IPrettyVc;
issuer?: {
id: string;
};
issuanceDate?: string;
credentialSubject?: ICredentialSubject;
}

interface ICredentialSubject {
[key: string]: string;
}

export interface IOptions{
Expand Down Expand Up @@ -242,6 +233,9 @@ export interface IClientDetails {
fileName?: string;
organizationLogoUrl?: string;
platformName?: string;
certificate?: string;
size?: string;
orientation?: string;
}
export interface IIssuedCredentialsSearchInterface {
issuedCredentialsSearchCriteria: IIssuedCredentialsSearchCriteria;
Expand Down Expand Up @@ -292,6 +286,7 @@ export interface SendEmailCredentialOffer {
organizationDetails: organisation;
platformName?: string,
organizationLogoUrl?: string;
prettyVc?: IPrettyVc;
}

export interface TemplateDetailsInterface {
Expand Down Expand Up @@ -336,6 +331,9 @@ export interface IQueuePayload{
isLastData: boolean;
organizationLogoUrl?: string;
platformName?: string;
certificate?: string;
size?: string;
orientation?: string;
}

interface FileDetails {
Expand Down Expand Up @@ -368,10 +366,13 @@ export interface IDeletedFileUploadRecords {
}

export interface BulkPayloadDetails {
clientId: string,
orgId: string,
requestId?: string,
isRetry: boolean
organizationLogoUrl?: string,
clientId: string;
orgId: string;
requestId?: string;
isRetry: boolean;
organizationLogoUrl?: string;
platformName?: string;
certificate?: string;
size?: string;
orientation?: string;
}
36 changes: 24 additions & 12 deletions apps/issuance/src/issuance.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ResponseMessages } from '@credebl/common/response-messages';
import { ClientProxy, RpcException } from '@nestjs/microservices';
import { map } from 'rxjs';
import { BulkPayloadDetails, CredentialOffer, FileUpload, FileUploadData, IAttributes, IBulkPayloadObject, IClientDetails, ICreateOfferResponse, ICredentialPayload, IIssuance, IIssueData, IPattern, IQueuePayload, ISchemaAttributes, ISendOfferNatsPayload, ImportFileDetails, IssueCredentialWebhookPayload, OutOfBandCredentialOfferPayload, PreviewRequest, SchemaDetails, SendEmailCredentialOffer, TemplateDetailsInterface } from '../interfaces/issuance.interfaces';
import { IssuanceProcessState, OrgAgentType, PromiseResult, SchemaType, TemplateIdentifier} from '@credebl/enum/enum';
import { AutoAccept, IssuanceProcessState, OrgAgentType, PromiseResult, SchemaType, TemplateIdentifier, W3CSchemaDataType} from '@credebl/enum/enum';
import * as QRCode from 'qrcode';
import { OutOfBandIssuance } from '../templates/out-of-band-issuance.template';
import { EmailDto } from '@credebl/common/dtos/email.dto';
Expand Down Expand Up @@ -463,7 +463,7 @@ export class IssuanceService {
}
}

async outOfBandCredentialOffer(outOfBandCredential: OutOfBandCredentialOfferPayload, platformName?: string, organizationLogoUrl?: string): Promise<boolean> {
async outOfBandCredentialOffer(outOfBandCredential: OutOfBandCredentialOfferPayload, platformName?: string, organizationLogoUrl?: string, prettyVc?: IPrettyVc): Promise<boolean> {
try {
const {
credentialOffer,
Expand Down Expand Up @@ -566,6 +566,7 @@ async outOfBandCredentialOffer(outOfBandCredential: OutOfBandCredentialOfferPayl
organizationDetails: organisation;
platformName?: string;
organizationLogoUrl?: string;
prettyVc?: IPrettyVc;
} = {
credentialType,
protocolVersion,
Expand All @@ -583,7 +584,12 @@ async outOfBandCredentialOffer(outOfBandCredential: OutOfBandCredentialOfferPayl
emailId: emailId || '',
index: 0,
platformName: platformName || null,
organizationLogoUrl: organizationLogoUrl || null
organizationLogoUrl: organizationLogoUrl || null,
prettyVc: {
certificate: prettyVc?.certificate,
size: prettyVc?.size,
orientation: prettyVc?.orientation
}
};

if (credentialOffer) {
Expand Down Expand Up @@ -1229,7 +1235,10 @@ return newCacheKey;
isRetry,
isLastData: false,
organizationLogoUrl: bulkPayloadDetails?.organizationLogoUrl,
platformName: bulkPayloadDetails?.platformName
platformName: bulkPayloadDetails?.platformName,
certificate: bulkPayloadDetails?.certificate,
size: bulkPayloadDetails?.size,
orientation: bulkPayloadDetails?.orientation
}
}));

Expand Down Expand Up @@ -1344,7 +1353,10 @@ return newCacheKey;
requestId,
isRetry: false,
organizationLogoUrl: clientDetails?.organizationLogoUrl,
platformName: clientDetails?.platformName
platformName: clientDetails?.platformName,
certificate: clientDetails?.certificate,
size: clientDetails?.size,
orientation: clientDetails?.orientation
};

this.processInBatches(bulkPayload, bulkPayloadDetails);
Expand Down Expand Up @@ -1384,7 +1396,10 @@ return newCacheKey;
orgId,
isRetry: true,
organizationLogoUrl: clientDetails?.organizationLogoUrl,
platformName: clientDetails?.platformName
platformName: clientDetails?.platformName,
certificate: clientDetails?.certificate,
size: clientDetails?.size,
orientation: clientDetails?.orientation
};
this.processInBatches(bulkpayloadRetry, bulkPayloadDetails);
} catch (error) {
Expand Down Expand Up @@ -1459,8 +1474,8 @@ return newCacheKey;
schemaLedgerId,
credentialData: jobDetails.credential_data,
orgDid,
orgId,
isReuseConnection: true
orgId

};

prettyVc = {
Expand All @@ -1471,11 +1486,8 @@ return newCacheKey;

oobIssuancepayload = await createOobJsonldIssuancePayload(JsonldCredentialDetails, prettyVc);
}

const oobCredentials = await this.outOfBandCredentialOffer(
oobIssuancepayload, jobDetails?.platformName, jobDetails?.organizationLogoUrl
);

oobIssuancepayload, jobDetails?.platformName, jobDetails?.organizationLogoUrl, prettyVc);
if (oobCredentials) {
await this.issuanceRepository.deleteFileDataByJobId(jobDetails.id);
}
Expand Down
8 changes: 5 additions & 3 deletions libs/common/src/cast.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
registerDecorator
} from 'class-validator';
import { ResponseMessages } from './response-messages';
import { IJsonldCredential, IPrettyVc } from './interfaces/issuance.interface';

interface ToNumberOptions {
default?: number;
Expand Down Expand Up @@ -199,9 +200,9 @@ export const validateEmail = (email: string): boolean => {


// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
export const createOobJsonldIssuancePayload = (JsonldCredentialDetails: IJsonldCredential) => {
export const createOobJsonldIssuancePayload = (JsonldCredentialDetails: IJsonldCredential, prettyVc: IPrettyVc) => {
const {credentialData, orgDid, orgId, schemaLedgerId, schemaName} = JsonldCredentialDetails;
const credentialSubject = { 'id': 'did:key:kdfJmG7pi1MnrX4y4nkJe' };
const credentialSubject = { };

for (const key in credentialData) {
if (credentialData.hasOwnProperty(key) && TemplateIdentifier.EMAIL_COLUMN !== key) {
Expand All @@ -223,7 +224,8 @@ export const createOobJsonldIssuancePayload = (JsonldCredentialDetails: IJsonldC
'id': `${orgDid}`
},
'issuanceDate': new Date().toISOString(),
credentialSubject
credentialSubject,
prettyVc
},
'options': {
'proofType': 'Ed25519Signature2018',
Expand Down
Loading

0 comments on commit 52cfdb6

Please sign in to comment.