fix(signing): align workbench with MEDISIGN contract
This commit is contained in:
@@ -46,21 +46,23 @@ function getCollectionRecords(collection: ArtifactCollection) {
|
||||
}
|
||||
|
||||
function normalizeArtifact(dto: SignArtifactResponseDto): SigningArtifact {
|
||||
const artifactType: SignArtifactType = dto.artifactType ?? dto.type ?? 'UNKNOWN'
|
||||
const artifactType: SignArtifactType = dto.artifactType
|
||||
const label = artifactLabels[artifactType] ?? '签署文件'
|
||||
const mimeType = dto.mimeType ?? dto.contentType ?? 'application/octet-stream'
|
||||
const mimeType = dto.mimeType || 'application/octet-stream'
|
||||
const extension =
|
||||
mimeType === 'application/pdf' ? 'pdf' : mimeType === 'image/png' ? 'png' : 'bin'
|
||||
|
||||
return {
|
||||
id: dto.id,
|
||||
taskId: dto.taskId,
|
||||
pipelineId: dto.pipelineId,
|
||||
artifactType,
|
||||
label,
|
||||
fileName: dto.fileName || `${label}.${extension}`,
|
||||
fileName: `${label}.${extension}`,
|
||||
mimeType,
|
||||
size: dto.size ?? dto.byteSize ?? dto.fileSize ?? 0,
|
||||
sha256: dto.sha256 ?? dto.contentSha256 ?? '',
|
||||
sizeBytes: dto.sizeBytes,
|
||||
sha256: dto.sha256,
|
||||
metadata: dto.metadata ?? {},
|
||||
createdAt: formatDateTime(dto.createdAt),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user