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

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 (177) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +71 -71
  3. package/dist/config.d.ts +2 -10
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js +1 -1
  6. package/dist/context.js +1 -1
  7. package/dist/errors.js +1 -1
  8. package/dist/fastify.d.ts.map +1 -1
  9. package/dist/fastify.js +1 -1
  10. package/dist/fcore.js +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/migrations/cli.js +1 -1
  13. package/dist/migrations/runner.js +1 -1
  14. package/dist/modules/auth/adduser-cli.d.ts +3 -0
  15. package/dist/modules/auth/adduser-cli.d.ts.map +1 -0
  16. package/dist/modules/auth/adduser-cli.js +2 -0
  17. package/dist/modules/auth/passwd-cli.d.ts +3 -0
  18. package/dist/modules/auth/passwd-cli.d.ts.map +1 -0
  19. package/dist/modules/auth/passwd-cli.js +2 -0
  20. package/dist/modules/auth/permission-cli.d.ts +3 -0
  21. package/dist/modules/auth/permission-cli.d.ts.map +1 -0
  22. package/dist/modules/auth/permission-cli.js +2 -0
  23. package/dist/modules/auth/route.d.ts.map +1 -1
  24. package/dist/modules/auth/route.js +1 -1
  25. package/dist/modules/auth/schema.d.ts +7 -1
  26. package/dist/modules/auth/schema.d.ts.map +1 -1
  27. package/dist/modules/auth/schema.js +1 -1
  28. package/dist/modules/auth/services/change-password.d.ts +9 -0
  29. package/dist/modules/auth/services/change-password.d.ts.map +1 -0
  30. package/dist/modules/auth/services/change-password.js +1 -0
  31. package/dist/modules/auth/services/get-current-user.js +1 -1
  32. package/dist/modules/auth/services/registration.d.ts +14 -0
  33. package/dist/modules/auth/services/registration.d.ts.map +1 -0
  34. package/dist/modules/auth/services/registration.js +1 -0
  35. package/dist/modules/auth/services/verify-two-factor.js +1 -1
  36. package/dist/modules/file/route.js +1 -1
  37. package/dist/modules/file/schema.js +1 -1
  38. package/dist/modules/file/services/get-file.js +1 -1
  39. package/dist/modules/file/services/resize-file.js +1 -1
  40. package/dist/modules/file/services/upload-file.js +1 -1
  41. package/dist/modules/resource/route.d.ts.map +1 -1
  42. package/dist/modules/resource/route.js +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.d.ts +8 -2
  47. package/dist/modules/resource/services/create-resource-relation.d.ts.map +1 -1
  48. package/dist/modules/resource/services/create-resource-relation.js +1 -1
  49. package/dist/modules/resource/services/create-resource.js +1 -1
  50. package/dist/modules/resource/services/delete-resource-relation.d.ts +8 -1
  51. package/dist/modules/resource/services/delete-resource-relation.d.ts.map +1 -1
  52. package/dist/modules/resource/services/delete-resource-relation.js +1 -1
  53. package/dist/modules/resource/services/delete-resource.js +1 -1
  54. package/dist/modules/resource/services/export-resource.js +1 -1
  55. package/dist/modules/resource/services/get-resource.js +1 -1
  56. package/dist/modules/resource/services/list-resource-relation.d.ts +7 -2
  57. package/dist/modules/resource/services/list-resource-relation.d.ts.map +1 -1
  58. package/dist/modules/resource/services/list-resource-relation.js +1 -1
  59. package/dist/modules/resource/services/list-resources.js +1 -1
  60. package/dist/modules/resource/services/search-resource.js +1 -1
  61. package/dist/modules/resource/services/suggest-resource.d.ts +3 -0
  62. package/dist/modules/resource/services/suggest-resource.d.ts.map +1 -1
  63. package/dist/modules/resource/services/suggest-resource.js +1 -1
  64. package/dist/modules/resource/services/update-resource.js +1 -1
  65. package/dist/modules/resource/services/upload-resource-file.js +1 -1
  66. package/dist/modules/system/route.d.ts +2 -1
  67. package/dist/modules/system/route.d.ts.map +1 -1
  68. package/dist/modules/system/route.js +1 -1
  69. package/dist/modules/system/schema.d.ts +22 -1
  70. package/dist/modules/system/schema.d.ts.map +1 -1
  71. package/dist/modules/system/schema.js +1 -1
  72. package/dist/modules/system/services/check-system.d.ts.map +1 -1
  73. package/dist/modules/system/services/check-system.js +1 -1
  74. package/dist/modules/system/services/get-access.d.ts +14 -0
  75. package/dist/modules/system/services/get-access.d.ts.map +1 -0
  76. package/dist/modules/system/services/get-access.js +1 -0
  77. package/dist/modules/system/services/get-api-list.d.ts +4 -1
  78. package/dist/modules/system/services/get-api-list.d.ts.map +1 -1
  79. package/dist/modules/system/services/get-api-list.js +1 -1
  80. package/dist/modules/system/services/get-audit-log.js +1 -1
  81. package/dist/modules/system/services/get-dictionary.js +1 -1
  82. package/dist/modules/system/services/get-system-log.d.ts +9 -5
  83. package/dist/modules/system/services/get-system-log.d.ts.map +1 -1
  84. package/dist/modules/system/services/get-system-log.js +1 -1
  85. package/dist/modules/system/services/get-system-settings.js +1 -1
  86. package/dist/modules/system/services/list-dictionaries.js +1 -1
  87. package/dist/modules/system/services/set-access.d.ts +16 -0
  88. package/dist/modules/system/services/set-access.d.ts.map +1 -0
  89. package/dist/modules/system/services/set-access.js +1 -0
  90. package/dist/modules/system/services/update-dictionary.d.ts +13 -0
  91. package/dist/modules/system/services/update-dictionary.d.ts.map +1 -0
  92. package/dist/modules/system/services/update-dictionary.js +1 -0
  93. package/dist/modules/system/services/update-system-settings.js +1 -1
  94. package/dist/modules/utils/require-admin.js +1 -1
  95. package/dist/modules/utils/safe-user.js +1 -1
  96. package/dist/modules/utils/unsupported.js +1 -1
  97. package/dist/plugins/audit/audit.js +1 -1
  98. package/dist/plugins/audit/index.js +1 -1
  99. package/dist/plugins/audit/services/write-audit.js +1 -1
  100. package/dist/plugins/auth/get-user-permissions.d.ts +3 -0
  101. package/dist/plugins/auth/get-user-permissions.d.ts.map +1 -0
  102. package/dist/plugins/auth/get-user-permissions.js +1 -0
  103. package/dist/plugins/auth/index.d.ts +4 -0
  104. package/dist/plugins/auth/index.d.ts.map +1 -1
  105. package/dist/plugins/auth/index.js +1 -1
  106. package/dist/plugins/auth/verifyUser.d.ts +9 -0
  107. package/dist/plugins/auth/verifyUser.d.ts.map +1 -0
  108. package/dist/plugins/auth/verifyUser.js +1 -0
  109. package/dist/plugins/dictionary.js +1 -1
  110. package/dist/plugins/file.js +1 -1
  111. package/dist/plugins/index.d.ts +1 -0
  112. package/dist/plugins/index.d.ts.map +1 -1
  113. package/dist/plugins/index.js +1 -1
  114. package/dist/plugins/logger/index.js +1 -1
  115. package/dist/plugins/logger/transport.js +1 -1
  116. package/dist/plugins/pg.js +1 -1
  117. package/dist/plugins/redis.js +1 -1
  118. package/dist/plugins/resource/index.js +1 -1
  119. package/dist/plugins/resource/resource.d.ts.map +1 -1
  120. package/dist/plugins/resource/resource.js +1 -1
  121. package/dist/plugins/resource/resource.registry.js +1 -1
  122. package/dist/plugins/resource/resource.types.d.ts +23 -0
  123. package/dist/plugins/resource/resource.types.d.ts.map +1 -1
  124. package/dist/plugins/resource/services/create-relation.d.ts +13 -0
  125. package/dist/plugins/resource/services/create-relation.d.ts.map +1 -0
  126. package/dist/plugins/resource/services/create-relation.js +1 -0
  127. package/dist/plugins/resource/services/create.js +1 -1
  128. package/dist/plugins/resource/services/delete-relation.d.ts +15 -0
  129. package/dist/plugins/resource/services/delete-relation.d.ts.map +1 -0
  130. package/dist/plugins/resource/services/delete-relation.js +1 -0
  131. package/dist/plugins/resource/services/delete.js +1 -1
  132. package/dist/plugins/resource/services/find-one.js +1 -1
  133. package/dist/plugins/resource/services/find-relation.d.ts +12 -0
  134. package/dist/plugins/resource/services/find-relation.d.ts.map +1 -0
  135. package/dist/plugins/resource/services/find-relation.js +1 -0
  136. package/dist/plugins/resource/services/find.js +1 -1
  137. package/dist/plugins/resource/services/update.js +1 -1
  138. package/dist/plugins/resource/utils/fields.js +1 -1
  139. package/dist/plugins/resource/utils/filters.js +1 -1
  140. package/dist/plugins/resource/utils/permissions.js +1 -1
  141. package/dist/plugins/resource/utils/sort.js +1 -1
  142. package/dist/plugins/resource/utils/sql.js +1 -1
  143. package/dist/shared/getIP.js +1 -1
  144. package/dist/type.d.ts +14 -0
  145. package/dist/type.d.ts.map +1 -1
  146. package/migrations/20260903120000_core_schema.sql +22 -19
  147. package/migrations/20260903130000_move_notes_files_to_admin.sql +17 -17
  148. package/migrations/20260903140000_settings_nulls_not_distinct.sql +18 -18
  149. package/migrations/20260905120000_add_user_foreign_keys.sql +43 -0
  150. package/package.json +10 -5
  151. package/dist/modules/auth/index.d.ts +0 -9
  152. package/dist/modules/auth/index.d.ts.map +0 -1
  153. package/dist/modules/auth/index.js +0 -1
  154. package/dist/modules/auth/services/login.d.ts +0 -10
  155. package/dist/modules/auth/services/login.d.ts.map +0 -1
  156. package/dist/modules/auth/services/login.js +0 -1
  157. package/dist/modules/auth/services/logout.d.ts +0 -9
  158. package/dist/modules/auth/services/logout.d.ts.map +0 -1
  159. package/dist/modules/auth/services/logout.js +0 -1
  160. package/dist/modules/auth/services/verifyPassword.d.ts +0 -11
  161. package/dist/modules/auth/services/verifyPassword.d.ts.map +0 -1
  162. package/dist/modules/auth/services/verifyPassword.js +0 -1
  163. package/dist/modules/file/index.d.ts +0 -8
  164. package/dist/modules/file/index.d.ts.map +0 -1
  165. package/dist/modules/file/index.js +0 -1
  166. package/dist/modules/resource/index.d.ts +0 -20
  167. package/dist/modules/resource/index.d.ts.map +0 -1
  168. package/dist/modules/resource/index.js +0 -1
  169. package/dist/modules/resource/services/list-children.d.ts +0 -6
  170. package/dist/modules/resource/services/list-children.d.ts.map +0 -1
  171. package/dist/modules/resource/services/list-children.js +0 -1
  172. package/dist/modules/system/index.d.ts +0 -13
  173. package/dist/modules/system/index.d.ts.map +0 -1
  174. package/dist/modules/system/index.js +0 -1
  175. package/dist/modules/utils/get-user-permissions.d.ts +0 -3
  176. package/dist/modules/utils/get-user-permissions.d.ts.map +0 -1
  177. package/dist/modules/utils/get-user-permissions.js +0 -1
