@nebulous/skynet
Advanced tools
Comparing version 0.0.7 to 0.0.8
14
index.js
@@ -7,3 +7,3 @@ const axios = require('axios') | ||
portalUrl: "https://siasky.net", | ||
portalUploadPath: "/api/skyfile", | ||
portalUploadPath: "/skynet/skyfile", | ||
portalFileFieldname: "file", | ||
@@ -23,3 +23,4 @@ customFilename: "", | ||
const url = `${trimTrailingSlash(opts.portalUrl)}${opts.portalUploadPath}` | ||
const uuid = generateUUID() | ||
const url = `${trimTrailingSlash(opts.portalUrl)}${trimTrailingSlash(opts.portalUploadPath)}/${uuid}` | ||
@@ -54,2 +55,11 @@ return new Promise((resolve, reject) => { | ||
function generateUUID() { | ||
let uuid = '' | ||
const cs = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | ||
for (let i = 0; i < 16; i++) { | ||
uuid += cs.charAt(Math.floor(Math.random() * cs.length)); | ||
} | ||
return uuid; | ||
} | ||
function trimSiaPrefix(str) { | ||
@@ -56,0 +66,0 @@ return str.replace("sia://", "") |
{ | ||
"name": "@nebulous/skynet", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Skynet SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3651
61