@@ -73658,34 +73658,26 @@ async function buildManifest (files, buildDir, signer) {
73658
73658
}
73659
73659
73660
73660
;// CONCATENATED MODULE: ./src/utils/getContentTypeByExtension.js
73661
+ const CONTENT_TYPE_MAPPING = {
73662
+ '.html': 'text/html',
73663
+ '.txt': 'text/plain',
73664
+ '.css': 'text/css',
73665
+ '.js': 'application/javascript',
73666
+ '.js.map': 'application/json',
73667
+ '.json': 'application/json',
73668
+ '.png': 'image/png',
73669
+ '.ico': 'image/x-icon',
73670
+ '.jpg': 'image/jpeg',
73671
+ '.jpeg': 'image/jpeg',
73672
+ '.gif': 'image/gif',
73673
+ '.svg': 'image/svg+xml',
73674
+ }
73675
+
73661
73676
function getContentTypeByExtension(ext) {
73662
- switch (ext.toLowerCase()) {
73663
- case '.html':
73664
- return 'text/html'
73665
- case '.txt':
73666
- return 'text/plain'
73667
- case '.css':
73668
- return 'text/css'
73669
- case '.js':
73670
- return 'application/javascript'
73671
- case '.js.map':
73672
- return 'application/json'
73673
- case '.json':
73674
- return 'application/json'
73675
- case '.png':
73676
- return 'image/png'
73677
- case '.ico':
73678
- return 'image/x-icon'
73679
- case '.jpg':
73680
- case '.jpeg':
73681
- return 'image/jpeg'
73682
- case '.gif':
73683
- return 'image/gif'
73684
- case '.svg':
73685
- return 'image/svg+xml'
73686
- default:
73687
- return 'application/octet-stream' // default to binary data
73688
- }
73677
+ const extension = ext.toLowerCase()
73678
+ return CONTENT_TYPE_MAPPING[extension]
73679
+ ? CONTENT_TYPE_MAPPING[extension]
73680
+ : 'application/octet-stream'
73689
73681
}
73690
73682
73691
73683
;// CONCATENATED MODULE: ./src/utils/createDataItem.js
@@ -73818,34 +73810,40 @@ async function upload(buildDir, privateKey, dryRun) {
73818
73810
const txId = await executeTransaction(tx, arweave, dryRun)
73819
73811
73820
73812
if (dryRun) {
73821
- return 1
73813
+ return {
73814
+ result: 'dry-run',
73815
+ manifestId: manifestDataItem.id
73816
+ }
73822
73817
}
73823
73818
console.log(`Wait for tx ${txId}...`)
73824
- let response = await arweave.transactions.getStatus(txId)
73819
+ let result = await arweave.transactions.getStatus(txId)
73825
73820
73826
73821
console.log(
73827
73822
'----> number_of_confirmations:',
73828
- response .confirmed?.number_of_confirmations,
73823
+ result .confirmed?.number_of_confirmations,
73829
73824
)
73830
- while (!response .confirmed?.number_of_confirmations > 0) {
73825
+ while (!result .confirmed?.number_of_confirmations > 0) {
73831
73826
console.log(
73832
- `${txId} confirmations: ${response .confirmed?.number_of_confirmations}`,
73827
+ `${txId} confirmations: ${result .confirmed?.number_of_confirmations}`,
73833
73828
)
73834
73829
await sleep(1000 * 5)
73835
- response = await arweave.transactions.getStatus(txId)
73830
+ result = await arweave.transactions.getStatus(txId)
73836
73831
}
73837
73832
console.log(`https://viewblock.io/arweave/tx/${txId}`)
73838
73833
console.log(`${txId} confirmed`)
73839
73834
console.log(
73840
73835
` ${txId} number_of_confirmations:`,
73841
- response .confirmed.number_of_confirmations,
73836
+ result .confirmed.number_of_confirmations,
73842
73837
)
73843
- console.log(` tx ${txId} block_height:`, response .confirmed.block_height)
73838
+ console.log(` tx ${txId} block_height:`, result .confirmed.block_height)
73844
73839
console.log(
73845
73840
` tx ${txId} block_indep_hash:`,
73846
- response .confirmed.block_indep_hash,
73841
+ result .confirmed.block_indep_hash,
73847
73842
)
73848
- return response.confirmed
73843
+ return {
73844
+ result,
73845
+ manifestId: manifestDataItem.id
73846
+ }
73849
73847
}
73850
73848
73851
73849
0 commit comments