Skip to content

Commit

Permalink
Merge branch 'main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 committed Jul 27, 2024
2 parents 252fcd0 + f1de7ad commit f62a58e
Show file tree
Hide file tree
Showing 32 changed files with 8,823 additions and 6,409 deletions.
8 changes: 4 additions & 4 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ runs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
node-version: "16.x"
registry-url: "https://registry.npmjs.org"

- name: Configure git
run: |
Expand All @@ -23,7 +23,7 @@ runs:
shell: bash

- name: Install dependencies
run: npm install -g pnpm@8 && pnpm install --production --ignore-scripts
run: npm install -g pnpm@9.6.0 && pnpm install --production --ignore-scripts
shell: bash

- name: Create .npmrc
Expand Down Expand Up @@ -62,4 +62,4 @@ runs:
git config pull.ff true
git add . && git commit -m "CI: @sliit-foss/automatic-versioning - sync release" || true
git pull --rebase && git push origin
shell: bash
shell: bash
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"prettier": "3.2.5"
},
"engines": {
"node": ">=14.0.0"
"node": ">=14.0.0",
"pnpm": ">=7.5.0"
},
"packageManager": "pnpm@7.5.0"
"packageManager": "pnpm@9.6.0"
}
2 changes: 1 addition & 1 deletion packages/actions-exec-wrapper/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/actions-exec-wrapper/src/index.js":"1"},{"size":454,"mtime":1710050796195,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"i5x69r","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/actions-exec-wrapper/src/index.js",[],[]]
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/actions-exec-wrapper/src/index.js":"1"},{"size":454,"mtime":1722085259170,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"w0p8s7","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/actions-exec-wrapper/src/index.js",[],[]]
2 changes: 1 addition & 1 deletion packages/clusterizer/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/clusterizer/src/index.js":"1"},{"size":1030,"mtime":1710050796198,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1o82yp5","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/clusterizer/src/index.js",[],[]]
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/clusterizer/src/index.js":"1"},{"size":1030,"mtime":1722085259172,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1nxc21x","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/clusterizer/src/index.js",[],[]]
2 changes: 1 addition & 1 deletion packages/express-http-context/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/browser.js":"1","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/index.js":"2"},{"size":478,"mtime":1710050796199,"results":"3","hashOfConfig":"4"},{"size":1164,"mtime":1710050796199,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","suppressedMessages":"8","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"fn3vkb",{"filePath":"9","messages":"10","suppressedMessages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/browser.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/index.js",[],[]]
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/browser.js":"1","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/index.js":"2"},{"size":478,"mtime":1722085259173,"results":"3","hashOfConfig":"4"},{"size":1164,"mtime":1722085259173,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","suppressedMessages":"8","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1ifmx47",{"filePath":"9","messages":"10","suppressedMessages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/browser.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/express-http-context/src/index.js",[],[]]
2 changes: 1 addition & 1 deletion packages/firebase/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/index.js":"1","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/firestore.js":"2","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/realtimeDB.js":"3"},{"size":108,"mtime":1710050796199,"results":"4","hashOfConfig":"5"},{"size":3092,"mtime":1710050796200,"results":"6","hashOfConfig":"5"},{"size":828,"mtime":1710050796200,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","suppressedMessages":"10","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1tlcbs0",{"filePath":"11","messages":"12","suppressedMessages":"13","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/index.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/firestore.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/realtimeDB.js",[],["17","18","19","20","21"],{"ruleId":"22","severity":2,"message":"23","line":31,"column":31,"nodeType":"24","messageId":"25","endLine":31,"endColumn":35,"suppressions":"26"},{"ruleId":"22","severity":2,"message":"27","line":31,"column":37,"nodeType":"24","messageId":"25","endLine":31,"endColumn":44,"suppressions":"28"},{"ruleId":"22","severity":2,"message":"23","line":33,"column":32,"nodeType":"24","messageId":"25","endLine":33,"endColumn":36,"suppressions":"29"},{"ruleId":"22","severity":2,"message":"27","line":33,"column":38,"nodeType":"24","messageId":"25","endLine":33,"endColumn":45,"suppressions":"30"},{"ruleId":"22","severity":2,"message":"23","line":35,"column":32,"nodeType":"24","messageId":"25","endLine":35,"endColumn":36,"suppressions":"31"},"no-unused-vars","'path' is defined but never used.","Identifier","unusedVar",["32"],"'payload' is defined but never used.",["33"],["34"],["35"],["36"],{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},"directive",""]
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/index.js":"1","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/firestore.js":"2","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/realtimeDB.js":"3"},{"size":108,"mtime":1722085259174,"results":"4","hashOfConfig":"5"},{"size":3092,"mtime":1722085259174,"results":"6","hashOfConfig":"5"},{"size":828,"mtime":1722085259174,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","suppressedMessages":"10","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"18fpw3u",{"filePath":"11","messages":"12","suppressedMessages":"13","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/index.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/firestore.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/firebase/src/libs/realtimeDB.js",[],["17","18","19","20","21"],{"ruleId":"22","severity":2,"message":"23","line":31,"column":31,"nodeType":"24","messageId":"25","endLine":31,"endColumn":35,"suppressions":"26"},{"ruleId":"22","severity":2,"message":"27","line":31,"column":37,"nodeType":"24","messageId":"25","endLine":31,"endColumn":44,"suppressions":"28"},{"ruleId":"22","severity":2,"message":"23","line":33,"column":32,"nodeType":"24","messageId":"25","endLine":33,"endColumn":36,"suppressions":"29"},{"ruleId":"22","severity":2,"message":"27","line":33,"column":38,"nodeType":"24","messageId":"25","endLine":33,"endColumn":45,"suppressions":"30"},{"ruleId":"22","severity":2,"message":"23","line":35,"column":32,"nodeType":"24","messageId":"25","endLine":35,"endColumn":36,"suppressions":"31"},"no-unused-vars","'path' is defined but never used.","Identifier","unusedVar",["32"],"'payload' is defined but never used.",["33"],["34"],["35"],["36"],{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},{"kind":"37","justification":"38"},"directive",""]
2 changes: 1 addition & 1 deletion packages/functions/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/async.js":"1","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/bind.js":"2","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/cached.js":"3","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/index.js":"4","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/traced.js":"5","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/utils/index.js":"6"},{"size":1470,"mtime":1719080935185,"results":"7","hashOfConfig":"8"},{"size":174,"mtime":1710050796201,"results":"9","hashOfConfig":"8"},{"size":354,"mtime":1710050796201,"results":"10","hashOfConfig":"8"},{"size":101,"mtime":1710050796201,"results":"11","hashOfConfig":"8"},{"size":2326,"mtime":1719080935185,"results":"12","hashOfConfig":"8"},{"size":531,"mtime":1710050796201,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"vo21ql",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/async.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/bind.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/cached.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/index.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/traced.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/utils/index.js",[],[]]
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/async.js":"1","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/bind.js":"2","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/cached.js":"3","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/index.js":"4","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/traced.js":"5","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/utils/index.js":"6"},{"size":1470,"mtime":1722085259175,"results":"7","hashOfConfig":"8"},{"size":174,"mtime":1722085259175,"results":"9","hashOfConfig":"8"},{"size":354,"mtime":1722085259175,"results":"10","hashOfConfig":"8"},{"size":101,"mtime":1722085259175,"results":"11","hashOfConfig":"8"},{"size":2326,"mtime":1722085259175,"results":"12","hashOfConfig":"8"},{"size":531,"mtime":1722085259175,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","suppressedMessages":"16","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"146k12k",{"filePath":"17","messages":"18","suppressedMessages":"19","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","suppressedMessages":"22","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","suppressedMessages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","suppressedMessages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","suppressedMessages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/async.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/bind.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/cached.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/index.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/traced.js",[],[],"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/functions/src/utils/index.js",[],[]]
2 changes: 1 addition & 1 deletion packages/http-logger/.eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/http-logger/src/index.js":"1"},{"size":1522,"mtime":1710050796203,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ej47uv","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/http-logger/src/index.js",[],["7"],{"ruleId":"8","severity":2,"message":"9","line":56,"column":9,"nodeType":"10","endLine":56,"endColumn":40,"suppressions":"11"},"turbo/no-undeclared-env-vars","$HTTP_LOGGER_IS_TEST is not listed as a dependency in turbo.json","MemberExpression",["12"],{"kind":"13","justification":"14"},"directive",""]
[{"/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/http-logger/src/index.js":"1"},{"size":1485,"mtime":1722086202960,"results":"2","hashOfConfig":"3"},{"filePath":"4","messages":"5","suppressedMessages":"6","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"kn7twj","/Users/akalanka/Documents/Repositories/FOSS/npm-catalogue/packages/http-logger/src/index.js",[],["7"],{"ruleId":"8","severity":2,"message":"9","line":56,"column":9,"nodeType":"10","endLine":56,"endColumn":40,"suppressions":"11"},"turbo/no-undeclared-env-vars","$HTTP_LOGGER_IS_TEST is not listed as a dependency in turbo.json","MemberExpression",["12"],{"kind":"13","justification":"14"},"directive",""]
68 changes: 36 additions & 32 deletions packages/http-logger/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
{
"name": "@sliit-foss/http-logger",
"version": "1.3.1",
"description": "Http logging middleware for Express.js",
"main": "dist/index.js",
"scripts": {
"build": "node ../../scripts/esbuild.config.js",
"build:watch": "bash ../../scripts/esbuild.watch.sh",
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/http-logger",
"lint": "bash ../../scripts/lint.sh",
"release": "bash ../../scripts/release.sh",
"test": "bash ../../scripts/test/test.sh"
},
"dependencies": {
"@sliit-foss/module-logger": "1.3.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sliit-foss/npm-catalogue.git"
},
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/http-logger/readme.md",
"keywords": [
"logging",
"http-logging",
"middleware"
],
"author": "SLIIT FOSS",
"license": "MIT",
"bugs": {
"url": "https://github.com/sliit-foss/npm-catalogue/issues"
}
}
{
"name": "@sliit-foss/http-logger",
"version": "1.3.1",
"description": "Http logging middleware for Express.js",
"main": "dist/index.js",
"types": "types/index.d.ts",
"scripts": {
"build": "node ../../scripts/esbuild.config.js",
"build:watch": "bash ../../scripts/esbuild.watch.sh",
"bump-version": "bash ../../scripts/bump-version.sh --name=@sliit-foss/http-logger",
"lint": "bash ../../scripts/lint.sh",
"release": "bash ../../scripts/release.sh",
"test": "bash ../../scripts/test/test.sh"
},
"dependencies": {
"@sliit-foss/module-logger": "1.3.1"
},
"peerDependencies": {
"express": "*"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sliit-foss/npm-catalogue.git"
},
"homepage": "https://github.com/sliit-foss/npm-catalogue/blob/main/packages/http-logger/readme.md",
"keywords": [
"logging",
"http-logging",
"middleware"
],
"author": "SLIIT FOSS",
"license": "MIT",
"bugs": {
"url": "https://github.com/sliit-foss/npm-catalogue/issues"
}
}
7 changes: 4 additions & 3 deletions packages/http-logger/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ app.use(httpLogger({
}));

// or
import { pick, omit} from 'loadash';

app.use(httpLogger({
whitelists: ["/public/*"],
loggable: ({headers, body} => {
loggable: ( (req) => {
// Pick the properties you want to log
return {
headers,
body
headers: pick(req.headers, ['x-user-email', 'user-agent']),
payload: omit(req.body, ['password', 'new_password', 'old_password'])
}
}),
}));
Expand Down
2 changes: 1 addition & 1 deletion packages/http-logger/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const httpLogger =
if (Array.isArray(loggable)) {
additionalInfo = generateInfoObject(req, loggable);
} else {
additionalInfo = loggable({ headers: req.headers, body: req.body });
additionalInfo = loggable(req);
}
}

Expand Down
18 changes: 18 additions & 0 deletions packages/http-logger/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RequestHandler, Request } from "express";

/**
* @description Options for logging middleware function
*/
type HttpLoggerOptions = {
whitelists?: string[];
loggable?: string[] | ((req: Request) => object);
};

/**
* @description Creates a HTTP logging middleware for Express.js
* @param {HttpLoggerOptions} options Add options to customize logging
* @returns {RequestHandler} A middleware function which will log http requests
*/
declare const httpLogger: (options: HttpLoggerOptions) => RequestHandler;

export default httpLogger;
Loading

0 comments on commit f62a58e

Please sign in to comment.