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.8 to 0.0.9

1

dist/js/import-bundle-builder.d.ts

@@ -15,2 +15,3 @@ import { GraphKeyType, GraphKeyPair, DsnpKeys, ImportBundle, PageData } from "./models";

withGraphKeyPair(keyType: GraphKeyType, publicKey: Uint8Array, secretKey: Uint8Array): ImportBundleBuilder;
withGraphKeyPairs(keys: GraphKeyPair[]): ImportBundleBuilder;
withDsnpKeys(dsnpKeys: DsnpKeys): ImportBundleBuilder;

@@ -17,0 +18,0 @@ withPageData(pageId: number, content: Uint8Array, contentHash: number): ImportBundleBuilder;

@@ -22,2 +22,7 @@ "use strict";

}
withGraphKeyPairs(keys) {
const keyPairs = this.values.keyPairs ? [...this.values.keyPairs] : [];
keyPairs.push(...keys);
return new ImportBundleBuilder({ ...this.values, keyPairs });
}
withDsnpKeys(dsnpKeys) {

@@ -24,0 +29,0 @@ return new ImportBundleBuilder({ ...this.values, dsnpKeys });

@@ -32,3 +32,3 @@ "use strict";

.withSchemaId(schemaId)
.withGraphKeyPair(models_1.GraphKeyType.X25519, new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]))
.withGraphKeyPairs([{ keyType: models_1.GraphKeyType.X25519, publicKey: new Uint8Array([1, 2, 3]), secretKey: new Uint8Array([4, 5, 6]) }])
.withDsnpKeys(dsnpKeys)

@@ -45,3 +45,20 @@ .withPageData(1, new Uint8Array([10, 11, 12]), 789);

});
it('should build the import bundle correctly with withGraphKeyPair', () => {
const dsnpUserId = "111";
const schemaId = 123;
const importBundleBuilder = new import_bundle_builder_1.ImportBundleBuilder()
.withDsnpUserId(dsnpUserId)
.withSchemaId(schemaId)
.withGraphKeyPair(models_1.GraphKeyType.X25519, new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6]))
.withDsnpKeys({ dsnpUserId: "111", keysHash: 456, keys: [{ index: 0, content: new Uint8Array([7, 8, 9]) }] })
.withPageData(1, new Uint8Array([10, 11, 12]), 789);
(0, globals_1.expect)(importBundleBuilder.build()).toEqual({
dsnpUserId,
schemaId,
keyPairs: [{ keyType: models_1.GraphKeyType.X25519, publicKey: new Uint8Array([1, 2, 3]), secretKey: new Uint8Array([4, 5, 6]) }],
dsnpKeys: { dsnpUserId: "111", keysHash: 456, keys: [{ index: 0, content: new Uint8Array([7, 8, 9]) }] },
pages: [{ pageId: 1, content: new Uint8Array([10, 11, 12]), contentHash: 789 }],
});
});
});
//# sourceMappingURL=import-bundle-builder.spec.js.map

2

package.json
{
"name": "@dsnp/graph-sdk",
"version": "0.0.8",
"version": "0.0.9",
"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

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