@opengis/fcore 0.0.1-beta.17 → 0.0.1-beta.19
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.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/migrations/cli.js +1 -1
- package/dist/migrations/runner.js +1 -1
- package/dist/modules/auth/adduser-cli.js +1 -1
- package/dist/modules/auth/passwd-cli.js +1 -1
- package/dist/modules/auth/permission-cli.js +1 -1
- package/dist/modules/auth/route.js +1 -1
- package/dist/modules/auth/schema.js +1 -1
- package/dist/modules/auth/services/change-password.js +1 -1
- package/dist/modules/auth/services/get-current-user.js +1 -1
- package/dist/modules/auth/services/registration.js +1 -1
- package/dist/modules/auth/services/verify-two-factor.js +1 -1
- package/dist/modules/file/mime.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.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.js +1 -1
- package/dist/modules/resource/services/create-resource.js +1 -1
- package/dist/modules/resource/services/delete-resource-relation.js +1 -1
- package/dist/modules/resource/services/delete-resource.js +1 -1
- package/dist/modules/resource/services/export-resource.js +1 -1
- package/dist/modules/resource/services/get-resource.js +1 -1
- package/dist/modules/resource/services/list-resource-relation.js +1 -1
- package/dist/modules/resource/services/list-resources.js +1 -1
- package/dist/modules/resource/services/search-resource.js +1 -1
- package/dist/modules/resource/services/suggest-resource.js +1 -1
- package/dist/modules/resource/services/update-resource-relation.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.js +1 -1
- package/dist/modules/system/schema.d.ts +3 -2
- 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.js +1 -1
- package/dist/modules/system/services/get-access.d.ts +1 -0
- package/dist/modules/system/services/get-access.d.ts.map +1 -1
- package/dist/modules/system/services/get-access.js +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.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 +2 -1
- package/dist/modules/system/services/set-access.d.ts.map +1 -1
- package/dist/modules/system/services/set-access.js +1 -1
- package/dist/modules/system/services/update-dictionary.js +1 -1
- 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/audit.types.d.ts +1 -1
- package/dist/plugins/audit/audit.types.d.ts.map +1 -1
- package/dist/plugins/audit/services/write-audit.js +1 -1
- package/dist/plugins/auth/get-user-permissions.js +1 -1
- package/dist/plugins/auth/index.js +1 -1
- package/dist/plugins/auth/verifyUser.js +1 -1
- package/dist/plugins/dictionary.js +1 -1
- package/dist/plugins/file.js +1 -1
- package/dist/plugins/jwt.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/resource.js +1 -1
- package/dist/plugins/resource/resource.registry.js +1 -1
- package/dist/plugins/resource/resource.types.d.ts +3 -4
- package/dist/plugins/resource/resource.types.d.ts.map +1 -1
- package/dist/plugins/resource/services/add-dictionary-lookup-data.js +1 -1
- package/dist/plugins/resource/services/add-file-token.js +1 -1
- package/dist/plugins/resource/services/add-table-lookup-data.js +1 -1
- package/dist/plugins/resource/services/create-relation.js +1 -1
- package/dist/plugins/resource/services/create.js +1 -1
- package/dist/plugins/resource/services/delete-relation.js +1 -1
- package/dist/plugins/resource/services/delete.d.ts.map +1 -1
- package/dist/plugins/resource/services/delete.js +1 -1
- package/dist/plugins/resource/services/find-one.d.ts.map +1 -1
- package/dist/plugins/resource/services/find-one.js +1 -1
- package/dist/plugins/resource/services/find-relation.d.ts.map +1 -1
- package/dist/plugins/resource/services/find-relation.js +1 -1
- package/dist/plugins/resource/services/find.d.ts.map +1 -1
- package/dist/plugins/resource/services/find.js +1 -1
- package/dist/plugins/resource/services/update-relation.js +1 -1
- package/dist/plugins/resource/services/update.d.ts.map +1 -1
- package/dist/plugins/resource/services/update.js +1 -1
- package/dist/plugins/resource/utils/auto-index.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.d.ts +1 -1
- package/dist/plugins/resource/utils/sort.d.ts.map +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/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 +42 -42
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0xb7;const c=Z();let t=c[L];return t;}function Z(){const e=['query','INSERT\x20INTO\x20admin.notes(resource,resource_id,body)\x20VALUES\x20($1,$2,$3)\x20RETURNING\x20*','resource','rows'];Z=function(){return e;};return Z();}export async function addNote(L,E){const t=O,c=await E['pg'][t(0xb7)](t(0xb8),[L[t(0xb9)],String(L['id']),L['body']]);return c[t(0xba)][0x0];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0xd3;const c=Z();let t=c[L];return t;}function Z(){const e=['filePath'];Z=function(){return e;};return Z();}export async function addResourceFile(L,E){const t=O,c=await E['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',[L['resource'],String(L['id']),L[t(0xd3)],L['size']??null]);return c['rows'][0x0];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export async function createResourceRelation(L,E){const r=O,{resource:c,id:t,relation:e,data:B,user:g}=L;return E[r(0x1f1)]['createRelation']({'name':c,'id':t,'relation':e,'data':B,'user':g});}function O(L,E){L=L-0x1f1;const c=Z();let t=c[L];return t;}function Z(){const X=['resource'];Z=function(){return X;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export async function createResource(L,E){return E['resource']['create']({'name':L['resource'],'data':L['data'],'user':L['user']});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x15f;const c=Z();let t=c[L];return t;}export async function deleteResourceRelation(L,E){const g=O,{resource:c,id:t,relation:e,relationId:B}=L;return E[g(0x15f)]['deleteRelation']({'name':c,'id':t,'relation':e,'relationId':B});}function Z(){const r=['resource'];Z=function(){return r;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export async function deleteResource(
|
|
1
|
+
export async function deleteResource(L,E){return E['resource']['delete']({'name':L['resource'],'id':L['id'],'user':L['user']});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function Z(){const e=['find','resource','search','rows'];Z=function(){return e;};return Z();}function O(L,E){L=L-0x1e1;const c=Z();let t=c[L];return t;}import{parseFilterQuery}from'../../../plugins/resource/utils/filters.js';export async function exportResource(L,E){const t=O,c=await E['resource'][t(0x1e1)]({'name':L[t(0x1e2)],'query':{'filter':parseFilterQuery(L),'sort':L['sort'],'search':L[t(0x1e3)],'limit':L['limit'],'offset':L['offset'],'fields':L['fields']},'user':L['user']});return c[t(0x1e4)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x1b1;var c=Z();var t=c[L];return t;}export async function getResource(L,E){var c=O;return E['resource']['findOne']({'name':L['resource'],'id':L['id'],'query':{'include':L[c(0x1b1)]},'user':L['user']});}function Z(){var t=['include'];Z=function(){return t;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export async function listResourceRelation(L,E){const {resource:c,id:t,relation:e,query:B,user:g}=L;return E['resource']['findRelation']({'name':c,'id':t,'relation':e,'query':B,'user':g});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseFilterQuery}from'../../../plugins/resource/utils/filters.js';export async function listResources(
|
|
1
|
+
import{parseFilterQuery}from'../../../plugins/resource/utils/filters.js';export async function listResources(L,E){var c=O;return E['resource']['find']({'name':L['resource'],'query':{'filter':parseFilterQuery(L),'sort':L['sort'],'search':L[c(0x1e3)],'limit':L['limit'],'offset':L['offset']??(L['page']?Math['max'](L['page']-0x1,0x0):0x0)*(L['limit']??0x14)},'user':L['user']});}function O(L,E){L=L-0x1e3;var c=Z();var t=c[L];return t;}function Z(){var t=['search'];Z=function(){return t;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x1ab;var c=Z();var t=c[L];return t;}function Z(){var t=['resource'];Z=function(){return t;};return Z();}import{parseFilterQuery}from'../../../plugins/resource/utils/filters.js';export async function searchResource(L,E){var c=O;return E[c(0x1ab)]['find']({'name':L[c(0x1ab)],'query':{...L,'filter':parseFilterQuery(L)},'user':L['user']});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{ValidationError}from'../../../errors.js';function O(L,E){L=L-0x1ad;const c=Z();let t=c[L];return t;}import{autoIndex}from'../../../plugins/resource/utils/auto-index.js';export async function suggestResource(L,E){const G=O,c=E['resource']['get'](L['resource']),t=String(L['search']??L['q']??'')['toLowerCase'](),e=Math['min'](Math['max'](Number(L[G(0x1ad)]??0x14),0x1),0xc8),B=Date['now'](),g=c['fields'][L['field']],r=g?.['dictionary'],X=g?.['lookup']?.[G(0x1ae)];if(X){const I=g[G(0x1af)]?.['text']??'name',T=g['lookup']?.['value']??'id';autoIndex(X,I,G(0x1b0),E['pg']);const f=await E['pg']['query'](G(0x1b1)+T+G(0x1b2)+I+'\x20as\x20text\x20FROM\x20'+X+'\x20WHERE\x20lower('+I+G(0x1b3),[''+t['toLowerCase'](),e])['then'](A=>A['rows']);return{'limit':e,'count':f['length'],'search':t,'time':Date['now']()-B,'data':f};}if(!r)throw new ValidationError('Field\x20has\x20no\x20lookup\x20dictionary:\x20'+L['field']);const j=await E['dictionary']['get'](r),F=j['filter'](A=>!t||A['code']['startsWith'](t)||A['name']['startsWith'](t))['slice'](0x0,e)['map'](A=>({'id':A['code']||A['id'],'text':A['name']||A['text']}));return{'search':t,'limit':e,'count':F[G(0x1b4)],'time':Date['now']()-B,'data':F};}function Z(){const x=['limit','table','lookup','text','SELECT\x20','\x20as\x20id,\x20',')\x20~\x20$1\x20LIMIT\x20$2','length'];Z=function(){return x;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export async function updateResourceRelation(
|
|
1
|
+
export async function updateResourceRelation(L,E){const X=O,{resource:c,id:t,relation:e,relationId:B,data:g,user:r}=L;return E[X(0x11c)]['updateRelation']({'name':c,'id':t,'relation':e,'relationId':B,'data':g,'user':r});}function O(L,E){L=L-0x11c;const c=Z();let t=c[L];return t;}function Z(){const j=['resource'];Z=function(){return j;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
export async function updateResource(L,E){var c=O;return E['resource'][c(0xb2)]({'name':L['resource'],'id':L['id'],'data':L['patch'],'user':L[c(0xb3)]});}function O(L,E){L=L-0xb2;var c=Z();var t=c[L];return t;}function Z(){var t=['update','user'];Z=function(){return t;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x103;const c=Z();let t=c[L];return t;}import{ForbiddenError,NotFoundError,ValidationError}from'../../../errors.js';function Z(){const r=['resource','get','admin','user','type','Admin\x20access\x20required','put','Uploaded\x20file\x20not\x20found'];Z=function(){return r;};return Z();}export async function uploadResourceFile(L,E){const g=O,c=E[g(0x103)][g(0x104)](L['resource']);if(c['access']===g(0x105)&&L[g(0x106)]?.[g(0x107)]!=='admin')throw new ForbiddenError(g(0x108));if(L['user']?.[g(0x107)]!=='admin'&&!L[g(0x106)]?.['permissions']?.['includes']((c['permission']??c['name'])+':update'))throw new ForbiddenError('Missing\x20permission:\x20'+(c['permission']??c['name'])+':update');if(!Buffer['isBuffer'](L['file'])||L['file']['length']===0x0)throw new ValidationError('File\x20is\x20required');const t=L['fileName']['replace'](/[^A-Za-z0-9._-]/g,'_');if(!t)throw new ValidationError('File\x20name\x20is\x20required');const e='files/'+L['resource']+'/'+String(L['id'])+'/'+t;await E['file'][g(0x109)](e,L['file']);if(!await E['file']['exists'](e))throw new NotFoundError(g(0x10a));const B=await E['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',[L['resource'],String(L['id']),e,L['file']['length']]);return B['rows'][0x0];}
|
|
@@ -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';import{checkSystem}from'./services/check-system.js';function
|
|
1
|
+
import{getSystemSettings}from'./services/get-system-settings.js';function O(L,E){L=L-0x15a;const c=Z();let t=c[L];return t;}import{updateSystemSettings}from'./services/update-system-settings.js';import{getAuditLog}from'./services/get-audit-log.js';import{checkSystem}from'./services/check-system.js';import{getApiList}from'./services/get-api-list.js';import{getSystemLog}from'./services/get-system-log.js';import{getDictionary}from'./services/get-dictionary.js';import{updateDictionary}from'./services/update-dictionary.js';function Z(){const F=['get','/api/dictionary/:name','fcore','system','system:dictionaries','dictionaryName','Returns\x20direct\x20and\x20role-based\x20access\x20rules\x20for\x20a\x20user\x20or\x20role.','system:access','access','params','Update\x20system\x20settings','admin','settings','body','send','Returns\x20the\x20system\x20audit\x20log\x20entries.','user','apiListQuery'];Z=function(){return F;};return Z();}import{getAccess}from'./services/get-access.js';import{setAccess}from'./services/set-access.js';import{systemSchemas}from'./schema.js';const u=L=>L['user'];export function systemRoutes(L,E=new Map()){return async c=>{const X=O;c[X(0x15a)](X(0x15b),{'schema':{'tags':[X(0x15c),X(0x15d)],'summary':'Get\x20platform\x20dictionary','description':'Returns\x20a\x20registered\x20platform\x20dictionary\x20by\x20name.','access':'user','permissions':[X(0x15e)],'params':systemSchemas[X(0x15f)]}},async e=>({'items':await getDictionary({...e['params'],'user':u(e)},L)})),c['post']('/api/dictionary/:name',{'schema':{'tags':['fcore','system'],'summary':'Update\x20platform\x20dictionary','description':'Replaces\x20the\x20items\x20of\x20a\x20registered\x20platform\x20dictionary.','access':'user','permissions':['system:dictionaries'],'params':systemSchemas[X(0x15f)],'body':systemSchemas['dictionaryItems']}},async e=>updateDictionary({...e['params'],...e['body'],'user':u(e)},L));const t=async e=>getAccess({...e['params'],'user':u(e)},L);c[X(0x15a)]('/api/access/:type/:id',{'schema':{'tags':['fcore','system'],'summary':'Get\x20access\x20rules','description':X(0x160),'access':'admin','permissions':[X(0x161)],'params':systemSchemas['accessTarget']}},t),c['post']('/api/access/:type/:id',{'schema':{'tags':['fcore','system'],'summary':'Set\x20access\x20rules','description':'Replaces\x20direct\x20access\x20rules\x20for\x20a\x20user\x20or\x20role.','access':'admin','permissions':['system:access'],'params':systemSchemas['accessTarget'],'body':systemSchemas[X(0x162)]}},async e=>setAccess({...e['params'],...e['body'],'user':u(e)},L)),c[X(0x15a)]('/api/system/settings',{'schema':{'tags':['fcore','system'],'summary':'Get\x20system\x20settings','description':'Returns\x20system\x20settings\x20as\x20nested\x20JSON.','access':'admin','permissions':['system:settings']}},async e=>getSystemSettings({...e[X(0x163)],'user':u(e)},L)),c['post']('/api/system/settings',{'schema':{'tags':[X(0x15c),'system'],'summary':X(0x164),'description':'Updates\x20system\x20settings\x20using\x20flat\x20dot-notation\x20keys.','access':X(0x165),'permissions':['system:settings'],'body':systemSchemas[X(0x166)]}},async e=>updateSystemSettings({...e['params'],'patch':e[X(0x167)],'user':u(e)},L)),c['get']('/api/system/logger',{'schema':{'tags':[X(0x15c),'system'],'summary':'Get\x20system\x20log','description':'Returns\x20system\x20logger\x20entries\x20for\x20the\x20requested\x20path.','access':'user','permissions':['system:logs'],'querystring':systemSchemas['logger']}},async(e,B)=>{const j=X,{contentType:g,body:r}=await getSystemLog({...e['query'],'user':u(e)},L);return B['type'](g)[j(0x168)](r);}),c['get']('/api/system/audit',{'schema':{'tags':[X(0x15c),'system'],'summary':'Get\x20audit\x20log','description':X(0x169),'access':X(0x16a),'permissions':['system:audit']}},async e=>getAuditLog({...e['query'],'user':u(e)},L)),c['get']('/api/system/check',{'schema':{'tags':['fcore','system'],'summary':'Check\x20system\x20health','description':'Checks\x20the\x20availability\x20of\x20system\x20dependencies.','access':'user','permissions':['system:check']}},async e=>checkSystem({'user':u(e)},L)),c[X(0x15a)]('/api/system/list',{'schema':{'tags':['fcore','system'],'summary':'List\x20APIs','description':'Returns\x20the\x20list\x20of\x20registered\x20platform\x20APIs.','access':'admin','permissions':[],'querystring':systemSchemas[X(0x16b)]}},async e=>getApiList({'user':u(e),'apiRoutes':E,...e['query']},L));};}
|
|
@@ -16,10 +16,11 @@ export declare const systemSchemas: {
|
|
|
16
16
|
id: import("@sinclair/typebox").TString;
|
|
17
17
|
}>;
|
|
18
18
|
access: import("@sinclair/typebox").TObject<{
|
|
19
|
-
|
|
19
|
+
permissions: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
20
|
+
access: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
20
21
|
resource: import("@sinclair/typebox").TString;
|
|
21
22
|
actions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
22
|
-
}
|
|
23
|
+
}>>>;
|
|
23
24
|
}>;
|
|
24
25
|
apiListQuery: import("@sinclair/typebox").TObject<{
|
|
25
26
|
format: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"short">, import("@sinclair/typebox").TLiteral<"extended">]>>;
|
|
@@ -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,eAAe;;;;;;;;IAef,YAAY;;;;IAIZ,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;;;;;;;IAaN,YAAY;;;IAGZ,cAAc;;;IACd,QAAQ;IACR,MAAM;;;CAKP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0xcf;const c=Z();let t=c[L];return t;}function Z(){const E=['Object','Union','Literal','Optional','Array','String','short'];Z=function(){return E;};return Z();}const L=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 systemSchemas={'dictionaryName':Type[L(0xcf)]({'name':identifier}),'dictionaryItems':Type['Object']({'items':Type['Array'](Type['Object']({'id':Type['Optional'](Type['Union']([Type['String'](),Type['Number']()])),'code':Type['String']({'minLength':0x1}),'name':Type['String']({'minLength':0x1}),'parentId':Type['Optional'](Type['Union']([Type['String'](),Type['Number'](),Type['Null']()]))},{'additionalProperties':!![]}))}),'accessTarget':Type['Object']({'type':Type[L(0xd0)]([Type[L(0xd1)]('user'),Type[L(0xd1)]('role')]),'id':identifier}),'access':Type[L(0xcf)]({'permissions':Type[L(0xd2)](Type['Array'](Type['String']({'minLength':0x1,'maxLength':0x80,'pattern':'^[A-Za-z0-9_-]+(?::[A-Za-z0-9_-]+)?$'}))),'access':Type['Optional'](Type[L(0xd3)](Type['Object']({'resource':Type[L(0xd4)]({'minLength':0x1,'maxLength':0x80}),'actions':Type[L(0xd3)](Type['String']({'minLength':0x1,'maxLength':0x80}),{'minItems':0x1})})))}),'apiListQuery':Type['Object']({'format':Type[L(0xd2)](Type[L(0xd0)]([Type['Literal'](L(0xd5)),Type[L(0xd1)]('extended')]))}),'settingsEntity':Type[L(0xcf)]({'entity':Type[L(0xd2)](identifier)}),'settings':Type['Record'](Type['String']({'minLength':0x1}),Type['Unknown']()),'logger':Type['Object']({'path':Type['Optional'](Type['String']({'maxLength':0x100,'pattern':'^[A-Za-z0-9_.\x5c-/]*$'}))})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x1e5;const c=Z();let t=c[L];return t;}export async function checkSystem(L,E){const e=O,[c,t]=await Promise[e(0x1e5)]([E['pg'][e(0x1e6)](e(0x1e7)),E[e(0x1e8)]['ping']()]);return{'status':c[e(0x1e9)]===e(0x1ea)&&t['status']==='fulfilled'?'ok':'degraded','pg':c['status'],'redis':t['status']};}function Z(){const B=['allSettled','query','SELECT\x201','redis','status','fulfilled'];Z=function(){return B;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAsB,SAAS,CAC7B,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACzD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"get-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/get-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAsB,SAAS,CAC7B,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,EACzD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAwB1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x9c;const c=Z();let t=c[L];return t;}export async function getAccess(L,E){const g=O,c=L[g(0x9c)]==='user'?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20ra.resource,\x20ra.actions,\x20ra.role_id\x20AS\x20role\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20ur.role_id\x20=\x20ra.role_id\x20AND\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20ra.resource,\x20ra.actions,\x20ra.role_id\x20AS\x20role\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20ra.role_id\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20',t=await E['pg'][g(0x9d)](c,[L['id']]),e=[...new Set(t[g(0x9e)]['map'](B=>B['resource'])[g(0x9f)](B=>B!==null))];return{'access':t['rows'],'resources':e};}function Z(){const r=['type','query','rows','filter'];Z=function(){return r;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0xed;const c=Z();let t=c[L];return t;}function Z(){const X=['sort','method','short'];Z=function(){return X;};return Z();}export async function getApiList(L,E){const r=O,c=[...L['apiRoutes']['values']()][r(0xed)]((t,e)=>(t['endpoint']+'\x20'+t[r(0xee)])['localeCompare'](e['endpoint']+'\x20'+e['method']));if(L['format']!==r(0xef))return c;return c['map'](({method:t,endpoint:e,access:B,permissions:g})=>t+'\x20'+e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x175;const c=Z();let t=c[L];return t;}export async function getAuditLog(L,E){const B=O,c=Math['min'](Math[B(0x175)](L['limit']??0x32,0x1),0xc8),t=Math[B(0x175)]((L['page']??0x1)-0x1,0x0)*c,e=await E['pg']['query'](B(0x176),[c,t]);return{'rows':e['rows'],'page':L[B(0x177)]??0x1,'limit':c};}function Z(){const g=['max','SELECT\x20*\x20FROM\x20admin.audit_log\x20ORDER\x20BY\x20id\x20DESC\x20LIMIT\x20$1\x20OFFSET\x20$2','page'];Z=function(){return g;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x1d1;var c=Z();var t=c[L];return t;}export async function getDictionary(L,E){var c=O;return E['dictionary'][c(0x1d1)](L['name']);}function Z(){var t=['get'];Z=function(){return t;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
import L from'node:fs/promises';function O(L,E){L=L-0x73;const c=Z();let t=c[L];return t;}import E from'node:path';import{NotFoundError,ValidationError}from'../../../errors.js';const LOGS_ROOT=E['resolve'](process['cwd'](),'logs'),TAIL_LINES=0x64;export async function getSystemLog(c,t){const A=O,e=normalizePath(c[A(0x73)]),B=E['resolve'](LOGS_ROOT,e);if(B!==LOGS_ROOT&&!B[A(0x74)](LOGS_ROOT+E[A(0x75)]))throw new ValidationError('Invalid\x20log\x20path');const g=await L['stat'](B)['catch'](()=>null);if(!g)throw new NotFoundError('Log\x20path\x20not\x20found');if(g['isDirectory']()){const X=await L['readdir'](B,{'withFileTypes':!![]}),j=await Promise['all'](X[A(0x76)](async F=>{const G=A,I=await L['stat'](E[G(0x77)](B,F[G(0x78)]));return{'name':F[G(0x78)],'path':e?e+'/'+F['name']:F['name'],'type':F['isDirectory']()?'directory':'file','size':F['isDirectory']()?undefined:I[G(0x79)],'modified':I['mtime']['toISOString']()};}));j['sort']((F,I)=>F['name'][A(0x7a)](I['name']));if(e){const F=e[A(0x7b)]('/')['slice'](0x0,-0x1)[A(0x77)]('/');j['unshift']({'name':'..','path':F,'type':'directory'});}return{'contentType':A(0x7c),'body':renderDirectory(e,j)};}const r=await tailFile(B,TAIL_LINES);return{'contentType':'text/plain;\x20charset=utf-8','body':r['join']('\x0a')};}function renderDirectory(c,t){const x=O,e=t[x(0x76)](g=>{const W=x,r='?path='+encodeURIComponent(g['path']),X=g['type']===W(0x7d)?g['name']+'/':g[W(0x78)];return'<li><a\x20href=\x22'+r+'\x22>'+escapeHtml(X)+'</a></li>';})['join']('\x0a'),B=escapeHtml('logs/'+c);return'<!DOCTYPE\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>'+B+'</title></head>\x0a<body>\x0a<h1>'+B+'</h1>\x0a<ul>\x0a'+e+'\x0a</ul>\x0a</body>\x0a</html>';}function Z(){const Y=['path','startsWith','sep','map','join','name','size','localeCompare','split','text/html;\x20charset=utf-8','directory','<','replace','toString','utf8','slice','close'];Z=function(){return Y;};return Z();}function escapeHtml(c){const q=O;return c['replace'](/&/g,'&')['replace'](/</g,q(0x7e))['replace'](/>/g,'>')['replace'](/"/g,'"');}function normalizePath(c){const y=O,t=(c??'')['replace'](/\\/g,'/')[y(0x7f)](/^\/+|\/+$/g,'');if(t['split']('/')['some'](e=>e==='..'))throw new ValidationError('Invalid\x20log\x20path');return t;}async function tailFile(c,t){const p=O,e=await L['open'](c,'r');try{const {size:B}=await e['stat'](),g=0x40*0x400;let r=B,X=Buffer['alloc'](0x0),j=0x0;while(r>0x0&&j<=t){const I=Math['min'](g,r);r-=I;const T=Buffer['alloc'](I);await e['read'](T,0x0,I,r),X=Buffer['concat']([T,X]),j+=countNewlines(T);}const F=X[p(0x80)](p(0x81))[p(0x7b)]('\x0a')['filter'](f=>f['length']>0x0);return F[p(0x82)](-t)['reverse']();}finally{await e[p(0x83)]();}}function countNewlines(c){let t=0x0;for(const e of c){if(e===0xa)t++;}return t;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export async function getSystemSettings(
|
|
1
|
+
export async function getSystemSettings(L,E){const X=O,c=await E['pg'][X(0x158)](X(0x159));return c['rows']['reduce']((t,e)=>{const B=String(e['key'])['split']('.');let g=t;for(const r of B['slice'](0x0,-0x1)){g[r]??={},g=g[r];}return g[B['at'](-0x1)]=e['value'],t;},{});}function O(L,E){L=L-0x158;const c=Z();let t=c[L];return t;}function Z(){const j=['query','\x0a\x20\x20\x20\x20\x20\x20SELECT\x20key,\x20value\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.settings\x0a\x20\x20\x20\x20\x20\x20WHERE\x20resource\x20=\x20\x27system\x27\x20AND\x20resource_id\x20IS\x20NULL\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20key\x0a\x20\x20\x20\x20'];Z=function(){return j;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export async function listDictionaries(L,E){return E['dictionary']['list']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/set-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"set-access.d.ts","sourceRoot":"","sources":["../../../../src/modules/system/services/set-access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/D,KAAK,WAAW,GAAG;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAoBF,wBAAsB,SAAS,CAC3B,MAAM,EAAE;IACJ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,IAAI,EAAE,IAAI,CAAC;CACd,EACD,GAAG,EAAE,UAAU,GAChB,OAAO,CAAC;IAAE,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,CAAC,CAiDrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Z(){const f=['delete','update','add','map','BEGIN','DELETE\x20FROM\x20admin.role_access\x20WHERE\x20user_uid\x20=\x20$1\x20AND\x20role_id\x20IS\x20NULL','access','INSERT\x20INTO\x20admin.role_access\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(\x20resource,\x20actions,\x20user_uid,\x20created_by,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)','resource','query','user','ROLLBACK','release'];Z=function(){return f;};return Z();}const F=O;import{getAccess}from'./get-access.js';function O(L,E){L=L-0xaf;const c=Z();let t=c[L];return t;}const CRUD_ACTIONS=['read','update','create',F(0xaf)];function permissionsToAccess(L){const I=F,E=new Map();for(const c of L){const [t,e]=c['split'](':');if(!t)continue;const B=e==='edit'?I(0xb0):e,g=E['get'](t)??new Set();for(const r of B?[B]:CRUD_ACTIONS)g[I(0xb1)](r);E['set'](t,g);}return[...E][I(0xb2)](([X,j])=>({'resource':X,'actions':[...j]}));}export async function setAccess(L,E){const T=F,c=await E['pg']['connect']();try{await c['query'](T(0xb3));L['type']==='user'?await c['query'](T(0xb4),[L['id']]):await c['query']('DELETE\x20FROM\x20admin.role_access\x20WHERE\x20role_id\x20=\x20$1\x20AND\x20user_uid\x20IS\x20NULL',[L['id']]);const t=L['permissions']?permissionsToAccess(L['permissions']):L[T(0xb5)]??[];for(const e of t){L['type']==='user'?await c['query'](T(0xb6),[e[T(0xb7)],e['actions'],L['id'],L['user']['id'],L['user']['id']]):await c[T(0xb8)]('INSERT\x20INTO\x20admin.role_access\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(\x20resource,\x20actions,\x20role_id,\x20created_by,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)',[e[T(0xb7)],e['actions'],L['id'],L[T(0xb9)]['id'],L['user']['id']]);}await c['query']('COMMIT');}catch(B){await c['query'](T(0xba));throw B;}finally{c[T(0xbb)]();}return getAccess(L,E);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Z(){var t=['dictionary'];Z=function(){return t;};return Z();}function O(L,E){L=L-0x1c1;var c=Z();var t=c[L];return t;}export async function updateDictionary(L,E){var c=O;return await E[c(0x1c1)]['put'](L['name'],L['items']),{'success':!![]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{ValidationError}from'../../../errors.js';export async function updateSystemSettings(L,E){const e=O;if(!Object['keys'](L['patch'])['length'])throw new ValidationError('Settings\x20patch\x20is\x20empty');for(const [c,t]of Object['entries'](L['patch'])){if(!c[e(0x15c)]()||c['includes']('..'))throw new ValidationError('Invalid\x20setting\x20key:\x20'+c);await E['pg'][e(0x15d)]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.settings\x20(resource,\x20resource_id,\x20key,\x20value,\x20updated_by)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(\x27system\x27,\x20NULL,\x20$1,\x20$2::jsonb,\x20$3)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT\x20(resource,\x20resource_id,\x20key)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20DO\x20UPDATE\x20SET\x20value\x20=\x20EXCLUDED.value,\x20updated_by\x20=\x20EXCLUDED.updated_by,\x20updated_at\x20=\x20now()\x0a\x20\x20\x20\x20\x20\x20\x20\x20',[c,JSON['stringify'](t),L['user']['id']]);}return{'success':!![]};}function O(L,E){L=L-0x15c;const c=Z();let t=c[L];return t;}function Z(){const B=['trim','query'];Z=function(){return B;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Z(){var t=['admin'];Z=function(){return t;};return Z();}function O(L,E){L=L-0x1c8;var c=Z();var t=c[L];return t;}import{ForbiddenError}from'../../errors.js';export function requireAdmin(L,E){var c=O;if(!L)throw new ForbiddenError('User\x20required');if(L['type']!=='admin')throw new ForbiddenError('Admin\x20access\x20required');if(L['type']!==c(0x1c8)&&E&&!L['permissions']?.['includes'](E))throw new ForbiddenError('Missing\x20permission:\x20'+E);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Z(){const B=['some'];Z=function(){return B;};return Z();}function O(L,E){L=L-0x156;const c=Z();let t=c[L];return t;}export const safeUser=L=>{const e=O,E=['password','salt','secret','credentials'];return Object['fromEntries'](Object['entries'](L)['filter'](([c])=>!E[e(0x156)](t=>c['toLowerCase']()['includes'](t))));};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UnsupportedError}from'../../errors.js';
|
|
1
|
+
function O(L,E){L=L-0xc8;var c=Z();var t=c[L];return t;}import{UnsupportedError}from'../../errors.js';function Z(){var c=['\x20requires\x20a\x20project/provider\x20implementation'];Z=function(){return c;};return Z();}export function unsupported(L){var E=O;throw new UnsupportedError(L+E(0xc8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{writeAudit}from'./services/write-audit.js';export function createAudit(
|
|
1
|
+
import{writeAudit}from'./services/write-audit.js';export function createAudit(L){const E=writeAudit(L);return{'write':E};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit.types.d.ts","sourceRoot":"","sources":["../../../src/plugins/audit/audit.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC1C,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"audit.types.d.ts","sourceRoot":"","sources":["../../../src/plugins/audit/audit.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,WAAW,UAAU;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AACD,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const secretPattern=/password|token|secret|credential|salt/i;function
|
|
1
|
+
const secretPattern=/password|token|secret|credential|salt/i;function Z(){const f=['isArray','fromEntries','test','[REDACTED]','rows','map','table_name','has','audit_log','audit_log_data','catch','changes','oldValue','audit','userId','resourceId','fields','field','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log_data\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20audit_log_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20field,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20old_value,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20new_value\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20'];Z=function(){return f;};return Z();}function O(L,E){L=L-0x189;const c=Z();let t=c[L];return t;}function clean(L){const j=O;if(Array[j(0x189)](L))return L['map'](clean);if(L&&typeof L==='object')return Object[j(0x18a)](Object['entries'](L)['map'](([E,c])=>[E,secretPattern[j(0x18b)](E)?j(0x18c):clean(c)]));return L;}export function writeAudit(L){let E,c;async function t(){const I=O;if(!L['pg'])return![];if(E!==undefined)return E;return c??=L['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_schema\x20=\x20\x27admin\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20IN\x20(\x27audit_log\x27,\x20\x27audit_log_data\x27)\x0a\x20\x20\x20\x20\x20\x20\x20\x20')['then'](e=>{const F=O,B=new Set(e[F(0x18d)][F(0x18e)](g=>g[F(0x18f)]));return E=B[F(0x190)](F(0x191))&&B['has'](F(0x192)),!E&&L['logger']['warn']({'expectedTables':['admin.audit_log','admin.audit_log_data'],'foundTables':[...B]},'Audit\x20tables\x20are\x20unavailable;\x20audit\x20writes\x20are\x20disabled'),E;})[I(0x193)](e=>{return E=![],L['logger']['warn']({'err':e},'Unable\x20to\x20check\x20audit\x20tables;\x20audit\x20writes\x20are\x20disabled'),![];}),c;}return async function e(B){const T=O;if(!await t())return L['logger']['info']({'auditFallback':!![],'event':clean({...B,'changes':B[T(0x194)]?.[T(0x18e)](X=>({...X,'oldValue':clean(X[T(0x195)]),'newValue':clean(X['newValue'])}))})},T(0x196)),0x0;if(!L['pg'])throw new Error('empty\x20pg');const g=await L['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.audit_log\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20user_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20module,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20fields,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20action,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20request_id,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ip_address,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20metadata\x0a\x20\x20\x20\x20\x20\x20\x20\x20)\x0a\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5,\x20$6,\x20$7,\x20$8,\x20$9)\x0a\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20id\x0a\x20\x20\x20\x20\x20\x20',[B[T(0x197)]??null,B['module'],B['resource'],B[T(0x198)]==null?null:String(B['resourceId']),B[T(0x199)]??null,B['action'],B['requestId']??null,B['ipAddress']??null,clean(B['metadata']??{})]),r=g['rows'][0x0]['id'];for(const X of B[T(0x194)]??[]){if(secretPattern['test'](X[T(0x19a)]))continue;await L['pg']['query'](T(0x19b),[r,X['field'],JSON['stringify'](clean(X['oldValue'])),JSON['stringify'](clean(X['newValue']))]);}return r;};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0x188;const c=Z();let t=c[L];return t;}export async function getUserPermissions(L,E){const e=O,c=await E['pg']['query'](e(0x188),[L]);return c[e(0x189)]['map'](t=>t[e(0x18a)]);}function Z(){const B=['\x0a\x20\x20\x20\x20\x20\x20SELECT\x20DISTINCT\x20ra.resource\x20||\x20\x27:\x27\x20||\x20action\x20AS\x20permission\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x20ON\x20ur.role_id\x20=\x20ra.role_id\x0a\x20\x20\x20\x20\x20\x20CROSS\x20JOIN\x20LATERAL\x20unnest(COALESCE(ra.actions,\x20\x27{}\x27::text[]))\x20AS\x20action\x0a\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20','rows','permission'];Z=function(){return B;};return Z();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function O(L,E){L=L-0xa0;const c=Z();let t=c[L];return t;}export*from'./auth.types.js';import{randomBytes,scrypt as L,timingSafeEqual}from'node:crypto';import{promisify}from'node:util';const scrypt=promisify(L);import E from'@fastify/cookie';import c from'@fastify/session';import{Authenticator}from'@fastify/passport';import t from'fastify-session-redis-store';import{getUserPermissions}from'./get-user-permissions.js';const fastifyPassport=new Authenticator();export*from'./verifyUser.js';export*from'./get-user-permissions.js';function Z(){const x=['scrypt$','toString','from','test','auth','cookieOptions','database','initialize','register','user'];Z=function(){return x;};return Z();}export async function hashPassword(e){const T=O,B=randomBytes(0x10),g=await scrypt(e,B,0x40);return T(0xa0)+B['toString']('hex')+'$'+g[T(0xa1)]('hex');}export async function verifyPassword(e,B){const f=O,[g,r,X]=B?.['split']('$')||[];if(g!=='scrypt'||!r||!X)return![];const j=Buffer[f(0xa2)](r,'hex'),F=Buffer['from'](X,'hex'),I=await scrypt(e,j,F['length']);return timingSafeEqual(I,F);}export async function createSessionStore(e,B){const A=O,{config:g,redis:r}=B;if(!g||!r){console['warn']('Missing\x20config\x20or\x20redis\x20-\x20skipping\x20session\x20store\x20creation');return;}if(process.env.NODE_ENV===A(0xa3)||process.env.VITEST)return;await e['register'](E,{'parseOptions':g[A(0xa4)]['cookieOptions']}),await e['register'](c,{'secret':g['auth']['secret'],'cookieName':g['auth']['cookieName'],'cookie':g['auth'][A(0xa5)],'store':new t({'prefix':g[A(0xa4)]['cookieName']+':'+(g['pg']?.[A(0xa6)]||'db')+':','client':r})}),await e['register'](fastifyPassport[A(0xa7)]()),await e[A(0xa8)](fastifyPassport['secureSession']()),fastifyPassport['registerUserSerializer'](async X=>({'user':X})),fastifyPassport['registerUserDeserializer'](async X=>{const G=A,j=X?.[G(0xa9)]||X;return j?.['id']&&(j['permissions']=await getUserPermissions(j['id'],B)),j;});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BadRequestError}from'../../errors.js';import{verifyPassword}from'./index.js';function
|
|
1
|
+
import{BadRequestError}from'../../errors.js';import{verifyPassword}from'./index.js';function O(L,E){L=L-0x1c6;const c=Z();let t=c[L];return t;}function Z(){const I=['query','rows','info','auth/warn'];Z=function(){return I;};return Z();}export async function verifyUser({user:L,password:E,ip:c},{pg:t,logger:e}){const F=O;if(!L||L==='')throw new BadRequestError('not\x20enough\x20params:\x20user');if(!E||E==='')throw new BadRequestError('not\x20enough\x20params:\x20password');e['metrics']('user.login');const B='select\x20uid\x20as\x20id,\x20user_type\x20as\x20type,\x20password_hash,\x20twofa\x20from\x20admin.users\x20where\x20$1\x20in\x20(login,email,phone)\x20and\x20enabled\x20limit\x201',g=await t[F(0x1c6)](B,[L])['then'](X=>X[F(0x1c7)]?.[0x0]);if(!g){const X='user\x20not\x20found';e[F(0x1c8)]({'file':F(0x1c9),'error':X,'user':L,'ip':c});throw new BadRequestError(X);}const r=await verifyPassword(E,g['password_hash']);if(!r){const j='Wrong\x20password';e[F(0x1c8)]({'file':'auth/warn','error':j,'user':L,'ip':c});throw new BadRequestError(j);}return delete g['password_hash'],g;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{ConflictError,NotFoundError,ValidationError}from'../errors.js';const dictionaryName=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;export function createDictionary({pg:L,dictionaries:dictionaries=[]}){const E=new Map(),c=new Map();let t,e;async function B(){const h=O;if(t!==undefined)return t;if(!L)throw new Error('empty\x20pg');return e??=L[h(0xae)]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_schema\x20=\x20\x27admin\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20\x27dictionaries\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20LIMIT\x201\x0a\x20\x20\x20\x20\x20\x20\x20\x20')[h(0xaf)](A=>{const w=h,G=A[w(0xb0)][0x0]?.[w(0xb1)];t=G==='dictionaries'?G:null;}),await e,t;}function g(A){if(!dictionaryName['test'](A))throw new ValidationError('Invalid\x20dictionary\x20name:\x20'+A);}function r(A){const S=O;for(const G of Array[S(0xb2)](A)?A:[A]){g(G['code']);if(!Array['isArray'](G['items']))throw new ValidationError(S(0xb3)+G['code']);if(E['has'](G['code']))throw new ConflictError('Dictionary\x20already\x20registered:\x20'+G[S(0xb4)]);E[S(0xb5)](G[S(0xb4)],{...G,'source':'static'});}}function X(A){return E['has'](A);}async function j(A){const D=O;g(A);const G=E['get'](A);if(G&&G[D(0xb6)])return G['items'];const x=await B();if(!x)throw new NotFoundError('Dictionary\x20table\x20not\x20found');const W=await L?.[D(0xae)](D(0xb7),[A]);if(W?.['rows']?.['length']){const q=W?.[D(0xb0)];return E['set'](A,{'code':A,'name':A,'items':q,'source':'database','checked':!![]}),q;}if(!G?.['items'])throw new NotFoundError('Dictionary\x20not\x20found:\x20'+A);return G['checked']=!![],G[D(0xb8)];}async function F(A,G){const u=O;g(A);if(!Array[u(0xb2)](G))throw new ValidationError('Dictionary\x20items\x20must\x20be\x20an\x20array');const x=await B();if(!x)throw new NotFoundError('Dictionary\x20table\x20not\x20found');if(!L)throw new Error(u(0xb9));const W=await L['connect']();try{await W['query']('BEGIN');const q=await W[u(0xae)]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.dictionaries\x20(code,\x20name,\x20module,\x20source,\x20editable)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4,\x20$5)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT\x20(code)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name\x20=\x20EXCLUDED.name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20module\x20=\x20EXCLUDED.module,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20source\x20=\x20EXCLUDED.source,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20editable\x20=\x20EXCLUDED.editable,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20updated_at\x20=\x20now()\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20RETURNING\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',[A,A,'fcore','custom',!![]]),y=q['rows'][0x0]['id'];await W['query']('DELETE\x20FROM\x20admin.dictionary_items\x20WHERE\x20dictionary_id\x20=\x20$1',[y]);for(const p of G){await W['query'](u(0xba),[y,p[u(0xb4)],p['name'],p[u(0xbb)]??null]);}await W['query']('COMMIT');}catch(Y){await W['query']('ROLLBACK');throw Y;}finally{W['release']();}E[u(0xb5)](A,{'items':G,'code':A,'source':'static','checked':!![]}),c['set'](A,(c['get'](A)??0x0)+0x1);}function I(A){return g(A),c['set'](A,(c['get'](A)??0x0)+0x1),E['delete'](A);}function T(A){return c['get'](A)??0x0;}async function f(){const A=[...E['values']()]['map'](({code:W,name:q,source:y})=>({'code':W,'name':q??W,'source':y})),G=await B();if(!G)return A;if(!L)throw new Error('empty\x20pg');const x=await L['query']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20code,\x20name,\x20\x27database\x27\x20AS\x20source\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.dictionaries\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20name\x0a\x20\x20\x20\x20\x20\x20\x20\x20');for(const W of x['rows']){!E['has'](W['code'])&&A['push'](W);}return A;}return r(dictionaries),{'register':r,'get':j,'put':F,'clear':I,'revision':T,'list':f,'has':X};}function O(L,E){L=L-0xae;const c=Z();let t=c[L];return t;}function Z(){const U=['query','then','rows','table_name','isArray','Invalid\x20dictionary\x20items:\x20','code','set','checked','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20di.code,\x20di.name\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20admin.dictionary_items\x20di\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20admin.dictionaries\x20d\x20ON\x20d.id\x20=\x20di.dictionary_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20d.code\x20=\x20$1\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20di.name\x0a\x20\x20\x20\x20\x20\x20\x20\x20','items','empty\x20pg','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20admin.dictionary_items\x20(dictionary_id,\x20code,\x20name,\x20parent_id)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20($1,\x20$2,\x20$3,\x20$4)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','parentId'];Z=function(){return U;};return Z();}
|
package/dist/plugins/file.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DeleteObjectCommand,GetObjectCommand,HeadObjectCommand,PutObjectCommand,S3Client}from'@aws-sdk/client-s3';function
|
|
1
|
+
import{DeleteObjectCommand,GetObjectCommand,HeadObjectCommand,PutObjectCommand,S3Client}from'@aws-sdk/client-s3';function Z(){const q=['startsWith','includes','replace','transformToByteArray','push','from','concat','toString','us-east-1','forcePathStyle','bucket','Body','httpStatusCode','tokenTtl','base64url','createHmac','sha256','Invalid\x20file\x20token','digest','length'];Z=function(){return q;};return Z();}import L from'node:crypto';import{ValidationError}from'../errors.js';function O(L,E){L=L-0xec;const c=Z();let t=c[L];return t;}import{UnauthorizedError}from'../errors.js';function keyFor(E,c){const I=O;if(!c||c[I(0xec)]('/')||c[I(0xed)]('..'))throw new ValidationError('Invalid\x20file\x20path');const t=c['replace'](/\\/g,'/')[I(0xee)](/^\/+/,''),e=(E??'')['replace'](/^\/+|\/+$/g,'');return e?e+'/'+t:t;}async function bodyToBuffer(E){const T=O;if(!E)return Buffer['alloc'](0x0);const c=E;if(typeof c[T(0xef)]==='function')return Buffer['from'](await c['transformToByteArray']());const t=[];for await(const e of E){t[T(0xf0)](Buffer[T(0xf1)](e));}return Buffer[T(0xf2)](t);}export function createFileS3(E){const f=O,c=E['tokenSecret']??process.env.FILE_TOKEN_SECRET??L['randomBytes'](0x20)[f(0xf3)]('hex'),t=new S3Client({'endpoint':E['endpoint'],'region':E['region']??f(0xf4),'forcePathStyle':E[f(0xf5)]??!![],'credentials':E['accessKeyId']||E['accessKey']?{'accessKeyId':E['accessKeyId']??E['accessKey'],'secretAccessKey':E['secretAccessKey']??E['secretKey']}:undefined}),e=B=>keyFor(E['folder'],B);return{async 'put'(B,g){await t['send'](new PutObjectCommand({'Bucket':E['bucket'],'Key':e(B),'Body':g}));},async 'get'(B){const A=f,g=await t['send'](new GetObjectCommand({'Bucket':E[A(0xf6)],'Key':e(B)}));return bodyToBuffer(g[A(0xf7)]);},async 'exists'(B){const G=f;try{return await t['send'](new HeadObjectCommand({'Bucket':E['bucket'],'Key':e(B)})),!![];}catch(g){const r=g;if(r['$metadata']?.[G(0xf8)]===0x194||r['name']==='NotFound')return![];throw g;}},async 'delete'(B){await t['send'](new DeleteObjectCommand({'Bucket':E['bucket'],'Key':e(B)}));},'create'(B,g=E[f(0xf9)]??0xe10){const x=f,r=Buffer['from'](B)['toString'](x(0xfa)),X=L[x(0xfb)](x(0xfc),c)['update'](r)['digest']('base64url');return r+'.'+X;},'verify'(B){const W=f,[g,r]=B['split']('.');if(!g||!r)throw new UnauthorizedError(W(0xfd));const X=L['createHmac']('sha256',c)['update'](g)[W(0xfe)](),j=Buffer[W(0xf1)](r,'base64url');if(X[W(0xff)]!==j['length']||!L['timingSafeEqual'](X,j))throw new UnauthorizedError('Invalid\x20file\x20token');const F=Buffer['from'](g,'base64url')[W(0xf3)]('utf8');return F;}};}
|
package/dist/plugins/jwt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SignJWT,jwtVerify}from'jose';const secret=new TextEncoder()['encode'](process.env.AUTH_JWT_SECRET);function
|
|
1
|
+
import{SignJWT,jwtVerify}from'jose';function O(L,E){L=L-0xf2;const c=Z();let t=c[L];return t;}const secret=new TextEncoder()['encode'](process.env.AUTH_JWT_SECRET);function Z(){const g=['setIssuedAt'];Z=function(){return g;};return Z();}export async function jwtSignToken(L){const B=O;if(!process.env.AUTH_JWT_SECRET)return;const {id:E,type:c,permissions:t}=L,e=await new SignJWT({'id':E,'type':c,'permissions':t})['setProtectedHeader']({'alg':'HS256'})[B(0xf2)]()['setExpirationTime']('1h')['sign'](secret);return e;}export async function jwtVerifyToken(L){const E=await jwtVerify(L,secret,{'algorithms':['HS256']})['catch'](c=>{console['log'](c['message']);});return E?.['payload'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import L from'pino';function Z(){const X=['transport','./transport.js','password','token','refreshToken','bind'];Z=function(){return X;};return Z();}function O(L,E){L=L-0xba;const c=Z();let t=c[L];return t;}export function createLogger(){const r=O,E=L[r(0xba)]({'target':r(0xbb)}),c=L({'level':'info','timestamp':L['stdTimeFunctions']['isoTime'],'base':{'service':'app'},'redact':{'paths':['req.headers.authorization',r(0xbc),r(0xbd),'accessToken',r(0xbe)],'censor':'[REDACTED]'}},E),t={};function e(B,g){if(B===undefined)return{...t};t[B]=(t[B]??0x0)+(g??0x1);}return Object['assign'](c,{'close':async()=>E['end'](),'metrics':e,'file':()=>c['info'][r(0xbf)](c)});}
|