Skip to content

Commit

Permalink
merge branch develop into 336_handle_data_from_asset
Browse files Browse the repository at this point in the history
Signed-off-by: Roy Scheeren <[email protected]>
  • Loading branch information
royscheeren committed Nov 22, 2024
2 parents e53204e + a473d47 commit 7e5499c
Show file tree
Hide file tree
Showing 85 changed files with 37 additions and 13,409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ export const _validateAndCreateMetadata =
}) =>
async (byteArray: Uint8Array, asset: Asset) => {
try {
console.log("2a")
console.log('2a')
const { conforms, reports, data } = await getShaclSchemaAndValidate(byteArray)
console.log("2b")
console.log('2b')
const assetCID = await createFilename(byteArray)
const domainMetadataCID = await createFilename(data.domainMetadata)

Expand All @@ -231,18 +231,18 @@ export const _validateAndCreateMetadata =
if (!user) {
throw new Error('User not found')
}
console.log("2c")
console.log('2c')
const [issuer] = await connection.getUserWithProfileById(user.issuerId)

if (!issuer) {
throw new Error('Issuer not found')
}
console.log("2d")
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")
console.log('2e')
const modifiedManifest = createModifiedManifest({
assetCID,
domainMetadataCID,
Expand All @@ -262,7 +262,7 @@ export const _validateAndCreateMetadata =
manifest: data.manifest,
domainMetadata: data.domainMetadata,
})
console.log("2f")
console.log('2f')
return {
conforms,
reports,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use server'

import { AssetStatus } from 'apps/envited.ascs.digital/common/types'

import { getMintParams, updateAssetStatus, uploadTokenMetadata } from '../../common/serverActions'
import { AssetStatus } from '../../common/types'
import { internalServerErrorError } from '../../common/utils'

export async function uploadAssetTokenMetadata(id: string) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 30 additions & 2 deletions apps/envited.ascs.digital/stacks/Envited.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ export default function Envited({ stack }: StackContext) {
})
metadataBucket.cdk.bucket.grantRead(oai)

const ipfsBucket = new Bucket(stack, 'ipfs', {
cdk: {
bucket: {
accessControl: aws_s3.BucketAccessControl.PRIVATE,
},
},
cors: [s3CorsRule],
})
ipfsBucket.cdk.bucket.grantRead(oai)

const assetsBucket = new Bucket(stack, 'assets', {
notifications: {
processAssetUpload: {
Expand All @@ -90,8 +100,9 @@ export default function Envited({ stack }: StackContext) {
environment: {
RDS_SECRET_ARN: rdsCluster.secret?.secretArn || '',
NEXT_PUBLIC_METADATA_BUCKET_NAME: metadataBucket.bucketName,
NEXT_PUBLIC_IPFS_BUCKET_NAME: ipfsBucket.bucketName,
},
permissions: [metadataBucket, 'secretsmanager:GetSecretValue'],
permissions: [ipfsBucket, metadataBucket, 'secretsmanager:GetSecretValue'],
copyFiles: [{ from: 'common/aws/handlers/processAssetUpload/schemas' }],
securityGroups: [sg],
vpc,
Expand All @@ -106,7 +117,7 @@ export default function Envited({ stack }: StackContext) {
},
cors: [s3CorsRule],
})
assetsBucket.attachPermissions([assetsBucket, metadataBucket])
assetsBucket.attachPermissions([assetsBucket, ipfsBucket, metadataBucket])
metadataBucket.attachPermissions([metadataBucket, assetsBucket])
assetsBucket.cdk.bucket.grantRead(oai)

Expand Down Expand Up @@ -140,6 +151,21 @@ export default function Envited({ stack }: StackContext) {
],
})

const ipfsDistribution = new aws_cloudfront.CloudFrontWebDistribution(stack, 'ipfsDistribution', {
originConfigs: [
{
s3OriginSource: {
s3BucketSource: ipfsBucket.cdk.bucket,
originAccessIdentity: oai,
},
behaviors: [
{ isDefaultBehavior: true },
{ pathPattern: '/*', allowedMethods: aws_cloudfront.CloudFrontAllowedMethods.GET_HEAD },
],
},
],
})

// Create the Next.js site
const site = new NextjsSite(stack, 'envited_ascs_digital', {
path: './',
Expand Down Expand Up @@ -196,5 +222,7 @@ export default function Envited({ stack }: StackContext) {
AssetsDistributionId: assetsDistribution.distributionId,
MetadataDistribution: metadataDistribution.distributionDomainName,
MetadataDistributionId: metadataDistribution.distributionId,
IpfsDistribution: ipfsDistribution.distributionDomainName,
IpfsDistributionId: ipfsDistribution.distributionId,
})
}
18 changes: 0 additions & 18 deletions apps/smart-contracts/.eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion apps/smart-contracts/.ligo/repository_id

This file was deleted.

1 change: 0 additions & 1 deletion apps/smart-contracts/asset-registry/.ligo/repository_id

This file was deleted.

1 change: 0 additions & 1 deletion apps/smart-contracts/asset-registry/.ligo/term_acceptance

This file was deleted.

77 changes: 0 additions & 77 deletions apps/smart-contracts/asset-registry/.taq/config.json

This file was deleted.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions apps/smart-contracts/asset-registry/.taq/config.local.testing.json

This file was deleted.

Loading

0 comments on commit 7e5499c

Please sign in to comment.