@opengis/fcore 0.0.1-beta.0 → 0.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -3
- package/README.md +71 -71
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/context.d.ts +4 -4
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/fastify.d.ts.map +1 -1
- package/dist/fastify.js +1 -1
- package/dist/fcore.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/migrations/cli.js +1 -1
- package/dist/migrations/runner.d.ts.map +1 -1
- package/dist/migrations/runner.js +1 -1
- package/dist/modules/auth/index.js +1 -1
- package/dist/modules/auth/route.js +1 -1
- package/dist/modules/auth/schema.js +1 -1
- package/dist/modules/auth/services/get-current-user.js +1 -1
- package/dist/modules/auth/services/login.js +1 -1
- package/dist/modules/auth/services/logout.js +1 -1
- package/dist/modules/auth/services/verify-two-factor.js +1 -1
- package/dist/modules/auth/services/verifyPassword.js +1 -1
- package/dist/modules/file/index.js +1 -1
- package/dist/modules/file/route.js +1 -1
- package/dist/modules/file/schema.js +1 -1
- package/dist/modules/file/services/get-file.js +1 -1
- package/dist/modules/file/services/resize-file.js +1 -1
- package/dist/modules/file/services/upload-file.d.ts.map +1 -1
- package/dist/modules/file/services/upload-file.js +1 -1
- package/dist/modules/resource/index.js +1 -1
- package/dist/modules/resource/route.js +1 -1
- package/dist/modules/resource/schema.js +1 -1
- package/dist/modules/resource/services/add-note.d.ts.map +1 -1
- package/dist/modules/resource/services/add-note.js +1 -1
- package/dist/modules/resource/services/add-resource-file.d.ts.map +1 -1
- package/dist/modules/resource/services/add-resource-file.js +1 -1
- package/dist/modules/resource/services/create-resource-relation.js +1 -1
- package/dist/modules/resource/services/create-resource.js +1 -1
- package/dist/modules/resource/services/delete-resource-relation.js +1 -1
- package/dist/modules/resource/services/delete-resource.js +1 -1
- package/dist/modules/resource/services/export-resource.js +1 -1
- package/dist/modules/resource/services/get-resource.js +1 -1
- package/dist/modules/resource/services/list-children.js +1 -1
- package/dist/modules/resource/services/list-resource-relation.js +1 -1
- package/dist/modules/resource/services/list-resources.js +1 -1
- package/dist/modules/resource/services/search-resource.js +1 -1
- package/dist/modules/resource/services/suggest-resource.js +1 -1
- package/dist/modules/resource/services/update-resource.js +1 -1
- package/dist/modules/resource/services/upload-resource-file.d.ts.map +1 -1
- package/dist/modules/resource/services/upload-resource-file.js +1 -1
- package/dist/modules/system/index.js +1 -1
- package/dist/modules/system/route.js +1 -1
- package/dist/modules/system/schema.js +1 -1
- package/dist/modules/system/services/check-system.d.ts.map +1 -1
- package/dist/modules/system/services/check-system.js +1 -1
- package/dist/modules/system/services/get-api-list.js +1 -1
- package/dist/modules/system/services/get-audit-log.d.ts.map +1 -1
- package/dist/modules/system/services/get-audit-log.js +1 -1
- package/dist/modules/system/services/get-dictionary.js +1 -1
- package/dist/modules/system/services/get-system-log.d.ts.map +1 -1
- package/dist/modules/system/services/get-system-log.js +1 -1
- package/dist/modules/system/services/get-system-settings.d.ts.map +1 -1
- package/dist/modules/system/services/get-system-settings.js +1 -1
- package/dist/modules/system/services/list-dictionaries.js +1 -1
- package/dist/modules/system/services/update-system-settings.d.ts.map +1 -1
- package/dist/modules/system/services/update-system-settings.js +1 -1
- package/dist/modules/utils/get-user-permissions.d.ts.map +1 -1
- package/dist/modules/utils/get-user-permissions.js +1 -1
- package/dist/modules/utils/require-admin.d.ts +1 -1
- package/dist/modules/utils/require-admin.d.ts.map +1 -1
- package/dist/modules/utils/require-admin.js +1 -1
- package/dist/modules/utils/safe-user.js +1 -1
- package/dist/modules/utils/unsupported.js +1 -1
- package/dist/plugins/audit/audit.d.ts +2 -2
- package/dist/plugins/audit/audit.d.ts.map +1 -1
- package/dist/plugins/audit/audit.js +1 -1
- package/dist/plugins/audit/index.js +1 -1
- package/dist/plugins/audit/services/write-audit.d.ts +2 -2
- package/dist/plugins/audit/services/write-audit.d.ts.map +1 -1
- package/dist/plugins/audit/services/write-audit.js +1 -1
- package/dist/plugins/auth/index.js +1 -1
- package/dist/plugins/dictionary.d.ts.map +1 -1
- package/dist/plugins/dictionary.js +1 -1
- package/dist/plugins/file.d.ts +1 -1
- package/dist/plugins/file.d.ts.map +1 -1
- package/dist/plugins/file.js +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/logger/index.d.ts +9 -4
- package/dist/plugins/logger/index.d.ts.map +1 -1
- package/dist/plugins/logger/index.js +1 -1
- package/dist/plugins/logger/transport.d.ts +3 -0
- package/dist/plugins/logger/transport.d.ts.map +1 -0
- package/dist/plugins/logger/transport.js +1 -0
- package/dist/plugins/pg.d.ts +1 -1
- package/dist/plugins/pg.d.ts.map +1 -1
- package/dist/plugins/pg.js +1 -1
- package/dist/plugins/redis.js +1 -1
- package/dist/plugins/resource/index.js +1 -1
- package/dist/plugins/resource/resource.js +1 -1
- package/dist/plugins/resource/resource.registry.js +1 -1
- package/dist/plugins/resource/resource.types.d.ts +10 -4
- package/dist/plugins/resource/resource.types.d.ts.map +1 -1
- package/dist/plugins/resource/services/create.js +1 -1
- package/dist/plugins/resource/services/delete.js +1 -1
- package/dist/plugins/resource/services/find-one.js +1 -1
- package/dist/plugins/resource/services/find.js +1 -1
- package/dist/plugins/resource/services/update.js +1 -1
- package/dist/plugins/resource/utils/fields.js +1 -1
- package/dist/plugins/resource/utils/filters.js +1 -1
- package/dist/plugins/resource/utils/permissions.js +1 -1
- package/dist/plugins/resource/utils/sort.js +1 -1
- package/dist/plugins/resource/utils/sql.js +1 -1
- package/dist/shared/getIP.js +1 -1
- package/dist/type.d.ts +23 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/type.js +1 -0
- package/migrations/20260903120000_core_schema.sql +256 -0
- package/migrations/20260903130000_move_notes_files_to_admin.sql +18 -0
- package/migrations/20260903140000_settings_nulls_not_distinct.sql +19 -0
- package/package.json +87 -86
- package/dist/plugins/logger/checkUserAccess.d.ts +0 -11
- package/dist/plugins/logger/checkUserAccess.d.ts.map +0 -1
- package/dist/plugins/logger/checkUserAccess.js +0 -1
- package/dist/plugins/logger/createFileStream.d.ts +0 -3
- package/dist/plugins/logger/createFileStream.d.ts.map +0 -1
- package/dist/plugins/logger/createFileStream.js +0 -1
- package/dist/plugins/logger/createLogger.d.ts +0 -9
- package/dist/plugins/logger/createLogger.d.ts.map +0 -1
- package/dist/plugins/logger/createLogger.js +0 -1
- package/dist/plugins/logger/errorStatus.d.ts +0 -2
- package/dist/plugins/logger/errorStatus.d.ts.map +0 -1
- package/dist/plugins/logger/errorStatus.js +0 -1
- package/dist/plugins/logger/getHooks.d.ts +0 -5
- package/dist/plugins/logger/getHooks.d.ts.map +0 -1
- package/dist/plugins/logger/getHooks.js +0 -1
- package/dist/plugins/logger/getRootDir.d.ts +0 -3
- package/dist/plugins/logger/getRootDir.d.ts.map +0 -1
- package/dist/plugins/logger/getRootDir.js +0 -1
- package/dist/plugins/logger/labels.d.ts +0 -3
- package/dist/plugins/logger/labels.d.ts.map +0 -1
- package/dist/plugins/logger/labels.js +0 -1
- package/dist/plugins/logger/serializers.d.ts +0 -14
- package/dist/plugins/logger/serializers.d.ts.map +0 -1
- package/dist/plugins/logger/serializers.js +0 -1
- package/dist/plugins/logger/timestampWithTimeZone.d.ts +0 -2
- package/dist/plugins/logger/timestampWithTimeZone.d.ts.map +0 -1
- package/dist/plugins/logger/timestampWithTimeZone.js +0 -1
package/package.json
CHANGED
|
@@ -1,87 +1,88 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@opengis/fcore",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
4
|
-
"description": "Reusable backend foundation for OpenGIS Node.js applications",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"test
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"migration
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@
|
|
52
|
-
"@aws-sdk/
|
|
53
|
-
"@
|
|
54
|
-
"@fastify/
|
|
55
|
-
"@fastify/
|
|
56
|
-
"@fastify/
|
|
57
|
-
"@fastify/
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"fastify-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"pino
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"@types/
|
|
77
|
-
"@types/passport
|
|
78
|
-
"@types/
|
|
79
|
-
"@types/
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/fcore",
|
|
3
|
+
"version": "0.0.1-beta.2",
|
|
4
|
+
"description": "Reusable backend foundation for OpenGIS Node.js applications",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"migrations",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./fastify": {
|
|
20
|
+
"types": "./dist/fastify.d.ts",
|
|
21
|
+
"import": "./dist/fastify.js"
|
|
22
|
+
},
|
|
23
|
+
"./migrate": {
|
|
24
|
+
"types": "./dist/migrations/runner.d.ts",
|
|
25
|
+
"import": "./dist/migrations/runner.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"bin": {
|
|
29
|
+
"fcore-migrate": "./dist/migrations/cli.js"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"clean": "rm -rf dist",
|
|
33
|
+
"build": "npm run clean && tsc -p tsconfig.json && node scripts/obfuscate.mjs",
|
|
34
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
35
|
+
"test": "node --test --import tsx test/**/*.test.ts",
|
|
36
|
+
"test-env": "node --env-file=.env.test --test --import tsx test/**/env.test.ts",
|
|
37
|
+
"dev": "tsx server.ts",
|
|
38
|
+
"migrate": "node ./dist/migrations/cli.js",
|
|
39
|
+
"migration": "node --import tsx src/migrations/cli.ts",
|
|
40
|
+
"migration-test": "node --env-file=.env.test --import tsx src/migrations/cli.ts",
|
|
41
|
+
"prepublishOnly": "npm run build",
|
|
42
|
+
"prepublishOnly1": "npm run build && npm test",
|
|
43
|
+
"patch": "npm version patch && git push && npm publish",
|
|
44
|
+
"minor": "npm version minor && git push && npm publish",
|
|
45
|
+
"major": "npm version major && git push && npm publish"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@sinclair/typebox": "^0.34.52",
|
|
52
|
+
"@aws-sdk/client-s3": "3.1125.0",
|
|
53
|
+
"@aws-sdk/lib-storage": "3.1125.0",
|
|
54
|
+
"@fastify/cookie": "11.1.2",
|
|
55
|
+
"@fastify/multipart": "10.1.1",
|
|
56
|
+
"@fastify/passport": "4.0.2",
|
|
57
|
+
"@fastify/rate-limit": "11.2.0",
|
|
58
|
+
"@fastify/session": "11.1.2",
|
|
59
|
+
"apache-crypt": "1.2.6",
|
|
60
|
+
"dotenv": "17.4.2",
|
|
61
|
+
"fastify-plugin": "6.0.0",
|
|
62
|
+
"fastify-session-redis-store": "7.1.2",
|
|
63
|
+
"file-type": "22.0.2",
|
|
64
|
+
"ioredis": "6.0.0",
|
|
65
|
+
"otplib": "13.5.0",
|
|
66
|
+
"pg": "8.23.0",
|
|
67
|
+
"pino": "10.3.1",
|
|
68
|
+
"pino-abstract-transport": "3.0.0",
|
|
69
|
+
"qrcode": "1.5.4",
|
|
70
|
+
"sharp": "0.35.4"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"fastify": ">=5.12.1"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/node": "22.20.1",
|
|
77
|
+
"@types/passport": "1.0.17",
|
|
78
|
+
"@types/passport-local": "1.0.38",
|
|
79
|
+
"@types/pg": "8.23.1",
|
|
80
|
+
"@types/qrcode": "1.5.6",
|
|
81
|
+
"fastify": "5.12.1",
|
|
82
|
+
"javascript-obfuscator": "5.6.0",
|
|
83
|
+
"tsx": "4.23.13",
|
|
84
|
+
"typescript": "7.0.2",
|
|
85
|
+
"vitest": "4.1.11"
|
|
86
|
+
},
|
|
87
|
+
"license": "UNLICENSED"
|
|
87
88
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ContextDependencies } from "../../context.js";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @summary check user access to logger interface - per admin user type or user group
|
|
5
|
-
* @returns {Object} message, status
|
|
6
|
-
*/
|
|
7
|
-
export default function checkUserAccess({ userType, token, }: {
|
|
8
|
-
userType?: string;
|
|
9
|
-
token?: string;
|
|
10
|
-
}, { config }: Pick<ContextDependencies, "config">): null;
|
|
11
|
-
//# sourceMappingURL=checkUserAccess.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkUserAccess.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/checkUserAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD;;;;GAIG;AAEH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,EACE,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,QAgBhD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function I(){const r=['99nyqByM','1829155QyWxxO','3656072LRfdpS','UFofW','admin','access\x20restricted','EXMQW','750NlxKla','718258lcLGsB','platform','includes','5524rJvPHw','2230844WhKlYm','gdOeQ','auth','gkdxM','4GDxUUJ','win32','1048490QNsJfU','314658aUyVrC'];I=function(){return r;};return I();}function b(n,a){n=n-0x8d;const E=I();let M=E[n];return M;}(function(n,a){const B=b,E=n();while(!![]){try{const M=-parseInt(B(0x97))/0x1+-parseInt(B(0x9a))/0x2*(parseInt(B(0x96))/0x3)+-parseInt(B(0x9f))/0x4*(-parseInt(B(0x90))/0x5)+-parseInt(B(0x8e))/0x6+parseInt(B(0x9b))/0x7+parseInt(B(0x91))/0x8+-parseInt(B(0x8f))/0x9*(-parseInt(B(0x8d))/0xa);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xcb886));import{ForbiddenError}from'../../errors.js';export default function checkUserAccess({userType:a,token:E},{config:M}){const A=b,X={};X[A(0x9e)]=function(u,Y){return u===Y;},X[A(0x9c)]=A(0x93),X[A(0x95)]=A(0xa0),X[A(0x92)]=A(0x94);const G=X,{accessToken:j}=M[A(0x9d)];if(E&&G[A(0x9e)](E,j))return null;if((!a||!a?.[A(0x99)]?.(G[A(0x9c)]))&&process[A(0x98)]!==G[A(0x95)])throw new ForbiddenError(G[A(0x92)]);return null;}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFileStream.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/createFileStream.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAmC5C,MAAM,CAAC,OAAO,UAAU,eAAe,iDAoDtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(n,a){const N=b,E=n();while(!![]){try{const M=parseInt(N(0xbf))/0x1*(-parseInt(N(0xcf))/0x2)+parseInt(N(0xef))/0x3+parseInt(N(0xbc))/0x4*(-parseInt(N(0xb5))/0x5)+parseInt(N(0xe6))/0x6*(parseInt(N(0xe8))/0x7)+parseInt(N(0xc6))/0x8+parseInt(N(0xd4))/0x9+-parseInt(N(0xca))/0xa*(parseInt(N(0xc0))/0xb);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xc7ba0));function b(n,a){n=n-0xb4;const E=I();let M=E[n];return M;}import m from'node:fs';import T from'pino-abstract-transport';import y from'./labels.js';import s from'./getRootDir.js';const dir=s(),streams={};function createFileStream({level:M,status:X}){const z=b,G={};G[z(0xee)]=function(Z,H){return Z+H;},G[z(0xe4)]=z(0xb6),G[z(0xc1)]=z(0xdf),G[z(0xc7)]=z(0xed);const j=G,u=new Date()[z(0xe0)]()[z(0xde)]('T')[0x0],Y=dir+'/'+M+'/'+u+(X?'_'+X:'')+z(0xd6),g={};g[z(0xc8)]=!![],m[z(0xce)](dir+'/'+M,g),console[z(0xcb)](j[z(0xee)](z(0xf1),Y));const e={};e[z(0xd5)]=j[z(0xe4)],e[z(0xd8)]='a+';const h=m[z(0xc3)](Y,e);return h['on'](j[z(0xc1)],()=>h[z(0xb4)]()),h['on'](z(0xd1),()=>h[z(0xb4)]()),h['on'](j[z(0xc7)],()=>h[z(0xb4)]()),h;}setInterval(()=>{const w=b,n=new Date()[w(0xe0)]()[w(0xde)]('T')[0x0];Object[w(0xf2)](streams)[w(0xe9)](a=>!a[w(0xb9)](n))[w(0xdc)](a=>streams[a][w(0xb4)]());},0x3e8*0xe10*0x2);function I(){const S=['log','YqcmO','type','mkdirSync','1046TLlywv','incoming\x20request','close','PwyxT','hLVuv','14421519iCiDcq','encoding','.log','closed','flags','RdDfx','status','ognxw','forEach','stringify','split','finish','toISOString','destroyed','FbnCD','amUvG','LAUAe','ANgzg','728034GtMNGT','MbVLb','77VfLzGL','filter','VkZOc','err','logfolder','error','gqbug','4425630rEadUF','tLecD','creating\x20log\x20stream:\x20','keys','write','destroy','907805YnIMUt','utf8','level','KuoFI','includes','nifFK','parse','12ofcgUn','JYwGj','vMWsa','658hcMQpx','919963alBPfX','SFhVh','request\x20completed','createWriteStream','msg','data','3780968JLGxhG','FlnLV','recursive','GaiJw','380gnwQTN'];I=function(){return S;};return I();}export default function transportTarget(){const R=b,n={'vMWsa':R(0xc2),'amUvG':function(a,E){return a(E);},'JYwGj':function(a,E){return a!==E;},'FbnCD':R(0xba),'KuoFI':R(0xd3),'RdDfx':R(0xc5)};return T(a=>{const F=R,E={'ognxw':n[F(0xbe)],'VkZOc':function(X,G){const i=F;return n[i(0xe3)](X,G);},'PwyxT':function(X,G){return X(G);},'MbVLb':function(X,G){const o=F;return n[o(0xbd)](X,G);},'tLecD':n[F(0xe2)],'ANgzg':F(0xc9),'YqcmO':n[F(0xb8)]},M=new Date()[F(0xe0)]()[F(0xde)]('T')[0x0];a['on'](n[F(0xd9)],X=>{const C=F;if([C(0xd0),E[C(0xdb)]][C(0xb9)](X[C(0xc4)]))return;const G=X[C(0xc4)]?.[C(0xec)]||X[C(0xec)],j=G||y[X[C(0xb7)]],u=j+M;if(X[C(0xeb)]?.[C(0xda)]){const e=X[C(0xeb)]?.[C(0xda)];streams[e]=streams[e]||E[C(0xea)](createFileStream,{'level':j,'status':e});const h={...X};h[C(0xb7)]=y[X[C(0xb7)]],streams[e][C(0xf3)](JSON[C(0xdd)](h)+'\x0a');}if(X[C(0xeb)]?.[C(0xcd)]){const Z=X[C(0xeb)]?.[C(0xcd)];streams[Z]=streams[Z]||E[C(0xd2)](createFileStream,{'level':j,'status':Z});const H={...X};H[C(0xb7)]=y[X[C(0xb7)]],streams[Z][C(0xf3)](JSON[C(0xdd)](H)+'\x0a');}streams[u]?.[C(0xd7)]&&(E[C(0xe7)](E[C(0xf0)],E[C(0xe5)])?streams[u][C(0xb4)]():delete Y[g]);streams[u]?.[C(0xe1)]&&(E[C(0xe7)](E[C(0xcc)],E[C(0xcc)])?Y[g][C(0xb4)]():delete streams[u]);const Y={};Y[C(0xb7)]=j,streams[u]=streams[u]||createFileStream(Y);const g={...X};g[C(0xb7)]=y[X[C(0xb7)]],streams[u][C(0xf3)](JSON[C(0xdd)](g)+'\x0a');});},{'parseLine':a=>JSON[R(0xbb)](a)});}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type FastifyRequest } from "fastify";
|
|
2
|
-
import { Logger } from "pino";
|
|
3
|
-
export interface ExtendedLogger extends Logger {
|
|
4
|
-
file: (logfolder: string, msg: any, req?: FastifyRequest) => void;
|
|
5
|
-
metrics: (key: string, val?: any, dbName?: string) => void;
|
|
6
|
-
}
|
|
7
|
-
import { ContextDependencies } from "../../context.js";
|
|
8
|
-
export declare const createLogger: ({ config, redis, }: Pick<ContextDependencies, "config" | "redis">) => any;
|
|
9
|
-
//# sourceMappingURL=createLogger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createLogger.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/createLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAa,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAOpC,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC5C,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAClE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5D;AAMD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,eAAO,MAAM,YAAY,uBAGtB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,OAAO,CAAC,QAkF/C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function I(){const S=['uzspQ','58DSyjkT','jUCTU',':system_metrics','15337dcjPOs','XnNtM','error','push','AgbLX','true','catch','destination','whETg','4219185CBvnkE','eHDwM','zGtCO','warn','file','CtnwB','logger','database','trace','IuLpa','wfuwR','HcsIT','debug','VNYlu','toString','targets','WXVUf','log','FGihm','pino/file','1869560jkeNcN','4967408kBguqu','hincrby','21858XjgwNQ','5fFGRdq','options','JBRYg',',\x22time\x22:\x22','LJjbi','ATUuy','createFileStream.js','FxhxG','test/redaction','20fJYTvu','metrics','string','ujVkI','info','should\x20be\x20redacted','FPXMp','level','log\x20level:\x20','738846kxAazR','jOeYu','includes','argv','redactionList','rTBTB','QmrTA','404332oNuyPo','target','1806UmpEsX','PsnAp','⚠️\x20logger\x20metrics\x20error'];I=function(){return S;};return I();}const F=b;(function(n,a){const R=b,E=n();while(!![]){try{const M=-parseInt(R(0x1c6))/0x1*(-parseInt(R(0x1e9))/0x2)+-parseInt(R(0x1d2))/0x3+-parseInt(R(0x203))/0x4*(parseInt(R(0x1ea))/0x5)+parseInt(R(0x1c2))/0x6*(parseInt(R(0x1c9))/0x7)+parseInt(R(0x1e7))/0x8+parseInt(R(0x1fc))/0x9*(parseInt(R(0x1f3))/0xa)+parseInt(R(0x1e6))/0xb;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xb4e69));import k from'pino';import{dirname,join}from'node:path';import{fileURLToPath}from'node:url';function b(n,a){n=n-0x1c1;const E=I();let M=E[n];return M;}const dir=dirname(fileURLToPath(import.meta.url));import p from'./getHooks.js';import l from'./serializers.js';import P from'./timestampWithTimeZone.js';const isServer=process[F(0x1ff)][0x2],loggerCache={};export const createLogger=({config:X,redis:G})=>{const i=F,j={'LJjbi':function(H,t){return H===t;},'wfuwR':i(0x1f5),'JBRYg':i(0x1f2),'zGtCO':function(H,t){return H!==t;},'FxhxG':i(0x1d1),'jOeYu':function(H,t){return H&&t;},'CtnwB':function(H,t){return H||t;},'eHDwM':i(0x1f7),'ujVkI':function(H,t){return H!==t;},'FGihm':i(0x1c7),'ATUuy':function(H,t,B){return H(t,B);},'XnNtM':i(0x1f0),'VNYlu':i(0x1cb),'AgbLX':i(0x1da),'FPXMp':i(0x1de),'rTBTB':i(0x1e5),'WXVUf':function(H){return H();},'IuLpa':i(0x1ce),'QmrTA':i(0x1f8)},u=X[i(0x1d8)][i(0x1fa)]||j[i(0x1d3)];console[i(0x1e3)](i(0x1fb)+u);if(loggerCache[u])return j[i(0x1f6)](i(0x1dd),j[i(0x1e4)])?loggerCache[u]:E[e];const Y={};Y[i(0x1d0)]=0x1;const g=process.env.VITEST?[]:[{'target':j[i(0x1ef)](join,dir,j[i(0x1ca)])},{'level':j[i(0x1df)],'target':i(0x1e5),'options':Y}];if([j[i(0x1cd)],j[i(0x1f9)]][i(0x1fe)](u)){const t={};t[i(0x1d0)]=0x1;const B={};B[i(0x1fa)]=u,B[i(0x1c1)]=j[i(0x201)],B[i(0x1eb)]=t,g[i(0x1cc)](B);}const e={};e[i(0x1e1)]=g;const h={'level':u,'timestamp':()=>i(0x1ed)+P()+'\x22','hooks':j[i(0x1e2)](p),'serializers':l,'transport':e,'redact':X[i(0x200)]},Z=k(h);return Z[i(0x1d6)]=function A(r,J,m){const o=i;Z[o(0x1f7)]({'logfolder':r,...j[o(0x1ee)](typeof J,j[o(0x1dc)])?{'msg':J}:J,'req':m});},j[i(0x1ee)](process.env.debug,j[i(0x1db)])&&Z[i(0x1d6)](j[i(0x1ec)],{'clientId':j[i(0x202)],'clientSecret':j[i(0x202)]}),Z[i(0x1f4)]=function r(J,m,T){const C=i,y={};y[C(0x1c5)]=j[C(0x1ec)],y[C(0x1c3)]=C(0x1f8);const s=y;if(j[C(0x1d4)](C(0x1d1),j[C(0x1f1)]))a[C(0x1d6)](VxeSfF[C(0x1c5)],{'clientId':VxeSfF[C(0x1c3)],'clientSecret':C(0x1f8)});else{const z=T||X['pg']?.[C(0x1d9)];if(j[C(0x1fd)](!z,!isServer))return;if(!G)return;G[C(0x1e8)](z+C(0x1c8),J,j[C(0x1d7)](m,0x1))[C(0x1cf)](w=>console[C(0x1d5)](C(0x1c4),w[C(0x1e0)]()));}},loggerCache[u]=Z,Z;};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errorStatus.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/errorStatus.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,GAAG,OAoB7C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function b(n,a){n=n-0x16c;var E=I();var M=E[n];return M;}function I(){var g=['oXLpT','ExecConstraints','56390NbBVcx','pl_exec.c','EXksw','routine','hEzec','file','KxBeo','5757160JurTdF','ajHDS','exec_stmt_raise','1578nbWPHd','49091867kbqBgv','wcyko','aDKJn','311332TeDDkN','135704WgxeDH','1896KTzYwl','28hchxZK','mpDRs','validation','avYmq','DatabaseError','type','204pvTnpK','statusCode','873NgvoNx','224625BmTcMz'];I=function(){return g;};return I();}(function(n,a){var u=b,E=n();while(!![]){try{var M=parseInt(u(0x180))/0x1+parseInt(u(0x182))/0x2*(-parseInt(u(0x17c))/0x3)+-parseInt(u(0x179))/0x4+-parseInt(u(0x16f))/0x5*(parseInt(u(0x16c))/0x6)+-parseInt(u(0x183))/0x7*(-parseInt(u(0x181))/0x8)+parseInt(u(0x16e))/0x9*(-parseInt(u(0x172))/0xa)+parseInt(u(0x17d))/0xb;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xca90e));export default function errorStatus(a){var Y=b,E={};E[Y(0x184)]=function(G,j){return G===j;},E[Y(0x17a)]=Y(0x17b),E[Y(0x186)]=function(G,j){return G===j;},E[Y(0x178)]=function(G,j){return G!==j;},E[Y(0x17f)]=Y(0x171),E[Y(0x170)]=Y(0x187),E[Y(0x17e)]=Y(0x176);var M=E;if(a[Y(0x185)])return 0x1a6;if(M[Y(0x184)](a[Y(0x175)],M[Y(0x17a)])&&M[Y(0x186)](a[Y(0x177)],Y(0x173)))return M[Y(0x178)](Y(0x174),Y(0x174))?0x1a6:0x1a6;if(a[Y(0x175)]===M[Y(0x17f)])return 0x1a6;if(M[Y(0x184)](a[Y(0x188)],M[Y(0x170)]))return 0x1f4;if(a[Y(0x16d)])return M[Y(0x178)](M[Y(0x17e)],M[Y(0x17e)])?a[Y(0x16d)]:a[Y(0x16d)];return 0x1f4;}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getHooks.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/getHooks.ts"],"names":[],"mappings":"AAEA,iBAAS,QAAQ;IAEb,SAAS,YAAY,GAAG,UAAU,GAAG;EAiBxC;eAEc,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(n,a){const S=b,E=n();while(!![]){try{const M=parseInt(S(0x14c))/0x1+parseInt(S(0x13d))/0x2*(-parseInt(S(0x13f))/0x3)+-parseInt(S(0x140))/0x4+-parseInt(S(0x144))/0x5*(parseInt(S(0x148))/0x6)+parseInt(S(0x143))/0x7+-parseInt(S(0x147))/0x8*(-parseInt(S(0x146))/0x9)+parseInt(S(0x149))/0xa;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x8e2ab));function I(){const U=['length','xowwo','req','1658OahBkd','originalUrl','795hZgTow','406372LzCAUw','err','toString','1000363OYBCUO','85qNFeHR','stack','17586UimCrj','488ZrmWAj','386028czpKOW','9875170zJBhBk','apply','status','747719skATot'];I=function(){return U;};return I();}import C from'./errorStatus.js';function getHooks(){const n={'xowwo':function(a,E){return a(E);}};return{'logMethod'(a,E){const c=b;if(a?.[c(0x14d)]===0x2&&a[0x1]?.[c(0x13e)]){const M=a[0x1],X=a[0x0]?.[c(0x145)]?a[0x0]:undefined;if(X)X[c(0x14b)]=n[c(0x13b)](C,X);const G={};return G[c(0x13c)]=M,G[c(0x141)]=X,E[c(0x14a)](this,[G,X?a[0x0][c(0x142)]():a[0x0]]);}return E[c(0x14a)](this,a);}};}function b(n,a){n=n-0x13b;const E=I();let M=E[n];return M;}export default getHooks;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRootDir.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/getRootDir.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function b(n,a){n=n-0x6f;const E=I();let M=E[n];return M;}const u=b;(function(a,E){const j=b,M=a();while(!![]){try{const X=parseInt(j(0x75))/0x1+parseInt(j(0x76))/0x2+parseInt(j(0x70))/0x3+-parseInt(j(0x71))/0x4+parseInt(j(0x72))/0x5*(-parseInt(j(0x78))/0x6)+parseInt(j(0x77))/0x7+parseInt(j(0x79))/0x8*(-parseInt(j(0x73))/0x9);if(X===E)break;else M['push'](M['shift']());}catch(G){M['push'](M['shift']());}}}(I,0x92016));function I(){const Y=['625380sdMmeC','1388494XIlxEk','5136082YtNtPs','30ZYnQPx','770656XBsmlw','join','cwd','2850114lGRJKa','1991260ValovX','558890rcYXde','126ovWazW','log'];I=function(){return Y;};return I();}import n from'node:path';const logDir=process.env.LOG_DIR||n[u(0x7a)](process[u(0x6f)](),u(0x74));export default()=>logDir;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/labels.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,EAQP,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC;eAEtB,MAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const u=b;(function(a,E){const j=b,M=a();while(!![]){try{const X=-parseInt(j(0x1c5))/0x1*(parseInt(j(0x1b7))/0x2)+parseInt(j(0x1c4))/0x3+parseInt(j(0x1c6))/0x4+parseInt(j(0x1b8))/0x5*(-parseInt(j(0x1c7))/0x6)+-parseInt(j(0x1c3))/0x7*(parseInt(j(0x1bd))/0x8)+-parseInt(j(0x1c1))/0x9*(-parseInt(j(0x1bf))/0xa)+parseInt(j(0x1c0))/0xb;if(X===E)break;else M['push'](M['shift']());}catch(G){M['push'](M['shift']());}}}(I,0x5367c));function b(n,a){n=n-0x1b6;const E=I();let M=E[n];return M;}const n={};n['10']=u(0x1bb),n['20']=u(0x1b6),n['30']=u(0x1be),n['40']=u(0x1c2),n['50']=u(0x1c8),n['60']=u(0x1ba),n[u(0x1b9)]=u(0x1bc);function I(){const Y=['861464MEAAHs','info','10FVqzpz','1493514apuaZu','4447089jNsndK','warn','7UEIDfl','641343lJjGRo','32IMzhvu','969772SYRarJ','4326ZaDfaD','error','debug','10600MjRDmH','3240WcXcMV','infinity','fatal','trace','silent'];I=function(){return Y;};return I();}const labels=n;export default labels;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/serializers.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,WAAW;iBACF,GAAG;;;;;;;;;;CAkBjB,CAAC;eAEa,WAAW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function I(){const k=['x-forwarded-for','params','method','10DnFtfZ','x-real-ip','3620862hNAqxW','connection','923010FSkdfl','1PHOZLn','bZZGU','20yYYbWI','req','hyqTG','38914aPYrZv','1128HKZQOV','2331464BZMZbA','user','1446075xJyEJH','query','url','referer','body','userId','remoteAddress','293530dXCaIg','passport','headers'];I=function(){return k;};return I();}const A=b;(function(n,a){const B=b,E=n();while(!![]){try{const M=-parseInt(B(0x129))/0x1*(parseInt(B(0x12e))/0x2)+-parseInt(B(0x12f))/0x3*(-parseInt(B(0x12b))/0x4)+parseInt(B(0x139))/0x5+parseInt(B(0x128))/0x6+parseInt(B(0x126))/0x7+-parseInt(B(0x130))/0x8+-parseInt(B(0x132))/0x9*(parseInt(B(0x124))/0xa);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x3f81a));function b(n,a){n=n-0x11f;const E=I();let M=E[n];return M;}const e={};e[A(0x12c)]=function(E){const r=A,M={};M[r(0x12d)]=r(0x125),M[r(0x12a)]=r(0x121);const X=M,{method:G,url:j,headers:u,params:Y,query:g,body:h,session:Z}=E,{id:H}=Z?.[r(0x11f)]?.[r(0x131)]||{},t={};return t[r(0x123)]=G,t[r(0x134)]=j,t[r(0x135)]=u?.[r(0x135)],t['ip']=E[r(0x120)]?.[X[r(0x12d)]]||E[r(0x120)]?.[X[r(0x12a)]]||E['ip']||E[r(0x127)]?.[r(0x138)],t[r(0x137)]=H,t[r(0x122)]=Y,t[r(0x133)]=g,t[r(0x136)]=h,t;};const serializers=e;export default serializers;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timestampWithTimeZone.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/timestampWithTimeZone.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,qBAAqB,WAK5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(n,a){const u=b,E=n();while(!![]){try{const M=parseInt(u(0x1a6))/0x1+-parseInt(u(0x1a2))/0x2+parseInt(u(0x1a7))/0x3*(-parseInt(u(0x1ab))/0x4)+parseInt(u(0x1a4))/0x5+-parseInt(u(0x1a1))/0x6+-parseInt(u(0x1a9))/0x7+parseInt(u(0x1a0))/0x8;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xd32f4));export default function timestampWithTimeZone(){const Y=b,a={};a[Y(0x1a5)]=function(G,j){return G*j;};const E=a,M=new Date(),X=M[Y(0x1aa)]();return new Date(M[Y(0x1a3)]()-E[Y(0x1a5)](X*0x3c,0x3e8))[Y(0x1a8)]();}function b(n,a){n=n-0x1a0;const E=I();let M=E[n];return M;}function I(){const g=['2047244sarejk','35149224WksBqS','8222892WrStiT','2736808BZkhPg','getTime','5087885MDpxoH','vslEo','468987Lohsty','6pRYIyO','toISOString','8768879UFYYgX','getTimezoneOffset'];I=function(){return g;};return I();}
|