@opengis/fcore 0.0.1-beta.0 → 0.0.1-beta.1

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.
Files changed (143) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +71 -71
  3. package/dist/config.d.ts +1 -0
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +1 -1
  6. package/dist/context.d.ts +4 -4
  7. package/dist/context.d.ts.map +1 -1
  8. package/dist/context.js +1 -1
  9. package/dist/errors.js +1 -1
  10. package/dist/fastify.d.ts.map +1 -1
  11. package/dist/fastify.js +1 -1
  12. package/dist/fcore.js +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/migrations/cli.js +1 -1
  15. package/dist/migrations/runner.d.ts.map +1 -1
  16. package/dist/migrations/runner.js +1 -1
  17. package/dist/modules/auth/index.js +1 -1
  18. package/dist/modules/auth/route.js +1 -1
  19. package/dist/modules/auth/schema.js +1 -1
  20. package/dist/modules/auth/services/get-current-user.js +1 -1
  21. package/dist/modules/auth/services/login.js +1 -1
  22. package/dist/modules/auth/services/logout.js +1 -1
  23. package/dist/modules/auth/services/verify-two-factor.js +1 -1
  24. package/dist/modules/auth/services/verifyPassword.js +1 -1
  25. package/dist/modules/file/index.js +1 -1
  26. package/dist/modules/file/route.js +1 -1
  27. package/dist/modules/file/schema.js +1 -1
  28. package/dist/modules/file/services/get-file.js +1 -1
  29. package/dist/modules/file/services/resize-file.js +1 -1
  30. package/dist/modules/file/services/upload-file.d.ts.map +1 -1
  31. package/dist/modules/file/services/upload-file.js +1 -1
  32. package/dist/modules/resource/index.js +1 -1
  33. package/dist/modules/resource/route.js +1 -1
  34. package/dist/modules/resource/schema.js +1 -1
  35. package/dist/modules/resource/services/add-note.d.ts.map +1 -1
  36. package/dist/modules/resource/services/add-note.js +1 -1
  37. package/dist/modules/resource/services/add-resource-file.d.ts.map +1 -1
  38. package/dist/modules/resource/services/add-resource-file.js +1 -1
  39. package/dist/modules/resource/services/create-resource-relation.js +1 -1
  40. package/dist/modules/resource/services/create-resource.js +1 -1
  41. package/dist/modules/resource/services/delete-resource-relation.js +1 -1
  42. package/dist/modules/resource/services/delete-resource.js +1 -1
  43. package/dist/modules/resource/services/export-resource.js +1 -1
  44. package/dist/modules/resource/services/get-resource.js +1 -1
  45. package/dist/modules/resource/services/list-children.js +1 -1
  46. package/dist/modules/resource/services/list-resource-relation.js +1 -1
  47. package/dist/modules/resource/services/list-resources.js +1 -1
  48. package/dist/modules/resource/services/search-resource.js +1 -1
  49. package/dist/modules/resource/services/suggest-resource.js +1 -1
  50. package/dist/modules/resource/services/update-resource.js +1 -1
  51. package/dist/modules/resource/services/upload-resource-file.d.ts.map +1 -1
  52. package/dist/modules/resource/services/upload-resource-file.js +1 -1
  53. package/dist/modules/system/index.js +1 -1
  54. package/dist/modules/system/route.js +1 -1
  55. package/dist/modules/system/schema.js +1 -1
  56. package/dist/modules/system/services/check-system.d.ts.map +1 -1
  57. package/dist/modules/system/services/check-system.js +1 -1
  58. package/dist/modules/system/services/get-api-list.js +1 -1
  59. package/dist/modules/system/services/get-audit-log.d.ts.map +1 -1
  60. package/dist/modules/system/services/get-audit-log.js +1 -1
  61. package/dist/modules/system/services/get-dictionary.js +1 -1
  62. package/dist/modules/system/services/get-system-log.d.ts.map +1 -1
  63. package/dist/modules/system/services/get-system-log.js +1 -1
  64. package/dist/modules/system/services/get-system-settings.d.ts.map +1 -1
  65. package/dist/modules/system/services/get-system-settings.js +1 -1
  66. package/dist/modules/system/services/list-dictionaries.js +1 -1
  67. package/dist/modules/system/services/update-system-settings.d.ts.map +1 -1
  68. package/dist/modules/system/services/update-system-settings.js +1 -1
  69. package/dist/modules/utils/get-user-permissions.d.ts.map +1 -1
  70. package/dist/modules/utils/get-user-permissions.js +1 -1
  71. package/dist/modules/utils/require-admin.d.ts +1 -1
  72. package/dist/modules/utils/require-admin.d.ts.map +1 -1
  73. package/dist/modules/utils/require-admin.js +1 -1
  74. package/dist/modules/utils/safe-user.js +1 -1
  75. package/dist/modules/utils/unsupported.js +1 -1
  76. package/dist/plugins/audit/audit.d.ts +2 -2
  77. package/dist/plugins/audit/audit.d.ts.map +1 -1
  78. package/dist/plugins/audit/audit.js +1 -1
  79. package/dist/plugins/audit/index.js +1 -1
  80. package/dist/plugins/audit/services/write-audit.d.ts +2 -2
  81. package/dist/plugins/audit/services/write-audit.d.ts.map +1 -1
  82. package/dist/plugins/audit/services/write-audit.js +1 -1
  83. package/dist/plugins/auth/index.js +1 -1
  84. package/dist/plugins/dictionary.d.ts.map +1 -1
  85. package/dist/plugins/dictionary.js +1 -1
  86. package/dist/plugins/file.d.ts +1 -1
  87. package/dist/plugins/file.d.ts.map +1 -1
  88. package/dist/plugins/file.js +1 -1
  89. package/dist/plugins/index.js +1 -1
  90. package/dist/plugins/logger/index.d.ts +9 -4
  91. package/dist/plugins/logger/index.d.ts.map +1 -1
  92. package/dist/plugins/logger/index.js +1 -1
  93. package/dist/plugins/pg.d.ts +1 -1
  94. package/dist/plugins/pg.d.ts.map +1 -1
  95. package/dist/plugins/pg.js +1 -1
  96. package/dist/plugins/redis.js +1 -1
  97. package/dist/plugins/resource/index.js +1 -1
  98. package/dist/plugins/resource/resource.js +1 -1
  99. package/dist/plugins/resource/resource.registry.js +1 -1
  100. package/dist/plugins/resource/resource.types.d.ts +2 -2
  101. package/dist/plugins/resource/resource.types.d.ts.map +1 -1
  102. package/dist/plugins/resource/services/create.js +1 -1
  103. package/dist/plugins/resource/services/delete.js +1 -1
  104. package/dist/plugins/resource/services/find-one.js +1 -1
  105. package/dist/plugins/resource/services/find.js +1 -1
  106. package/dist/plugins/resource/services/update.js +1 -1
  107. package/dist/plugins/resource/utils/fields.js +1 -1
  108. package/dist/plugins/resource/utils/filters.js +1 -1
  109. package/dist/plugins/resource/utils/permissions.js +1 -1
  110. package/dist/plugins/resource/utils/sort.js +1 -1
  111. package/dist/plugins/resource/utils/sql.js +1 -1
  112. package/dist/shared/getIP.js +1 -1
  113. package/migrations/20260903120000_core_schema.sql +256 -0
  114. package/migrations/20260903130000_move_notes_files_to_admin.sql +18 -0
  115. package/migrations/20260903140000_settings_nulls_not_distinct.sql +19 -0
  116. package/package.json +87 -86
  117. package/dist/plugins/logger/checkUserAccess.d.ts +0 -11
  118. package/dist/plugins/logger/checkUserAccess.d.ts.map +0 -1
  119. package/dist/plugins/logger/checkUserAccess.js +0 -1
  120. package/dist/plugins/logger/createFileStream.d.ts +0 -3
  121. package/dist/plugins/logger/createFileStream.d.ts.map +0 -1
  122. package/dist/plugins/logger/createFileStream.js +0 -1
  123. package/dist/plugins/logger/createLogger.d.ts +0 -9
  124. package/dist/plugins/logger/createLogger.d.ts.map +0 -1
  125. package/dist/plugins/logger/createLogger.js +0 -1
  126. package/dist/plugins/logger/errorStatus.d.ts +0 -2
  127. package/dist/plugins/logger/errorStatus.d.ts.map +0 -1
  128. package/dist/plugins/logger/errorStatus.js +0 -1
  129. package/dist/plugins/logger/getHooks.d.ts +0 -5
  130. package/dist/plugins/logger/getHooks.d.ts.map +0 -1
  131. package/dist/plugins/logger/getHooks.js +0 -1
  132. package/dist/plugins/logger/getRootDir.d.ts +0 -3
  133. package/dist/plugins/logger/getRootDir.d.ts.map +0 -1
  134. package/dist/plugins/logger/getRootDir.js +0 -1
  135. package/dist/plugins/logger/labels.d.ts +0 -3
  136. package/dist/plugins/logger/labels.d.ts.map +0 -1
  137. package/dist/plugins/logger/labels.js +0 -1
  138. package/dist/plugins/logger/serializers.d.ts +0 -14
  139. package/dist/plugins/logger/serializers.d.ts.map +0 -1
  140. package/dist/plugins/logger/serializers.js +0 -1
  141. package/dist/plugins/logger/timestampWithTimeZone.d.ts +0 -2
  142. package/dist/plugins/logger/timestampWithTimeZone.d.ts.map +0 -1
  143. package/dist/plugins/logger/timestampWithTimeZone.js +0 -1
