@opengis/fcore 0.0.1-beta.6 → 0.0.1-beta.8

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 (163) hide show
  1. package/dist/config.js +1 -1
  2. package/dist/context.js +1 -1
  3. package/dist/errors.js +1 -1
  4. package/dist/fastify.d.ts +2 -1
  5. package/dist/fastify.d.ts.map +1 -1
  6. package/dist/fastify.js +1 -1
  7. package/dist/fcore.js +1 -1
  8. package/dist/migrations/cli.js +1 -1
  9. package/dist/migrations/runner.js +1 -1
  10. package/dist/modules/auth/adduser-cli.js +1 -1
  11. package/dist/modules/auth/passwd-cli.js +1 -1
  12. package/dist/modules/auth/permission-cli.js +1 -1
  13. package/dist/modules/auth/route.d.ts.map +1 -1
  14. package/dist/modules/auth/route.js +1 -1
  15. package/dist/modules/auth/schema.d.ts +3 -0
  16. package/dist/modules/auth/schema.d.ts.map +1 -1
  17. package/dist/modules/auth/schema.js +1 -1
  18. package/dist/modules/auth/services/change-password.js +1 -1
  19. package/dist/modules/auth/services/get-current-user.d.ts +1 -0
  20. package/dist/modules/auth/services/get-current-user.d.ts.map +1 -1
  21. package/dist/modules/auth/services/get-current-user.js +1 -1
  22. package/dist/modules/auth/services/registration.js +1 -1
  23. package/dist/modules/auth/services/verify-two-factor.js +1 -1
  24. package/dist/modules/file/mime.d.ts +3 -0
  25. package/dist/modules/file/mime.d.ts.map +1 -0
  26. package/dist/modules/file/mime.js +1 -0
  27. package/dist/modules/file/route.d.ts.map +1 -1
  28. package/dist/modules/file/route.js +1 -1
  29. package/dist/modules/file/schema.d.ts +3 -0
  30. package/dist/modules/file/schema.d.ts.map +1 -1
  31. package/dist/modules/file/schema.js +1 -1
  32. package/dist/modules/file/services/get-file.js +1 -1
  33. package/dist/modules/file/services/resize-file.d.ts.map +1 -1
  34. package/dist/modules/file/services/resize-file.js +1 -1
  35. package/dist/modules/file/services/upload-file.d.ts +4 -6
  36. package/dist/modules/file/services/upload-file.d.ts.map +1 -1
  37. package/dist/modules/file/services/upload-file.js +1 -1
  38. package/dist/modules/resource/route.d.ts +0 -3
  39. package/dist/modules/resource/route.d.ts.map +1 -1
  40. package/dist/modules/resource/route.js +1 -1
  41. package/dist/modules/resource/schema.d.ts +3 -0
  42. package/dist/modules/resource/schema.d.ts.map +1 -1
  43. package/dist/modules/resource/schema.js +1 -1
  44. package/dist/modules/resource/services/add-note.js +1 -1
  45. package/dist/modules/resource/services/add-resource-file.js +1 -1
  46. package/dist/modules/resource/services/create-resource-relation.js +1 -1
  47. package/dist/modules/resource/services/create-resource.js +1 -1
  48. package/dist/modules/resource/services/delete-resource-relation.js +1 -1
  49. package/dist/modules/resource/services/delete-resource.js +1 -1
  50. package/dist/modules/resource/services/export-resource.d.ts.map +1 -1
  51. package/dist/modules/resource/services/export-resource.js +1 -1
  52. package/dist/modules/resource/services/get-resource.d.ts.map +1 -1
  53. package/dist/modules/resource/services/get-resource.js +1 -1
  54. package/dist/modules/resource/services/list-resource-relation.d.ts +2 -0
  55. package/dist/modules/resource/services/list-resource-relation.d.ts.map +1 -1
  56. package/dist/modules/resource/services/list-resource-relation.js +1 -1
  57. package/dist/modules/resource/services/list-resources.d.ts.map +1 -1
  58. package/dist/modules/resource/services/list-resources.js +1 -1
  59. package/dist/modules/resource/services/search-resource.d.ts.map +1 -1
  60. package/dist/modules/resource/services/search-resource.js +1 -1
  61. package/dist/modules/resource/services/suggest-resource.d.ts.map +1 -1
  62. package/dist/modules/resource/services/suggest-resource.js +1 -1
  63. package/dist/modules/resource/services/update-resource-relation.d.ts +10 -0
  64. package/dist/modules/resource/services/update-resource-relation.d.ts.map +1 -0
  65. package/dist/modules/resource/services/update-resource-relation.js +1 -0
  66. package/dist/modules/resource/services/update-resource.js +1 -1
  67. package/dist/modules/resource/services/upload-resource-file.js +1 -1
  68. package/dist/modules/system/route.d.ts.map +1 -1
  69. package/dist/modules/system/route.js +1 -1
  70. package/dist/modules/system/schema.js +1 -1
  71. package/dist/modules/system/services/check-system.d.ts.map +1 -1
  72. package/dist/modules/system/services/check-system.js +1 -1
  73. package/dist/modules/system/services/get-access.d.ts.map +1 -1
  74. package/dist/modules/system/services/get-access.js +1 -1
  75. package/dist/modules/system/services/get-api-list.d.ts.map +1 -1
  76. package/dist/modules/system/services/get-api-list.js +1 -1
  77. package/dist/modules/system/services/get-audit-log.d.ts.map +1 -1
  78. package/dist/modules/system/services/get-audit-log.js +1 -1
  79. package/dist/modules/system/services/get-dictionary.js +1 -1
  80. package/dist/modules/system/services/get-system-log.d.ts.map +1 -1
  81. package/dist/modules/system/services/get-system-log.js +1 -1
  82. package/dist/modules/system/services/get-system-settings.d.ts.map +1 -1
  83. package/dist/modules/system/services/get-system-settings.js +1 -1
  84. package/dist/modules/system/services/list-dictionaries.js +1 -1
  85. package/dist/modules/system/services/set-access.d.ts.map +1 -1
  86. package/dist/modules/system/services/set-access.js +1 -1
  87. package/dist/modules/system/services/update-dictionary.d.ts.map +1 -1
  88. package/dist/modules/system/services/update-dictionary.js +1 -1
  89. package/dist/modules/system/services/update-system-settings.d.ts.map +1 -1
  90. package/dist/modules/system/services/update-system-settings.js +1 -1
  91. package/dist/modules/utils/require-admin.js +1 -1
  92. package/dist/modules/utils/safe-user.js +1 -1
  93. package/dist/modules/utils/unsupported.js +1 -1
  94. package/dist/plugins/audit/audit.js +1 -1
  95. package/dist/plugins/audit/services/write-audit.js +1 -1
  96. package/dist/plugins/auth/get-user-permissions.js +1 -1
  97. package/dist/plugins/auth/index.d.ts.map +1 -1
  98. package/dist/plugins/auth/index.js +1 -1
  99. package/dist/plugins/auth/verifyUser.js +1 -1
  100. package/dist/plugins/dictionary.d.ts +3 -0
  101. package/dist/plugins/dictionary.d.ts.map +1 -1
  102. package/dist/plugins/dictionary.js +1 -1
  103. package/dist/plugins/file.d.ts +3 -6
  104. package/dist/plugins/file.d.ts.map +1 -1
  105. package/dist/plugins/file.js +1 -1
  106. package/dist/plugins/index.d.ts +1 -0
  107. package/dist/plugins/index.d.ts.map +1 -1
  108. package/dist/plugins/index.js +1 -1
  109. package/dist/plugins/jwt.d.ts +4 -0
  110. package/dist/plugins/jwt.d.ts.map +1 -0
  111. package/dist/plugins/jwt.js +1 -0
  112. package/dist/plugins/logger/index.js +1 -1
  113. package/dist/plugins/logger/transport.js +1 -1
  114. package/dist/plugins/pg.d.ts.map +1 -1
  115. package/dist/plugins/pg.js +1 -1
  116. package/dist/plugins/redis.js +1 -1
  117. package/dist/plugins/resource/resource.d.ts.map +1 -1
  118. package/dist/plugins/resource/resource.js +1 -1
  119. package/dist/plugins/resource/resource.registry.js +1 -1
  120. package/dist/plugins/resource/resource.types.d.ts +18 -3
  121. package/dist/plugins/resource/resource.types.d.ts.map +1 -1
  122. package/dist/plugins/resource/services/add-dictionary-lookup-data.d.ts +3 -0
  123. package/dist/plugins/resource/services/add-dictionary-lookup-data.d.ts.map +1 -0
  124. package/dist/plugins/resource/services/add-dictionary-lookup-data.js +1 -0
  125. package/dist/plugins/resource/services/add-file-token.d.ts +3 -0
  126. package/dist/plugins/resource/services/add-file-token.d.ts.map +1 -0
  127. package/dist/plugins/resource/services/add-file-token.js +1 -0
  128. package/dist/plugins/resource/services/add-table-lookup-data.d.ts +4 -0
  129. package/dist/plugins/resource/services/add-table-lookup-data.d.ts.map +1 -0
  130. package/dist/plugins/resource/services/add-table-lookup-data.js +1 -0
  131. package/dist/plugins/resource/services/create-relation.js +1 -1
  132. package/dist/plugins/resource/services/create.d.ts.map +1 -1
  133. package/dist/plugins/resource/services/create.js +1 -1
  134. package/dist/plugins/resource/services/delete-relation.js +1 -1
  135. package/dist/plugins/resource/services/delete.d.ts.map +1 -1
  136. package/dist/plugins/resource/services/delete.js +1 -1
  137. package/dist/plugins/resource/services/find-one.d.ts +3 -2
  138. package/dist/plugins/resource/services/find-one.d.ts.map +1 -1
  139. package/dist/plugins/resource/services/find-one.js +1 -1
  140. package/dist/plugins/resource/services/find-relation.d.ts +3 -2
  141. package/dist/plugins/resource/services/find-relation.d.ts.map +1 -1
  142. package/dist/plugins/resource/services/find-relation.js +1 -1
  143. package/dist/plugins/resource/services/find.d.ts.map +1 -1
  144. package/dist/plugins/resource/services/find.js +1 -1
  145. package/dist/plugins/resource/services/update-relation.d.ts +11 -0
  146. package/dist/plugins/resource/services/update-relation.d.ts.map +1 -0
  147. package/dist/plugins/resource/services/update-relation.js +1 -0
  148. package/dist/plugins/resource/services/update.d.ts.map +1 -1
  149. package/dist/plugins/resource/services/update.js +1 -1
  150. package/dist/plugins/resource/utils/auto-index.d.ts +4 -0
  151. package/dist/plugins/resource/utils/auto-index.d.ts.map +1 -0
  152. package/dist/plugins/resource/utils/auto-index.js +1 -0
  153. package/dist/plugins/resource/utils/fields.js +1 -1
  154. package/dist/plugins/resource/utils/filters.d.ts +3 -2
  155. package/dist/plugins/resource/utils/filters.d.ts.map +1 -1
  156. package/dist/plugins/resource/utils/filters.js +1 -1
  157. package/dist/plugins/resource/utils/permissions.js +1 -1
  158. package/dist/plugins/resource/utils/sort.d.ts.map +1 -1
  159. package/dist/plugins/resource/utils/sort.js +1 -1
  160. package/dist/plugins/resource/utils/sql.js +1 -1
  161. package/dist/shared/getIP.js +1 -1
  162. package/migrations/20260907090000_core_schema.sql +2 -0
  163. package/package.json +93 -92
