diff --git a/backend/.yarn/install-state.gz b/backend/.yarn/install-state.gz index cfc2185d..644cf75a 100644 Binary files a/backend/.yarn/install-state.gz and b/backend/.yarn/install-state.gz differ diff --git a/backend/migrations/20241115171659-add-node-archiving-data.js b/backend/migrations/20241115171659-add-node-archiving-data.js new file mode 100644 index 00000000..5bff72d6 --- /dev/null +++ b/backend/migrations/20241115171659-add-node-archiving-data.js @@ -0,0 +1,53 @@ +'use strict'; + +var dbm; +var type; +var seed; +var fs = require('fs'); +var path = require('path'); +var Promise; + +/** + * We receive the dbmigrate dependency from dbmigrate initially. + * This enables us to not have to rely on NODE_PATH. + */ +exports.setup = function(options, seedLink) { + dbm = options.dbmigrate; + type = dbm.dataType; + seed = seedLink; + Promise = options.Promise; +}; + +exports.up = function(db) { + var filePath = path.join(__dirname, 'sqls', '20241115171659-add-node-archiving-data-up.sql'); + return new Promise( function( resolve, reject ) { + fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){ + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }) + .then(function(data) { + return db.runSql(data); + }); +}; + +exports.down = function(db) { + var filePath = path.join(__dirname, 'sqls', '20241115171659-add-node-archiving-data-down.sql'); + return new Promise( function( resolve, reject ) { + fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){ + if (err) return reject(err); + console.log('received data: ' + data); + + resolve(data); + }); + }) + .then(function(data) { + return db.runSql(data); + }); +}; + +exports._meta = { + "version": 1 +}; diff --git a/backend/migrations/sqls/20241115171659-add-node-archiving-data-down.sql b/backend/migrations/sqls/20241115171659-add-node-archiving-data-down.sql new file mode 100644 index 00000000..8a7ddb2c --- /dev/null +++ b/backend/migrations/sqls/20241115171659-add-node-archiving-data-down.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.nodes DROP COLUMN piece_index; +ALTER TABLE public.nodes DROP COLUMN piece_offset; diff --git a/backend/migrations/sqls/20241115171659-add-node-archiving-data-up.sql b/backend/migrations/sqls/20241115171659-add-node-archiving-data-up.sql new file mode 100644 index 00000000..2695c598 --- /dev/null +++ b/backend/migrations/sqls/20241115171659-add-node-archiving-data-up.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.nodes ADD COLUMN piece_index INTEGER; +ALTER TABLE public.nodes ADD COLUMN piece_offset INTEGER; diff --git a/backend/package.json b/backend/package.json index a412cdc4..76c06730 100644 --- a/backend/package.json +++ b/backend/package.json @@ -12,7 +12,7 @@ "lint": "eslint . " }, "dependencies": { - "@autonomys/auto-dag-data": "^1.0.5", + "@autonomys/auto-dag-data": "^1.0.7", "@autonomys/auto-drive": "^1.0.5", "@polkadot/api": "^12.3.1", "@polkadot/types": "^13.0.1", @@ -30,6 +30,7 @@ "pg-format": "^1.0.4", "pizzip": "^3.1.7", "uuid": "^10.0.0", + "websocket": "^1.0.35", "zod": "^3.23.8" }, "devDependencies": { @@ -40,6 +41,7 @@ "@types/pg": "^8.11.10", "@types/pg-format": "^1", "@types/uuid": "^10", + "@types/websocket": "^1", "@typescript-eslint/eslint-plugin": "^8.13.0", "@typescript-eslint/parser": "^8.13.0", "blockstore-core": "^5.0.2", diff --git a/backend/src/drivers/ws.ts b/backend/src/drivers/ws.ts new file mode 100644 index 00000000..26247b73 --- /dev/null +++ b/backend/src/drivers/ws.ts @@ -0,0 +1,93 @@ +import Websocket from 'websocket' +import { stringify } from '../utils/misc.js' + +type RPCMessage = { + jsonrpc: string + method: string + params?: unknown + id: number +} + +export type WS = { + send: (message: Omit) => Promise + on: (callback: (event: unknown) => void) => void + off: (callback: (event: unknown) => void) => void +} + +export const createWS = (endpoint: string): WS => { + let ws: Websocket.w3cwebsocket + let onMessageCallbacks: ((event: RPCMessage) => void)[] = [] + + const handleConnection = () => { + ws = new Websocket.w3cwebsocket(endpoint) + + ws.onerror = (event) => { + const errorDetails = { + readyState: ws.readyState, + url: endpoint, + message: event.message || 'Unknown error', + } + + console.error('WebSocket connection error', errorDetails) + + setTimeout(() => { + console.log(`Reconnecting to RPC Web Socket (${endpoint})`) + handleConnection() + }, 10_000) + } + + ws.onmessage = (event) => { + console.debug(`Received message from WebSocket (${endpoint})`) + onMessageCallbacks.forEach((callback) => + callback(JSON.parse(event.data.toString())), + ) + } + + ws.onclose = (event) => { + console.log( + `WebSocket connection closed (${event.code}) due to ${event.reason}.`, + ) + } + } + + handleConnection() + + const connected: Promise = new Promise((resolve) => { + ws.onopen = () => { + console.log(`Connected to RPC Web Socket (${endpoint})`) + resolve() + } + }) + + const send = async (message: Omit) => { + await connected + + const id = Math.floor(Math.random() * 65546) + const messageWithID = { ...message, id } + + return new Promise((resolve, reject) => { + const cb = (event: RPCMessage) => { + try { + if (event.id === id) { + off(cb) + resolve(event) + } + } catch (error) { + reject(error) + } + } + on(cb) + + ws.send(stringify(messageWithID)) + }) + } + + const on = (callback: (event: RPCMessage) => void) => { + onMessageCallbacks.push(callback) + } + const off = (callback: (event: RPCMessage) => void) => { + onMessageCallbacks = onMessageCallbacks.filter((cb) => cb !== callback) + } + + return { send, on, off } +} diff --git a/backend/src/models/objects/object.ts b/backend/src/models/objects/object.ts index 2e76cbcd..e4e9601f 100644 --- a/backend/src/models/objects/object.ts +++ b/backend/src/models/objects/object.ts @@ -10,6 +10,7 @@ export interface ObjectInformation { export interface UploadStatus { uploadedNodes: number | null totalNodes: number | null + archivedNodes: number | null minimumBlockDepth: number | null maximumBlockDepth: number | null } @@ -32,7 +33,7 @@ export type ObjectSearchResult = { export type ObjectSummary = { headCid: string name?: string - size: number + size: string owners: Owner[] uploadStatus: UploadStatus } & ( @@ -54,7 +55,7 @@ export const getObjectSummary = (object: ObjectInformation): ObjectSummary => { headCid: object.metadata.dataCid, name: object.metadata.name, type: object.metadata.type, - size: object.metadata.totalSize, + size: object.metadata.totalSize.toString(), owners: object.owners, children: object.metadata.children, uploadStatus: object.uploadStatus, @@ -63,7 +64,7 @@ export const getObjectSummary = (object: ObjectInformation): ObjectSummary => { headCid: object.metadata.dataCid, name: object.metadata.name, type: object.metadata.type, - size: object.metadata.totalSize, + size: object.metadata.totalSize.toString(), mimeType: object.metadata.mimeType, uploadStatus: object.uploadStatus, owners: object.owners, diff --git a/backend/src/models/objects/objectMappings.ts b/backend/src/models/objects/objectMappings.ts new file mode 100644 index 00000000..faa8923c --- /dev/null +++ b/backend/src/models/objects/objectMappings.ts @@ -0,0 +1,20 @@ +import { z } from 'zod' + +export type ObjectMapping = [ + hash: string, + pieceIndex: number, + pieceOffset: number, +] + +export const ObjectMappingSchema = z.tuple([z.string(), z.number(), z.number()]) + +export const ObjectMappingListEntrySchema = z.object({ + blockNumber: z.number(), + v0: z.object({ + objects: z.array(ObjectMappingSchema), + }), +}) + +export type ObjectMappingListEntry = z.infer< + typeof ObjectMappingListEntrySchema +> diff --git a/backend/src/repositories/objects/interactions.ts b/backend/src/repositories/objects/interactions.ts index b0ee7ead..455e005b 100644 --- a/backend/src/repositories/objects/interactions.ts +++ b/backend/src/repositories/objects/interactions.ts @@ -23,13 +23,13 @@ const createInteraction = async ( id: string, subscription_id: string, type: InteractionType, - size: number, + size: bigint, ): Promise => { const db = await getDatabase() const interaction = await db.query( 'INSERT INTO interactions (id, subscription_id, type, size) VALUES ($1, $2, $3, $4) RETURNING *', - [id, subscription_id, type, size], + [id, subscription_id, type, size.toString()], ) return mapRows(interaction.rows)[0] diff --git a/backend/src/repositories/objects/metadata.ts b/backend/src/repositories/objects/metadata.ts index ba16ccc0..376d292b 100644 --- a/backend/src/repositories/objects/metadata.ts +++ b/backend/src/repositories/objects/metadata.ts @@ -1,6 +1,7 @@ import { OffchainMetadata } from '@autonomys/auto-dag-data' import { getDatabase } from '../../drivers/pg.js' import { PaginatedResult } from '../../useCases/objects/common.js' +import { stringify } from '../../utils/misc.js' export interface MetadataEntry { root_cid: string @@ -34,7 +35,7 @@ const setMetadata = async ( return db.query({ text: 'INSERT INTO metadata (root_cid, head_cid, metadata) VALUES ($1, $2, $3) ON CONFLICT (root_cid, head_cid) DO UPDATE SET metadata = EXCLUDED.metadata', - values: [rootCid, headCid, JSON.stringify(metadata)], + values: [rootCid, headCid, stringify(metadata)], }) } diff --git a/backend/src/repositories/objects/nodes.ts b/backend/src/repositories/objects/nodes.ts index a9b0ebc3..7ac734fd 100644 --- a/backend/src/repositories/objects/nodes.ts +++ b/backend/src/repositories/objects/nodes.ts @@ -66,7 +66,8 @@ const getNodeCount = async ({ }) => { const db = await getDatabase() - let query = 'SELECT count(*) FROM nodes' + let query = + 'SELECT count(*) as total_count, count(piece_index) as archived_count FROM nodes' const params = [] const conditions = [] @@ -96,12 +97,43 @@ const getNodeCount = async ({ return db .query<{ - count: string + total_count: string + archived_count: string }>({ text: query, values: params, }) - .then((e) => Number(e.rows[0].count)) + .then((e) => ({ + totalCount: Number(e.rows[0].total_count), + archivedCount: Number(e.rows[0].archived_count), + })) +} + +const getArchivingNodesCID = async () => { + const db = await getDatabase() + + return db + .query({ + text: 'SELECT cid FROM nodes WHERE piece_index IS NULL and piece_offset IS NULL', + }) + .then((e) => e.rows.map((e) => e.cid)) +} + +const setNodeArchivingData = async ({ + cid, + pieceIndex, + pieceOffset, +}: { + cid: string + pieceIndex: number + pieceOffset: number +}) => { + const db = await getDatabase() + + return db.query({ + text: 'UPDATE nodes SET piece_index = $1, piece_offset = $2 WHERE cid = $3', + values: [pieceIndex, pieceOffset, cid], + }) } export const nodesRepository = { @@ -109,4 +141,6 @@ export const nodesRepository = { getNodeCount, saveNode, saveNodes, + getArchivingNodesCID, + setNodeArchivingData, } diff --git a/backend/src/repositories/objects/transactionResults.ts b/backend/src/repositories/objects/transactionResults.ts index 35193912..aa8ce727 100644 --- a/backend/src/repositories/objects/transactionResults.ts +++ b/backend/src/repositories/objects/transactionResults.ts @@ -1,5 +1,6 @@ import { getDatabase } from '../../drivers/pg.js' import { TransactionResult } from '../../models/objects/transaction.js' +import { stringify } from '../../utils/misc.js' import { Node } from './nodes.js' export interface TransactionResultEntry { @@ -15,7 +16,7 @@ const storeTransactionResult = async ( await db.query({ text: 'INSERT INTO transaction_results (cid, transaction_result) VALUES ($1, $2) ON CONFLICT (cid) DO UPDATE SET transaction_result = EXCLUDED.transaction_result', - values: [cid, JSON.stringify(transaction_result)], + values: [cid, stringify(transaction_result)], }) } @@ -87,6 +88,20 @@ const getUploadedNodesByRootCid = async (rootCid: string) => { return result } +const getFirstNotArchivedNode = async () => { + const db = await getDatabase() + + const result = await db + .query<{ block_number: number }>({ + text: `SELECT MIN(transaction_results.transaction_result->>'blockNumber') as block_number FROM transaction_results inner join nodes + on transaction_results.cid = nodes.cid + where nodes.piece_index is null`, + }) + .then(({ rows }) => rows.at(0)?.block_number ?? null) + + return result +} + export const transactionResultsRepository = { storeTransactionResult, getTransactionResult, @@ -94,4 +109,5 @@ export const transactionResultsRepository = { getHeadTransactionResults, getPendingUploadsByHeadCid, getUploadedNodesByRootCid, + getFirstNotArchivedNode, } diff --git a/backend/src/repositories/uploads/blockstore.ts b/backend/src/repositories/uploads/blockstore.ts index ce5af4e8..8f41296e 100644 --- a/backend/src/repositories/uploads/blockstore.ts +++ b/backend/src/repositories/uploads/blockstore.ts @@ -5,14 +5,14 @@ interface BlockstoreEntry { upload_id: string cid: string node_type: MetadataType - node_size: number + node_size: bigint data: Buffer } const parseEntry = (entry: BlockstoreEntry) => { return { ...entry, - node_size: Number(entry.node_size), + node_size: entry.node_size.toString(), } } @@ -20,7 +20,7 @@ const addBlockstoreEntry = async ( uploadId: string, cid: string, nodeType: MetadataType, - nodeSize: number, + nodeSize: bigint, data: Buffer, ) => { const db = await getDatabase() diff --git a/backend/src/repositories/uploads/fileParts.ts b/backend/src/repositories/uploads/fileParts.ts index 304e4b0f..620d2494 100644 --- a/backend/src/repositories/uploads/fileParts.ts +++ b/backend/src/repositories/uploads/fileParts.ts @@ -45,17 +45,17 @@ const getChunkByUploadIdAndPartIndex = async ( const getUploadFilePartsSize = async ( uploadId: string, -): Promise => { +): Promise => { const db = await getDatabase() return db .query<{ - total_size: number + total_size: string }>( 'SELECT SUM(LENGTH(data)) AS total_size FROM uploads.file_parts WHERE upload_id = $1', [uploadId], ) - .then((result) => result.rows.at(0)?.total_size ?? 0) + .then((result) => BigInt(result.rows.at(0)?.total_size ?? '0').valueOf()) } export const filePartsRepository = { diff --git a/backend/src/services/objectMappingListener/index.ts b/backend/src/services/objectMappingListener/index.ts new file mode 100644 index 00000000..4ed80a0b --- /dev/null +++ b/backend/src/services/objectMappingListener/index.ts @@ -0,0 +1,60 @@ +import { z } from 'zod' +import { createWS } from '../../drivers/ws.js' +import { ObjectMappingListEntrySchema } from '../../models/objects/objectMappings.js' +import { NodesUseCases } from '../../useCases/index.js' +import { transactionResultsRepository } from '../../repositories/index.js' + +const start = async () => { + const url = process.env.OBJECT_MAPPING_ARCHIVER_URL + if (!url) { + throw new Error('OBJECT_MAPPING_ARCHIVER_URL is not set') + } + + const ws = createWS(url) + + const SAFE_BLOCK_NUMBER_THRESHOLD = 100 + const blockNumber = + await transactionResultsRepository.getFirstNotArchivedNode() + + if (!blockNumber) { + console.log('Subscribing to real time object mappings') + await ws.send({ + jsonrpc: '2.0', + method: 'subscribe_object_mappings', + }) + } else { + console.log(`Subscribing to recover object mappings from ${blockNumber}`) + await ws.send({ + jsonrpc: '2.0', + method: 'subscribe_recover_object_mappings', + params: { + blockNumber: blockNumber - SAFE_BLOCK_NUMBER_THRESHOLD, + }, + }) + } + + ws.on(async (message) => { + const { data, success } = z + .object({ + subscriptionId: z.string(), + result: ObjectMappingListEntrySchema, + }) + .safeParse(message) + + if (!success) { + console.error('Failed to parse object mapping list entry', data) + return + } + + if (data.result.v0.objects.length > 0) { + console.log( + `Processing object mapping list entry of length ${data.result.v0.objects.length}`, + ) + await NodesUseCases.processNodeArchived(data.result) + } + }) +} + +export const objectMappingArchiver = { + start, +} diff --git a/backend/src/services/onchainPublisher/index.ts b/backend/src/services/onchainPublisher/index.ts index 066d677b..38694da8 100644 --- a/backend/src/services/onchainPublisher/index.ts +++ b/backend/src/services/onchainPublisher/index.ts @@ -1,6 +1,7 @@ import { TransactionResultsUseCases } from '../../useCases/index.js' import { safeCallback } from '../../utils/safe.js' import { createTransactionManager } from './transactionManager.js' +import { compactAddLength } from '@polkadot/util' const state = { executing: false, @@ -25,10 +26,11 @@ const processPendingUploads = safeCallback(async () => { } const transactions = pendingUploads.map((upload) => { + const buffer = Buffer.from(upload.encoded_node, 'base64') return { module: 'system', method: 'remark', - params: [upload.encoded_node], + params: [compactAddLength(buffer)], } }) diff --git a/backend/src/services/uploadProcessorCache/blockstore.ts b/backend/src/services/uploadProcessorCache/blockstore.ts index 212ee95a..1a586686 100644 --- a/backend/src/services/uploadProcessorCache/blockstore.ts +++ b/backend/src/services/uploadProcessorCache/blockstore.ts @@ -35,7 +35,7 @@ export class MultiUploadBlockstore implements BaseBlockstore { async put(cid: Pair['cid'], data: Uint8Array): Promise { const decodedData = decodeIPLDNodeData(data) - const size = decodedData.size ?? 0 + const size = decodedData.size ?? BigInt(0).valueOf() await blockstoreRepository.addBlockstoreEntry( this.uploadId, @@ -111,12 +111,12 @@ export class MultiUploadBlockstore implements BaseBlockstore { } } - async getSize(key: Pair['cid']): Promise { + async getSize(key: Pair['cid']): Promise { const block = await blockstoreRepository.getByCIDWithoutData( this.uploadId, cidToString(key), ) - return block!.node_size + return BigInt(block!.node_size).valueOf() } } diff --git a/backend/src/useCases/objects/files.ts b/backend/src/useCases/objects/files.ts index fb862482..870562ee 100644 --- a/backend/src/useCases/objects/files.ts +++ b/backend/src/useCases/objects/files.ts @@ -48,7 +48,10 @@ const generateFileArtifacts = async ( ) } - const totalSize = chunks.reduce((acc, e) => acc + Number(e.size), 0) + const totalSize = chunks.reduce( + (acc, e) => acc + e.size.valueOf(), + BigInt(0).valueOf(), + ) const metadata = fileMetadata( cid, @@ -273,7 +276,7 @@ const handleFileUploadFinalization = async ( await UsersUseCases.registerInteraction( user, InteractionType.Upload, - metadata.totalSize, + metadata.totalSize.valueOf(), ) return metadata.dataCid diff --git a/backend/src/useCases/objects/interactions.ts b/backend/src/useCases/objects/interactions.ts index 084c4dd4..a42db4cb 100644 --- a/backend/src/useCases/objects/interactions.ts +++ b/backend/src/useCases/objects/interactions.ts @@ -5,7 +5,7 @@ import { interactionsRepository } from '../../repositories/objects/interactions. const createInteraction = async ( subscriptionId: string, type: InteractionType, - size: number, + size: bigint, ): Promise => { await interactionsRepository.createInteraction( v4(), diff --git a/backend/src/useCases/objects/nodes.ts b/backend/src/useCases/objects/nodes.ts index 01bb06ce..41a3e58f 100644 --- a/backend/src/useCases/objects/nodes.ts +++ b/backend/src/useCases/objects/nodes.ts @@ -1,4 +1,5 @@ import { + cidFromBlakeHash, cidOfNode, cidToString, decodeIPLDNodeData, @@ -11,6 +12,7 @@ import { CID } from 'multiformats' import { nodesRepository } from '../../repositories/index.js' import { uploadsRepository } from '../../repositories/uploads/uploads.js' import { getUploadBlockstore } from '../../services/uploadProcessorCache/index.js' +import { ObjectMappingListEntry } from '../../models/objects/objectMappings.js' import { asyncIterableForEach, asyncIterableToPromiseOfArray, @@ -141,10 +143,42 @@ const migrateFromBlockstoreToNodesTable = async ( } } +export const processNodeArchived = async ( + objectMappings: ObjectMappingListEntry, +) => { + const nodes = await nodesRepository.getArchivingNodesCID() + + console.log(`Archiving ${nodes.length} nodes`) + + const objects = objectMappings.v0.objects.map((e) => { + const cid = cidToString(cidFromBlakeHash(Buffer.from(e[0], 'hex'))) + + return nodes.includes(cid) + ? { + cid, + pieceIndex: e[1], + pieceOffset: e[2], + } + : undefined + }) + + const promises = objects.map((e) => { + if (!e) { + return + } + return nodesRepository.setNodeArchivingData(e) + }) + + await Promise.all(promises) + + return objects +} + export const NodesUseCases = { getNode, saveNode, getChunkData, saveNodes, migrateFromBlockstoreToNodesTable, + processNodeArchived, } diff --git a/backend/src/useCases/objects/uploadStatus.ts b/backend/src/useCases/objects/uploadStatus.ts index 90888c79..9c8a4162 100644 --- a/backend/src/useCases/objects/uploadStatus.ts +++ b/backend/src/useCases/objects/uploadStatus.ts @@ -18,12 +18,13 @@ const getUploadStatus = async (cid: string): Promise => { return { uploadedNodes: null, totalNodes: null, + archivedNodes: null, minimumBlockDepth: null, maximumBlockDepth: null, } } - const totalNodes = await nodesRepository.getNodeCount({ + const { totalCount, archivedCount } = await nodesRepository.getNodeCount({ rootCid: cid, }) const uploadedNodes = @@ -39,13 +40,14 @@ const getUploadStatus = async (cid: string): Promise => { .map((e) => e.transaction_result.blockNumber!) .reduce((a, b) => (a === null ? b : Math.max(a, b)), null as number | null) - const isFullyUploaded = uploadedNodes.length === totalNodes + const isFullyUploaded = uploadedNodes.length === totalCount const maximumBlockDepth = isFullyUploaded ? maxSeenBlockDepth : null return { uploadedNodes: uploadedNodes.length, - totalNodes, + totalNodes: totalCount, + archivedNodes: archivedCount, minimumBlockDepth, maximumBlockDepth, } diff --git a/backend/src/useCases/uploads/blockstore.ts b/backend/src/useCases/uploads/blockstore.ts index 4d74b0da..39bd27d5 100644 --- a/backend/src/useCases/uploads/blockstore.ts +++ b/backend/src/useCases/uploads/blockstore.ts @@ -68,7 +68,7 @@ const getChunksByNodeType = async ( return blockstoreEntries .filter((e) => e.node_type === nodeType) .map((block) => ({ - size: block.node_size, + size: BigInt(block.node_size).valueOf(), cid: block.cid, })) } @@ -121,7 +121,10 @@ const processFileTree = async ( ), ) - const totalSize = childrenNodesLengths.reduce((acc, curr) => acc + curr, 0) + const totalSize = childrenNodesLengths.reduce( + (acc, curr) => acc + BigInt(curr).valueOf(), + BigInt(0).valueOf(), + ) return processFolderToIPLDFormat( blockstore, diff --git a/backend/src/useCases/uploads/uploadProcessing.ts b/backend/src/useCases/uploads/uploadProcessing.ts index a2034a68..b87902ef 100644 --- a/backend/src/useCases/uploads/uploadProcessing.ts +++ b/backend/src/useCases/uploads/uploadProcessing.ts @@ -61,7 +61,7 @@ const processChunk = async ( dataToProcess, fileBuilders, { - maxChunkSize: DEFAULT_MAX_CHUNK_SIZE, + maxNodeSize: DEFAULT_MAX_CHUNK_SIZE, }, ) @@ -92,7 +92,8 @@ const completeFileProcessing = async (uploadId: string): Promise => { } const uploadedSize = - (await filePartsRepository.getUploadFilePartsSize(uploadId)) ?? 0 + (await filePartsRepository.getUploadFilePartsSize(uploadId)) ?? + BigInt(0).valueOf() const uploadOptions = { maxLinkPerNode: DEFAULT_MAX_LINK_PER_NODE, diff --git a/backend/src/useCases/users/users.ts b/backend/src/useCases/users/users.ts index db5316f0..dd2f199d 100644 --- a/backend/src/useCases/users/users.ts +++ b/backend/src/useCases/users/users.ts @@ -221,7 +221,7 @@ const getPendingCreditsByUserAndType = async ( const registerInteraction = async ( userOrPublicId: UserOrPublicId, type: InteractionType, - size: number, + size: bigint, ) => { const subscription = await SubscriptionsUseCases.getSubscription(userOrPublicId) diff --git a/backend/src/utils/misc.ts b/backend/src/utils/misc.ts new file mode 100644 index 00000000..05270664 --- /dev/null +++ b/backend/src/utils/misc.ts @@ -0,0 +1,5 @@ +export const stringify = (value: unknown) => { + return JSON.stringify(value, (key, value) => + typeof value === 'bigint' ? value.toString() : value, + ) +} diff --git a/backend/src/worker.ts b/backend/src/worker.ts index a6429c30..ea6fd9c2 100644 --- a/backend/src/worker.ts +++ b/backend/src/worker.ts @@ -1,5 +1,7 @@ import { nodeMigrator } from './services/nodeMigrator/index.js' +import { objectMappingArchiver } from './services/objectMappingListener/index.js' import { onchainPublisher } from './services/onchainPublisher/index.js' nodeMigrator.start() onchainPublisher.start() +objectMappingArchiver.start() diff --git a/backend/yarn.lock b/backend/yarn.lock index abbdd237..b1dbba85 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -15,11 +15,29 @@ __metadata: languageName: node linkType: hard -"@autonomys/auto-dag-data@npm:^1.0.5": - version: 1.0.5 - resolution: "@autonomys/auto-dag-data@npm:1.0.5" +"@autonomys/auto-dag-data@npm:^1.0.6": + version: 1.0.6 + resolution: "@autonomys/auto-dag-data@npm:1.0.6" + dependencies: + "@ipld/dag-pb": "npm:^4.1.2" + "@webbuf/blake3": "npm:^3.0.26" + "@webbuf/fixedbuf": "npm:^3.0.26" + "@webbuf/webbuf": "npm:^3.0.26" + fflate: "npm:^0.8.2" + multiformats: "npm:^13.2.2" + protobufjs: "npm:^7.4.0" + protons: "npm:^7.6.0" + protons-runtime: "npm:^5.5.0" + checksum: 10c0/31ad3a266358964ec1200a02b72e9cdc9d0208197e7d7fc012e1e6dc421f7b79d567e201fd94965248c642e9132781d0c12cd06c768702a5546e5c3064e119ab + languageName: node + linkType: hard + +"@autonomys/auto-dag-data@npm:^1.0.7": + version: 1.0.7 + resolution: "@autonomys/auto-dag-data@npm:1.0.7" dependencies: "@ipld/dag-pb": "npm:^4.1.2" + "@peculiar/webcrypto": "npm:^1.5.0" "@webbuf/blake3": "npm:^3.0.26" "@webbuf/fixedbuf": "npm:^3.0.26" "@webbuf/webbuf": "npm:^3.0.26" @@ -28,19 +46,19 @@ __metadata: protobufjs: "npm:^7.4.0" protons: "npm:^7.6.0" protons-runtime: "npm:^5.5.0" - checksum: 10c0/f5008da92c88adf1aacff196d7ebc47fee6b04d52ce34bec26f0fdb6bf0e0f665d1a1fbd1c7b3a8e37ffd3f12c44214f8ae8f5b232000fd514fda5ec191fd03c + checksum: 10c0/6e11e11db4af0cefddb6fc5c11185c2cd03e29d48c33d13bec9c835f11653aca5932a7fd9f358df07134aad91a71c167c800afc83280b0439b7a861f453fe81f languageName: node linkType: hard "@autonomys/auto-drive@npm:^1.0.5": - version: 1.0.5 - resolution: "@autonomys/auto-drive@npm:1.0.5" + version: 1.0.6 + resolution: "@autonomys/auto-drive@npm:1.0.6" dependencies: - "@autonomys/auto-dag-data": "npm:^1.0.5" + "@autonomys/auto-dag-data": "npm:^1.0.6" jszip: "npm:^3.10.1" mime-types: "npm:^2.1.35" zod: "npm:^3.23.8" - checksum: 10c0/65553dab901fc1d54364b3a7a0586a4456b1c45b101c1d7b86e5a2f6d84223b704f29d7a8b147cb652d0332c9c558ba6cafec92cd9a458a4487a03eff6e30ef6 + checksum: 10c0/13d8dc03b1090685ea7289ef277702c90106038508b842e709afe92b99f261aecc9b5845fd6cecf22711fe45b15ac430b7ba3bf2c27d37741cfbcdc3ac284bd3 languageName: node linkType: hard @@ -974,6 +992,39 @@ __metadata: languageName: node linkType: hard +"@peculiar/asn1-schema@npm:^2.3.13, @peculiar/asn1-schema@npm:^2.3.8": + version: 2.3.13 + resolution: "@peculiar/asn1-schema@npm:2.3.13" + dependencies: + asn1js: "npm:^3.0.5" + pvtsutils: "npm:^1.3.5" + tslib: "npm:^2.6.2" + checksum: 10c0/98020f09a1b412e16bd5cb96ecb35a4da8043d90f4911eaa8b565cba7c437ae39544f928f8c112d5926f260bff78a184c165f60f153409c94b5224527ea355b0 + languageName: node + linkType: hard + +"@peculiar/json-schema@npm:^1.1.12": + version: 1.1.12 + resolution: "@peculiar/json-schema@npm:1.1.12" + dependencies: + tslib: "npm:^2.0.0" + checksum: 10c0/202132c66dcc6b6aca5d0af971c015be2e163da2f7f992910783c5d39c8a7db59b6ec4f4ce419459a1f954b7e1d17b6b253f0e60072c1b3d254079f4eaebc311 + languageName: node + linkType: hard + +"@peculiar/webcrypto@npm:^1.5.0": + version: 1.5.0 + resolution: "@peculiar/webcrypto@npm:1.5.0" + dependencies: + "@peculiar/asn1-schema": "npm:^2.3.8" + "@peculiar/json-schema": "npm:^1.1.12" + pvtsutils: "npm:^1.3.5" + tslib: "npm:^2.6.2" + webcrypto-core: "npm:^1.8.0" + checksum: 10c0/4f6f24b2c52c2155b9c569b6eb1d57954cb5f7bd2764a50cdaed7aea17a6dcf304b75b87b57ba318756ffec8179a07d9a76534aaf77855912b838543e5ff8983 + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -1127,27 +1178,27 @@ __metadata: linkType: hard "@polkadot/keyring@npm:^13.0.2, @polkadot/keyring@npm:^13.1.1": - version: 13.2.2 - resolution: "@polkadot/keyring@npm:13.2.2" + version: 13.2.3 + resolution: "@polkadot/keyring@npm:13.2.3" dependencies: - "@polkadot/util": "npm:13.2.2" - "@polkadot/util-crypto": "npm:13.2.2" + "@polkadot/util": "npm:13.2.3" + "@polkadot/util-crypto": "npm:13.2.3" tslib: "npm:^2.8.0" peerDependencies: - "@polkadot/util": 13.2.2 - "@polkadot/util-crypto": 13.2.2 - checksum: 10c0/f01f0f7ba1d75ac8edb4f380dec8584be09a4a0593df1db5fe2f42a8b2e868547c08903765a1270a2b5c1b76e5bc900ba53132d372879f4dfccec84a42f61c98 + "@polkadot/util": 13.2.3 + "@polkadot/util-crypto": 13.2.3 + checksum: 10c0/0f8adca69888107cdff2acfbd8eeea87e7db86dda79ed9438f192cc05cf6fbf983483c4f630848c52e168574c57168875903c4d49b79a0e0d27e2c3b9b3046e4 languageName: node linkType: hard -"@polkadot/networks@npm:13.2.2, @polkadot/networks@npm:^13.0.2": - version: 13.2.2 - resolution: "@polkadot/networks@npm:13.2.2" +"@polkadot/networks@npm:13.2.3, @polkadot/networks@npm:^13.0.2": + version: 13.2.3 + resolution: "@polkadot/networks@npm:13.2.3" dependencies: - "@polkadot/util": "npm:13.2.2" + "@polkadot/util": "npm:13.2.3" "@substrate/ss58-registry": "npm:^1.51.0" tslib: "npm:^2.8.0" - checksum: 10c0/aeac8733a3f1f0ed2872603b7925441e1016097b5da850f49f860a8e300d10555e73450e2952023de560718b49026937919490749f4075c9b3c4ea78464e027f + checksum: 10c0/1ff4b329c05c6c8fadbaf733432392bf6e73f9151df869a5416228d21906e46f5643eae600046025aace635867b9458042865c0b847a8c2c65af76a98c4ba605 languageName: node linkType: hard @@ -1326,38 +1377,38 @@ __metadata: languageName: node linkType: hard -"@polkadot/util-crypto@npm:13.2.2, @polkadot/util-crypto@npm:^13.0.2, @polkadot/util-crypto@npm:^13.1.1": - version: 13.2.2 - resolution: "@polkadot/util-crypto@npm:13.2.2" +"@polkadot/util-crypto@npm:13.2.3, @polkadot/util-crypto@npm:^13.0.2, @polkadot/util-crypto@npm:^13.1.1": + version: 13.2.3 + resolution: "@polkadot/util-crypto@npm:13.2.3" dependencies: "@noble/curves": "npm:^1.3.0" "@noble/hashes": "npm:^1.3.3" - "@polkadot/networks": "npm:13.2.2" - "@polkadot/util": "npm:13.2.2" + "@polkadot/networks": "npm:13.2.3" + "@polkadot/util": "npm:13.2.3" "@polkadot/wasm-crypto": "npm:^7.4.1" "@polkadot/wasm-util": "npm:^7.4.1" - "@polkadot/x-bigint": "npm:13.2.2" - "@polkadot/x-randomvalues": "npm:13.2.2" + "@polkadot/x-bigint": "npm:13.2.3" + "@polkadot/x-randomvalues": "npm:13.2.3" "@scure/base": "npm:^1.1.7" tslib: "npm:^2.8.0" peerDependencies: - "@polkadot/util": 13.2.2 - checksum: 10c0/5843cfc599a7d8d6c76921cba679909f3e730d363c62d82cc5755ed67dadcc36ff0cc0fce6017d31041f5f7a62b05311b02aa922ac38608ee5dd04705e19d056 + "@polkadot/util": 13.2.3 + checksum: 10c0/83b8dcdd843aa8f5346faeb5921bb2072944d2536d9169e4d0ed3f2b969ccd63081d5d35f1a5c96f3977ff0cb52b25447d58c7e78e23ae4a8f14a1205bdd3100 languageName: node linkType: hard -"@polkadot/util@npm:13.2.2, @polkadot/util@npm:^13.0.2, @polkadot/util@npm:^13.1.1": - version: 13.2.2 - resolution: "@polkadot/util@npm:13.2.2" +"@polkadot/util@npm:13.2.3, @polkadot/util@npm:^13.0.2, @polkadot/util@npm:^13.1.1": + version: 13.2.3 + resolution: "@polkadot/util@npm:13.2.3" dependencies: - "@polkadot/x-bigint": "npm:13.2.2" - "@polkadot/x-global": "npm:13.2.2" - "@polkadot/x-textdecoder": "npm:13.2.2" - "@polkadot/x-textencoder": "npm:13.2.2" + "@polkadot/x-bigint": "npm:13.2.3" + "@polkadot/x-global": "npm:13.2.3" + "@polkadot/x-textdecoder": "npm:13.2.3" + "@polkadot/x-textencoder": "npm:13.2.3" "@types/bn.js": "npm:^5.1.6" bn.js: "npm:^5.2.1" tslib: "npm:^2.8.0" - checksum: 10c0/a63fb46907a77fb99ace488fa61d9005c700ff6504322a3b98a2fca434bbef3a5aa6dd6c52d4b806b71e2f4a3def6f6ecb2548644be0546b8667efc3da4118cd + checksum: 10c0/8de6dfe7f0af03a8ce9e0c77575c6308de2e6ea615cba7dfce1942180eb0719115c114ad15371049670e2f91810fc17feb05b89574c662f4ccd33d5b1086c057 languageName: node linkType: hard @@ -1441,77 +1492,77 @@ __metadata: languageName: node linkType: hard -"@polkadot/x-bigint@npm:13.2.2, @polkadot/x-bigint@npm:^13.0.2, @polkadot/x-bigint@npm:^13.1.1": - version: 13.2.2 - resolution: "@polkadot/x-bigint@npm:13.2.2" +"@polkadot/x-bigint@npm:13.2.3, @polkadot/x-bigint@npm:^13.0.2, @polkadot/x-bigint@npm:^13.1.1": + version: 13.2.3 + resolution: "@polkadot/x-bigint@npm:13.2.3" dependencies: - "@polkadot/x-global": "npm:13.2.2" + "@polkadot/x-global": "npm:13.2.3" tslib: "npm:^2.8.0" - checksum: 10c0/5e793b1870c18e631965500693751bf49e7e4fdd0028f93a380fbdeb78d9faaadfb1742af6a52e1faf7943c2fa35bbb2fe1988a43c42a11a87260195311932e9 + checksum: 10c0/56620bc9be1dc5de366a7e651704be5a9c62d1295aa1531e88d50e5a9ebdda0e6df13a5d9979ce91fdcf68a9f9528ba368e1f2bc418037089c6bec36e2a44d29 languageName: node linkType: hard "@polkadot/x-fetch@npm:^13.0.2": - version: 13.2.2 - resolution: "@polkadot/x-fetch@npm:13.2.2" + version: 13.2.3 + resolution: "@polkadot/x-fetch@npm:13.2.3" dependencies: - "@polkadot/x-global": "npm:13.2.2" + "@polkadot/x-global": "npm:13.2.3" node-fetch: "npm:^3.3.2" tslib: "npm:^2.8.0" - checksum: 10c0/e3004168629e899e633973bb6e0dfcaf0498c1cdf16649dfbaa59b8579da7f1f56df186289d51b717b086885126121a422442f986910473db2df241c7ef91f87 + checksum: 10c0/809ebc8fa79f6119e2f291d21900d8c0f8e33c07524d4e9a0bbfc19c254c063b6b377ef1f1f9cfbcf358da77493eb114a92c362d19afadf8fe52a5f2993a8d34 languageName: node linkType: hard -"@polkadot/x-global@npm:13.2.2, @polkadot/x-global@npm:^13.0.2": - version: 13.2.2 - resolution: "@polkadot/x-global@npm:13.2.2" +"@polkadot/x-global@npm:13.2.3, @polkadot/x-global@npm:^13.0.2": + version: 13.2.3 + resolution: "@polkadot/x-global@npm:13.2.3" dependencies: tslib: "npm:^2.8.0" - checksum: 10c0/8129a33319be3f48e7cd540324e97f6108799ef2aeb026157bfd313fbf22146f3a2ebefd1d8dfa1fbc57987d2157a3169a33b5cbb4f26f9abf49765bbb1874fe + checksum: 10c0/7ab3f18b9ab30dcd6554c7ac81d404ec8552fd970d276a6a87ebcb7fb0feaf5c684df58b323b88888419304504dc5dd793e4b315b0468ce4d94005652bfc2a97 languageName: node linkType: hard -"@polkadot/x-randomvalues@npm:13.2.2": - version: 13.2.2 - resolution: "@polkadot/x-randomvalues@npm:13.2.2" +"@polkadot/x-randomvalues@npm:13.2.3": + version: 13.2.3 + resolution: "@polkadot/x-randomvalues@npm:13.2.3" dependencies: - "@polkadot/x-global": "npm:13.2.2" + "@polkadot/x-global": "npm:13.2.3" tslib: "npm:^2.8.0" peerDependencies: - "@polkadot/util": 13.2.2 + "@polkadot/util": 13.2.3 "@polkadot/wasm-util": "*" - checksum: 10c0/383636261de6c2986302a8bd65e610826dba1e72cb15623af10c513c003f4eabd235396abc5e7e3dc3799d026204f7dc2a752945f0eef020029a005c6716715d + checksum: 10c0/43ef86ef6d65e7fa586aa8e227f3a9febbd038cb0d1a8bcafd2ae216e826412c9d5565cffe67d868f66de04705de9057e7ccc2d5e19efc7fae194f2921786477 languageName: node linkType: hard -"@polkadot/x-textdecoder@npm:13.2.2": - version: 13.2.2 - resolution: "@polkadot/x-textdecoder@npm:13.2.2" +"@polkadot/x-textdecoder@npm:13.2.3": + version: 13.2.3 + resolution: "@polkadot/x-textdecoder@npm:13.2.3" dependencies: - "@polkadot/x-global": "npm:13.2.2" + "@polkadot/x-global": "npm:13.2.3" tslib: "npm:^2.8.0" - checksum: 10c0/4f0fbfb6a575b0c77831fd4602d36f84367fc20247882a1bd7ff1f327c38a9c8c17f6ad151930ee0a4687698e4411960546b7b54772bd4de7d215edc9dbdf192 + checksum: 10c0/54fb113cc0fa82ebd2187edd8768e133bb9c32aa9ecba1627e3c8cd435cfa5d6f8479bc790a7904fa0e5d98ae7a2a3510a3a147e728f0faef8412bdb36a97162 languageName: node linkType: hard -"@polkadot/x-textencoder@npm:13.2.2": - version: 13.2.2 - resolution: "@polkadot/x-textencoder@npm:13.2.2" +"@polkadot/x-textencoder@npm:13.2.3": + version: 13.2.3 + resolution: "@polkadot/x-textencoder@npm:13.2.3" dependencies: - "@polkadot/x-global": "npm:13.2.2" + "@polkadot/x-global": "npm:13.2.3" tslib: "npm:^2.8.0" - checksum: 10c0/ce3e6b2b2fb4a5225629f4cbbeba3d71cd38f35f4b4c26e5a0725b23b91c8a085f94da73d22b4b338a6a4f6d3336c49122cdf69b761a32d528ac1d93862fa396 + checksum: 10c0/94542a22c5b1388772fda2a994b8b2b1627af4849489500f13b310af0a8b572aec492b980d5821ba97329495bac456ad4d895963714b4b77a2b0eb8b8b2864ab languageName: node linkType: hard "@polkadot/x-ws@npm:^13.0.2": - version: 13.2.2 - resolution: "@polkadot/x-ws@npm:13.2.2" + version: 13.2.3 + resolution: "@polkadot/x-ws@npm:13.2.3" dependencies: - "@polkadot/x-global": "npm:13.2.2" + "@polkadot/x-global": "npm:13.2.3" tslib: "npm:^2.8.0" ws: "npm:^8.18.0" - checksum: 10c0/2357628b0c71a4298c79f46c424e62ba3b80e160466aac772265071439b443f440390f5d393775bfe949ee7c4ea840a4197df4187fceddc71e9d8fa95b4c3d44 + checksum: 10c0/7f7b793721d042e3a0bb86033b54d40a06871804c1baed1838a898801bbb0a1e3e1d3946befb39e04ff5d678dada3249ac30424a94f0781e08b7821a3693753f languageName: node linkType: hard @@ -2000,6 +2051,15 @@ __metadata: languageName: node linkType: hard +"@types/websocket@npm:^1": + version: 1.0.10 + resolution: "@types/websocket@npm:1.0.10" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/5950b8d01d1178c67c049f482fcab182085c59c2f98edda5980721f6eb512439ff91534e50ca7262720d75fc42ea6c8f8e5e7739442feea8f3cc0e320ebe2c74 + languageName: node + linkType: hard + "@types/yargs-parser@npm:*": version: 21.0.3 resolution: "@types/yargs-parser@npm:21.0.3" @@ -2017,14 +2077,14 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.13.0" + version: 8.14.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.14.0" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.13.0" - "@typescript-eslint/type-utils": "npm:8.13.0" - "@typescript-eslint/utils": "npm:8.13.0" - "@typescript-eslint/visitor-keys": "npm:8.13.0" + "@typescript-eslint/scope-manager": "npm:8.14.0" + "@typescript-eslint/type-utils": "npm:8.14.0" + "@typescript-eslint/utils": "npm:8.14.0" + "@typescript-eslint/visitor-keys": "npm:8.14.0" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" @@ -2035,66 +2095,66 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/ee96515e9def17b0d1b8d568d4afcd21c5a8a1bc01bf2f30c4d1f396b41a2f49de3508f79c6231a137ca06943dd6933ac00032652190ab99a4e935ffef44df0b + checksum: 10c0/46c82eb45be82ffec0ab04728a5180691b1d17002c669864861a3044b6d2105a75ca23cc80d18721b40b5e7dff1eff4ed68a43d726e25d55f3e466a9fbeeb873 languageName: node linkType: hard "@typescript-eslint/parser@npm:^8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/parser@npm:8.13.0" + version: 8.14.0 + resolution: "@typescript-eslint/parser@npm:8.14.0" dependencies: - "@typescript-eslint/scope-manager": "npm:8.13.0" - "@typescript-eslint/types": "npm:8.13.0" - "@typescript-eslint/typescript-estree": "npm:8.13.0" - "@typescript-eslint/visitor-keys": "npm:8.13.0" + "@typescript-eslint/scope-manager": "npm:8.14.0" + "@typescript-eslint/types": "npm:8.14.0" + "@typescript-eslint/typescript-estree": "npm:8.14.0" + "@typescript-eslint/visitor-keys": "npm:8.14.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/fa04f6c417c0f72104e148f1d7ff53e04108d383550365a556fbfae5d2283484696235db522189e17bc49039946977078e324100cef991ca01f78704182624ad + checksum: 10c0/522b7afd25cd302c0510cc71985ba55ff92ecc5dbe3fc74a76fefea0169252fdd4b8cad6291fef05f63dfc173951af450dca20859c7f23e387b2e7410e8b97b1 languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/scope-manager@npm:8.13.0" +"@typescript-eslint/scope-manager@npm:8.14.0": + version: 8.14.0 + resolution: "@typescript-eslint/scope-manager@npm:8.14.0" dependencies: - "@typescript-eslint/types": "npm:8.13.0" - "@typescript-eslint/visitor-keys": "npm:8.13.0" - checksum: 10c0/1924b3e740e244d98f8a99740b4196d23ae3263303b387c66db94e140455a3132e603a130f3f70fc71e37f4bda5d0c0c67224ae3911908b097ef3f972c136be4 + "@typescript-eslint/types": "npm:8.14.0" + "@typescript-eslint/visitor-keys": "npm:8.14.0" + checksum: 10c0/1e1295c6f9febadf63559aad328b23d960510ce6b4c9f74e10d881c3858fa7f1db767cd1af5272d2fe7c9c5c7daebee71854e6f841e413e5d70af282f6616e26 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/type-utils@npm:8.13.0" +"@typescript-eslint/type-utils@npm:8.14.0": + version: 8.14.0 + resolution: "@typescript-eslint/type-utils@npm:8.14.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:8.13.0" - "@typescript-eslint/utils": "npm:8.13.0" + "@typescript-eslint/typescript-estree": "npm:8.14.0" + "@typescript-eslint/utils": "npm:8.14.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.3.0" peerDependenciesMeta: typescript: optional: true - checksum: 10c0/65319084616f3aea3d9f8dfab30c9b0a70de7314b445805016fdf0d0e39fe073eef2813c3e16c3e1c6a40462ba8eecfdbb12ab1e8570c3407a1cccdb69d4bc8b + checksum: 10c0/42616a664b38ca418e13504247e5e1bad6ae85c045b48e5735ffab977d4bd58cc86fb9d2292bbb314fa408d78d4b0454c3a27dbf9f881f9921917a942825c806 languageName: node linkType: hard -"@typescript-eslint/types@npm:8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/types@npm:8.13.0" - checksum: 10c0/bd3f88b738a92b2222f388bcf831357ef8940a763c2c2eb1947767e1051dd2f8bee387020e8cf4c2309e4142353961b659abc2885e30679109a0488b0bfefc23 +"@typescript-eslint/types@npm:8.14.0": + version: 8.14.0 + resolution: "@typescript-eslint/types@npm:8.14.0" + checksum: 10c0/7707f900e24e60e6780c5705f69627b7c0ef912cb3b095dfc8f4a0c84e866c66b1c4c10278cf99724560dc66985ec640750c4192786a09b853f9bb4c3ca5a7ce languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.13.0" +"@typescript-eslint/typescript-estree@npm:8.14.0": + version: 8.14.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.14.0" dependencies: - "@typescript-eslint/types": "npm:8.13.0" - "@typescript-eslint/visitor-keys": "npm:8.13.0" + "@typescript-eslint/types": "npm:8.14.0" + "@typescript-eslint/visitor-keys": "npm:8.14.0" debug: "npm:^4.3.4" fast-glob: "npm:^3.3.2" is-glob: "npm:^4.0.3" @@ -2104,31 +2164,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/2d45bc5ed4ac352bea927167ac28ef23bd13b6ae352ff50e85cddfdc4b06518f1dd4ae5f2495e30d6f62d247987677a4e807065d55829ba28963908a821dc96d + checksum: 10c0/5e890d22bd067095f871cf144907a8c302db5b5f014c58906ad58d7f23569951cba805042eac6844744e5abb0d3648c9cc221a91b0703da0a8d6345dc1f83e74 languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/utils@npm:8.13.0" +"@typescript-eslint/utils@npm:8.14.0": + version: 8.14.0 + resolution: "@typescript-eslint/utils@npm:8.14.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.13.0" - "@typescript-eslint/types": "npm:8.13.0" - "@typescript-eslint/typescript-estree": "npm:8.13.0" + "@typescript-eslint/scope-manager": "npm:8.14.0" + "@typescript-eslint/types": "npm:8.14.0" + "@typescript-eslint/typescript-estree": "npm:8.14.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 - checksum: 10c0/3fc5a7184a949df5f5b64f6af039a1d21ef7fe15f3d88a5d485ccbb535746d18514751143993a5aee287228151be3e326baf8f899a0a0a93368f6f20857ffa6d + checksum: 10c0/1fcc2651d870832a799a5d1c85fc9421853508a006d6a6073c8316b012489dda77e123d13aea8f53eb9030a2da2c0eb273a6946a9941caa2519b99b33e89b720 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.13.0": - version: 8.13.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.13.0" +"@typescript-eslint/visitor-keys@npm:8.14.0": + version: 8.14.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.14.0" dependencies: - "@typescript-eslint/types": "npm:8.13.0" + "@typescript-eslint/types": "npm:8.14.0" eslint-visitor-keys: "npm:^3.4.3" - checksum: 10c0/50b35f3cf673aaed940613f0007f7c4558a89ebef15c49824e65b6f084b700fbf01b01a4e701e24bbe651297a39678645e739acd255255f1603867a84bef0383 + checksum: 10c0/d0faf70ed9ecff5e36694bbb161a90bea6db59e0e79a7d4f264d67d565c12b13733d664b736b2730935f013c87ce3155cea954a533d28e99987681bc5f6259c3 languageName: node linkType: hard @@ -2342,6 +2402,17 @@ __metadata: languageName: node linkType: hard +"asn1js@npm:^3.0.5": + version: 3.0.5 + resolution: "asn1js@npm:3.0.5" + dependencies: + pvtsutils: "npm:^1.3.2" + pvutils: "npm:^1.1.3" + tslib: "npm:^2.4.0" + checksum: 10c0/bb8eaf4040c8f49dd475566874986f5976b81bae65a6b5526e2208a13cdca323e69ce297bcd435fdda3eb6933defe888e71974d705b6fcb14f2734a907f8aed4 + languageName: node + linkType: hard + "async@npm:3.2.3": version: 3.2.3 resolution: "async@npm:3.2.3" @@ -2594,6 +2665,16 @@ __metadata: languageName: node linkType: hard +"bufferutil@npm:^4.0.1": + version: 4.0.8 + resolution: "bufferutil@npm:4.0.8" + dependencies: + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.3.0" + checksum: 10c0/36cdc5b53a38d9f61f89fdbe62029a2ebcd020599862253fefebe31566155726df9ff961f41b8c97b02b4c12b391ef97faf94e2383392654cf8f0ed68f76e47c + languageName: node + linkType: hard + "busboy@npm:^1.0.0": version: 1.6.0 resolution: "busboy@npm:1.6.0" @@ -2665,9 +2746,9 @@ __metadata: linkType: hard "caniuse-lite@npm:^1.0.30001669": - version: 1.0.30001679 - resolution: "caniuse-lite@npm:1.0.30001679" - checksum: 10c0/87fb89c5cb5130e40fa97b110fe175ea1104c359e4882aa5e277f824fbd33aa024f26d41a25f7d214db985f43d5b148c44e363965d17b36660b126a03e75e6e0 + version: 1.0.30001680 + resolution: "caniuse-lite@npm:1.0.30001680" + checksum: 10c0/11a4e7f6f5d5f965cfd4b7dc4aef34e12a26e99647f02b5ac9fd7f7670845473b95ada416a785473237e4b1b67281f7b043c8736c85b77097f6b697e8950b15f languageName: node linkType: hard @@ -2909,11 +2990,21 @@ __metadata: languageName: node linkType: hard +"d@npm:1, d@npm:^1.0.1, d@npm:^1.0.2": + version: 1.0.2 + resolution: "d@npm:1.0.2" + dependencies: + es5-ext: "npm:^0.10.64" + type: "npm:^2.7.2" + checksum: 10c0/3e6ede10cd3b77586c47da48423b62bed161bf1a48bdbcc94d87263522e22f5dfb0e678a6dba5323fdc14c5d8612b7f7eb9e7d9e37b2e2d67a7bf9f116dabe5a + languageName: node + linkType: hard + "data-access-layer@workspace:.": version: 0.0.0-use.local resolution: "data-access-layer@workspace:." dependencies: - "@autonomys/auto-dag-data": "npm:^1.0.5" + "@autonomys/auto-dag-data": "npm:^1.0.7" "@autonomys/auto-drive": "npm:^1.0.5" "@polkadot/api": "npm:^12.3.1" "@polkadot/types": "npm:^13.0.1" @@ -2926,6 +3017,7 @@ __metadata: "@types/pg": "npm:^8.11.10" "@types/pg-format": "npm:^1" "@types/uuid": "npm:^10" + "@types/websocket": "npm:^1" "@typescript-eslint/eslint-plugin": "npm:^8.13.0" "@typescript-eslint/parser": "npm:^8.13.0" blockstore-core: "npm:^5.0.2" @@ -2952,6 +3044,7 @@ __metadata: ts-node: "npm:^10.9.2" typescript: "npm:^5.6.3" uuid: "npm:^10.0.0" + websocket: "npm:^1.0.35" zod: "npm:^3.23.8" languageName: unknown linkType: soft @@ -3016,7 +3109,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:2.6.9": +"debug@npm:2.6.9, debug@npm:^2.2.0": version: 2.6.9 resolution: "debug@npm:2.6.9" dependencies: @@ -3181,9 +3274,9 @@ __metadata: linkType: hard "electron-to-chromium@npm:^1.5.41": - version: 1.5.55 - resolution: "electron-to-chromium@npm:1.5.55" - checksum: 10c0/1b9e0970a591d342cf4d4c95b63bcdb8bffed01edb7c8baed8dd54ea769c8b33c07484c94a031a20363a8129ca2ad1d612ce4ca55ec831244240ae1e6bcdf07c + version: 1.5.61 + resolution: "electron-to-chromium@npm:1.5.61" + checksum: 10c0/8d0b4700ab8719071d9963c6d1ea768db1c1597d0439a20a8e85017654d121128c9d3f589f4b069ccfb466ed6a78380bdaa189e3210159ede6fad39e4e7c560d languageName: node linkType: hard @@ -3277,6 +3370,39 @@ __metadata: languageName: node linkType: hard +"es5-ext@npm:^0.10.35, es5-ext@npm:^0.10.62, es5-ext@npm:^0.10.63, es5-ext@npm:^0.10.64, es5-ext@npm:~0.10.14": + version: 0.10.64 + resolution: "es5-ext@npm:0.10.64" + dependencies: + es6-iterator: "npm:^2.0.3" + es6-symbol: "npm:^3.1.3" + esniff: "npm:^2.0.1" + next-tick: "npm:^1.1.0" + checksum: 10c0/4459b6ae216f3c615db086e02437bdfde851515a101577fd61b19f9b3c1ad924bab4d197981eb7f0ccb915f643f2fc10ff76b97a680e96cbb572d15a27acd9a3 + languageName: node + linkType: hard + +"es6-iterator@npm:^2.0.3": + version: 2.0.3 + resolution: "es6-iterator@npm:2.0.3" + dependencies: + d: "npm:1" + es5-ext: "npm:^0.10.35" + es6-symbol: "npm:^3.1.1" + checksum: 10c0/91f20b799dba28fb05bf623c31857fc1524a0f1c444903beccaf8929ad196c8c9ded233e5ac7214fc63a92b3f25b64b7f2737fcca8b1f92d2d96cf3ac902f5d8 + languageName: node + linkType: hard + +"es6-symbol@npm:^3.1.1, es6-symbol@npm:^3.1.3": + version: 3.1.4 + resolution: "es6-symbol@npm:3.1.4" + dependencies: + d: "npm:^1.0.2" + ext: "npm:^1.7.0" + checksum: 10c0/777bf3388db5d7919e09a0fd175aa5b8a62385b17cb2227b7a137680cba62b4d9f6193319a102642aa23d5840d38a62e4784f19cfa5be4a2210a3f0e9b23d15d + languageName: node + linkType: hard + "escalade@npm:^3.1.1, escalade@npm:^3.2.0": version: 3.2.0 resolution: "escalade@npm:3.2.0" @@ -3432,6 +3558,18 @@ __metadata: languageName: node linkType: hard +"esniff@npm:^2.0.1": + version: 2.0.1 + resolution: "esniff@npm:2.0.1" + dependencies: + d: "npm:^1.0.1" + es5-ext: "npm:^0.10.62" + event-emitter: "npm:^0.3.5" + type: "npm:^2.7.2" + checksum: 10c0/7efd8d44ac20e5db8cb0ca77eb65eca60628b2d0f3a1030bcb05e71cc40e6e2935c47b87dba3c733db12925aa5b897f8e0e7a567a2c274206f184da676ea2e65 + languageName: node + linkType: hard + "espree@npm:^9.0.0, espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" @@ -3499,6 +3637,16 @@ __metadata: languageName: node linkType: hard +"event-emitter@npm:^0.3.5": + version: 0.3.5 + resolution: "event-emitter@npm:0.3.5" + dependencies: + d: "npm:1" + es5-ext: "npm:~0.10.14" + checksum: 10c0/75082fa8ffb3929766d0f0a063bfd6046bd2a80bea2666ebaa0cfd6f4a9116be6647c15667bea77222afc12f5b4071b68d393cf39fdaa0e8e81eda006160aff0 + languageName: node + linkType: hard + "eventemitter3@npm:^5.0.1": version: 5.0.1 resolution: "eventemitter3@npm:5.0.1" @@ -3589,6 +3737,15 @@ __metadata: languageName: node linkType: hard +"ext@npm:^1.7.0": + version: 1.7.0 + resolution: "ext@npm:1.7.0" + dependencies: + type: "npm:^2.7.2" + checksum: 10c0/a8e5f34e12214e9eee3a4af3b5c9d05ba048f28996450975b369fc86e5d0ef13b6df0615f892f5396a9c65d616213c25ec5b0ad17ef42eac4a500512a19da6c7 + languageName: node + linkType: hard + "eyes@npm:0.1.x": version: 0.1.8 resolution: "eyes@npm:0.1.8" @@ -4311,6 +4468,13 @@ __metadata: languageName: node linkType: hard +"is-typedarray@npm:^1.0.0": + version: 1.0.0 + resolution: "is-typedarray@npm:1.0.0" + checksum: 10c0/4c096275ba041a17a13cca33ac21c16bc4fd2d7d7eb94525e7cd2c2f2c1a3ab956e37622290642501ff4310601e413b675cf399ad6db49855527d2163b3eeeec + languageName: node + linkType: hard + "isarray@npm:~1.0.0": version: 1.0.0 resolution: "isarray@npm:1.0.0" @@ -5603,14 +5767,21 @@ __metadata: languageName: node linkType: hard +"next-tick@npm:^1.1.0": + version: 1.1.0 + resolution: "next-tick@npm:1.1.0" + checksum: 10c0/3ba80dd805fcb336b4f52e010992f3e6175869c8d88bf4ff0a81d5d66e6049f89993463b28211613e58a6b7fe93ff5ccbba0da18d4fa574b96289e8f0b577f28 + languageName: node + linkType: hard + "nock@npm:^13.5.4": - version: 13.5.5 - resolution: "nock@npm:13.5.5" + version: 13.5.6 + resolution: "nock@npm:13.5.6" dependencies: debug: "npm:^4.1.0" json-stringify-safe: "npm:^5.0.1" propagate: "npm:^2.0.0" - checksum: 10c0/58be4dda214d6e1914232ae41a3ac4f4e05622f71eb82825816f3030e0343bd54c1001878a6bce8412067c1059730919f3d600069d76f1336da11f47bd3b5d40 + checksum: 10c0/94249a294176a6e521bbb763c214de4aa6b6ab63dff1e299aaaf455886a465d38906891d7f24570d94a43b1e376c239c54d89ff7697124bc57ef188006acc25e languageName: node linkType: hard @@ -5640,6 +5811,17 @@ __metadata: languageName: node linkType: hard +"node-gyp-build@npm:^4.3.0": + version: 4.8.3 + resolution: "node-gyp-build@npm:4.8.3" + bin: + node-gyp-build: bin.js + node-gyp-build-optional: optional.js + node-gyp-build-test: build-test.js + checksum: 10c0/a7f43c4128d817db80bb0884f631121449ac586b4a3e708eab0db6fcb7fa0d2e66f6d7d4ee1f49469409de4a9b2e413926befe2dce70b850c6c583a3bbe228d2 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 10.2.0 resolution: "node-gyp@npm:10.2.0" @@ -5709,9 +5891,9 @@ __metadata: linkType: hard "object-inspect@npm:^1.13.1": - version: 1.13.2 - resolution: "object-inspect@npm:1.13.2" - checksum: 10c0/b97835b4c91ec37b5fd71add84f21c3f1047d1d155d00c0fcd6699516c256d4fcc6ff17a1aced873197fe447f91a3964178fd2a67a1ee2120cdaf60e81a050b4 + version: 1.13.3 + resolution: "object-inspect@npm:1.13.3" + checksum: 10c0/cc3f15213406be89ffdc54b525e115156086796a515410a8d390215915db9f23c8eab485a06f1297402f440a33715fe8f71a528c1dcbad6e1a3bcaf5a46921d4 languageName: node linkType: hard @@ -6374,6 +6556,22 @@ __metadata: languageName: node linkType: hard +"pvtsutils@npm:^1.3.2, pvtsutils@npm:^1.3.5": + version: 1.3.5 + resolution: "pvtsutils@npm:1.3.5" + dependencies: + tslib: "npm:^2.6.1" + checksum: 10c0/d425aed316907e0b447a459bfb97c55d22270c3cfdba5a07ec90da0737b0e40f4f1771a444636f85bb6a453de90ff8c6b5f4f6ddba7597977166af49974b4534 + languageName: node + linkType: hard + +"pvutils@npm:^1.1.3": + version: 1.1.3 + resolution: "pvutils@npm:1.1.3" + checksum: 10c0/23489e6b3c76b6afb6964a20f891d6bef092939f401c78bba186b2bfcdc7a13904a0af0a78f7933346510f8c1228d5ab02d3c80e968fd84d3c76ff98d8ec9aac + languageName: node + linkType: hard + "qs@npm:6.13.0": version: 6.13.0 resolution: "qs@npm:6.13.0" @@ -7168,7 +7366,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.1.0, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.7.0, tslib@npm:^2.8.0": +"tslib@npm:^2.0.0, tslib@npm:^2.1.0, tslib@npm:^2.4.0, tslib@npm:^2.6.1, tslib@npm:^2.6.2, tslib@npm:^2.6.3, tslib@npm:^2.7.0, tslib@npm:^2.8.0": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62 @@ -7242,6 +7440,22 @@ __metadata: languageName: node linkType: hard +"type@npm:^2.7.2": + version: 2.7.3 + resolution: "type@npm:2.7.3" + checksum: 10c0/dec6902c2c42fcb86e3adf8cdabdf80e5ef9de280872b5fd547351e9cca2fe58dd2aa6d2547626ddff174145db272f62d95c7aa7038e27c11315657d781a688d + languageName: node + linkType: hard + +"typedarray-to-buffer@npm:^3.1.5": + version: 3.1.5 + resolution: "typedarray-to-buffer@npm:3.1.5" + dependencies: + is-typedarray: "npm:^1.0.0" + checksum: 10c0/4ac5b7a93d604edabf3ac58d3a2f7e07487e9f6e98195a080e81dbffdc4127817f470f219d794a843b87052cedef102b53ac9b539855380b8c2172054b7d5027 + languageName: node + linkType: hard + "typedarray@npm:^0.0.6": version: 0.0.6 resolution: "typedarray@npm:0.0.6" @@ -7375,6 +7589,16 @@ __metadata: languageName: node linkType: hard +"utf-8-validate@npm:^5.0.2": + version: 5.0.10 + resolution: "utf-8-validate@npm:5.0.10" + dependencies: + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.3.0" + checksum: 10c0/23cd6adc29e6901aa37ff97ce4b81be9238d0023c5e217515b34792f3c3edb01470c3bd6b264096dd73d0b01a1690b57468de3a24167dd83004ff71c51cc025f + languageName: node + linkType: hard + "util-deprecate@npm:~1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -7449,6 +7673,33 @@ __metadata: languageName: node linkType: hard +"webcrypto-core@npm:^1.8.0": + version: 1.8.1 + resolution: "webcrypto-core@npm:1.8.1" + dependencies: + "@peculiar/asn1-schema": "npm:^2.3.13" + "@peculiar/json-schema": "npm:^1.1.12" + asn1js: "npm:^3.0.5" + pvtsutils: "npm:^1.3.5" + tslib: "npm:^2.7.0" + checksum: 10c0/b85a986b4f73e8505ec5eaafe8e4f1ff02574a3b655793aca91f913d02822c8b79168ad6961eaab86ae00fec00bf780ec4cef7535f64879fb866649bc2a723fa + languageName: node + linkType: hard + +"websocket@npm:^1.0.35": + version: 1.0.35 + resolution: "websocket@npm:1.0.35" + dependencies: + bufferutil: "npm:^4.0.1" + debug: "npm:^2.2.0" + es5-ext: "npm:^0.10.63" + typedarray-to-buffer: "npm:^3.1.5" + utf-8-validate: "npm:^5.0.2" + yaeti: "npm:^0.0.6" + checksum: 10c0/8be9a68dc0228f18058c9010d1308479f05050af8f6d68b9dbc6baebd9ab484c15a24b2521a5d742a9d78e62ee19194c532992f1047a9b9adf8c3eedb0b1fcdc + languageName: node + linkType: hard + "when@npm:~2.0.1": version: 2.0.1 resolution: "when@npm:2.0.1" @@ -7599,6 +7850,13 @@ __metadata: languageName: node linkType: hard +"yaeti@npm:^0.0.6": + version: 0.0.6 + resolution: "yaeti@npm:0.0.6" + checksum: 10c0/4e88702d8b34d7b61c1c4ec674422b835d453b8f8a6232be41e59fc98bc4d9ab6d5abd2da55bab75dfc07ae897fdc0c541f856ce3ab3b17de1630db6161aa3f6 + languageName: node + linkType: hard + "yallist@npm:^3.0.2": version: 3.1.1 resolution: "yallist@npm:3.1.1" diff --git a/frontend/.yarn/install-state.gz b/frontend/.yarn/install-state.gz index 731d046a..00d79cbe 100644 Binary files a/frontend/.yarn/install-state.gz and b/frontend/.yarn/install-state.gz differ diff --git a/frontend/package.json b/frontend/package.json index 8d5f1e98..45b13d6b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,12 +9,13 @@ "lint": "next lint" }, "dependencies": { - "@autonomys/auto-drive": "^1.0.5", + "@autonomys/auto-drive": "^1.0.7", "@headlessui/react": "^2.1.8", "@heroicons/react": "^2.1.5", "@ipld/dag-pb": "^4.1.2", "@peculiar/webcrypto": "^1.5.0", "@uidotdev/usehooks": "^2.4.1", + "byte-size": "^9.0.0", "bytes": "^3.1.2", "fflate": "^0.8.2", "jszip": "^3.10.1", @@ -29,11 +30,13 @@ "streamsaver": "^2.0.6", "usehooks-ts": "^3.1.0", "util-browser": "^0.0.2", + "zod": "^3.23.8", "zustand": "^5.0.0" }, "devDependencies": { - "@autonomys/auto-dag-data": "^1.0.4", + "@autonomys/auto-dag-data": "^1.0.7", "@next/eslint-plugin-next": "^15.0.2", + "@types/byte-size": "^8.1.2", "@types/bytes": "^3", "@types/eslint-plugin-jsx-a11y": "^6", "@types/node": "^20", diff --git a/frontend/src/components/Files/Metadata.tsx b/frontend/src/components/Files/Metadata.tsx index b251cdaf..2ab602ca 100644 --- a/frontend/src/components/Files/Metadata.tsx +++ b/frontend/src/components/Files/Metadata.tsx @@ -7,10 +7,18 @@ export const Metadata = ({ object }: { object: ObjectSummary }) => { return (
-

- {object.name} -

-

Size: {bytes(object.size)}

+
+

+ {object.name} +

+ {object.uploadStatus.archivedNodes === + object.uploadStatus.totalNodes && ( + + ARCHIVED + + )} +
+

Size: {bytes(Number(object.size))}

CID: {object.headCid}

@@ -46,7 +54,9 @@ export const Metadata = ({ object }: { object: ObjectSummary }) => {
Archive blocks count: - 0 + + {object.uploadStatus.archivedNodes ?? 'N/A'} +
diff --git a/frontend/src/components/Files/UploadingObjects.tsx b/frontend/src/components/Files/UploadingObjects.tsx index 08c1c660..a0ec2425 100644 --- a/frontend/src/components/Files/UploadingObjects.tsx +++ b/frontend/src/components/Files/UploadingObjects.tsx @@ -109,7 +109,7 @@ const UploadingObject = ({

{metadata.name}

- Size: {bytes(metadata.totalSize)} + Size: {bytes(Number(metadata.totalSize))}

Fees: 0 ATC

diff --git a/frontend/src/components/RemainingCreditTracker/index.tsx b/frontend/src/components/RemainingCreditTracker/index.tsx index de7826ce..899ad082 100644 --- a/frontend/src/components/RemainingCreditTracker/index.tsx +++ b/frontend/src/components/RemainingCreditTracker/index.tsx @@ -31,8 +31,13 @@ export const RemainingCreditTracker = ({
- {bytes(uploadUsed)}/ - {bytes(uploadLimit)} + + {bytes(Number(uploadUsed))} + + / + + {bytes(Number(uploadLimit))} + diff --git a/frontend/src/components/common/FileCard.tsx b/frontend/src/components/common/FileCard.tsx index a14fecbc..85d5949d 100644 --- a/frontend/src/components/common/FileCard.tsx +++ b/frontend/src/components/common/FileCard.tsx @@ -90,7 +90,7 @@ export const FileCard = ({

{name}

-

Size: {bytes(totalSize)}

+

Size: {bytes(Number(totalSize))}