Comparing version 3.0.0-beta to 3.0.0
# Changelog | ||
## [3.0.0-beta] | ||
## [3.0.0] | ||
[Updating Guide](https://siasky.net/docs/v3-beta/#updating-from-v2) | ||
[Updating Guide](https://siasky.net/docs/v3/#updating-from-v2) | ||
_This beta version is released on the `beta` stream. It can be installed with `npm install skynet-js@beta`._ | ||
### Added | ||
- `getFileContent` and `getFileContentHns` methods have been added for getting the content of a file from a skylink or Handshake domain without downloading the file in-browser. | ||
- `noResponseMetadata` option was added to the download options. | ||
@@ -13,0 +12,0 @@ ### Changed |
@@ -10,3 +10,3 @@ import { AxiosResponse } from "axios"; | ||
* @property [customUserAgent] - Custom user agent header to set. | ||
* @property [onUploadProgress] -Optional callback to track upload progress. | ||
* @property [onUploadProgress] - Optional callback to track upload progress. | ||
*/ | ||
@@ -13,0 +13,0 @@ export declare type CustomClientOptions = { |
@@ -59,2 +59,3 @@ import { pki } from "node-forge"; | ||
* @returns - The child seed derived from `masterSeed` using `seed`. | ||
* @throws - Will throw if the inputs are not strings. | ||
*/ | ||
@@ -66,3 +67,3 @@ export declare function deriveChildSeed(masterSeed: string, seed: string): string; | ||
* @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. | ||
* @returns -The generated key pair and seed. | ||
* @returns - The generated key pair and seed. | ||
*/ | ||
@@ -75,4 +76,5 @@ export declare function genKeyPairAndSeed(length?: number): KeyPairAndSeed; | ||
* @returns - The generated key pair. | ||
* @throws - Will throw if the input is not a string. | ||
*/ | ||
export declare function genKeyPairFromSeed(seed: string): KeyPair; | ||
//# sourceMappingURL=crypto.d.ts.map |
@@ -120,2 +120,3 @@ "use strict"; | ||
* @returns - The child seed derived from `masterSeed` using `seed`. | ||
* @throws - Will throw if the inputs are not strings. | ||
*/ | ||
@@ -138,3 +139,3 @@ function deriveChildSeed(masterSeed, seed) { | ||
* @param [length=64] - The number of random bytes for the seed. Note that the string seed will be converted to hex representation, making it twice this length. | ||
* @returns -The generated key pair and seed. | ||
* @returns - The generated key pair and seed. | ||
*/ | ||
@@ -152,2 +153,3 @@ function genKeyPairAndSeed(length) { | ||
* @returns - The generated key pair. | ||
* @throws - Will throw if the input is not a string. | ||
*/ | ||
@@ -154,0 +156,0 @@ function genKeyPairFromSeed(seed) { |
@@ -7,2 +7,3 @@ import { SkynetClient } from "./client"; | ||
* @property [download=false] - Indicates to `getSkylinkUrl` whether the file should be downloaded (true) or opened in the browser (false). `downloadFile` and `openFile` override this value. | ||
* @property [noResponseMetadata=false] - Download without metadata in the response. | ||
* @property [path=""] - A path to append to the skylink, e.g. `dir1/dir2/file`. A Unix-style path is expected. Each path component will be URL-encoded. | ||
@@ -14,2 +15,3 @@ * @property [query={}] - A query object to convert to a query parameter string and append to the URL. | ||
download?: boolean; | ||
noResponseMetadata?: boolean; | ||
path?: string; | ||
@@ -80,2 +82,3 @@ query?: Record<string, unknown>; | ||
* @returns - The full URL that was used. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -102,2 +105,3 @@ export declare function downloadFileHns(this: SkynetClient, domain: string, customOptions?: CustomDownloadOptions): Promise<string>; | ||
* @returns - The full URL for the HNS domain. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -113,2 +117,3 @@ export declare function getHnsUrl(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): string; | ||
* @returns - The full URL for the resolver for the HNS domain. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -178,2 +183,3 @@ export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: BaseCustomOptions): string; | ||
* @returns - The full URL that was used. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -189,4 +195,5 @@ export declare function openFileHns(this: SkynetClient, domain: string, customOptions?: CustomHnsDownloadOptions): Promise<string>; | ||
* @returns - The data for the TXT record. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
export declare function resolveHns(this: SkynetClient, domain: string, customOptions?: BaseCustomOptions): Promise<ResolveHnsResponse>; | ||
//# sourceMappingURL=download.d.ts.map |
@@ -85,2 +85,3 @@ "use strict"; | ||
* @returns - The full URL that was used. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -123,4 +124,9 @@ function downloadFileHns(domain, customOptions) { | ||
if (opts.download) { | ||
// Set the "attachment" parameter. | ||
query.attachment = true; | ||
} | ||
if (opts.noResponseMetadata) { | ||
// Set the "no-response-metadata" parameter. | ||
query["no-response-metadata"] = true; | ||
} | ||
// URL-encode the path. | ||
@@ -176,2 +182,3 @@ var path = ""; | ||
* @returns - The full URL for the HNS domain. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -189,2 +196,5 @@ function getHnsUrl(domain, customOptions) { | ||
} | ||
if (opts.noResponseMetadata) { | ||
query["no-response-metadata"] = true; | ||
} | ||
domain = utils_1.trimUriPrefix(domain, utils_1.uriHandshakePrefix); | ||
@@ -205,2 +215,3 @@ var url = opts.subdomain | ||
* @returns - The full URL for the resolver for the HNS domain. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -365,2 +376,3 @@ function getHnsresUrl(domain, customOptions) { | ||
* @returns - The full URL that was used. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -392,2 +404,3 @@ function openFileHns(domain, customOptions) { | ||
* @returns - The data for the TXT record. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
@@ -394,0 +407,0 @@ function resolveHns(domain, customOptions) { |
@@ -24,3 +24,2 @@ import { BaseCustomOptions } from "./utils"; | ||
* @property bitfield - The bitfield that gets encoded into the skylink. The bitfield contains a version, an offset and a length in a heavily compressed and optimized format. | ||
* @property metadata - | ||
*/ | ||
@@ -40,2 +39,3 @@ export declare type UploadRequestResponse = { | ||
* @returns - The returned skylink. | ||
* @throws - Will throw if the request is successful but the upload response does not contain a complete response. | ||
*/ | ||
@@ -62,2 +62,3 @@ export declare function uploadFile(this: SkynetClient, file: File, customOptions?: CustomUploadOptions): Promise<UploadRequestResponse>; | ||
* @returns - The returned skylink. | ||
* @throws - Will throw if the request is successful but the upload response does not contain a complete response. | ||
*/ | ||
@@ -74,4 +75,5 @@ export declare function uploadDirectory(this: SkynetClient, directory: Record<string, File>, filename: string, customOptions?: CustomUploadOptions): Promise<UploadRequestResponse>; | ||
* @returns - The upload response. | ||
* @throws - Will throw if the input filename is not a string. | ||
*/ | ||
export declare function uploadDirectoryRequest(this: SkynetClient, directory: Record<string, File>, filename: string, customOptions?: CustomUploadOptions): Promise<AxiosResponse>; | ||
//# sourceMappingURL=upload.d.ts.map |
@@ -61,2 +61,3 @@ "use strict"; | ||
* @returns - The returned skylink. | ||
* @throws - Will throw if the request is successful but the upload response does not contain a complete response. | ||
*/ | ||
@@ -127,2 +128,3 @@ function uploadFile(file, customOptions) { | ||
* @returns - The returned skylink. | ||
* @throws - Will throw if the request is successful but the upload response does not contain a complete response. | ||
*/ | ||
@@ -160,2 +162,3 @@ function uploadDirectory(directory, filename, customOptions) { | ||
* @returns - The upload response. | ||
* @throws - Will throw if the input filename is not a string. | ||
*/ | ||
@@ -162,0 +165,0 @@ function uploadDirectoryRequest(directory, filename, customOptions) { |
@@ -153,2 +153,3 @@ import { CustomClientOptions } from "./client"; | ||
* @returns - The uint8 array. | ||
* @throws - Will throw if the input is not a string. | ||
*/ | ||
@@ -169,2 +170,3 @@ export declare function stringToUint8Array(str: string): Uint8Array; | ||
* @returns - True if the input is hex-encoded. | ||
* @throws - Will throw if the input is not a string. | ||
*/ | ||
@@ -171,0 +173,0 @@ export declare function isHexString(str: string): boolean; |
@@ -338,2 +338,3 @@ "use strict"; | ||
* @returns - The uint8 array. | ||
* @throws - Will throw if the input is not a string. | ||
*/ | ||
@@ -371,2 +372,3 @@ function stringToUint8Array(str) { | ||
* @returns - True if the input is hex-encoded. | ||
* @throws - Will throw if the input is not a string. | ||
*/ | ||
@@ -373,0 +375,0 @@ function isHexString(str) { |
{ | ||
"name": "skynet-js", | ||
"version": "3.0.0-beta", | ||
"version": "3.0.0", | ||
"description": "Sia Skynet Javascript Client", | ||
@@ -17,3 +17,3 @@ "main": "dist/index.js", | ||
"build": "rimraf dist && babel src --out-dir dist --extensions .ts --ignore src/**/*.test.ts && tsc --project tsconfig.build.json", | ||
"lint:eslint": "eslint --ext .ts utils src", | ||
"lint:eslint": "eslint --ext .ts utils src --max-warnings 0", | ||
"lint:tsc": "tsc", | ||
@@ -102,3 +102,3 @@ "prepublishOnly": "yarn build" | ||
"eslint-plugin-compat": "^3.8.0", | ||
"eslint-plugin-jsdoc": "^30.7.8", | ||
"eslint-plugin-jsdoc": "^31.0.7", | ||
"husky": "^4.3.0", | ||
@@ -105,0 +105,0 @@ "jest": "^26.4.2", |
@@ -10,2 +10,8 @@ # skynet-js - Javascript Sia Skynet Client | ||
## Updating to v3 from v2 | ||
The latest stable major version is `v3`. There are many breaking changes from `v2`. | ||
Please consult [the update guide](https://siasky.net/docs/v3/?javascript--browser#updating-from-v2) for help migrating your code. | ||
## Documentation | ||
@@ -12,0 +18,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
138005
2510
0
66