@@ -1 +1 @@
1
- (function(_0x48f558,_0x4a1476){var _0x341088=_0x12ec,_0x402ef5=_0x48f558();while(!![]){try{var _0x49f050=parseInt(_0x341088(0x19d))/0x1+parseInt(_0x341088(0x182))/0x2*(-parseInt(_0x341088(0x195))/0x3)+parseInt(_0x341088(0x1aa))/0x4+parseInt(_0x341088(0x187))/0x5+-parseInt(_0x341088(0x1ac))/0x6*(parseInt(_0x341088(0x19a))/0x7)+-parseInt(_0x341088(0x1a4))/0x8+parseInt(_0x341088(0x19b))/0x9*(parseInt(_0x341088(0x186))/0xa);if(_0x49f050===_0x4a1476)break;else _0x402ef5['push'](_0x402ef5['shift']());}catch(_0xdaa286){_0x402ef5['push'](_0x402ef5['shift']());}}}(_0x2576,0x3cb95));import{uploadFile}from'./services/upload-file.js';function _0x12ec(_0xe6b3fc,_0x33b1bb){_0xe6b3fc=_0xe6b3fc-0x181;var _0x2576ba=_0x2576();var _0x12ecca=_0x2576ba[_0xe6b3fc];return _0x12ecca;}import{resizeFile}from'./services/resize-file.js';import{fileSchemas}from'./schema.js';function _0x2576(){var _0x318355=['Uploads\x20a\x20file\x20and\x20stores\x20its\x20metadata.','user','Returns\x20a\x20file\x20after\x20verifying\x20its\x20signed\x20access\x20token.','Returns\x20a\x20resized\x20image\x20file.','ARHPq','JfGXA','/api/file/:token/resize','BXtDs','query','uzCMN','params','3VXsLjO','iRfvN','KUXJC','fcore','Get\x20file\x20by\x20token','636139ZxEDUC','126KkruOe','jaZmW','397679jUJxUM','WqjHA','SsIio','bvsxe','Upload\x20file','/api/file/:token','FpsHE','3900712IpqCkC','qkCXi','fileToken','public','get','send','27048scCByA','post','24tfoSNf','LrbYC','/api/file/upload','upload','verify','token','resizeQuery','402260EOwbrC','files:read','files:create','Resize\x20file','545460tKARlP','664335Ajsneu','file','body'];_0x2576=function(){return _0x318355;};return _0x2576();}export function fileRoutes(_0x9a6583){var _0x5278b4=_0x12ec,_0x37d473={};_0x37d473[_0x5278b4(0x18e)]=_0x5278b4(0x1a2),_0x37d473[_0x5278b4(0x193)]=_0x5278b4(0x188),_0x37d473[_0x5278b4(0x1ad)]=_0x5278b4(0x199),_0x37d473[_0x5278b4(0x1a5)]=_0x5278b4(0x18c),_0x37d473[_0x5278b4(0x191)]=_0x5278b4(0x1a7),_0x37d473[_0x5278b4(0x1a3)]=_0x5278b4(0x1ae),_0x37d473[_0x5278b4(0x19c)]=_0x5278b4(0x198),_0x37d473[_0x5278b4(0x197)]=_0x5278b4(0x1a1),_0x37d473[_0x5278b4(0x1a0)]=_0x5278b4(0x18b),_0x37d473[_0x5278b4(0x19f)]=_0x5278b4(0x184),_0x37d473[_0x5278b4(0x196)]=_0x5278b4(0x190),_0x37d473[_0x5278b4(0x18f)]=_0x5278b4(0x18d),_0x37d473[_0x5278b4(0x19e)]=_0x5278b4(0x183);var _0x46d816=_0x37d473;return async _0x2b6fd2=>{var _0x184368=_0x5278b4;_0x2b6fd2[_0x184368(0x1a8)](_0x46d816[_0x184368(0x18e)],{'schema':{'tags':[_0x184368(0x198),_0x46d816[_0x184368(0x193)]],'summary':_0x46d816[_0x184368(0x1ad)],'description':_0x46d816[_0x184368(0x1a5)],'access':_0x46d816[_0x184368(0x191)],'permissions':[],'params':fileSchemas[_0x184368(0x1a6)]}},async(_0x3a1114,_0x4a10e7)=>_0x4a10e7[_0x184368(0x1a9)](await _0x9a6583[_0x184368(0x188)]?.[_0x184368(0x1a8)](_0x9a6583[_0x184368(0x188)][_0x184368(0x1b0)](_0x3a1114[_0x184368(0x194)][_0x184368(0x1b1)])['p']))),_0x2b6fd2[_0x184368(0x1ab)](_0x46d816[_0x184368(0x1a3)],{'schema':{'tags':[_0x46d816[_0x184368(0x19c)],_0x184368(0x188)],'summary':_0x46d816[_0x184368(0x197)],'description':_0x184368(0x18a),'access':_0x46d816[_0x184368(0x1a0)],'permissions':[_0x46d816[_0x184368(0x19f)]],'body':fileSchemas[_0x184368(0x1af)]}},async _0x4ea6c6=>uploadFile(_0x4ea6c6[_0x184368(0x189)],_0x9a6583)),_0x2b6fd2[_0x184368(0x1a8)](_0x46d816[_0x184368(0x196)],{'schema':{'tags':[_0x184368(0x198),_0x46d816[_0x184368(0x193)]],'summary':_0x184368(0x185),'description':_0x46d816[_0x184368(0x18f)],'access':_0x184368(0x18b),'permissions':[_0x46d816[_0x184368(0x19e)]],'params':fileSchemas[_0x184368(0x1a6)],'querystring':fileSchemas[_0x184368(0x181)]}},async _0x47e4bf=>resizeFile({'pathOrToken':_0x9a6583[_0x184368(0x188)]?.[_0x184368(0x1b0)](_0x47e4bf[_0x184368(0x194)][_0x184368(0x1b1)])['p'],..._0x47e4bf[_0x184368(0x192)]},_0x9a6583));};}
1
+ import{uploadFile}from'./services/upload-file.js';import{resizeFile}from'./services/resize-file.js';import{fileSchemas}from'./schema.js';function T(r,u){r=r-0x181;var G=H();var o=G[r];return o;}export function fileRoutes(r){return async u=>{var X=T;u[X(0x181)]('/api/file/:token',{'schema':{'tags':['fcore','file'],'summary':'Get\x20file\x20by\x20token','description':'Returns\x20a\x20file\x20after\x20verifying\x20its\x20signed\x20access\x20token.','access':X(0x182),'permissions':[],'params':fileSchemas['fileToken']}},async(G,o)=>o['send'](await r['file']?.[X(0x181)](r[X(0x183)]['verify'](G[X(0x184)]['token'])['p']))),u['post']('/api/file/upload',{'schema':{'tags':['fcore','file'],'summary':'Upload\x20file','description':'Uploads\x20a\x20file\x20and\x20stores\x20its\x20metadata.','access':'user','permissions':['files:create'],'body':fileSchemas['upload']}},async G=>uploadFile(G[X(0x185)],r)),u['get']('/api/file/:token/resize',{'schema':{'tags':['fcore','file'],'summary':X(0x186),'description':'Returns\x20a\x20resized\x20image\x20file.','access':'user','permissions':[X(0x187)],'params':fileSchemas['fileToken'],'querystring':fileSchemas['resizeQuery']}},async G=>resizeFile({'pathOrToken':r[X(0x183)]?.[X(0x188)](G['params'][X(0x189)])['p'],...G['query']},r));};}function H(){var w=['get','public','file','params','body','Resize\x20file','files:read','verify','token'];H=function(){return w;};return H();}
@@ -1 +1 @@
1
- const _0x596f0b=_0x3758;(function(_0x21263b,_0x2e2e41){const _0xd97f61=_0x3758,_0x307265=_0x21263b();while(!![]){try{const _0x2c4ef5=parseInt(_0xd97f61(0x162))/0x1*(parseInt(_0xd97f61(0x161))/0x2)+parseInt(_0xd97f61(0x15f))/0x3+-parseInt(_0xd97f61(0x150))/0x4*(parseInt(_0xd97f61(0x151))/0x5)+-parseInt(_0xd97f61(0x159))/0x6*(parseInt(_0xd97f61(0x158))/0x7)+-parseInt(_0xd97f61(0x15d))/0x8+parseInt(_0xd97f61(0x167))/0x9*(-parseInt(_0xd97f61(0x15e))/0xa)+parseInt(_0xd97f61(0x154))/0xb;if(_0x2c4ef5===_0x2e2e41)break;else _0x307265['push'](_0x307265['shift']());}catch(_0x2b175c){_0x307265['push'](_0x307265['shift']());}}}(_0x46df,0xde4a2));function _0x46df(){const _0xff05d8=['contain','minLength','9909544TCjrcG','1111270fvuFNg','5404974tJEXZu','Any','3481934ucvVoy','1pUDdNH','fill','Optional','inside','String','99dUffXk','minimum','Literal','4yzyEXt','5403755jMruvv','Object','Union','14371511fWRGUg','outside','cover','maxLength','1043HJtYfm','15978kEAvLw','Integer'];_0x46df=function(){return _0xff05d8;};return _0x46df();}import{Type}from'@sinclair/typebox';const _0x3a2741={};_0x3a2741[_0x596f0b(0x15c)]=0x1,_0x3a2741[_0x596f0b(0x157)]=0x80;const _0x5d05b8={};_0x5d05b8[_0x596f0b(0x15c)]=0x1,_0x5d05b8[_0x596f0b(0x157)]=0x800;const _0x2b60e4={};_0x2b60e4[_0x596f0b(0x15c)]=0x1,_0x2b60e4[_0x596f0b(0x157)]=0x400;const _0x22cb3f={};_0x22cb3f[_0x596f0b(0x15c)]=0x1;const _0x503dda={};_0x503dda[_0x596f0b(0x15c)]=0x1;const _0x5bb711={};_0x5bb711[_0x596f0b(0x15c)]=0x1;const _0x4c5b56={};_0x4c5b56[_0x596f0b(0x15c)]=0x1;function _0x3758(_0x1babcd,_0xcc36ea){_0x1babcd=_0x1babcd-0x14e;const _0x46df53=_0x46df();let _0x37583f=_0x46df53[_0x1babcd];return _0x37583f;}const _0x439757={};_0x439757[_0x596f0b(0x15c)]=0x1;const _0x4b25e2={};_0x4b25e2[_0x596f0b(0x15c)]=0x1;const _0x4f27a7={};_0x4f27a7[_0x596f0b(0x14e)]=0x1;const _0x5cb738={};_0x5cb738[_0x596f0b(0x14e)]=0x1;export const fileSchemas={'fileId':Type[_0x596f0b(0x152)]({'id':Type[_0x596f0b(0x166)](_0x3a2741)}),'fileToken':Type[_0x596f0b(0x152)]({'token':Type[_0x596f0b(0x166)](_0x5d05b8)}),'filePath':Type[_0x596f0b(0x152)]({'*':Type[_0x596f0b(0x166)](_0x2b60e4)}),'upload':Type[_0x596f0b(0x152)]({'file':Type[_0x596f0b(0x160)](),'metadata':Type[_0x596f0b(0x152)]({'name':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x166)](_0x22cb3f)),'path':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x166)](_0x503dda)),'entityType':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x166)](_0x5bb711)),'entityId':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x166)](_0x4c5b56))})}),'filePatch':Type[_0x596f0b(0x152)]({'entityType':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x166)](_0x439757)),'entityId':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x166)](_0x4b25e2))}),'resizeQuery':Type[_0x596f0b(0x152)]({'width':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x15a)](_0x4f27a7)),'height':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x15a)](_0x5cb738)),'fit':Type[_0x596f0b(0x164)](Type[_0x596f0b(0x153)]([Type[_0x596f0b(0x14f)](_0x596f0b(0x156)),Type[_0x596f0b(0x14f)](_0x596f0b(0x15b)),Type[_0x596f0b(0x14f)](_0x596f0b(0x163)),Type[_0x596f0b(0x14f)](_0x596f0b(0x165)),Type[_0x596f0b(0x14f)](_0x596f0b(0x155))]))})};
1
+ function T(r,u){r=r-0x10a;const G=H();let o=G[r];return o;}const r=T;function H(){const u=['String','Optional','Object','Literal','fill','inside'];H=function(){return u;};return H();}import{Type}from'@sinclair/typebox';export const fileSchemas={'fileId':Type['Object']({'id':Type[r(0x10a)]({'minLength':0x1,'maxLength':0x80})}),'fileToken':Type['Object']({'token':Type['String']({'minLength':0x1,'maxLength':0x800})}),'filePath':Type['Object']({'*':Type['String']({'minLength':0x1,'maxLength':0x400})}),'upload':Type['Object']({'file':Type['Any'](),'metadata':Type['Object']({'name':Type['Optional'](Type['String']({'minLength':0x1})),'path':Type[r(0x10b)](Type[r(0x10a)]({'minLength':0x1})),'entityType':Type['Optional'](Type[r(0x10a)]({'minLength':0x1})),'entityId':Type['Optional'](Type[r(0x10a)]({'minLength':0x1}))})}),'filePatch':Type['Object']({'entityType':Type['Optional'](Type[r(0x10a)]({'minLength':0x1})),'entityId':Type['Optional'](Type[r(0x10a)]({'minLength':0x1}))}),'resizeQuery':Type[r(0x10c)]({'width':Type['Optional'](Type['Integer']({'minimum':0x1})),'height':Type['Optional'](Type['Integer']({'minimum':0x1})),'fit':Type['Optional'](Type['Union']([Type['Literal']('cover'),Type[r(0x10d)]('contain'),Type['Literal'](r(0x10e)),Type['Literal'](r(0x10f)),Type[r(0x10d)]('outside')]))})};
@@ -1 +1 @@
1
- function _0x2ca3(_0x5a7d32,_0x1593e2){_0x5a7d32=_0x5a7d32-0xb3;var _0x251dcb=_0x251d();var _0x2ca30c=_0x251dcb[_0x5a7d32];return _0x2ca30c;}function _0x251d(){var _0x130bd0=['exists','pathOrToken','file','301wQbqGx','349386LMKoOd','File\x20not\x20found','105170nkFRgs','216xEefzt','265976nzdqou','980507jExifj','84tzxQyI','get','wWDzq','144295MznPgs','4glPiBK','981SDnFtV','1672344igNRNO','752097lqMTrS','empty\x20file'];_0x251d=function(){return _0x130bd0;};return _0x251d();}(function(_0x3b48d4,_0x484164){var _0x5266bb=_0x2ca3,_0x33c974=_0x3b48d4();while(!![]){try{var _0x415a1a=parseInt(_0x5266bb(0xbd))/0x1*(-parseInt(_0x5266bb(0xb3))/0x2)+-parseInt(_0x5266bb(0xc0))/0x3+-parseInt(_0x5266bb(0xbf))/0x4+parseInt(_0x5266bb(0xbc))/0x5*(-parseInt(_0x5266bb(0xb6))/0x6)+parseInt(_0x5266bb(0xc5))/0x7*(parseInt(_0x5266bb(0xb7))/0x8)+-parseInt(_0x5266bb(0xbe))/0x9*(-parseInt(_0x5266bb(0xb5))/0xa)+-parseInt(_0x5266bb(0xb8))/0xb*(-parseInt(_0x5266bb(0xb9))/0xc);if(_0x415a1a===_0x484164)break;else _0x33c974['push'](_0x33c974['shift']());}catch(_0x2b69b1){_0x33c974['push'](_0x33c974['shift']());}}}(_0x251d,0xc1b6c));import{NotFoundError}from'../../../errors.js';export async function getFile(_0x414abc,_0x54a88c){var _0x218c2a=_0x2ca3,_0x35f41d={};_0x35f41d[_0x218c2a(0xbb)]=_0x218c2a(0xb4);var _0xf92945=_0x35f41d;if(!_0x54a88c[_0x218c2a(0xc4)])throw new Error(_0x218c2a(0xc1));if(!await _0x54a88c[_0x218c2a(0xc4)][_0x218c2a(0xc2)](_0x414abc[_0x218c2a(0xc3)]))throw new NotFoundError(_0xf92945[_0x218c2a(0xbb)]);return _0x54a88c[_0x218c2a(0xc4)][_0x218c2a(0xba)](_0x414abc[_0x218c2a(0xc3)]);}
1
+ import{NotFoundError}from'../../../errors.js';function H(){var o=['empty\x20file','file','get'];H=function(){return o;};return H();}function T(r,u){r=r-0x91;var G=H();var o=G[r];return o;}export async function getFile(r,u){var G=T;if(!u['file'])throw new Error(G(0x91));if(!await u[G(0x92)]['exists'](r['pathOrToken']))throw new NotFoundError('File\x20not\x20found');return u[G(0x92)][G(0x93)](r['pathOrToken']);}
@@ -1 +1 @@
1
- (function(_0x2fb549,_0x2840f8){const _0xf8935e=_0x16c5,_0x460192=_0x2fb549();while(!![]){try{const _0x1a52f9=parseInt(_0xf8935e(0xe4))/0x1+parseInt(_0xf8935e(0xf1))/0x2+parseInt(_0xf8935e(0xf4))/0x3*(-parseInt(_0xf8935e(0xf0))/0x4)+-parseInt(_0xf8935e(0xd7))/0x5*(parseInt(_0xf8935e(0xdf))/0x6)+-parseInt(_0xf8935e(0xd8))/0x7*(-parseInt(_0xf8935e(0xe3))/0x8)+-parseInt(_0xf8935e(0xd5))/0x9*(-parseInt(_0xf8935e(0xd2))/0xa)+-parseInt(_0xf8935e(0xd6))/0xb;if(_0x1a52f9===_0x2840f8)break;else _0x460192['push'](_0x460192['shift']());}catch(_0x33ab07){_0x460192['push'](_0x460192['shift']());}}}(_0x30f4,0xe21f8));import{NotFoundError,ValidationError}from'../../../errors.js';function _0x16c5(_0x725dba,_0x1de205){_0x725dba=_0x725dba-0xcc;const _0x30f4e6=_0x30f4();let _0x16c5bc=_0x30f4e6[_0x725dba];return _0x16c5bc;}import _0x2cb571 from'sharp';export async function resizeFile(_0x2f231c,_0x52d49a){const _0x2130ab=_0x16c5,_0x229d71={'jOHbZ':_0x2130ab(0xef),'WkUjZ':_0x2130ab(0xe2),'erowe':function(_0x2733ef,_0x271602,_0x2a3724){return _0x2733ef(_0x271602,_0x2a3724);},'WpZFA':_0x2130ab(0xe1),'pLggf':_0x2130ab(0xe5),'SBTcl':function(_0x5e7ae2,_0x719ef4){return _0x5e7ae2&&_0x719ef4;},'pTjas':_0x2130ab(0xda),'ThLms':_0x2130ab(0xea),'NvIyt':_0x2130ab(0xd4)};if(!_0x52d49a[_0x2130ab(0xd1)])throw new Error(_0x229d71[_0x2130ab(0xde)]);const _0x563135=_0x2f231c[_0x2130ab(0xd9)]??_0x2f231c[_0x2130ab(0xe7)];if(!_0x563135)throw new ValidationError(_0x229d71[_0x2130ab(0xec)]);const _0x3f8c9d=_0x229d71[_0x2130ab(0xeb)](parseDimension,_0x2f231c[_0x2130ab(0xe1)],_0x229d71[_0x2130ab(0xce)]),_0x54bcd4=_0x229d71[_0x2130ab(0xeb)](parseDimension,_0x2f231c[_0x2130ab(0xe5)],_0x229d71[_0x2130ab(0xf3)]);if(_0x229d71[_0x2130ab(0xdc)](!_0x3f8c9d,!_0x54bcd4))throw new ValidationError(_0x229d71[_0x2130ab(0xd3)]);if(!await _0x52d49a[_0x2130ab(0xd1)][_0x2130ab(0xcf)](_0x563135))throw new NotFoundError(_0x229d71[_0x2130ab(0xe6)]);const _0x553e6e={};return _0x553e6e[_0x2130ab(0xe1)]=_0x3f8c9d,_0x553e6e[_0x2130ab(0xe5)]=_0x54bcd4,_0x553e6e[_0x2130ab(0xf2)]=_0x2f231c[_0x2130ab(0xf2)]??_0x229d71[_0x2130ab(0xe9)],_0x2cb571(await _0x52d49a[_0x2130ab(0xd1)][_0x2130ab(0xe8)](_0x563135))[_0x2130ab(0xcd)](_0x553e6e)[_0x2130ab(0xed)]();}function parseDimension(_0x567823,_0x5837f7){const _0x145979=_0x16c5,_0x33781c={'pCghM':function(_0x23b5db,_0x24e0b0){return _0x23b5db===_0x24e0b0;},'alics':_0x145979(0xd0),'JyPTA':function(_0x27c9bc,_0x45ed17){return _0x27c9bc(_0x45ed17);}};if(_0x33781c[_0x145979(0xdd)](_0x567823,undefined)||_0x567823===''){if(_0x33781c[_0x145979(0xee)]!==_0x145979(0xd0))throw new _0x13b320(_0x1320e0+_0x145979(0xe0));else return undefined;}const _0x27e897=_0x33781c[_0x145979(0xdb)](Number,_0x567823);if(!Number[_0x145979(0xcc)](_0x27e897)||_0x27e897<=0x0)throw new ValidationError(_0x5837f7+_0x145979(0xe0));return _0x27e897;}function _0x30f4(){const _0x29edef=['8DlOshi','1698742NZBoyz','height','ThLms','path','get','NvIyt','File\x20not\x20found','erowe','WkUjZ','toBuffer','alics','empty\x20file','4UeyqPd','3293718xDXjYd','fit','pLggf','413847vRVKfY','isInteger','resize','WpZFA','exists','sHPCx','file','110bhTnrB','pTjas','cover','879696xyLmXD','36839275pKMBaj','10kZkGyh','1873207DxrZEk','pathOrToken','Width\x20or\x20height\x20is\x20required','JyPTA','SBTcl','pCghM','jOHbZ','825636YKPaDc','\x20must\x20be\x20a\x20positive\x20integer','width','File\x20path\x20is\x20required'];_0x30f4=function(){return _0x29edef;};return _0x30f4();}
1
+ import{NotFoundError,ValidationError}from'../../../errors.js';function T(r,u){r=r-0x89;const G=H();let o=G[r];return o;}import r from'sharp';export async function resizeFile(u,G){const a=T;if(!G[a(0x89)])throw new Error(a(0x8a));const o=u[a(0x8b)]??u['path'];if(!o)throw new ValidationError('File\x20path\x20is\x20required');const X=parseDimension(u['width'],'width'),w=parseDimension(u[a(0x8c)],a(0x8c));if(!X&&!w)throw new ValidationError(a(0x8d));if(!await G['file']['exists'](o))throw new NotFoundError(a(0x8e));return r(await G['file']['get'](o))['resize']({'width':X,'height':w,'fit':u['fit']??'cover'})['toBuffer']();}function H(){const p=['file','empty\x20file','pathOrToken','height','Width\x20or\x20height\x20is\x20required','File\x20not\x20found','isInteger'];H=function(){return p;};return H();}function parseDimension(u,G){const q=T;if(u===undefined||u==='')return undefined;const o=Number(u);if(!Number[q(0x8f)](o)||o<=0x0)throw new ValidationError(G+'\x20must\x20be\x20a\x20positive\x20integer');return o;}
@@ -1 +1 @@
1
- (function(_0x52ab23,_0x17a192){const _0x5b7618=_0x369e,_0x359712=_0x52ab23();while(!![]){try{const _0x3f7240=-parseInt(_0x5b7618(0xb9))/0x1*(-parseInt(_0x5b7618(0xac))/0x2)+-parseInt(_0x5b7618(0xa9))/0x3+-parseInt(_0x5b7618(0xae))/0x4*(-parseInt(_0x5b7618(0xb3))/0x5)+-parseInt(_0x5b7618(0xa5))/0x6*(parseInt(_0x5b7618(0xab))/0x7)+-parseInt(_0x5b7618(0xa3))/0x8*(-parseInt(_0x5b7618(0xb8))/0x9)+-parseInt(_0x5b7618(0xb1))/0xa+parseInt(_0x5b7618(0xb6))/0xb;if(_0x3f7240===_0x17a192)break;else _0x359712['push'](_0x359712['shift']());}catch(_0x1b66ef){_0x359712['push'](_0x359712['shift']());}}}(_0x864f,0xad495));function _0x369e(_0x4bbe34,_0x31750a){_0x4bbe34=_0x4bbe34-0xa2;const _0x864f7e=_0x864f();let _0x369e2a=_0x864f7e[_0x4bbe34];return _0x369e2a;}import{randomUUID}from'node:crypto';function _0x864f(){const _0xdeaa89=['metadata','10356170DwbyyT','HXlce','3061665SACQht','322ABSHoT','length','path','24YezcAd','rows','216ETEKQY','entityType','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\x20\x20','2802363qtwejJ','entityId','140742JzPEXV','3986CtFMNO','name','4BLyhGN','put','replace','3437330mZbmdB','uploads/','538400SWLilc','file'];_0x864f=function(){return _0xdeaa89;};return _0x864f();}export async function uploadFile(_0x35e88b,_0x4c9b60){const _0x47a033=_0x369e,_0x55d7f7={'HXlce':function(_0x3942ac){return _0x3942ac();}},_0x3e5995=(_0x35e88b[_0x47a033(0xb5)][_0x47a033(0xad)]??_0x47a033(0xb4))[_0x47a033(0xb0)](/[^a-zA-Z0-9._-]/g,'_'),_0x25e24e=_0x35e88b[_0x47a033(0xb5)][_0x47a033(0xa2)]??_0x47a033(0xb2)+_0x55d7f7[_0x47a033(0xb7)](randomUUID)+'-'+_0x3e5995;await _0x4c9b60[_0x47a033(0xb4)][_0x47a033(0xaf)](_0x25e24e,_0x35e88b[_0x47a033(0xb4)]);const _0x2b1874=await _0x4c9b60['pg'][_0x47a033(0xa7)](_0x47a033(0xa8),[_0x35e88b[_0x47a033(0xb5)][_0x47a033(0xa6)]??null,_0x35e88b[_0x47a033(0xb5)][_0x47a033(0xaa)]??null,_0x25e24e,_0x35e88b[_0x47a033(0xb4)][_0x47a033(0xba)]]);return _0x2b1874[_0x47a033(0xa4)][0x0];}
1
+ function T(r,u){r=r-0xb7;const G=H();let o=G[r];return o;}import{randomUUID}from'node:crypto';export async function uploadFile(r,u){const w=T,G=(r['metadata'][w(0xb7)]??'file')[w(0xb8)](/[^a-zA-Z0-9._-]/g,'_'),o=r['metadata']['path']??'uploads/'+randomUUID()+'-'+G;await u[w(0xb9)]['put'](o,r['file']);const X=await u['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\x20\x20',[r['metadata']['entityType']??null,r['metadata']['entityId']??null,o,r[w(0xb9)]['length']]);return X[w(0xba)][0x0];}function H(){const a=['name','replace','file','rows'];H=function(){return a;};return H();}
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/modules/resource/route.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAoBnD,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,kBAAkB,CA0WlE"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../src/modules/resource/route.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAkBnD,wBAAgB,cAAc,CAAC,GAAG,EAAE,UAAU,GAAG,kBAAkB,CA4PlE"}
@@ -1 +1 @@
1
- const _0x58e7dd=_0x21f3;(function(_0x35ba4c,_0x4ddd89){const _0x27d7d3=_0x21f3,_0x40e9a2=_0x35ba4c();while(!![]){try{const _0x10bac5=parseInt(_0x27d7d3(0x1cb))/0x1*(parseInt(_0x27d7d3(0x20d))/0x2)+-parseInt(_0x27d7d3(0x204))/0x3+-parseInt(_0x27d7d3(0x1bb))/0x4*(-parseInt(_0x27d7d3(0x1c1))/0x5)+-parseInt(_0x27d7d3(0x1ff))/0x6+parseInt(_0x27d7d3(0x20b))/0x7+-parseInt(_0x27d7d3(0x21d))/0x8+parseInt(_0x27d7d3(0x20a))/0x9;if(_0x10bac5===_0x4ddd89)break;else _0x40e9a2['push'](_0x40e9a2['shift']());}catch(_0x12e6ef){_0x40e9a2['push'](_0x40e9a2['shift']());}}}(_0x2446,0xe0794));import{listResources}from'./services/list-resources.js';import{getResource}from'./services/get-resource.js';import{createResource}from'./services/create-resource.js';import{updateResource}from'./services/update-resource.js';import{deleteResource}from'./services/delete-resource.js';import{listResourceRelation}from'./services/list-resource-relation.js';import{createResourceRelation}from'./services/create-resource-relation.js';import{deleteResourceRelation}from'./services/delete-resource-relation.js';import{searchResource}from'./services/search-resource.js';import{exportResource}from'./services/export-resource.js';import{suggestResource}from'./services/suggest-resource.js';import{addNote}from'./services/add-note.js';import{addResourceFile}from'./services/add-resource-file.js';import{uploadResourceFile}from'./services/upload-resource-file.js';import{resourceSchemas}from'./schema.js';const user=_0x357654=>_0x357654[_0x58e7dd(0x1ed)];function _0x21f3(_0x6a5ba2,_0x400f35){_0x6a5ba2=_0x6a5ba2-0x1b0;const _0x2446c9=_0x2446();let _0x21f392=_0x2446c9[_0x6a5ba2];return _0x21f392;}export function resourceRoutes(_0x51872c){const _0xd4866c=_0x58e7dd,_0x324896={};_0x324896[_0xd4866c(0x1c0)]=_0xd4866c(0x1d5),_0x324896[_0xd4866c(0x1ca)]=_0xd4866c(0x1b9),_0x324896[_0xd4866c(0x211)]=_0xd4866c(0x224),_0x324896[_0xd4866c(0x1b8)]=_0xd4866c(0x214),_0x324896[_0xd4866c(0x1f8)]=_0xd4866c(0x1ec),_0x324896[_0xd4866c(0x1b0)]=_0xd4866c(0x220),_0x324896[_0xd4866c(0x221)]=_0xd4866c(0x1d7),_0x324896[_0xd4866c(0x1c4)]=_0xd4866c(0x1ed),_0x324896[_0xd4866c(0x1b4)]=_0xd4866c(0x1ce),_0x324896[_0xd4866c(0x1db)]=_0xd4866c(0x1cf),_0x324896[_0xd4866c(0x1e5)]=_0xd4866c(0x1f9),_0x324896[_0xd4866c(0x1d2)]=_0xd4866c(0x1d8),_0x324896[_0xd4866c(0x1d9)]=_0xd4866c(0x223),_0x324896[_0xd4866c(0x207)]=_0xd4866c(0x1e4),_0x324896[_0xd4866c(0x225)]=_0xd4866c(0x21a),_0x324896[_0xd4866c(0x1fe)]=_0xd4866c(0x213),_0x324896[_0xd4866c(0x219)]=_0xd4866c(0x1b2),_0x324896[_0xd4866c(0x1d6)]=_0xd4866c(0x1e8),_0x324896[_0xd4866c(0x1ea)]=_0xd4866c(0x1bf),_0x324896[_0xd4866c(0x1d4)]=_0xd4866c(0x203),_0x324896[_0xd4866c(0x1da)]=_0xd4866c(0x1fc),_0x324896[_0xd4866c(0x1d0)]=_0xd4866c(0x1c5),_0x324896[_0xd4866c(0x1fa)]=_0xd4866c(0x208),_0x324896[_0xd4866c(0x21c)]=_0xd4866c(0x1b6),_0x324896[_0xd4866c(0x20f)]=_0xd4866c(0x218),_0x324896[_0xd4866c(0x1cc)]=_0xd4866c(0x1e6),_0x324896[_0xd4866c(0x202)]=_0xd4866c(0x1c3),_0x324896[_0xd4866c(0x1c8)]=_0xd4866c(0x1bd),_0x324896[_0xd4866c(0x1f7)]=_0xd4866c(0x1be),_0x324896[_0xd4866c(0x21e)]=_0xd4866c(0x21f),_0x324896[_0xd4866c(0x1fb)]=_0xd4866c(0x216),_0x324896[_0xd4866c(0x222)]=_0xd4866c(0x1e0),_0x324896[_0xd4866c(0x1e2)]=_0xd4866c(0x205),_0x324896[_0xd4866c(0x1d1)]=_0xd4866c(0x1f0);const _0x59903e=_0x324896;return async _0x10d75f=>{const _0x35cff7=_0xd4866c,_0x2c7301=_0x59903e[_0x35cff7(0x1c0)][_0x35cff7(0x1e7)]('|');let _0x2c69ab=0x0;while(!![]){switch(_0x2c7301[_0x2c69ab++]){case'0':_0x10d75f[_0x35cff7(0x206)](_0x59903e[_0x35cff7(0x1ca)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x35cff7(0x220)],'summary':_0x59903e[_0x35cff7(0x1b8)],'description':_0x59903e[_0x35cff7(0x1f8)],'access':_0x35cff7(0x1ed),'permissions':[],'params':resourceSchemas[_0x35cff7(0x1c6)]}},async _0x2a18ce=>updateResource({..._0x2a18ce[_0x35cff7(0x1e1)],'patch':_0x2a18ce[_0x35cff7(0x1b1)],'user':user(_0x2a18ce)},_0x51872c));continue;case'1':const _0x4e6f9e={};_0x4e6f9e[_0x35cff7(0x1dd)]=[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],_0x4e6f9e[_0x35cff7(0x215)]=_0x59903e[_0x35cff7(0x221)],_0x4e6f9e[_0x35cff7(0x1fd)]=_0x35cff7(0x1eb),_0x4e6f9e[_0x35cff7(0x1f5)]=_0x59903e[_0x35cff7(0x1c4)],_0x4e6f9e[_0x35cff7(0x1e3)]=[],_0x4e6f9e[_0x35cff7(0x1e1)]=resourceSchemas[_0x35cff7(0x226)];const _0x583fe2={};_0x583fe2[_0x35cff7(0x1ba)]=_0x4e6f9e,_0x10d75f[_0x35cff7(0x1df)](_0x35cff7(0x1f3),_0x583fe2,async _0x18659c=>deleteResourceRelation({..._0x18659c[_0x35cff7(0x1e1)],'relation':_0x35cff7(0x1de),'user':user(_0x18659c)},_0x51872c));continue;case'2':_0x10d75f[_0x35cff7(0x200)](_0x59903e[_0x35cff7(0x1ca)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x35cff7(0x209),'description':_0x59903e[_0x35cff7(0x1b4)],'access':_0x59903e[_0x35cff7(0x1c4)],'permissions':[],'params':resourceSchemas[_0x35cff7(0x1c6)]}},async _0x24c210=>getResource({..._0x24c210[_0x35cff7(0x1e1)],'user':user(_0x24c210)},_0x51872c));continue;case'3':_0x10d75f[_0x35cff7(0x1df)](_0x59903e[_0x35cff7(0x1db)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x35cff7(0x220)],'summary':_0x59903e[_0x35cff7(0x1e5)],'description':_0x59903e[_0x35cff7(0x1d2)],'access':_0x35cff7(0x1ed),'permissions':[],'params':resourceSchemas[_0x35cff7(0x226)]}},async _0x1ff739=>deleteResourceRelation({..._0x1ff739[_0x35cff7(0x1e1)],'user':user(_0x1ff739)},_0x51872c));continue;case'4':_0x10d75f[_0x35cff7(0x1bc)](_0x59903e[_0x35cff7(0x1d9)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x35cff7(0x210),'description':_0x59903e[_0x35cff7(0x207)],'access':_0x59903e[_0x35cff7(0x1c4)],'permissions':[],'params':resourceSchemas[_0x35cff7(0x220)]}},async _0x11177c=>createResource({..._0x11177c[_0x35cff7(0x1e1)],'data':_0x11177c[_0x35cff7(0x1b1)],'user':user(_0x11177c)},_0x51872c));continue;case'5':_0x10d75f[_0x35cff7(0x1bc)](_0x59903e[_0x35cff7(0x225)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x35cff7(0x1f4),'description':_0x59903e[_0x35cff7(0x1fe)],'access':_0x59903e[_0x35cff7(0x1c4)],'permissions':[],'params':resourceSchemas[_0x35cff7(0x1f2)]}},async _0x19fd8e=>createResourceRelation({..._0x19fd8e[_0x35cff7(0x1e1)],'data':_0x19fd8e[_0x35cff7(0x1b1)],'user':user(_0x19fd8e)},_0x51872c));continue;case'6':const _0x4e9a54={};_0x4e9a54[_0x35cff7(0x1dd)]=[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],_0x4e9a54[_0x35cff7(0x215)]=_0x59903e[_0x35cff7(0x219)],_0x4e9a54[_0x35cff7(0x1fd)]=_0x35cff7(0x1c2),_0x4e9a54[_0x35cff7(0x1f5)]=_0x35cff7(0x1ed),_0x4e9a54[_0x35cff7(0x1e3)]=[],_0x4e9a54[_0x35cff7(0x1e1)]=resourceSchemas[_0x35cff7(0x1f2)];const _0x56f5d6={};_0x56f5d6[_0x35cff7(0x1ba)]=_0x4e9a54,_0x10d75f[_0x35cff7(0x200)](_0x35cff7(0x21a),_0x56f5d6,async _0x131561=>listResourceRelation({..._0x131561[_0x35cff7(0x1f1)],..._0x131561[_0x35cff7(0x1e1)],'user':user(_0x131561)},_0x51872c));continue;case'7':_0x10d75f[_0x35cff7(0x1bc)](_0x59903e[_0x35cff7(0x1d6)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x35cff7(0x1dc),'description':_0x35cff7(0x212),'access':_0x35cff7(0x1ed),'permissions':[_0x35cff7(0x1ee)],'params':resourceSchemas[_0x35cff7(0x21b)],'body':resourceSchemas[_0x35cff7(0x20e)]}},async _0x4c331a=>uploadResourceFile({..._0x4c331a[_0x35cff7(0x1e1)],..._0x4c331a[_0x35cff7(0x1b1)],'user':user(_0x4c331a)},_0x51872c));continue;case'8':_0x10d75f[_0x35cff7(0x200)](_0x59903e[_0x35cff7(0x1ea)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x35cff7(0x1cd),'description':_0x35cff7(0x1c7),'access':_0x35cff7(0x1ed),'permissions':[],'params':resourceSchemas[_0x35cff7(0x1f6)],'querystring':resourceSchemas[_0x35cff7(0x1c9)]}},async _0x1af09e=>suggestResource({..._0x1af09e[_0x35cff7(0x1f1)],..._0x1af09e[_0x35cff7(0x1e1)],'user':user(_0x1af09e)},_0x51872c));continue;case'9':_0x10d75f[_0x35cff7(0x1bc)](_0x59903e[_0x35cff7(0x1d4)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x35cff7(0x220)],'summary':_0x59903e[_0x35cff7(0x1da)],'description':_0x59903e[_0x35cff7(0x1d0)],'access':_0x59903e[_0x35cff7(0x1c4)],'permissions':[],'params':resourceSchemas[_0x35cff7(0x1c6)]}},async _0x1ff407=>addResourceFile({..._0x1ff407[_0x35cff7(0x1e1)],..._0x1ff407[_0x35cff7(0x1b1)],'user':user(_0x1ff407)},_0x51872c));continue;case'10':const _0xab9361={};_0xab9361[_0x35cff7(0x1dd)]=[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],_0xab9361[_0x35cff7(0x215)]=_0x59903e[_0x35cff7(0x1fa)],_0xab9361[_0x35cff7(0x1fd)]=_0x59903e[_0x35cff7(0x21c)],_0xab9361[_0x35cff7(0x1f5)]=_0x59903e[_0x35cff7(0x1c4)],_0xab9361[_0x35cff7(0x1e3)]=[],_0xab9361[_0x35cff7(0x1e1)]=resourceSchemas[_0x35cff7(0x220)];const _0x2921c4={};_0x2921c4[_0x35cff7(0x1ba)]=_0xab9361,_0x10d75f[_0x35cff7(0x200)](_0x35cff7(0x217),_0x2921c4,async _0x218905=>searchResource({..._0x218905[_0x35cff7(0x1f1)],..._0x218905[_0x35cff7(0x1e1)],'user':user(_0x218905)},_0x51872c));continue;case'11':_0x10d75f[_0x35cff7(0x200)](_0x59903e[_0x35cff7(0x1d4)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x59903e[_0x35cff7(0x20f)],'description':_0x35cff7(0x20c),'access':_0x35cff7(0x1ed),'permissions':[],'params':resourceSchemas[_0x35cff7(0x1c6)]}},async _0x58c5bc=>listResourceRelation({..._0x58c5bc[_0x35cff7(0x1e1)],'relation':_0x35cff7(0x1de),'user':user(_0x58c5bc)},_0x51872c));continue;case'12':_0x10d75f[_0x35cff7(0x200)](_0x59903e[_0x35cff7(0x1d9)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x59903e[_0x35cff7(0x1cc)],'description':_0x59903e[_0x35cff7(0x202)],'access':_0x35cff7(0x1ed),'permissions':[],'params':resourceSchemas[_0x35cff7(0x220)]}},async _0x3146af=>listResources({..._0x3146af[_0x35cff7(0x1f1)],..._0x3146af[_0x35cff7(0x1e1)],'user':user(_0x3146af)},_0x51872c));continue;case'13':_0x10d75f[_0x35cff7(0x1df)](_0x59903e[_0x35cff7(0x1ca)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x35cff7(0x1ef),'description':_0x59903e[_0x35cff7(0x1c8)],'access':_0x59903e[_0x35cff7(0x1c4)],'permissions':[],'params':resourceSchemas[_0x35cff7(0x1c6)]}},async _0x4ef3ce=>deleteResource({..._0x4ef3ce[_0x35cff7(0x1e1)],'user':user(_0x4ef3ce)},_0x51872c));continue;case'14':_0x10d75f[_0x35cff7(0x200)](_0x59903e[_0x35cff7(0x1f7)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x35cff7(0x220)],'summary':_0x59903e[_0x35cff7(0x21e)],'description':_0x35cff7(0x1b7),'access':_0x59903e[_0x35cff7(0x1c4)],'permissions':[],'params':resourceSchemas[_0x35cff7(0x1c6)]}},async _0x18cdb7=>listResourceRelation({..._0x18cdb7[_0x35cff7(0x1e1)],'relation':_0x35cff7(0x1b5),'user':user(_0x18cdb7)},_0x51872c));continue;case'15':const _0x3c2a3={};_0x3c2a3[_0x35cff7(0x1dd)]=[_0x35cff7(0x224),_0x59903e[_0x35cff7(0x1b0)]],_0x3c2a3[_0x35cff7(0x215)]=_0x59903e[_0x35cff7(0x1fb)],_0x3c2a3[_0x35cff7(0x1fd)]=_0x59903e[_0x35cff7(0x222)],_0x3c2a3[_0x35cff7(0x1f5)]=_0x59903e[_0x35cff7(0x1c4)],_0x3c2a3[_0x35cff7(0x1e3)]=[],_0x3c2a3[_0x35cff7(0x1e1)]=resourceSchemas[_0x35cff7(0x1c6)];const _0x1022c2={};_0x1022c2[_0x35cff7(0x1ba)]=_0x3c2a3,_0x10d75f[_0x35cff7(0x1bc)](_0x35cff7(0x1be),_0x1022c2,async _0x10f574=>addNote({..._0x10f574[_0x35cff7(0x1e1)],..._0x10f574[_0x35cff7(0x1b1)],'user':user(_0x10f574)},_0x51872c));continue;case'16':_0x10d75f[_0x35cff7(0x200)](_0x59903e[_0x35cff7(0x1e2)],{'schema':{'tags':[_0x59903e[_0x35cff7(0x211)],_0x59903e[_0x35cff7(0x1b0)]],'summary':_0x35cff7(0x201),'description':_0x35cff7(0x1b3),'access':_0x59903e[_0x35cff7(0x1c4)],'permissions':[_0x59903e[_0x35cff7(0x1d1)]],'params':resourceSchemas[_0x35cff7(0x1e9)],'querystring':resourceSchemas[_0x35cff7(0x1d3)]}},async _0x29b91a=>exportResource({..._0x29b91a[_0x35cff7(0x1f1)],..._0x29b91a[_0x35cff7(0x1e1)],'user':user(_0x29b91a)},_0x51872c));continue;}break;}};}function _0x2446(){const _0x207e55=['Returns\x20related\x20records\x20for\x20a\x20resource\x20record.','Returns\x20records\x20from\x20a\x20registered\x20resource.','rBgYE','Adds\x20a\x20file\x20to\x20a\x20resource\x20record.','resourceId','Returns\x20suggested\x20values\x20for\x20a\x20resource\x20field.','cyFjz','suggestQuery','edSzd','1184627qpUkfb','HmNeJ','Suggest\x20resource\x20values','Returns\x20one\x20record\x20from\x20a\x20registered\x20resource.','/api/resource/:resource/:id/:relation/:relationId','shCgO','sanQX','PhJcQ','exportResourceQuery','wWiim','10|8|16|12|4|2|0|13|14|15|11|9|7|1|6|5|3','UZDOU','Delete\x20resource\x20file','Deletes\x20a\x20relation\x20from\x20a\x20resource\x20record.','AGFWo','uVRUQ','jNklC','Upload\x20resource\x20file','tags','files','delete','Adds\x20a\x20note\x20to\x20a\x20resource\x20record.','params','ufPRo','permissions','Creates\x20a\x20record\x20in\x20a\x20registered\x20resource.','lMvLy','List\x20resource\x20records','split','/api/resource/:resource/:id/upload','exportResource','wozpT','Removes\x20a\x20file\x20relation\x20from\x20a\x20resource\x20record.','Updates\x20a\x20record\x20in\x20a\x20registered\x20resource.','user','resource:update','Delete\x20resource\x20record','*:read','query','resourceIdRelation','/api/resource/:resource/:id/files/:relationId','Create\x20resource\x20relation','access','resourceField','Kaqje','hoFyY','Delete\x20resource\x20relation','oxmHy','edyEa','Add\x20resource\x20file','description','TRSnA','8118162DqMhJu','get','Export\x20resource\x20records','CvxJk','/api/resource/:resource/:id/files','3559605uncZVt','/api/resource/:resource/export','put','XdXnC','Search\x20resource','Get\x20resource\x20record','23626485rqslNm','5104680CRdmhX','Returns\x20files\x20related\x20to\x20a\x20resource\x20record.','2GSyvOu','uploadResourceFileBody','yuMYt','Create\x20resource\x20record','PiJIs','Uploads\x20a\x20file\x20to\x20a\x20Resource\x20record\x20and\x20stores\x20its\x20metadata.','Creates\x20a\x20relation\x20for\x20a\x20resource\x20record.','Update\x20resource\x20record','summary','Add\x20resource\x20note','/api/resource/:resource/search','List\x20resource\x20files','nrpWj','/api/resource/:resource/:id/:relation','uploadResourceFile','snXaG','9643912AaDLRA','fyCAS','List\x20resource\x20notes','resource','EOFFY','IUUGn','/api/resource/:resource','fcore','muJVd','resourceIdRelationId','KxCMc','body','List\x20resource\x20relations','Exports\x20readable\x20records\x20from\x20a\x20registered\x20resource.','PGsZg','notes','Searches\x20records\x20in\x20a\x20registered\x20resource.','Returns\x20notes\x20related\x20to\x20a\x20resource\x20record.','hDxCG','/api/resource/:resource/:id','schema','38604jPnaSG','post','Deletes\x20a\x20record\x20from\x20a\x20registered\x20resource.','/api/resource/:resource/:id/notes','/api/suggest/:resource/:field','kiiRX','65QNDRiV'];_0x2446=function(){return _0x207e55;};return _0x2446();}
1
+ import{listResources}from'./services/list-resources.js';function T(r,u){r=r-0x12c;const G=H();let o=G[r];return o;}import{getResource}from'./services/get-resource.js';import{createResource}from'./services/create-resource.js';import{updateResource}from'./services/update-resource.js';import{deleteResource}from'./services/delete-resource.js';import{listResourceRelation}from'./services/list-resource-relation.js';function H(){const X=['get','fcore','Search\x20resource','query','params','/api/suggest/:resource/:field','user','suggestQuery','resource','Creates\x20a\x20record\x20in\x20a\x20registered\x20resource.','body','Get\x20resource\x20record','put','delete','resourceId','Uploads\x20a\x20file\x20to\x20a\x20Resource\x20record\x20and\x20stores\x20its\x20metadata.','uploadResourceFileBody','resourceIdRelation','/api/resource/:resource/:id/:relation','Create\x20resource\x20relation','Creates\x20a\x20relation\x20for\x20a\x20resource\x20record.','/api/resource/:resource/:id/:relation/:relationId','Delete\x20resource\x20relation'];H=function(){return X;};return H();}import{createResourceRelation}from'./services/create-resource-relation.js';import{deleteResourceRelation}from'./services/delete-resource-relation.js';import{searchResource}from'./services/search-resource.js';import{exportResource}from'./services/export-resource.js';import{suggestResource}from'./services/suggest-resource.js';import{uploadResourceFile}from'./services/upload-resource-file.js';import{resourceSchemas}from'./schema.js';const user=u=>u['user'];export function resourceRoutes(r){return async u=>{const o=T;u[o(0x12c)]('/api/resource/:resource/search',{'schema':{'tags':[o(0x12d),'resource'],'summary':o(0x12e),'description':'Searches\x20records\x20in\x20a\x20registered\x20resource.','access':'user','permissions':[],'params':resourceSchemas['resource']}},async G=>searchResource({...G[o(0x12f)],...G[o(0x130)],'user':user(G)},r)),u[o(0x12c)](o(0x131),{'schema':{'tags':[o(0x12d),'resource'],'summary':'Suggest\x20resource\x20values','description':'Returns\x20suggested\x20values\x20for\x20a\x20resource\x20field.','access':o(0x132),'permissions':[],'params':resourceSchemas['resourceField'],'querystring':resourceSchemas[o(0x133)]}},async G=>suggestResource({...G['query'],...G['params'],'user':user(G)},r)),u[o(0x12c)]('/api/resource/:resource/export',{'schema':{'tags':['fcore','resource'],'summary':'Export\x20resource\x20records','description':'Exports\x20readable\x20records\x20from\x20a\x20registered\x20resource.','access':'user','permissions':['*:read'],'params':resourceSchemas['exportResource'],'querystring':resourceSchemas['exportResourceQuery']}},async G=>exportResource({...G['query'],...G['params'],'user':user(G)},r)),u[o(0x12c)]('/api/resource/:resource',{'schema':{'tags':['fcore',o(0x134)],'summary':'List\x20resource\x20records','description':'Returns\x20records\x20from\x20a\x20registered\x20resource.','access':'user','permissions':[],'params':resourceSchemas['resource']}},async G=>listResources({...G['query'],...G['params'],'user':user(G)},r)),u['post']('/api/resource/:resource',{'schema':{'tags':['fcore',o(0x134)],'summary':'Create\x20resource\x20record','description':o(0x135),'access':'user','permissions':[],'params':resourceSchemas[o(0x134)]}},async G=>createResource({...G[o(0x130)],'data':G[o(0x136)],'user':user(G)},r)),u['get']('/api/resource/:resource/:id',{'schema':{'tags':[o(0x12d),'resource'],'summary':o(0x137),'description':'Returns\x20one\x20record\x20from\x20a\x20registered\x20resource.','access':o(0x132),'permissions':[],'params':resourceSchemas['resourceId']}},async G=>getResource({...G['params'],'user':user(G)},r)),u[o(0x138)]('/api/resource/:resource/:id',{'schema':{'tags':['fcore','resource'],'summary':'Update\x20resource\x20record','description':'Updates\x20a\x20record\x20in\x20a\x20registered\x20resource.','access':o(0x132),'permissions':[],'params':resourceSchemas['resourceId']}},async G=>updateResource({...G['params'],'patch':G['body'],'user':user(G)},r)),u[o(0x139)]('/api/resource/:resource/:id',{'schema':{'tags':['fcore',o(0x134)],'summary':'Delete\x20resource\x20record','description':'Deletes\x20a\x20record\x20from\x20a\x20registered\x20resource.','access':'user','permissions':[],'params':resourceSchemas[o(0x13a)]}},async G=>deleteResource({...G['params'],'user':user(G)},r)),u['post']('/api/resource/:resource/:id/upload',{'schema':{'tags':['fcore','resource'],'summary':'Upload\x20resource\x20file','description':o(0x13b),'access':'user','permissions':['resource:update'],'params':resourceSchemas['uploadResourceFile'],'body':resourceSchemas[o(0x13c)]}},async G=>uploadResourceFile({...G[o(0x130)],...G[o(0x136)],'user':user(G)},r)),u['get']('/api/resource/:resource/:id/:relation',{'schema':{'tags':['fcore','resource'],'summary':'List\x20resource\x20relations','description':'Returns\x20related\x20records\x20for\x20a\x20resource\x20record.','access':'user','permissions':[],'params':resourceSchemas[o(0x13d)]}},async G=>listResourceRelation({...G[o(0x12f)],...G[o(0x130)],'user':user(G)},r)),u['post'](o(0x13e),{'schema':{'tags':[o(0x12d),'resource'],'summary':o(0x13f),'description':o(0x140),'access':'user','permissions':[],'params':resourceSchemas['resourceIdRelation']}},async G=>createResourceRelation({...G[o(0x130)],'data':G[o(0x136)],'user':user(G)},r)),u['delete'](o(0x141),{'schema':{'tags':['fcore','resource'],'summary':o(0x142),'description':'Deletes\x20a\x20relation\x20from\x20a\x20resource\x20record.','access':'user','permissions':[],'params':resourceSchemas['resourceIdRelationId']}},async G=>deleteResourceRelation({...G['params'],'user':user(G)},r));};}
@@ -1 +1 @@
1
- const _0x283bd0=_0xc351;(function(_0x169bd7,_0x37ba61){const _0x314f29=_0xc351,_0x1327f5=_0x169bd7();while(!![]){try{const _0x584dfc=parseInt(_0x314f29(0x170))/0x1*(parseInt(_0x314f29(0x168))/0x2)+-parseInt(_0x314f29(0x16f))/0x3+parseInt(_0x314f29(0x17a))/0x4+parseInt(_0x314f29(0x15d))/0x5+parseInt(_0x314f29(0x161))/0x6*(parseInt(_0x314f29(0x15e))/0x7)+parseInt(_0x314f29(0x175))/0x8*(parseInt(_0x314f29(0x179))/0x9)+-parseInt(_0x314f29(0x16a))/0xa*(parseInt(_0x314f29(0x177))/0xb);if(_0x584dfc===_0x37ba61)break;else _0x1327f5['push'](_0x1327f5['shift']());}catch(_0x2e5cbe){_0x1327f5['push'](_0x1327f5['shift']());}}}(_0x4367,0xc2379));import{Type}from'@sinclair/typebox';const _0xc937e4={};_0xc937e4[_0x283bd0(0x165)]=0x1,_0xc937e4[_0x283bd0(0x166)]=0x80,_0xc937e4[_0x283bd0(0x15f)]=_0x283bd0(0x176);export const identifier=Type[_0x283bd0(0x172)](_0xc937e4);const _0xcad2d0={};_0xcad2d0[_0x283bd0(0x169)]=identifier;const _0x35541f={};_0x35541f[_0x283bd0(0x163)]=identifier;const _0x45effc={};_0x45effc[_0x283bd0(0x163)]=identifier;const _0x58a5d3={};_0x58a5d3[_0x283bd0(0x163)]=identifier,_0x58a5d3[_0x283bd0(0x171)]=identifier;const _0x1577a5={};_0x1577a5[_0x283bd0(0x16d)]=0x1,_0x1577a5[_0x283bd0(0x160)]=0xc8;const _0xdc4d43={};_0xdc4d43[_0x283bd0(0x163)]=identifier,_0xdc4d43['id']=identifier;const _0x14504f={};_0x14504f[_0x283bd0(0x163)]=identifier,_0x14504f['id']=identifier,_0x14504f[_0x283bd0(0x174)]=identifier;const _0x32f538={};_0x32f538[_0x283bd0(0x163)]=identifier,_0x32f538['id']=identifier,_0x32f538[_0x283bd0(0x174)]=identifier,_0x32f538[_0x283bd0(0x162)]=identifier;const _0x2f161d={};_0x2f161d[_0x283bd0(0x163)]=identifier,_0x2f161d['id']=identifier;const _0x51563e={};_0x51563e[_0x283bd0(0x165)]=0x1,_0x51563e[_0x283bd0(0x166)]=0xff;function _0x4367(){const _0x391038=['Unknown','minLength','maxLength','Optional','393202xHzMqT','name','10LjPCTw','Record','Any','minimum','Array','1154448SpVHfu','2crOLcS','field','String','Object','relation','784fqavBT','^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$','26850461bAMRqn','Integer','61416fPUwlD','4925360TKtVzu','2301170LNXrvG','6074264fEXaLt','pattern','maximum','6dOKvvR','relationId','resource'];_0x4367=function(){return _0x391038;};return _0x4367();}const _0x336b2a={};function _0xc351(_0x5b14be,_0x22f87){_0x5b14be=_0x5b14be-0x15d;const _0x436750=_0x4367();let _0xc35160=_0x436750[_0x5b14be];return _0xc35160;}_0x336b2a[_0x283bd0(0x165)]=0x1;const _0x42861b={};_0x42861b[_0x283bd0(0x16d)]=0x1,_0x42861b[_0x283bd0(0x160)]=0xc8;const _0xc2cfb6={};_0xc2cfb6[_0x283bd0(0x16d)]=0x0;export const resourceSchemas={'dictionaryName':Type[_0x283bd0(0x173)](_0xcad2d0),'resource':Type[_0x283bd0(0x173)](_0x35541f),'exportResource':Type[_0x283bd0(0x173)](_0x45effc),'resourceField':Type[_0x283bd0(0x173)](_0x58a5d3),'suggestQuery':Type[_0x283bd0(0x173)]({'q':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x172)]()),'search':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x172)]()),'limit':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x178)](_0x1577a5))}),'resourceId':Type[_0x283bd0(0x173)](_0xdc4d43),'resourceIdRelation':Type[_0x283bd0(0x173)](_0x14504f),'resourceIdRelationId':Type[_0x283bd0(0x173)](_0x32f538),'uploadResourceFile':Type[_0x283bd0(0x173)](_0x2f161d),'uploadResourceFileBody':Type[_0x283bd0(0x173)]({'file':Type[_0x283bd0(0x16c)](),'fileName':Type[_0x283bd0(0x172)](_0x51563e)}),'exportResourceQuery':Type[_0x283bd0(0x173)]({'filter':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x16b)](Type[_0x283bd0(0x172)](),Type[_0x283bd0(0x164)]())),'sort':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x16e)](Type[_0x283bd0(0x172)](_0x336b2a))),'search':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x172)]()),'limit':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x178)](_0x42861b)),'offset':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x178)](_0xc2cfb6)),'fields':Type[_0x283bd0(0x167)](Type[_0x283bd0(0x16e)](identifier))})};
1
+ const r=T;function H(){const u=['Object','String','Optional','Unknown','Array'];H=function(){return u;};return H();}function T(r,u){r=r-0x139;const G=H();let o=G[r];return o;}import{Type}from'@sinclair/typebox';export const identifier=Type['String']({'minLength':0x1,'maxLength':0x80,'pattern':'^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$'});export const resourceSchemas={'dictionaryName':Type[r(0x139)]({'name':identifier}),'resource':Type['Object']({'resource':identifier}),'exportResource':Type['Object']({'resource':identifier}),'resourceField':Type[r(0x139)]({'resource':identifier,'field':identifier}),'suggestQuery':Type['Object']({'q':Type['Optional'](Type[r(0x13a)]()),'search':Type[r(0x13b)](Type['String']()),'limit':Type['Optional'](Type['Integer']({'minimum':0x1,'maximum':0xc8}))}),'resourceId':Type[r(0x139)]({'resource':identifier,'id':identifier}),'resourceIdRelation':Type['Object']({'resource':identifier,'id':identifier,'relation':identifier}),'resourceIdRelationId':Type[r(0x139)]({'resource':identifier,'id':identifier,'relation':identifier,'relationId':identifier}),'uploadResourceFile':Type['Object']({'resource':identifier,'id':identifier}),'uploadResourceFileBody':Type['Object']({'file':Type['Any'](),'fileName':Type['String']({'minLength':0x1,'maxLength':0xff})}),'exportResourceQuery':Type['Object']({'filter':Type['Optional'](Type['Record'](Type[r(0x13a)](),Type[r(0x13c)]())),'sort':Type['Optional'](Type[r(0x13d)](Type['String']({'minLength':0x1}))),'search':Type[r(0x13b)](Type['String']()),'limit':Type['Optional'](Type['Integer']({'minimum':0x1,'maximum':0xc8})),'offset':Type[r(0x13b)](Type['Integer']({'minimum':0x0})),'fields':Type['Optional'](Type['Array'](identifier))})};
@@ -1 +1 @@
1
- (function(_0x66d8cc,_0x2d344a){const _0x21a3f6=_0x2014,_0x4c4a5b=_0x66d8cc();while(!![]){try{const _0x26b35b=-parseInt(_0x21a3f6(0x151))/0x1+-parseInt(_0x21a3f6(0x15c))/0x2+parseInt(_0x21a3f6(0x15a))/0x3+-parseInt(_0x21a3f6(0x154))/0x4*(parseInt(_0x21a3f6(0x157))/0x5)+parseInt(_0x21a3f6(0x153))/0x6*(parseInt(_0x21a3f6(0x15b))/0x7)+-parseInt(_0x21a3f6(0x15f))/0x8*(-parseInt(_0x21a3f6(0x152))/0x9)+parseInt(_0x21a3f6(0x15d))/0xa*(-parseInt(_0x21a3f6(0x150))/0xb);if(_0x26b35b===_0x2d344a)break;else _0x4c4a5b['push'](_0x4c4a5b['shift']());}catch(_0x43f58e){_0x4c4a5b['push'](_0x4c4a5b['shift']());}}}(_0x3e62,0x80727));function _0x2014(_0x2d6084,_0x399046){_0x2d6084=_0x2d6084-0x14f;const _0x3e6223=_0x3e62();let _0x2014a4=_0x3e6223[_0x2d6084];return _0x2014a4;}export async function addNote(_0xdf4e04,_0x17ca19){const _0xc4c1a=_0x2014,_0x49919d={'aWmEv':_0xc4c1a(0x155),'rCTql':function(_0x20f54d,_0x42be5c){return _0x20f54d(_0x42be5c);}},_0x1243f6=await _0x17ca19['pg'][_0xc4c1a(0x156)](_0x49919d[_0xc4c1a(0x159)],[_0xdf4e04[_0xc4c1a(0x160)],_0x49919d[_0xc4c1a(0x14f)](String,_0xdf4e04['id']),_0xdf4e04[_0xc4c1a(0x158)]]);return _0x1243f6[_0xc4c1a(0x15e)][0x0];}function _0x3e62(){const _0x254c82=['2368MmRPmq','resource','rCTql','1578247xzWVri','72126FJOQfR','27549DBOlQm','60IRSDgT','546188AOZRtx','INSERT\x20INTO\x20admin.notes(resource,resource_id,body)\x20VALUES\x20($1,$2,$3)\x20RETURNING\x20*','query','5ucueBm','body','aWmEv','1769874ozJrQE','629573TmmJxc','451684yGxrQz','100rTxqzX','rows'];_0x3e62=function(){return _0x254c82;};return _0x3e62();}
1
+ export async function addNote(u,G){const o=await G['pg']['query']('INSERT\x20INTO\x20admin.notes(resource,resource_id,body)\x20VALUES\x20($1,$2,$3)\x20RETURNING\x20*',[u['resource'],String(u['id']),u['body']]);return o['rows'][0x0];}
@@ -1 +1 @@
1
- function _0xc2ee(){const _0x4787ef=['21803590yLLSdJ','889582tgrWoT','3sUddag','query','1305004RjsmYw','size','7EQXnfA','rows','pcNlI','resource','4432720vimfyg','5uePpCV','\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\x20\x20','4502898ihuKBV','11jkDdnN','3487602RHhslF','73654cdGpAG','filePath'];_0xc2ee=function(){return _0x4787ef;};return _0xc2ee();}function _0x2aef(_0x5f492c,_0x311bd4){_0x5f492c=_0x5f492c-0xcb;const _0xc2eead=_0xc2ee();let _0x2aef20=_0xc2eead[_0x5f492c];return _0x2aef20;}(function(_0x351056,_0x54a257){const _0x4878be=_0x2aef,_0x483904=_0x351056();while(!![]){try{const _0xe0d796=-parseInt(_0x4878be(0xcc))/0x1+parseInt(_0x4878be(0xcf))/0x2*(-parseInt(_0x4878be(0xd0))/0x3)+-parseInt(_0x4878be(0xd2))/0x4*(-parseInt(_0x4878be(0xd9))/0x5)+parseInt(_0x4878be(0xcb))/0x6*(-parseInt(_0x4878be(0xd4))/0x7)+-parseInt(_0x4878be(0xd8))/0x8+-parseInt(_0x4878be(0xdb))/0x9+-parseInt(_0x4878be(0xce))/0xa*(-parseInt(_0x4878be(0xdc))/0xb);if(_0xe0d796===_0x54a257)break;else _0x483904['push'](_0x483904['shift']());}catch(_0x5e2d10){_0x483904['push'](_0x483904['shift']());}}}(_0xc2ee,0x560e6));export async function addResourceFile(_0x3d03d9,_0x367a60){const _0x3c2ccf=_0x2aef,_0x18a543={'pcNlI':function(_0x508481,_0x4ca257){return _0x508481(_0x4ca257);}},_0x3ba734=await _0x367a60['pg'][_0x3c2ccf(0xd1)](_0x3c2ccf(0xda),[_0x3d03d9[_0x3c2ccf(0xd7)],_0x18a543[_0x3c2ccf(0xd6)](String,_0x3d03d9['id']),_0x3d03d9[_0x3c2ccf(0xcd)],_0x3d03d9[_0x3c2ccf(0xd3)]??null]);return _0x3ba734[_0x3c2ccf(0xd5)][0x0];}
1
+ export async function addResourceFile(r,u){const o=T,G=await u['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\x20\x20',[r['resource'],String(r['id']),r[o(0x1b4)],r['size']??null]);return G[o(0x1b5)][0x0];}function T(r,u){r=r-0x1b4;const G=H();let o=G[r];return o;}function H(){const X=['filePath','rows'];H=function(){return X;};return H();}
@@ -1,6 +1,12 @@
1
1
  /**
2
2
  * Implements the create resource relation application service for its module.
3
3
  */
