Skip to content

Commit f150f27

Browse files
authored
Merge pull request #99 from lighthouse-web3/v0.2.7
V0.2.7
2 parents 7e619ac + 0e6d50e commit f150f27

28 files changed

+124
-92
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Lighthouse <img src="https://img.shields.io/badge/BETA-v0.2.6-green"/>
1+
# Lighthouse <img src="https://img.shields.io/badge/BETA-v0.2.7-green"/>
22

33
Lighthouse is a permanent decentralized file storage protocol that allows the ability to pay once and store forever. While traditionally, users need to repeatedly keep track and pay for their storage after every fixed amount of time, Lighthouse manages this for them and makes sure that user files are stored forever. The aim is to move users from a rent-based cost model where they are renting their own files on cloud storage to a permanent ownership model. It is built on top of IPFS, Filecoin, and Polygon. It uses the existing miner network and storage capacity of the filecoin network.
44

package-lock.json

Lines changed: 6 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lighthouse-web3/sdk",
3-
"version": "0.2.6",
3+
"version": "0.2.7",
44
"description": "NPM package and CLI tool to interact with lighthouse protocol",
55
"main": "./dist/Lighthouse/index.js",
66
"types": "./dist/Lighthouse/index.d.ts",
@@ -56,6 +56,7 @@
5656
"@types/fs-extra": "^11.0.1",
5757
"@types/jest": "^29.5.0",
5858
"@types/mime-types": "^2.1.1",
59+
"@types/node": "^20.5.3",
5960
"@types/read": "^0.0.29",
6061
"@typescript-eslint/eslint-plugin": "^5.57.1",
6162
"@typescript-eslint/parser": "^5.57.1",

src/Commands/api-key.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default async (data: any, options: any) => {
5757
}
5858
} catch (error: any) {
5959
console.log(red(error.message))
60+
process.exit(0)
6061
}
6162
}
6263
}

src/Commands/create-car.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@ export default async function (_path: string, options: any) {
2020
} else {
2121
try {
2222
const path = resolve(process.cwd(), _path)
23-
if(fs.lstatSync(path).isDirectory()){
23+
if (fs.lstatSync(path).isDirectory()) {
2424
throw new Error('Directory is not supported')
25-
} else{
25+
} else {
2626
const apiKey = config.get('LIGHTHOUSE_GLOBAL_API_KEY') as string
2727
if (!apiKey) {
2828
throw new Error('Please create api-key first: use api-key command')
2929
}
3030

31-
const authToken = (await lighthouse.dataDepotAuth(apiKey)).data.access_token
31+
const authToken = (await lighthouse.dataDepotAuth(apiKey)).data
32+
.access_token
3233
const uploadResponse = await lighthouse.createCar(path, authToken)
3334
console.log(green('File uploaded successfully!!!'))
3435
}
3536
} catch (error: any) {
3637
console.log(red(error.message))
38+
process.exit(0)
3739
}
3840
}
3941
}

src/Commands/create-wallet.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,6 @@ export default async (_: any, _options: any) => {
4646
})
4747
} catch (error: any) {
4848
console.log(red(error.message))
49+
process.exit(0)
4950
}
5051
}

src/Commands/deal-status.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default async function (data: any, options: any) {
4949
: showResponse(data, dealStatus)
5050
} catch (error: any) {
5151
console.log(red(error.message))
52+
process.exit(0)
5253
}
5354
}
5455
}

src/Commands/decrypt-file.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@ export default async function (cid: string) {
5454
fs.createWriteStream(fileDetails.fileName).write(Buffer.from(decryptedFile))
5555
} catch (error: any) {
5656
console.log(red(error.message))
57+
process.exit(0)
5758
}
5859
}

src/Commands/get-uploads.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ export default async function () {
3737
}
3838
} catch (error: any) {
3939
console.log(red(error.message))
40+
process.exit(0)
4041
}
4142
}

src/Commands/import-wallet.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default async function (data: any, options: any) {
3636
)
3737
} catch (error: any) {
3838
console.log(red(error.message))
39+
process.exit(0)
3940
}
4041
}
4142
}

0 commit comments

Comments
 (0)