@@ -1 +1 @@
1
- function H(){const q=['deleteRelation'];H=function(){return q;};return H();}function T(r,u){r=r-0xee;const G=H();let o=G[r];return o;}export async function deleteResourceRelation(r,u){const a=T,{resource:G,id:o,relation:X,relationId:w}=r;return u['resource'][a(0xee)]({'name':G,'id':o,'relation':X,'relationId':w});}
1
+ function A(z,j){z=z-0x10f;const c=U();let p=c[z];return p;}function U(){const b=['resource'];U=function(){return b;};return U();}export async function deleteResourceRelation(z,j){const i=A,{resource:c,id:p,relation:M,relationId:H}=z;return j[i(0x10f)]['deleteRelation']({'name':c,'id':p,'relation':M,'relationId':H});}
@@ -1 +1 @@
1
- export async function deleteResource(r,u){var G=T;return u[G(0xb1)]['delete']({'name':r[G(0xb1)],'id':r['id'],'user':r['user']});}function T(r,u){r=r-0xb1;var G=H();var o=G[r];return o;}function H(){var o=['resource'];H=function(){return o;};return H();}
1
+ function A(z,j){z=z-0x186;var c=U();var p=c[z];return p;}export async function deleteResource(z,j){var c=A;return j[c(0x186)]['delete']({'name':z['resource'],'id':z['id'],'user':z['user']});}function U(){var p=['resource'];U=function(){return p;};return U();}
@@ -1 +1 @@
1
- {"version":3,"file":"export-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/export-resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAcrG"}
1
+ {"version":3,"file":"export-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/export-resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,wBAAsB,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAcrG"}
@@ -1 +1 @@
1
- function T(r,u){r=r-0x150;const G=H();let o=G[r];return o;}function H(){const X=['resource'];H=function(){return X;};return H();}export async function exportResource(r,u){const o=T,G=await u['resource']['find']({'name':r[o(0x150)],'query':{'filter':r['filter'],'sort':r['sort'],'search':r['search'],'limit':r['limit'],'offset':r['offset'],'fields':r['fields']},'user':r['user']});return G['rows'];}
1
+ import{parseFilterQuery}from'../../../plugins/resource/utils/filters.js';function A(z,j){z=z-0x1c3;const c=U();let p=c[z];return p;}function U(){const M=['find'];U=function(){return M;};return U();}export async function exportResource(z,j){const p=A,c=await j['resource'][p(0x1c3)]({'name':z['resource'],'query':{'filter':parseFilterQuery(z),'sort':z['sort'],'search':z['search'],'limit':z['limit'],'offset':z['offset'],'fields':z['fields']},'user':z['user']});return c['rows'];}
@@ -1 +1 @@
1
- {"version":3,"file":"get-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/get-resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,wBAAsB,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAE5E"}
1
+ {"version":3,"file":"get-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/get-resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,wBAAsB,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAO5E"}
@@ -1 +1 @@
1
- function H(){var o=['resource','findOne','user'];H=function(){return o;};return H();}function T(r,u){r=r-0xb9;var G=H();var o=G[r];return o;}export async function getResource(r,u){var G=T;return u[G(0xb9)][G(0xba)]({'name':r[G(0xb9)],'id':r['id'],'user':r[G(0xbb)]});}
1
+ export async function getResource(z,j){var c=A;return j[c(0x183)]['findOne']({'name':z['resource'],'id':z['id'],'query':{'include':z[c(0x184)]},'user':z['user']});}function A(z,j){z=z-0x183;var c=U();var p=c[z];return p;}function U(){var p=['resource','include'];U=function(){return p;};return U();}
@@ -2,10 +2,12 @@
2
2
  * Implements the list resource relation application service for its module.
3
3
  */
4
4
  import type { AppContext, User } from '../../../context.js';
5
+ import type { ResourceQuery } from '../../../plugins/resource/resource.types.js';
5
6
  export declare function listResourceRelation(params: {
6
7
  resource: string;
7
8
  id: string;
8
9
  relation: string;
10
+ query?: ResourceQuery;
9
11
  user?: User;
10
12
  }, ctx: AppContext): Promise<any>;
11
13
  //# sourceMappingURL=list-resource-relation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-resource-relation.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/list-resource-relation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,oBAAoB,CACxC,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,EACvE,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAGd"}