4
- import type { AppContext } from '../../../context.js';
5
- export declare function createResourceRelation(params: any, ctx: AppContext): Promise<never>;
4
+ import type { AppContext, User } from '../../../context.js';
5
+ export declare function createResourceRelation(params: {
6
+ resource: string;
7
+ id: string;
8
+ relation: string;
9
+ data?: any;
10
+ user: User;
11
+ }, ctx: AppContext): Promise<any>;
6
12
  //# sourceMappingURL=create-resource-relation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-resource-relation.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/create-resource-relation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAEzF"}
1
+ {"version":3,"file":"create-resource-relation.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/create-resource-relation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EAClF,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,GAAG,CAAC,CAGd"}
@@ -1 +1 @@
1
- function _0x22c0(){var _0x483242=['3759789UDjywC','1598391ZltxSa','2992230CgGmXr','fSWoh','6570064wrIUEJ','10yOlwBz','39seKmCD','7rmMQLy','24OAvUsr','37092dQJELn','801798TukEhO','8UFOBwo','DScIs','1672080IvumZx','Generic\x20Resource\x20relations'];_0x22c0=function(){return _0x483242;};return _0x22c0();}(function(_0x15a082,_0x288700){var _0x3e72ba=_0x4520,_0x56a923=_0x15a082();while(!![]){try{var _0x2857b2=-parseInt(_0x3e72ba(0x174))/0x1*(parseInt(_0x3e72ba(0x177))/0x2)+parseInt(_0x3e72ba(0x16f))/0x3+parseInt(_0x3e72ba(0x179))/0x4*(parseInt(_0x3e72ba(0x16c))/0x5)+parseInt(_0x3e72ba(0x178))/0x6+-parseInt(_0x3e72ba(0x175))/0x7*(-parseInt(_0x3e72ba(0x172))/0x8)+parseInt(_0x3e72ba(0x170))/0x9*(-parseInt(_0x3e72ba(0x173))/0xa)+-parseInt(_0x3e72ba(0x16e))/0xb*(parseInt(_0x3e72ba(0x176))/0xc);if(_0x2857b2===_0x288700)break;else _0x56a923['push'](_0x56a923['shift']());}catch(_0x501e21){_0x56a923['push'](_0x56a923['shift']());}}}(_0x22c0,0x65d86));function _0x4520(_0x3fe74a,_0x5c4e5a){_0x3fe74a=_0x3fe74a-0x16b;var _0x22c085=_0x22c0();var _0x4520da=_0x22c085[_0x3fe74a];return _0x4520da;}import{unsupported}from'../../utils/unsupported.js';export async function createResourceRelation(_0x5e104f,_0x58ba75){var _0x1542a2=_0x4520,_0x2a07ec={'fSWoh':function(_0x1f2b87,_0x5dce7a){return _0x1f2b87(_0x5dce7a);},'DScIs':_0x1542a2(0x16d)};return _0x2a07ec[_0x1542a2(0x171)](unsupported,_0x2a07ec[_0x1542a2(0x16b)]);}
1
+ export async function createResourceRelation(r,u){const q=T,{resource:G,id:o,relation:X,data:w,user:a}=r;return u[q(0x1f3)]['createRelation']({'name':G,'id':o,'relation':X,'data':w,'user':a});}function T(r,u){r=r-0x1f3;const G=H();let o=G[r];return o;}function H(){const p=['resource'];H=function(){return p;};return H();}
@@ -1 +1 @@
1
- (function(_0x26269d,_0x5ac9d4){var _0x104b9e=_0x5a6e,_0x1a9458=_0x26269d();while(!![]){try{var _0x46e293=parseInt(_0x104b9e(0x98))/0x1+parseInt(_0x104b9e(0x9c))/0x2+-parseInt(_0x104b9e(0x97))/0x3+parseInt(_0x104b9e(0x93))/0x4*(-parseInt(_0x104b9e(0x9d))/0x5)+-parseInt(_0x104b9e(0x92))/0x6*(parseInt(_0x104b9e(0x96))/0x7)+parseInt(_0x104b9e(0x90))/0x8+-parseInt(_0x104b9e(0x94))/0x9*(-parseInt(_0x104b9e(0x91))/0xa);if(_0x46e293===_0x5ac9d4)break;else _0x1a9458['push'](_0x1a9458['shift']());}catch(_0x10dbb0){_0x1a9458['push'](_0x1a9458['shift']());}}}(_0x4a00,0xecb46));function _0x5a6e(_0x220b63,_0x1d263f){_0x220b63=_0x220b63-0x90;var _0x4a00fa=_0x4a00();var _0x5a6e3e=_0x4a00fa[_0x220b63];return _0x5a6e3e;}export async function createResource(_0x59f2db,_0x4fa800){var _0x7a5159=_0x5a6e,_0x16ab82={};return _0x16ab82[_0x7a5159(0x95)]=_0x59f2db[_0x7a5159(0x99)],_0x16ab82[_0x7a5159(0x9a)]=_0x59f2db[_0x7a5159(0x9a)],_0x16ab82[_0x7a5159(0x9e)]=_0x59f2db[_0x7a5159(0x9e)],_0x4fa800[_0x7a5159(0x99)][_0x7a5159(0x9b)](_0x16ab82);}function _0x4a00(){var _0x1b1a20=['695264JDutqW','resource','data','create','3280866rAzcfA','257305pyDYLI','user','15242216FaaOkq','510060KJlkTe','60kLqEqT','72zJnWAc','27WedWOG','name','1013901gLoVmX','3149166KrdQWS'];_0x4a00=function(){return _0x1b1a20;};return _0x4a00();}
1
+ function T(r,u){r=r-0xf5;var G=H();var o=G[r];return o;}function H(){var o=['data'];H=function(){return o;};return H();}export async function createResource(r,u){var G=T;return u['resource']['create']({'name':r['resource'],'data':r[G(0xf5)],'user':r['user']});}
@@ -2,5 +2,12 @@
2
2
  * Implements the delete resource relation application service for its module.
