Skip to content

Commit

Permalink
Feature/typescript integration (#19)
Browse files Browse the repository at this point in the history
* fix: set python version for pyenv

* refactor: migrate to typescript

* test: reference compile js

* chore(npm): change npm script prepublish -> prepare

* delete .python-version

* fix(tsconfig): remove , af the end of last field delclaration

* Added HelloStorj.ts, Added two functions

Co-authored-by: Ayush <[email protected]>
  • Loading branch information
NemeSnz and ayush-srivastava-03 authored Jan 25, 2021
1 parent 85297ca commit 35e4dc3
Show file tree
Hide file tree
Showing 1,347 changed files with 31,481 additions and 11,267 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
dist
150 changes: 78 additions & 72 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,78 @@
# Storj-Nodejs Changelog

## [1.0.7] - 24-08-2020
* Updated Make file

## [1.0.6] - 10-08-2020
* Changed function structures
* Updates documentation
* Updated HelloStorj.js

## [1.0.5] - 13-07-2020
* Added Testcases
* Updates documentation

## [1.0.5] - 29-06-2020
* Bugs fixed
* Removed docs folder

## [1.0.4] - 25-06-2020
* Asyncronous function
* Changed HelloStorj.js
* Splitted c files

## [1.0.3] - 09-06-2020
### Changelog:
* Updated ReadMe
* Removed Warnings
* Improved Memory managment and memory leaks
* Changed module name

## [1.0.2] - 09-05-2020
### Changelog:
* Updated module version

## [0.10.2] - 06-05-2020
### Changelog:
* Updated README.md
* Add Makefile
* Resloved MacOS Image not fount issue

## [0.10.1] - 14-04-2020
### Changelog:
* Updated README.md

## [0.10.0] - 13-04-2020
### Changelog:
* Updated README.md
* Updated Project according to RC 1.0
* Resolved windows issue

## [0.9.2] - 05-02-2020
### Changelog:
* Updated README.md
* Updated Error statements

## [0.9.1] - 27-01-2020
### Changelog:
* Automated creation of libuplink.so file.
* Removed dependency from ref modules

## [0.8.8] - 25-11-2019
### Changelog:
* Removed download_file and upload_file function from library.

## [0.8.7] - 18-11-2019
### Changelog:
* Updated new_uplink fucntion parameters
* Changes made in UplinkConfig->Volatile structure

## [0.8.6] - 14-11-2019
### Changelog:
* Updated package to reads path from .env config file
# Storj-Nodejs Changelog

## [1.0.9] - 27-11-2020
* Merged PR

## [1.0.7] - 03-09-2020
* Added functions and updated code according to uplink-c v1.1.0 master branch

## [1.0.7] - 24-08-2020
* Updated Make file

## [1.0.6] - 10-08-2020
* Changed function structures
* Updates documentation
* Updated HelloStorj.js

## [1.0.5] - 13-07-2020
* Added Testcases
* Updates documentation

## [1.0.5] - 29-06-2020
* Bugs fixed
* Removed docs folder

## [1.0.4] - 25-06-2020
* Asyncronous function
* Changed HelloStorj.js
* Splitted c files

## [1.0.3] - 09-06-2020
### Changelog:
* Updated ReadMe
* Removed Warnings
* Improved Memory managment and memory leaks
* Changed module name

## [1.0.2] - 09-05-2020
### Changelog:
* Updated module version

## [0.10.2] - 06-05-2020
### Changelog:
* Updated README.md
* Add Makefile
* Resloved MacOS Image not fount issue

## [0.10.1] - 14-04-2020
### Changelog:
* Updated README.md

## [0.10.0] - 13-04-2020
### Changelog:
* Updated README.md
* Updated Project according to RC 1.0
* Resolved windows issue

## [0.9.2] - 05-02-2020
### Changelog:
* Updated README.md
* Updated Error statements

## [0.9.1] - 27-01-2020
### Changelog:
* Automated creation of libuplink.so file.
* Removed dependency from ref modules

## [0.8.8] - 25-11-2019
### Changelog:
* Removed download_file and upload_file function from library.

## [0.8.7] - 18-11-2019
### Changelog:
* Updated new_uplink fucntion parameters
* Changes made in UplinkConfig->Volatile structure

## [0.8.6] - 14-11-2019
### Changelog:
* Updated package to reads path from .env config file
19 changes: 17 additions & 2 deletions HelloStorj.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function getDateTime(unixTimestamp) {
}
//
async function accessshare(uplink,access){
var permission = new storj.Permission(true,true,true,false,0,0);
var permission = new storj.Permission(false,false,false,true,0,0);
var sharePrefix = storj.SharePrefix;
var sharePrefixListArray = [];
sharePrefix.bucket = "change-me-to-desired-bucket-name";
Expand All @@ -72,9 +72,24 @@ async function accessshare(uplink,access){
//
console.log("Parsing access share...");
await uplink.parseAccess(stringResult).then(async (parsedSharedAccess) => {
//
console.log("\nDeriving encryption key");
//
var encryption = await libUplink.uplinkDeriveEncryptionKey("test",[4,5,6]).catch((error) => {
console.log("Failed to derive encryption key");
console.log(error);
});
//
console.log("Over riding encryption key");
//
await parsedSharedAccess.overrideEncryptionKey(sharePrefix.bucket,sharePrefix.prefix,encryption["encryption_key"]).catch((err) => {
console.log("Failed to over write encryption key");
console.log(err);
});
//
console.log("Opening project using paresed shared access");
await parsedSharedAccess.openProject().then(async (project) => {
//
//
console.log("\nOpened Project using share access");
await project.deleteObject(storjConfig.bucketName,storjConfig.uploadPath).then((objectInfo) => {
Expand Down Expand Up @@ -414,4 +429,4 @@ var access = libUplink.requestAccessWithPassphrase(storjConfig.satelliteURL,stor
}).catch((err) => {
console.log("Failed to get access");
console.log(err);
});
});
Loading

0 comments on commit 35e4dc3

Please sign in to comment.