@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.
- package/LICENSE +3 -3
- package/README.md +71 -71
- package/dist/config.d.ts +2 -10
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/context.js +1 -1
- package/dist/errors.js +1 -1
- package/dist/fastify.d.ts.map +1 -1
- package/dist/fastify.js +1 -1
- package/dist/fcore.js +1 -1
- package/dist/index.js +1 -1
- package/dist/migrations/cli.js +1 -1
- package/dist/migrations/runner.js +1 -1
- package/dist/modules/auth/adduser-cli.d.ts +3 -0
- package/dist/modules/auth/adduser-cli.d.ts.map +1 -0
- package/dist/modules/auth/adduser-cli.js +2 -0
- package/dist/modules/auth/passwd-cli.d.ts +3 -0
- package/dist/modules/auth/passwd-cli.d.ts.map +1 -0
- package/dist/modules/auth/passwd-cli.js +2 -0
- package/dist/modules/auth/permission-cli.d.ts +3 -0
- package/dist/modules/auth/permission-cli.d.ts.map +1 -0
- package/dist/modules/auth/permission-cli.js +2 -0
- package/dist/modules/auth/route.d.ts.map +1 -1
- package/dist/modules/auth/route.js +1 -1
- package/dist/modules/auth/schema.d.ts +7 -1
- package/dist/modules/auth/schema.d.ts.map +1 -1
- package/dist/modules/auth/schema.js +1 -1
- package/dist/modules/auth/services/change-password.d.ts +9 -0
- package/dist/modules/auth/services/change-password.d.ts.map +1 -0
- package/dist/modules/auth/services/change-password.js +1 -0
- package/dist/modules/auth/services/get-current-user.js +1 -1
- package/dist/modules/auth/services/registration.d.ts +14 -0
- package/dist/modules/auth/services/registration.d.ts.map +1 -0
- package/dist/modules/auth/services/registration.js +1 -0
- package/dist/modules/auth/services/verify-two-factor.js +1 -1
- package/dist/modules/file/route.js +1 -1
- package/dist/modules/file/schema.js +1 -1
- package/dist/modules/file/services/get-file.js +1 -1
- package/dist/modules/file/services/resize-file.js +1 -1
- package/dist/modules/file/services/upload-file.js +1 -1
- package/dist/modules/resource/route.d.ts.map +1 -1
- package/dist/modules/resource/route.js +1 -1
- package/dist/modules/resource/schema.js +1 -1
- package/dist/modules/resource/services/add-note.js +1 -1
- package/dist/modules/resource/services/add-resource-file.js +1 -1
- package/dist/modules/resource/services/create-resource-relation.d.ts +8 -2
- package/dist/modules/resource/services/create-resource-relation.d.ts.map +1 -1
- package/dist/modules/resource/services/create-resource-relation.js +1 -1
- package/dist/modules/resource/services/create-resource.js +1 -1
- package/dist/modules/resource/services/delete-resource-relation.d.ts +8 -1
- package/dist/modules/resource/services/delete-resource-relation.d.ts.map +1 -1
- package/dist/modules/resource/services/delete-resource-relation.js +1 -1
- package/dist/modules/resource/services/delete-resource.js +1 -1
- package/dist/modules/resource/services/export-resource.js +1 -1
- package/dist/modules/resource/services/get-resource.js +1 -1
- package/dist/modules/resource/services/list-resource-relation.d.ts +7 -2
- package/dist/modules/resource/services/list-resource-relation.d.ts.map +1 -1
- package/dist/modules/resource/services/list-resource-relation.js +1 -1
- package/dist/modules/resource/services/list-resources.js +1 -1
- package/dist/modules/resource/services/search-resource.js +1 -1
- package/dist/modules/resource/services/suggest-resource.d.ts +3 -0
- package/dist/modules/resource/services/suggest-resource.d.ts.map +1 -1
- package/dist/modules/resource/services/suggest-resource.js +1 -1
- package/dist/modules/resource/services/update-resource.js +1 -1
- package/dist/modules/resource/services/upload-resource-file.js +1 -1
- package/dist/modules/system/route.d.ts +2 -1
- package/dist/modules/system/route.d.ts.map +1 -1
- package/dist/modules/system/route.js +1 -1
- package/dist/modules/system/schema.d.ts +22 -1
- package/dist/modules/system/schema.d.ts.map +1 -1
- package/dist/modules/system/schema.js +1 -1
- package/dist/modules/system/services/check-system.d.ts.map +1 -1
- package/dist/modules/system/services/check-system.js +1 -1
- package/dist/modules/system/services/get-access.d.ts +14 -0
- package/dist/modules/system/services/get-access.d.ts.map +1 -0
- package/dist/modules/system/services/get-access.js +1 -0
- package/dist/modules/system/services/get-api-list.d.ts +4 -1
- package/dist/modules/system/services/get-api-list.d.ts.map +1 -1
- package/dist/modules/system/services/get-api-list.js +1 -1
- package/dist/modules/system/services/get-audit-log.js +1 -1
- package/dist/modules/system/services/get-dictionary.js +1 -1
- package/dist/modules/system/services/get-system-log.d.ts +9 -5
- package/dist/modules/system/services/get-system-log.d.ts.map +1 -1
- package/dist/modules/system/services/get-system-log.js +1 -1
- package/dist/modules/system/services/get-system-settings.js +1 -1
- package/dist/modules/system/services/list-dictionaries.js +1 -1
- package/dist/modules/system/services/set-access.d.ts +16 -0
- package/dist/modules/system/services/set-access.d.ts.map +1 -0
- package/dist/modules/system/services/set-access.js +1 -0
- package/dist/modules/system/services/update-dictionary.d.ts +13 -0
- package/dist/modules/system/services/update-dictionary.d.ts.map +1 -0
- package/dist/modules/system/services/update-dictionary.js +1 -0
- package/dist/modules/system/services/update-system-settings.js +1 -1
- package/dist/modules/utils/require-admin.js +1 -1
- package/dist/modules/utils/safe-user.js +1 -1
- package/dist/modules/utils/unsupported.js +1 -1
- package/dist/plugins/audit/audit.js +1 -1
- package/dist/plugins/audit/index.js +1 -1
- package/dist/plugins/audit/services/write-audit.js +1 -1
- package/dist/plugins/auth/get-user-permissions.d.ts +3 -0
- package/dist/plugins/auth/get-user-permissions.d.ts.map +1 -0
- package/dist/plugins/auth/get-user-permissions.js +1 -0
- package/dist/plugins/auth/index.d.ts +4 -0
- package/dist/plugins/auth/index.d.ts.map +1 -1
- package/dist/plugins/auth/index.js +1 -1
- package/dist/plugins/auth/verifyUser.d.ts +9 -0
- package/dist/plugins/auth/verifyUser.d.ts.map +1 -0
- package/dist/plugins/auth/verifyUser.js +1 -0
- package/dist/plugins/dictionary.js +1 -1
- package/dist/plugins/file.js +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/logger/index.js +1 -1
- package/dist/plugins/logger/transport.js +1 -1
- package/dist/plugins/pg.js +1 -1
- package/dist/plugins/redis.js +1 -1
- package/dist/plugins/resource/index.js +1 -1
- package/dist/plugins/resource/resource.d.ts.map +1 -1
- package/dist/plugins/resource/resource.js +1 -1
- package/dist/plugins/resource/resource.registry.js +1 -1
- package/dist/plugins/resource/resource.types.d.ts +23 -0
- package/dist/plugins/resource/resource.types.d.ts.map +1 -1
- package/dist/plugins/resource/services/create-relation.d.ts +13 -0
- package/dist/plugins/resource/services/create-relation.d.ts.map +1 -0
- package/dist/plugins/resource/services/create-relation.js +1 -0
- package/dist/plugins/resource/services/create.js +1 -1
- package/dist/plugins/resource/services/delete-relation.d.ts +15 -0
- package/dist/plugins/resource/services/delete-relation.d.ts.map +1 -0
- package/dist/plugins/resource/services/delete-relation.js +1 -0
- package/dist/plugins/resource/services/delete.js +1 -1
- package/dist/plugins/resource/services/find-one.js +1 -1
- package/dist/plugins/resource/services/find-relation.d.ts +12 -0
- package/dist/plugins/resource/services/find-relation.d.ts.map +1 -0
- package/dist/plugins/resource/services/find-relation.js +1 -0
- package/dist/plugins/resource/services/find.js +1 -1
- package/dist/plugins/resource/services/update.js +1 -1
- package/dist/plugins/resource/utils/fields.js +1 -1
- package/dist/plugins/resource/utils/filters.js +1 -1
- package/dist/plugins/resource/utils/permissions.js +1 -1
- package/dist/plugins/resource/utils/sort.js +1 -1
- package/dist/plugins/resource/utils/sql.js +1 -1
- package/dist/shared/getIP.js +1 -1
- package/dist/type.d.ts +14 -0
- package/dist/type.d.ts.map +1 -1
- package/migrations/20260903120000_core_schema.sql +22 -19
- package/migrations/20260903130000_move_notes_files_to_admin.sql +17 -17
- package/migrations/20260903140000_settings_nulls_not_distinct.sql +18 -18
- package/migrations/20260905120000_add_user_foreign_keys.sql +43 -0
- package/package.json +10 -5
- package/dist/modules/auth/index.d.ts +0 -9
- package/dist/modules/auth/index.d.ts.map +0 -1
- package/dist/modules/auth/index.js +0 -1
- package/dist/modules/auth/services/login.d.ts +0 -10
- package/dist/modules/auth/services/login.d.ts.map +0 -1
- package/dist/modules/auth/services/login.js +0 -1
- package/dist/modules/auth/services/logout.d.ts +0 -9
- package/dist/modules/auth/services/logout.d.ts.map +0 -1
- package/dist/modules/auth/services/logout.js +0 -1
- package/dist/modules/auth/services/verifyPassword.d.ts +0 -11
- package/dist/modules/auth/services/verifyPassword.d.ts.map +0 -1
- package/dist/modules/auth/services/verifyPassword.js +0 -1
- package/dist/modules/file/index.d.ts +0 -8
- package/dist/modules/file/index.d.ts.map +0 -1
- package/dist/modules/file/index.js +0 -1
- package/dist/modules/resource/index.d.ts +0 -20
- package/dist/modules/resource/index.d.ts.map +0 -1
- package/dist/modules/resource/index.js +0 -1
- package/dist/modules/resource/services/list-children.d.ts +0 -6
- package/dist/modules/resource/services/list-children.d.ts.map +0 -1
- package/dist/modules/resource/services/list-children.js +0 -1
- package/dist/modules/system/index.d.ts +0 -13
- package/dist/modules/system/index.d.ts.map +0 -1
- package/dist/modules/system/index.js +0 -1
- package/dist/modules/utils/get-user-permissions.d.ts +0 -3
- package/dist/modules/utils/get-user-permissions.d.ts.map +0 -1
- package/dist/modules/utils/get-user-permissions.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
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
|
|
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
|
-
|
|
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
|
|
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:
|
|
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;
|
|
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
|
|
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
|
-
|
|
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:
|
|
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,
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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:
|
|
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;
|
|
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
|
-
|
|
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
|
|
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
|
|
1
|
+
export async function searchResource(r,u){return u['resource']['find']({'name':r['resource'],'query':{...r,'filter':r['filter']},'user':r['user']});}
|
|
@@ -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;
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
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
|
-
|
|
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
|
-
|
|
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;;;
|
|
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
|
|
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();}
|