3
3
  */
4
4
  import type { AppContext } from '../../../context.js';
5
- export declare function deleteResourceRelation(params: any, ctx: AppContext): Promise<never>;
5
+ export declare function deleteResourceRelation(params: {
6
+ resource: string;
7
+ id: string;
8
+ relation: string;
9
+ relationId: string;
10
+ }, ctx: AppContext): Promise<{
11
+ success: boolean;
12
+ }>;
6
13
  //# sourceMappingURL=delete-resource-relation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delete-resource-relation.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/delete-resource-relation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAEzF"}
1
+ {"version":3,"file":"delete-resource-relation.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/delete-resource-relation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAC9E,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAG/B"}
@@ -1 +1 @@
1
- function _0x3c93(){var _0x3ec2da=['34408IhQwjT','XVlJH','54080IIaoDW','Generic\x20Resource\x20relations','9UJYXfw','180gCQgbk','24OZvltm','896336yPKzlQ','12ypSFJD','488866PlFsru','537568wAUQzm','hYBxg','140508jmaCMO','518845zBDFBN'];_0x3c93=function(){return _0x3ec2da;};return _0x3c93();}function _0x54dd(_0x18c57a,_0x3a77f8){_0x18c57a=_0x18c57a-0x122;var _0x3c934f=_0x3c93();var _0x54dd32=_0x3c934f[_0x18c57a];return _0x54dd32;}(function(_0x3e927c,_0x5cfa03){var _0x29b6cc=_0x54dd,_0x3f7396=_0x3e927c();while(!![]){try{var _0x1718a9=-parseInt(_0x29b6cc(0x129))/0x1+parseInt(_0x29b6cc(0x12d))/0x2*(parseInt(_0x29b6cc(0x123))/0x3)+parseInt(_0x29b6cc(0x124))/0x4+parseInt(_0x29b6cc(0x12a))/0x5*(-parseInt(_0x29b6cc(0x125))/0x6)+parseInt(_0x29b6cc(0x126))/0x7+parseInt(_0x29b6cc(0x127))/0x8*(-parseInt(_0x29b6cc(0x12f))/0x9)+-parseInt(_0x29b6cc(0x122))/0xa*(-parseInt(_0x29b6cc(0x12b))/0xb);if(_0x1718a9===_0x5cfa03)break;else _0x3f7396['push'](_0x3f7396['shift']());}catch(_0x594b21){_0x3f7396['push'](_0x3f7396['shift']());}}}(_0x3c93,0x24f08));import{unsupported}from'../../utils/unsupported.js';export async function deleteResourceRelation(_0x182b0e,_0x378786){var _0xfcd627=_0x54dd,_0x228177={'hYBxg':function(_0x10d6f0,_0x1379e4){return _0x10d6f0(_0x1379e4);},'XVlJH':_0xfcd627(0x12e)};return _0x228177[_0xfcd627(0x128)](unsupported,_0x228177[_0xfcd627(0x12c)]);}
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 +1 @@
1
- (function(_0x31c475,_0x13b37f){var _0x28ec91=_0x223c,_0x114d17=_0x31c475();while(!![]){try{var _0x3ee1b1=parseInt(_0x28ec91(0x1a7))/0x1+-parseInt(_0x28ec91(0x19c))/0x2*(parseInt(_0x28ec91(0x19f))/0x3)+parseInt(_0x28ec91(0x1a2))/0x4+parseInt(_0x28ec91(0x19d))/0x5*(-parseInt(_0x28ec91(0x1a6))/0x6)+-parseInt(_0x28ec91(0x1aa))/0x7+parseInt(_0x28ec91(0x1a0))/0x8*(parseInt(_0x28ec91(0x1a1))/0x9)+parseInt(_0x28ec91(0x1a3))/0xa*(parseInt(_0x28ec91(0x1a5))/0xb);if(_0x3ee1b1===_0x13b37f)break;else _0x114d17['push'](_0x114d17['shift']());}catch(_0x4c9908){_0x114d17['push'](_0x114d17['shift']());}}}(_0x11cd,0x35c7b));export async function deleteResource(_0x39bc2b,_0x1c7e5a){var _0x5d447a=_0x223c,_0x7c33a4={};return _0x7c33a4[_0x5d447a(0x1a8)]=_0x39bc2b[_0x5d447a(0x19e)],_0x7c33a4['id']=_0x39bc2b['id'],_0x7c33a4[_0x5d447a(0x1a9)]=_0x39bc2b[_0x5d447a(0x1a9)],_0x1c7e5a[_0x5d447a(0x19e)][_0x5d447a(0x1a4)](_0x7c33a4);}function _0x223c(_0x2860b4,_0x345d0f){_0x2860b4=_0x2860b4-0x19c;var _0x11cdd7=_0x11cd();var _0x223c2c=_0x11cdd7[_0x2860b4];return _0x223c2c;}function _0x11cd(){var _0x51b443=['2472774SrpfjG','182717hRooCP','name','user','2773344hwSAFf','4168kEUvBm','5VNLWCU','resource','153SkNivN','16jEdwkP','1249065sqIGqa','919716PwQdhe','120KbMXwC','delete','407616cUVvIQ'];_0x11cd=function(){return _0x51b443;};return _0x11cd();}
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 +1 @@
1
- function _0xafa2(){const _0x22fb90=['filter','resource','find','offset','2385UEwEkg','3779968ZVcJTc','826120LpWQyI','6ThOuAw','174AYWRuJ','query','fields','name','sort','8610puqUvC','search','4423515KwvypW','limit','893574fPiTJR','263991YeUZKD','user','311810Mxlfow','rows'];_0xafa2=function(){return _0x22fb90;};return _0xafa2();}function _0x5cc0(_0x10737b,_0x2a74c0){_0x10737b=_0x10737b-0x198;const _0xafa265=_0xafa2();let _0x5cc052=_0xafa265[_0x10737b];return _0x5cc052;}(function(_0x5484ee,_0x571989){const _0x38cde8=_0x5cc0,_0x388ca8=_0x5484ee();while(!![]){try{const _0xd41b4f=-parseInt(_0x38cde8(0x198))/0x1+parseInt(_0x38cde8(0x19b))/0x2+parseInt(_0x38cde8(0x1a4))/0x3*(parseInt(_0x38cde8(0x1a3))/0x4)+-parseInt(_0x38cde8(0x1ac))/0x5+-parseInt(_0x38cde8(0x1a5))/0x6*(-parseInt(_0x38cde8(0x199))/0x7)+parseInt(_0x38cde8(0x1a2))/0x8+-parseInt(_0x38cde8(0x1a1))/0x9*(-parseInt(_0x38cde8(0x1aa))/0xa);if(_0xd41b4f===_0x571989)break;else _0x388ca8['push'](_0x388ca8['shift']());}catch(_0x1a5289){_0x388ca8['push'](_0x388ca8['shift']());}}}(_0xafa2,0x8ed42));export async function exportResource(_0x4883f3,_0x1ea8dc){const _0x4c2342=_0x5cc0,_0x6f022={};_0x6f022[_0x4c2342(0x1a8)]=_0x4883f3[_0x4c2342(0x19e)],_0x6f022[_0x4c2342(0x1a6)]={},_0x6f022[_0x4c2342(0x19a)]=_0x4883f3[_0x4c2342(0x19a)],_0x6f022[_0x4c2342(0x1a6)][_0x4c2342(0x19d)]=_0x4883f3[_0x4c2342(0x19d)],_0x6f022[_0x4c2342(0x1a6)][_0x4c2342(0x1a9)]=_0x4883f3[_0x4c2342(0x1a9)],_0x6f022[_0x4c2342(0x1a6)][_0x4c2342(0x1ab)]=_0x4883f3[_0x4c2342(0x1ab)],_0x6f022[_0x4c2342(0x1a6)][_0x4c2342(0x1ad)]=_0x4883f3[_0x4c2342(0x1ad)],_0x6f022[_0x4c2342(0x1a6)][_0x4c2342(0x1a0)]=_0x4883f3[_0x4c2342(0x1a0)],_0x6f022[_0x4c2342(0x1a6)][_0x4c2342(0x1a7)]=_0x4883f3[_0x4c2342(0x1a7)];const _0x571d3f=await _0x1ea8dc[_0x4c2342(0x19e)][_0x4c2342(0x19f)](_0x6f022);return _0x571d3f[_0x4c2342(0x19c)];}
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 +1 @@
1
- (function(_0x157039,_0x143176){var _0x33a7fd=_0x12fb,_0x225d80=_0x157039();while(!![]){try{var _0x32c94f=-parseInt(_0x33a7fd(0x88))/0x1*(parseInt(_0x33a7fd(0x7e))/0x2)+parseInt(_0x33a7fd(0x83))/0x3*(-parseInt(_0x33a7fd(0x87))/0x4)+parseInt(_0x33a7fd(0x86))/0x5+parseInt(_0x33a7fd(0x85))/0x6*(-parseInt(_0x33a7fd(0x81))/0x7)+-parseInt(_0x33a7fd(0x82))/0x8*(parseInt(_0x33a7fd(0x79))/0x9)+-parseInt(_0x33a7fd(0x84))/0xa*(parseInt(_0x33a7fd(0x7d))/0xb)+parseInt(_0x33a7fd(0x7c))/0xc;if(_0x32c94f===_0x143176)break;else _0x225d80['push'](_0x225d80['shift']());}catch(_0xfb575c){_0x225d80['push'](_0x225d80['shift']());}}}(_0x1c17,0x606a8));function _0x1c17(){var _0xebd8ad=['32561364NsCOvN','55pHBhKm','6436PKZGsU','resource','user','7SQpkWA','59336YZQeHW','3wTbUNl','1385010jTFUpK','4085502vxcrob','1389385VyFCTJ','2429780JrJwXB','106bMvUij','333bAurdX','findOne','name'];_0x1c17=function(){return _0xebd8ad;};return _0x1c17();}function _0x12fb(_0x26fff4,_0x19ebe7){_0x26fff4=_0x26fff4-0x79;var _0x1c1784=_0x1c17();var _0x12fbba=_0x1c1784[_0x26fff4];return _0x12fbba;}export async function getResource(_0x5f22c6,_0x16011d){var _0x4875ef=_0x12fb,_0xb7d5ab={};return _0xb7d5ab[_0x4875ef(0x7b)]=_0x5f22c6[_0x4875ef(0x7f)],_0xb7d5ab['id']=_0x5f22c6['id'],_0xb7d5ab[_0x4875ef(0x80)]=_0x5f22c6[_0x4875ef(0x80)],_0x16011d[_0x4875ef(0x7f)][_0x4875ef(0x7a)](_0xb7d5ab);}
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,6 +1,11 @@
1
1
  /**
2
2
  * Implements the list resource relation application service for its module.
3
3
  */
