Skip to content

Commit

Permalink
update pino relalted packages (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandra-c authored Nov 4, 2024
1 parent e0901fd commit d7203a5
Show file tree
Hide file tree
Showing 10 changed files with 503 additions and 582 deletions.
10 changes: 10 additions & 0 deletions .changeset/wild-tips-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@totalsoft/multitenancy-core': major
'@totalsoft/pino-multitenancy': major
'@totalsoft/pino-correlation': major
'@totalsoft/pino-mssqlserver': major
'@totalsoft/correlation': major
'@totalsoft/pino-apollo': major
---

Update all dependencies
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"**/.pnp.*": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"files.eol": "\n",
"eslint.validate": [
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packageManager": "[email protected]",
"private": true,
"engines": {
"node": ">=16.x"
"node": ">=18.x"
},
"workspaces": [
"packages/*"
Expand All @@ -15,14 +15,15 @@
"release": "run build && changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.22.0",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"eslint": "7.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.6.2",
"ts-node": "^10.9.1",
"typescript": "^4.6.3"
"@changesets/cli": "^2.27.9",
"@types/node": "^22.8.7",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"eslint": "8.57.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"ts-node": "^10.9.2",
"typescript": "^5.6.3"
}
}
18 changes: 9 additions & 9 deletions packages/correlation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
"test": "jest --collectCoverage --passWithNoTests --verbose --silent=false --runInBand"
},
"devDependencies": {
"@jest/types": "^28.1.0",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.32",
"@types/uuid": "^8.3.4",
"jest": "^28.1.0",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.3",
"typescript": "^4.7.2"
"@jest/types": "^29.6.3",
"@types/jest": "^29.5.14",
"@types/node": "^22.8.7",
"@types/uuid": "^10.0.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"dependencies": {
"uuid": "^9.0.0"
"uuid": "^11.0.2"
},
"jest": {
"preset": "ts-jest",
Expand Down
32 changes: 16 additions & 16 deletions packages/multitenancy-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@
"test": "jest --collectCoverage --passWithNoTests --verbose --silent=false --runInBand"
},
"devDependencies": {
"@jest/types": "^28.1.0",
"@types/debounce": "^1.2.1",
"@types/glob": "^7.2.0",
"@types/humps": "^2.0.1",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.32",
"@types/object-path": "^0.11.1",
"@types/ramda": "0.28.0",
"@types/rimraf": "^3",
"@types/uuid": "^8.3.4",
"jest": "^28.1.0",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.3",
"typescript": "^4.7.2"
"@jest/types": "^29.6.3",
"@types/debounce": "^1.2.4",
"@types/glob": "^8.1.0",
"@types/humps": "^2.0.6",
"@types/jest": "^29.5.14",
"@types/node": "^22.8.7",
"@types/object-path": "^0.11.4",
"@types/ramda": "0.30.2",
"@types/rimraf": "^4",
"@types/uuid": "^10.0.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"dependencies": {
"debounce": "^1.2.1",
"deepmerge": "^4.2.2",
"debounce": "^2.2.0",
"deepmerge": "^4.3.1",
"humps": "^2.0.1",
"object-path": "^0.11.8"
},
Expand Down
14 changes: 7 additions & 7 deletions packages/multitenancy-core/src/tenantConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ const { IS_MULTITENANT } = process.env
const isMultiTenant = JSON.parse(IS_MULTITENANT || 'false')
const debounceTimeoutMs = 5000

const _getTenantsDebounced = debounce(_getTenants, debounceTimeoutMs, true)
const _getDefaultsDebounced = debounce(_getDefaults, debounceTimeoutMs, true)
const _getTenantsDebounced = debounce(_getTenants, debounceTimeoutMs, {immediate:true})
const _getDefaultsDebounced = debounce(_getDefaults, debounceTimeoutMs, {immediate:true})

