-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alder Whiteford
authored and
Alder Whiteford
committed
May 7, 2024
1 parent
42e9b70
commit 212558a
Showing
47 changed files
with
2,756 additions
and
7,418 deletions.
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,18 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react-hooks/recommended", | ||
], | ||
ignorePatterns: ["dist", ".eslintrc.cjs"], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["react-refresh"], | ||
rules: { | ||
"react-refresh/only-export-components": [ | ||
"warn", | ||
{ allowConstantExport: true }, | ||
], | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,24 @@ | ||
node_modules/ | ||
dist | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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
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 |
---|---|---|
@@ -1,51 +1,59 @@ | ||
{ | ||
"name": "@generatesac/lib", | ||
"version": "1.0.53", | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"description": "This repository holds the common types, apis, and components for frontend library used by the Student Activity Calendar.", | ||
"repository": { | ||
"url": "https://github.com/GenerateNU/sac" | ||
}, | ||
"license": "ISC", | ||
"scripts": { | ||
"test": "echo \"Woah there, we have no frontend tests as of right now. Let's just say we're passing.\" && exit 0", | ||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix", | ||
"format": "prettier --write .", | ||
"clean": "rimraf dist", | ||
"build": "yarn clean && tsc", | ||
"watch": "tsc --watch" | ||
}, | ||
"dependencies": { | ||
"@blocknote/core": "^0.12.4", | ||
"@blocknote/react": "^0.12.4", | ||
"@reduxjs/toolkit": "^2.2.3", | ||
"@tiptap/pm": "^2.3.1", | ||
"eslint": "^9.1.1", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-icons": "^5.1.0", | ||
"react-redux": "^9.1.2", | ||
"rollup-plugin-typescript2": "^0.36.0", | ||
"zod": "^3.23.4" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.24.5", | ||
"@trivago/prettier-plugin-sort-imports": "^4.3.0", | ||
"@types/react": "^18", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"prettier": "^3.2.4", | ||
"rimraf": "^5.0.5", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.3.1" | ||
}, | ||
"publishConfig": { | ||
"@generatesac:registry": "https://npm.pkg.github.com" | ||
} | ||
"name": "@generatesac/lib", | ||
"version": "0.0.1", | ||
"type": "module", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"description": "This repository holds the common types, apis, and components for frontend library used by the Student Activity Calendar.", | ||
"repository": { | ||
"url": "https://github.com/GenerateNU/sac" | ||
}, | ||
"license": "ISC", | ||
"scripts": { | ||
"dev": "vite", | ||
"format": "prettier --write .", | ||
"build": "tsc && vite build", | ||
"watch": "yarn build --watch", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@blocknote/core": "^0.12.4", | ||
"@blocknote/react": "^0.12.4", | ||
"@reduxjs/toolkit": "^2.2.3", | ||
"@tiptap/pm": "^2.3.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-icons": "^5.2.1", | ||
"react-redux": "^9.1.2", | ||
"zod": "^3.23.6" | ||
}, | ||
"devDependencies": { | ||
"@trivago/prettier-plugin-sort-imports": "^4.3.0", | ||
"@types/node": "^20.12.10", | ||
"@types/react": "^18.2.66", | ||
"@types/react-dom": "^18.2.22", | ||
"@typescript-eslint/eslint-plugin": "^7.2.0", | ||
"@typescript-eslint/parser": "^7.2.0", | ||
"@vitejs/plugin-react-swc": "^3.5.0", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.4.6", | ||
"glob": "^10.3.12", | ||
"prettier": "^3.2.5", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.2.0", | ||
"vite-plugin-dts": "^3.9.1", | ||
"vite-plugin-lib-inject-css": "^2.0.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"publishConfig": { | ||
"@generatesac:registry": "https://npm.pkg.github.com" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,69 +1,69 @@ | ||
import { LoginRequestBody, RefreshTokenRequestBody } from '../types/auth'; | ||
import { User, userSchema } from '../types/user'; | ||
import { LoginRequestBody, RefreshTokenRequestBody } from "../types/auth"; | ||
import { User, userSchema } from "../types/user"; | ||
import { | ||
EmailRequestBody, | ||
VerifyEmailRequestBody, | ||
VerifyPasswordResetTokenRequestBody | ||
} from '../types/verification'; | ||
import { baseApi } from './base'; | ||
EmailRequestBody, | ||
VerifyEmailRequestBody, | ||
VerifyPasswordResetTokenRequestBody, | ||
} from "../types/verification"; | ||
import { baseApi } from "./base"; | ||
|
||
const AUTH_API_BASE_URL = '/auth'; | ||
const AUTH_API_BASE_URL = "/auth"; | ||
|
||
export const authApi = baseApi.injectEndpoints({ | ||
endpoints: (builder) => ({ | ||
login: builder.mutation<User, LoginRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/login`, | ||
method: 'POST', | ||
body | ||
}), | ||
transformResponse: (response: User) => { | ||
return userSchema.parse(response); | ||
} | ||
}), | ||
logout: builder.mutation<void, void>({ | ||
query: () => ({ | ||
url: `${AUTH_API_BASE_URL}/logout`, | ||
method: 'POST' | ||
}) | ||
}), | ||
refresh: builder.mutation<void, RefreshTokenRequestBody>({ | ||
query: (body) => ({ | ||
url: 'refresh', | ||
method: 'POST', | ||
body | ||
}) | ||
}), | ||
forgotPassword: builder.mutation<void, EmailRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/forgot-password`, | ||
method: 'POST', | ||
body | ||
}) | ||
}), | ||
verifyPasswordResetToken: builder.mutation< | ||
void, | ||
VerifyPasswordResetTokenRequestBody | ||
>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/verify-reset`, | ||
method: 'POST', | ||
body | ||
}) | ||
}), | ||
sendCode: builder.mutation<void, EmailRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/send-code`, | ||
method: 'POST', | ||
body | ||
}) | ||
}), | ||
verifyEmail: builder.mutation<void, VerifyEmailRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/verify-email`, | ||
method: 'POST', | ||
body | ||
}) | ||
}) | ||
}) | ||
endpoints: (builder) => ({ | ||
login: builder.mutation<User, LoginRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/login`, | ||
method: "POST", | ||
body, | ||
}), | ||
transformResponse: (response: User) => { | ||
return userSchema.parse(response); | ||
}, | ||
}), | ||
logout: builder.mutation<void, void>({ | ||
query: () => ({ | ||
url: `${AUTH_API_BASE_URL}/logout`, | ||
method: "POST", | ||
}), | ||
}), | ||
refresh: builder.mutation<void, RefreshTokenRequestBody>({ | ||
query: (body) => ({ | ||
url: "refresh", | ||
method: "POST", | ||
body, | ||
}), | ||
}), | ||
forgotPassword: builder.mutation<void, EmailRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/forgot-password`, | ||
method: "POST", | ||
body, | ||
}), | ||
}), | ||
verifyPasswordResetToken: builder.mutation< | ||
void, | ||
VerifyPasswordResetTokenRequestBody | ||
>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/verify-reset`, | ||
method: "POST", | ||
body, | ||
}), | ||
}), | ||
sendCode: builder.mutation<void, EmailRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/send-code`, | ||
method: "POST", | ||
body, | ||
}), | ||
}), | ||
verifyEmail: builder.mutation<void, VerifyEmailRequestBody>({ | ||
query: (body) => ({ | ||
url: `${AUTH_API_BASE_URL}/verify-email`, | ||
method: "POST", | ||
body, | ||
}), | ||
}), | ||
}), | ||
}); |
Oops, something went wrong.