Comparing version 4.0.5-beta to 4.0.6-beta
@@ -24,2 +24,3 @@ import { AxiosResponse } from "axios"; | ||
* | ||
* @property endpointPath - The endpoint to contact. | ||
* @property [data] - The data for a POST request. | ||
@@ -31,2 +32,5 @@ * @property [url] - The full url to contact. Will be computed from the portalUrl and endpointPath if not provided. | ||
* @property [extraPath] - An additional path to append to the URL, e.g. a 46-character skylink. | ||
* @property [headers] - Any request headers to set. | ||
* @property [transformRequest] - A function that allows manually transforming the request. | ||
* @property [transformResponse] - A function that allows manually transforming the response. | ||
*/ | ||
@@ -33,0 +37,0 @@ export declare type RequestConfig = CustomClientOptions & { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -8,3 +8,2 @@ 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. | ||
@@ -17,3 +16,2 @@ * @property [query={}] - A query object to convert to a query parameter string and append to the URL. | ||
download?: boolean; | ||
noResponseMetadata?: boolean; | ||
path?: string; | ||
@@ -33,2 +31,9 @@ query?: Record<string, unknown>; | ||
}; | ||
export declare type CustomGetMetadataOptions = BaseCustomOptions & { | ||
endpointGetMetadata?: string; | ||
query?: Record<string, unknown>; | ||
}; | ||
export declare type CustomHnsResolveOptions = BaseCustomOptions & { | ||
endpointResolveHns?: string; | ||
}; | ||
/** | ||
@@ -46,3 +51,2 @@ * The response for a get file content request. | ||
contentType: string; | ||
metadata: Record<string, unknown>; | ||
portalUrl: string; | ||
@@ -60,6 +64,3 @@ skylink: string; | ||
export declare type GetMetadataResponse = { | ||
contentType: string; | ||
metadata: Record<string, unknown>; | ||
portalUrl: string; | ||
skylink: string; | ||
}; | ||
@@ -77,3 +78,2 @@ /** | ||
download: boolean; | ||
noResponseMetadata: boolean; | ||
path: undefined; | ||
@@ -93,3 +93,3 @@ query: undefined; | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -105,3 +105,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -117,3 +117,3 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the skylink. | ||
@@ -129,2 +129,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. | ||
* @returns - The full URL for the skylink. | ||
@@ -140,3 +141,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the HNS domain. | ||
@@ -152,7 +153,7 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the resolver for the HNS domain. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: BaseCustomOptions): Promise<string>; | ||
export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise<string>; | ||
/** | ||
@@ -164,7 +165,7 @@ * Gets only the metadata for the given skylink without the contents. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The metadata in JSON format. Empty if no metadata was found. | ||
* @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
*/ | ||
export declare function getMetadata(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise<GetMetadataResponse>; | ||
export declare function getMetadata(this: SkynetClient, skylinkUrl: string, customOptions?: CustomGetMetadataOptions): Promise<GetMetadataResponse>; | ||
/** | ||
@@ -176,3 +177,3 @@ * Gets the contents of the file at the given skylink. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -188,3 +189,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -210,3 +211,3 @@ * @throws - Will throw if the domain does not contain a skylink. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -222,3 +223,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -234,7 +235,7 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @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>; | ||
export declare function resolveHns(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise<ResolveHnsResponse>; | ||
//# sourceMappingURL=download.d.ts.map |
@@ -14,3 +14,2 @@ "use strict"; | ||
download: false, | ||
noResponseMetadata: false, | ||
path: undefined, | ||
@@ -20,2 +19,6 @@ query: undefined, | ||
}; | ||
const defaultGetMetadataOptions = { | ||
endpointGetMetadata: "/skynet/metadata", | ||
query: undefined, | ||
}; | ||
const defaultDownloadHnsOptions = { | ||
@@ -28,3 +31,3 @@ ...exports.defaultDownloadOptions, | ||
...options_1.defaultBaseOptions, | ||
endpointDownloadHnsres: "hnsres", | ||
endpointResolveHns: "hnsres", | ||
}; | ||
@@ -37,3 +40,3 @@ /** | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -57,3 +60,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -77,3 +80,3 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the skylink. | ||
@@ -95,2 +98,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. | ||
* @returns - The full URL for the skylink. | ||
@@ -110,6 +114,2 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
} | ||
if (opts.noResponseMetadata) { | ||
// Set the "no-response-metadata" parameter. | ||
query["no-response-metadata"] = true; | ||
} | ||
// URL-encode the path. | ||
@@ -152,3 +152,4 @@ let path = ""; | ||
// Add additional path if passed in. | ||
url = url_1.makeUrl(portalUrl, opts.endpointDownload, skylink, path); | ||
url = url_1.makeUrl(portalUrl, opts.endpointDownload, skylink); | ||
url = url_1.makeUrl(url, path); | ||
} | ||
@@ -164,3 +165,3 @@ return url_1.addUrlQuery(url, query); | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the HNS domain. | ||
@@ -178,5 +179,2 @@ * @throws - Will throw if the input domain is not a string. | ||
} | ||
if (opts.noResponseMetadata) { | ||
query["no-response-metadata"] = true; | ||
} | ||
domain = string_1.trimUriPrefix(domain, url_1.uriHandshakePrefix); | ||
@@ -196,3 +194,3 @@ const portalUrl = await this.portalUrl(); | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the resolver for the HNS domain. | ||
@@ -207,3 +205,3 @@ * @throws - Will throw if the input domain is not a string. | ||
const portalUrl = await this.portalUrl(); | ||
return url_1.makeUrl(portalUrl, opts.endpointDownloadHnsres, domain); | ||
return url_1.makeUrl(portalUrl, opts.endpointResolveHns, domain); | ||
} | ||
@@ -217,3 +215,3 @@ exports.getHnsresUrl = getHnsresUrl; | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The metadata in JSON format. Empty if no metadata was found. | ||
@@ -224,19 +222,28 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
// Validation is done in `getSkylinkUrl`. | ||
var _a, _b; | ||
const opts = { ...exports.defaultDownloadOptions, ...this.customOptions, ...customOptions }; | ||
const url = await this.getSkylinkUrl(skylinkUrl, opts); | ||
const opts = { ...defaultGetMetadataOptions, ...this.customOptions, ...customOptions }; | ||
// Don't include the path for now since the endpoint doesn't support it. | ||
const path = parse_1.parseSkylink(skylinkUrl, { onlyPath: true }); | ||
if (path) { | ||
throw new Error("Skylink string should not contain a path"); | ||
} | ||
const getSkylinkUrlOpts = { endpointDownload: opts.endpointGetMetadata, query: opts.query }; | ||
const url = await this.getSkylinkUrl(skylinkUrl, getSkylinkUrlOpts); | ||
const response = await this.executeRequest({ | ||
...opts, | ||
endpointPath: opts.endpointDownload, | ||
method: "head", | ||
endpointPath: opts.endpointGetMetadata, | ||
method: "GET", | ||
url, | ||
}); | ||
if (typeof response.headers === "undefined") { | ||
throw new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists."); | ||
} | ||
const contentType = (_a = response.headers["content-type"]) !== null && _a !== void 0 ? _a : ""; | ||
const metadata = response.headers["skynet-file-metadata"] ? JSON.parse(response.headers["skynet-file-metadata"]) : {}; | ||
const portalUrl = (_b = response.headers["skynet-portal-api"]) !== null && _b !== void 0 ? _b : ""; | ||
const skylink = response.headers["skynet-skylink"] ? format_1.formatSkylink(response.headers["skynet-skylink"]) : ""; | ||
return { contentType, metadata, portalUrl, skylink }; | ||
validateGetMetadataResponse(response); | ||
const metadata = response.data; | ||
// TODO: Add back in once the endpoint supports these headers. | ||
// if (typeof response.headers === "undefined") { | ||
// throw new Error( | ||
// "Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists." | ||
// ); | ||
// } | ||
// const contentType = response.headers["content-type"] ?? ""; | ||
// const portalUrl = response.headers["skynet-portal-api"] ?? ""; | ||
// const skylink = response.headers["skynet-skylink"] ? formatSkylink(response.headers["skynet-skylink"]) : ""; | ||
return { metadata }; | ||
} | ||
@@ -250,3 +257,3 @@ exports.getMetadata = getMetadata; | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -268,3 +275,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -307,6 +314,5 @@ * @throws - Will throw if the domain does not contain a skylink. | ||
const contentType = (_a = response.headers["content-type"]) !== null && _a !== void 0 ? _a : ""; | ||
const metadata = response.headers["skynet-file-metadata"] ? JSON.parse(response.headers["skynet-file-metadata"]) : {}; | ||
const portalUrl = (_b = response.headers["skynet-portal-api"]) !== null && _b !== void 0 ? _b : ""; | ||
const skylink = response.headers["skynet-skylink"] ? format_1.formatSkylink(response.headers["skynet-skylink"]) : ""; | ||
return { data: response.data, contentType, portalUrl, metadata, skylink }; | ||
return { data: response.data, contentType, portalUrl, skylink }; | ||
} | ||
@@ -320,3 +326,3 @@ exports.getFileContentRequest = getFileContentRequest; | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -339,3 +345,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -359,3 +365,3 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The data for the TXT record. | ||
@@ -371,3 +377,3 @@ * @throws - Will throw if the input domain is not a string. | ||
...opts, | ||
endpointPath: opts.endpointDownloadHnsres, | ||
endpointPath: opts.endpointResolveHns, | ||
method: "get", | ||
@@ -380,2 +386,12 @@ url, | ||
exports.resolveHns = resolveHns; | ||
function validateGetMetadataResponse(response) { | ||
try { | ||
if (!response.data) { | ||
throw new Error("response.data field missing"); | ||
} | ||
} | ||
catch (err) { | ||
throw new Error(`Metadata response invalid despite a successful request. Please try again and report this issue to the devs if it persists. Error: ${err}`); | ||
} | ||
} | ||
function validateResolveHnsResponse(response) { | ||
@@ -382,0 +398,0 @@ try { |
@@ -0,0 +0,0 @@ import { SkynetClient } from "./client"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export { SkynetClient } from "./client"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Connection } from "post-me"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Permission } from "skynet-mysky-utils"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export type { CustomConnectorOptions } from "./connector"; |
@@ -81,3 +81,5 @@ "use strict"; | ||
async checkLogin() { | ||
const [seedFound, permissionsResponse] = await this.connector.connection.remoteHandle().call("checkLogin", this.pendingPermissions); | ||
const [seedFound, permissionsResponse] = await this.connector.connection | ||
.remoteHandle() | ||
.call("checkLogin", this.pendingPermissions); | ||
// Save granted and failed permissions. | ||
@@ -136,3 +138,5 @@ const { grantedPermissions, failedPermissions } = permissionsResponse; | ||
// TODO: This should be a dual-promise that also calls ping() on an interval and rejects if no response was found in a given amount of time. | ||
const [seedFoundResponse, permissionsResponse] = await uiConnection.remoteHandle().call("requestLoginAccess", this.pendingPermissions); | ||
const [seedFoundResponse, permissionsResponse] = await uiConnection | ||
.remoteHandle() | ||
.call("requestLoginAccess", this.pendingPermissions); | ||
seedFound = seedFoundResponse; | ||
@@ -139,0 +143,0 @@ // Save failed permissions. |
@@ -0,0 +0,0 @@ export declare class DiscoverableBucketTweak { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { SkynetClient } from "../client"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { SkynetClient } from "./client"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -19,3 +19,2 @@ import { SkynetClient } from "./client"; | ||
download: boolean; | ||
noResponseMetadata: boolean; | ||
path: undefined; | ||
@@ -39,2 +38,12 @@ query: undefined; | ||
portalDirectoryFileFieldname: string; | ||
/** | ||
* Gets the JSON object corresponding to the publicKey and dataKey. | ||
* | ||
* @param this - SkynetClient | ||
* @param publicKey - The user public key. | ||
* @param dataKey - The key of the data to fetch for the given user. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @returns - The returned JSON and revision number. | ||
* @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. | ||
*/ | ||
customFilename: string; | ||
@@ -51,3 +60,2 @@ query: undefined; | ||
download: boolean; | ||
noResponseMetadata: boolean; | ||
path: undefined; | ||
@@ -54,0 +62,0 @@ subdomain: boolean; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare class SiaSkylink { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { BaseCustomOptions } from "./utils/options"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { CustomClientOptions } from "../client"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare const defaultSkynetPortalUrl = "https://siasky.net"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -24,2 +24,3 @@ import { AxiosResponse } from "axios"; | ||
* | ||
* @property endpointPath - The endpoint to contact. | ||
* @property [data] - The data for a POST request. | ||
@@ -31,2 +32,5 @@ * @property [url] - The full url to contact. Will be computed from the portalUrl and endpointPath if not provided. | ||
* @property [extraPath] - An additional path to append to the URL, e.g. a 46-character skylink. | ||
* @property [headers] - Any request headers to set. | ||
* @property [transformRequest] - A function that allows manually transforming the request. | ||
* @property [transformResponse] - A function that allows manually transforming the response. | ||
*/ | ||
@@ -33,0 +37,0 @@ export declare type RequestConfig = CustomClientOptions & { |
@@ -0,0 +0,0 @@ import axios from "axios"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ import { misc, codec } from "sjcl"; |
@@ -8,3 +8,2 @@ 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. | ||
@@ -17,3 +16,2 @@ * @property [query={}] - A query object to convert to a query parameter string and append to the URL. | ||
download?: boolean; | ||
noResponseMetadata?: boolean; | ||
path?: string; | ||
@@ -33,2 +31,9 @@ query?: Record<string, unknown>; | ||
}; | ||
export declare type CustomGetMetadataOptions = BaseCustomOptions & { | ||
endpointGetMetadata?: string; | ||
query?: Record<string, unknown>; | ||
}; | ||
export declare type CustomHnsResolveOptions = BaseCustomOptions & { | ||
endpointResolveHns?: string; | ||
}; | ||
/** | ||
@@ -46,3 +51,2 @@ * The response for a get file content request. | ||
contentType: string; | ||
metadata: Record<string, unknown>; | ||
portalUrl: string; | ||
@@ -60,6 +64,3 @@ skylink: string; | ||
export declare type GetMetadataResponse = { | ||
contentType: string; | ||
metadata: Record<string, unknown>; | ||
portalUrl: string; | ||
skylink: string; | ||
}; | ||
@@ -77,3 +78,2 @@ /** | ||
download: boolean; | ||
noResponseMetadata: boolean; | ||
path: undefined; | ||
@@ -93,3 +93,3 @@ query: undefined; | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -105,3 +105,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -117,3 +117,3 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the skylink. | ||
@@ -129,2 +129,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. | ||
* @returns - The full URL for the skylink. | ||
@@ -140,3 +141,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the HNS domain. | ||
@@ -152,7 +153,7 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the resolver for the HNS domain. | ||
* @throws - Will throw if the input domain is not a string. | ||
*/ | ||
export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: BaseCustomOptions): Promise<string>; | ||
export declare function getHnsresUrl(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise<string>; | ||
/** | ||
@@ -164,7 +165,7 @@ * Gets only the metadata for the given skylink without the contents. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The metadata in JSON format. Empty if no metadata was found. | ||
* @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
*/ | ||
export declare function getMetadata(this: SkynetClient, skylinkUrl: string, customOptions?: CustomDownloadOptions): Promise<GetMetadataResponse>; | ||
export declare function getMetadata(this: SkynetClient, skylinkUrl: string, customOptions?: CustomGetMetadataOptions): Promise<GetMetadataResponse>; | ||
/** | ||
@@ -176,3 +177,3 @@ * Gets the contents of the file at the given skylink. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -188,3 +189,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -210,3 +211,3 @@ * @throws - Will throw if the domain does not contain a skylink. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -222,3 +223,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -234,7 +235,7 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @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>; | ||
export declare function resolveHns(this: SkynetClient, domain: string, customOptions?: CustomHnsResolveOptions): Promise<ResolveHnsResponse>; | ||
//# sourceMappingURL=download.d.ts.map |
@@ -11,3 +11,2 @@ import { defaultBaseOptions } from "./utils/options"; | ||
download: false, | ||
noResponseMetadata: false, | ||
path: undefined, | ||
@@ -17,2 +16,6 @@ query: undefined, | ||
}; | ||
const defaultGetMetadataOptions = { | ||
endpointGetMetadata: "/skynet/metadata", | ||
query: undefined, | ||
}; | ||
const defaultDownloadHnsOptions = { | ||
@@ -25,3 +28,3 @@ ...defaultDownloadOptions, | ||
...defaultBaseOptions, | ||
endpointDownloadHnsres: "hnsres", | ||
endpointResolveHns: "hnsres", | ||
}; | ||
@@ -34,3 +37,3 @@ /** | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -53,3 +56,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -72,3 +75,3 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the skylink. | ||
@@ -89,2 +92,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint. | ||
* @returns - The full URL for the skylink. | ||
@@ -104,6 +108,2 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
} | ||
if (opts.noResponseMetadata) { | ||
// Set the "no-response-metadata" parameter. | ||
query["no-response-metadata"] = true; | ||
} | ||
// URL-encode the path. | ||
@@ -146,3 +146,4 @@ let path = ""; | ||
// Add additional path if passed in. | ||
url = makeUrl(portalUrl, opts.endpointDownload, skylink, path); | ||
url = makeUrl(portalUrl, opts.endpointDownload, skylink); | ||
url = makeUrl(url, path); | ||
} | ||
@@ -157,3 +158,3 @@ return addUrlQuery(url, query); | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the HNS domain. | ||
@@ -171,5 +172,2 @@ * @throws - Will throw if the input domain is not a string. | ||
} | ||
if (opts.noResponseMetadata) { | ||
query["no-response-metadata"] = true; | ||
} | ||
domain = trimUriPrefix(domain, uriHandshakePrefix); | ||
@@ -188,3 +186,3 @@ const portalUrl = await this.portalUrl(); | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL for the resolver for the HNS domain. | ||
@@ -199,3 +197,3 @@ * @throws - Will throw if the input domain is not a string. | ||
const portalUrl = await this.portalUrl(); | ||
return makeUrl(portalUrl, opts.endpointDownloadHnsres, domain); | ||
return makeUrl(portalUrl, opts.endpointResolveHns, domain); | ||
} | ||
@@ -208,3 +206,3 @@ /** | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointGetMetadata="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The metadata in JSON format. Empty if no metadata was found. | ||
@@ -215,19 +213,28 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
// Validation is done in `getSkylinkUrl`. | ||
var _a, _b; | ||
const opts = { ...defaultDownloadOptions, ...this.customOptions, ...customOptions }; | ||
const url = await this.getSkylinkUrl(skylinkUrl, opts); | ||
const opts = { ...defaultGetMetadataOptions, ...this.customOptions, ...customOptions }; | ||
// Don't include the path for now since the endpoint doesn't support it. | ||
const path = parseSkylink(skylinkUrl, { onlyPath: true }); | ||
if (path) { | ||
throw new Error("Skylink string should not contain a path"); | ||
} | ||
const getSkylinkUrlOpts = { endpointDownload: opts.endpointGetMetadata, query: opts.query }; | ||
const url = await this.getSkylinkUrl(skylinkUrl, getSkylinkUrlOpts); | ||
const response = await this.executeRequest({ | ||
...opts, | ||
endpointPath: opts.endpointDownload, | ||
method: "head", | ||
endpointPath: opts.endpointGetMetadata, | ||
method: "GET", | ||
url, | ||
}); | ||
if (typeof response.headers === "undefined") { | ||
throw new Error("Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists."); | ||
} | ||
const contentType = (_a = response.headers["content-type"]) !== null && _a !== void 0 ? _a : ""; | ||
const metadata = response.headers["skynet-file-metadata"] ? JSON.parse(response.headers["skynet-file-metadata"]) : {}; | ||
const portalUrl = (_b = response.headers["skynet-portal-api"]) !== null && _b !== void 0 ? _b : ""; | ||
const skylink = response.headers["skynet-skylink"] ? formatSkylink(response.headers["skynet-skylink"]) : ""; | ||
return { contentType, metadata, portalUrl, skylink }; | ||
validateGetMetadataResponse(response); | ||
const metadata = response.data; | ||
// TODO: Add back in once the endpoint supports these headers. | ||
// if (typeof response.headers === "undefined") { | ||
// throw new Error( | ||
// "Did not get 'headers' in response despite a successful request. Please try again and report this issue to the devs if it persists." | ||
// ); | ||
// } | ||
// const contentType = response.headers["content-type"] ?? ""; | ||
// const portalUrl = response.headers["skynet-portal-api"] ?? ""; | ||
// const skylink = response.headers["skynet-skylink"] ? formatSkylink(response.headers["skynet-skylink"]) : ""; | ||
return { metadata }; | ||
} | ||
@@ -240,3 +247,3 @@ /** | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -257,3 +264,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - An object containing the data of the file, the content-type, metadata, and the file's skylink. | ||
@@ -295,6 +302,5 @@ * @throws - Will throw if the domain does not contain a skylink. | ||
const contentType = (_a = response.headers["content-type"]) !== null && _a !== void 0 ? _a : ""; | ||
const metadata = response.headers["skynet-file-metadata"] ? JSON.parse(response.headers["skynet-file-metadata"]) : {}; | ||
const portalUrl = (_b = response.headers["skynet-portal-api"]) !== null && _b !== void 0 ? _b : ""; | ||
const skylink = response.headers["skynet-skylink"] ? formatSkylink(response.headers["skynet-skylink"]) : ""; | ||
return { data: response.data, contentType, portalUrl, metadata, skylink }; | ||
return { data: response.data, contentType, portalUrl, skylink }; | ||
} | ||
@@ -307,3 +313,3 @@ /** | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFile` for the full list. | ||
* @param [customOptions.endpointPath="/"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownload="/"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -325,3 +331,3 @@ * @throws - Will throw if the skylinkUrl does not contain a skylink or if the path option is not a string. | ||
* @param [customOptions] - Additional settings that can optionally be set. See `downloadFileHns` for the full list. | ||
* @param [customOptions.endpointPath="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointDownloadHns="/hns"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The full URL that was used. | ||
@@ -344,3 +350,3 @@ * @throws - Will throw if the input domain is not a string. | ||
* @param [customOptions={}] - Additional settings that can optionally be set. | ||
* @param [customOptions.endpointPath="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @param [customOptions.endpointResolveHns="/hnsres"] - The relative URL path of the portal endpoint to contact. | ||
* @returns - The data for the TXT record. | ||
@@ -356,3 +362,3 @@ * @throws - Will throw if the input domain is not a string. | ||
...opts, | ||
endpointPath: opts.endpointDownloadHnsres, | ||
endpointPath: opts.endpointResolveHns, | ||
method: "get", | ||
@@ -364,2 +370,12 @@ url, | ||
} | ||
function validateGetMetadataResponse(response) { | ||
try { | ||
if (!response.data) { | ||
throw new Error("response.data field missing"); | ||
} | ||
} | ||
catch (err) { | ||
throw new Error(`Metadata response invalid despite a successful request. Please try again and report this issue to the devs if it persists. Error: ${err}`); | ||
} | ||
} | ||
function validateResolveHnsResponse(response) { | ||
@@ -366,0 +382,0 @@ try { |
@@ -0,0 +0,0 @@ import { SkynetClient } from "./client"; |
@@ -0,0 +0,0 @@ import { deriveDiscoverableTweak } from "./mysky/tweak"; |
@@ -0,0 +0,0 @@ export { SkynetClient } from "./client"; |
@@ -0,0 +0,0 @@ export { SkynetClient } from "./client"; |
@@ -0,0 +0,0 @@ import { Connection } from "post-me"; |
@@ -0,0 +0,0 @@ import { ParentHandshake, WindowMessenger } from "post-me"; |
@@ -0,0 +0,0 @@ import { Permission } from "skynet-mysky-utils"; |
@@ -0,0 +0,0 @@ import { Connector } from "./connector"; |
@@ -0,0 +0,0 @@ export type { CustomConnectorOptions } from "./connector"; |
@@ -76,3 +76,5 @@ export { DacLibrary } from "./dac"; | ||
async checkLogin() { | ||
const [seedFound, permissionsResponse] = await this.connector.connection.remoteHandle().call("checkLogin", this.pendingPermissions); | ||
const [seedFound, permissionsResponse] = await this.connector.connection | ||
.remoteHandle() | ||
.call("checkLogin", this.pendingPermissions); | ||
// Save granted and failed permissions. | ||
@@ -131,3 +133,5 @@ const { grantedPermissions, failedPermissions } = permissionsResponse; | ||
// TODO: This should be a dual-promise that also calls ping() on an interval and rejects if no response was found in a given amount of time. | ||
const [seedFoundResponse, permissionsResponse] = await uiConnection.remoteHandle().call("requestLoginAccess", this.pendingPermissions); | ||
const [seedFoundResponse, permissionsResponse] = await uiConnection | ||
.remoteHandle() | ||
.call("requestLoginAccess", this.pendingPermissions); | ||
seedFound = seedFoundResponse; | ||
@@ -134,0 +138,0 @@ // Save failed permissions. |
@@ -0,0 +0,0 @@ export declare class DiscoverableBucketTweak { |
@@ -0,0 +0,0 @@ import { hashAll } from "../crypto"; |
@@ -0,0 +0,0 @@ import { SkynetClient } from "../client"; |
@@ -0,0 +0,0 @@ import { ensureUrl } from "skynet-mysky-utils"; |
@@ -0,0 +0,0 @@ import { SkynetClient } from "./client"; |
@@ -0,0 +0,0 @@ import { Buffer } from "buffer"; |
@@ -19,3 +19,2 @@ import { SkynetClient } from "./client"; | ||
download: boolean; | ||
noResponseMetadata: boolean; | ||
path: undefined; | ||
@@ -39,2 +38,12 @@ query: undefined; | ||
portalDirectoryFileFieldname: string; | ||
/** | ||
* Gets the JSON object corresponding to the publicKey and dataKey. | ||
* | ||
* @param this - SkynetClient | ||
* @param publicKey - The user public key. | ||
* @param dataKey - The key of the data to fetch for the given user. | ||
* @param [customOptions] - Additional settings that can optionally be set. | ||
* @returns - The returned JSON and revision number. | ||
* @throws - Will throw if the returned signature does not match the returned entry, or if the skylink in the entry is invalid. | ||
*/ | ||
customFilename: string; | ||
@@ -51,3 +60,2 @@ query: undefined; | ||
download: boolean; | ||
noResponseMetadata: boolean; | ||
path: undefined; | ||
@@ -54,0 +62,0 @@ subdomain: boolean; |
@@ -0,0 +0,0 @@ import { sign } from "tweetnacl"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import base64 from "base64-js"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import parse from "url-parse"; |
@@ -0,0 +0,0 @@ export declare class SiaSkylink { |
@@ -0,0 +0,0 @@ import { fromByteArray } from "base64-js"; |
@@ -0,0 +0,0 @@ import { BaseCustomOptions } from "./utils/options"; |
@@ -0,0 +0,0 @@ import { getFileMimeType } from "./utils/file"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { assertUint64 } from "./number"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import mime from "mime/lite"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { validateBigint } from "./validation"; |
@@ -0,0 +0,0 @@ import { CustomClientOptions } from "../client"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { Buffer } from "buffer"; |
@@ -0,0 +0,0 @@ export declare const defaultSkynetPortalUrl = "https://siasky.net"; |
@@ -0,0 +0,0 @@ import parse from "url-parse"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import { isHexString } from "./string"; |
{ | ||
"name": "skynet-js", | ||
"version": "4.0.5-beta", | ||
"version": "4.0.6-beta", | ||
"description": "Sia Skynet Javascript Client", | ||
@@ -79,3 +79,3 @@ "main": "dist/cjs/index.js", | ||
"@types/mime": "^2.0.3", | ||
"@types/node": "^14.11.2", | ||
"@types/node": "^15.0.1", | ||
"@types/randombytes": "^2.0.0", | ||
@@ -89,6 +89,6 @@ "@types/sjcl": "^1.0.29", | ||
"eslint": "^7.11.0", | ||
"eslint-plugin-jsdoc": "^32.0.0", | ||
"eslint-plugin-jsdoc": "^34.0.1", | ||
"husky": "^5.0.9", | ||
"jest": "^26.6.3", | ||
"lint-staged": "^10.3.0", | ||
"lint-staged": "^11.0.0", | ||
"prettier": "^2.1.1", | ||
@@ -95,0 +95,0 @@ "rimraf": "^3.0.2", |
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
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
394221
7831