4
- import type { AppContext } from '../../../context.js';
5
- export declare function listResourceRelation(params: any, ctx: AppContext): Promise<never>;
4
+ import type { AppContext, User } from '../../../context.js';
5
+ export declare function listResourceRelation(params: {
6
+ resource: string;
7
+ id: string;
8
+ relation: string;
9
+ user?: User;
10
+ }, ctx: AppContext): Promise<any>;
6
11
  //# 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,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAEvF"}
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 +1 @@
1
- (function(_0x267d52,_0x41003b){var _0x3ce592=_0x4da8,_0x4dd73c=_0x267d52();while(!![]){try{var _0x3df46e=parseInt(_0x3ce592(0xb7))/0x1*(parseInt(_0x3ce592(0xb6))/0x2)+-parseInt(_0x3ce592(0xb5))/0x3*(-parseInt(_0x3ce592(0xbb))/0x4)+-parseInt(_0x3ce592(0xc0))/0x5*(parseInt(_0x3ce592(0xbf))/0x6)+-parseInt(_0x3ce592(0xc1))/0x7+-parseInt(_0x3ce592(0xbd))/0x8*(parseInt(_0x3ce592(0xb8))/0x9)+parseInt(_0x3ce592(0xba))/0xa+parseInt(_0x3ce592(0xbc))/0xb;if(_0x3df46e===_0x41003b)break;else _0x4dd73c['push'](_0x4dd73c['shift']());}catch(_0x4fb02d){_0x4dd73c['push'](_0x4dd73c['shift']());}}}(_0x26b1,0x34144));import{unsupported}from'../../utils/unsupported.js';function _0x4da8(_0x2bff0b,_0x577dc5){_0x2bff0b=_0x2bff0b-0xb5;var _0x26b17c=_0x26b1();var _0x4da874=_0x26b17c[_0x2bff0b];return _0x4da874;}function _0x26b1(){var _0xecad21=['124hGVjqL','5923599tlTXsI','7880VxZyCY','Generic\x20Resource\x20relations','77892DKZNKv','35TzSDUS','1732871kCVVoF','RJveX','15123GUuVCd','84KldNnm','1011ktSzdc','3339bzhcFM','GHIBs','1799360EsInjd'];_0x26b1=function(){return _0xecad21;};return _0x26b1();}export async function listResourceRelation(_0x38187b,_0x3edba0){var _0x22ba33=_0x4da8,_0x1e9b39={'GHIBs':function(_0x197c65,_0x5eff36){return _0x197c65(_0x5eff36);},'RJveX':_0x22ba33(0xbe)};return _0x1e9b39[_0x22ba33(0xb9)](unsupported,_0x1e9b39[_0x22ba33(0xc2)]);}
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 +1 @@
1
- function _0x5cde(){var _0x5439c5=['find','1508264JzLaMN','2539708wtcREF','8465930dTxCFI','1012254qxYGMV','resource','limit','max','page','filter','40EzvfPx','5974885gjpPLB','2157744dmgryV','196aUbJsB','search','sort','offset','user','54865KHzSoQ','63rakoKS','3KbEjrZ'];_0x5cde=function(){return _0x5439c5;};return _0x5cde();}function _0x6a5f(_0x15be57,_0x780ef0){_0x15be57=_0x15be57-0xac;var _0x5cde97=_0x5cde();var _0x6a5f07=_0x5cde97[_0x15be57];return _0x6a5f07;}(function(_0x17c912,_0xa21159){var _0x5db0f7=_0x6a5f,_0xcb45e1=_0x17c912();while(!![]){try{var _0x4fd682=parseInt(_0x5db0f7(0xb4))/0x1+-parseInt(_0x5db0f7(0xb2))/0x2*(parseInt(_0x5db0f7(0xaf))/0x3)+-parseInt(_0x5db0f7(0xbd))/0x4*(-parseInt(_0x5db0f7(0xad))/0x5)+-parseInt(_0x5db0f7(0xbc))/0x6+-parseInt(_0x5db0f7(0xbb))/0x7+parseInt(_0x5db0f7(0xb1))/0x8*(-parseInt(_0x5db0f7(0xae))/0x9)+-parseInt(_0x5db0f7(0xba))/0xa*(-parseInt(_0x5db0f7(0xb3))/0xb);if(_0x4fd682===_0xa21159)break;else _0xcb45e1['push'](_0xcb45e1['shift']());}catch(_0xa3d3c5){_0xcb45e1['push'](_0xcb45e1['shift']());}}}(_0x5cde,0xc9957));export async function listResources(_0x433f3a,_0x117f69){var _0x551bd0=_0x6a5f;return _0x117f69[_0x551bd0(0xb5)][_0x551bd0(0xb0)]({'name':_0x433f3a[_0x551bd0(0xb5)],'query':{'filter':_0x433f3a[_0x551bd0(0xb9)],'sort':_0x433f3a[_0x551bd0(0xbf)],'search':_0x433f3a[_0x551bd0(0xbe)],'limit':_0x433f3a[_0x551bd0(0xb6)],'offset':_0x433f3a[_0x551bd0(0xc0)]??(_0x433f3a[_0x551bd0(0xb8)]?Math[_0x551bd0(0xb7)](_0x433f3a[_0x551bd0(0xb8)]-0x1,0x0):0x0)*(_0x433f3a[_0x551bd0(0xb6)]??0x14)},'user':_0x433f3a[_0x551bd0(0xac)]});}
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 +1 @@
1
- function _0x3344(){var _0x3b3947=['1590352eOkceM','5565241csDjlX','556638nXhtub','query','865HQRebJ','name','80IWgMXt','4251glczLH','filter','find','user','17848UzaXhk','7YYbEEY','resource','549566Rwdpyp','20iiLeZH','3688002UUsugO'];_0x3344=function(){return _0x3b3947;};return _0x3344();}function _0x9e7e(_0x409125,_0x127219){_0x409125=_0x409125-0xa6;var _0x33440c=_0x3344();var _0x9e7eef=_0x33440c[_0x409125];return _0x9e7eef;}(function(_0x48e95a,_0x24a786){var _0x3b6c12=_0x9e7e,_0x5ad4ec=_0x48e95a();while(!![]){try{var _0xe794a6=-parseInt(_0x3b6c12(0xb1))/0x1+-parseInt(_0x3b6c12(0xa9))/0x2*(parseInt(_0x3b6c12(0xaa))/0x3)+parseInt(_0x3b6c12(0xae))/0x4*(parseInt(_0x3b6c12(0xa7))/0x5)+-parseInt(_0x3b6c12(0xb6))/0x6*(parseInt(_0x3b6c12(0xaf))/0x7)+-parseInt(_0x3b6c12(0xb4))/0x8+-parseInt(_0x3b6c12(0xb3))/0x9+-parseInt(_0x3b6c12(0xb2))/0xa*(-parseInt(_0x3b6c12(0xb5))/0xb);if(_0xe794a6===_0x24a786)break;else _0x5ad4ec['push'](_0x5ad4ec['shift']());}catch(_0x45d3f3){_0x5ad4ec['push'](_0x5ad4ec['shift']());}}}(_0x3344,0x74425));export async function searchResource(_0x59bbc5,_0x46feac){var _0x2a053c=_0x9e7e,_0x5311ff={};return _0x5311ff[_0x2a053c(0xa8)]=_0x59bbc5[_0x2a053c(0xb0)],_0x5311ff[_0x2a053c(0xa6)]={..._0x59bbc5},_0x5311ff[_0x2a053c(0xad)]=_0x59bbc5[_0x2a053c(0xad)],_0x5311ff[_0x2a053c(0xa6)][_0x2a053c(0xab)]=_0x59bbc5[_0x2a053c(0xab)],_0x46feac[_0x2a053c(0xb0)][_0x2a053c(0xac)](_0x5311ff);}
1
+ export async function searchResource(r,u){return u['resource']['find']({'name':r['resource'],'query':{...r,'filter':r['filter']},'user':r['user']});}
@@ -3,6 +3,9 @@ type SuggestResourceResult = {
3
3
  search: string;
4
4
  time: number;
5
5
  data: any[];
6
+ limit?: number;
7
+ count?: number;
8
+ total?: number;
6
9
  };
