-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentations #52
Closed
Closed
Documentations #52
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# EndPoint List | ||
|
||
1. ### _Users Endpoints_ | ||
|
||
* [Create a new user](user-endpoints-documentation/create-new-user) `Post /signup` | ||
* [Signin User](user-endpoints-documentation/signin) `Post /login` | ||
* [Refresh Token](user-endpoints-documentation/refresh-token) `Post /refresh_token` | ||
* [githubAuthValidator](user-endpoints-documentation/github signin) `Post /github` | ||
|
||
|
||
2. ### _Claim & Node Documentation_ | ||
|
||
* [requires a valid JWT token to be passed in the request ](Claim-&-Node-Documentation/jwtVerify) `Post /claim` | ||
* [GET claims](Claim-&-Node-Documentation/get-claims) `GET /claim/:claimId?` | ||
* [retrieves a list of nodes]( claim-node-documentiona/gets-node) `GET /node/:nodeId?` | ||
|
||
|
||
### _DETAILS_ | ||
|
||
``claimPost: creates a new claim in the database using the data provided in the request body. If the request contains the necessary environment variables, it also sends the claim data to a third-party service using an HTTP POST request. Returns the created claim as a JSON response. | ||
claimGet: retrieves a list of claims from the database, filtered by optional query parameters such as a search term or pagination limits. If a claim ID is provided in the request params, returns the single claim object with that ID. Otherwise, returns an array of claim objects and a count of the total number of claims in the database. | ||
nodesGet: retrieves a list of nodes from the database, filtered by optional query parameters such as a search term or pagination limits. If a node ID is provided in the request params, returns the single node object with that ID and any edges connected to it. Otherwise, returns an array of node objects and a count of the total number of nodes in the database. | ||
|
||
`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# TRUST_CLAIM | ||
|
||
|
||
## Process Flow | ||
|
||
![Diagram](./flow1.png) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions
93
prisma/migrations/20230406062906_postgres_init/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
-- CreateEnum | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this whole migration in here? We already have claims? |
||
CREATE TYPE "AuthType" AS ENUM ('PASSWORD', 'GITHUB'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "EntityType" AS ENUM ('PERSON', 'ORGANIZATION', 'CLAIM', 'IMPACT', 'EVENT', 'DOCUMENT', 'PRODUCT', 'PLACE', 'UNKNOWN', 'OTHER'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "IssuerIdType" AS ENUM ('DID', 'ETH', 'PUBKEY', 'URL'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "HowKnown" AS ENUM ('FIRST_HAND', 'SECOND_HAND', 'WEB_DOCUMENT', 'VERIFIED_LOGIN', 'BLOCKCHAIN', 'SIGNED_DOCUMENT', 'PHYSICAL_DOCUMENT', 'INTEGRATION', 'RESEARCH', 'OPINION', 'OTHER'); | ||
|
||
-- CreateTable | ||
CREATE TABLE "User" ( | ||
"id" SERIAL NOT NULL, | ||
"email" TEXT, | ||
"passwordHash" TEXT, | ||
"name" TEXT, | ||
"authType" "AuthType" NOT NULL DEFAULT E'PASSWORD', | ||
"authProviderId" TEXT, | ||
|
||
CONSTRAINT "User_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Node" ( | ||
"id" SERIAL NOT NULL, | ||
"nodeUri" TEXT NOT NULL, | ||
"name" TEXT NOT NULL, | ||
"entType" "EntityType" NOT NULL, | ||
"descrip" TEXT NOT NULL, | ||
"image" TEXT, | ||
"thumbnail" TEXT, | ||
|
||
CONSTRAINT "Node_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Edge" ( | ||
"id" SERIAL NOT NULL, | ||
"startNodeId" INTEGER NOT NULL, | ||
"endNodeId" INTEGER, | ||
"label" TEXT NOT NULL, | ||
"thumbnail" TEXT, | ||
"claimId" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "Edge_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Claim" ( | ||
"id" SERIAL NOT NULL, | ||
"subject" TEXT NOT NULL, | ||
"claim" TEXT NOT NULL, | ||
"object" TEXT, | ||
"statement" TEXT, | ||
"effectiveDate" TIMESTAMP(3), | ||
"sourceURI" TEXT, | ||
"howKnown" "HowKnown", | ||
"dateObserved" TIMESTAMP(3), | ||
"digestMultibase" TEXT, | ||
"author" TEXT, | ||
"curator" TEXT, | ||
"aspect" TEXT, | ||
"score" DOUBLE PRECISION, | ||
"stars" INTEGER, | ||
"amt" DOUBLE PRECISION, | ||
"unit" TEXT, | ||
"howMeasured" TEXT, | ||
"intendedAudience" TEXT, | ||
"respondAt" TEXT, | ||
"confidence" DOUBLE PRECISION, | ||
"issuerId" TEXT, | ||
"issuerIdType" "IssuerIdType", | ||
"claimAddress" TEXT, | ||
"proof" TEXT, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"lastUpdatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
|
||
CONSTRAINT "Claim_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Edge" ADD CONSTRAINT "Edge_startNodeId_fkey" FOREIGN KEY ("startNodeId") REFERENCES "Node"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Edge" ADD CONSTRAINT "Edge_endNodeId_fkey" FOREIGN KEY ("endNodeId") REFERENCES "Node"("id") ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Edge" ADD CONSTRAINT "Edge_claimId_fkey" FOREIGN KEY ("claimId") REFERENCES "Claim"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @romeoscript no no, every time a user makes a claim it is a raw claim
Its TOTALLY OK if its the same as someone else's claim
If they are verifying a claim they would do that by clicking on it
Please do NOT try to unique claims.