-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from credebl/endorser-request-and-submit
feat: schema endorsement request and sign transaction
- Loading branch information
Showing
14 changed files
with
799 additions
and
308 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
36 changes: 0 additions & 36 deletions
36
apps/api-gateway/src/ecosystem/dtos/create-organization-dto.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { ApiExtraModels, ApiProperty } from '@nestjs/swagger'; | ||
import { IsArray, IsBoolean, IsInt, IsNotEmpty, IsOptional, IsString } from 'class-validator'; | ||
@ApiExtraModels() | ||
|
||
class AttributeValue { | ||
|
||
@IsString() | ||
@IsNotEmpty({ message: 'attributeName is required.' }) | ||
attributeName: string; | ||
|
||
@IsString() | ||
@IsNotEmpty({ message: 'schemaDataType is required.' }) | ||
schemaDataType: string; | ||
|
||
@IsString() | ||
@IsNotEmpty({ message: 'displayName is required.' }) | ||
displayName: string; | ||
} | ||
|
||
export class RequestSchemaDto { | ||
@ApiProperty() | ||
@IsString({ message: 'name must be in string format.' }) | ||
name: string; | ||
|
||
@ApiProperty() | ||
@IsInt({ message: 'version must be in number format.' }) | ||
version: number; | ||
|
||
@ApiProperty({ | ||
'example': [ | ||
{ | ||
attributeName: 'name', | ||
schemaDataType: 'string', | ||
displayName: 'Name' | ||
} | ||
] | ||
}) | ||
@IsArray({ message: 'attributes must be an array' }) | ||
@IsNotEmpty({ message: 'please provide valid attributes' }) | ||
attributes: AttributeValue[]; | ||
|
||
@ApiProperty() | ||
@IsBoolean({ message: 'endorse must be a boolean.' }) | ||
@IsOptional() | ||
endorse?: boolean; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
export interface RequestSchemaEndorsement { | ||
orgId: number | ||
name: string; | ||
version: number; | ||
attributes: IAttributeValue[]; | ||
endorse?: boolean; | ||
} | ||
|
||
export interface IAttributeValue { | ||
attributeName: string; | ||
schemaDataType: string; | ||
displayName: string | ||
} | ||
|
||
export interface SchemaTransactionPayload { | ||
endorserDid: string; | ||
endorse: boolean; | ||
attributes: string[]; | ||
version: string; | ||
name: string; | ||
issuerId: string; | ||
} | ||
|
||
export interface SchemaMessage { | ||
message?: { | ||
jobId: string; | ||
schemaState: { | ||
state: string; | ||
action: string; | ||
schemaId: string; | ||
schema: Record<string, unknown>; | ||
schemaRequest: string; | ||
}; | ||
registrationMetadata: Record<string, unknown>; | ||
schemaMetadata: Record<string, unknown>; | ||
}; | ||
} | ||
|
||
export interface SchemaTransactionResponse { | ||
endorserDid: string; | ||
authorDid: string; | ||
requestPayload: string; | ||
status: string; | ||
ecosystemOrgId: string; | ||
} | ||
|
||
export interface SignedTransactionMessage { | ||
message?: { | ||
signedTransaction: 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.