@dsnp/graph-sdk
Advanced tools
Comparing version 0.0.0-a55c8a to 0.0.0-ab5a34
@@ -1,29 +0,25 @@ | ||
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 } 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]>; | ||
getGraphHandle(): number; | ||
getGraphConfig(environment: EnvironmentInterface): Promise<Config>; | ||
getGraphCapacity(): Promise<number>; | ||
getGraphSize(): Promise<number>; | ||
containsUserGraph(dsnpUserId: number): Promise<boolean>; | ||
getGraphUsersCount(): Promise<number>; | ||
removeUserGraph(dsnpUserId: number): Promise<void>; | ||
importUserData(payload: [ImportBundle]): Promise<void>; | ||
exportUpdates(): Promise<Update>; | ||
getConnectionsForUserGraphUpdates(dsnpUserId: number, schemaId: string, includePending: boolean): Promise<[DsnpGraphEdge]>; | ||
applyActions(actions: [Action]): Promise<void>; | ||
forceCalculateGraphs(dsnpUserId: number): Promise<Update>; | ||
getConnectionsWithoutKeys(): Promise<[number]>; | ||
getOneSidedPrivateFriendshipConnections(dsnpUserId: number): Promise<[DsnpGraphEdge]>; | ||
getPublicKeys(dsnpUserId: number): Promise<[DsnpPublicKey]>; | ||
deserializeDsnpKeys(keys: DsnpKeys): Promise<[DsnpPublicKey]>; | ||
freeGraphState(handle: number): Promise<void>; | ||
freeAllGraphStates(): Promise<void>; | ||
getGraphConfig(environment: EnvironmentInterface): Promise<Config>; | ||
freeGraphState(): Promise<void>; | ||
printHelloGraph(): void; | ||
} | ||
//# sourceMappingURL=graph.d.ts.map |
@@ -14,59 +14,53 @@ "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."); | ||
getGraphCapacity() { | ||
return index_1.graphsdkModule.getGraphCapacity(this.handle); | ||
} | ||
getGraphSize(handle) { | ||
throw new Error("Method not implemented."); | ||
getGraphSize() { | ||
return index_1.graphsdkModule.getGraphSize(this.handle); | ||
} | ||
containsUserGraph(handle, dsnpUserId) { | ||
throw new Error("Method not implemented."); | ||
containsUserGraph(dsnpUserId) { | ||
return index_1.graphsdkModule.containsUserGraph(this.handle, dsnpUserId); | ||
} | ||
getGraphUsersCount(handle) { | ||
throw new Error("Method not implemented."); | ||
getGraphUsersCount() { | ||
return index_1.graphsdkModule.getGraphUsersCount(this.handle); | ||
} | ||
removeUserGraph(handle, dsnpUserId) { | ||
throw new Error("Method not implemented."); | ||
removeUserGraph(dsnpUserId) { | ||
return index_1.graphsdkModule.removeUserGraph(this.handle, dsnpUserId); | ||
} | ||
importUserData(handle, payload) { | ||
throw new Error("Method not implemented."); | ||
importUserData(payload) { | ||
return index_1.graphsdkModule.importUserData(this.handle, payload); | ||
} | ||
exportUpdates(handle) { | ||
throw new Error("Method not implemented."); | ||
exportUpdates() { | ||
return index_1.graphsdkModule.exportUpdates(this.handle); | ||
} | ||
getConnectionsForUserGraphUpdates(handle, dsnpUserId, schemaId, includePending) { | ||
throw new Error("Method not implemented."); | ||
getConnectionsForUserGraphUpdates(dsnpUserId, schemaId, includePending) { | ||
return index_1.graphsdkModule.getConnectionsForUserGraphUpdates(this.handle, dsnpUserId, schemaId, includePending); | ||
} | ||
applyActions(handle, actions) { | ||
throw new Error("Method not implemented."); | ||
applyActions(actions) { | ||
return index_1.graphsdkModule.applyActions(this.handle, actions); | ||
} | ||
forceCalculateGraphs(handle, dsnpUserId) { | ||
throw new Error("Method not implemented."); | ||
forceCalculateGraphs(dsnpUserId) { | ||
return index_1.graphsdkModule.forceCalculateGraphs(this.handle, dsnpUserId); | ||
} | ||
getConnectionsWithoutKeys(handle) { | ||
throw new Error("Method not implemented."); | ||
getConnectionsWithoutKeys() { | ||
return index_1.graphsdkModule.getConnectionsWithoutKeys(this.handle); | ||
} | ||
getOneSidedPrivateFriendshipConnections(handle, dsnpUserId) { | ||
throw new Error("Method not implemented."); | ||
getOneSidedPrivateFriendshipConnections(dsnpUserId) { | ||
return index_1.graphsdkModule.getOneSidedPrivateFriendshipConnections(this.handle, dsnpUserId); | ||
} | ||
getPublicKeys(handle, dsnpUserId) { | ||
throw new Error("Method not implemented."); | ||
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 +67,0 @@ console.log(index_1.graphsdkModule.printHelloGraph()); |
@@ -12,2 +12,3 @@ "use strict"; | ||
expect(consoleLogMock).toHaveBeenCalledWith('Hello, Graph!'); | ||
await graph.freeGraphState(); | ||
}); | ||
@@ -20,2 +21,3 @@ test('getGraphConfig should return the graph config', async () => { | ||
expect(config.sdkMaxUsersGraphSize).toEqual(1000); | ||
await graph.freeGraphState(); | ||
}); | ||
@@ -28,2 +30,3 @@ test('getGraphConfig with Mainnet environment should return the graph config', async () => { | ||
expect(config.sdkMaxUsersGraphSize).toEqual(1000); | ||
await graph.freeGraphState(); | ||
}); | ||
@@ -36,3 +39,13 @@ 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 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(); | ||
}); | ||
//# sourceMappingURL=graph.test.js.map |
@@ -12,3 +12,4 @@ "use strict"; | ||
expect(consoleLogMock).toHaveBeenCalledWith('Hello, Graph!'); | ||
await graph.freeGraphState(); | ||
}); | ||
//# sourceMappingURL=index.test.js.map |
@@ -22,3 +22,3 @@ declare enum DsnpVersion { | ||
maxPageId: number; | ||
max_key_page_size_bytes: number; | ||
maxKeyPageSizeBytes: number; | ||
schemaMap: { | ||
@@ -25,0 +25,0 @@ [key: string]: SchemaConfig; |
export interface Connection { | ||
dsnpUserIds: number; | ||
dsnpUserId: number; | ||
schemaId: number; | ||
} | ||
//# sourceMappingURL=connection.d.ts.map |
{ | ||
"name": "@dsnp/graph-sdk", | ||
"version": "0.0.0-a55c8a", | ||
"version": "0.0.0-ab5a34", | ||
"author": "Amplica Labs", | ||
@@ -5,0 +5,0 @@ "license": "ISC", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
4483404
401
91
1