export function getValue(tenantId: string, key?: string) {
if (!isMultiTenant) {
return undefined
}

const defaults = _getDefaultsDebounced()
const tenantSection = _getTenantsDebounced()[tenantId?.toLowerCase()]
const tenantSection = _getTenantsDebounced()?.[tenantId?.toLowerCase()]

if (!tenantSection) throw new Error(`Configuration not found for tenant '${tenantId}'`)

const defaultValue = objectPath.get(defaults, key || '')
const defaultValue = defaults?objectPath.get(defaults, key || ''):''
const tenantValue = objectPath.get(tenantSection, key || '')

if (_isObject(defaultValue) && _isObject(tenantValue)) {
Expand All @@ -48,11 +48,11 @@ export function getAll(): TenantSection[] {
const defaults = _getDefaultsDebounced()
const allTenantsMap = _getTenantsDebounced()

return Object.entries(allTenantsMap).map(([tid, tenantSection]) => {
return _isObject(defaults) && _isObject(tenantSection)
return allTenantsMap? Object.entries(allTenantsMap).map(([_tid, tenantSection]) => {
return defaults &&_isObject(defaults) && _isObject(tenantSection)
? deepmerge(defaults, tenantSection)
: tenantSection || defaults
})
}):[]
}

function _getDefaults(): TenantMapByCode {
Expand Down
32 changes: 16 additions & 16 deletions packages/pino-apollo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@
"test": "jest --collectCoverage --passWithNoTests --verbose --silent=false --runInBand"
},
"devDependencies": {
"@jest/types": "^28.1.0",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.32",
"@types/ramda": "0.28.0",
"@types/rimraf": "^3",
"@types/uuid": "^8.3.4",
"jest": "^28.1.0",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.3",
"typescript": "^4.7.2"
"@jest/types": "^29.6.3",
"@types/jest": "^29.5.14",
"@types/node": "^22.8.7",
"@types/ramda": "0.30.2",
"@types/rimraf": "^4",
"@types/uuid": "^10.0.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"dependencies": {
"@apollo/server": "^4.1.1",
"@colors/colors": "^1.5.0",
"@apollo/server": "^4.11.2",
"@colors/colors": "^1.6.0",
"@totalsoft/correlation": "1.1.0",
"graphql": "^16.4.0",
"pino": "^8.4.1",
"ramda": "^0.28.0",
"uuid": "^8.3.2"
"graphql": "^16.9.0",
"pino": "^9.5.0",
"ramda": "^0.30.1",
"uuid": "^11.0.2"
},
"jest": {
"preset": "ts-jest",
Expand Down
16 changes: 8 additions & 8 deletions packages/pino-correlation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"test": "jest --collectCoverage --passWithNoTests --verbose --silent=false --runInBand"
},
"devDependencies": {
"@jest/types": "^28.1.0",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.32",
"@types/uuid": "^8.3.4",
"jest": "^28.1.0",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.3",
"typescript": "^4.7.2"
"@jest/types": "^29.6.3",
"@types/jest": "^29.5.14",
"@types/node": "^22.8.7",
"@types/uuid": "^10.0.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"dependencies": {
"@totalsoft/correlation": "1.1.0"
Expand Down
16 changes: 8 additions & 8 deletions packages/pino-multitenancy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"test": "jest --collectCoverage --passWithNoTests --verbose --silent=false --runInBand"
},
"devDependencies": {
"@jest/types": "^28.1.0",
"@types/jest": "^27.5.1",
"@types/node": "^17.0.32",
"@types/uuid": "^8.3.4",
"jest": "^28.1.0",
"rimraf": "^3.0.2",
"ts-jest": "^28.0.3",
"typescript": "^4.7.2"
"@jest/types": "^29.6.3",
"@types/jest": "^29.5.14",
"@types/node": "^22.8.7",
"@types/uuid": "^10.0.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ts-jest": "^29.2.5",
"typescript": "^5.6.3"
},
"dependencies": {
"@totalsoft/multitenancy-core": "1.2.0"
Expand Down
Loading

0 comments on commit d7203a5

Please sign in to comment.