Comments (14)
Awesome! I was counting the days ;-) until your response!
Thank you for the clarification. I am very happy to contribute.
from typedb-driver-nodejs.
Any idea if this request might be accomplished in the near future? We would like to consume Grakn upcoming project.
from typedb-driver-nodejs.
I don't think we have the bandwitdh to implement and maintain this ourselves right now. That being said, I believe the bindings would be relatively easy to create for your use case! Perhaps we can help you collaborate and design the bindings and contribute them as an open source project?
from typedb-driver-nodejs.
@sorsaffari would be the one to talk to as he has the relevant experience.
from typedb-driver-nodejs.
I agree @flyingsilverfin.
A PR to this repo or DefinitelyTyped would be much appreciated @MichaelNino.
from typedb-driver-nodejs.
from typedb-driver-nodejs.
Hi @sorsaffari
I have begun writing the Typescript definition. Below is the definition file so I might better ask my questions.
// Type definitions for grakn-client 1.6.0
// Project: Grakn Client API: NodeJS
// Definitions by: Michael Niño https://www.michaelnino.com
export = GraknClient;
interface Credentials {
username: string;
password: string;
}
interface KeyspacesResponse {
retrieve(): Promise<any>;
delete(keyspace: string): Promise<any>;
}
declare class GraknClient {
constructor(uri: string, credentials?: Credentials);
session(keyspace: string): Session;
/*
this.keyspaces = () => ({
delete: (keyspace) => keyspaceService.delete(keyspace),
retrieve: () => keyspaceService.retrieve()
});
*/
keyspaces(): KeyspacesResponse[]; // <-- The method "keyspaces" is plural. Are we intending to destructure to an array of object literals?
close(): void;
}
/*
module.exports.dataType = {
STRING: messages.AttributeType.DATA_TYPE.STRING,
BOOLEAN: messages.AttributeType.DATA_TYPE.BOOLEAN,
INTEGER: messages.AttributeType.DATA_TYPE.INTEGER,
LONG: messages.AttributeType.DATA_TYPE.LONG,
FLOAT: messages.AttributeType.DATA_TYPE.FLOAT,
DOUBLE: messages.AttributeType.DATA_TYPE.DOUBLE,
DATE: messages.AttributeType.DATA_TYPE.DATE
};
*/
declare namespace GraknClient {
export interface dataType {
STRING: any;
BOOLEAN: any;
INTEGER: any;
LONG: any;
FLOAT: any;
DOUBLE: any;
DATE: any;
}
}
I have included comments from the your project's JavaScript source file for reference as well.
- Could you elaborate on your intention to destructure object literals in the method
keyspaces
. I would like to better understand the approach so I may create necessary typing but not over-typing. - Could you provide me with the URL to the declaration of
messages.AttributeType.DATA
so I might create the correct types for that part of the Typescript definition? Thank you I couldn't easily locate it.
Thanks for your assistance. I think this definition file will increase overall adoption of Grakn/NodeJS.
from typedb-driver-nodejs.
@sorsaffari your input would be greatly appreciated :-)
from typedb-driver-nodejs.
Perhaps we can help you collaborate and design the bindings and contribute them as an open source project?
Perhaps @flyingsilverfin. Not sure if @sorsaffari could reply. I have been waiting almost 3 yrs. to begin using Grakn. Will anyone be interested in answering a couple of questions (above).
from typedb-driver-nodejs.
Hi @MichaelNino. Sorry for the late response. I'll be back at the office on the 28th and will attend to this right away.
Thank you for willing to contribute the type definitions to Client Node.js. I'm sure this will be much appreciated by the community :)
from typedb-driver-nodejs.
Got it! :-) Thanks again for your guidance.
from typedb-driver-nodejs.
Could you elaborate on your intention to destructure object literals in the method keyspaces.
There isn't a specific reason for it. It's been the design the decision made initially for Client Java which then has been replicated in the other clients.
Could you provide me with the URL to the declaration of messages.AttributeType.DATA
Here is the enum Datatype
within Concept.proto
of graknlabs/protocol
.
The method "keyspaces" is plural. Are we intending to destructure to an array of object literals?
Despite its plurality, keyspaces()
returns a single object. It's a bit confusing, I know, but I kind of see why it's been made plural considering the methods that can be called on the object it returns (i.e. delete
and retrieve
)
Once again, thanks for the effort @MichaelNino and do let me know if any of these answers are unclear or if you have any more questions :)
from typedb-driver-nodejs.
Hi! I'm very interested in using Grakn with a NodeJS project I'm working on, written in TypeScript.
Is there anything I could do to help make this Type Def file happen?
from typedb-driver-nodejs.
The NodeJS client for Grakn 2.0 is a TypeScript project, and the npm
package grakn-client
contains both .js
and .d.ts
files as of 2.0.
See: https://www.npmjs.com/package/grakn-client
from typedb-driver-nodejs.
Related Issues (20)
- Is this library functional yet? HOT 4
- QueryManager's matchAggregate, matchGroup and matchGroupAggregate send queries with incorrect type
- matchAggregate queries throw an exception
- Enable BDD tests for all Graql Queries on Client Nodejs HOT 1
- Upgrade client-nodejs to use the latest @graknlabs_common HOT 1
- The package deployed to `npm` uses UMD modules, not CommonJS, causing incompatibility with Workbase
- Unify NodeJS dependency declarations into Bazel HOT 4
- 'npm install typedb-client' on MacOS fails HOT 2
- BDD: User management
- TypeDB Cluster: Update password
- Use `yarn` instead of `npm` to install dependencies HOT 1
- Determine which of our direct dependencies pull in the most transitive deps HOT 1
- Support user token mechanism for faster authentication
- User role management HOT 1
- Replica tracking simplification HOT 1
- Node.js build fails on Apple Silicon HOT 1
- Add a function to the Cluster client to return the current user
- Integration tests fail locally with `undefined` errors
- Un-ignore test for modifying schema in a READ transaction HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typedb-driver-nodejs.