one-click-auth / trustauthx_ts_sdk Goto Github PK
View Code? Open in Web Editor NEWOfficial Typescript Server-Side SDK of TrustAuthx
Official Typescript Server-Side SDK of TrustAuthx
Description:
We need to implement the EdgeDB and role management functionality in the client-side TypeScript SDK, similar to the Python SDK implementation. This includes the following features:
Role Management: Implement methods for retrieving all roles, adding/deleting roles, and adding/deleting permissions for roles. These methods should make API calls to the server-side SDK and handle the responses accordingly.
Response Classes: Implement separate response classes for each method in the role management functionality, such as GetAllRolesResponse
, AddRoleResponse
, DeleteRoleResponse
, AddPermissionResponse
, and DeletePermissionResponse
. These classes should match the response formats expected from the corresponding methods.
Documentation: Update the client-side TypeScript SDK documentation to include detailed information about the new classes, methods, and usage examples.
Implementation Steps:
Recommendations:
For the client-side TypeScript SDK, I recommend using IndexedDB or localStorage as the database solution for storing roles and permissions locally. Both options are well-supported in modern web browsers and can be used to store data on the client-side.
IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs, and provides features like indexes and transactions for efficient data access and management. However, it has a steeper learning curve compared to localStorage.
We’re missing a README for our project. It’s super important because it helps users understand what we’re all about and how to use our project.
Could someone help us out and write one? For an idea of what we’re looking for, check out this repo: TrustAuthx-Py-SDK
The SDK code (index.ts) is currently mixed together in a single TypeScript file. As our project grows larger, it will become more complex and difficult to contribute to.
To address this, we propose refactoring the index.ts file into separate folders. For TypeScript types, we can create a dedicated folder and place the types there. Similarly, we can create a separate utils folder to contain all the files related to utilities, including the utils.ts file.
Setup Server Side Sdk in Typescript for next-13 and subsequently client side sdk for react.
Brownie points for vanilla js sdk.
Functions are already exposed here (server side ) : https://github.com/One-Click-Auth/Trustauthx_TS_SDK/blob/main/src/index.ts
Client side: https://github.com/One-Click-Auth/Trustauthx_TS_SDK/blob/main/src/client.ts
We are facing few issues regarding storing the tokens in cookies.
This is a paid gig.
Contact the team here for more info: https://discord.gg/qrB4Dzes
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 as GetAllRolesResponse
, AddRoleResponse
, DeleteRoleResponse
, AddPermissionResponse
, and DeletePermissionResponse
. 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:
npm install sqlite3
npm install --save-dev @types/sqlite3
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:
npm install sqlite3 --save
npm install sqlite --save
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.