Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Initial Setup #1

Merged
merged 267 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
267 commits
Select commit Hold shift + click to select a range
0bdd7bf
Added file upload (picture & banner)
Juknum May 4, 2023
0821a77
Added utilities for images
Juknum May 4, 2023
97b3777
remove refresh token and expanded the jwt token to 1 week
Juknum May 4, 2023
0d2c269
lint
Juknum May 4, 2023
0456d0b
remove refresh token and expanded the jwt token to 1 week
Juknum May 4, 2023
63be899
Added subscriber account number & fixed issues
Juknum May 5, 2023
cc05d0e
Fix password missing in mikro orm config
Nchrd May 5, 2023
d88d94d
Fixes
Juknum May 9, 2023
15d6783
Merge branch 'setup-mikrorm' of https://github.com/ae-utbm/api into s…
Juknum May 9, 2023
4e3387a
Hide dist & temp folders & update deps
Juknum May 11, 2023
23e5645
Update perms.guard.ts
Juknum May 11, 2023
c796df9
Added missing fields & promotion-picture entity
Juknum May 12, 2023
5b54fb0
Allow all origin
Juknum May 12, 2023
fc6a9b7
Use REST endpoints for files
Juknum May 16, 2023
7f3ff5c
Fix date verification on user picture change
Juknum May 16, 2023
11a7305
Added endpoint to delete user banner
Juknum May 16, 2023
166dc0f
Added retry mechanism on file request
Juknum May 18, 2023
39655ab
Added missing fields & fix issue when picture/banner does not exist
Juknum May 22, 2023
253dd68
Added endpoint to delete user picture
Juknum May 22, 2023
ae66e75
Rewrite the db seeder
Juknum May 22, 2023
3324a8d
Fix user promotion to user the number property instead of its id
Juknum May 22, 2023
d1497b6
Made two endpoint to filter or not user info
Juknum May 22, 2023
2ac3c05
Removed UserGroupedObject & improved visibility checks
Juknum May 22, 2023
2d69071
Merged config for pictures/banners directory
Juknum May 22, 2023
d9600eb
Init the promotion (if there is one)
Juknum May 22, 2023
a93325d
Throw when trying to delete a non existent pic/banner
Juknum May 22, 2023
af31153
Added endpoint for promotion logos
Juknum May 22, 2023
b600c4c
Added swagger decorators to upload file
Juknum May 22, 2023
d0d6b9b
Update users.service.ts
Juknum May 22, 2023
d38f381
Abstracted guards to make them work with REST endpoints
Juknum May 23, 2023
755383f
Remove forgotten console log
Juknum Jun 1, 2023
7377e5a
Added possibility to retrieve user fields visibility
Juknum Jun 1, 2023
3196e0d
Added a method to get the latest promotion (by its number)
Juknum Jun 1, 2023
e35083f
Moved from GraphQL + REST (files) to full REST
Juknum Jun 19, 2023
846b50f
Create .gitmodules on typings repo
Juknum Jun 19, 2023
58d7e47
Updated promotions endpoints
Juknum Jun 27, 2023
c0a02bb
Added AE logo as icon for swagger
Juknum Jun 27, 2023
3c28e37
Fixed CSS for file input in swagger
Juknum Jun 27, 2023
12a10f1
Clear logs older than 2 months each day at 7:00 AM
Juknum Jun 27, 2023
814e318
Hide filepath value from requests
Juknum Jun 27, 2023
970ab1a
Added description to promotions endpoints
Juknum Jun 27, 2023
2565ad0
Added minimum values for ids (swagger)
Juknum Jun 27, 2023
4de4a7e
Added Cron to create a new promotion each year on the 15th of July
Juknum Jun 27, 2023
b7ca1c5
Removed id param from url (as it's in the body)
Juknum Jun 27, 2023
d019b23
Updated deps
Juknum Jul 3, 2023
e8d3b55
Fixed Logging Interceptor
Juknum Jul 3, 2023
8eda6cc
Added descriptions, fixes & lot of stuff
Juknum Jul 3, 2023
a5fe5f3
Send confirmation email on account creation
Juknum Jul 3, 2023
1d41d3d
Added Swagger documentation to users/ endpoints
Juknum Jul 3, 2023
64fcb28
Simplified permissions
Juknum Jul 3, 2023
5e6de4d
Added non-verified user detector
Juknum Jul 3, 2023
725790c
Started writting tests
Juknum Jul 4, 2023
7955074
Should fix coverage not being put in the workflow result
Juknum Jul 5, 2023
78edffc
Fix JSON indentation
Juknum Jul 5, 2023
7155a73
Added translations to templates
Juknum Jul 5, 2023
65e39b9
Moved swagger files
Juknum Jul 5, 2023
78872dd
Better tests
Juknum Jul 6, 2023
f18dfb0
Fixed lock file
Juknum Jul 6, 2023
d81456c
Fixed database initialization when testing
Juknum Jul 7, 2023
f5b5d39
Improved workflow
Juknum Jul 7, 2023
d885c50
Started tests for logs endpoints & added translations for errors
Juknum Jul 7, 2023
f914a4c
Improved linting workflow
Juknum Jul 7, 2023
1fb7885
Specified express as dependency (jest complain)
Juknum Jul 7, 2023
150d368
Removed duplicated Jest config
Juknum Jul 7, 2023
f221987
Enforced `GuardPermissions` to have at least 1 permission
Juknum Jul 7, 2023
d0807cf
Safer way to check bearer token
Juknum Jul 7, 2023
b6bcda5
Improved logs tests (on GET endpoint)
Juknum Jul 7, 2023
d6dd826
Added `eslint-plugin-import` to sort imports statements
Juknum Jul 7, 2023
1415070
Fixed lock file
Juknum Jul 7, 2023
b300bf1
Should fix workflow & improved eslint again
Juknum Jul 7, 2023
e92c625
Should install postgres before doing tests
Juknum Jul 7, 2023
b3c096f
Update .env.example
Juknum Jul 7, 2023
1b768fb
Might help Jest with the workflow
Juknum Jul 7, 2023
b5bf6e2
Disabled automock for Jest
Juknum Jul 7, 2023
056f201
uhh
Juknum Jul 7, 2023
3e14089
Updated deps
Juknum Jul 8, 2023
2e7e2e9
Trying to fix Jest (again)
Juknum Jul 8, 2023
10e537e
Update setupFilesAfterEnv.ts
Juknum Jul 8, 2023
e5384c9
Hmm
Juknum Jul 8, 2023
04770b4
Trying to add cache to see if solves anything
Juknum Jul 8, 2023
4c79743
Removed cache directory (not working)
Juknum Jul 8, 2023
e69569f
Jest ?
Juknum Jul 10, 2023
68fc9a8
Clean up
Juknum Jul 10, 2023
c5d9faf
Fix Jest global setup breaking everything 🤞🏻
Juknum Jul 11, 2023
a610017
Added missing env variables
Juknum Jul 11, 2023
09c2aa6
Fix `ENOENT: no such file or directory, open '/home/runner/work/api/s…
Juknum Jul 11, 2023
0ba23c4
Fix `connect ECONNREFUSED 127.0.0.1:465`
Juknum Jul 11, 2023
39ebf30
Added more tests
Juknum Jul 28, 2023
46eb9ac
Fix database seeding for tests
Juknum Jul 28, 2023
5dd8fde
Ignore MikroORM config file from coverage
Juknum Jul 28, 2023
b87643d
Added more tests & started working on roles tests
Juknum Jul 28, 2023
880b19e
Improved tests & added more of them
Juknum Jul 29, 2023
9d2607c
Make i18n types compatible between oses
Juknum Aug 1, 2023
6d670ae
Added specific errors when JWT token is invalid/expired
Juknum Aug 1, 2023
456efff
Merged isBannerAspectRatio and isSquare
Juknum Aug 1, 2023
cf98b86
Simplified methods
Juknum Aug 1, 2023
659fb38
Added more tests
Juknum Aug 1, 2023
7a03cb7
Fixed config
Juknum Aug 5, 2023
eefa38f
Removed duplicated endpoints
Juknum Aug 5, 2023
8ac9e9e
Fixed database creation scripts
TheoDurr Aug 7, 2023
9406221
Fixed linting
TheoDurr Aug 7, 2023
422f2ad
Improved utils method to get readstream of a file
Juknum Aug 7, 2023
a0ee2bd
Merge branch 'setup-mikrorm' of https://github.com/ae-utbm/api into s…
Juknum Aug 7, 2023
85ffff1
Forgot to change the method name
Juknum Aug 7, 2023
c62323b
Fix lint
Juknum Aug 7, 2023
8cedf53
Updated types names
Juknum Aug 7, 2023
a9e7876
Added visibility groups for files
Juknum Aug 7, 2023
842d56a
Added password strength verification
Juknum Aug 7, 2023
f09d0cf
Removed API prefix
TheoDurr Aug 8, 2023
65178c0
Removed prefix in tests too
Juknum Aug 8, 2023
149a3a9
Added getter to File entity
Juknum Aug 8, 2023
56327df
Should fix `i18n.d.ts` file
Juknum Aug 8, 2023
a3f290b
Removed graphql extension recommandation
TheoDurr Aug 8, 2023
9aa7aca
Fixed typo in birthday
TheoDurr Aug 8, 2023
c5b8f83
Continued the typo fixing
TheoDurr Aug 8, 2023
aba0985
Properly fix variable rename
Juknum Aug 9, 2023
2ae448b
Add subscriber visibility group to the seeder
Juknum Aug 16, 2023
1fa355a
Add errors messages for files
Juknum Aug 16, 2023
ed14657
Make the description mandatory and users+files optional in visibility…
Juknum Aug 16, 2023
953e52d
Implement Inheritance Mapping for files entities
Juknum Aug 16, 2023
b2d5e9f
Rename table name of `logs` to `users_logs`
Juknum Aug 16, 2023
72c6ac6
Fix modules
Juknum Aug 16, 2023
f8ebfe1
Remove migrations (unused)
Juknum Aug 16, 2023
4e5eae8
Fix tests
Juknum Aug 16, 2023
3ba9dca
Rename methods for clarity
Juknum Aug 16, 2023
796c799
Move data validation into controllers
Juknum Aug 17, 2023
348552a
Add more data validation to controller
Juknum Aug 17, 2023
59e15d3
Split user controller into 2 controllers
Juknum Aug 17, 2023
e13396e
Improve error message
Juknum Aug 17, 2023
23b41d8
Fixes and update tests
Juknum Aug 17, 2023
843e68b
Unify & Improve readability of tests (e2e/unit)
Juknum Aug 17, 2023
b905c25
Use populate option instead of using .init() everywhere
Juknum Aug 20, 2023
0e55d07
Add `/roles/:role_id`
Juknum Aug 20, 2023
51cdf12
Make `/roles/:role_id/users/:user_id` -> `/roles/:role_id/users` wher…
Juknum Aug 20, 2023
cf3ac94
Update tests
Juknum Aug 20, 2023
b416a2b
Fix typo
Juknum Aug 20, 2023
85912c8
Add examples for Swagger
Juknum Aug 20, 2023
1aa0768
Fix deeply nested properties
Juknum Aug 20, 2023
2e5848a
"Deactivate" subscription part until next PR
Juknum Aug 20, 2023
b32720d
Fix tests
Juknum Aug 20, 2023
9b1c3f4
Add tests for roles endpoints
Juknum Aug 23, 2023
c66db66
Update controller tag for users files endpoints
Juknum Aug 24, 2023
aee50f0
Make the nickname always public
Juknum Aug 24, 2023
37882b9
Specify user in the id field for clarity
Juknum Aug 24, 2023
72ce051
Fix last seen field not being updated
Juknum Aug 24, 2023
8a6489f
Update user endpoint to retrieve user data
Juknum Aug 24, 2023
3a92c1a
Improve swagger doc for user entity
Juknum Aug 24, 2023
ca127aa
Disable cursus & specialty for now (NYI)
Juknum Aug 24, 2023
9af9160
Add permissions endpoints on user
Juknum Aug 24, 2023
646a89d
Improve methods to make less request on the database
Juknum Aug 24, 2023
5541f54
Fix tests
Juknum Aug 24, 2023
1a07f1e
Create dependabot.yml
Juknum Aug 25, 2023
b40b2ed
Make `permissions/:user_id` self guard & perm guard
Juknum Aug 25, 2023
f895adc
Add `promotions/latest` back & `promotions/current`
Juknum Aug 25, 2023
d4bb290
Fix user-controlled bypass of security check
Juknum Aug 25, 2023
f098320
Fix uncontrolled data used in path expression
Juknum Aug 25, 2023
b70676a
Fix inefficient regular expression
Juknum Aug 25, 2023
e48b662
Fix insecure randomness
Juknum Aug 25, 2023
e6c5fbd
Update tests
Juknum Aug 25, 2023
100fc60
Fix user-controlled bypass of security check
Juknum Aug 25, 2023
0cccb9d
Fix uncontrolled data used in path expression
Juknum Aug 25, 2023
9ec2d6e
Fix insecure randomness
Juknum Aug 25, 2023
2a323ab
Update tests
Juknum Aug 25, 2023
719d313
Fix inefficient regular expression
Juknum Aug 25, 2023
cc96784
Update auth.e2e-spec.ts
Juknum Aug 25, 2023
a3f1805
Merge branch 'setup-mikrorm' of https://github.com/ae-utbm/api into s…
Juknum Aug 25, 2023
bc418a6
Add links to YML/JSON swagger generated data
Juknum Aug 28, 2023
04a720b
Add better MimeType check in files services
Juknum Aug 28, 2023
129752d
Fix MimeType check to use a non ESM version of it
Juknum Aug 28, 2023
1c559be
Add fake verification for viruses
Juknum Aug 28, 2023
3aab4f1
Rename method
Juknum Aug 28, 2023
1fd41bf
Update password.ts
Juknum Aug 28, 2023
4f4f96b
Update README.md
Juknum Aug 28, 2023
4aa64b8
Improve consistency of randomInt function
Juknum Aug 28, 2023
975a855
Remove unused function getImageFileExtension (replaced by file-type p…
Juknum Aug 28, 2023
5d0b6fe
Fix modulus usage on randomInt method
Juknum Aug 29, 2023
cb0b409
Move hardcoded settings to config
Juknum Aug 29, 2023
cf59706
Add missing tests for /auth endpoint
Juknum Aug 29, 2023
04c202b
Update update.yml
Juknum Aug 29, 2023
e45d1c6
Make a service for emails rather than a simple file
Juknum Aug 30, 2023
57701cd
Move verifyJWT into the AuthService
Juknum Aug 30, 2023
0a3c14e
Move Errors/Success namespaces into a service
Juknum Aug 30, 2023
3ef613c
Update libs
Juknum Aug 31, 2023
febb257
Add tests
Juknum Aug 31, 2023
9edeff9
Update deps
Juknum Sep 11, 2023
e0084e6
Update settings.json
Juknum Sep 11, 2023
5567b8a
Use zod to parse incoming data instead of self-made function
Juknum Sep 12, 2023
467353c
Remove submodule
Juknum Sep 12, 2023
c902769
Add submodule again (renamed the submodule)
Juknum Sep 12, 2023
ff07832
Adapt module importation (submodule changes)
Juknum Sep 12, 2023
7f2940a
Fix linting
Juknum Sep 12, 2023
a3cb64e
Refactor of `UserService.findOne`
Juknum Sep 18, 2023
2cddf81
Moved `pnpm format` into `pnpm lint`
Juknum Sep 19, 2023
5e2c876
Update README.md
Juknum Sep 19, 2023
44036a7
Update CODE_OF_CONDUCT.md
Juknum Sep 19, 2023
b56dcd2
Made `utils/image.ts` its own service
Juknum Sep 19, 2023
3f331e3
Remove getter from File entity (can't be used with async stuff)
Juknum Sep 19, 2023
a159504
Move array, object & randomInt method to submodule
Juknum Sep 19, 2023
4ab005d
Add the submodule as a package dependency
Juknum Sep 19, 2023
6b6ee38
Update dependencies
Juknum Sep 19, 2023
a9ee28f
Add status code to MessageResponseDTO
Juknum Sep 19, 2023
2972ef3
Return MessageResponseDTO instead of {} when delete user
Juknum Sep 19, 2023
0bd4055
Allow only deletion of your own account
Juknum Sep 19, 2023
d723047
Fix logging interceptor when the user is being deleted
Juknum Sep 19, 2023
e59bf6b
Tests for `(DELET) /users/:id` endpoint
Juknum Sep 19, 2023
9370932
Role does not expires but its user assignation does
Juknum Sep 21, 2023
f057567
Make `(POST) /users` and `(PATCH) /users` now takes array as body
Juknum Sep 22, 2023
0930cc7
Add CodeQL code analysis workflow
Juknum Sep 23, 2023
dda392b
Add clean script
Juknum Oct 1, 2023
2798d23
Use CommonJS file extension
Juknum Oct 1, 2023
2b7c3f8
Update deps
Juknum Oct 1, 2023
1a99f8c
More tests
Juknum Oct 1, 2023
0540699
Add optional error message to validate()
Juknum Oct 3, 2023
98742ec
Improve typing of filtered user data
Juknum Oct 3, 2023
b123445
Add missing route to edit user visibility settings
Juknum Oct 3, 2023
eb2c45e
Use a better error message if only 1 invalid id
Juknum Oct 5, 2023
615edeb
Fix typo & imprecisions
Juknum Oct 5, 2023
b536014
Fix Role entity & `/users/:id/roles` response
Juknum Oct 5, 2023
7ede4d5
Sort emails on AreAlreadyUsed error
Juknum Oct 5, 2023
6269e89
Add verified field so email_verified can be used multiple times witho…
Juknum Oct 5, 2023
a0b56a1
Update users-data.e2e-spec.ts
Juknum Oct 5, 2023
dc704d6
Prettier
Juknum Oct 5, 2023
e80d975
Update clean.mjs
Juknum Oct 11, 2023
4c5adf1
Update deps
Juknum Oct 11, 2023
7ff9013
Split user files service into its own service
Juknum Oct 11, 2023
7d65d6e
Simplified config file
Juknum Oct 11, 2023
d7cb79a
Fork the entity manager for each test suite
Juknum Oct 11, 2023
e566cdc
Blacklist `coverage` dir for comments anchor extension
Juknum Oct 12, 2023
d089a8b
Fix process envs vars not being used in config
Juknum Oct 12, 2023
33d59e1
Replace subscriber role with a boolean (to be replaced with a collect…
Juknum Oct 12, 2023
1ff4230
Remove non redirect endpoint for email verification
Juknum Oct 12, 2023
1e2827f
Removed roles are now revoked instead of simply being removed
Juknum Oct 12, 2023
c22f0c6
Update .eslintrc.cjs
Juknum Oct 16, 2023
534d566
Add owner field to files & Add method to check if user has permssion …
Juknum Oct 17, 2023
d1e0b98
Update deps
Juknum Oct 17, 2023
7079a96
Add more tests
Juknum Oct 17, 2023
a09330b
Use Node 18 LTS to avoid issue with latest Node version (20) & supert…
Juknum Oct 17, 2023
fc328aa
Improve Jest tests reliability :eyes:
Juknum Oct 17, 2023
d097b9e
Try to fix race condition with supertest.attach()
Juknum Oct 17, 2023
e9ff301
Finished tests
Juknum Oct 18, 2023
c0537bb
Split seeder into two seeder (one global & one for tests)
Juknum Oct 22, 2023
8733192
Add descriptions to workflows
Juknum Oct 26, 2023
48260b0
Remove unused command
Juknum Oct 26, 2023
6572eab
Removed VSCode settings file
Juknum Oct 26, 2023
1df3bb8
Add/Fix JSDoc
Juknum Oct 26, 2023
e47180a
Try to fix GitHub secrets
Juknum Oct 26, 2023
cf24e46
Fix (revert) secrets usage in matrix workflow
Juknum Oct 26, 2023
5d5592b
Update clean.mjs
Juknum Oct 26, 2023
3c82d1b
Revamped README & add comments to .env.example
Juknum Oct 26, 2023
8d6c3a1
Remove redirect to email verification
Juknum Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ root = true

[*]
charset = utf-8
indent_style = space
indent_style = tab
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false

[*.yml]
indent_style = space

[*.json]
indent_style = space
46 changes: 46 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
API_PORT = 5000
# Allowed URLs for CORS 'Access-Control-Allow-Origin' header
CORS_ORIGIN_WHITELIST = 'https://ae.utbm.fr;'
DEBUG = true

# Postgres configuration
# You can avoid user password when developing on local machine
POSTGRES_DB = 'ae_test'
POSTGRES_HOST = '127.0.0.1'
POSTGRES_PORT = '5432'
POSTGRES_USER = 'postgres'
POSTGRES_PASSWORD = 'postgres'

# JWT configuration
# Note: changing the key will invalidate all existing tokens
JWT_KEY = 'secret_jwt_key'
JWT_EXPIRATION_TIME = 604800000 # 1 week in milliseconds

# Base directory for generic uploaded files
FILES_BASE_DIR = './public'

# Users configuration
# Delay before allowing the user to update its profile picture
USERS_PICTURES_DELAY = 604800000 # 1 week in milliseconds
USERS_PICTURES_PATH = './public/users/pictures'
USERS_BANNERS_PATH = './public/users/banners'
USERS_PATH = './public/users'

# Promotion configuration
PROMOTION_LOGO_PATH = './public/promotions'

# Emailing configuration
# Note: use your own UTBM email account when developing on local machine
EMAIL_HOST = 'smtp.domain.com'
EMAIL_PORT = 465
EMAIL_SECURE = true
EMAIL_AUTH_USER = '[email protected]'
EMAIL_AUTH_PASS = 'azertyuiop'
EMAIL_ENABLED = true

# Whitelisted emails/host can be used to register
WHITELISTED_HOSTS =
WHITELISTED_EMAILS = '[email protected];[email protected]'
# Blacklisted emails/host cannot be used to register
BLACKLISTED_HOSTS = '@utbm.fr;'
BLACKLISTED_EMAILS =
64 changes: 64 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'import'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: [
'.eslintrc.cjs',
'dist',
'node_modules',
'coverage',
'src/database/migrations',
'src/exported/api/@types/i18n.d.ts',
],
settings: {
'import/resolver': {
typescript: true,
node: true,
},
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-namespace': 'off',
'no-console': 'warn',
'prettier/prettier': ['error', { endOfLine: 'lf' }],
'import/export': 'off',
'import/order': [
'error',
{
'newlines-between': 'always',
groups: ['type', 'builtin', 'external', 'internal', ['parent', 'sibling', 'index']],
pathGroups: [
{
pattern: '@(database|modules|templates|utils|src)/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
};
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

22 changes: 11 additions & 11 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Code de conduite - Sith 4
# Code de conduite - API

## Nos engagements

Expand All @@ -8,19 +8,19 @@ Dans le but de favoriser un environnement ouvert et accueillant, nous, en tant q

Les exemples de comportements qui contribuent à un environnement positif pour notre communauté :

* Faire preuve d'empathie et de gentillesse envers les autres.
* Respecter les opinions, les points de vue et les expériences différentes.
* Émettre et accepter les commentaires constructifs
* Accepter la responsabilité et s'excuser auprès des personnes affectées par nos erreurs, et apprendre de l'expérience
* Se concentrer sur ce qui est le mieux non seulement pour nous en tant qu'individus, mais pour la communauté dans son ensemble
- Faire preuve d'empathie et de gentillesse envers les autres.
- Respecter les opinions, les points de vue et les expériences différentes.
- Émettre et accepter les commentaires constructifs
- Accepter la responsabilité et s'excuser auprès des personnes affectées par nos erreurs, et apprendre de l'expérience
- Se concentrer sur ce qui est le mieux non seulement pour nous en tant qu'individus, mais pour la communauté dans son ensemble

Voici quelques exemples de comportements inacceptables :

* l'utilisation d'un langage ou d'images à caractère sexuel, et les attentions ou avances sexuelles.
* le trollage, les commentaires insultants ou désobligeants et les attaques personnelles ou politiques
* le harcèlement public ou privé
* la publication d'informations privées d'autrui, telles qu'une adresse physique ou électronique, sans leur permission explicite.
* toute autre conduite qui pourrait raisonnablement être considérée comme inappropriée dans un cadre professionnel.
- l'utilisation d'un langage ou d'images à caractère sexuel, et les attentions ou avances sexuelles.
- le trollage, les commentaires insultants ou désobligeants et les attaques personnelles ou politiques
- le harcèlement public ou privé
- la publication d'informations privées d'autrui, telles qu'une adresse physique ou électronique, sans leur permission explicite.
- toute autre conduite qui pourrait raisonnablement être considérée comme inappropriée dans un cadre professionnel.

## Nos responsabilités

Expand Down
10 changes: 7 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- omit in toc -->
# Contribuer au Sith 4

# Contribuer à l'API

Premièrement, merci de prendre le temps de contribuer ! ❤️

Expand All @@ -13,6 +14,7 @@ Tout type de contributions sont encouragée et valorisée. Veuillez consulter la
> - Mentioner le projet lors de réunion locales et parler-en à vos amis/collègues

<!-- omit in toc -->

## Table des matières

- [Code de conduite](#code-de-conduite)
Expand Down Expand Up @@ -49,13 +51,14 @@ Nous nous occuperons alors du problème dans les plus brefs délais.
### Rapporter des Bugs

<!-- omit in toc -->

#### Avant de rapporter un bug

Une bonne issue ne doit pas laisser les autres vous courir après afin d'obtenir davantage d'information. Ainsi, nous vous demandons d'enquêter attentivement, de collecter des informations et décrire le problème en détail dans votre rapport. Veuillez compléter les étapes suivantes à l'avance pour nous aider à résoudre le bug potentiel le plus rapidement possible.

- Assurez-vous d'utiliser la dernière version.
- Vérifiez si votre bug n'est pas en fait une erreur de votre côté, par exemple en utilisant des composants d'environnement/incompatibles (assurez-vous d'avoir lu la [documentation](https://github.com/ae-utbm/api/wiki).
Si vous recherchez de l'aide, vous pouvez consulter [cette section](#jai-une-question)).
Si vous recherchez de l'aide, vous pouvez consulter [cette section](#jai-une-question)).
- Pour voir si d'autres utilisateurs ont expérimentés (et potentiellement déjà résolu) le même problème que vous rencontrez, vérifiez si il n'y a pas déjà un rapport de bug existant pour votre bug ou erreur dans le [bug tracker](https://github.com/ae-utbm/sith4/issues?q=is%3Aissue+is%3Aclosed)
- Assurez-vous de rechercher sur internet (y compris Stack Overflow) pour voir si d'autres utilisateurs hors de la communauté GitHub ont discuté du problème.
- Collectez des informations sur le bug :
Expand All @@ -73,7 +76,7 @@ Nous utilisons les issues GitHub pour suivre les bugs et les erreurs. Si vous re

- Ouvrez une [issue](https://github.com/ae-utbm/sith4/issues/new). (Comme nous ne pouvons pas être sûrs à ce stade de savoir si c'est un bug ou non, nous vous demandons de ne pas parler de bug et de ne pas ajouter de tag sur l'issue.)
- Expliquer le comportement que vous attendez et le comportement réel.
- Veuillez fournir autant de contexte que possible et décrire les *étapes de reproduction* que quelqu'un d'autre peut suivre pour recréer le problème sur son propre ordinateur. Cela inclut généralement votre code. Pour de bons rapports de bugs, vous devez isoler le problème et créer un cas de test réduit.
- Veuillez fournir autant de contexte que possible et décrire les _étapes de reproduction_ que quelqu'un d'autre peut suivre pour recréer le problème sur son propre ordinateur. Cela inclut généralement votre code. Pour de bons rapports de bugs, vous devez isoler le problème et créer un cas de test réduit.
- Si vous en avez la possibilité, incluez des captures d'écran et des vidéos qui montrent le problème.

Une fois que c'est fait :
Expand All @@ -89,6 +92,7 @@ Cette section vous guide
Cette section vous guide tout au long de la soumission d'une suggestion d'amélioration pour le Sith 4, **incluant des fonctionnalités entièrement nouvelles et des améliorations mineures des fonctionnalités existantes**. Suivre ces directives aidera les mainteneurs et la communauté à comprendre votre suggestion et à trouver des suggestions connexes.

<!-- omit in toc -->

#### Avant de soumettre une amélioration

- Assurez-vous que vous utilisez la dernière version.
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 🐛 Rapport de bug
description: Remplissez un rapport de bug
title: "[BUG] "
labels: ["type: bug", "status: triage"]
assignees: "developers-v4"
title: '[BUG] '
labels: ['type: bug', 'status: triage']
assignees: 'developers-v4'
body:
- type: markdown
attributes:
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_report.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: ✨ Suggestion d'amélioration
description: Suggérez une idée pour le projet
title: "[FEATURE] "
labels: ["type: feature", "status: triage"]
assignees: "developers-v4"
title: '[FEATURE] '
labels: ['type: feature', 'status: triage']
assignees: 'developers-v4'
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -37,4 +37,3 @@ body:
options:
- label: "J'accepte de suivre le code de conduite de ce projet"
required: true

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'weekly'
36 changes: 36 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Code QL Analysis

# Description:
# - This workflow runs CodeQL analysis on the codebase.

on:
workflow_call:
workflow_dispatch:

jobs:
codeql:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Init CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript # typescript is recognized as javascript
queries: +security-extended,security-and-quality

- name: Build CodeQL Database
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:javascript'
32 changes: 32 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Code Linting

# Description:
# - This workflow runs linting on the codebase, fails if linting does not pass.

on:
workflow_call:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Lint Typescript
run: pnpm workflow:lint
Loading