@dsnp/graph-sdk
Advanced tools
Comparing version 0.0.0-41d73d to 0.0.0-63c2b1
@@ -1,2 +0,2 @@ | ||
import { ImportBundle, Update, DsnpGraphEdge, Action, DsnpPublicKey, DsnpKeys, Config, ConnectionType, PrivacyType } from "./models"; | ||
import { ImportBundle, Update, DsnpGraphEdge, Action, DsnpPublicKey, DsnpKeys, Config, ConnectionType, PrivacyType, GraphKeyPair } from "./models"; | ||
import { EnvironmentInterface } from "./models/environment"; | ||
@@ -22,3 +22,4 @@ export declare class Graph { | ||
getPublicKeys(dsnpUserId: number): Promise<DsnpPublicKey[]>; | ||
deserializeDsnpKeys(keys: DsnpKeys): Promise<DsnpPublicKey[]>; | ||
static deserializeDsnpKeys(keys: DsnpKeys): Promise<DsnpPublicKey[]>; | ||
static generateKeyPair(keyType: number): Promise<GraphKeyPair>; | ||
freeGraphState(): Promise<boolean>; | ||
@@ -25,0 +26,0 @@ printHelloGraph(): void; |
@@ -62,5 +62,8 @@ "use strict"; | ||
} | ||
deserializeDsnpKeys(keys) { | ||
static deserializeDsnpKeys(keys) { | ||
return index_1.graphsdkModule.deserializeDsnpKeys(keys); | ||
} | ||
static generateKeyPair(keyType) { | ||
return index_1.graphsdkModule.generateKeyPair(keyType); | ||
} | ||
freeGraphState() { | ||
@@ -67,0 +70,0 @@ return index_1.graphsdkModule.freeGraphState(this.handle); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const graph_1 = require("./graph"); | ||
const models_1 = require("./models"); | ||
const config_1 = require("./models/config"); | ||
@@ -269,3 +270,3 @@ const environment_1 = require("./models/environment"); | ||
}; | ||
const connections = await graph.deserializeDsnpKeys(keys); | ||
const connections = await graph_1.Graph.deserializeDsnpKeys(keys); | ||
expect(connections).toBeDefined(); | ||
@@ -342,6 +343,12 @@ expect(connections.length).toEqual(0); | ||
const environment = { environmentType: environment_1.EnvironmentType.Mainnet }; | ||
const graph = new graph_1.Graph(environment); | ||
const deserialized_keys = await graph.deserializeDsnpKeys(dsnp_keys); | ||
const deserialized_keys = await graph_1.Graph.deserializeDsnpKeys(dsnp_keys); | ||
expect(deserialized_keys).toBeDefined(); | ||
}); | ||
test('generateKeyPair should return a key pair', async () => { | ||
const keyPair = await graph_1.Graph.generateKeyPair(models_1.GraphKeyType.X25519); | ||
expect(keyPair).toBeDefined(); | ||
expect(keyPair.publicKey).toBeDefined(); | ||
expect(keyPair.secretKey).toBeDefined(); | ||
expect(keyPair.keyType).toEqual(models_1.GraphKeyType.X25519); | ||
}); | ||
//# sourceMappingURL=graph.test.js.map |
@@ -1,2 +0,2 @@ | ||
import { Action, Config, ConnectionType, DsnpGraphEdge, DsnpKeys, DsnpPublicKey, EnvironmentInterface, ImportBundle, PrivacyType, Update } from "./models"; | ||
import { Action, Config, ConnectionType, DsnpGraphEdge, DsnpKeys, DsnpPublicKey, EnvironmentInterface, GraphKeyPair, GraphKeyType, ImportBundle, PrivacyType, Update } from "./models"; | ||
export interface Native { | ||
@@ -22,2 +22,3 @@ printHelloGraph(): void; | ||
deserializeDsnpKeys(keys: DsnpKeys): Promise<DsnpPublicKey[]>; | ||
generateKeyPair(keyType: GraphKeyType): Promise<GraphKeyPair>; | ||
freeGraphState(handle: number): Promise<boolean>; | ||
@@ -24,0 +25,0 @@ } |
@@ -235,3 +235,3 @@ # DSNP Graph SDK | ||
const deserialized_keys = await graph.deserializeDsnpKeys(dsnp_keys); | ||
const deserialized_keys = await Graph.deserializeDsnpKeys(dsnp_keys); | ||
@@ -238,0 +238,0 @@ graph.freeGraphState(); |
{ | ||
"name": "@dsnp/graph-sdk", | ||
"version": "0.0.0-41d73d", | ||
"version": "0.0.0-63c2b1", | ||
"author": "Amplica Labs", | ||
@@ -5,0 +5,0 @@ "license": "ISC", |
@@ -235,3 +235,3 @@ # DSNP Graph SDK | ||
const deserialized_keys = await graph.deserializeDsnpKeys(dsnp_keys); | ||
const deserialized_keys = await Graph.deserializeDsnpKeys(dsnp_keys); | ||
@@ -238,0 +238,0 @@ graph.freeGraphState(); |
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
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
6377147
731
1