Skip to content

Commit 7a0eafa

Browse files
authored
Merge pull request #6 from lightningrodlabs/refactor/handle-errors
Refactor: Handle errors
2 parents c01439f + 3172f40 commit 7a0eafa

File tree

9 files changed

+3287
-3144
lines changed

9 files changed

+3287
-3144
lines changed

Cargo.lock

Lines changed: 1194 additions & 878 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[package]
22
edition = "2021"
33
name = "lightningrodlabs_we-rust-utils"
4-
version = "0.500.0-rc.3"
4+
version = "0.501.0"
55

66
[lib]
77
crate-type = ["cdylib"]
88

99
[dependencies]
1010
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
11-
napi = { version = "2.12.2", default-features = false, features = [
11+
napi = { version = "3.2.2", default-features = false, features = [
1212
"napi4",
1313
"tokio_rt",
1414
"async",
1515
"serde-json",
1616
] }
17-
napi-derive = "2.12.2"
17+
napi-derive = "3.2.2"
1818

1919
holochain_types = "0.5.2"
2020
lair_keystore_api = "0.6.1"

index.d.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
1-
/* tslint:disable */
2-
/* eslint-disable */
3-
41
/* auto-generated by NAPI-RS */
2+
/* eslint-disable */
3+
export declare class WeRustHandler {
4+
/** Connect to lair keystore */
5+
static connect(keystoreUrl: string, passphrase: string): Promise<WeRustHandler>
6+
/** Sign a zome call */
7+
signZomeCall(payload: Array<number>, pubKey: Array<number>): Promise<Array<number>>
8+
}
59

6-
export function overwriteConfig(adminPort: number, configPath: string, keystoreConnectionUrl: string, bootstrapServerUrl: string, signalingServerUrl: string, allowedOrigin: string, signalAllowPlainText: boolean, iceServerUrls?: Array<string> | undefined | null, keystoreInProcEnvironmentDir?: string | undefined | null): string
7-
export function defaultConductorConfig(adminPort: number, conductorEnvironmentPath: string, keystoreConnectionUrl: string, bootstrapServerUrl: string, signalingServerUrl: string, allowedOrigin: string, signalAllowPlainText: boolean, iceServerUrls?: Array<string> | undefined | null, keystoreInProcEnvironmentDir?: string | undefined | null): string
810
export interface HappAndUiHashes {
911
happSha256: string
1012
webhappSha256?: string
1113
uiSha256?: string
1214
}
15+
16+
export declare function happBytesWithCustomProperties(happPath: string, properties: Record<string, string | undefined | null>): Promise<Array<number>>
17+
18+
/**
19+
* Saves a happ or a webhapp file. If a uis_dir is specified and it is a webhapp,
20+
* then the UI will be stored in [uis_dir]/[sha 256 of UI]/assets. If no uis_dir
21+
* is specified, only the happ file will be stored.
22+
*/
23+
export declare function saveHappOrWebhapp(happOrWebHappPath: string, happsDir: string, uisDir?: string | undefined | null): Promise<StoredHappPathAndHashes>
24+
1325
export interface StoredHappPathAndHashes {
1426
happPath: string
1527
happSha256: string
1628
webhappSha256?: string
1729
uiSha256?: string
1830
}
19-
export function happBytesWithCustomProperties(happPath: string, properties: Record<string, string | undefined | null>): Promise<Array<number>>
20-
/**
21-
* Saves a happ or a webhapp file. If a uis_dir is specified and it is a webhapp,
22-
* then the UI will be stored in [uis_dir]/[sha 256 of UI]/assets. If no uis_dir
23-
* is specified, only the happ file will be stored.
24-
*/
25-
export function saveHappOrWebhapp(happOrWebHappPath: string, happsDir: string, uisDir?: string | undefined | null): Promise<StoredHappPathAndHashes>
31+
2632
/**
2733
* Checks that the happ or webhapp is of the correct format
2834
* WARNING: The decoding and encoding of the happ bytes seems to affect happ's sha256 hash.
2935
*/
30-
export function validateHappOrWebhapp(happOrWebhappBytes: Array<number>): Promise<HappAndUiHashes>
31-
export type JsWeRustHandler = WeRustHandler
32-
export class WeRustHandler {
33-
constructor()
34-
static connect(keystoreUrl: string, passphrase: string): Promise<WeRustHandler>
35-
signZomeCall(payload: Array<number>, pubKey: Array<number>): Promise<Array<number>>
36-
}
37-
export type JsZomeCallSigner = ZomeCallSigner
38-
export class ZomeCallSigner {
39-
constructor()
40-
static connect(connectionUrl: string, passphrase: string): Promise<ZomeCallSigner>
41-
signZomeCall(payload: Array<number>, pubKey: Array<number>): Promise<Array<number>>
42-
}
36+
export declare function validateHappOrWebhapp(happOrWebhappBytes: Array<number>): Promise<HappAndUiHashes>

0 commit comments

Comments
 (0)