diff --git a/apps/envited.ascs.digital/common/asset/validateAndCreateMetadata.ts b/apps/envited.ascs.digital/common/asset/validateAndCreateMetadata.ts index 891f6c8f..fd17f2bd 100644 --- a/apps/envited.ascs.digital/common/asset/validateAndCreateMetadata.ts +++ b/apps/envited.ascs.digital/common/asset/validateAndCreateMetadata.ts @@ -220,8 +220,9 @@ export const _validateAndCreateMetadata = }) => async (byteArray: Uint8Array, asset: Asset) => { try { + console.log("2a") const { conforms, reports, data } = await getShaclSchemaAndValidate(byteArray) - + console.log("2b") const assetCID = await createFilename(byteArray) const domainMetadataCID = await createFilename(data.domainMetadata) @@ -230,18 +231,18 @@ export const _validateAndCreateMetadata = if (!user) { throw new Error('User not found') } - + console.log("2c") const [issuer] = await connection.getUserWithProfileById(user.issuerId) if (!issuer) { throw new Error('Issuer not found') } - + console.log("2d") const files = await getFilesAsPathAndByteArrayFromManifest(byteArray, data.manifest) const visualization = filter(propEq('visualization', 'type'))(files.publicUser) as ExtractedFile[] const visualizationFiles = await getAllFilenamesFromFiles(visualization) const displayUri = find(propEq('visualization', 'type'))(visualizationFiles) as ExtractedFileWithCID - + console.log("2e") const modifiedManifest = createModifiedManifest({ assetCID, domainMetadataCID, @@ -261,7 +262,7 @@ export const _validateAndCreateMetadata = manifest: data.manifest, domainMetadata: data.domainMetadata, }) - + console.log("2f") return { conforms, reports, diff --git a/apps/envited.ascs.digital/common/aws/handlers/processAssetUpload/processAssetUpload.ts b/apps/envited.ascs.digital/common/aws/handlers/processAssetUpload/processAssetUpload.ts index 90044d4d..e2295831 100644 --- a/apps/envited.ascs.digital/common/aws/handlers/processAssetUpload/processAssetUpload.ts +++ b/apps/envited.ascs.digital/common/aws/handlers/processAssetUpload/processAssetUpload.ts @@ -59,6 +59,7 @@ export const _main = }): S3Handler => async event => { try { + console.log(1) // Read uploaded asset const s3Record = event.Records[0].s3 @@ -70,13 +71,14 @@ export const _main = if (isNil(Body)) { return } + console.log(2) const uploadedFile = await Body.transformToByteArray() // Validate uploaded asset const asset = await getAsset(Key) const { conforms, metadata, assetCID, modifiedManifest, files, visualizationFiles } = await validateAndCreateMetadata(uploadedFile, asset) - + console.log(3) if (!conforms) { // Revert if validation fails await deleteFile({ Bucket, Key }) @@ -84,7 +86,7 @@ export const _main = return } - + console.log(4) // Copy asset ZIP file to S3 with CID as name await copyFile({ Bucket,