7
10
  export declare function suggestResource(params: any, ctx: AppContext): Promise<SuggestResourceResult>;
8
11
  export {};
@@ -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;CACf,CAAC;AAEF,wBAAsB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAmClG"}
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 +1 @@
1
- function _0x45cd(){const _0x5ba63f=['search','now','204799JoxjKE','4020OawIJF','\x20as\x20id,\x20','Field\x20has\x20no\x20lookup\x20dictionary:\x20','84MlmEpe','11106nRLBqW','query','table','1248960GTnhTO','lookup','then','max','toLowerCase','dictionary','field','14440382EfYdwb','3175048GRkVrK','40822ZzJzwI','name','filter','valueField','4olrSQz','textField','limit','min','\x20as\x20text\x20FROM\x20','MjZsO','startsWith','code','fields','slice','12PzmFdQ','resource','qLghD','\x20WHERE\x20lower(','rows',')\x20~\x20$1\x20LIMIT\x20$2','get','SELECT\x20','25lGMqwo','157460eTPnEh'];_0x45cd=function(){return _0x5ba63f;};return _0x45cd();}function _0x3c93(_0x4654bf,_0x162a89){_0x4654bf=_0x4654bf-0x77;const _0x45cdb5=_0x45cd();let _0x3c93c6=_0x45cdb5[_0x4654bf];return _0x3c93c6;}(function(_0x489d9b,_0x3cb11e){const _0x344dd7=_0x3c93,_0x478eeb=_0x489d9b();while(!![]){try{const _0x4076e4=-parseInt(_0x344dd7(0x80))/0x1*(-parseInt(_0x344dd7(0x7c))/0x2)+-parseInt(_0x344dd7(0x9e))/0x3+-parseInt(_0x344dd7(0x93))/0x4*(parseInt(_0x344dd7(0x92))/0x5)+parseInt(_0x344dd7(0x9a))/0x6*(-parseInt(_0x344dd7(0x96))/0x7)+parseInt(_0x344dd7(0x7b))/0x8+parseInt(_0x344dd7(0x9b))/0x9*(-parseInt(_0x344dd7(0x97))/0xa)+-parseInt(_0x344dd7(0x7a))/0xb*(-parseInt(_0x344dd7(0x8a))/0xc);if(_0x4076e4===_0x3cb11e)break;else _0x478eeb['push'](_0x478eeb['shift']());}catch(_0x48fb16){_0x478eeb['push'](_0x478eeb['shift']());}}}(_0x45cd,0x4285c));import{ValidationError}from'../../../errors.js';export async function suggestResource(_0x457683,_0x3b4afd){const _0x3d418b=_0x3c93,_0x2db042={'MjZsO':function(_0x4ca14a,_0x314dde){return _0x4ca14a(_0x314dde);},'qLghD':function(_0x545369,_0xb482d4){return _0x545369-_0xb482d4;}},_0x5a405d=_0x3b4afd[_0x3d418b(0x8b)][_0x3d418b(0x90)](_0x457683[_0x3d418b(0x8b)]),_0x295d9d=_0x2db042[_0x3d418b(0x85)](String,_0x457683[_0x3d418b(0x94)]??_0x457683['q']??'')[_0x3d418b(0x77)](),_0x24edf2=Math[_0x3d418b(0x83)](Math[_0x3d418b(0xa1)](Number(_0x457683[_0x3d418b(0x82)]??0x14),0x1),0xc8),_0x194544=Date[_0x3d418b(0x95)](),_0x12bb54=_0x5a405d[_0x3d418b(0x88)][_0x457683[_0x3d418b(0x79)]],_0x12107d=_0x12bb54?.[_0x3d418b(0x9f)]?.[_0x3d418b(0x78)],_0x3ea57f=_0x12bb54?.[_0x3d418b(0x9f)]?.[_0x3d418b(0x9d)];if(_0x3ea57f){const _0x4c5fae=_0x12bb54?.[_0x3d418b(0x9f)]?.[_0x3d418b(0x81)],_0x3d11ca=_0x12bb54?.[_0x3d418b(0x9f)]?.[_0x3d418b(0x7f)],_0x3ecdb7=await _0x3b4afd['pg'][_0x3d418b(0x9c)](_0x3d418b(0x91)+_0x3d11ca+_0x3d418b(0x98)+_0x4c5fae+_0x3d418b(0x84)+_0x3ea57f+_0x3d418b(0x8d)+_0x4c5fae+_0x3d418b(0x8f),[''+_0x295d9d[_0x3d418b(0x77)](),_0x24edf2])[_0x3d418b(0xa0)](_0x4bb480=>_0x4bb480[_0x3d418b(0x8e)]);return{'search':_0x295d9d,'time':_0x2db042[_0x3d418b(0x8c)](Date[_0x3d418b(0x95)](),_0x194544),'data':_0x3ecdb7};}if(!_0x12107d)throw new ValidationError(_0x3d418b(0x99)+_0x457683[_0x3d418b(0x79)]);const _0x188a43=await _0x3b4afd[_0x3d418b(0x78)][_0x3d418b(0x90)](_0x12107d),_0x5c412f=_0x188a43[_0x3d418b(0x7e)](_0x2882d3=>!_0x295d9d||_0x2882d3[_0x3d418b(0x87)][_0x3d418b(0x86)](_0x295d9d)||_0x2882d3[_0x3d418b(0x7d)][_0x3d418b(0x86)](_0x295d9d))[_0x3d418b(0x89)](0x0,_0x24edf2);return{'search':_0x295d9d,'time':_0x2db042[_0x3d418b(0x8c)](Date[_0x3d418b(0x95)](),_0x194544),'data':_0x5c412f};}
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 +1 @@
1
- function _0x268c(_0x4a3e3e,_0x1b4749){_0x4a3e3e=_0x4a3e3e-0xd6;var _0x147b9c=_0x147b();var _0x268ca=_0x147b9c[_0x4a3e3e];return _0x268ca;}(function(_0x139f48,_0x469e2d){var _0x1be02f=_0x268c,_0x3e73a5=_0x139f48();while(!![]){try{var _0x215ab0=parseInt(_0x1be02f(0xd9))/0x1*(-parseInt(_0x1be02f(0xdf))/0x2)+-parseInt(_0x1be02f(0xdd))/0x3*(-parseInt(_0x1be02f(0xdb))/0x4)+-parseInt(_0x1be02f(0xe3))/0x5+-parseInt(_0x1be02f(0xe1))/0x6+-parseInt(_0x1be02f(0xdc))/0x7+-parseInt(_0x1be02f(0xd7))/0x8*(parseInt(_0x1be02f(0xe0))/0x9)+parseInt(_0x1be02f(0xd8))/0xa;if(_0x215ab0===_0x469e2d)break;else _0x3e73a5['push'](_0x3e73a5['shift']());}catch(_0x11647d){_0x3e73a5['push'](_0x3e73a5['shift']());}}}(_0x147b,0x5d3dc));function _0x147b(){var _0x207846=['29982410AWLftq','10iZPLcS','patch','4ltvrsl','4976692jWbTil','116109mbfVUF','data','105372ufzkEC','1957581kMkotu','3907884kolztB','user','2741945ceYCah','name','update','resource','8EiAhgV'];_0x147b=function(){return _0x207846;};return _0x147b();}export async function updateResource(_0x5b9199,_0x57fc11){var _0x201dc2=_0x268c,_0x13c835={};return _0x13c835[_0x201dc2(0xe4)]=_0x5b9199[_0x201dc2(0xd6)],_0x13c835['id']=_0x5b9199['id'],_0x13c835[_0x201dc2(0xde)]=_0x5b9199[_0x201dc2(0xda)],_0x13c835[_0x201dc2(0xe2)]=_0x5b9199[_0x201dc2(0xe2)],_0x57fc11[_0x201dc2(0xd6)][_0x201dc2(0xe5)](_0x13c835);}
1
+ export async function updateResource(r,u){return u['resource']['update']({'name':r['resource'],'id':r['id'],'data':r['patch'],'user':r['user']});}
@@ -1 +1 @@
1
- function _0x15f9(_0x32af64,_0x593f18){_0x32af64=_0x32af64-0x1ae;const _0x1ff4d9=_0x1ff4();let _0x15f95e=_0x1ff4d9[_0x32af64];return _0x15f95e;}(function(_0x48d5e8,_0x2ec90e){const _0x39a851=_0x15f9,_0x1022e1=_0x48d5e8();while(!![]){try{const _0x19aec2=-parseInt(_0x39a851(0x1e7))/0x1*(-parseInt(_0x39a851(0x1b0))/0x2)+parseInt(_0x39a851(0x1d7))/0x3+-parseInt(_0x39a851(0x1bd))/0x4+parseInt(_0x39a851(0x1dd))/0x5+parseInt(_0x39a851(0x1da))/0x6*(-parseInt(_0x39a851(0x1e4))/0x7)+parseInt(_0x39a851(0x1ca))/0x8*(-parseInt(_0x39a851(0x1b9))/0x9)+parseInt(_0x39a851(0x1c3))/0xa*(parseInt(_0x39a851(0x1d3))/0xb);if(_0x19aec2===_0x2ec90e)break;else _0x1022e1['push'](_0x1022e1['shift']());}catch(_0x4dbcfc){_0x1022e1['push'](_0x1022e1['shift']());}}}(_0x1ff4,0xb2388));function _0x1ff4(){const _0x401b7f=['Missing\x20permission:\x20','exists','lzwFk','DevOW','8693226UrYFjs','File\x20name\x20is\x20required','OlFfq','name','5106996IHYDqa','type','FAkNp','MKYDY','\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','length','40ZTegKf','cuNxb','File\x20is\x20required','nMWUM','FeyaG','cDRtr','WwxIh','8WvWdEf','IUlCn','Admin\x20access\x20required','DiJXR','qqhvs','files/','permission','get','DcDKB','5809243iMxdIr','file','jtPPj','OukYZ','1234833oGKsSG','includes','admin','227442zUeYIJ','query','rows','1739565rdbBUq',':update','HsOOp','access','fileName','put','permissions','21pNkwFx','resource','Wqndz','335Kmjlbv','Jxurv','isBuffer','replace','Uploaded\x20file\x20not\x20found','1280SqiQov','OarNZ','xXVIm','ANFPf','user'];_0x1ff4=function(){return _0x401b7f;};return _0x1ff4();}import{ForbiddenError,NotFoundError,ValidationError}from'../../../errors.js';export async function uploadResourceFile(_0xd9aae8,_0x156f3e){const _0x20d0d5=_0x15f9,_0x1d7602={'FAkNp':_0x20d0d5(0x1cc),'xXVIm':_0x20d0d5(0x1c5),'cDRtr':_0x20d0d5(0x1ba),'HsOOp':_0x20d0d5(0x1d9),'Jxurv':function(_0x53579f,_0x35cf46){return _0x53579f!==_0x35cf46;},'MKYDY':function(_0x11c238,_0xa83ff){return _0x11c238===_0xa83ff;},'Wqndz':_0x20d0d5(0x1cd),'WwxIh':function(_0x2c2457,_0x455d31){return _0x2c2457===_0x455d31;},'DevOW':_0x20d0d5(0x1c7),'OlFfq':_0x20d0d5(0x1d2),'nMWUM':function(_0x1d6c16,_0x14b718){return _0x1d6c16(_0x14b718);},'jtPPj':_0x20d0d5(0x1b1),'OukYZ':_0x20d0d5(0x1ce),'ANFPf':_0x20d0d5(0x1af),'lzwFk':function(_0x2fcb7d,_0x3659b0){return _0x2fcb7d(_0x3659b0);}},_0x4465a5=_0x156f3e[_0x20d0d5(0x1e5)][_0x20d0d5(0x1d1)](_0xd9aae8[_0x20d0d5(0x1e5)]);if(_0x4465a5[_0x20d0d5(0x1e0)]===_0x1d7602[_0x20d0d5(0x1df)]&&_0x1d7602[_0x20d0d5(0x1e8)](_0xd9aae8[_0x20d0d5(0x1b4)]?.[_0x20d0d5(0x1be)],_0x1d7602[_0x20d0d5(0x1df)])){if(_0x1d7602[_0x20d0d5(0x1c0)](_0x20d0d5(0x1c4),_0x1d7602[_0x20d0d5(0x1e6)]))throw new _0x2d1590(_0x1d7602[_0x20d0d5(0x1bf)]);else throw new ForbiddenError(_0x1d7602[_0x20d0d5(0x1bf)]);}if(_0x1d7602[_0x20d0d5(0x1e8)](_0xd9aae8[_0x20d0d5(0x1b4)]?.[_0x20d0d5(0x1be)],_0x1d7602[_0x20d0d5(0x1df)])&&!_0xd9aae8[_0x20d0d5(0x1b4)]?.[_0x20d0d5(0x1e3)]?.[_0x20d0d5(0x1d8)]((_0x4465a5[_0x20d0d5(0x1d0)]??_0x4465a5[_0x20d0d5(0x1bc)])+_0x20d0d5(0x1de)))throw new ForbiddenError(_0x20d0d5(0x1b5)+(_0x4465a5[_0x20d0d5(0x1d0)]??_0x4465a5[_0x20d0d5(0x1bc)])+_0x20d0d5(0x1de));if(!Buffer[_0x20d0d5(0x1e9)](_0xd9aae8[_0x20d0d5(0x1d4)])||_0x1d7602[_0x20d0d5(0x1c9)](_0xd9aae8[_0x20d0d5(0x1d4)][_0x20d0d5(0x1c2)],0x0)){if(_0x1d7602[_0x20d0d5(0x1b8)]===_0x1d7602[_0x20d0d5(0x1b8)])throw new ValidationError(_0x20d0d5(0x1c5));else throw new _0x1f3dba(_0x20d0d5(0x1b5)+(_0x51d243[_0x20d0d5(0x1d0)]??_0x138537[_0x20d0d5(0x1bc)])+_0x20d0d5(0x1de));}const _0xaa6cee=_0xd9aae8[_0x20d0d5(0x1e1)][_0x20d0d5(0x1ae)](/[^A-Za-z0-9._-]/g,'_');if(!_0xaa6cee){if(_0x1d7602[_0x20d0d5(0x1c0)](_0x20d0d5(0x1cb),_0x1d7602[_0x20d0d5(0x1bb)]))throw new _0x5407e5(_0x1d7602[_0x20d0d5(0x1b2)]);else throw new ValidationError(_0x1d7602[_0x20d0d5(0x1c8)]);}const _0x586a98=_0x20d0d5(0x1cf)+_0xd9aae8[_0x20d0d5(0x1e5)]+'/'+_0x1d7602[_0x20d0d5(0x1c6)](String,_0xd9aae8['id'])+'/'+_0xaa6cee;await _0x156f3e[_0x20d0d5(0x1d4)][_0x20d0d5(0x1e2)](_0x586a98,_0xd9aae8[_0x20d0d5(0x1d4)]);if(!await _0x156f3e[_0x20d0d5(0x1d4)][_0x20d0d5(0x1b6)](_0x586a98)){if(_0x1d7602[_0x20d0d5(0x1c0)](_0x1d7602[_0x20d0d5(0x1d5)],_0x1d7602[_0x20d0d5(0x1d6)]))throw new _0x18022d(_0x1d7602[_0x20d0d5(0x1c8)]);else throw new NotFoundError(_0x1d7602[_0x20d0d5(0x1b3)]);}const _0x3a06ef=await _0x156f3e['pg'][_0x20d0d5(0x1db)](_0x20d0d5(0x1c1),[_0xd9aae8[_0x20d0d5(0x1e5)],_0x1d7602[_0x20d0d5(0x1b7)](String,_0xd9aae8['id']),_0x586a98,_0xd9aae8[_0x20d0d5(0x1d4)][_0x20d0d5(0x1c2)]]);return _0x3a06ef[_0x20d0d5(0x1dc)][0x0];}
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();}
@@ -3,5 +3,6 @@
3
3
  */
