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.10 to 0.0.11

54

dist/js/graph.test.js

@@ -23,6 +23,11 @@ "use strict";

connectionType: config_1.ConnectionType.Follow,
privacyType: config_1.PrivacyType.Private,
privacyType: config_1.PrivacyType.Public,
},
3: {
dsnpVersion: config_1.DsnpVersion.Version1_0,
connectionType: config_1.ConnectionType.Follow,
privacyType: config_1.PrivacyType.Private,
},
4: {
dsnpVersion: config_1.DsnpVersion.Version1_0,
connectionType: config_1.ConnectionType.Friendship,

@@ -67,5 +72,5 @@ privacyType: config_1.PrivacyType.Private,

expect(config).toBeDefined();
expect(config.graphPublicKeySchemaId).toEqual(5);
expect(config.graphPublicKeySchemaId).toEqual(7);
const schema_id = graph.getSchemaIdFromConfig(environment, config_1.ConnectionType.Follow, config_1.PrivacyType.Public);
expect(schema_id).toEqual(1);
expect(schema_id).toEqual(8);
graph.freeGraphState();

@@ -385,3 +390,46 @@ });

});
test("Private Graph: Import bundle without schema id and empty pages should import keys", async () => {
const dsnpUserId = "1000";
const keyPair = {
publicKey: Uint8Array.from(Buffer.from("e3b18e1aa5c84175ec0c516838fb89dd9c947dd348fa38fe2082764bbc82a86f", "hex")),
secretKey: Uint8Array.from(Buffer.from("a55688dc2ffcf0f2b7e819029ad686a3c896c585725f5ac38dddace7de703451", "hex")),
keyType: models_1.GraphKeyType.X25519,
};
const keyPairs = [keyPair];
const dsnpKeys = {
dsnpUserId,
keysHash: 100,
keys: [
{
index: 0,
content: Uint8Array.from(Buffer.from('40e3b18e1aa5c84175ec0c516838fb89dd9c947dd348fa38fe2082764bbc82a86f', 'hex')),
},
],
};
const importBundle = {
dsnpUserId,
schemaId: 0,
keyPairs,
dsnpKeys,
pages: [],
};
const imported = graph.importUserData([importBundle]);
expect(imported).toEqual(true);
let connectionPrivate = {
dsnpUserId: "1000",
schemaId: 3,
};
let privateConnectAction = {
type: "Connect",
ownerDsnpUserId: "1000",
dsnpKeys,
connection: connectionPrivate,
};
const appliedAction = await graph.applyActions([privateConnectAction]);
expect(appliedAction).toEqual(true);
const exported = graph.exportUpdates();
expect(exported).toBeDefined();
expect(exported.length).toEqual(1);
});
});
//# sourceMappingURL=graph.test.js.map

2

package.json
{
"name": "@dsnp/graph-sdk",
"version": "0.0.10",
"version": "0.0.11",
"author": "Amplica Labs",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

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