Skip to content
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

10 webhook for writing #36

Merged
merged 22 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
814cee2
[Change] #3 clean up npm scripts, to have clean folder before build
Type-Style Jan 17, 2024
de76928
[Task] #10 created data types in typescript
Type-Style Jan 17, 2024
3702306
[Temp] #10 created subroute for writing, and folder structure
Type-Style Jan 17, 2024
35ede7e
[Change] #3 include to use relative paths from src folder in ts and node
Type-Style Jan 18, 2024
42231a2
[Change] Update VSCode to keep files open
Type-Style Jan 18, 2024
b3963dc
[Task] #18 setup dotenv for secret variables
Type-Style Jan 19, 2024
4b00e07
[Temp, Task] #10 Validate inputs using express-validator and custom f…
Type-Style Jan 19, 2024
2145888
Merge branch 'dev' into 10-webhook-for-writing
Type-Style Jan 19, 2024
3c5a6a2
[Task] #18 prevent parameter pollution
Type-Style Jan 19, 2024
57fbd75
[Task] #10 validating incoming parameter and logging errors
Type-Style Jan 20, 2024
a28f896
[Task] #7 add basic cache to express
Type-Style Jan 21, 2024
00cc0ba
[Changes] #7 Error Handling, to include basic custom Error Handling
Type-Style Jan 22, 2024
1c06026
[Task] #10 enhanced validation to only allow known parameters
Type-Style Jan 22, 2024
e6e508b
[Change] #35 added Jest, tests for helper functions when writing
Type-Style Jan 22, 2024
6952eed
[Task] #10 better error Handling
Type-Style Jan 23, 2024
f57f34d
[Task] #35 add tests for writing webhook validation
Type-Style Jan 23, 2024
6b898df
[TASK] #18 protect Webhook using KEY
Type-Style Jan 24, 2024
2363c06
[Fix] #35 test know import path structure now
Type-Style Jan 24, 2024
1f34521
[Task] #35 add test for protected webhook
Type-Style Jan 24, 2024
4d11814
[Task] #35 refactor build to run jest tests
Type-Style Jan 24, 2024
f84dde3
[Task] #10 switched to crypto instead of bcrypt for dependency issue
Type-Style Jan 24, 2024
4fe4c9d
[Fix] #36 PRQ Feedback
Type-Style Jan 24, 2024
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
20 changes: 14 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@
"sourceType": "module",
"project": "tsconfig.json"
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended"
],
"env": {
"node": true
"node": true,
"jest/globals": true
},
"plugins": ["jest", "@typescript-eslint"],
"rules": {
//'no-console': 'off',
//'import/prefer-default-export': 'off',
//'@typescript-eslint/no-unused-vars': 'warn',
//"no-console": "off",
//"import/prefer-default-export": "off",
//"@typescript-eslint/no-unused-vars": "warn"
"jest/no-conditional-expect": "off"
},
"ignorePatterns": ["dist"]
"ignorePatterns": ["dist", "jest.config.js"]

}
9 changes: 3 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ jobs:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build:prod --if-present
- name: Start server and test server response
- name: Start server
run: |
npm start &
sleep 5 # Wait for server to start
curl localhost:80
if [ -n "$(jobs -p)" ]; then
kill $(jobs -p) # Kill background jobs
fi
sleep 5 # Give server some time to start
- run: npm test
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"workbench.editor.enablePreview": false,
"editor.rename.enablePreview": false
}
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePathIgnorePatterns: ['<rootDir>/dist/'],
moduleNameMapper: {
'^@src/(.*)$': '<rootDir>/src/$1',
},
};
Loading