4
4
  import type { FastifyPluginAsync } from "fastify";
5
5
  import type { AppContext } from "../../context.js";
6
- export declare function systemRoutes(ctx: AppContext): FastifyPluginAsync;
6
+ import type { ApiRoute } from "../../type.js";
7
+ export declare function systemRoutes(ctx: AppContext, apiRoutes?: ReadonlyMap<string, ApiRoute>): FastifyPluginAsync;
7
8
  //# sourceMappingURL=route.d.ts.map
@@ -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;AAYnD,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,kBAAkB,CAkHhE"}
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 +1 @@
1
- const _0x5891bf=_0x90f9;(function(_0xd617c6,_0xc27c6e){const _0x571202=_0x90f9,_0x5a52e7=_0xd617c6();while(!![]){try{const _0xefef18=parseInt(_0x571202(0x9a))/0x1*(-parseInt(_0x571202(0xc6))/0x2)+parseInt(_0x571202(0xb3))/0x3+-parseInt(_0x571202(0xd6))/0x4+-parseInt(_0x571202(0xce))/0x5+parseInt(_0x571202(0xe0))/0x6+-parseInt(_0x571202(0x9c))/0x7+-parseInt(_0x571202(0xaa))/0x8*(-parseInt(_0x571202(0x9b))/0x9);if(_0xefef18===_0xc27c6e)break;else _0x5a52e7['push'](_0x5a52e7['shift']());}catch(_0xed1b37){_0x5a52e7['push'](_0x5a52e7['shift']());}}}(_0x3557,0x43209));import{getSystemSettings}from'./services/get-system-settings.js';import{updateSystemSettings}from'./services/update-system-settings.js';function _0x90f9(_0xb751f1,_0x453ce5){_0xb751f1=_0xb751f1-0x93;const _0x3557c3=_0x3557();let _0x90f9fe=_0x3557c3[_0xb751f1];return _0x90f9fe;}import{getAuditLog}from'./services/get-audit-log.js';import{checkSystem}from'./services/check-system.js';import{getApiList}from'./services/get-api-list.js';function _0x3557(){const _0x2503bf=['List\x20APIs','lWUrg','settings','MPgyA','gtAkB','/api/system/check','/api/system/audit/','admin','Get\x20platform\x20dictionary','system:settings:update','logger','Checks\x20the\x20availability\x20of\x20system\x20dependencies.','FDdby','17858hShFbZ','213813SUksJy','3444854gOwvvk','/api/dictionaries','Get\x20system\x20settings','summary','post','rWXvs','trrRV','SLFzz','Get\x20system\x20log','system:api:read','fCnsG','tLluZ','Returns\x20system\x20settings\x20as\x20nested\x20JSON.','hyWfY','384UMICNf','Returns\x20a\x20registered\x20platform\x20dictionary\x20by\x20name.','get','yipGP','iXIkX','system:check','/api/dictionaries/:name','description','access','1055163bcJgsG','user','Returns\x20system\x20logger\x20entries\x20for\x20the\x20requested\x20path.','jAGGk','dgkrD','system:settings:read','Updates\x20system\x20settings\x20using\x20flat\x20dot-notation\x20keys.','eWBMS','iTCKw','vkyOS','fcore','Returns\x20the\x20list\x20of\x20registered\x20platform\x20APIs.','/api/system/api-list','OewIw','JVPzK','params','dictionaryName','yUEJa','FVRMb','32IVedBN','system','FVUZD','audit:read','permissions','system:logs:read','Update\x20system\x20settings','Returns\x20the\x20system\x20audit\x20log\x20entries.','1903690oKmdTV','query','body','PamjZ','tags','List\x20platform\x20dictionaries','ORNfV','Returns\x20all\x20available\x20dictionaries\x20registered\x20by\x20the\x20platform.','1984788XrxoZL','Check\x20system\x20health','rXNbU','Get\x20audit\x20log','schema','/api/system/settings','khIZC','WeOSS','/api/system/logger/*','split','2626086yvRoVa','2|5|1|4|6|3|0|7','rDXns'];_0x3557=function(){return _0x2503bf;};return _0x3557();}import{getSystemLog}from'./services/get-system-log.js';import{listDictionaries}from'./services/list-dictionaries.js';import{getDictionary}from'./services/get-dictionary.js';import{systemSchemas}from'./schema.js';const u=_0x5cf289=>_0x5cf289[_0x5891bf(0xb4)];export function systemRoutes(_0x369a22){const _0x24d22e=_0x5891bf,_0x231f1e={};_0x231f1e[_0x24d22e(0xa7)]=_0x24d22e(0xe1),_0x231f1e[_0x24d22e(0xe7)]=_0x24d22e(0xe8),_0x231f1e[_0x24d22e(0xe4)]=_0x24d22e(0xbd),_0x231f1e[_0x24d22e(0xad)]=_0x24d22e(0xd7),_0x231f1e[_0x24d22e(0xb6)]=_0x24d22e(0x98),_0x231f1e[_0x24d22e(0xd1)]=_0x24d22e(0xaf),_0x231f1e[_0x24d22e(0xd4)]=_0x24d22e(0xdb),_0x231f1e[_0x24d22e(0xd8)]=_0x24d22e(0xc7),_0x231f1e[_0x24d22e(0xb7)]=_0x24d22e(0x9e),_0x231f1e[_0x24d22e(0xc5)]=_0x24d22e(0xa8),_0x231f1e[_0x24d22e(0xc4)]=_0x24d22e(0x94),_0x231f1e[_0x24d22e(0xc1)]=_0x24d22e(0xb8),_0x231f1e[_0x24d22e(0xa1)]=_0x24d22e(0x9d),_0x231f1e[_0x24d22e(0xa6)]=_0x24d22e(0xd5),_0x231f1e[_0x24d22e(0xc8)]=_0x24d22e(0xd9),_0x231f1e[_0x24d22e(0xba)]=_0x24d22e(0xcc),_0x231f1e[_0x24d22e(0xbc)]=_0x24d22e(0x96),_0x231f1e[_0x24d22e(0x99)]=_0x24d22e(0xb0),_0x231f1e[_0x24d22e(0xdc)]=_0x24d22e(0x95),_0x231f1e[_0x24d22e(0xa2)]=_0x24d22e(0xab),_0x231f1e[_0x24d22e(0xa9)]=_0x24d22e(0xde),_0x231f1e[_0x24d22e(0xa3)]=_0x24d22e(0xa4),_0x231f1e[_0x24d22e(0xae)]=_0x24d22e(0xb5),_0x231f1e[_0x24d22e(0xe6)]=_0x24d22e(0xcb),_0x231f1e[_0x24d22e(0xc0)]=_0x24d22e(0xbf),_0x231f1e[_0x24d22e(0xdd)]=_0x24d22e(0xe3),_0x231f1e[_0x24d22e(0xe2)]=_0x24d22e(0xbe),_0x231f1e[_0x24d22e(0xbb)]=_0x24d22e(0xa5);const _0x13a15b=_0x231f1e;return async _0x33b410=>{const _0x1b3200=_0x24d22e,_0x9ee801=_0x13a15b[_0x1b3200(0xa7)][_0x1b3200(0xdf)]('|');let _0x127676=0x0;while(!![]){switch(_0x9ee801[_0x127676++]){case'0':_0x33b410[_0x1b3200(0xac)](_0x13a15b[_0x1b3200(0xe7)],{'schema':{'tags':[_0x13a15b[_0x1b3200(0xe4)],_0x1b3200(0xc7)],'summary':_0x13a15b[_0x1b3200(0xad)],'description':_0x13a15b[_0x1b3200(0xb6)],'access':_0x1b3200(0x94),'permissions':[_0x13a15b[_0x1b3200(0xd1)]]}},async _0x1d9201=>checkSystem({'user':u(_0x1d9201)},_0x369a22));continue;case'1':_0x33b410[_0x1b3200(0xac)](_0x13a15b[_0x1b3200(0xd4)],{'schema':{'tags':[_0x13a15b[_0x1b3200(0xe4)],_0x13a15b[_0x1b3200(0xd8)]],'summary':_0x13a15b[_0x1b3200(0xb7)],'description':_0x13a15b[_0x1b3200(0xc5)],'access':_0x13a15b[_0x1b3200(0xc4)],'permissions':[_0x13a15b[_0x1b3200(0xc1)]]}},async _0x5cdf88=>getSystemSettings({..._0x5cdf88[_0x1b3200(0xc2)],'user':u(_0x5cdf88)},_0x369a22));continue;case'2':_0x33b410[_0x1b3200(0xac)](_0x13a15b[_0x1b3200(0xa1)],{'schema':{'tags':[_0x13a15b[_0x1b3200(0xe4)],_0x13a15b[_0x1b3200(0xd8)]],'summary':_0x1b3200(0xd3),'description':_0x13a15b[_0x1b3200(0xa6)],'access':_0x13a15b[_0x1b3200(0xc4)],'permissions':[]}},async _0xd6a30d=>listDictionaries({'user':u(_0xd6a30d)},_0x369a22));continue;case'3':const _0x58f4c4={};_0x58f4c4[_0x1b3200(0xd2)]=[_0x13a15b[_0x1b3200(0xe4)],_0x13a15b[_0x1b3200(0xd8)]],_0x58f4c4[_0x1b3200(0x9f)]=_0x13a15b[_0x1b3200(0xc8)],_0x58f4c4[_0x1b3200(0xb1)]=_0x1b3200(0xcd),_0x58f4c4[_0x1b3200(0xb2)]=_0x1b3200(0x94),_0x58f4c4[_0x1b3200(0xca)]=[_0x1b3200(0xc9)];const _0x4b6fd6={};_0x4b6fd6[_0x1b3200(0xda)]=_0x58f4c4,_0x33b410[_0x1b3200(0xac)](_0x1b3200(0x93),_0x4b6fd6,async _0x49e793=>getAuditLog({..._0x49e793[_0x1b3200(0xcf)],'user':u(_0x49e793)},_0x369a22));continue;case'4':_0x33b410[_0x1b3200(0xa0)](_0x13a15b[_0x1b3200(0xd4)],{'schema':{'tags':[_0x13a15b[_0x1b3200(0xe4)],_0x13a15b[_0x1b3200(0xd8)]],'summary':_0x13a15b[_0x1b3200(0xba)],'description':_0x1b3200(0xb9),'access':_0x13a15b[_0x1b3200(0xc4)],'permissions':[_0x13a15b[_0x1b3200(0xbc)]],'body':systemSchemas[_0x1b3200(0xe5)]}},async _0x5d15c6=>updateSystemSettings({..._0x5d15c6[_0x1b3200(0xc2)],'patch':_0x5d15c6[_0x1b3200(0xd0)],'user':u(_0x5d15c6)},_0x369a22));continue;case'5':_0x33b410[_0x1b3200(0xac)](_0x13a15b[_0x1b3200(0x99)],{'schema':{'tags':[_0x13a15b[_0x1b3200(0xe4)],_0x1b3200(0xc7)],'summary':_0x13a15b[_0x1b3200(0xdc)],'description':_0x13a15b[_0x1b3200(0xa2)],'access':_0x13a15b[_0x1b3200(0xc4)],'permissions':[],'params':systemSchemas[_0x1b3200(0xc3)]}},async _0x24864f=>getDictionary({..._0x24864f[_0x1b3200(0xc2)],'user':u(_0x24864f)},_0x369a22));continue;case'6':_0x33b410[_0x1b3200(0xac)](_0x13a15b[_0x1b3200(0xa9)],{'schema':{'tags':[_0x13a15b[_0x1b3200(0xe4)],_0x13a15b[_0x1b3200(0xd8)]],'summary':_0x13a15b[_0x1b3200(0xa3)],'description':_0x13a15b[_0x1b3200(0xae)],'access':_0x1b3200(0x94),'permissions':[_0x13a15b[_0x1b3200(0xe6)]],'params':systemSchemas[_0x1b3200(0x97)]}},async _0xd4facf=>getSystemLog({..._0xd4facf[_0x1b3200(0xcf)],..._0xd4facf[_0x1b3200(0xc2)],'user':u(_0xd4facf)},_0x369a22));continue;case'7':_0x33b410[_0x1b3200(0xac)](_0x13a15b[_0x1b3200(0xc0)],{'schema':{'tags':[_0x13a15b[_0x1b3200(0xe4)],_0x1b3200(0xc7)],'summary':_0x13a15b[_0x1b3200(0xdd)],'description':_0x13a15b[_0x1b3200(0xe2)],'access':_0x13a15b[_0x1b3200(0xc4)],'permissions':[_0x13a15b[_0x1b3200(0xbb)]]}},async _0x4ed74c=>getApiList({'user':u(_0x4ed74c)},_0x369a22));continue;}break;}};}
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));};}
@@ -3,12 +3,33 @@ export declare const systemSchemas: {
3
3
  dictionaryName: import("@sinclair/typebox").TObject<{
4
4
  name: import("@sinclair/typebox").TString;
5
5
  }>;
6
+ dictionaryItems: import("@sinclair/typebox").TObject<{
7
+ items: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
8
+ id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber]>>;
9
+ code: import("@sinclair/typebox").TString;
10
+ name: import("@sinclair/typebox").TString;
11
+ parentId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull]>>;
12
+ }>>;
13
+ }>;
14
+ accessTarget: import("@sinclair/typebox").TObject<{
15
+ type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"user">, import("@sinclair/typebox").TLiteral<"role">]>;
16
+ id: import("@sinclair/typebox").TString;
17
+ }>;
18
+ access: import("@sinclair/typebox").TObject<{
19
+ access: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
20
+ resource: import("@sinclair/typebox").TString;
21
+ actions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
22
+ }>>;
23
+ }>;
24
+ apiListQuery: import("@sinclair/typebox").TObject<{
25
+ format: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"short">, import("@sinclair/typebox").TLiteral<"extended">]>>;
26
+ }>;
6
27
  settingsEntity: import("@sinclair/typebox").TObject<{
7
28
  entity: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
8
29
  }>;
