Implement EdgeDB and Role Management Functionality in Server-side TypeScript SDK #12
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Server-side SDK UPDATE
Description:
We need to implement the EdgeDB and role management functionality in the server-side TypeScript SDK, similar to the Python SDK ( https://github.com/One-Click-Auth/TrustAuthx-Py-SDK ) implementation. This includes the following features:
EdgeDB Role Query: Implement the
_EdgeDBRoleQuery
class to query and manage roles and permissions. This class should support in-memory and database storage modes, with methods for querying roles, validating permissions, and counting roles.Role Management: Implement the
_Roles
class, which inherits from_EdgeDBRoleQuery
. This class should provide methods for retrieving all roles, adding/deleting roles, and adding/deleting permissions for roles.Response Classes: Implement separate response classes for each method in the
_Roles
class, such asGetAllRolesResponse
,AddRoleResponse
,DeleteRoleResponse
,AddPermissionResponse
, andDeletePermissionResponse
. These classes should match the response formats expected from the corresponding methods.Database Storage: Provide the option to store roles and permissions in a database. Recommend a suitable database solution for the server-side TypeScript SDK to use for this purpose. Some potential options include PostgreSQL, MySQL, or MongoDB.
Documentation: Update the server-side TypeScript SDK documentation to include detailed information about the new classes, methods, and usage examples.
Implementation Steps:
_EdgeDBRoleQuery
class with the appropriate methods for querying and managing roles and permissions._Roles
class and its methods for role and permission management._Roles
class, following the expected response formats.Recommendations:
For the server-side TypeScript SDK,
There's AI suggestion for SQLLITE
In TypeScript, you have several options to work with SQLite:
sqlite3 with TypeScript: You can use the
sqlite3
package along with its TypeScript definitions. You can install them using npm:This will allow you to use SQLite in your TypeScript project².
sqlite: This is a wrapper library written in TypeScript that adds ES6 promises and SQL-based migrations API to sqlite3¹. You can install it using npm:
This library has the same API as the original sqlite3 library, except that all its API methods return ES6 Promises¹.
Prisma: If you're looking for an Object-Relational Mapping (ORM) solution, Prisma is a good option. It supports SQLite and has strong TypeScript integration³.
better-sqlite3: This is another SQLite library that you can use in TypeScript⁴. It's designed to be simpler and faster than sqlite3.
The text was updated successfully, but these errors were encountered: