*Update dist
This commit is contained in:
parent
516e82b7c1
commit
4c618a311d
|
@ -0,0 +1,27 @@
|
|||
import type { Ed25519Keypair } from "libskynet";
|
||||
import { OverwriteDataFn, ReadDataFn } from "./index.js";
|
||||
export interface IndependentFileSmallMetadata {
|
||||
largestHistoricSize: bigint;
|
||||
}
|
||||
export interface IndependentFileSmall {
|
||||
dataKey: Uint8Array;
|
||||
fileData: Uint8Array;
|
||||
inode: string;
|
||||
keypair: Ed25519Keypair;
|
||||
metadata: IndependentFileSmallMetadata;
|
||||
revision: bigint;
|
||||
seed: Uint8Array;
|
||||
skylink: string;
|
||||
viewKey: string;
|
||||
overwriteData: OverwriteDataFn;
|
||||
readData: ReadDataFn;
|
||||
}
|
||||
export interface SslData {
|
||||
cert?: Uint8Array;
|
||||
key?: Uint8Array;
|
||||
}
|
||||
export interface SavedSslData {
|
||||
cert?: IndependentFileSmall;
|
||||
key?: IndependentFileSmall;
|
||||
}
|
||||
//# sourceMappingURL=files.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAO,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,WAAW,4BAA4B;IAC3C,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,4BAA4B,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAEhB,aAAa,EAAE,eAAe,CAAC;IAE/B,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,GAAG,CAAC,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,GAAG,CAAC,EAAE,oBAAoB,CAAC;CAC5B"}
|
|
@ -1,112 +1,4 @@
|
|||
/// <reference types="node" />
|
||||
import tls from "tls";
|
||||
import type { Logger } from "loglevel";
|
||||
import type { Ed25519Keypair, Err } from "libskynet";
|
||||
import type express from "express";
|
||||
import type Config from "@lumeweb/cfg";
|
||||
export interface RPCRequest {
|
||||
bypassCache?: boolean;
|
||||
module: string;
|
||||
method: string;
|
||||
data: any;
|
||||
}
|
||||
export interface RPCResponse {
|
||||
updated?: number;
|
||||
data?: any;
|
||||
error?: string;
|
||||
}
|
||||
export interface RPCMethod {
|
||||
cacheable: boolean;
|
||||
handler: (
|
||||
request: RPCRequest,
|
||||
sendStream: (stream: AsyncIterable<Uint8Array>) => void
|
||||
) => Promise<RPCResponse | null>;
|
||||
}
|
||||
export interface StreamFileResponse {
|
||||
data?: Uint8Array;
|
||||
done: boolean;
|
||||
}
|
||||
export declare type DnsProvider = (
|
||||
ipAddress: string,
|
||||
domain: string
|
||||
) => Promise<void>;
|
||||
export declare type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||
export interface Plugin {
|
||||
name: string;
|
||||
plugin: PluginFunction;
|
||||
exports?: any;
|
||||
default?: Plugin;
|
||||
}
|
||||
export declare type RPCStreamHandler = (
|
||||
stream: AsyncIterable<Uint8Array>
|
||||
) => Promise<RPCResponse>;
|
||||
export declare type OverwriteDataFn = (newData: Uint8Array) => Promise<Err>;
|
||||
export declare type ReadDataFn = () => Promise<[Uint8Array, Err]>;
|
||||
export interface IndependentFileSmallMetadata {
|
||||
largestHistoricSize: bigint;
|
||||
}
|
||||
export interface IndependentFileSmall {
|
||||
dataKey: Uint8Array;
|
||||
fileData: Uint8Array;
|
||||
inode: string;
|
||||
keypair: Ed25519Keypair;
|
||||
metadata: IndependentFileSmallMetadata;
|
||||
revision: bigint;
|
||||
seed: Uint8Array;
|
||||
skylink: string;
|
||||
viewKey: string;
|
||||
overwriteData: OverwriteDataFn;
|
||||
readData: ReadDataFn;
|
||||
}
|
||||
export interface SslData {
|
||||
cert?: Uint8Array;
|
||||
key?: Uint8Array;
|
||||
}
|
||||
export interface SavedSslData {
|
||||
cert?: IndependentFileSmall;
|
||||
key?: IndependentFileSmall;
|
||||
}
|
||||
export interface PluginAPI {
|
||||
config: Config;
|
||||
registerMethod: (methodName: string, method: RPCMethod) => void;
|
||||
loadPlugin: (moduleName: string) => Promise<Plugin>;
|
||||
getMethods: () => string[];
|
||||
ssl: {
|
||||
setContext: (context: tls.SecureContext) => void;
|
||||
getContext: () => tls.SecureContext;
|
||||
getSaved: (retry: boolean) => Promise<boolean | SavedSslData>;
|
||||
set: (
|
||||
cert: IndependentFileSmall | Uint8Array,
|
||||
key: IndependentFileSmall | Uint8Array
|
||||
) => void;
|
||||
get: () => SslData;
|
||||
save: () => Promise<void>;
|
||||
setCheck(checker: () => Promise<void>): void;
|
||||
};
|
||||
appRouter: {
|
||||
get: () => express.Router;
|
||||
set: (newRouter: express.Router) => void;
|
||||
reset: () => void;
|
||||
};
|
||||
files: {
|
||||
createIndependentFileSmall(
|
||||
seed: Uint8Array,
|
||||
userInode: string,
|
||||
fileData: Uint8Array
|
||||
): Promise<[IndependentFileSmall, Err]>;
|
||||
openIndependentFileSmall(
|
||||
seed: Uint8Array,
|
||||
userInode: string
|
||||
): Promise<[IndependentFileSmall, Err]>;
|
||||
overwriteIndependentFileSmall(
|
||||
file: IndependentFileSmall,
|
||||
newData: Uint8Array
|
||||
): Promise<Err>;
|
||||
};
|
||||
dns: {
|
||||
setProvider(provider: DnsProvider): void;
|
||||
};
|
||||
logger: Logger;
|
||||
getSeed: () => Uint8Array;
|
||||
}
|
||||
export * from "./rpc.js";
|
||||
export * from "./plugin.js";
|
||||
export * from "./files.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,CACP,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,KAAK,IAAI,KACpD,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,oBAAY,WAAW,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/E,oBAAY,cAAc,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/D,MAAM,WAAW,MAAM;I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AW,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,UAAU,CAAC;CAC3B"}
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
@ -0,0 +1,65 @@
|
|||
/// <reference types="node" />
|
||||
import Config from "@lumeweb/cfg";
|
||||
import tls from "tls";
|
||||
import { Logger } from "loglevel";
|
||||
import { RPCMethod, RPCServer } from "./rpc.js";
|
||||
import { IndependentFileSmall, SavedSslData, SslData } from "./files.js";
|
||||
import type { express } from "express";
|
||||
import type { Err } from "libskynet";
|
||||
export declare type PluginFunction = (api: PluginAPI) => Promise<void>;
|
||||
export declare type DnsProvider = (
|
||||
ipAddress: string,
|
||||
domain: string
|
||||
) => Promise<void>;
|
||||
export declare type OverwriteDataFn = (newData: Uint8Array) => Promise<Err>;
|
||||
export declare type ReadDataFn = () => Promise<[Uint8Array, Err]>;
|
||||
export interface Plugin {
|
||||
name: string;
|
||||
plugin: PluginFunction;
|
||||
exports?: any;
|
||||
default?: Plugin;
|
||||
}
|
||||
export interface PluginAPI {
|
||||
config: Config;
|
||||
registerMethod: (methodName: string, method: RPCMethod) => void;
|
||||
loadPlugin: (moduleName: string) => Promise<Plugin>;
|
||||
getRpcServer: () => RPCServer;
|
||||
ssl: {
|
||||
setContext: (context: tls.SecureContext) => void;
|
||||
getContext: () => tls.SecureContext;
|
||||
getSaved: (retry: boolean) => Promise<boolean | SavedSslData>;
|
||||
set: (
|
||||
cert: IndependentFileSmall | Uint8Array,
|
||||
key: IndependentFileSmall | Uint8Array
|
||||
) => void;
|
||||
get: () => SslData;
|
||||
save: () => Promise<void>;
|
||||
setCheck(checker: () => Promise<void>): void;
|
||||
};
|
||||
appRouter: {
|
||||
get: () => express.Router;
|
||||
set: (newRouter: express.Router) => void;
|
||||
reset: () => void;
|
||||
};
|
||||
files: {
|
||||
createIndependentFileSmall(
|
||||
seed: Uint8Array,
|
||||
userInode: string,
|
||||
fileData: Uint8Array
|
||||
): Promise<[IndependentFileSmall, Err]>;
|
||||
openIndependentFileSmall(
|
||||
seed: Uint8Array,
|
||||
userInode: string
|
||||
): Promise<[IndependentFileSmall, Err]>;
|
||||
overwriteIndependentFileSmall(
|
||||
file: IndependentFileSmall,
|
||||
newData: Uint8Array
|
||||
): Promise<Err>;
|
||||
};
|
||||
dns: {
|
||||
setProvider(provider: DnsProvider): void;
|
||||
};
|
||||
logger: Logger;
|
||||
getSeed: () => Uint8Array;
|
||||
}
|
||||
//# sourceMappingURL=plugin.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAErC,oBAAY,cAAc,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/D,oBAAY,WAAW,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/E,oBAAY,eAAe,GAAG,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAEpE,oBAAY,UAAU,G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AE,UAAU,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC,CAAC;QACxC,wBAAwB,CACtB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC,CAAC;QACxC,6BAA6B,CAC3B,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,GAAG,CAAC,CAAC;KACjB,CAAC;IACF,GAAG,EAAE;QACH,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;KAC1C,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,UAAU,CAAC;CAC3B"}
|
|
@ -0,0 +1,70 @@
|
|||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import type EventEmitter from "events";
|
||||
export interface RPCRequest {
|
||||
module: string;
|
||||
method: string;
|
||||
data: any;
|
||||
}
|
||||
export interface ClientRPCRequest extends RPCRequest {
|
||||
bypassCache?: boolean;
|
||||
}
|
||||
export interface RPCResponse {
|
||||
updated?: number;
|
||||
data?: any | RPCResponse;
|
||||
error?: string;
|
||||
signature?: string;
|
||||
signedField?: string;
|
||||
}
|
||||
export interface RPCMethod {
|
||||
cacheable: boolean;
|
||||
handler: (req: any) => Promise<any>;
|
||||
}
|
||||
export interface RPCCacheData {
|
||||
[query: string]: RPCCacheItem | null;
|
||||
}
|
||||
export interface RPCCacheItem extends RPCResponse {
|
||||
value: RPCResponse;
|
||||
signature: string;
|
||||
}
|
||||
export interface RPCClearCacheRequest {
|
||||
request: string;
|
||||
relays?: string[];
|
||||
}
|
||||
export declare type RPCClearCacheResponseRelayList = {
|
||||
[relay: string]: RPCClearCacheResponse;
|
||||
};
|
||||
export interface RPCClearCacheResponse extends RPCResponse {
|
||||
relays?: RPCClearCacheResponseRelayList;
|
||||
}
|
||||
export interface RPCBroadcastRequest {
|
||||
request: RPCRequest;
|
||||
relays: string[];
|
||||
}
|
||||
export interface RPCBroadcastResponse extends RPCResponse {
|
||||
relays: {
|
||||
[relay: string]: RPCResponse;
|
||||
};
|
||||
}
|
||||
export declare class RPCServer extends EventEmitter {
|
||||
get cache(): RPCCache;
|
||||
registerMethod(
|
||||
moduleName: string,
|
||||
methodName: string,
|
||||
options: RPCMethod
|
||||
): void;
|
||||
getMethods(): string[];
|
||||
setup(stream: any): any;
|
||||
signData(data: any): string;
|
||||
static hashQuery(query: RPCRequest): string;
|
||||
}
|
||||
export declare class RPCCache extends EventEmitter {
|
||||
get data(): RPCCacheData;
|
||||
constructor(server: RPCServer);
|
||||
getNodeQuery(node: string, queryHash: string): Promise<boolean | RPCResponse>;
|
||||
signResponse(item: RPCCacheItem): any;
|
||||
verifyResponse(pubkey: Buffer, item: RPCCacheItem): boolean | Buffer;
|
||||
addItem(query: RPCRequest, response: RPCResponse): void;
|
||||
deleteItem(queryHash: string): boolean;
|
||||
}
|
||||
//# sourceMappingURL=rpc.d.ts.map
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AAEvC,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,GAAG,WAAW,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAA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