9
30
  settings: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
10
31
  logger: import("@sinclair/typebox").TObject<{
11
- "*": import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
32
+ path: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
33
  }>;
13
34
  };
14
35
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/system/schema.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,qCAIrB,CAAC;AAEH,eAAO,MAAM,aAAa;IACxB,cAAc;;;IAGd,cAAc;;;IACd,QAAQ;IACR,MAAM;;;CACP,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/system/schema.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,qCAIrB,CAAC;AAEH,eAAO,MAAM,aAAa;IACxB,cAAc;;;IAGd,eAAe;;;;;;;;IAef,YAAY;;;;IAIZ,MAAM;;;;;;IAQN,YAAY;;;IAGZ,cAAc;;;IACd,QAAQ;IACR,MAAM;;;CAKP,CAAC"}
@@ -1 +1 @@
1
- const _0x9f464=_0x2540;(function(_0x3dd861,_0x1074a1){const _0x5ababf=_0x2540,_0xebd154=_0x3dd861();while(!![]){try{const _0x1062d8=-parseInt(_0x5ababf(0xed))/0x1+-parseInt(_0x5ababf(0xe6))/0x2*(-parseInt(_0x5ababf(0xe9))/0x3)+-parseInt(_0x5ababf(0xdf))/0x4*(parseInt(_0x5ababf(0xe7))/0x5)+-parseInt(_0x5ababf(0xdd))/0x6+parseInt(_0x5ababf(0xeb))/0x7+parseInt(_0x5ababf(0xe2))/0x8+-parseInt(_0x5ababf(0xdb))/0x9*(-parseInt(_0x5ababf(0xda))/0xa);if(_0x1062d8===_0x1074a1)break;else _0xebd154['push'](_0xebd154['shift']());}catch(_0x2b2289){_0xebd154['push'](_0xebd154['shift']());}}}(_0x1935,0x1dbba));import{Type}from'@sinclair/typebox';const _0x5d22d2={};function _0x2540(_0x1b8bcf,_0x2119a3){_0x1b8bcf=_0x1b8bcf-0xda;const _0x1935b5=_0x1935();let _0x254050=_0x1935b5[_0x1b8bcf];return _0x254050;}_0x5d22d2[_0x9f464(0xdc)]=0x1,_0x5d22d2[_0x9f464(0xe4)]=0x80,_0x5d22d2[_0x9f464(0xe1)]=_0x9f464(0xe5);export const identifier=Type[_0x9f464(0xe8)](_0x5d22d2);const _0x4f0531={};function _0x1935(){const _0x95ac25=['Optional','maxLength','^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$','2WKqNAS','285xinzvu','String','197931egtUWA','Object','524125swOUJx','Unknown','167248hFtUHg','10niGHzp','3255849RHqfFP','minLength','912006xsOvUO','name','4516sdwdzt','Record','pattern','22200owIqvD'];_0x1935=function(){return _0x95ac25;};return _0x1935();}_0x4f0531[_0x9f464(0xde)]=identifier;const _0x479737={};_0x479737[_0x9f464(0xdc)]=0x1;const _0x473b22={};_0x473b22[_0x9f464(0xdc)]=0x1;export const systemSchemas={'dictionaryName':Type[_0x9f464(0xea)](_0x4f0531),'settingsEntity':Type[_0x9f464(0xea)]({'entity':Type[_0x9f464(0xe3)](identifier)}),'settings':Type[_0x9f464(0xe0)](Type[_0x9f464(0xe8)](_0x479737),Type[_0x9f464(0xec)]()),'logger':Type[_0x9f464(0xea)]({'*':Type[_0x9f464(0xe3)](Type[_0x9f464(0xe8)](_0x473b22))})};
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();}