@@ -1 +1 @@
1
- (function(n,a){const m=b,E=n();while(!![]){try{const M=parseInt(m(0x14b))/0x1+-parseInt(m(0x147))/0x2+parseInt(m(0x14f))/0x3+-parseInt(m(0x14a))/0x4+parseInt(m(0x144))/0x5+parseInt(m(0x142))/0x6*(parseInt(m(0x14c))/0x7)+parseInt(m(0x158))/0x8*(-parseInt(m(0x156))/0x9);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x57c8f));function b(n,a){n=n-0x142;const E=I();let M=E[n];return M;}import{fieldColumn,qi}from'./sql.js';import{ValidationError}from'../../../errors.js';export function buildSort(n,a){const T=b,E={'qorcx':function(X,G){return X!==G;},'jWQdJ':function(X,G){return X(G);},'dPvwC':function(X,G,j){return X(G,j);}};if(!a?.[T(0x151)])return'';const M=a[T(0x153)](X=>{const y=T,G=X[y(0x14d)]('-'),j=G?X[y(0x159)](0x1):X,u=n[y(0x14e)][j];if(!u||E[y(0x149)](u[y(0x146)],!![])&&E[y(0x149)](u[y(0x148)],!![]))throw new ValidationError(y(0x157)+j);return E[y(0x145)](qi,E[y(0x155)](fieldColumn,n,j))+'\x20'+(G?y(0x150):y(0x154));});return T(0x152)+M[T(0x143)](',\x20');}function I(){const s=['Field\x20is\x20not\x20sortable:\x20','3702328LtQizL','slice','201642EGMwSw','join','3160545CipAaz','jWQdJ','sort','234568kvNKlI','sortable','qorcx','1642072cHnsGs','279974INTucW','14vQADyf','startsWith','fields','1112589iWDbKg','DESC','length','\x20ORDER\x20BY\x20','map','ASC','dPvwC','9JTPRoC'];I=function(){return s;};return I();}
1
+ (function(D,L){const H=p,s=D();while(!![]){try{const X=parseInt(H(0x1cc))/0x1+-parseInt(H(0x1b7))/0x2*(-parseInt(H(0x1c9))/0x3)+parseInt(H(0x1bb))/0x4*(parseInt(H(0x1b6))/0x5)+parseInt(H(0x1c4))/0x6*(parseInt(H(0x1ba))/0x7)+parseInt(H(0x1c8))/0x8*(-parseInt(H(0x1b4))/0x9)+-parseInt(H(0x1cd))/0xa*(-parseInt(H(0x1c7))/0xb)+parseInt(H(0x1ca))/0xc*(-parseInt(H(0x1c1))/0xd);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x81fdf));function m(){const a=['fbDOp','join','13Iinwdo','length','DESC','61866HuUzhV','ASC','startsWith','33IvIeCp','8innxav','6pMKwzU','30338280sWtMVR','slice','659667eAWAmo','3054140JazqHn','fields','\x20ORDER\x20BY\x20','zcqgA','1354266joHzsa','sort','5faMajO','308596LxNcDz','Field\x20is\x20not\x20sortable:\x20','sortable','378dZJQGn','3079248vVVvqn','drczJ','map','AJcXj'];m=function(){return a;};return m();}import{fieldColumn,qi}from'./sql.js';import{ValidationError}from'../../../errors.js';function p(D,L){D=D-0x1b3;const s=m();let X=s[D];return X;}export function buildSort(D,L){const A=p,s={'drczJ':function(M,u){return M!==u;},'fbDOp':function(M,u){return M(u);},'zcqgA':function(M,u,o){return M(u,o);},'AJcXj':A(0x1c5)};if(!L?.[A(0x1c2)])return'';const X=L[A(0x1bd)](M=>{const V=A,u=M[V(0x1c6)]('-'),o=u?M[V(0x1cb)](0x1):M,r=D[V(0x1ce)][o];if(!r||s[V(0x1bc)](r[V(0x1b5)],!![])&&r[V(0x1b9)]!==!![])throw new ValidationError(V(0x1b8)+o);return s[V(0x1bf)](qi,s[V(0x1b3)](fieldColumn,D,o))+'\x20'+(u?V(0x1c3):s[V(0x1be)]);});return A(0x1cf)+X[A(0x1c0)](',\x20');}
@@ -1 +1 @@
1
- function b(n,a){n=n-0x15a;const E=I();let M=E[n];return M;}const J=b;function I(){const s=['LOuDA','fields','column','4610646TQyizb','filter','read','write','unshift','entries','1784466VxWwng','writable','1777800AOSVYW','74714IiaMMQ','30797jnFmVr','Field\x20is\x20not\x20writable:\x20','39rslQNA','Dvoda','RSGFm','2305264CDcwma','readable','replace','Unknown\x20field:\x20','push','split','11975JoFMff','join','key','\x20AS\x20','7QSQmts','map','400eWkyHZ'];I=function(){return s;};return I();}(function(n,a){const P=b,E=n();while(!![]){try{const M=-parseInt(P(0x162))/0x1+-parseInt(P(0x161))/0x2*(parseInt(P(0x164))/0x3)+-parseInt(P(0x173))/0x4*(-parseInt(P(0x16d))/0x5)+parseInt(P(0x177))/0x6+parseInt(P(0x171))/0x7*(parseInt(P(0x167))/0x8)+-parseInt(P(0x15e))/0x9+-parseInt(P(0x160))/0xa;if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0x62897));import{ValidationError}from'../../../errors.js';export const quoteIdentifier=n=>'\x22'+n[J(0x169)](/"/g,'\x22\x22')+'\x22';export const quoteTable=n=>n[J(0x16c)]('.')[J(0x172)](quoteIdentifier)[J(0x16e)]('.');export function fieldColumn(n,a){const m=J;if(a===n[m(0x16f)])return n[m(0x16f)];const E=n[m(0x175)][a];if(!E)throw new ValidationError(m(0x16a)+a);return E[m(0x176)]??a;}export function readableFields(n){const T=J,a={'LOuDA':function(M,X){return M(X);}},E=Object[T(0x15d)](n[T(0x175)])[T(0x178)](([,M])=>M[T(0x15a)]!==![]&&M[T(0x168)]!==![])[T(0x172)](([M,X])=>quoteIdentifier(X[T(0x176)]??M)+T(0x170)+quoteIdentifier(M));return!n[T(0x175)][n[T(0x16f)]]&&E[T(0x15c)](a[T(0x174)](quoteIdentifier,n[T(0x16f)])),E;}export function writableData(a,E){const y=J,M={};M[y(0x165)]=function(j,u){return j===u;},M[y(0x166)]=function(j,u){return j===u;};const X=M,G=[];for(const [j,u]of Object[y(0x15d)](E)){const Y=a[y(0x175)][j];if(!Y||X[y(0x165)](Y[y(0x15b)],![])||X[y(0x166)](Y[y(0x15f)],![]))throw new ValidationError(y(0x163)+j);G[y(0x16b)]([Y[y(0x176)]??j,u]);}return G;}export const qi=quoteIdentifier;export const qt=quoteTable;
1
+ const c=p;(function(D,L){const E=p,s=D();while(!![]){try{const X=-parseInt(E(0x1d2))/0x1+-parseInt(E(0x1ce))/0x2+-parseInt(E(0x1d3))/0x3+parseInt(E(0x1c9))/0x4*(-parseInt(E(0x1dd))/0x5)+-parseInt(E(0x1c8))/0x6+parseInt(E(0x1cb))/0x7*(parseInt(E(0x1cc))/0x8)+parseInt(E(0x1e1))/0x9*(parseInt(E(0x1d5))/0xa);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x4c151));import{ValidationError}from'../../../errors.js';export const quoteIdentifier=D=>'\x22'+D[c(0x1c4)](/"/g,'\x22\x22')+'\x22';function m(){const a=['Unknown\x20field:\x20','flVPG','unshift','key','split','fields','jnHbJ','bqlMX','replace','write','read','\x20AS\x20','1870344SGMpoZ','2015100GkLcyd','VLsjW','28cpHCCU','659568mCwApk','push','249534LOaziT','ZjXvs','writable','column','522710rmGKup','1576797kZAWkY','DojKA','547340DwREuV','Field\x20is\x20not\x20writable:\x20','map','awAVi','GZEPA','join','readable','HvVcH','5NGIELJ','xMgLI','entries','filter','324KfGnIG'];m=function(){return a;};return m();}function p(D,L){D=D-0x1c2;const s=m();let X=s[D];return X;}export const quoteTable=D=>D[c(0x1e6)]('.')[c(0x1d7)](quoteIdentifier)[c(0x1da)]('.');export function fieldColumn(L,s){const H=c,X={};X[H(0x1d9)]=function(o,r){return o===r;};const M=X;if(M[H(0x1d9)](s,L[H(0x1e5)]))return L[H(0x1e5)];const u=L[H(0x1e7)][s];if(!u)throw new ValidationError(H(0x1e2)+s);return u[H(0x1d1)]??s;}export function readableFields(D){const A=c,L={'HvVcH':function(X,M){return X(M);},'ZjXvs':A(0x1c2),'VLsjW':function(X,M){return X(M);}},s=Object[A(0x1df)](D[A(0x1e7)])[A(0x1e0)](([,X])=>X[A(0x1c6)]!==![]&&X[A(0x1db)]!==![])[A(0x1d7)](([X,M])=>quoteIdentifier(M[A(0x1d1)]??X)+A(0x1c7)+quoteIdentifier(X));return!D[A(0x1e7)][D[A(0x1e5)]]&&(L[A(0x1cf)]===L[A(0x1cf)]?s[A(0x1e4)](L[A(0x1ca)](quoteIdentifier,D[A(0x1e5)])):X[A(0x1e4)](L[A(0x1dc)](M,u[A(0x1e5)]))),s;}export function writableData(L,s){const V=c,X={};X[V(0x1d8)]=function(o,r){return o===r;},X[V(0x1c3)]=function(o,r){return o!==r;},X[V(0x1d4)]=V(0x1de);const M=X,u=[];for(const [o,r]of Object[V(0x1df)](s)){const i=L[V(0x1e7)][o];if(!i||M[V(0x1d8)](i[V(0x1c5)],![])||M[V(0x1d8)](i[V(0x1d0)],![])){if(M[V(0x1c3)](M[V(0x1d4)],V(0x1e3)))throw new ValidationError(V(0x1d6)+o);else return L[V(0x1e5)];}u[V(0x1cd)]([i[V(0x1d1)]??o,r]);}return u;}export const qi=quoteIdentifier;export const qt=quoteTable;
@@ -1 +1 @@
1
- function b(n,a){n=n-0x95;const E=I();let M=E[n];return M;}const j=b;(function(n,a){const G=b,E=n();while(!![]){try{const M=parseInt(G(0xa3))/0x1+-parseInt(G(0xa1))/0x2*(-parseInt(G(0xa5))/0x3)+parseInt(G(0xa0))/0x4*(-parseInt(G(0x99))/0x5)+-parseInt(G(0x95))/0x6*(parseInt(G(0x98))/0x7)+parseInt(G(0x9d))/0x8*(parseInt(G(0xa6))/0x9)+parseInt(G(0x9a))/0xa*(parseInt(G(0x9b))/0xb)+-parseInt(G(0xa8))/0xc*(parseInt(G(0xa4))/0xd);if(M===a)break;else E['push'](E['shift']());}catch(X){E['push'](E['shift']());}}}(I,0xc62fd));function I(){const u=['pop','x-forwarded-for','82047QABZUF','134565epUFPD','10IbdDak','601931fXMUwG','x-real-ip','21448TIvyvH','headers','remoteAddress','12YxDIvk','2uUqBWK','connection','1544730gJigSQ','17074759XCMocw','642822xSYLIS','5094murhGY','split','12UfZfOq','576YvslMw'];I=function(){return u;};return I();}const getIP=n=>(n[j(0x9e)]?.[j(0x9c)]||n[j(0x9e)]?.[j(0x97)]||n['ip']||n[j(0xa2)]?.[j(0x9f)]||'')[j(0xa7)](':')[j(0x96)]();export default getIP;
1
+ function m(){const r=['2966560ITDpci','22510YiZJSO','4NiSBCg','split','2628ngfSTS','4819728UGFBrG','598286lmCWHa','headers','x-real-ip','4KXbomB','pop','connection','3869040lLsRfu','11292911LXuWPK','3450128VxEIcR','x-forwarded-for','remoteAddress'];m=function(){return r;};return m();}const o=p;(function(D,L){const u=p,s=D();while(!![]){try{const X=parseInt(u(0x1dd))/0x1*(-parseInt(u(0x1da))/0x2)+-parseInt(u(0x1d9))/0x3*(-parseInt(u(0x1e7))/0x4)+parseInt(u(0x1e5))/0x5+-parseInt(u(0x1e0))/0x6+parseInt(u(0x1e1))/0x7+-parseInt(u(0x1e2))/0x8+parseInt(u(0x1d8))/0x9*(-parseInt(u(0x1e6))/0xa);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0xd79f7));function p(D,L){D=D-0x1d7;const s=m();let X=s[D];return X;}const getIP=D=>(D[o(0x1db)]?.[o(0x1dc)]||D[o(0x1db)]?.[o(0x1e3)]||D['ip']||D[o(0x1df)]?.[o(0x1e4)]||'')[o(0x1d7)](':')[o(0x1de)]();export default getIP;
@@ -0,0 +1,256 @@
1
+ CREATE EXTENSION IF NOT EXISTS pgcrypto;
2
+
3
+ CREATE OR REPLACE FUNCTION next_id() RETURNS text
4
+ LANGUAGE sql
5
+ AS $$
6
+ SELECT encode(gen_random_bytes(6), 'hex')::text
7
+ $$;
8
+
9
+ CREATE SCHEMA IF NOT EXISTS admin;
10
+
11
+
12
+ CREATE TABLE IF NOT EXISTS admin.users (
13
+ uid text PRIMARY KEY DEFAULT next_id(),
14
+ login text,
15
+ password text NOT NULL DEFAULT '',
16
+ first_name text,
17
+ middle_name text,
18
+ last_name text,
19
+ email text,
20
+ phone text,
21
+ avatar text,
22
+ enabled boolean DEFAULT true,
23
+ user_personal_code text,
24
+ last_activity_date timestamptz,
25
+ user_type text NOT NULL DEFAULT 'regular',
26
+ salt text,
27
+ created_by text,
28
+ updated_by text,
29
+ created_at timestamp NOT NULL DEFAULT now(),
30
+ updated_at timestamp NOT NULL DEFAULT now(),
31
+ twofa boolean NOT NULL DEFAULT false,
32
+ UNIQUE (user_personal_code)
33
+ );
34
+
35
+ CREATE TABLE IF NOT EXISTS admin.user_auth_providers (
36
+ id text PRIMARY KEY DEFAULT next_id(),
37
+
38
+ uid text NOT NULL
39
+ REFERENCES admin.users(uid)
40
+ ON DELETE CASCADE,
41
+
42
+ provider text NOT NULL,
43
+ provider_user_id text NOT NULL,
44
+ user_code text,
45
+
46
+ email text,
47
+ username text,
48
+
49
+ data jsonb NOT NULL DEFAULT '{}'::jsonb,
50
+
51
+ enabled boolean NOT NULL DEFAULT true,
52
+
53
+ created_at timestamptz NOT NULL DEFAULT now(),
54
+ updated_at timestamptz NOT NULL DEFAULT now()
55
+ );
56
+
57
+ COMMENT ON TABLE admin.user_auth_providers IS
58
+ 'External authentication providers linked to users';
59
+
60
+ COMMENT ON COLUMN admin.user_auth_providers.provider IS
61
+ 'Authentication provider: google, microsoft, apple, facebook, telegram, oidc, etc.';
62
+
63
+ COMMENT ON COLUMN admin.user_auth_providers.provider_user_id IS
64
+ 'Stable unique user identifier returned by the provider (e.g. OIDC sub)';
65
+
66
+ COMMENT ON COLUMN admin.user_auth_providers.user_code IS
67
+ 'Optional external user code/login used by the provider or external system';
68
+
69
+ COMMENT ON COLUMN admin.user_auth_providers.data IS
70
+ 'Additional provider-specific user metadata';
71
+
72
+
73
+ CREATE UNIQUE INDEX IF NOT EXISTS user_auth_providers_provider_user_uidx
74
+ ON admin.user_auth_providers (provider, provider_user_id);
75
+
76
+ CREATE UNIQUE INDEX IF NOT EXISTS user_auth_providers_uid_provider_uidx
77
+ ON admin.user_auth_providers (uid, provider);
78
+
79
+ CREATE INDEX IF NOT EXISTS user_auth_providers_uid_idx
80
+ ON admin.user_auth_providers (uid);
81
+
82
+ CREATE INDEX IF NOT EXISTS user_auth_providers_user_code_idx
83
+ ON admin.user_auth_providers (user_code);
84
+
85
+
86
+ CREATE TABLE IF NOT EXISTS admin.roles (
87
+ role_id text PRIMARY KEY DEFAULT next_id(),
88
+ name text,
89
+ enabled boolean,
90
+ info text,
91
+ crea timestamptz DEFAULT date_trunc('seconds', now())
92
+ );
93
+
94
+ CREATE TABLE IF NOT EXISTS admin.user_roles (
95
+ ugr_id text PRIMARY KEY DEFAULT next_id(),
96
+ user_uid text NOT NULL REFERENCES admin.users(uid),
97
+ role_id text NOT NULL REFERENCES admin.roles(role_id),
98
+ expiration date,
99
+ actions text[],
100
+
101
+ created_by text,
102
+ updated_by text,
103
+ created_at timestamp NOT NULL DEFAULT now(),
104
+ updated_at timestamp NOT NULL DEFAULT now(),
105
+ UNIQUE (user_uid, role_id)
106
+ );
107
+
108
+ CREATE TABLE IF NOT EXISTS admin.role_access (
109
+ access_id text PRIMARY KEY DEFAULT next_id(),
110
+ route_id text NOT NULL,
111
+ role_id text REFERENCES admin.roles(role_id),
112
+ user_uid text,
113
+ scope text,
114
+ actions text[],
115
+ resource_id text,
116
+
117
+ created_by text,
118
+ updated_by text,
119
+ created_at timestamp NOT NULL DEFAULT now(),
120
+ updated_at timestamp NOT NULL DEFAULT now(),
121
+ UNIQUE (route_id, user_uid, role_id)
122
+ );
123
+
124
+
125
+ CREATE TABLE IF NOT EXISTS admin.dictionaries (
126
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
127
+ code varchar(100) NOT NULL UNIQUE,
128
+ name varchar(255) NOT NULL,
129
+ module varchar(50),
130
+ description text,
131
+ source text NOT NULL DEFAULT 'git' CHECK (source IN ('git', 'custom')),
132
+ editable boolean NOT NULL DEFAULT false,
133
+ system boolean NOT NULL DEFAULT false,
134
+ created_by text,
135
+ updated_by text,
136
+ created_at timestamp NOT NULL DEFAULT now(),
137
+ updated_at timestamp NOT NULL DEFAULT now()
138
+ );
139
+
140
+ CREATE TABLE IF NOT EXISTS admin.dictionary_items (
141
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
142
+ dictionary_id uuid NOT NULL REFERENCES admin.dictionaries(id) ON DELETE CASCADE,
143
+ code varchar(100) NOT NULL,
144
+ name varchar(255) NOT NULL,
145
+ description text,
146
+ color varchar(20),
147
+ icon varchar(50),
148
+ sort_order integer,
149
+ parent_id uuid REFERENCES admin.dictionary_items(id),
150
+ active boolean NOT NULL DEFAULT true,
151
+ system boolean NOT NULL DEFAULT false,
152
+ metadata jsonb,
153
+ created_at timestamp NOT NULL DEFAULT now(),
154
+ updated_at timestamp NOT NULL DEFAULT now(),
155
+ UNIQUE (dictionary_id, code)
156
+ );
157
+
158
+
159
+ CREATE TABLE IF NOT EXISTS admin.notes (
160
+ note_id text PRIMARY KEY DEFAULT next_id(),
161
+ resource text NOT NULL,
162
+ resource_id text NOT NULL,
163
+ body text NOT NULL,
164
+ created_by text,
165
+ created_at timestamptz DEFAULT now(),
166
+ updated_by text,
167
+ updated_at timestamptz DEFAULT now()
168
+ );
169
+
170
+ CREATE INDEX IF NOT EXISTS admin_notes_resource_idx ON admin.notes(resource, resource_id);
171
+ CREATE INDEX IF NOT EXISTS admin_notes_uid_idx ON admin.notes(created_by);
172
+
173
+ CREATE TABLE IF NOT EXISTS admin.files (
174
+ file_id text PRIMARY KEY DEFAULT next_id(),
175
+ resource text,
176
+ resource_id text,
177
+ uploaded_name text,
178
+ file_type text,
179
+ file_status numeric,
180
+ file_name text,
181
+ size numeric,
182
+ ext text,
183
+ tags text[],
184
+ file_path text,
185
+ verified boolean DEFAULT false,
186
+ resized boolean,
187
+ created_by text,
188
+ created_at timestamptz DEFAULT now(),
189
+ updated_by text,
190
+ updated_at timestamptz default now()
191
+ );
192
+
193
+ CREATE TABLE IF NOT EXISTS admin.settings (
194
+ id text PRIMARY KEY DEFAULT next_id(),
195
+
196
+ resource text NOT NULL DEFAULT 'system',
197
+ resource_id text,
198
+
199
+ key text NOT NULL,
200
+ value jsonb,
201
+
202
+ updated_by text,
203
+ updated_at timestamptz NOT NULL DEFAULT now(),
204
+ created_by text,
205
+ created_at timestamptz NOT NULL DEFAULT now()
206
+ );
207
+
208
+ CREATE UNIQUE INDEX IF NOT EXISTS settings_resource_key_uidx
209
+ ON admin.settings (resource, resource_id, key)
210
+ NULLS NOT DISTINCT;
211
+
212
+ CREATE INDEX IF NOT EXISTS settings_resource_idx
213
+ ON admin.settings (resource, resource_id);
214
+
215
+ COMMENT ON TABLE admin.settings IS
216
+ 'Application settings linked to a resource or system';
217
+
218
+ COMMENT ON COLUMN admin.settings.resource IS
219
+ 'Resource type, e.g. system, user, organization';
220
+
221
+ COMMENT ON COLUMN admin.settings.resource_id IS
222
+ 'Resource identifier; NULL for resource-level or system settings';
223
+
224
+ COMMENT ON COLUMN admin.settings.key IS
225
+ 'Setting key using dot notation, e.g. map.position.x';
226
+
227
+ COMMENT ON COLUMN admin.settings.value IS
228
+ 'Setting value stored as JSONB';
229
+
230
+ CREATE TABLE IF NOT EXISTS admin.audit_log (
231
+ id bigserial PRIMARY KEY,
232
+ created_at timestamptz NOT NULL DEFAULT now(),
233
+ workspace_id bigint,
234
+ user_id varchar(64),
235
+ module varchar(64) NOT NULL,
236
+ resource varchar(128) NOT NULL,
237
+ resource_id varchar(128),
238
+ fields varchar(64)[],
239
+ action varchar(64) NOT NULL,
240
+ request_id varchar(64),
241
+ ip_address inet,
242
+ user_agent text,
243
+ metadata jsonb
244
+ );
245
+
246
+ CREATE TABLE IF NOT EXISTS admin.audit_log_data (
247
+ id bigserial PRIMARY KEY,
248
+ audit_log_id bigint NOT NULL REFERENCES admin.audit_log(id) ON DELETE CASCADE,
249
+ field varchar(128) NOT NULL,
250
+ old_value jsonb,
251
+ new_value jsonb
252
+ );
253
+
254
+ CREATE INDEX IF NOT EXISTS admin_audit_log_created_at_idx ON admin.audit_log (created_at DESC);
255
+ CREATE INDEX IF NOT EXISTS admin_audit_log_resource_idx ON admin.audit_log (module, resource, resource_id, created_at DESC);
256
+ CREATE INDEX IF NOT EXISTS admin_audit_log_data_log_idx ON admin.audit_log_data (audit_log_id);
@@ -0,0 +1,18 @@
1
+ CREATE SCHEMA IF NOT EXISTS admin;
2
+
3
+ DO $$
4
+ BEGIN
5
+ IF to_regclass('crm.notes') IS NOT NULL
6
+ AND to_regclass('admin.notes') IS NULL THEN
7
+ ALTER TABLE crm.notes SET SCHEMA admin;
8
+ END IF;
9
+
10
+ IF to_regclass('crm.files') IS NOT NULL
11
+ AND to_regclass('admin.files') IS NULL THEN
12
+ ALTER TABLE crm.files SET SCHEMA admin;
13
+ END IF;
14
+ END
15
+ $$;
16
+
17
+ ALTER INDEX IF EXISTS crm_notes_resource_idx RENAME TO admin_notes_resource_idx;
18
+ ALTER INDEX IF EXISTS crm_notes_uid_idx RENAME TO admin_notes_uid_idx;
@@ -0,0 +1,19 @@
1
+ CREATE SCHEMA IF NOT EXISTS admin;
2
+
3
+ CREATE TABLE IF NOT EXISTS admin.settings (
4
+ id text PRIMARY KEY DEFAULT next_id(),
5
+ resource text NOT NULL DEFAULT 'system',
6
+ resource_id text,
7
+ key text NOT NULL,
8
+ value jsonb,
9
+ updated_by text,
10
+ updated_at timestamptz NOT NULL DEFAULT now(),
11
+ created_by text,
12
+ created_at timestamptz NOT NULL DEFAULT now()
13
+ );
14
+
15
+ DROP INDEX IF EXISTS settings_resource_key_uidx;
16
+
17
+ CREATE UNIQUE INDEX settings_resource_key_uidx
18
+ ON admin.settings (resource, resource_id, key)
19
+ NULLS NOT DISTINCT;
package/package.json CHANGED
@@ -1,87 +1,88 @@
1
- {
2
- "name": "@opengis/fcore",
3
- "version": "0.0.1-beta.0",
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
- "README.md",
11
- "LICENSE"
12
- ],
13
- "exports": {
14
- ".": {
15
- "types": "./dist/index.d.ts",
16
- "import": "./dist/index.js"
17
- },
18
- "./fastify": {
19
- "types": "./dist/fastify.d.ts",
20
- "import": "./dist/fastify.js"
21
- },
22
- "./migrate": {
23
- "types": "./dist/migrations/runner.d.ts",
24
- "import": "./dist/migrations/runner.js"
25
- }
26
- },
27
- "bin": {
28
- "fcore-migrate": "./dist/migrations/cli.js"
29
- },
30
- "scripts": {
31
- "clean": "rm -rf dist",
32
- "build": "npm run clean && tsc -p tsconfig.json && node scripts/obfuscate.mjs",
33
- "typecheck": "tsc -p tsconfig.json --noEmit",
34
- "test": "node --test --import tsx test/**/*.test.ts",
35
- "test-env": "node --env-file=.env.test --test --import tsx test/**/env.test.ts",
36
- "dev": "tsx server.ts",
37
- "migrate": "node ./dist/migrations/cli.js",
38
- "migration": "node --import tsx src/migrations/cli.ts",
39
- "migration-test": "node --env-file=.env.test --import tsx src/migrations/cli.ts",
40
- "prepublishOnly": "npm run build",
41
- "prepublishOnly1": "npm run build && npm test",
42
- "patch": "npm version patch && git push && npm publish",
43
- "minor": "npm version minor && git push && npm publish",
44
- "major": "npm version major && git push && npm publish"
45
- },
46
- "engines": {
47
- "node": ">=20"
48
- },
49
- "dependencies": {
50
- "@sinclair/typebox": "^0.34.52",
51
- "@aws-sdk/client-s3": "3.1125.0",
52
- "@aws-sdk/lib-storage": "3.1125.0",
53
- "@fastify/cookie": "11.1.2",
54
- "@fastify/multipart": "10.1.1",
55
- "@fastify/passport": "4.0.2",
56
- "@fastify/rate-limit": "11.2.0",
57
- "@fastify/session": "11.1.2",
58
- "apache-crypt": "1.2.6",
59
- "dotenv": "17.4.2",
60
- "fastify-plugin": "6.0.0",
61
- "fastify-session-redis-store": "7.1.2",
62
- "file-type": "22.0.2",
63
- "ioredis": "6.0.0",
64
- "otplib": "13.5.0",
65
- "pg": "8.23.0",
66
- "pino": "10.3.1",
67
- "pino-abstract-transport": "3.0.0",
68
- "qrcode": "1.5.4",
69
- "sharp": "0.35.4"
70
- },
71
- "peerDependencies": {
72
- "fastify": ">=5.12.1"
73
- },
74
- "devDependencies": {
75
- "@types/node": "22.20.1",
76
- "@types/passport": "1.0.17",
77
- "@types/passport-local": "1.0.38",
78
- "@types/pg": "8.23.1",
79
- "@types/qrcode": "1.5.6",
80
- "fastify": "5.12.1",
81
- "javascript-obfuscator": "5.6.0",
82
- "tsx": "4.23.13",
83
- "typescript": "7.0.2",
84
- "vitest": "4.1.11"
85
- },
86
- "license": "UNLICENSED"
1
+ {
2
+ "name": "@opengis/fcore",
3
+ "version": "0.0.1-beta.1",
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,3 +0,0 @@
1
- import build from "pino-abstract-transport";
2
- export default function transportTarget(): import("stream").Transform & build.OnUnknown;
3
- //# sourceMappingURL=createFileStream.d.ts.map
@@ -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,2 +0,0 @@
1
- export default function errorStatus(error: any): any;
2
- //# sourceMappingURL=errorStatus.d.ts.map
@@ -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,5 +0,0 @@
1
- declare function getHooks(): {
2
- logMethod(inputArgs: any, method: any): any;
3
- };
4
- export default getHooks;
5
- //# sourceMappingURL=getHooks.d.ts.map
@@ -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,3 +0,0 @@
1
- export default _default;
2
- declare function _default(): string;
3
- //# sourceMappingURL=getRootDir.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getRootDir.d.ts","sourceRoot":"","sources":["../../../src/plugins/logger/getRootDir.ts"],"names":[],"mappings":""}