Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dsnp/graph-sdk

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dsnp/graph-sdk - npm Package Compare versions

Comparing version 0.0.0-a55c8a to 0.0.0-aa56de

dist/README.md

41

dist/js/graph.d.ts

@@ -1,29 +0,26 @@

import { Native } from "./index";
import { ImportBundle, Update, DsnpGraphEdge, Action, DsnpPublicKey, DsnpKeys } from "./models";
import { Config } from "./models/config";
import { ImportBundle, Update, DsnpGraphEdge, Action, DsnpPublicKey, DsnpKeys, Config, ConnectionType, PrivacyType } from "./models";
import { EnvironmentInterface } from "./models/environment";
export declare class Graph implements Native {
export declare class Graph {
private handle;
constructor(environment: EnvironmentInterface, capacity?: number);
initializeGraphState(environment: EnvironmentInterface): number;
initializeGraphStateWithCapacity(environment: EnvironmentInterface, capacity: number): number;
getGraphCapacity(handle: number): Promise<number>;
getGraphSize(handle: number): Promise<number>;
containsUserGraph(handle: number, dsnpUserId: number): Promise<boolean>;
getGraphUsersCount(handle: number): Promise<number>;
removeUserGraph(handle: number, dsnpUserId: number): Promise<void>;
importUserData(handle: number, payload: [ImportBundle]): Promise<void>;
exportUpdates(handle: number): Promise<Update>;
getConnectionsForUserGraphUpdates(handle: number, dsnpUserId: number, schemaId: string, includePending: boolean): Promise<[DsnpGraphEdge]>;
applyActions(handle: number, actions: [Action]): Promise<void>;
forceCalculateGraphs(handle: number, dsnpUserId: number): Promise<Update>;
getConnectionsWithoutKeys(handle: number): Promise<[number]>;
getOneSidedPrivateFriendshipConnections(handle: number, dsnpUserId: number): Promise<[DsnpGraphEdge]>;
getPublicKeys(handle: number, dsnpUserId: number): Promise<[DsnpPublicKey]>;
deserializeDsnpKeys(keys: DsnpKeys): Promise<[DsnpPublicKey]>;
freeGraphState(handle: number): Promise<void>;
freeAllGraphStates(): Promise<void>;
getGraphHandle(): number;
getGraphConfig(environment: EnvironmentInterface): Promise<Config>;
getSchemaIdFromConfig(environment: EnvironmentInterface, connectionType: ConnectionType, privacyType: PrivacyType): Promise<number>;
getGraphCapacity(): Promise<number>;
getGraphStatesCount(): Promise<number>;
containsUserGraph(dsnpUserId: number): Promise<boolean>;
getGraphUsersCount(): Promise<number>;
removeUserGraph(dsnpUserId: number): Promise<boolean>;
importUserData(payload: ImportBundle[]): Promise<boolean>;
exportUpdates(): Promise<Update[]>;
getConnectionsForUserGraph(dsnpUserId: number, schemaId: number, includePending: boolean): Promise<DsnpGraphEdge[]>;
applyActions(actions: Action[]): Promise<boolean>;
forceCalculateGraphs(dsnpUserId: number): Promise<Update[]>;
getConnectionsWithoutKeys(): Promise<number[]>;
getOneSidedPrivateFriendshipConnections(dsnpUserId: number): Promise<DsnpGraphEdge[]>;
getPublicKeys(dsnpUserId: number): Promise<DsnpPublicKey[]>;
deserializeDsnpKeys(keys: DsnpKeys): Promise<DsnpPublicKey[]>;
freeGraphState(): Promise<boolean>;
printHelloGraph(): void;
}
//# sourceMappingURL=graph.d.ts.map

@@ -14,59 +14,56 @@ "use strict";

}
initializeGraphState(environment) {
throw new Error("Method not implemented.");
getGraphHandle() {
return this.handle;
}
initializeGraphStateWithCapacity(environment, capacity) {
throw new Error("Method not implemented.");
getGraphConfig(environment) {
return index_1.graphsdkModule.getGraphConfig(environment);
}
getGraphCapacity(handle) {
throw new Error("Method not implemented.");
getSchemaIdFromConfig(environment, connectionType, privacyType) {
return index_1.graphsdkModule.getSchemaIdFromConfig(environment, connectionType, privacyType);
}
getGraphSize(handle) {
throw new Error("Method not implemented.");
getGraphCapacity() {
return index_1.graphsdkModule.getGraphCapacity(this.handle);
}
containsUserGraph(handle, dsnpUserId) {
throw new Error("Method not implemented.");
getGraphStatesCount() {
return index_1.graphsdkModule.getGraphStatesCount();
}
getGraphUsersCount(handle) {
throw new Error("Method not implemented.");
containsUserGraph(dsnpUserId) {
return index_1.graphsdkModule.containsUserGraph(this.handle, dsnpUserId);
}
removeUserGraph(handle, dsnpUserId) {
throw new Error("Method not implemented.");
getGraphUsersCount() {
return index_1.graphsdkModule.getGraphUsersCount(this.handle);
}
importUserData(handle, payload) {
throw new Error("Method not implemented.");
removeUserGraph(dsnpUserId) {
return index_1.graphsdkModule.removeUserGraph(this.handle, dsnpUserId);
}
exportUpdates(handle) {
throw new Error("Method not implemented.");
importUserData(payload) {
return index_1.graphsdkModule.importUserData(this.handle, payload);
}
getConnectionsForUserGraphUpdates(handle, dsnpUserId, schemaId, includePending) {
throw new Error("Method not implemented.");
exportUpdates() {
return index_1.graphsdkModule.exportUpdates(this.handle);
}
applyActions(handle, actions) {
throw new Error("Method not implemented.");
getConnectionsForUserGraph(dsnpUserId, schemaId, includePending) {
return index_1.graphsdkModule.getConnectionsForUserGraph(this.handle, dsnpUserId, schemaId, includePending);
}
forceCalculateGraphs(handle, dsnpUserId) {
throw new Error("Method not implemented.");
applyActions(actions) {
return index_1.graphsdkModule.applyActions(this.handle, actions);
}
getConnectionsWithoutKeys(handle) {
throw new Error("Method not implemented.");
forceCalculateGraphs(dsnpUserId) {
return index_1.graphsdkModule.forceCalculateGraphs(this.handle, dsnpUserId);
}
getOneSidedPrivateFriendshipConnections(handle, dsnpUserId) {
throw new Error("Method not implemented.");
getConnectionsWithoutKeys() {
return index_1.graphsdkModule.getConnectionsWithoutKeys(this.handle);
}
getPublicKeys(handle, dsnpUserId) {
throw new Error("Method not implemented.");
getOneSidedPrivateFriendshipConnections(dsnpUserId) {
return index_1.graphsdkModule.getOneSidedPrivateFriendshipConnections(this.handle, dsnpUserId);
}
getPublicKeys(dsnpUserId) {
return index_1.graphsdkModule.getPublicKeys(this.handle, dsnpUserId);
}
deserializeDsnpKeys(keys) {
throw new Error("Method not implemented.");
return index_1.graphsdkModule.deserializeDsnpKeys(keys);
}
freeGraphState(handle) {
throw new Error("Method not implemented.");
freeGraphState() {
return index_1.graphsdkModule.freeGraphState(this.handle);
}
freeAllGraphStates() {
throw new Error("Method not implemented.");
}
getGraphConfig(environment) {
return index_1.graphsdkModule.getGraphConfig(environment);
}
printHelloGraph() {

@@ -73,0 +70,0 @@ console.log(index_1.graphsdkModule.printHelloGraph());

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const graph_1 = require("./graph");
const config_1 = require("./models/config");
const environment_1 = require("./models/environment");
function getTestConfig() {
const config = {};
config.sdkMaxUsersGraphSize = 100;
config.sdkMaxStaleFriendshipDays = 100;
config.maxPageId = 100;
config.dsnpVersions = [config_1.DsnpVersion.Version1_0];
config.maxGraphPageSizeBytes = 100;
config.maxKeyPageSizeBytes = 100;
const schemaConfig = {};
schemaConfig.dsnpVersion = config_1.DsnpVersion.Version1_0;
schemaConfig.connectionType = config_1.ConnectionType.Follow;
schemaConfig.privacyType = config_1.PrivacyType.Public;
config.schemaMap = { 1: schemaConfig };
return config;
}
test('printHelloGraph should print "Hello, Graph!"', async () => {
// Mock the console.log function
const consoleLogMock = jest.spyOn(console, 'log').mockImplementation();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config: {} };
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
await graph.printHelloGraph();
expect(consoleLogMock).toHaveBeenCalledWith('Hello, Graph!');
await graph.freeGraphState();
});
test('getGraphConfig should return the graph config', async () => {
const environment = { environmentType: environment_1.EnvironmentType.Dev, config: {} };
const config_input = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config: config_input };
const graph = new graph_1.Graph(environment);
const config = await graph.getGraphConfig(environment);
expect(config).toBeDefined();
expect(config.sdkMaxUsersGraphSize).toEqual(1000);
expect(config.sdkMaxUsersGraphSize).toEqual(100);
await graph.freeGraphState();
});

@@ -26,2 +45,5 @@ test('getGraphConfig with Mainnet environment should return the graph config', async () => {

expect(config.sdkMaxUsersGraphSize).toEqual(1000);
const schema_id = await graph.getSchemaIdFromConfig(environment, config_1.ConnectionType.Follow, config_1.PrivacyType.Public);
expect(schema_id).toEqual(1);
await graph.freeGraphState();
});

@@ -34,3 +56,292 @@ test('getGraphConfig with Rococo environment should return the graph config', async () => {

expect(config.sdkMaxUsersGraphSize).toEqual(1000);
await graph.freeGraphState();
});
test('initialize graph with low capacity of 100 should return the same capacity', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment, 100);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const capacity = await graph.getGraphCapacity();
expect(capacity).toEqual(100);
await graph.freeGraphState();
});
test('getGraphStatesCount should be zero after previous graph is freed', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
await graph.freeGraphState();
const count = await graph.getGraphStatesCount();
expect(count).toEqual(0);
});
test('getGraphStatesCount should be one after graph is initialized', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const count = await graph.getGraphStatesCount();
expect(count).toEqual(1);
await graph.freeGraphState();
});
test('getGraphUsersCount should be zero on initialized graph', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const count = await graph.getGraphUsersCount();
expect(count).toEqual(0);
await graph.freeGraphState();
await expect(async () => {
await graph.getGraphUsersCount();
}).rejects.toThrow('Graph state not found');
});
test('containsUserGraph should return false on initialized graph', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const contains = await graph.containsUserGraph(1);
expect(contains).toEqual(false);
await graph.freeGraphState();
});
test('removeUserGraph should pass through on initialized graph', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const removed = await graph.removeUserGraph(1);
expect(removed).toEqual(true);
await graph.freeGraphState();
});
test('importUserData should pass through on initialized graph', async () => {
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
// Set up import data
const dsnpUserId1 = 1;
const dsnpUserId2 = 2;
const pageData1 = {
pageId: 1,
content: new Uint8Array([24, 227, 96, 97, 96, 99, 224, 96, 224, 98, 96, 0, 0]),
contentHash: 100,
};
const keyPairs1 = [];
const keyPairs2 = [];
const dsnpKeys1 = {
dsnpUserId: dsnpUserId1,
keysHash: 100,
keys: [],
};
const dsnpKeys2 = {
dsnpUserId: dsnpUserId2,
keysHash: 100,
keys: [],
};
const importBundle1 = {
dsnpUserId: dsnpUserId1,
schemaId: 1,
keyPairs: keyPairs1,
dsnpKeys: dsnpKeys1,
pages: [pageData1],
};
const importBundle2 = {
dsnpUserId: dsnpUserId2,
schemaId: 1,
keyPairs: keyPairs2,
dsnpKeys: dsnpKeys2,
pages: [pageData1],
};
// Import user data for each ImportBundle
const imported = await graph.importUserData([importBundle1, importBundle2]);
expect(imported).toEqual(true);
await graph.freeGraphState();
});
test('applyActions with empty actions should pass through on initialized graph', async () => {
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
// Set up actions
const actions = [];
const applied = await graph.applyActions(actions);
expect(applied).toEqual(true);
await graph.freeGraphState();
});
test('applyActions with few actions should pass through on initialized graph', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
// Set up actions
const actions = [];
const action_1 = {
type: "Connect",
ownerDsnpUserId: 1,
connection: {
dsnpUserId: 2,
schemaId: 1,
},
dsnpKeys: {
dsnpUserId: 2,
keysHash: 100,
keys: [],
},
};
actions.push(action_1);
const applied = await graph.applyActions(actions);
expect(applied).toEqual(true);
const exported = await graph.exportUpdates();
expect(exported).toBeDefined();
expect(exported.length).toEqual(1);
await graph.freeGraphState();
});
test('getConnectionsForUserGraph with empty connections should return empty array', async () => {
const config = getTestConfig();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
// Set up actions
const actions = [];
const action_1 = {
type: "Connect",
ownerDsnpUserId: 1,
connection: {
dsnpUserId: 2,
schemaId: 1,
},
dsnpKeys: {
dsnpUserId: 2,
keysHash: 100,
keys: [],
},
};
actions.push(action_1);
const applied = await graph.applyActions(actions);
expect(applied).toEqual(true);
const connections = await graph.getConnectionsForUserGraph(1, 1, true);
expect(connections).toBeDefined();
expect(connections.length).toEqual(1);
const forceCalculateGraphs = await graph.forceCalculateGraphs(1);
expect(forceCalculateGraphs).toBeDefined();
expect(forceCalculateGraphs.length).toEqual(0);
await graph.freeGraphState();
});
test('getConnectionsWithoutKeys with empty connections should return empty array', async () => {
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const connections = await graph.getConnectionsWithoutKeys();
expect(connections).toBeDefined();
expect(connections.length).toEqual(0);
expect(async () => {
await graph.getOneSidedPrivateFriendshipConnections(1);
}).rejects.toThrow('User graph for 1 is not imported');
await graph.freeGraphState();
});
test('getPublicKeys with empty connections should return empty array', async () => {
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const connections = await graph.getPublicKeys(1);
expect(connections).toBeDefined();
expect(connections.length).toEqual(0);
await graph.freeGraphState();
});
test('deserializeDsnpKeys with empty keys should return empty array', async () => {
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
const handle = graph.getGraphHandle();
expect(handle).toBeDefined();
const keys = {
dsnpUserId: 2,
keysHash: 100,
keys: [],
};
const connections = await graph.deserializeDsnpKeys(keys);
expect(connections).toBeDefined();
expect(connections.length).toEqual(0);
await graph.freeGraphState();
});
test('Create and export a new graph', async () => {
let mainnet_environment = { environmentType: environment_1.EnvironmentType.Mainnet };
let graph = new graph_1.Graph(mainnet_environment);
let public_follow_graph_schema_id = await graph.getSchemaIdFromConfig(mainnet_environment, config_1.ConnectionType.Follow, config_1.PrivacyType.Public);
let connect_action = {
type: "Connect",
ownerDsnpUserId: 1,
connection: {
dsnpUserId: 2,
schemaId: public_follow_graph_schema_id,
},
dsnpKeys: {
dsnpUserId: 2,
keysHash: 100,
keys: [],
},
};
let actions = [];
actions.push(connect_action);
let applied = await graph.applyActions(actions);
expect(applied).toEqual(true);
let connections_including_pending = await graph.getConnectionsForUserGraph(1, public_follow_graph_schema_id, true);
expect(connections_including_pending).toBeDefined();
expect(connections_including_pending.length).toEqual(1);
let exported = await graph.exportUpdates();
expect(exported).toBeDefined();
expect(exported.length).toEqual(1);
});
test('Add a new graph key', async () => {
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
const dsnpOwnerId = 1;
const x25519_public_key = [
15, 234, 44, 175, 171, 220, 131, 117, 43, 227, 111, 165, 52, 150, 64, 218, 44, 130, 138,
221, 10, 41, 13, 241, 60, 210, 216, 23, 62, 178, 73, 111,
];
const addGraphKeyAction = {
type: "AddGraphKey",
ownerDsnpUserId: dsnpOwnerId,
newPublicKey: new Uint8Array(x25519_public_key),
};
const actions = [];
actions.push(addGraphKeyAction);
const applied = await graph.applyActions(actions);
expect(applied).toEqual(true);
const exported = await graph.exportUpdates();
expect(exported).toBeDefined();
expect(exported.length).toEqual(1);
});
test('Read and deserialize published graph keys', async () => {
let dsnp_key_owner = 1000;
// published keys blobs fetched from blockchain
let published_keys_blob = [
64, 15, 234, 44, 175, 171, 220, 131, 117, 43, 227, 111, 165, 52, 150, 64, 218, 44, 130,
138, 221, 10, 41, 13, 241, 60, 210, 216, 23, 62, 178, 73, 111,
];
let dsnp_keys = {
dsnpUserId: dsnp_key_owner,
keysHash: 100,
keys: [
{
index: 0,
content: new Uint8Array(published_keys_blob),
}
],
};
const environment = { environmentType: environment_1.EnvironmentType.Mainnet };
const graph = new graph_1.Graph(environment);
const deserialized_keys = await graph.deserializeDsnpKeys(dsnp_keys);
expect(deserialized_keys).toBeDefined();
});
//# sourceMappingURL=graph.test.js.map

@@ -1,2 +0,2 @@

import { Action, Config, DsnpGraphEdge, DsnpKeys, DsnpPublicKey, EnvironmentInterface, ImportBundle, Update } from "./models";
import { Action, Config, ConnectionType, DsnpGraphEdge, DsnpKeys, DsnpPublicKey, EnvironmentInterface, ImportBundle, PrivacyType, Update } from "./models";
export interface Native {

@@ -7,20 +7,20 @@ printHelloGraph(): void;

getGraphConfig(environment: EnvironmentInterface): Promise<Config>;
getSchemaIdFromConfig(environment: EnvironmentInterface, connectionType: ConnectionType, privacyType: PrivacyType): Promise<number>;
getGraphCapacity(handle: number): Promise<number>;
getGraphSize(handle: number): Promise<number>;
getGraphStatesCount(): Promise<number>;
getGraphUsersCount(handle: number): Promise<number>;
containsUserGraph(handle: number, dsnpUserId: number): Promise<boolean>;
getGraphUsersCount(handle: number): Promise<number>;
removeUserGraph(handle: number, dsnpUserId: number): Promise<void>;
importUserData(handle: number, payload: [ImportBundle]): Promise<void>;
exportUpdates(handle: number): Promise<Update>;
getConnectionsForUserGraphUpdates(handle: number, dsnpUserId: number, schemaId: string, includePending: boolean): Promise<[DsnpGraphEdge]>;
applyActions(handle: number, actions: [Action]): Promise<void>;
forceCalculateGraphs(handle: number, dsnpUserId: number): Promise<Update>;
getConnectionsWithoutKeys(handle: number): Promise<[number]>;
getOneSidedPrivateFriendshipConnections(handle: number, dsnpUserId: number): Promise<[DsnpGraphEdge]>;
getPublicKeys(handle: number, dsnpUserId: number): Promise<[DsnpPublicKey]>;
deserializeDsnpKeys(keys: DsnpKeys): Promise<[DsnpPublicKey]>;
freeGraphState(handle: number): Promise<void>;
freeAllGraphStates(): Promise<void>;
removeUserGraph(handle: number, dsnpUserId: number): Promise<boolean>;
importUserData(handle: number, payload: ImportBundle[]): Promise<boolean>;
applyActions(handle: number, actions: Action[]): Promise<boolean>;
exportUpdates(handle: number): Promise<Update[]>;
getConnectionsForUserGraph(handle: number, dsnpUserId: number, schemaId: number, includePending: boolean): Promise<DsnpGraphEdge[]>;
forceCalculateGraphs(handle: number, dsnpUserId: number): Promise<Update[]>;
getConnectionsWithoutKeys(handle: number): Promise<number[]>;
getOneSidedPrivateFriendshipConnections(handle: number, dsnpUserId: number): Promise<DsnpGraphEdge[]>;
getPublicKeys(handle: number, dsnpUserId: number): Promise<DsnpPublicKey[]>;
deserializeDsnpKeys(keys: DsnpKeys): Promise<DsnpPublicKey[]>;
freeGraphState(handle: number): Promise<boolean>;
}
export declare const graphsdkModule: Native;
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const graph_1 = require("./graph");
const models_1 = require("./models");
const environment_1 = require("./models/environment");
function getTestConfig() {
const config = {};
config.sdkMaxUsersGraphSize = 100;
config.sdkMaxStaleFriendshipDays = 100;
config.maxPageId = 100;
config.dsnpVersions = [models_1.DsnpVersion.Version1_0];
config.maxGraphPageSizeBytes = 100;
config.maxKeyPageSizeBytes = 100;
const schemaConfig = {};
schemaConfig.dsnpVersion = models_1.DsnpVersion.Version1_0;
schemaConfig.connectionType = models_1.ConnectionType.Follow;
schemaConfig.privacyType = models_1.PrivacyType.Public;
config.schemaMap = { 1: schemaConfig };
return config;
}
test('printHelloGraph should print "Hello, Graph!"', async () => {
// Mock the console.log function
const consoleLogMock = jest.spyOn(console, 'log').mockImplementation();
const environment = { environmentType: environment_1.EnvironmentType.Dev, config: {} };
const environment = { environmentType: environment_1.EnvironmentType.Dev, config: getTestConfig() };
const graph = new graph_1.Graph(environment);
await graph.printHelloGraph();
expect(consoleLogMock).toHaveBeenCalledWith('Hello, Graph!');
await graph.freeGraphState();
});
//# sourceMappingURL=index.test.js.map

@@ -7,3 +7,3 @@ import { Connection } from "./connection";

connection: Connection;
dsnpKeys: DsnpKeys;
dsnpKeys?: DsnpKeys;
}

@@ -10,0 +10,0 @@ export interface DisconnectAction {

@@ -22,9 +22,9 @@ declare enum DsnpVersion {

maxPageId: number;
max_key_page_size_bytes: number;
maxKeyPageSizeBytes: number;
schemaMap: {
[key: string]: SchemaConfig;
[key: number]: SchemaConfig;
};
dsnpVersions: DsnpVersion[];
}
export { Config, ConnectionType, DsnpVersion, SchemaConfig };
export { Config, ConnectionType, DsnpVersion, SchemaConfig, PrivacyType };
//# sourceMappingURL=config.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DsnpVersion = exports.ConnectionType = void 0;
exports.PrivacyType = exports.DsnpVersion = exports.ConnectionType = void 0;
var DsnpVersion;

@@ -17,3 +17,3 @@ (function (DsnpVersion) {

PrivacyType["Private"] = "private";
})(PrivacyType || (PrivacyType = {}));
})(PrivacyType || (exports.PrivacyType = PrivacyType = {}));
//# sourceMappingURL=config.js.map
export interface Connection {
dsnpUserIds: number;
dsnpUserId: number;
schemaId: number;
}
//# sourceMappingURL=connection.d.ts.map

@@ -7,3 +7,3 @@ export interface KeyData {

dsnpUserId: number;
keysHash: Uint8Array;
keysHash: number;
keys: KeyData[];

@@ -20,5 +20,5 @@ }

export interface PageData {
page_id: string;
pageId: number;
content: Uint8Array;
contentHash: Uint8Array;
contentHash: number;
}

@@ -25,0 +25,0 @@ export interface ImportBundle {

@@ -6,3 +6,3 @@ export interface PersistPageUpdate {

pageId: number;
prevHash: Uint8Array;
prevHash: number;
payload: Uint8Array;

@@ -15,3 +15,3 @@ }

pageId: number;
prevHash: Uint8Array;
prevHash: number;
}

@@ -21,3 +21,3 @@ export interface AddKeyUpdate {

ownerDsnpUserId: number;
prevHash: Uint8Array;
prevHash: number;
payload: Uint8Array;

@@ -24,0 +24,0 @@ }

{
"name": "@dsnp/graph-sdk",
"version": "0.0.0-a55c8a",
"version": "0.0.0-aa56de",
"author": "Amplica Labs",

@@ -51,3 +51,3 @@ "license": "ISC",

},
"homepage": "https://github.com/LibertyDSNP/graph-sdk#readme"
"homepage": "https://github.com/LibertyDSNP/graph-sdk/bridge/node/README.md"
}

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc