Beta versions are released on the beta
stream. The latest beta can be installed with npm install skynet-js@beta
.
For the latest stable changes, see CHANGELOG.md.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Types of changes:
Added
for new features.Changed
for changes in existing functionality.Removed
for now removed features.
- Removed console output when uploading large files.
- Fixed broken single-chunk uploads when chunkSizeMultiplier > 1.
- Improved performance and stability of integration tests.
- Added
client.getFileContentBinary
andclient.getFileContentBinaryHns
methods for downloading binary data. - Added
chunkSizeMultiplier
option for large file uploads. - Added
staggerPercent
option for more efficient uploading of large file uploads.
- Large file uploads now make one less request before starting an upload.
- Throws error when passing both dev and alpha options for MySky (#257). By @amberm31 in #352
- Mysky login flow fixes. By @m-cat in #403
- Added SkyDB V2.
- SkyDB V2 can be accessed with
client.dbV2
andmySky.dbV2
. - SkyDB V2 methods use a revision number cache internally, improving performance and correctness.
dbV2.setJSON
does not make a network request to get the latest revision number, so you must always calldbV2.getJSON
first.
- SkyDB V2 can be accessed with
- Errors caused by network requests to
skyd
are now typeExecuteRequestError
.- This error type is fully compatible with
AxiosError
. - Errors from failed requests now contain a message with the original message
from axios as well as the full context from
skyd
. ExecuteRequestError
also contains.responseMessage
and.responseStatus
.ExecuteRequestError
can be used withinstanceof
(unlike AxiosError).
- This error type is fully compatible with
- Parallel uploads for large files have been fixed and re-enabled. This should improve performance.
- Add option for portal API keys and env var for integration tests
- Added ability to set custom cookie in integration tests with the
SKYNET_JS_INTEGRATION_TEST_CUSTOM_COOKIE
env var.
- Fix critical tus upload bug.
Revert 4.0.21-beta
.
- [Breaking change] - SkyDB methods now use a revision number cache
internally, improving performance and correctness.
setJSON
no longer makes a network request to get the latest revision number, so you must always callgetJSON
first. - [Breaking change] - Errors from
skyd
requests are now typeExecuteRequestError
as opposed toAxiosError
. The axios error can be retrieved with.originalError
. - Error messages from
skyd
requests now contain the full, descriptive error response returned fromskyd
. - Parallel uploads for large files have been fixed and re-enabled. This should improve performance.
- Added exports for encryption utilities
decryptJSONFile
,encryptJSONFile
,ENCRYPTED_JSON_RESPONSE_VERSION
, andEncryptedJSONResponse
.
- Add MySky ID verification
mySky.signMessage
mySky.verifyMessageSignature
- Expose
executeRequest
.
- Try resolving the portal URL again if the previous attempt failed.
- Revert tus parallel uploads due to bug with chunking.
- Fixed
downloadFileHns
to takeCustomHnsDownloadOptions
.
- Add missing entry data methods
mySky.deleteEntryData
db.getEntryData
,db.setEntryData
,db.deleteEntryData
- Fixed some bugs affecting the MySky UI window.
- Added
mySky.isBrowserSupported
method to check for unsupported browsers.
- Downloads now verify the registry proofs returned from the portal.
- Large file uploads now upload in parallel for more efficient uploads.
- Deprecated
client.registry.getEntryLink
in flavor of the standalone and non-asyncgetEntryLink
function.
- Added
validateRegistryProof
function. - Added the
errorPages
andtryFiles
options for directory uploads. - Exported some crypto length constants.
- Add
tryfiles
option for uploads.
- Added
onDownloadProgress
client option.
- Updated default requested permissions when
skappDomain
!= skapp URL to include Discoverable Write. - Removed case sensitivity from MySky URL and domain processing.
- Encrypted files API.
mySky.setJSONEncrypted
mySky.getJSONEncrypted
mySky.getEncryptedFileSeed
file.getJSONEncrypted
- Export MySky as value instead of as type + minor fixes.
- Error reporting for large files has been improved.
- Fixed large file upload cookies and sticky sessions.
- Added
client.pinSkylink
.
- Fixed
mySky.getEntryLink
andfile.getEntryLink
bug.
- [Breaking change] Removed
merkleRoot
andbitfield
from upload response.
- Added support for large file uploads. The tus protocol will be used for files greater than 40MiB in size.
- Added
convertSkylinkToBase64
. - Added
mySky.getEntryData
,mySky.setEntryData
, andfile.getEntryData
. - Added
range
option to download options.
- [Breaking change] The
sia:
skylink prefix has been changed tosia://
. - [Breaking change] Added missing
sia://
prefixes to the skylinks returned from SkyDB and MySky. - The
resolveHNS
method now works for Handshake domains withskyns://
HNS entries.
- Added
db.deleteJSON
andmySky.deleteJSON
. - Added
db.setDataLink
. - Added
isSkylinkV1
andisSkylinkV2
. - Added
file.getEntryLink
. getMetadata
now returns the skylink and portal URL again, as it did prior to4.0.6-beta
.- Exported
Keypair
andKeyPairAndSeed
crypto types.
- [Breaking change] Removed
uriHandshakeResolverPrefix
.
- [Breaking change] Registry entries now contain
data
that is typeUint8Array
instead ofstring
. - [Breaking change]
getHnsUrl
now defaults tosubdomain: true
.
- Added
mySky.setDataLink
.
- [Breaking change]
getFileContent
andgetFileContentHns
no longer return metadata objects. - [Breaking change] Remove
noResponseMetadata
custom option from download and HNS download methods. - [Breaking change]
getMetadata
now takes aCustomGetMetadataOptions
object for custom options. - [Breaking change] Rename
resolveHns
optionendpointDownloadHnsres
toendpointResolveHns
.
- [Breaking change]
getMetadata
now only returns the metadata, and not the content-type, skylink, or portal URL. (Note: The skylink and portal URL were added back inv4.0.8-beta
.)
- Added
cachedDataLink
option todb.getJSON
. This lets us avoid getting the data again if the latest data link matches the cached data link. - Added
customCookie
client option.
- Make datapath functions
client.getFullDomainUrl
andclient.extractDomain
when paths are included, and for localhost domains/urls. - Fixed build for CommonJS and React projects.
- Pass custom userID options to mysky
- [Breaking change] Renamed SkyDB
skylink
response field todataLink
.
- Added
registry.getEntryLink
andmysky.getEntryLink
. - Added
client.loadMySky
alpha
option, allowing access to the experimental alpha MySky.
- Expanded
client.extractDomain
to also work with input URLs.
- [Breaking change] An issue with path encodings in
file.getJSON
,mysky.getJSON
andmysky.setJSON
has been fixed. Unfortunately the encoding had to be changed so all MySky data will be lost. - [Breaking change] Renamed
RegistryEntry.datakey
todataKey
for consistency
- [Breaking change] The
getEntry
timeout
option has been removed as it no longer has an effect.
Permission
is now re-exported fromskynet-js
so that you can callmysky.addPermissions
without requiring theskynet-mysky-utils
dependency.
-
[Breaking change]
client.db.getJSON
no longer returns{ data, revision }
but instead{ data, skylink }
. -
[Breaking change]
client.db.setJSON
no longer accepts a revision number. -
[Breaking change]
getSkylinkUrl
,downloadFile
,openFile
, and the HNS equivalents are all nowasync
. -
[Breaking change]
client.portalUrl
is now an async method instead of a variable. -
Fixed Range Error on unicode data keys.
-
The SDK now supports cookies with requests that are "same-site" but "cross-origin." This allows accounts to be associated with requests made to API endpoints at the base portal URL.
- Added
client.loadMySky
. - Added
MySky
andDacLibrary
types. - Added
client.file.getJSON
. - Added
extractDomainForPortal
,getFullDomainUrlForPortal
.
- Added
getEntryUrlForPortal
,getSkylinkUrlForPortal
. - Added
signEntry
helper function. - Added
client.registry.postSignedEntry
helper method. - Added
client.initPortalUrl
method to manually initialize the portal URL before it is needed.
- Add portalUrl response field to
getFileContents
andgetMetadata
.
- Fix a bug where registry entries with empty data were rejected.
- The bundle size when building with webpack has been further reduced.
- A new optimization causes
db.setJSON
to complete significantly faster. - The size of the bundled SDK has been reduced by more than 60% by changing crypto dependencies.
This beta version is released on the beta
stream. It can be installed with npm install skynet-js@beta
.
getFileContent
andgetFileContentHns
methods have been added for getting the content of a file from a skylink or Handshake domain without downloading the file in-browser.
- [Breaking change] Entry revisions are now
bigint
instead ofnumber
. - [Breaking change] Upload methods return full objects instead of just a skylink string.
- [Breaking change] Upload request methods were removed.
- [Breaking change]
getMetadata
returns a full object containing the metadata in a subfield. - [Breaking change] The registry timeout has changed to take seconds instead of milliseconds.
- [Breaking change]
db.getJSON
can return destructured nulls instead of null - [Breaking change]
registry.getEntry
only returnsnull
on entry-not-found. - Almost every API method now has the potential to throw. A common cause would be wrongly-typed inputs to a method, which are now checked.
- [Breaking change]
executeRequest
was removed.