@dsnp/graph-sdk
Advanced tools
Comparing version 0.0.0-c3568c to 0.0.0-ca7762
@@ -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"); | ||
@@ -254,5 +255,5 @@ const environment_1 = require("./models/environment"); | ||
expect(handle).toBeDefined(); | ||
const connections = await graph.getPublicKeys(1); | ||
expect(connections).toBeDefined(); | ||
expect(connections.length).toEqual(0); | ||
const keys = await graph.getPublicKeys(1); | ||
expect(keys).toBeDefined(); | ||
expect(keys.length).toEqual(0); | ||
await graph.freeGraphState(); | ||
@@ -270,5 +271,5 @@ }); | ||
}; | ||
const connections = await graph.deserializeDsnpKeys(keys); | ||
expect(connections).toBeDefined(); | ||
expect(connections.length).toEqual(0); | ||
const des_keys = await graph_1.Graph.deserializeDsnpKeys(keys); | ||
expect(des_keys).toBeDefined(); | ||
expect(des_keys.length).toEqual(0); | ||
await graph.freeGraphState(); | ||
@@ -343,6 +344,12 @@ }); | ||
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,5 +22,8 @@ printHelloGraph(): void; | ||
deserializeDsnpKeys(keys: DsnpKeys): Promise<DsnpPublicKey[]>; | ||
generateKeyPair(keyType: GraphKeyType): Promise<GraphKeyPair>; | ||
freeGraphState(handle: number): Promise<boolean>; | ||
} | ||
export declare const graphsdkModule: Native; | ||
export * from "./models"; | ||
export * from "./graph"; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -19,2 +33,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
exports.graphsdkModule = loadNativeModule(); | ||
// Export the models | ||
__exportStar(require("./models"), exports); | ||
__exportStar(require("./graph"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -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-c3568c", | ||
"version": "0.0.0-ca7762", | ||
"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
6378051
750
1