1
+ {"version":3,"file":"list-resource-relation.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/list-resource-relation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF,wBAAsB,oBAAoB,CACxC,MAAM,EAAE;IACN,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAGd"}
@@ -1 +1 @@
1
- export async function listResourceRelation(r,u){const {resource:G,id:o,relation:X,user:w}=r;return u['resource']['findRelation']({'name':G,'id':o,'relation':X,'user':w});}
1
+ function U(){const n=['resource'];U=function(){return n;};return U();}function A(z,j){z=z-0x7b;const c=U();let p=c[z];return p;}export async function listResourceRelation(z,j){const b=A,{resource:c,id:p,relation:M,query:H,user:i}=z;return j[b(0x7b)]['findRelation']({'name':c,'id':p,'relation':M,'query':H,'user':i});}
@@ -1 +1 @@
1
- {"version":3,"file":"list-resources.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/list-resources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,wBAAsB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAY9E"}
1
+ {"version":3,"file":"list-resources.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/list-resources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAY9E"}
@@ -1 +1 @@
1
- function H(){var o=['find','limit','offset','page','user'];H=function(){return o;};return H();}function T(r,u){r=r-0x1cd;var G=H();var o=G[r];return o;}export async function listResources(r,u){var G=T;return u['resource'][G(0x1cd)]({'name':r['resource'],'query':{'filter':r['filter'],'sort':r['sort'],'search':r['search'],'limit':r[G(0x1ce)],'offset':r[G(0x1cf)]??(r['page']?Math['max'](r[G(0x1d0)]-0x1,0x0):0x0)*(r[G(0x1ce)]??0x14)},'user':r[G(0x1d1)]});}
1
+ function A(z,j){z=z-0x184;var c=U();var p=c[z];return p;}import{parseFilterQuery}from'../../../plugins/resource/utils/filters.js';export async function listResources(z,j){var c=A;return j['resource']['find']({'name':z['resource'],'query':{'filter':parseFilterQuery(z),'sort':z['sort'],'search':z['search'],'limit':z[c(0x184)],'offset':z[c(0x185)]??(z[c(0x186)]?Math[c(0x187)](z['page']-0x1,0x0):0x0)*(z['limit']??0x14)},'user':z['user']});}function U(){var p=['limit','offset','page','max'];U=function(){return p;};return U();}
@@ -1 +1 @@
1
- {"version":3,"file":"search-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/search-resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,wBAAsB,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAE/E"}
1
+ {"version":3,"file":"search-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/search-resource.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAE/E"}
@@ -1 +1 @@
1
- export async function searchResource(r,u){return u['resource']['find']({'name':r['resource'],'query':{...r,'filter':r['filter']},'user':r['user']});}
1
+ function A(z,j){z=z-0x1c0;var c=U();var p=c[z];return p;}import{parseFilterQuery}from'../../../plugins/resource/utils/filters.js';export async function searchResource(z,j){var c=A;return j['resource']['find']({'name':z['resource'],'query':{...z,'filter':parseFilterQuery(z)},'user':z[c(0x1c0)]});}function U(){var p=['user'];U=function(){return p;};return U();}
@@ -1 +1 @@
1
- {"version":3,"file":"suggest-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/suggest-resource.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,KAAK,qBAAqB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAElB,CAAC;AAEF,wBAAsB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuClG"}
1
+ {"version":3,"file":"suggest-resource.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/suggest-resource.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,KAAK,qBAAqB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAElB,CAAC;AAEF,wBAAsB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4ClG"}
@@ -1 +1 @@
1
- import{ValidationError}from'../../../errors.js';function H(){const P=['search','min','max','limit','lookup','query','\x20WHERE\x20lower(','toLowerCase','rows','Field\x20has\x20no\x20lookup\x20dictionary:\x20','filter','startsWith','now'];H=function(){return P;};return H();}function T(r,u){r=r-0x172;const G=H();let o=G[r];return o;}export async function suggestResource(r,u){const h=T,G=u['resource']['get'](r['resource']),o=String(r[h(0x172)]??r['q']??'')['toLowerCase'](),X=Math[h(0x173)](Math[h(0x174)](Number(r[h(0x175)]??0x14),0x1),0xc8),w=Date['now'](),a=G['fields'][r['field']],q=a?.['lookup']?.['dictionary'],p=a?.[h(0x176)]?.['table'];if(p){const Y=a?.['lookup']?.['textField'],S=a?.['lookup']?.['valueField'],I=await u['pg'][h(0x177)]('SELECT\x20'+S+'\x20as\x20id,\x20'+Y+'\x20as\x20text\x20FROM\x20'+p+h(0x178)+Y+')\x20~\x20$1\x20LIMIT\x20$2',[''+o[h(0x179)](),X])['then'](c=>c[h(0x17a)]);return{'limit':X,'count':I['length'],'search':o,'time':Date['now']()-w,'data':I};}if(!q)throw new ValidationError(h(0x17b)+r['field']);const F=await u['dictionary']['get'](q),E=F[h(0x17c)](c=>!o||c['code'][h(0x17d)](o)||c['name'][h(0x17d)](o))['slice'](0x0,X);return{'search':o,'limit':X,'count':E['length'],'time':Date[h(0x17e)]()-w,'data':E};}
1
+ import{ValidationError}from'../../../errors.js';function A(z,j){z=z-0x119;const c=U();let p=c[z];return p;}import{autoIndex}from'../../../plugins/resource/utils/auto-index.js';export async function suggestResource(z,j){const P=A,c=j['resource'][P(0x119)](z[P(0x11a)]),p=String(z['search']??z['q']??'')['toLowerCase'](),M=Math['min'](Math['max'](Number(z[P(0x11b)]??0x14),0x1),0xc8),H=Date[P(0x11c)](),i=c['fields'][z['field']],b=i?.['lookup']?.['dictionary'],n=i?.['lookup']?.[P(0x11d)];if(n){const q=i['lookup']?.[P(0x11e)]??P(0x11f),Z=i[P(0x120)]?.['valueField']??'id';autoIndex(n,q,'text',j['pg']);const e=await j['pg']['query']('SELECT\x20'+Z+P(0x121)+q+P(0x122)+n+'\x20WHERE\x20lower('+q+')\x20~\x20$1\x20LIMIT\x20$2',[''+p[P(0x123)](),M])[P(0x124)](o=>o['rows']);return{'limit':M,'count':e['length'],'search':p,'time':Date['now']()-H,'data':e};}if(!b)throw new ValidationError(P(0x125)+z['field']);const v=await j['dictionary']['get'](b),r=v['filter'](o=>!p||o['code']['startsWith'](p)||o['name']['startsWith'](p))['slice'](0x0,M)[P(0x126)](o=>({'id':o[P(0x127)]||o['id'],'text':o[P(0x11f)]||o[P(0x128)]}));return{'search':p,'limit':M,'count':r['length'],'time':Date['now']()-H,'data':r};}function U(){const t=['get','resource','limit','now','table','textField','name','lookup','\x20as\x20id,\x20','\x20as\x20text\x20FROM\x20','toLowerCase','then','Field\x20has\x20no\x20lookup\x20dictionary:\x20','map','code','text'];U=function(){return t;};return U();}
@@ -0,0 +1,10 @@
1
+ import type { AppContext, User } from "../../../context.js";
2
+ export declare function updateResourceRelation(params: {
3
+ resource: string;
4
+ id: string;
5
+ relation: string;
6
+ relationId: string;
7
+ data: Record<string, unknown>;
8
+ user?: User;
9
+ }, ctx: AppContext): Promise<Record<string, unknown>>;
10
+ //# sourceMappingURL=update-resource-relation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-resource-relation.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/update-resource-relation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,sBAAsB,CACxC,MAAM,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,IAAI,CAAC;CACf,EACD,GAAG,EAAE,UAAU,GAChB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAUlC"}
@@ -0,0 +1 @@
1
+ function A(z,j){z=z-0x132;const c=U();let p=c[z];return p;}export async function updateResourceRelation(z,j){const n=A,{resource:c,id:p,relation:M,relationId:H,data:i,user:b}=z;return j[n(0x132)]['updateRelation']({'name':c,'id':p,'relation':M,'relationId':H,'data':i,'user':b});}function U(){const v=['resource'];U=function(){return v;};return U();}
@@ -1 +1 @@
1
- export async function updateResource(r,u){return u['resource']['update']({'name':r['resource'],'id':r['id'],'data':r['patch'],'user':r['user']});}
1
+ function A(z,j){z=z-0x6d;var c=U();var p=c[z];return p;}export async function updateResource(z,j){var c=A;return j[c(0x6d)]['update']({'name':z[c(0x6d)],'id':z['id'],'data':z['patch'],'user':z['user']});}function U(){var p=['resource'];U=function(){return p;};return U();}
@@ -1 +1 @@
1
- import{ForbiddenError,NotFoundError,ValidationError}from'../../../errors.js';export async function uploadResourceFile(r,u){const a=T,G=u[a(0xf3)]['get'](r['resource']);if(G[a(0xf4)]==='admin'&&r['user']?.['type']!=='admin')throw new ForbiddenError('Admin\x20access\x20required');if(r['user']?.[a(0xf5)]!==a(0xf6)&&!r[a(0xf7)]?.['permissions']?.['includes']((G['permission']??G['name'])+':update'))throw new ForbiddenError('Missing\x20permission:\x20'+(G['permission']??G['name'])+':update');if(!Buffer['isBuffer'](r['file'])||r[a(0xf8)]['length']===0x0)throw new ValidationError(a(0xf9));const o=r['fileName'][a(0xfa)](/[^A-Za-z0-9._-]/g,'_');if(!o)throw new ValidationError(a(0xfb));const X='files/'+r['resource']+'/'+String(r['id'])+'/'+o;await u['file']['put'](X,r['file']);if(!await u['file']['exists'](X))throw new NotFoundError('Uploaded\x20file\x20not\x20found');const w=await u['pg'][a(0xfc)]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.files\x20(resource,\x20resource_id,\x20file_path,\x20size)\x0a\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20*\x0a\x20\x20\x20\x20',[r['resource'],String(r['id']),X,r['file'][a(0xfd)]]);return w['rows'][0x0];}function T(r,u){r=r-0xf3;const G=H();let o=G[r];return o;}function H(){const q=['resource','access','type','admin','user','file','File\x20is\x20required','replace','File\x20name\x20is\x20required','query','length'];H=function(){return q;};return H();}
1
+ function A(z,j){z=z-0x153;const c=U();let p=c[z];return p;}import{ForbiddenError,NotFoundError,ValidationError}from'../../../errors.js';export async function uploadResourceFile(z,j){const i=A,c=j[i(0x153)]['get'](z[i(0x153)]);if(c[i(0x154)]==='admin'&&z['user']?.['type']!==i(0x155))throw new ForbiddenError(i(0x156));if(z['user']?.['type']!=='admin'&&!z['user']?.['permissions']?.['includes']((c['permission']??c['name'])+i(0x157)))throw new ForbiddenError('Missing\x20permission:\x20'+(c[i(0x158)]??c[i(0x159)])+':update');if(!Buffer['isBuffer'](z[i(0x15a)])||z['file']['length']===0x0)throw new ValidationError(i(0x15b));const p=z['fileName']['replace'](/[^A-Za-z0-9._-]/g,'_');if(!p)throw new ValidationError('File\x20name\x20is\x20required');const M=i(0x15c)+z[i(0x153)]+'/'+String(z['id'])+'/'+p;await j['file']['put'](M,z['file']);if(!await j[i(0x15a)]['exists'](M))throw new NotFoundError(i(0x15d));const H=await j['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.files\x20(resource,\x20resource_id,\x20file_path,\x20size)\x0a\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20*\x0a\x20\x20\x20\x20',[z['resource'],String(z['id']),M,z['file']['length']]);return H['rows'][0x0];}function U(){const b=['resource','access','admin','Admin\x20access\x20required',':update','permission','name','file','File\x20is\x20required','files/','Uploaded\x20file\x20not\x20found'];U=function(){return b;};return U();}
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/modules/system/route.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAanD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,SAAS,GAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAa,GACnD,kBAAkB,CA4KpB"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/modules/system/route.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAanD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,EACf,SAAS,GAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAa,GACnD,kBAAkB,CA8JpB"}
@@ -1 +1 @@
1
- import{getSystemSettings}from'./services/get-system-settings.js';import{updateSystemSettings}from'./services/update-system-settings.js';import{getAuditLog}from'./services/get-audit-log.js';function T(r,u){r=r-0x163;const G=H();let o=G[r];return o;}import{checkSystem}from'./services/check-system.js';import{getApiList}from'./services/get-api-list.js';import{getSystemLog}from'./services/get-system-log.js';import{listDictionaries}from'./services/list-dictionaries.js';import{getDictionary}from'./services/get-dictionary.js';function H(){const Y=['get','system:dictionaries','fcore','system','Update\x20platform\x20dictionary','admin','dictionaryItems','params','accessTarget','post','Set\x20access\x20rules','access','/api/system/settings','system:settings','logger','query','type','send','system:audit','Checks\x20the\x20availability\x20of\x20system\x20dependencies.','Returns\x20the\x20list\x20of\x20registered\x20platform\x20APIs.','apiListQuery'];H=function(){return Y;};return H();}import{updateDictionary}from'./services/update-dictionary.js';import{getAccess}from'./services/get-access.js';import{setAccess}from'./services/set-access.js';import{systemSchemas}from'./schema.js';const u=G=>G['user'];export function systemRoutes(r,G=new Map()){return async o=>{const F=T;o['get']('/api/dictionaries',{'schema':{'tags':['fcore','system'],'summary':'List\x20platform\x20dictionaries','description':'Returns\x20all\x20available\x20dictionaries\x20registered\x20by\x20the\x20platform.','access':'admin','permissions':['system:dictionaries']}},async w=>listDictionaries({'user':u(w)},r)),o[F(0x163)]('/api/dictionaries/:name',{'schema':{'tags':['fcore','system'],'summary':'Get\x20platform\x20dictionary','description':'Returns\x20a\x20registered\x20platform\x20dictionary\x20by\x20name.','access':'admin','permissions':[F(0x164)],'params':systemSchemas['dictionaryName']}},async w=>getDictionary({...w['params'],'user':u(w)},r)),o['post']('/api/dictionaries/:name',{'schema':{'tags':[F(0x165),F(0x166)],'summary':F(0x167),'description':'Replaces\x20the\x20items\x20of\x20a\x20registered\x20platform\x20dictionary.','access':F(0x168),'permissions':[F(0x164)],'params':systemSchemas['dictionaryName'],'body':systemSchemas[F(0x169)]}},async w=>updateDictionary({...w[F(0x16a)],...w['body'],'user':u(w)},r));const X=async w=>getAccess({...w['params'],'user':u(w)},r);o[F(0x163)]('/api/access/:type/:id',{'schema':{'tags':['fcore','system'],'summary':'Get\x20access\x20rules','description':'Returns\x20direct\x20and\x20role-based\x20access\x20rules\x20for\x20a\x20user\x20or\x20role.','access':'admin','permissions':['system:access'],'params':systemSchemas[F(0x16b)]}},X),o[F(0x16c)]('/api/access/:type/:id',{'schema':{'tags':['fcore','system'],'summary':F(0x16d),'description':'Replaces\x20direct\x20access\x20rules\x20for\x20a\x20user\x20or\x20role.','access':F(0x168),'permissions':['system:access'],'params':systemSchemas[F(0x16b)],'body':systemSchemas[F(0x16e)]}},async w=>setAccess({...w['params'],...w['body'],'user':u(w)},r)),o['get'](F(0x16f),{'schema':{'tags':[F(0x165),'system'],'summary':'Get\x20system\x20settings','description':'Returns\x20system\x20settings\x20as\x20nested\x20JSON.','access':'admin','permissions':[F(0x170)]}},async w=>getSystemSettings({...w['params'],'user':u(w)},r)),o[F(0x16c)]('/api/system/settings',{'schema':{'tags':[F(0x165),'system'],'summary':'Update\x20system\x20settings','description':'Updates\x20system\x20settings\x20using\x20flat\x20dot-notation\x20keys.','access':F(0x168),'permissions':['system:settings'],'body':systemSchemas['settings']}},async w=>updateSystemSettings({...w['params'],'patch':w['body'],'user':u(w)},r)),o[F(0x163)]('/api/system/logger',{'schema':{'tags':['fcore',F(0x166)],'summary':'Get\x20system\x20log','description':'Returns\x20system\x20logger\x20entries\x20for\x20the\x20requested\x20path.','access':'admin','permissions':['system:logs'],'querystring':systemSchemas[F(0x171)]}},async(w,a)=>{const E=F,{contentType:q,body:p}=await getSystemLog({...w[E(0x172)],'user':u(w)},r);return a[E(0x173)](q)[E(0x174)](p);}),o['get']('/api/system/audit',{'schema':{'tags':['fcore','system'],'summary':'Get\x20audit\x20log','description':'Returns\x20the\x20system\x20audit\x20log\x20entries.','access':'admin','permissions':[F(0x175)]}},async w=>getAuditLog({...w[F(0x172)],'user':u(w)},r)),o['get']('/api/system/check',{'schema':{'tags':[F(0x165),'system'],'summary':'Check\x20system\x20health','description':F(0x176),'access':F(0x168),'permissions':['system:check']}},async w=>checkSystem({'user':u(w)},r)),o['get']('/api/system/list',{'schema':{'tags':['fcore',F(0x166)],'summary':'List\x20APIs','description':F(0x177),'access':'admin','permissions':[],'querystring':systemSchemas[F(0x178)]}},async w=>getApiList({'user':u(w),'apiRoutes':G,...w['query']},r));};}
1
+ const n=A;function U(){const r=['user','/api/dictionary/:name','fcore','Get\x20platform\x20dictionary','params','post','Update\x20platform\x20dictionary','Replaces\x20the\x20items\x20of\x20a\x20registered\x20platform\x20dictionary.','body','system','Get\x20access\x20rules','Returns\x20direct\x20and\x20role-based\x20access\x20rules\x20for\x20a\x20user\x20or\x20role.','accessTarget','admin','system:settings','Update\x20system\x20settings','settings','get','/api/system/logger','Get\x20system\x20log','Returns\x20system\x20logger\x20entries\x20for\x20the\x20requested\x20path.','List\x20APIs'];U=function(){return r;};return U();}import{getSystemSettings}from'./services/get-system-settings.js';import{updateSystemSettings}from'./services/update-system-settings.js';import{getAuditLog}from'./services/get-audit-log.js';import{checkSystem}from'./services/check-system.js';import{getApiList}from'./services/get-api-list.js';import{getSystemLog}from'./services/get-system-log.js';function A(z,j){z=z-0x1c8;const c=U();let p=c[z];return p;}import{getDictionary}from'./services/get-dictionary.js';import{updateDictionary}from'./services/update-dictionary.js';import{getAccess}from'./services/get-access.js';import{setAccess}from'./services/set-access.js';import{systemSchemas}from'./schema.js';const u=z=>z[n(0x1c8)];export function systemRoutes(z,j=new Map()){return async c=>{const v=A;c['get'](v(0x1c9),{'schema':{'tags':[v(0x1ca),'system'],'summary':v(0x1cb),'description':'Returns\x20a\x20registered\x20platform\x20dictionary\x20by\x20name.','access':v(0x1c8),'permissions':['system:dictionaries'],'params':systemSchemas['dictionaryName']}},async M=>({'items':await getDictionary({...M[v(0x1cc)],'user':u(M)},z)})),c[v(0x1cd)]('/api/dictionary/:name',{'schema':{'tags':['fcore','system'],'summary':v(0x1ce),'description':v(0x1cf),'access':'user','permissions':['system:dictionaries'],'params':systemSchemas['dictionaryName'],'body':systemSchemas['dictionaryItems']}},async M=>updateDictionary({...M[v(0x1cc)],...M[v(0x1d0)],'user':u(M)},z));const p=async M=>getAccess({...M['params'],'user':u(M)},z);c['get']('/api/access/:type/:id',{'schema':{'tags':[v(0x1ca),v(0x1d1)],'summary':v(0x1d2),'description':v(0x1d3),'access':'admin','permissions':['system:access'],'params':systemSchemas[v(0x1d4)]}},p),c[v(0x1cd)]('/api/access/:type/:id',{'schema':{'tags':['fcore','system'],'summary':'Set\x20access\x20rules','description':'Replaces\x20direct\x20access\x20rules\x20for\x20a\x20user\x20or\x20role.','access':'admin','permissions':['system:access'],'params':systemSchemas['accessTarget'],'body':systemSchemas['access']}},async M=>setAccess({...M['params'],...M['body'],'user':u(M)},z)),c['get']('/api/system/settings',{'schema':{'tags':['fcore','system'],'summary':'Get\x20system\x20settings','description':'Returns\x20system\x20settings\x20as\x20nested\x20JSON.','access':v(0x1d5),'permissions':[v(0x1d6)]}},async M=>getSystemSettings({...M[v(0x1cc)],'user':u(M)},z)),c[v(0x1cd)]('/api/system/settings',{'schema':{'tags':['fcore','system'],'summary':v(0x1d7),'description':'Updates\x20system\x20settings\x20using\x20flat\x20dot-notation\x20keys.','access':'admin','permissions':['system:settings'],'body':systemSchemas[v(0x1d8)]}},async M=>updateSystemSettings({...M['params'],'patch':M[v(0x1d0)],'user':u(M)},z)),c[v(0x1d9)](v(0x1da),{'schema':{'tags':['fcore','system'],'summary':v(0x1db),'description':v(0x1dc),'access':v(0x1c8),'permissions':['system:logs'],'querystring':systemSchemas['logger']}},async(M,H)=>{const {contentType:i,body:b}=await getSystemLog({...M['query'],'user':u(M)},z);return H['type'](i)['send'](b);}),c['get']('/api/system/audit',{'schema':{'tags':['fcore',v(0x1d1)],'summary':'Get\x20audit\x20log','description':'Returns\x20the\x20system\x20audit\x20log\x20entries.','access':'user','permissions':['system:audit']}},async M=>getAuditLog({...M['query'],'user':u(M)},z)),c['get']('/api/system/check',{'schema':{'tags':['fcore',v(0x1d1)],'summary':'Check\x20system\x20health','description':'Checks\x20the\x20availability\x20of\x20system\x20dependencies.','access':'user','permissions':['system:check']}},async M=>checkSystem({'user':u(M)},z)),c['get']('/api/system/list',{'schema':{'tags':[v(0x1ca),'system'],'summary':v(0x1dd),'description':'Returns\x20the\x20list\x20of\x20registered\x20platform\x20APIs.','access':'admin','permissions':[],'querystring':systemSchemas['apiListQuery']}},async M=>getApiList({'user':u(M),'apiRoutes':j,...M['query']},z));};}
@@ -1 +1 @@
1
- const r=T;import{Type}from'@sinclair/typebox';function T(r,u){r=r-0xd0;const G=H();let o=G[r];return o;}export const identifier=Type['String']({'minLength':0x1,'maxLength':0x80,'pattern':r(0xd0)});export const systemSchemas={'dictionaryName':Type[r(0xd1)]({'name':identifier}),'dictionaryItems':Type[r(0xd1)]({'items':Type[r(0xd2)](Type[r(0xd1)]({'id':Type[r(0xd3)](Type[r(0xd4)]([Type['String'](),Type[r(0xd5)]()])),'code':Type[r(0xd6)]({'minLength':0x1}),'name':Type[r(0xd6)]({'minLength':0x1}),'parentId':Type[r(0xd3)](Type['Union']([Type['String'](),Type['Number'](),Type['Null']()]))},{'additionalProperties':!![]}))}),'accessTarget':Type[r(0xd1)]({'type':Type['Union']([Type['Literal']('user'),Type[r(0xd7)](r(0xd8))]),'id':identifier}),'access':Type['Object']({'access':Type['Array'](Type['Object']({'resource':Type['String']({'minLength':0x1,'maxLength':0x80}),'actions':Type['Array'](Type['String']({'minLength':0x1,'maxLength':0x80}),{'minItems':0x1})}))}),'apiListQuery':Type['Object']({'format':Type['Optional'](Type['Union']([Type['Literal'](r(0xd9)),Type['Literal']('extended')]))}),'settingsEntity':Type[r(0xd1)]({'entity':Type['Optional'](identifier)}),'settings':Type['Record'](Type[r(0xd6)]({'minLength':0x1}),Type['Unknown']()),'logger':Type['Object']({'path':Type[r(0xd3)](Type['String']({'maxLength':0x100,'pattern':'^[A-Za-z0-9_.\x5c-/]*$'}))})};function H(){const u=['^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$','Object','Array','Optional','Union','Number','String','Literal','role','short'];H=function(){return u;};return H();}
1
+ function A(z,j){z=z-0x110;const c=U();let p=c[z];return p;}function U(){const j=['String','^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$','Object','Union','Literal','user','Array','Unknown','Optional'];U=function(){return j;};return U();}const z=A;import{Type}from'@sinclair/typebox';export const identifier=Type[z(0x110)]({'minLength':0x1,'maxLength':0x80,'pattern':z(0x111)});export const systemSchemas={'dictionaryName':Type['Object']({'name':identifier}),'dictionaryItems':Type[z(0x112)]({'items':Type['Array'](Type[z(0x112)]({'id':Type['Optional'](Type[z(0x113)]([Type['String'](),Type['Number']()])),'code':Type['String']({'minLength':0x1}),'name':Type['String']({'minLength':0x1}),'parentId':Type['Optional'](Type['Union']([Type[z(0x110)](),Type['Number'](),Type['Null']()]))},{'additionalProperties':!![]}))}),'accessTarget':Type[z(0x112)]({'type':Type['Union']([Type[z(0x114)](z(0x115)),Type['Literal']('role')]),'id':identifier}),'access':Type['Object']({'access':Type['Array'](Type[z(0x112)]({'resource':Type['String']({'minLength':0x1,'maxLength':0x80}),'actions':Type[z(0x116)](Type['String']({'minLength':0x1,'maxLength':0x80}),{'minItems':0x1})}))}),'apiListQuery':Type['Object']({'format':Type['Optional'](Type['Union']([Type['Literal']('short'),Type['Literal']('extended')]))}),'settingsEntity':Type['Object']({'entity':Type['Optional'](identifier)}),'settings':Type['Record'](Type['String']({'minLength':0x1}),Type[z(0x117)]()),'logger':Type[z(0x112)]({'path':Type[z(0x118)](Type[z(0x110)]({'maxLength':0x100,'pattern':'^[A-Za-z0-9_.\x5c-/]*$'}))})};
@@ -1 +1 @@
1
- {"version":3,"file":"check-system.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/check-system.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;CACZ,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAgBd"}
1
+ {"version":3,"file":"check-system.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/check-system.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;CACZ,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAcd"}
@@ -1 +1 @@
1
- function T(r,u){r=r-0xfc;const G=H();let o=G[r];return o;}function H(){const w=['query','redis','status','fulfilled'];H=function(){return w;};return H();}import{requireAdmin}from'../../utils/require-admin.js';export async function checkSystem(r,u){const X=T;requireAdmin(r['user'],'system:check');const [G,o]=await Promise['allSettled']([u['pg'][X(0xfc)]('SELECT\x201'),u[X(0xfd)]['ping']()]);return{'status':G[X(0xfe)]===X(0xff)&&o['status']==='fulfilled'?'ok':'degraded','pg':G[X(0xfe)],'redis':o[X(0xfe)]};}
1
+ function U(){const H=['fulfilled','degraded'];U=function(){return H;};return U();}function A(z,j){z=z-0x136;const c=U();let p=c[z];return p;}export async function checkSystem(z,j){const M=A,[c,p]=await Promise['allSettled']([j['pg']['query']('SELECT\x201'),j['redis']['ping']()]);return{'status':c['status']===M(0x136)&&p['status']==='fulfilled'?'ok':M(0x137),'pg':c['status'],'redis':p['status']};}
@@ -1 +1 @@
1
- {"version":3,"file":"get-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG5D,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wBAAsB,SAAS,CAC3B,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACzD,GAAG,EAAE,UAAU,GAChB,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAoBrC"}
1
+ {"version":3,"file":"get-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAsB,SAAS,CAC7B,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACzD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAkBrC"}
@@ -1 +1 @@
1
- import{requireAdmin}from'../../utils/require-admin.js';function H(){const w=['system:access'];H=function(){return w;};return H();}function T(r,u){r=r-0x15e;const G=H();let o=G[r];return o;}export async function getAccess(r,u){const X=T;requireAdmin(r['user'],X(0x15e));const G=r['type']==='user'?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20ra.resource,\x20ra.actions,\x20ra.role_id\x20AS\x20role\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20ur.role_id\x20=\x20ra.role_id\x20AND\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20ra.resource,\x20ra.actions,\x20ra.role_id\x20AS\x20role\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20ra.role_id\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20',o=await u['pg']['query'](G,[r['id']]);return{'access':o['rows']};}
1
+ function A(z,j){z=z-0x119;const c=U();let p=c[z];return p;}export async function getAccess(z,j){const M=A,c=z[M(0x119)]===M(0x11a)?M(0x11b):M(0x11c),p=await j['pg']['query'](c,[z['id']]);return{'access':p['rows']};}function U(){const H=['type','user','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20ra.resource,\x20ra.actions,\x20ra.role_id\x20AS\x20role\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20ur.role_id\x20=\x20ra.role_id\x20AND\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20ra.resource,\x20ra.actions,\x20ra.role_id\x20AS\x20role\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20ra.role_id\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20'];U=function(){return H;};return U();}
@@ -1 +1 @@
1
- {"version":3,"file":"get-api-list.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-api-list.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,kBAAkB,CAAC;AAEhE,wBAAsB,UAAU,CAC9B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;CAC/B,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC,CAYhC"}
1
+ {"version":3,"file":"get-api-list.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-api-list.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,kBAAkB,CAAC;AAEhE,wBAAsB,UAAU,CAC9B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;CAC/B,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC,CAWhC"}
@@ -1 +1 @@
1
- function T(r,u){r=r-0xa6;const G=H();let o=G[r];return o;}function H(){const p=['user','apiRoutes','sort','endpoint','format','short'];H=function(){return p;};return H();}import{requireAdmin}from'../../utils/require-admin.js';export async function getApiList(r,u){const q=T;requireAdmin(r[q(0xa6)],'system:list');const G=[...r[q(0xa7)]['values']()][q(0xa8)]((o,X)=>(o['endpoint']+'\x20'+o['method'])['localeCompare'](X[q(0xa9)]+'\x20'+X['method']));if(r[q(0xaa)]!==q(0xab))return G;return G['map'](({method:o,endpoint:X,access:w,permissions:a})=>o+'\x20'+X);}
1
+ function U(){const n=['sort','endpoint','format','map'];U=function(){return n;};return U();}function A(z,j){z=z-0x184;const c=U();let p=c[z];return p;}export async function getApiList(z,j){const b=A,c=[...z['apiRoutes']['values']()][b(0x184)]((p,M)=>(p[b(0x185)]+'\x20'+p['method'])['localeCompare'](M['endpoint']+'\x20'+M['method']));if(z[b(0x186)]!=='short')return c;return c[b(0x187)](({method:p,endpoint:M,access:H,permissions:i})=>p+'\x20'+M);}
@@ -1 +1 @@
1
- {"version":3,"file":"get-audit-log.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-audit-log.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAgBd"}
1
+ {"version":3,"file":"get-audit-log.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-audit-log.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,WAAW,CAC/B,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAcd"}
@@ -1 +1 @@
1
- function T(r,u){r=r-0x15f;const G=H();let o=G[r];return o;}import{requireAdmin}from'../../utils/require-admin.js';export async function getAuditLog(u,G){const a=T;requireAdmin(u[a(0x15f)],a(0x160));const o=Math['min'](Math['max'](u[a(0x161)]??0x32,0x1),0xc8),X=Math['max']((u['page']??0x1)-0x1,0x0)*o,w=await G['pg']['query']('SELECT\x20*\x20FROM\x20admin.audit_log\x20ORDER\x20BY\x20id\x20DESC\x20LIMIT\x20$1\x20OFFSET\x20$2',[o,X]);return{'rows':w[a(0x162)],'page':u['page']??0x1,'limit':o};}function H(){const q=['user','system:audit','limit','rows'];H=function(){return q;};return H();}
1
+ function A(z,j){z=z-0x1be;const c=U();let p=c[z];return p;}export async function getAuditLog(z,j){const H=A,c=Math[H(0x1be)](Math[H(0x1bf)](z['limit']??0x32,0x1),0xc8),p=Math['max']((z['page']??0x1)-0x1,0x0)*c,M=await j['pg'][H(0x1c0)]('SELECT\x20*\x20FROM\x20admin.audit_log\x20ORDER\x20BY\x20id\x20DESC\x20LIMIT\x20$1\x20OFFSET\x20$2',[c,p]);return{'rows':M['rows'],'page':z['page']??0x1,'limit':c};}function U(){const i=['min','max','query'];U=function(){return i;};return U();}
@@ -1 +1 @@
1
- export async function getDictionary(r,u){return u['dictionary']['get'](r['name']);}
1
+ export async function getDictionary(z,j){var c=A;return j['dictionary']['get'](z[c(0x72)]);}function A(z,j){z=z-0x72;var c=U();var p=c[z];return p;}function U(){var p=['name'];U=function(){return p;};return U();}
@@ -1 +1 @@
1
- {"version":3,"file":"get-system-log.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-system-log.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAe5D,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACrC,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,SAAS,CAAC,CA2CpB"}
1
+ {"version":3,"file":"get-system-log.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-system-log.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAc5D,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACrC,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,SAAS,CAAC,CA0CpB"}
@@ -1 +1 @@
1
- import r from'node:fs/promises';import u from'node:path';import{requireAdmin}from'../../utils/require-admin.js';import{NotFoundError,ValidationError}from'../../../errors.js';const LOGS_ROOT=u['resolve'](process['cwd'](),'logs'),TAIL_LINES=0x64;function T(r,u){r=r-0xfe;const G=H();let o=G[r];return o;}export async function getSystemLog(G,o){const c=T;requireAdmin(G['user'],'system:logs');const X=normalizePath(G['path']),w=u['resolve'](LOGS_ROOT,X);if(w!==LOGS_ROOT&&!w['startsWith'](LOGS_ROOT+u[c(0xfe)]))throw new ValidationError('Invalid\x20log\x20path');const a=await r[c(0xff)](w)['catch'](()=>null);if(!a)throw new NotFoundError('Log\x20path\x20not\x20found');if(a[c(0x100)]()){const p=await r[c(0x101)](w,{'withFileTypes':!![]}),F=await Promise['all'](p['map'](async E=>{const h=c,Y=await r['stat'](u[h(0x102)](w,E[h(0x103)]));return{'name':E['name'],'path':X?X+'/'+E['name']:E['name'],'type':E['isDirectory']()?'directory':'file','size':E['isDirectory']()?undefined:Y['size'],'modified':Y[h(0x104)]['toISOString']()};}));F['sort']((E,Y)=>E['name']['localeCompare'](Y[c(0x103)]));if(X){const E=X['split']('/')['slice'](0x0,-0x1)['join']('/');F['unshift']({'name':'..','path':E,'type':'directory'});}return{'contentType':'text/html;\x20charset=utf-8','body':renderDirectory(X,F)};}const q=await tailFile(w,TAIL_LINES);return{'contentType':'text/plain;\x20charset=utf-8','body':q['join']('\x0a')};}function renderDirectory(G,o){const P=T,X=o[P(0x105)](a=>{const q='?path='+encodeURIComponent(a['path']),p=a['type']==='directory'?a['name']+'/':a['name'];return'<li><a\x20href=\x22'+q+'\x22>'+escapeHtml(p)+'</a></li>';})[P(0x102)]('\x0a'),w=escapeHtml('logs/'+G);return'<!DOCTYPE\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>'+w+'</title></head>\x0a<body>\x0a<h1>'+w+'</h1>\x0a<ul>\x0a'+X+'\x0a</ul>\x0a</body>\x0a</html>';}function escapeHtml(G){const l=T;return G[l(0x106)](/&/g,'&amp;')[l(0x106)](/</g,'&lt;')[l(0x106)](/>/g,'&gt;')[l(0x106)](/"/g,'&quot;');}function normalizePath(G){const Q=T,o=(G??'')['replace'](/\\/g,'/')[Q(0x106)](/^\/+|\/+$/g,'');if(o['split']('/')[Q(0x107)](X=>X==='..'))throw new ValidationError(Q(0x108));return o;}async function tailFile(G,o){const J=T,X=await r[J(0x109)](G,'r');try{const {size:w}=await X['stat'](),a=0x40*0x400;let q=w,p=Buffer['alloc'](0x0),F=0x0;while(q>0x0&&F<=o){const Y=Math['min'](a,q);q-=Y;const S=Buffer['alloc'](Y);await X['read'](S,0x0,Y,q),p=Buffer['concat']([S,p]),F+=countNewlines(S);}const E=p['toString']('utf8')['split']('\x0a')[J(0x10a)](I=>I['length']>0x0);return E['slice'](-o)['reverse']();}finally{await X['close']();}}function H(){const O=['sep','stat','isDirectory','readdir','join','name','mtime','map','replace','some','Invalid\x20log\x20path','open','filter'];H=function(){return O;};return H();}function countNewlines(G){let o=0x0;for(const X of G){if(X===0xa)o++;}return o;}
1
+ function U(){const R=['resolve','startsWith','sep','catch','all','join','name','directory','isDirectory','mtime','toISOString','localeCompare','slice','text/plain;\x20charset=utf-8','type','</h1>\x0a<ul>\x0a','&amp;','&lt;','split','stat','min','concat','length'];U=function(){return R;};return U();}function A(z,j){z=z-0x1e1;const c=U();let p=c[z];return p;}const o=A;import z from'node:fs/promises';import j from'node:path';import{NotFoundError,ValidationError}from'../../../errors.js';const LOGS_ROOT=j[o(0x1e1)](process['cwd'](),'logs'),TAIL_LINES=0x64;export async function getSystemLog(c,p){const P=o,M=normalizePath(c['path']),H=j['resolve'](LOGS_ROOT,M);if(H!==LOGS_ROOT&&!H[P(0x1e2)](LOGS_ROOT+j[P(0x1e3)]))throw new ValidationError('Invalid\x20log\x20path');const i=await z['stat'](H)[P(0x1e4)](()=>null);if(!i)throw new NotFoundError('Log\x20path\x20not\x20found');if(i['isDirectory']()){const n=await z['readdir'](H,{'withFileTypes':!![]}),v=await Promise[P(0x1e5)](n['map'](async r=>{const t=P,q=await z['stat'](j[t(0x1e6)](H,r[t(0x1e7)]));return{'name':r[t(0x1e7)],'path':M?M+'/'+r[t(0x1e7)]:r[t(0x1e7)],'type':r['isDirectory']()?t(0x1e8):'file','size':r[t(0x1e9)]()?undefined:q['size'],'modified':q[t(0x1ea)][t(0x1eb)]()};}));v['sort']((r,q)=>r[P(0x1e7)][P(0x1ec)](q['name']));if(M){const r=M['split']('/')[P(0x1ed)](0x0,-0x1)['join']('/');v['unshift']({'name':'..','path':r,'type':'directory'});}return{'contentType':'text/html;\x20charset=utf-8','body':renderDirectory(M,v)};}const b=await tailFile(H,TAIL_LINES);return{'contentType':P(0x1ee),'body':b[P(0x1e6)]('\x0a')};}function renderDirectory(c,p){const y=o,M=p['map'](i=>{const g=A,b='?path='+encodeURIComponent(i['path']),n=i[g(0x1ef)]==='directory'?i[g(0x1e7)]+'/':i['name'];return'<li><a\x20href=\x22'+b+'\x22>'+escapeHtml(n)+'</a></li>';})['join']('\x0a'),H=escapeHtml('logs/'+c);return'<!DOCTYPE\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>'+H+'</title></head>\x0a<body>\x0a<h1>'+H+y(0x1f0)+M+'\x0a</ul>\x0a</body>\x0a</html>';}function escapeHtml(c){const B=o;return c['replace'](/&/g,B(0x1f1))['replace'](/</g,B(0x1f2))['replace'](/>/g,'&gt;')['replace'](/"/g,'&quot;');}function normalizePath(c){const Y=o,p=(c??'')['replace'](/\\/g,'/')['replace'](/^\/+|\/+$/g,'');if(p[Y(0x1f3)]('/')['some'](M=>M==='..'))throw new ValidationError('Invalid\x20log\x20path');return p;}async function tailFile(c,p){const s=o,M=await z['open'](c,'r');try{const {size:H}=await M[s(0x1f4)](),i=0x40*0x400;let b=H,n=Buffer['alloc'](0x0),v=0x0;while(b>0x0&&v<=p){const q=Math[s(0x1f5)](i,b);b-=q;const Z=Buffer['alloc'](q);await M['read'](Z,0x0,q,b),n=Buffer[s(0x1f6)]([Z,n]),v+=countNewlines(Z);}const r=n['toString']('utf8')[s(0x1f3)]('\x0a')['filter'](e=>e[s(0x1f7)]>0x0);return r['slice'](-p)['reverse']();}finally{await M['close']();}}function countNewlines(c){let p=0x0;for(const M of c){if(M===0xa)p++;}return p;}
@@ -1 +1 @@
1
- {"version":3,"file":"get-system-settings.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-system-settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,iBAAiB,CACrC,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;CACZ,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAuBlC"}
1
+ {"version":3,"file":"get-system-settings.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-system-settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,iBAAiB,CACrC,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;CACZ,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAkBlC"}
@@ -1 +1 @@
1
- import{requireAdmin}from'../../utils/require-admin.js';function T(r,u){r=r-0x163;const G=H();let o=G[r];return o;}export async function getSystemSettings(r,u){const p=T;requireAdmin(r[p(0x163)],'system:settings');const G=await u['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20SELECT\x20key,\x20value\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.settings\x0a\x20\x20\x20\x20\x20\x20WHERE\x20resource\x20=\x20\x27system\x27\x20AND\x20resource_id\x20IS\x20NULL\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20key\x0a\x20\x20\x20\x20');return G[p(0x164)][p(0x165)]((o,X)=>{const F=p,w=String(X['key'])[F(0x166)]('.');let a=o;for(const q of w['slice'](0x0,-0x1)){a[q]??={},a=a[q];}return a[w['at'](-0x1)]=X[F(0x167)],o;},{});}function H(){const E=['user','rows','reduce','split','value'];H=function(){return E;};return H();}
1
+ function A(z,j){z=z-0x85;const c=U();let p=c[z];return p;}export async function getSystemSettings(z,j){const n=A,c=await j['pg']['query'](n(0x85));return c['rows']['reduce']((p,M)=>{const v=n,H=String(M[v(0x86)])[v(0x87)]('.');let i=p;for(const b of H['slice'](0x0,-0x1)){i[b]??={},i=i[b];}return i[H['at'](-0x1)]=M['value'],p;},{});}function U(){const r=['\x0a\x20\x20\x20\x20\x20\x20SELECT\x20key,\x20value\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.settings\x0a\x20\x20\x20\x20\x20\x20WHERE\x20resource\x20=\x20\x27system\x27\x20AND\x20resource_id\x20IS\x20NULL\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20key\x0a\x20\x20\x20\x20','key','split'];U=function(){return r;};return U();}
@@ -1 +1 @@
1
- export async function listDictionaries(r,u){return u['dictionary']['list']();}
1
+ export async function listDictionaries(z,j){return j['dictionary']['list']();}
@@ -1 +1 @@
1
- {"version":3,"file":"set-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/set-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/D,KAAK,WAAW,GAAG;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,wBAAsB,SAAS,CAC3B,MAAM,EAAE;IACJ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;CACd,EACD,GAAG,EAAE,UAAU,GAChB,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CA8CrC"}
1
+ {"version":3,"file":"set-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/set-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/D,KAAK,WAAW,GAAG;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,wBAAsB,SAAS,CAC3B,MAAM,EAAE;IACJ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;CACd,EACD,GAAG,EAAE,UAAU,GAChB,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CA6CrC"}
@@ -1 +1 @@
1
- import{requireAdmin}from'../../utils/require-admin.js';function T(r,u){r=r-0x13d;const G=H();let o=G[r];return o;}import{getAccess}from'./get-access.js';export async function setAccess(r,u){const w=T;requireAdmin(r['user'],'system:access');const G=await u['pg']['connect']();try{await G['query']('BEGIN');r[w(0x13d)]===w(0x13e)?await G['query'](w(0x13f),[r['id']]):await G['query']('DELETE\x20FROM\x20admin.role_access\x20WHERE\x20role_id\x20=\x20$1\x20AND\x20user_uid\x20IS\x20NULL',[r['id']]);for(const o of r['access']){r['type']===w(0x13e)?await G['query']('INSERT\x20INTO\x20admin.role_access\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(\x20resource,\x20actions,\x20user_uid,\x20created_by,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)',[o[w(0x140)],o[w(0x141)],r['id'],r[w(0x13e)]['id'],r[w(0x13e)]['id']]):await G['query']('INSERT\x20INTO\x20admin.role_access\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(\x20resource,\x20actions,\x20role_id,\x20created_by,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)',[o['resource'],o[w(0x141)],r['id'],r['user']['id'],r['user']['id']]);}await G['query']('COMMIT');}catch(X){await G['query']('ROLLBACK');throw X;}finally{G['release']();}return getAccess(r,u);}function H(){const a=['type','user','DELETE\x20FROM\x20admin.role_access\x20WHERE\x20user_uid\x20=\x20$1\x20AND\x20role_id\x20IS\x20NULL','resource','actions'];H=function(){return a;};return H();}
1
+ import{getAccess}from'./get-access.js';function U(){const i=['user','query','type','COMMIT'];U=function(){return i;};return U();}function A(z,j){z=z-0x1d5;const c=U();let p=c[z];return p;}export async function setAccess(z,j){const H=A,c=await j['pg']['connect']();try{await c['query']('BEGIN');z['type']===H(0x1d5)?await c['query']('DELETE\x20FROM\x20admin.role_access\x20WHERE\x20user_uid\x20=\x20$1\x20AND\x20role_id\x20IS\x20NULL',[z['id']]):await c[H(0x1d6)]('DELETE\x20FROM\x20admin.role_access\x20WHERE\x20role_id\x20=\x20$1\x20AND\x20user_uid\x20IS\x20NULL',[z['id']]);for(const p of z['access']){z[H(0x1d7)]==='user'?await c['query']('INSERT\x20INTO\x20admin.role_access\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(\x20resource,\x20actions,\x20user_uid,\x20created_by,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)',[p['resource'],p['actions'],z['id'],z['user']['id'],z[H(0x1d5)]['id']]):await c['query']('INSERT\x20INTO\x20admin.role_access\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(\x20resource,\x20actions,\x20role_id,\x20created_by,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)',[p['resource'],p['actions'],z['id'],z['user']['id'],z[H(0x1d5)]['id']]);}await c['query'](H(0x1d8));}catch(M){await c['query']('ROLLBACK');throw M;}finally{c['release']();}return getAccess(z,j);}
@@ -1 +1 @@
1
- {"version":3,"file":"update-dictionary.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/update-dictionary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,wBAAsB,gBAAgB,CACpC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAC7D,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAK/B"}
1
+ {"version":3,"file":"update-dictionary.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/update-dictionary.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,wBAAsB,gBAAgB,CACpC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAC7D,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAI/B"}
@@ -1 +1 @@
1
- function T(r,u){r=r-0xed;var G=H();var o=G[r];return o;}function H(){var o=['name'];H=function(){return o;};return H();}import{requireAdmin}from'../../utils/require-admin.js';export async function updateDictionary(r,u){var G=T;return requireAdmin(r['user'],'system:dictionaries'),await u['dictionary']['put'](r[G(0xed)],r['items']),{'success':!![]};}
1
+ function A(z,j){z=z-0xb5;var c=U();var p=c[z];return p;}export async function updateDictionary(z,j){var c=A;return await j['dictionary'][c(0xb5)](z['name'],z['items']),{'success':!![]};}function U(){var p=['put'];U=function(){return p;};return U();}
@@ -1 +1 @@
1
- {"version":3,"file":"update-system-settings.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/update-system-settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAsB,oBAAoB,CACxC,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC,CAuB5B"}
1
+ {"version":3,"file":"update-system-settings.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/update-system-settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG5D,wBAAsB,oBAAoB,CACxC,MAAM,EAAE;IACN,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC,CAqB5B"}
@@ -1 +1 @@
1
- import{requireAdmin}from'../../utils/require-admin.js';function T(r,u){r=r-0x183;const G=H();let o=G[r];return o;}import{ValidationError}from'../../../errors.js';function H(){const w=['system:settings','entries','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.settings\x20(resource,\x20resource_id,\x20key,\x20value,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(\x27system\x27,\x20NULL,\x20$1,\x20$2::jsonb,\x20$3)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT\x20(resource,\x20resource_id,\x20key)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20DO\x20UPDATE\x20SET\x20value\x20=\x20EXCLUDED.value,\x20updated_by\x20=\x20EXCLUDED.updated_by,\x20updated_at\x20=\x20now()\x0a\x20\x20\x20\x20\x20\x20\x20\x20','user'];H=function(){return w;};return H();}export async function updateSystemSettings(r,u){const X=T;requireAdmin(r['user'],X(0x183));if(!Object['keys'](r['patch'])['length'])throw new ValidationError('Settings\x20patch\x20is\x20empty');for(const [G,o]of Object[X(0x184)](r['patch'])){if(!G['trim']()||G['includes']('..'))throw new ValidationError('Invalid\x20setting\x20key:\x20'+G);await u['pg']['query'](X(0x185),[G,JSON['stringify'](o),r[X(0x186)]['id']]);}return{'success':!![]};}
1
+ function A(z,j){z=z-0x120;const c=U();let p=c[z];return p;}import{ValidationError}from'../../../errors.js';export async function updateSystemSettings(z,j){const M=A;if(!Object[M(0x120)](z['patch'])['length'])throw new ValidationError('Settings\x20patch\x20is\x20empty');for(const [c,p]of Object['entries'](z['patch'])){if(!c['trim']()||c[M(0x121)]('..'))throw new ValidationError('Invalid\x20setting\x20key:\x20'+c);await j['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.settings\x20(resource,\x20resource_id,\x20key,\x20value,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(\x27system\x27,\x20NULL,\x20$1,\x20$2::jsonb,\x20$3)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT\x20(resource,\x20resource_id,\x20key)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20DO\x20UPDATE\x20SET\x20value\x20=\x20EXCLUDED.value,\x20updated_by\x20=\x20EXCLUDED.updated_by,\x20updated_at\x20=\x20now()\x0a\x20\x20\x20\x20\x20\x20\x20\x20',[c,JSON[M(0x122)](p),z['user']['id']]);}return{'success':!![]};}function U(){const H=['keys','includes','stringify'];U=function(){return H;};return U();}
@@ -1 +1 @@
1
- function H(){var o=['type','admin'];H=function(){return o;};return H();}import{ForbiddenError}from'../../errors.js';function T(r,u){r=r-0xab;var G=H();var o=G[r];return o;}export function requireAdmin(r,u){var G=T;if(!r)throw new ForbiddenError('User\x20required');if(r[G(0xab)]!=='admin')throw new ForbiddenError('Admin\x20access\x20required');if(r['type']!==G(0xac)&&u&&!r['permissions']?.['includes'](u))throw new ForbiddenError('Missing\x20permission:\x20'+u);}
1
+ function A(z,j){z=z-0x131;var c=U();var p=c[z];return p;}function U(){var p=['User\x20required','admin'];U=function(){return p;};return U();}import{ForbiddenError}from'../../errors.js';export function requireAdmin(z,j){var c=A;if(!z)throw new ForbiddenError(c(0x131));if(z['type']!=='admin')throw new ForbiddenError('Admin\x20access\x20required');if(z['type']!==c(0x132)&&j&&!z['permissions']?.['includes'](j))throw new ForbiddenError('Missing\x20permission:\x20'+j);}
@@ -1 +1 @@
1
- function T(r,u){r=r-0x139;const G=H();let o=G[r];return o;}function H(){const w=['token','entries'];H=function(){return w;};return H();}export const safeUser=r=>{const X=T,u=['password','salt',X(0x139),'secret','credentials'];return Object['fromEntries'](Object[X(0x13a)](r)['filter'](([G])=>!u['some'](o=>G['toLowerCase']()['includes'](o))));};
1
+ function U(){const H=['password','includes'];U=function(){return H;};return U();}function A(z,j){z=z-0x16e;const c=U();let p=c[z];return p;}export const safeUser=z=>{const M=A,j=[M(0x16e),'salt','secret','credentials'];return Object['fromEntries'](Object['entries'](z)['filter'](([c])=>!j['some'](p=>c['toLowerCase']()[M(0x16f)](p))));};
@@ -1 +1 @@
1
- import{UnsupportedError}from'../../errors.js';export function unsupported(r){throw new UnsupportedError(r+'\x20requires\x20a\x20project/provider\x20implementation');}
1
+ import{UnsupportedError}from'../../errors.js';export function unsupported(z){throw new UnsupportedError(z+'\x20requires\x20a\x20project/provider\x20implementation');}
@@ -1 +1 @@
1
- import{writeAudit}from'./services/write-audit.js';export function createAudit(r){const u=writeAudit(r);return{'write':u};}
1
+ import{writeAudit}from'./services/write-audit.js';export function createAudit(z){const j=writeAudit(z);return{'write':j};}
@@ -1 +1 @@
1
- const secretPattern=/password|token|secret|credential|salt/i;function clean(r){const F=T;if(Array['isArray'](r))return r[F(0xcf)](clean);if(r&&typeof r===F(0xd0))return Object[F(0xd1)](Object['entries'](r)['map'](([u,G])=>[u,secretPattern['test'](u)?'[REDACTED]':clean(G)]));return r;}function T(r,u){r=r-0xcf;const G=H();let o=G[r];return o;}function H(){const c=['map','object','fromEntries','query','then','rows','audit_log_data','admin.audit_log','Audit\x20tables\x20are\x20unavailable;\x20audit\x20writes\x20are\x20disabled','catch','logger','changes','oldValue','audit','empty\x20pg','\x0a\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20user_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20module,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20fields,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20action,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20request_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ip_address,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20metadata\x0a\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5,\x20$6,\x20$7,\x20$8,\x20$9)\x0a\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20id\x0a\x20\x20\x20\x20\x20\x20','userId','action','metadata','field'];H=function(){return c;};return H();}export function writeAudit(r){let u,G;async function o(){const E=T;if(!r['pg'])return![];if(u!==undefined)return u;return G??=r['pg'][E(0xd2)]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_schema\x20=\x20\x27admin\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20IN\x20(\x27audit_log\x27,\x20\x27audit_log_data\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20')[E(0xd3)](X=>{const Y=E,w=new Set(X[Y(0xd4)]['map'](a=>a['table_name']));return u=w['has']('audit_log')&&w['has'](Y(0xd5)),!u&&r['logger']['warn']({'expectedTables':[Y(0xd6),'admin.audit_log_data'],'foundTables':[...w]},Y(0xd7)),u;})[E(0xd8)](X=>{const S=E;return u=![],r[S(0xd9)]['warn']({'err':X},'Unable\x20to\x20check\x20audit\x20tables;\x20audit\x20writes\x20are\x20disabled'),![];}),G;}return async function X(w){const I=T;if(!await o())return r['logger']['info']({'auditFallback':!![],'event':clean({...w,'changes':w[I(0xda)]?.['map'](p=>({...p,'oldValue':clean(p[I(0xdb)]),'newValue':clean(p['newValue'])}))})},I(0xdc)),0x0;if(!r['pg'])throw new Error(I(0xdd));const a=await r['pg'][I(0xd2)](I(0xde),[w[I(0xdf)]??null,w['module'],w['resource'],w['resourceId']==null?null:String(w['resourceId']),w['fields']??null,w[I(0xe0)],w['requestId']??null,w['ipAddress']??null,clean(w[I(0xe1)]??{})]),q=a[I(0xd4)][0x0]['id'];for(const p of w['changes']??[]){if(secretPattern['test'](p['field']))continue;await r['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log_data\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20audit_log_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20field,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20old_value,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20new_value\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20',[q,p[I(0xe2)],JSON['stringify'](clean(p['oldValue'])),JSON['stringify'](clean(p['newValue']))]);}return q;};}
1
+ const secretPattern=/password|token|secret|credential|salt/i;function clean(z){const v=A;if(Array['isArray'](z))return z['map'](clean);if(z&&typeof z==='object')return Object[v(0x10c)](Object['entries'](z)['map'](([j,c])=>[j,secretPattern['test'](j)?'[REDACTED]':clean(c)]));return z;}function U(){const e=['fromEntries','rows','warn','admin.audit_log','Unable\x20to\x20check\x20audit\x20tables;\x20audit\x20writes\x20are\x20disabled','audit','empty\x20pg','query','resourceId','action','field'];U=function(){return e;};return U();}function A(z,j){z=z-0x10c;const c=U();let p=c[z];return p;}export function writeAudit(z){let j,c;async function p(){if(!z['pg'])return![];if(j!==undefined)return j;return c??=z['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_schema\x20=\x20\x27admin\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20IN\x20(\x27audit_log\x27,\x20\x27audit_log_data\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20')['then'](M=>{const r=A,H=new Set(M[r(0x10d)]['map'](i=>i['table_name']));return j=H['has']('audit_log')&&H['has']('audit_log_data'),!j&&z['logger'][r(0x10e)]({'expectedTables':[r(0x10f),'admin.audit_log_data'],'foundTables':[...H]},'Audit\x20tables\x20are\x20unavailable;\x20audit\x20writes\x20are\x20disabled'),j;})['catch'](M=>{const q=A;return j=![],z['logger']['warn']({'err':M},q(0x110)),![];}),c;}return async function M(H){const Z=A;if(!await p())return z['logger']['info']({'auditFallback':!![],'event':clean({...H,'changes':H['changes']?.['map'](n=>({...n,'oldValue':clean(n['oldValue']),'newValue':clean(n['newValue'])}))})},Z(0x111)),0x0;if(!z['pg'])throw new Error(Z(0x112));const i=await z['pg'][Z(0x113)]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20user_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20module,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20fields,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20action,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20request_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ip_address,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20metadata\x0a\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5,\x20$6,\x20$7,\x20$8,\x20$9)\x0a\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20id\x0a\x20\x20\x20\x20\x20\x20',[H['userId']??null,H['module'],H['resource'],H[Z(0x114)]==null?null:String(H[Z(0x114)]),H['fields']??null,H[Z(0x115)],H['requestId']??null,H['ipAddress']??null,clean(H['metadata']??{})]),b=i['rows'][0x0]['id'];for(const n of H['changes']??[]){if(secretPattern['test'](n[Z(0x116)]))continue;await z['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log_data\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20audit_log_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20field,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20old_value,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20new_value\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20',[b,n[Z(0x116)],JSON['stringify'](clean(n['oldValue'])),JSON['stringify'](clean(n['newValue']))]);}return b;};}
@@ -1 +1 @@
1
- function H(){const w=['query'];H=function(){return w;};return H();}function T(r,u){r=r-0x19d;const G=H();let o=G[r];return o;}export async function getUserPermissions(r,u){const X=T,G=await u['pg'][X(0x19d)]('\x0a\x20\x20\x20\x20\x20\x20SELECT\x20DISTINCT\x20ra.resource\x20||\x20\x27:\x27\x20||\x20action\x20AS\x20permission\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x20ON\x20ur.role_id\x20=\x20ra.role_id\x0a\x20\x20\x20\x20\x20\x20CROSS\x20JOIN\x20LATERAL\x20unnest(COALESCE(ra.actions,\x20\x27{}\x27::text[]))\x20AS\x20action\x0a\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20',[r]);return G['rows']['map'](o=>o['permission']);}
1
+ function A(z,j){z=z-0x1ea;const c=U();let p=c[z];return p;}function U(){const H=['map','permission'];U=function(){return H;};return U();}export async function getUserPermissions(z,j){const M=A,c=await j['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20SELECT\x20DISTINCT\x20ra.resource\x20||\x20\x27:\x27\x20||\x20action\x20AS\x20permission\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x20ON\x20ur.role_id\x20=\x20ra.role_id\x0a\x20\x20\x20\x20\x20\x20CROSS\x20JOIN\x20LATERAL\x20unnest(COALESCE(ra.actions,\x20\x27{}\x27::text[]))\x20AS\x20action\x0a\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20',[z]);return c['rows'][M(0x1ea)](p=>p[M(0x1eb)]);}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAUhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAE1C,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpE;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,mBAAmB,iBA6CzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAUhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAE1C,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpE;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAalB;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,mBAAmB,iBA6CzB"}
@@ -1 +1 @@
1
- export*from'./auth.types.js';import{randomBytes,scrypt as r,timingSafeEqual}from'node:crypto';import{promisify}from'node:util';const scrypt=promisify(r);import u from'@fastify/cookie';function T(r,u){r=r-0x76;const G=H();let o=G[r];return o;}function H(){const P=['scrypt$','toString','split','scrypt','hex','length','warn','cookieOptions','user'];H=function(){return P;};return H();}import G from'@fastify/session';import{Authenticator}from'@fastify/passport';import o from'fastify-session-redis-store';import{getUserPermissions}from'./get-user-permissions.js';const fastifyPassport=new Authenticator();export*from'./verifyUser.js';export*from'./get-user-permissions.js';export async function hashPassword(X){const S=T,w=randomBytes(0x10),a=await scrypt(X,w,0x40);return S(0x76)+w[S(0x77)]('hex')+'$'+a[S(0x77)]('hex');}export async function verifyPassword(X,w){const I=T,[a,q,p]=w[I(0x78)]('$');if(a!==I(0x79)||!q||!p)return![];const F=Buffer['from'](q,I(0x7a)),E=Buffer['from'](p,'hex'),Y=await scrypt(X,F,E[I(0x7b)]);return timingSafeEqual(Y,E);}export async function createSessionStore(X,w){const c=T,{config:a,redis:q}=w;if(!a||!q){console[c(0x7c)]('Missing\x20config\x20or\x20redis\x20-\x20skipping\x20session\x20store\x20creation');return;}if(process.env.NODE_ENV==='test'||process.env.VITEST)return;await X['register'](u,{'parseOptions':a['auth'][c(0x7d)]}),await X['register'](G,{'secret':a['auth']['secret'],'cookieName':a['auth']['cookieName'],'cookie':a['auth'][c(0x7d)],'store':new o({'prefix':a['auth']['cookieName']+':'+(a['pg']?.['database']||'db')+':','client':q})}),await X['register'](fastifyPassport['initialize']()),await X['register'](fastifyPassport['secureSession']()),fastifyPassport['registerUserSerializer'](async p=>({'user':p})),fastifyPassport['registerUserDeserializer'](async p=>{const h=c,F=p?.[h(0x7e)]||p;return F?.['id']&&(F['permissions']=await getUserPermissions(F['id'],w)),F;});}
1
+ export*from'./auth.types.js';import{randomBytes,scrypt as z,timingSafeEqual}from'node:crypto';import{promisify}from'node:util';const scrypt=promisify(z);import j from'@fastify/cookie';import c from'@fastify/session';import{Authenticator}from'@fastify/passport';import p from'fastify-session-redis-store';function U(){const o=['hex','warn','test','auth','secret','database','register'];U=function(){return o;};return U();}import{getUserPermissions}from'./get-user-permissions.js';const fastifyPassport=new Authenticator();function A(z,j){z=z-0x185;const c=U();let p=c[z];return p;}export*from'./verifyUser.js';export*from'./get-user-permissions.js';export async function hashPassword(M){const H=randomBytes(0x10),i=await scrypt(M,H,0x40);return'scrypt$'+H['toString']('hex')+'$'+i['toString']('hex');}export async function verifyPassword(M,H){const Z=A,[i,b,n]=H?.['split']('$')||[];if(i!=='scrypt'||!b||!n)return![];const v=Buffer['from'](b,Z(0x185)),r=Buffer['from'](n,'hex'),q=await scrypt(M,v,r['length']);return timingSafeEqual(q,r);}export async function createSessionStore(M,H){const e=A,{config:i,redis:b}=H;if(!i||!b){console[e(0x186)]('Missing\x20config\x20or\x20redis\x20-\x20skipping\x20session\x20store\x20creation');return;}if(process.env.NODE_ENV===e(0x187)||process.env.VITEST)return;await M['register'](j,{'parseOptions':i[e(0x188)]['cookieOptions']}),await M['register'](c,{'secret':i['auth'][e(0x189)],'cookieName':i['auth']['cookieName'],'cookie':i[e(0x188)]['cookieOptions'],'store':new p({'prefix':i['auth']['cookieName']+':'+(i['pg']?.[e(0x18a)]||'db')+':','client':b})}),await M['register'](fastifyPassport['initialize']()),await M[e(0x18b)](fastifyPassport['secureSession']()),fastifyPassport['registerUserSerializer'](async n=>({'user':n})),fastifyPassport['registerUserDeserializer'](async n=>{const v=n?.['user']||n;return v?.['id']&&(v['permissions']=await getUserPermissions(v['id'],H)),v;});}
@@ -1 +1 @@
1
- import{BadRequestError}from'../../errors.js';function H(){const Y=['user.login','password_hash','info','auth/warn'];H=function(){return Y;};return H();}import{verifyPassword}from'./index.js';function T(r,u){r=r-0x78;const G=H();let o=G[r];return o;}export async function verifyUser({user:r,password:u,ip:G},{pg:o,logger:X}){const E=T;if(!r||r==='')throw new BadRequestError('not\x20enough\x20params:\x20user');if(!u||u==='')throw new BadRequestError('not\x20enough\x20params:\x20password');X['metrics'](E(0x78));const w='select\x20uid\x20as\x20id,\x20user_type\x20as\x20type,\x20password_hash,\x20twofa\x20from\x20admin.users\x20where\x20$1\x20in\x20(login,email,phone)\x20and\x20enabled\x20limit\x201',a=await o['query'](w,[r])['then'](p=>p['rows']?.[0x0]);if(!a){const p='user\x20not\x20found';X['info']({'file':'auth/warn','error':p,'user':r,'ip':G});throw new BadRequestError(p);}const q=await verifyPassword(u,a[E(0x79)]);if(!q){const F='Wrong\x20password';X[E(0x7a)]({'file':E(0x7b),'error':F,'user':r,'ip':G});throw new BadRequestError(F);}return delete a['password_hash'],a;}
1
+ function U(){const q=['then','info','Wrong\x20password'];U=function(){return q;};return U();}import{BadRequestError}from'../../errors.js';function A(z,j){z=z-0x168;const c=U();let p=c[z];return p;}import{verifyPassword}from'./index.js';export async function verifyUser({user:z,password:j,ip:c},{pg:p,logger:M}){const r=A;if(!z||z==='')throw new BadRequestError('not\x20enough\x20params:\x20user');if(!j||j==='')throw new BadRequestError('not\x20enough\x20params:\x20password');M['metrics']('user.login');const H='select\x20uid\x20as\x20id,\x20user_type\x20as\x20type,\x20password_hash,\x20twofa\x20from\x20admin.users\x20where\x20$1\x20in\x20(login,email,phone)\x20and\x20enabled\x20limit\x201',i=await p['query'](H,[z])[r(0x168)](n=>n['rows']?.[0x0]);if(!i){const n='user\x20not\x20found';M[r(0x169)]({'file':'auth/warn','error':n,'user':z,'ip':c});throw new BadRequestError(n);}const b=await verifyPassword(j,i['password_hash']);if(!b){const v=r(0x16a);M['info']({'file':'auth/warn','error':v,'user':z,'ip':c});throw new BadRequestError(v);}return delete i['password_hash'],i;}
@@ -9,13 +9,16 @@ export interface DictionaryItem {
9
9
  export interface DictionaryDefinition {
10
10
  code: string;
11
11
  name?: string;
12
+ checked?: boolean;
12
13
  items: DictionaryItem[];
13
14
  }
14
15
  export interface DictionaryPlugin {
15
16
  register(input: DictionaryDefinition | DictionaryDefinition[]): void;
17
+ has(name: string): boolean;
16
18
  get(name: string): Promise<DictionaryItem[]>;
17
19
  put(name: string, items: DictionaryItem[]): Promise<void>;
18
20
  clear(name: string): boolean;
21
+ revision(name: string): number;
19
22
  list(): Promise<Array<{
20
23
  code: string;
21
24
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../src/plugins/dictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,GAAG,IAAI,CAAC;IACrE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC7C,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,IAAI,IAAI,OAAO,CACb,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;KAAE,CAAC,CACrE,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACvC;AAID,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,YAAiB,GAClB,EAAE,sBAAsB,GAAG,gBAAgB,CAiM3C"}
1
+ {"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../src/plugins/dictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,GAAG,IAAI,CAAC;IACrE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC7C,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,IAAI,IAAI,OAAO,CACb,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;KAAE,CAAC,CACrE,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,eAAe,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACvC;AAID,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,YAAiB,GAClB,EAAE,sBAAsB,GAAG,gBAAgB,CAkN3C"}