@opengis/fcore 0.0.1-beta.2 → 0.0.1-beta.21
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 +2 -5
- 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 +10 -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.d.ts +1 -0
- package/dist/modules/auth/services/get-current-user.d.ts.map +1 -1
- 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/mime.d.ts +3 -0
- package/dist/modules/file/mime.d.ts.map +1 -0
- package/dist/modules/file/mime.js +1 -0
- package/dist/modules/file/route.d.ts.map +1 -1
- package/dist/modules/file/route.js +1 -1
- package/dist/modules/file/schema.d.ts +3 -0
- package/dist/modules/file/schema.d.ts.map +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.d.ts.map +1 -1
- package/dist/modules/file/services/resize-file.js +1 -1
- package/dist/modules/file/services/upload-file.d.ts +4 -6
- package/dist/modules/file/services/upload-file.d.ts.map +1 -1
- package/dist/modules/file/services/upload-file.js +1 -1
- package/dist/modules/resource/route.d.ts +0 -3
- package/dist/modules/resource/route.d.ts.map +1 -1
- package/dist/modules/resource/route.js +1 -1
- package/dist/modules/resource/schema.d.ts +3 -0
- package/dist/modules/resource/schema.d.ts.map +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.d.ts.map +1 -1
- package/dist/modules/resource/services/export-resource.js +1 -1
- package/dist/modules/resource/services/get-resource.d.ts.map +1 -1
- package/dist/modules/resource/services/get-resource.js +1 -1
- package/dist/modules/resource/services/list-resource-relation.d.ts +9 -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.d.ts.map +1 -1
- package/dist/modules/resource/services/list-resources.js +1 -1
- package/dist/modules/resource/services/search-resource.d.ts.map +1 -1
- package/dist/modules/resource/services/search-resource.js +1 -1
- package/dist/modules/resource/services/suggest-resource.d.ts +10 -4
- 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-relation.d.ts +10 -0
- package/dist/modules/resource/services/update-resource-relation.d.ts.map +1 -0
- package/dist/modules/resource/services/update-resource-relation.js +1 -0
- 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 +23 -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 +15 -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.d.ts.map +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.d.ts.map +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 +17 -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.d.ts.map +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/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.d.ts +3 -0
- package/dist/plugins/dictionary.d.ts.map +1 -1
- package/dist/plugins/dictionary.js +1 -1
- package/dist/plugins/file.d.ts +3 -6
- package/dist/plugins/file.d.ts.map +1 -1
- package/dist/plugins/file.js +1 -1
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/jwt.d.ts +4 -0
- package/dist/plugins/jwt.d.ts.map +1 -0
- package/dist/plugins/jwt.js +1 -0
- package/dist/plugins/logger/index.js +1 -1
- package/dist/plugins/logger/transport.js +1 -1
- package/dist/plugins/pg.d.ts +4 -2
- package/dist/plugins/pg.d.ts.map +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 +73 -15
- package/dist/plugins/resource/resource.types.d.ts.map +1 -1
- package/dist/plugins/resource/services/add-dictionary-lookup-data.d.ts +3 -0
- package/dist/plugins/resource/services/add-dictionary-lookup-data.d.ts.map +1 -0
- package/dist/plugins/resource/services/add-dictionary-lookup-data.js +1 -0
- package/dist/plugins/resource/services/add-file-token.d.ts +3 -0
- package/dist/plugins/resource/services/add-file-token.d.ts.map +1 -0
- package/dist/plugins/resource/services/add-file-token.js +1 -0
- package/dist/plugins/resource/services/add-table-lookup-data.d.ts +4 -0
- package/dist/plugins/resource/services/add-table-lookup-data.d.ts.map +1 -0
- package/dist/plugins/resource/services/add-table-lookup-data.js +1 -0
- package/dist/plugins/resource/services/create-relation.d.ts +16 -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.d.ts +5 -2
- package/dist/plugins/resource/services/create.d.ts.map +1 -1
- package/dist/plugins/resource/services/create.js +1 -1
- package/dist/plugins/resource/services/delete-relation.d.ts +18 -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.d.ts +9 -2
- 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 +3 -2
- 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 +13 -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.d.ts.map +1 -1
- package/dist/plugins/resource/services/find.js +1 -1
- package/dist/plugins/resource/services/update-relation.d.ts +14 -0
- package/dist/plugins/resource/services/update-relation.d.ts.map +1 -0
- package/dist/plugins/resource/services/update-relation.js +1 -0
- package/dist/plugins/resource/services/update.d.ts +9 -2
- 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.d.ts +4 -0
- package/dist/plugins/resource/utils/auto-index.d.ts.map +1 -0
- package/dist/plugins/resource/utils/auto-index.js +1 -0
- package/dist/plugins/resource/utils/fields.d.ts +8 -1
- package/dist/plugins/resource/utils/fields.d.ts.map +1 -1
- package/dist/plugins/resource/utils/fields.js +1 -1
- package/dist/plugins/resource/utils/filters.d.ts +3 -2
- package/dist/plugins/resource/utils/filters.d.ts.map +1 -1
- package/dist/plugins/resource/utils/filters.js +1 -1
- package/dist/plugins/resource/utils/permissions.d.ts.map +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.d.ts +1 -1
- package/dist/plugins/resource/utils/sql.d.ts.map +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 +27 -21
- package/migrations/20260903130000_move_notes_files_to_admin.sql +17 -17
- package/migrations/20260903130001_add_file_fields.sql +5 -0
- package/migrations/20260903140000_settings_nulls_not_distinct.sql +18 -18
- package/migrations/20260905120000_add_user_foreign_keys.sql +43 -0
- package/migrations/20260907090000_core_schema.sql +32 -0
- package/package.json +93 -88
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-permissions.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/get-user-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,GACnC,OAAO,CAAC,MAAM,EAAE,CAAC,CAenB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export async function getUserPermissions(n,k){const Z=await k['pg']['query']('\x0a\x20\x20\x20\x20\x20\x20SELECT\x20DISTINCT\x20ra.resource\x20||\x20\x27:\x27\x20||\x20action\x20AS\x20permission\x0a\x20\x20\x20\x20\x20\x20FROM\x20admin.role_access\x20ra\x0a\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20admin.user_roles\x20ur\x20ON\x20ur.role_id\x20=\x20ra.role_id\x0a\x20\x20\x20\x20\x20\x20CROSS\x20JOIN\x20LATERAL\x20unnest(COALESCE(ra.actions,\x20\x27{}\x27::text[]))\x20AS\x20action\x0a\x20\x20\x20\x20\x20\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20',[n]);return Z['rows']['map'](K=>K['permission']);}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from "./auth.types.js";
|
|
2
2
|
import { type FastifyInstance } from "fastify";
|
|
3
3
|
import { type ContextDependencies } from "../../context.js";
|
|
4
|
+
export * from "./verifyUser.js";
|
|
5
|
+
export * from "./get-user-permissions.js";
|
|
6
|
+
export declare function hashPassword(password: string): Promise<string>;
|
|
7
|
+
export declare function verifyPassword(password: string, stored: string): Promise<boolean>;
|
|
4
8
|
export declare function createSessionStore(app: FastifyInstance, ctx: ContextDependencies): Promise<void>;
|
|
5
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAUhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAI5D,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAE1C,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpE;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAalB;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,mBAAmB,iBA6CzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export*from'./auth.types.js';import{randomBytes,scrypt as n,timingSafeEqual}from'node:crypto';function r(n,k){n=n-0x1af;const Z=g();let K=Z[n];return K;}import{promisify}from'node:util';const scrypt=promisify(n);import k from'@fastify/cookie';import Z from'@fastify/session';import{Authenticator}from'@fastify/passport';import K from'fastify-session-redis-store';function g(){const O=['toString','from','hex','length','warn','test','auth','cookieOptions','registerUserDeserializer'];g=function(){return O;};return g();}import{getUserPermissions}from'./get-user-permissions.js';const fastifyPassport=new Authenticator();export*from'./verifyUser.js';export*from'./get-user-permissions.js';export async function hashPassword(d){const H=r,J=randomBytes(0x10),B=await scrypt(d,J,0x40);return'scrypt$'+J['toString']('hex')+'$'+B[H(0x1af)]('hex');}export async function verifyPassword(d,J){const A=r,[B,l,f]=J?.['split']('$')||[];if(B!=='scrypt'||!l||!f)return![];const R=Buffer[A(0x1b0)](l,'hex'),Q=Buffer['from'](f,A(0x1b1)),a=await scrypt(d,R,Q[A(0x1b2)]);return timingSafeEqual(a,Q);}export async function createSessionStore(d,J){const I=r,{config:B,redis:l}=J;if(!B||!l){console[I(0x1b3)]('Missing\x20config\x20or\x20redis\x20-\x20skipping\x20session\x20store\x20creation');return;}if(process.env.NODE_ENV===I(0x1b4)||process.env.VITEST)return;await d['register'](k,{'parseOptions':B[I(0x1b5)]['cookieOptions']}),await d['register'](Z,{'secret':B['auth']['secret'],'cookieName':B['auth']['cookieName'],'cookie':B['auth'][I(0x1b6)],'store':new K({'prefix':B['auth']['cookieName']+':'+(B['pg']?.['database']||'db')+':','client':l})}),await d['register'](fastifyPassport['initialize']()),await d['register'](fastifyPassport['secureSession']()),fastifyPassport['registerUserSerializer'](async f=>({'user':f})),fastifyPassport[I(0x1b7)](async f=>{const R=f?.['user']||f;return R?.['id']&&(R['permissions']=await getUserPermissions(R['id'],J)),R;});}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContextDependencies } from "../../context.js";
|
|
2
|
+
type params = {
|
|
3
|
+
user: string;
|
|
4
|
+
password: string;
|
|
5
|
+
ip?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function verifyUser({ user, password, ip, }: params, { pg, logger }: Pick<ContextDependencies, "pg" | "logger">): Promise<import("./auth.types.js").AuthUser>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=verifyUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyUser.d.ts","sourceRoot":"","sources":["../../../src/plugins/auth/verifyUser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAQ,MAAM,kBAAkB,CAAC;AAI7D,KAAK,MAAM,GAAG;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,wBAAsB,UAAU,CAC9B,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,MAAM,EAC/B,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,QAAQ,CAAC,+CAgC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function g(){const a=['not\x20enough\x20params:\x20password','then','auth/warn'];g=function(){return a;};return g();}function r(n,k){n=n-0x1b9;const Z=g();let K=Z[n];return K;}import{BadRequestError}from'../../errors.js';import{verifyPassword}from'./index.js';export async function verifyUser({user:n,password:k,ip:Z},{pg:K,logger:d}){const Q=r;if(!n||n==='')throw new BadRequestError('not\x20enough\x20params:\x20user');if(!k||k==='')throw new BadRequestError(Q(0x1b9));d['metrics']('user.login');const J='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',B=await K['query'](J,[n])[Q(0x1ba)](f=>f['rows']?.[0x0]);if(!B){const f='user\x20not\x20found';d['info']({'file':'auth/warn','error':f,'user':n,'ip':Z});throw new BadRequestError(f);}const l=await verifyPassword(k,B['password_hash']);if(!l){const R='Wrong\x20password';d['info']({'file':Q(0x1bb),'error':R,'user':n,'ip':Z});throw new BadRequestError(R);}return delete B['password_hash'],B;}
|
|
@@ -9,13 +9,16 @@ export interface DictionaryItem {
|
|
|
9
9
|
export interface DictionaryDefinition {
|
|
10
10
|
code: string;
|
|
11
11
|
name?: string;
|
|
12
|
+
checked?: boolean;
|
|
12
13
|
items: DictionaryItem[];
|
|
13
14
|
}
|
|
14
15
|
export interface DictionaryPlugin {
|
|
15
16
|
register(input: DictionaryDefinition | DictionaryDefinition[]): void;
|
|
17
|
+
has(name: string): boolean;
|
|
16
18
|
get(name: string): Promise<DictionaryItem[]>;
|
|
17
19
|
put(name: string, items: DictionaryItem[]): Promise<void>;
|
|
18
20
|
clear(name: string): boolean;
|
|
21
|
+
revision(name: string): number;
|
|
19
22
|
list(): Promise<Array<{
|
|
20
23
|
code: string;
|
|
21
24
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../src/plugins/dictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAA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parseInt(_0x4aafb5(0xf1))/0x5)+parseInt(_0x4aafb5(0xbf))/0x6+parseInt(_0x4aafb5(0xa4))/0x7*(-parseInt(_0x4aafb5(0xae))/0x8)+-parseInt(_0x4aafb5(0x98))/0x9+-parseInt(_0x4aafb5(0xbc))/0xa;if(_0x171993===_0x4f5c70)break;else _0x5d96a4['push'](_0x5d96a4['shift']());}catch(_0x5004b0){_0x5d96a4['push'](_0x5d96a4['shift']());}}}(_0x456c,0x3466f));import{ConflictError,NotFoundError,ValidationError}from'../errors.js';function _0x2b12(_0x411fcb,_0x180a22){_0x411fcb=_0x411fcb-0x95;const _0x456c22=_0x456c();let _0x2b124c=_0x456c22[_0x411fcb];return _0x2b124c;}const dictionaryName=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;export function createDictionary({pg:_0x26f9ee,dictionaries:dictionaries=[]}){const _0xa7ad=_0x2b12,_0x38b327={'LVcQF':_0xa7ad(0xd1),'FHVau':function(_0x587053,_0x3b48dc){return _0x587053===_0x3b48dc;},'gSgrK':_0xa7ad(0xbe),'LWBwc':_0xa7ad(0x9b),'AMdvF':function(_0xbd8c87,_0x4e24d9){return _0xbd8c87!==_0x4e24d9;},'vrhXB':_0xa7ad(0xaf),'QaeWl':_0xa7ad(0xa9),'tNknE':_0xa7ad(0xb2),'HMPUn':function(_0xfa3441,_0x290619){return _0xfa3441===_0x290619;},'bBzNZ':_0xa7ad(0xf8),'cYUYd':function(_0x2d7543,_0x55e89b){return _0x2d7543(_0x55e89b);},'HNrpK':_0xa7ad(0xc6),'PkXiV':_0xa7ad(0xe6),'jSsoh':function(_0x25de73,_0x3b3cee){return _0x25de73!==_0x3b3cee;},'dSySn':_0xa7ad(0xa6),'DgIjr':function(_0x34bc86,_0x554346){return _0x34bc86===_0x554346;},'tNTII':_0xa7ad(0xf0),'cNieM':_0xa7ad(0xfa),'poGQn':_0xa7ad(0xad),'SIQCP':_0xa7ad(0xd0),'xHySM':function(_0x101048,_0x586c5d){return _0x101048(_0x586c5d);},'ZkcIk':function(_0x2eb6a4){return _0x2eb6a4();},'jTcaO':_0xa7ad(0xcd),'RGRDe':_0xa7ad(0xd9),'yYAsV':_0xa7ad(0xc4),'xTWrR':_0xa7ad(0xb3),'CCXIL':_0xa7ad(0xf7),'jqNaM':_0xa7ad(0xcb),'LIiBV':function(_0x302f12,_0x5ad819){return _0x302f12===_0x5ad819;},'iyhqx':_0xa7ad(0xe7),'qMkfo':function(_0x73d04c,_0x4a1373){return _0x73d04c!==_0x4a1373;},'oueKO':_0xa7ad(0xcc)},_0x573e07=new Map();let _0x362dbb,_0x3d25ad;async function _0x55215d(){const _0x29d5a8=_0xa7ad;if(_0x38b327[_0x29d5a8(0xaa)](_0x38b327[_0x29d5a8(0xe5)],_0x38b327[_0x29d5a8(0xc9)]))!_0x2f8363[_0x29d5a8(0x9c)](_0x44dbb0[_0x29d5a8(0xd3)])&&_0x42c426[_0x29d5a8(0xa8)](_0x34c303);else{if(_0x38b327[_0x29d5a8(0xf3)](_0x362dbb,undefined)){if(_0x38b327[_0x29d5a8(0xaa)](_0x38b327[_0x29d5a8(0xb8)],_0x29d5a8(0xeb)))_0xe7a648[_0x29d5a8(0xa8)](_0x4c7e55);else return _0x362dbb;}if(!_0x26f9ee){if(_0x38b327[_0x29d5a8(0xf3)](_0x38b327[_0x29d5a8(0xef)],_0x29d5a8(0xc8)))throw new Error(_0x38b327[_0x29d5a8(0xca)]);else throw new _0x4a4b06(_0x29d5a8(0xbb)+_0x5bf2f7);}return _0x3d25ad??=_0x26f9ee[_0x29d5a8(0xec)](_0x29d5a8(0xcf))[_0x29d5a8(0xdb)](_0x53d3a7=>{const _0x748fa7=_0x29d5a8,_0x196dee={};_0x196dee[_0x748fa7(0xdf)]=_0x748fa7(0xcb);const _0x491ace=_0x196dee;if(_0x748fa7(0xd1)!==_0x38b327[_0x748fa7(0xfe)])throw new _0x286287(_0x491ace[_0x748fa7(0xdf)]);else{const _0x1b6006=_0x53d3a7[_0x748fa7(0xc1)][0x0]?.[_0x748fa7(0xfb)];_0x362dbb=_0x1b6006===_0x748fa7(0xa3)?_0x1b6006:null;}}),await _0x3d25ad,_0x362dbb;}}function _0x1a5741(_0x48175c){const _0x4a0e2a=_0xa7ad,_0x3ac581={'Dnmmb':function(_0x5e15f1,_0x48bf23){const _0x4c5db7=_0x2b12;return _0x38b327[_0x4c5db7(0xfd)](_0x5e15f1,_0x48bf23);},'UdTqY':_0x4a0e2a(0xa3)};if(_0x38b327[_0x4a0e2a(0xfd)](_0x38b327[_0x4a0e2a(0xb7)],_0x38b327[_0x4a0e2a(0xb7)])){if(!dictionaryName[_0x4a0e2a(0xb1)](_0x48175c))throw new ValidationError(_0x4a0e2a(0xbb)+_0x48175c);}else{const _0x5789c8=_0x4c1ec2[_0x4a0e2a(0xc1)][0x0]?.[_0x4a0e2a(0xfb)];_0x5dc1ff=DbrMUP[_0x4a0e2a(0xab)](_0x5789c8,DbrMUP[_0x4a0e2a(0x97)])?_0x5789c8:null;}}function _0x3a9c2b(_0x7cb0ba){const _0x4b4071=_0xa7ad;for(const _0x15ee22 of Array[_0x4b4071(0xd2)](_0x7cb0ba)?_0x7cb0ba:[_0x7cb0ba]){_0x38b327[_0x4b4071(0x95)](_0x1a5741,_0x15ee22[_0x4b4071(0xd3)]);if(!Array[_0x4b4071(0xd2)](_0x15ee22[_0x4b4071(0xde)])){if(_0x38b327[_0x4b4071(0xc3)]!==_0x38b327[_0x4b4071(0xc3)]){_0x38b327[_0x4b4071(0x95)](_0x53e851,_0xc3adea[_0x4b4071(0xd3)]);if(!_0x174a20[_0x4b4071(0xd2)](_0xae283f[_0x4b4071(0xde)]))throw new _0x4054f8(_0x4b4071(0xa5)+_0x5e34ad[_0x4b4071(0xd3)]);if(_0x4d92e1[_0x4b4071(0x9c)](_0xba38d3[_0x4b4071(0xd3)]))throw new _0x37228b(_0x4b4071(0xce)+_0x424f0a[_0x4b4071(0xd3)]);const _0xae414d={..._0x38d240};_0xae414d[_0x4b4071(0xee)]=_0x4b4071(0xe6),_0x5e0c3c[_0x4b4071(0x99)](_0x37c96c[_0x4b4071(0xd3)],_0xae414d);}else throw new ValidationError(_0x4b4071(0xa5)+_0x15ee22[_0x4b4071(0xd3)]);}if(_0x573e07[_0x4b4071(0x9c)](_0x15ee22[_0x4b4071(0xd3)]))throw new ConflictError(_0x4b4071(0xce)+_0x15ee22[_0x4b4071(0xd3)]);_0x573e07[_0x4b4071(0x99)](_0x15ee22[_0x4b4071(0xd3)],{..._0x15ee22,'source':_0x38b327[_0x4b4071(0x9a)]});}}async function _0x4424e3(_0x51fcd6){const _0x4a19ee=_0xa7ad;if(_0x38b327[_0x4a19ee(0xd7)](_0x4a19ee(0xf6),_0x38b327[_0x4a19ee(0xda)])){_0x1a5741(_0x51fcd6);const _0xb2c661=_0x573e07[_0x4a19ee(0xa0)](_0x51fcd6);if(_0xb2c661){if(_0x38b327[_0x4a19ee(0xb6)](_0x38b327[_0x4a19ee(0xb0)],_0x38b327[_0x4a19ee(0xb0)]))return _0xb2c661[_0x4a19ee(0xde)];else _0x12b3f9[_0x4a19ee(0x9e)]();}const _0x13ac1e=await _0x55215d();if(!_0x13ac1e){if(_0x38b327[_0x4a19ee(0xaa)](_0x38b327[_0x4a19ee(0xe3)],_0x38b327[_0x4a19ee(0xe3)]))throw new NotFoundError(_0x4a19ee(0xcb));else return _0xbd4676;}if(!_0x26f9ee)throw new Error(_0x4a19ee(0xb2));const _0x5e24a5=await _0x26f9ee[_0x4a19ee(0xec)](_0x4a19ee(0xe8),[_0x51fcd6]);if(!_0x5e24a5[_0x4a19ee(0xc1)][_0x4a19ee(0xd4)]){if(_0x38b327[_0x4a19ee(0xff)]!==_0x38b327[_0x4a19ee(0xff)])throw new _0x15074b(_0x4a19ee(0x9f)+_0x4c7895);else throw new NotFoundError(_0x4a19ee(0x9f)+_0x51fcd6);}const _0x16df44=_0x5e24a5[_0x4a19ee(0xc1)];return _0x573e07[_0x4a19ee(0x99)](_0x51fcd6,{'code':_0x51fcd6,'name':_0x51fcd6,'items':_0x16df44,'source':_0x38b327[_0x4a19ee(0xea)]}),_0x16df44;}else throw new _0x445ae7(_0x4a19ee(0xce)+_0x1597e1[_0x4a19ee(0xd3)]);}async function _0x139724(_0x18f43a,_0x918f30){const _0x352ca9=_0xa7ad;_0x38b327[_0x352ca9(0xbd)](_0x1a5741,_0x18f43a);if(!Array[_0x352ca9(0xd2)](_0x918f30))throw new ValidationError(_0x352ca9(0xb4));const _0x2c6625=await _0x38b327[_0x352ca9(0xf5)](_0x55215d);if(!_0x2c6625)throw new NotFoundError(_0x352ca9(0xcb));if(!_0x26f9ee){if(_0x38b327[_0x352ca9(0xb6)](_0x352ca9(0xcd),_0x38b327[_0x352ca9(0xac)]))throw new Error(_0x38b327[_0x352ca9(0xca)]);else throw new _0x4e8e6f(_0x352ca9(0xa5)+_0x4e8956[_0x352ca9(0xd3)]);}const _0x19eabd=await _0x26f9ee[_0x352ca9(0xb9)]();try{await _0x19eabd[_0x352ca9(0xec)](_0x352ca9(0xc7));const _0x3bfd4b=await _0x19eabd[_0x352ca9(0xec)](_0x352ca9(0xf2),[_0x18f43a,_0x18f43a,_0x38b327[_0x352ca9(0xdc)],_0x38b327[_0x352ca9(0xa7)],!![]]),_0x6fe042=_0x3bfd4b[_0x352ca9(0xc1)][0x0]['id'];await _0x19eabd[_0x352ca9(0xec)](_0x38b327[_0x352ca9(0xd5)],[_0x6fe042]);for(const _0x4638f6 of _0x918f30){await _0x19eabd[_0x352ca9(0xec)](_0x352ca9(0xc2),[_0x6fe042,_0x4638f6[_0x352ca9(0xd3)],_0x4638f6[_0x352ca9(0x96)],_0x4638f6[_0x352ca9(0xfc)]??null]);}await _0x19eabd[_0x352ca9(0xec)](_0x38b327[_0x352ca9(0x100)]);}catch(_0x2e7a49){await _0x19eabd[_0x352ca9(0xec)](_0x352ca9(0xc5));throw _0x2e7a49;}finally{_0x19eabd[_0x352ca9(0x9e)]();}_0x38b327[_0x352ca9(0xbd)](_0x39affa,_0x18f43a);}function _0x39affa(_0xedf36){const _0x152fa3=_0xa7ad;return _0x38b327[_0x152fa3(0x95)](_0x1a5741,_0xedf36),_0x573e07[_0x152fa3(0xf4)](_0xedf36);}async function _0x263fe7(){const _0xd1b47c=_0xa7ad,_0x48bf99=[..._0x573e07[_0xd1b47c(0xe9)]()][_0xd1b47c(0xd6)](({code:_0x37b5ae,name:_0x46c4ff,source:_0x492f28})=>({'code':_0x37b5ae,'name':_0x46c4ff??_0x37b5ae,'source':_0x492f28})),_0x119d68=await _0x55215d();if(!_0x119d68)return _0x48bf99;if(!_0x26f9ee){if(_0x38b327[_0xd1b47c(0xe0)](_0x38b327[_0xd1b47c(0xa1)],_0x38b327[_0xd1b47c(0xa1)]))throw new Error(_0x38b327[_0xd1b47c(0xca)]);else return _0x912d99;}const _0x231b17=await _0x26f9ee[_0xd1b47c(0xec)](_0xd1b47c(0x9d));for(const _0x51ed61 of _0x231b17[_0xd1b47c(0xc1)]){if(!_0x573e07[_0xd1b47c(0x9c)](_0x51ed61[_0xd1b47c(0xd3)])){if(_0x38b327[_0xd1b47c(0xe1)](_0x38b327[_0xd1b47c(0xed)],_0x38b327[_0xd1b47c(0xed)]))throw new _0x227c06(_0x38b327[_0xd1b47c(0xc0)]);else _0x48bf99[_0xd1b47c(0xa8)](_0x51ed61);}}return _0x48bf99;}_0x3a9c2b(dictionaries);const _0x4e3226={};return _0x4e3226[_0xa7ad(0xe2)]=_0x3a9c2b,_0x4e3226[_0xa7ad(0xa0)]=_0x4424e3,_0x4e3226[_0xa7ad(0xa2)]=_0x139724,_0x4e3226[_0xa7ad(0xb5)]=_0x39affa,_0x4e3226[_0xa7ad(0xba)]=_0x263fe7,_0x4e3226;}function _0x456c(){const _0x6b3ff5=['287783TIQRGu','gSgrK','static','ElvyJ','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20di.id,\x20di.code,\x20di.name,\x20di.parent_id\x20AS\x20\x22parentId\x22\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','values','SIQCP','LPJTL','query','oueKO','source','QaeWl','dRHcA','2700XRdMQM','\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','AMdvF','delete','ZkcIk','lZKtx','COMMIT','SHmBj','1053621gOiqIX','jRMOS','table_name','parentId','HMPUn','LVcQF','poGQn','CCXIL','cYUYd','name','UdTqY','1162971qHVHrj','set','PkXiV','ubiOJ','has','\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','release','Dictionary\x20not\x20found:\x20','get','iyhqx','put','dictionaries','529109kCGgId','Invalid\x20dictionary\x20items:\x20','nKYDE','yYAsV','push','kwtTY','FHVau','Dnmmb','jTcaO','cGJuE','24OhrZtX','CvJpD','tNTII','test','empty\x20pg','DELETE\x20FROM\x20admin.dictionary_items\x20WHERE\x20dictionary_id\x20=\x20$1','Dictionary\x20items\x20must\x20be\x20an\x20array','clear','DgIjr','bBzNZ','vrhXB','connect','list','Invalid\x20dictionary\x20name:\x20','3005850vXvMxv','xHySM','BltMq','567084nLHJJl','jqNaM','rows','\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','HNrpK','custom','ROLLBACK','MZmXk','BEGIN','USFcm','LWBwc','tNknE','Dictionary\x20table\x20not\x20found','cqPHB','ehheT','Dictionary\x20already\x20registered:\x20','\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','database','uFrNa','isArray','code','length','xTWrR','map','jSsoh','2mysaDg','fcore','dSySn','then','RGRDe','1020YmuyQd','items','ymplb','LIiBV','qMkfo','register','cNieM'];_0x456c=function(){return _0x6b3ff5;};return _0x456c();}
|
|
1
|
+
function g(){const o=['then','table_name','dictionaries','test','code','set','items','isArray','empty\x20pg','connect','BEGIN','query','name','release'];g=function(){return o;};return g();}function r(n,k){n=n-0x86;const Z=g();let K=Z[n];return K;}import{ConflictError,NotFoundError,ValidationError}from'../errors.js';const dictionaryName=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;export function createDictionary({pg:n,dictionaries:dictionaries=[]}){const k=new Map(),Z=new Map();let K,d;async function J(){const q=r;if(K!==undefined)return K;if(!n)throw new Error('empty\x20pg');return d??=n['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\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')[q(0x86)](I=>{const z=q,O=I['rows'][0x0]?.[z(0x87)];K=O===z(0x88)?O:null;}),await d,K;}function B(I){const j=r;if(!dictionaryName[j(0x89)](I))throw new ValidationError('Invalid\x20dictionary\x20name:\x20'+I);}function l(I){const w=r;for(const O of Array['isArray'](I)?I:[I]){B(O[w(0x8a)]);if(!Array['isArray'](O['items']))throw new ValidationError('Invalid\x20dictionary\x20items:\x20'+O[w(0x8a)]);if(k['has'](O['code']))throw new ConflictError('Dictionary\x20already\x20registered:\x20'+O['code']);k[w(0x8b)](O['code'],{...O,'source':'static'});}}function f(I){return k['has'](I);}async function R(I){const M=r;B(I);const O=k['get'](I);if(O&&O['checked'])return O['items'];const m=await J();if(!m)throw new NotFoundError('Dictionary\x20table\x20not\x20found');const p=await n?.['query']('\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',[I]);if(p?.['rows']?.['length']){const C=p?.['rows'];return k['set'](I,{'code':I,'name':I,'items':C,'source':'database','checked':!![]}),C;}if(!O?.[M(0x8c)])throw new NotFoundError('Dictionary\x20not\x20found:\x20'+I);return O['checked']=!![],O['items'];}async function Q(I,O){const V=r;B(I);if(!Array[V(0x8d)](O))throw new ValidationError('Dictionary\x20items\x20must\x20be\x20an\x20array');const m=await J();if(!m)throw new NotFoundError('Dictionary\x20table\x20not\x20found');if(!n)throw new Error(V(0x8e));const p=await n[V(0x8f)]();try{await p['query'](V(0x90));const C=await p['query']('\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',[I,I,'fcore','custom',!![]]),T=C['rows'][0x0]['id'];await p['query']('DELETE\x20FROM\x20admin.dictionary_items\x20WHERE\x20dictionary_id\x20=\x20$1',[T]);for(const c of O){await p[V(0x91)]('\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',[T,c['code'],c[V(0x92)],c['parentId']??null]);}await p['query']('COMMIT');}catch(b){await p[V(0x91)]('ROLLBACK');throw b;}finally{p[V(0x93)]();}k['set'](I,{'items':O,'code':I,'source':'static','checked':!![]}),Z[V(0x8b)](I,(Z['get'](I)??0x0)+0x1);}function a(I){const x=r;return B(I),Z[x(0x8b)](I,(Z['get'](I)??0x0)+0x1),k['delete'](I);}function H(I){return Z['get'](I)??0x0;}async function A(){const X=r,I=[...k['values']()]['map'](({code:p,name:C,source:T})=>({'code':p,'name':C??p,'source':T})),O=await J();if(!O)return I;if(!n)throw new Error('empty\x20pg');const m=await n['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 p of m['rows']){!k['has'](p[X(0x8a)])&&I['push'](p);}return I;}return l(dictionaries),{'register':l,'get':R,'put':Q,'clear':a,'revision':H,'list':A,'has':f};}
|
package/dist/plugins/file.d.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Implements the S3-compatible file storage adapter and its contracts.
|
|
3
3
|
*/
|
|
4
|
+
import type { Readable } from "node:stream";
|
|
4
5
|
export interface FileAdapter {
|
|
5
|
-
put(path: string,
|
|
6
|
+
put(path: string, body: Buffer | Readable): Promise<void>;
|
|
6
7
|
get(path: string): Promise<Buffer>;
|
|
7
8
|
exists(path: string): Promise<boolean>;
|
|
8
9
|
delete(path: string): Promise<void>;
|
|
9
10
|
create(path: string, ttl?: number): string;
|
|
10
|
-
verify(token: string):
|
|
11
|
-
}
|
|
12
|
-
export interface FileTokenPayload {
|
|
13
|
-
p: string;
|
|
14
|
-
exp: number;
|
|
11
|
+
verify(token: string): string;
|
|
15
12
|
}
|
|
16
13
|
export interface FileS3Config {
|
|
17
14
|
endpoint?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/plugins/file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/plugins/file.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,WAAW;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAKD,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAgCD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAiF9D"}
|
package/dist/plugins/file.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{DeleteObjectCommand,GetObjectCommand,HeadObjectCommand,PutObjectCommand,S3Client}from'@aws-sdk/client-s3';import n from'node:crypto';import{ValidationError}from'../errors.js';import{UnauthorizedError}from'../errors.js';function r(n,k){n=n-0x11c;const Z=g();let K=Z[n];return K;}function keyFor(k,Z){const a=r;if(!Z||Z[a(0x11c)]('/')||Z['includes']('..'))throw new ValidationError('Invalid\x20file\x20path');const K=Z[a(0x11d)](/\\/g,'/')['replace'](/^\/+/,''),d=(k??'')[a(0x11d)](/^\/+|\/+$/g,'');return d?d+'/'+K:K;}function g(){const C=['startsWith','replace','alloc','transformToByteArray','from','toString','hex','region','us-east-1','accessKey','send','bucket','$metadata','httpStatusCode','update','createHmac','digest'];g=function(){return C;};return g();}async function bodyToBuffer(k){const H=r;if(!k)return Buffer[H(0x11e)](0x0);const Z=k;if(typeof Z[H(0x11f)]==='function')return Buffer[H(0x120)](await Z[H(0x11f)]());const K=[];for await(const d of k){K['push'](Buffer['from'](d));}return Buffer['concat'](K);}export function createFileS3(k){const A=r,Z=k['tokenSecret']??process.env.FILE_TOKEN_SECRET??n['randomBytes'](0x20)[A(0x121)](A(0x122)),K=new S3Client({'endpoint':k['endpoint'],'region':k[A(0x123)]??A(0x124),'forcePathStyle':k['forcePathStyle']??!![],'credentials':k['accessKeyId']||k[A(0x125)]?{'accessKeyId':k['accessKeyId']??k['accessKey'],'secretAccessKey':k['secretAccessKey']??k['secretKey']}:undefined}),d=J=>keyFor(k['folder'],J);return{async 'put'(J,B){await K['send'](new PutObjectCommand({'Bucket':k['bucket'],'Key':d(J),'Body':B}));},async 'get'(J){const I=A,B=await K[I(0x126)](new GetObjectCommand({'Bucket':k['bucket'],'Key':d(J)}));return bodyToBuffer(B['Body']);},async 'exists'(J){const O=A;try{return await K[O(0x126)](new HeadObjectCommand({'Bucket':k[O(0x127)],'Key':d(J)})),!![];}catch(B){const l=B;if(l[O(0x128)]?.[O(0x129)]===0x194||l['name']==='NotFound')return![];throw B;}},async 'delete'(J){await K['send'](new DeleteObjectCommand({'Bucket':k['bucket'],'Key':d(J)}));},'create'(J,B=k['tokenTtl']??0xe10){const m=A,l=Buffer[m(0x120)](J)[m(0x121)]('base64url'),f=n['createHmac']('sha256',Z)[m(0x12a)](l)['digest']('base64url');return l+'.'+f;},'verify'(J){const p=A,[B,l]=J['split']('.');if(!B||!l)throw new UnauthorizedError('Invalid\x20file\x20token');const f=n[p(0x12b)]('sha256',Z)['update'](B)[p(0x12c)](),R=Buffer[p(0x120)](l,'base64url');if(f['length']!==R['length']||!n['timingSafeEqual'](f,R))throw new UnauthorizedError('Invalid\x20file\x20token');const Q=Buffer['from'](B,'base64url')['toString']('utf8');return Q;}};}
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
export * from "./logger/index.js";
|
|
5
5
|
export * from "./redis.js";
|
|
6
6
|
export * from "./pg.js";
|
|
7
|
+
export * from "./auth/index.js";
|
|
7
8
|
export * from "./file.js";
|
|
8
9
|
export * from "./dictionary.js";
|
|
9
10
|
export * from "./audit/index.js";
|
|
10
11
|
export * from "./resource/index.js";
|
|
12
|
+
export * from './jwt.js';
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,UAAU,CAAC"}
|
package/dist/plugins/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export*from'./logger/index.js';export*from'./redis.js';export*from'./pg.js';export*from'./auth/index.js';export*from'./file.js';export*from'./dictionary.js';export*from'./audit/index.js';export*from'./resource/index.js';export*from'./jwt.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../src/plugins/jwt.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAIhD,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,+BAY/D;AACD,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,qBAKjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function g(){const B=['sign'];g=function(){return B;};return g();}import{SignJWT,jwtVerify}from'jose';function r(n,k){n=n-0x123;const Z=g();let K=Z[n];return K;}const secret=new TextEncoder()['encode'](process.env.AUTH_JWT_SECRET);export async function jwtSignToken(n){const J=r;if(!process.env.AUTH_JWT_SECRET)return;const {id:k,type:Z,permissions:K}=n,d=await new SignJWT({'id':k,'type':Z,'permissions':K})['setProtectedHeader']({'alg':'HS256'})['setIssuedAt']()['setExpirationTime']('1h')[J(0x123)](secret);return d;}export async function jwtVerifyToken(n){const k=await jwtVerify(n,secret,{'algorithms':['HS256']})['catch'](Z=>{console['log'](Z['message']);});return k?.['payload'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import n from'pino';export function createLogger(){const l=r,k=n['transport']({'target':'./transport.js'}),Z=n({'level':l(0x10d),'timestamp':n[l(0x10e)]['isoTime'],'base':{'service':'app'},'redact':{'paths':[l(0x10f),'password',l(0x110),'accessToken','refreshToken'],'censor':'[REDACTED]'}},k),K={};function d(J,B){if(J===undefined)return{...K};K[J]=(K[J]??0x0)+(B??0x1);}return Object['assign'](Z,{'close':async()=>k['end'](),'metrics':d,'file':()=>Z[l(0x10d)]['bind'](Z)});}function r(n,k){n=n-0x10d;const Z=g();let K=Z[n];return K;}function g(){const f=['info','stdTimeFunctions','req.headers.authorization','token'];g=function(){return f;};return g();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function r(n,k){n=n-0x103;const Z=g();let K=Z[n];return K;}const l=r;import n from'node:fs';import k from'node:path';import Z from'pino-abstract-transport';const LEVELS={0x1e:'info',0x28:'warn',0x32:'error',0x3c:l(0x103)},streams=new Map();function getDate(){const f=l;return new Date()[f(0x104)]()['slice'](0x0,0xa);}function createStream(K,d){const R=l,J=k['resolve']('logs',K);return n['mkdirSync'](J,{'recursive':!![]}),n['createWriteStream'](k[R(0x105)](J,d+'.log'),{'flags':'a'});}function getStream(K){const Q=l,d=getDate(),J=streams['get'](K);if(J&&J[Q(0x106)]===d)return J[Q(0x107)];J?.[Q(0x107)][Q(0x108)]();const B=createStream(K,d);return streams['set'](K,{'date':d,'stream':B}),B;}function closeStreams(){for(const {stream:K}of streams['values']()){K['end']();}streams['clear']();}export default async function loggerTransport(){return Z(writeLogs,{'close':async()=>{closeStreams();}});}function g(){const a=['error','toISOString','join','date','stream','end'];g=function(){return a;};return g();}async function writeLogs(K){for await(const d of K){const J=LEVELS[d['level']];if(!J)continue;const B=getStream(d['file']||J);delete d['file'],B['write'](JSON['stringify'](d)+'\x0a');}}
|
package/dist/plugins/pg.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface DatabaseConfig {
|
|
|
10
10
|
password: string;
|
|
11
11
|
max?: number;
|
|
12
12
|
}
|
|
13
|
-
export declare function createDatabase(config: DatabaseConfig):
|
|
14
|
-
export type DatabaseAdapter = pg.Pool
|
|
13
|
+
export declare function createDatabase(config: DatabaseConfig): DatabaseAdapter;
|
|
14
|
+
export type DatabaseAdapter = pg.Pool & {
|
|
15
|
+
transaction: <T>(callback: (client: pg.PoolClient) => Promise<T>) => Promise<T>;
|
|
16
|
+
};
|
|
15
17
|
//# sourceMappingURL=pg.d.ts.map
|
package/dist/plugins/pg.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg.d.ts","sourceRoot":"","sources":["../../src/plugins/pg.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,wBAAgB,cAAc,
|
|
1
|
+
{"version":3,"file":"pg.d.ts","sourceRoot":"","sources":["../../src/plugins/pg.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,wBAAgB,cAAc,CAC1B,MAAM,EAAE,cAAc,mBAiDzB;AACD,MAAM,MAAM,eAAe,GAAG,EAAE,CAAC,IAAI,GAAG;IACpC,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CACnF,CAAC"}
|
package/dist/plugins/pg.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function g(){const A=['bind','transaction','query','COMMIT'];g=function(){return A;};return g();}function r(n,k){n=n-0x13c;const Z=g();let K=Z[n];return K;}import n from'pg';const {Pool}=n;export function createDatabase(k){const a=r,Z=new Pool(k),K=Z['query'][a(0x13c)](Z);function d(J,B){const l=new Error();return Error['captureStackTrace']?.(l,d),K(J,B)['catch'](f=>{const R=f;R['sql']=J,R['callerStack']=l['stack'];throw R;});}return Z['query']=d,Z['transaction']=async function(J){const H=a,B=new Error();Error['captureStackTrace']?.(B,Z[H(0x13d)]);const l=await Z['connect']();try{await l['query']('BEGIN');const f=await J(l);return await l[H(0x13e)](H(0x13f)),f;}catch(R){await l[H(0x13e)]('ROLLBACK');const Q=R;Q['callerStack']=B['stack'];throw Q;}finally{l['release']();}},Z;}
|
package/dist/plugins/redis.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function r(n,k){n=n-0x128;const Z=g();let K=Z[n];return K;}function g(){const f=['get','set'];g=function(){return f;};return g();}import{Redis}from'ioredis';export function createRedis(n){const B=r,k=new Redis(n);return{'get':Z=>k[B(0x128)](Z),'set':(Z,K,d,J)=>{const l=B;if(J)return k[l(0x129)](Z,K,'EX',J);if(typeof d==='number')return k['set'](Z,K,'EX',d);return k[l(0x129)](Z,K);},'del':Z=>k['del'](Z),'delete':Z=>k['del'](Z),'close':()=>k['quit'](),'ping':()=>k['ping'](),'hincrby':(Z,K,d)=>k['hincrby'](Z,K,d),'incrby':(Z,K)=>k['incrby'](Z,K)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export*from'./resource.types.js';export*from'./resource.registry.js';export*from'./resource.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/plugins/resource/resource.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/plugins/resource/resource.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAUhF,wBAAgB,cAAc,CAAC,IAAI,EAAE,oBAAoB,GAAG,cAAc,CA2BzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{ResourceRegistry}from'./resource.registry.js';import{createFind}from'./services/find.js';function r(n,k){n=n-0x11d;const Z=g();let K=Z[n];return K;}import{createFindOne}from'./services/find-one.js';function g(){const H=['register','bind','list'];g=function(){return H;};return g();}import{createCreate}from'./services/create.js';import{createUpdate}from'./services/update.js';import{createRemove}from'./services/delete.js';import{createFindRelation}from'./services/find-relation.js';import{createCreateRelation}from'./services/create-relation.js';import{createDeleteRelation}from'./services/delete-relation.js';import{createUpdateRelation}from'./services/update-relation.js';export function createResource(n){const a=r,k=new ResourceRegistry(),Z=createFind(n,k),K=createFindOne(n,k),d=createCreate(n,k),J=createUpdate(n,k),B=createRemove(n,k),l=createFindRelation(n,k),f=createCreateRelation(n,k),R=createUpdateRelation(n,k),Q=createDeleteRelation(n,k);return{'register':k[a(0x11d)]['bind'](k),'has':k['has'][a(0x11e)](k),'get':k['get']['bind'](k),'list':k[a(0x11f)][a(0x11e)](k),'find':Z,'findOne':K,'create':d,'update':J,'delete':B,'findRelation':l,'createRelation':f,'updateRelation':R,'deleteRelation':Q};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d=r;import{ValidationError,ConflictError,NotFoundError}from'../../errors.js';const ident=/^[a-zA-Z0-9_-]*$/;function r(n,k){n=n-0x123;const Z=g();let K=Z[n];return K;}function validQualified(n){const K=r;return n[K(0x123)]('.')['length']<=0x2&&n['split']('.')['every'](k=>ident['test'](k));}export class ResourceRegistry{[d(0x124)]=new Map();[d(0x125)](n){const J=d;for(const k of Array['isArray'](n)?n:[n]){this['validate'](k);if(this[J(0x124)][J(0x126)](k['name']))throw new ConflictError(J(0x127)+k['name']);this['resources']['set'](k[J(0x128)],k);}}['has'](n){return this['resources']['has'](n);}['get'](n){const B=d,k=this['resources'][B(0x129)](n);if(!k)throw new NotFoundError('Resource\x20not\x20registered:\x20'+n);return k;}['list'](){const l=d;return[...this['resources'][l(0x12a)]()];}[d(0x12b)](n){const f=d;if(n[f(0x12c)]!==0x1||!ident[f(0x12d)](n[f(0x128)])||!validQualified(n['table'])||!ident[f(0x12d)](n[f(0x12e)]))throw new ValidationError('Invalid\x20resource\x20contract:\x20'+n['name']);for(const [k,Z]of Object['entries'](n[f(0x12f)])){if(!ident[f(0x12d)](k)||!ident[f(0x12d)](Z[f(0x130)]??k))throw new ValidationError('Invalid\x20resource\x20field:\x20'+k);}}}function g(){const R=['split','resources','register','has','Resource\x20already\x20registered:\x20','name','get','values','validate','version','test','key','fields','column'];g=function(){return R;};return g();}
|
|
@@ -4,11 +4,18 @@
|
|
|
4
4
|
import type { DatabaseAdapter } from "../pg.js";
|
|
5
5
|
import type { AppLogger } from "../logger/index.js";
|
|
6
6
|
import type { AuditPlugin } from "../audit/index.js";
|
|
7
|
+
import type { DictionaryPlugin } from "../dictionary.js";
|
|
8
|
+
import type { FileAdapter } from "../file.js";
|
|
7
9
|
import { User } from "../../context.js";
|
|
10
|
+
import type { AppContext } from "../../context.js";
|
|
8
11
|
export type ResourceOperation = "read" | "create" | "update" | "delete";
|
|
12
|
+
export interface ResourceJoinContract {
|
|
13
|
+
scope?: "all" | "item";
|
|
14
|
+
sql: string;
|
|
15
|
+
}
|
|
9
16
|
export interface ResourceFieldContract {
|
|
10
17
|
column?: string;
|
|
11
|
-
type?: "string" | "number" | "integer" | "boolean" | "date" | "json" | "text" | "timestamp" | "uuid";
|
|
18
|
+
type?: "string" | "number" | "integer" | "boolean" | "date" | "json" | "text" | "timestamp" | "uuid" | "file" | "geometry" | "geom";
|
|
12
19
|
read?: boolean;
|
|
13
20
|
write?: boolean;
|
|
14
21
|
readable?: boolean;
|
|
@@ -19,39 +26,54 @@ export interface ResourceFieldContract {
|
|
|
19
26
|
searchable?: boolean;
|
|
20
27
|
sortable?: boolean;
|
|
21
28
|
filter?: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
scope?: "all" | "item";
|
|
30
|
+
dictionary?: string;
|
|
24
31
|
lookup?: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
table: string;
|
|
33
|
+
value: string;
|
|
34
|
+
text: string;
|
|
35
|
+
fields?: string[];
|
|
29
36
|
};
|
|
37
|
+
enum?: string[] | number[];
|
|
38
|
+
minLength?: number;
|
|
39
|
+
maxLength?: number;
|
|
40
|
+
minimum?: number;
|
|
41
|
+
maximum?: number;
|
|
42
|
+
pattern?: string;
|
|
30
43
|
}
|
|
31
44
|
export interface ResourceRelationContract {
|
|
32
45
|
resource?: string;
|
|
33
46
|
table?: string;
|
|
34
|
-
|
|
47
|
+
where?: string;
|
|
48
|
+
localKey?: string;
|
|
35
49
|
foreignKey?: string;
|
|
36
|
-
|
|
50
|
+
targetKey?: string;
|
|
51
|
+
fields?: string[];
|
|
52
|
+
junctionTable?: string;
|
|
53
|
+
junctionLocalKey?: string;
|
|
54
|
+
junctionForeignKey?: string;
|
|
55
|
+
junctionTargetKey?: string;
|
|
37
56
|
}
|
|
38
57
|
export interface ResourceContract {
|
|
39
58
|
version: 1;
|
|
40
59
|
name: string;
|
|
41
|
-
module
|
|
60
|
+
module?: string;
|
|
42
61
|
title?: string;
|
|
43
62
|
table: string;
|
|
63
|
+
where?: string;
|
|
44
64
|
key: string;
|
|
45
65
|
operations: ResourceOperation[];
|
|
66
|
+
searchable?: string[];
|
|
46
67
|
capabilities?: string[];
|
|
47
68
|
permission?: string;
|
|
48
69
|
fields: Record<string, ResourceFieldContract>;
|
|
49
70
|
relations?: Record<string, ResourceRelationContract>;
|
|
50
|
-
|
|
71
|
+
joins?: ResourceJoinContract[];
|
|
51
72
|
access?: "public" | "user" | "admin";
|
|
52
73
|
}
|
|
53
74
|
export interface ResourceQuery {
|
|
54
75
|
filter?: Record<string, unknown>;
|
|
76
|
+
include?: string | string[];
|
|
55
77
|
sort?: string[];
|
|
56
78
|
search?: string;
|
|
57
79
|
limit?: number;
|
|
@@ -61,13 +83,17 @@ export interface ResourceQuery {
|
|
|
61
83
|
export interface ResourceListResult<T = Record<string, unknown>> {
|
|
62
84
|
rows: T[];
|
|
63
85
|
limit: number;
|
|
86
|
+
time: number;
|
|
87
|
+
total: number | null;
|
|
64
88
|
offset: number;
|
|
65
89
|
}
|
|
66
90
|
export type ResourceUser = User;
|
|
67
91
|
export interface ResourceDependencies {
|
|
68
|
-
pg: DatabaseAdapter
|
|
92
|
+
pg: DatabaseAdapter;
|
|
69
93
|
logger?: AppLogger;
|
|
70
94
|
audit?: AuditPlugin;
|
|
95
|
+
dictionary?: DictionaryPlugin;
|
|
96
|
+
file?: FileAdapter;
|
|
71
97
|
}
|
|
72
98
|
export interface ResourcePlugin {
|
|
73
99
|
register(input: ResourceContract | ResourceContract[]): void;
|
|
@@ -82,23 +108,55 @@ export interface ResourcePlugin {
|
|
|
82
108
|
findOne(params: {
|
|
83
109
|
name: string;
|
|
84
110
|
id: string | number;
|
|
111
|
+
query?: ResourceQuery;
|
|
85
112
|
user?: ResourceUser;
|
|
86
113
|
}): Promise<Record<string, unknown> | null>;
|
|
87
114
|
create(params: {
|
|
88
115
|
name: string;
|
|
89
116
|
data: Record<string, unknown>;
|
|
90
117
|
user?: ResourceUser;
|
|
91
|
-
}): Promise<Record<string, unknown>>;
|
|
118
|
+
}, ctx?: AppContext): Promise<Record<string, unknown>>;
|
|
92
119
|
update(params: {
|
|
93
120
|
name: string;
|
|
94
121
|
id: string | number;
|
|
95
122
|
data: Record<string, unknown>;
|
|
96
123
|
user?: ResourceUser;
|
|
97
|
-
}): Promise<Record<string, unknown>>;
|
|
124
|
+
}, ctx?: AppContext): Promise<Record<string, unknown>>;
|
|
98
125
|
delete(params: {
|
|
99
126
|
name: string;
|
|
100
127
|
id: string | number;
|
|
101
128
|
user?: ResourceUser;
|
|
102
|
-
}): Promise<boolean>;
|
|
129
|
+
}, ctx?: AppContext): Promise<boolean>;
|
|
130
|
+
findRelation(params: {
|
|
131
|
+
name: string;
|
|
132
|
+
id: string | number;
|
|
133
|
+
relation: string;
|
|
134
|
+
query?: ResourceQuery;
|
|
135
|
+
user?: ResourceUser;
|
|
136
|
+
}): Promise<any>;
|
|
137
|
+
createRelation(params: {
|
|
138
|
+
name: string;
|
|
139
|
+
id: string | number;
|
|
140
|
+
relation: string;
|
|
141
|
+
data?: Record<string, unknown>;
|
|
142
|
+
user?: ResourceUser;
|
|
143
|
+
}, ctx?: AppContext): Promise<any>;
|
|
144
|
+
updateRelation(params: {
|
|
145
|
+
name: string;
|
|
146
|
+
id: string | number;
|
|
147
|
+
relation: string;
|
|
148
|
+
relationId: string;
|
|
149
|
+
data: Record<string, unknown>;
|
|
150
|
+
user?: ResourceUser;
|
|
151
|
+
}, ctx?: AppContext): Promise<Record<string, unknown>>;
|
|
152
|
+
deleteRelation(params: {
|
|
153
|
+
name: string;
|
|
154
|
+
id: string | number;
|
|
155
|
+
relation: string;
|
|
156
|
+
relationId: string;
|
|
157
|
+
user?: ResourceUser;
|
|
158
|
+
}, ctx?: AppContext): Promise<{
|
|
159
|
+
success: boolean;
|
|
160
|
+
}>;
|
|
103
161
|
}
|
|
104
162
|
//# sourceMappingURL=resource.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.types.d.ts","sourceRoot":"","sources":["../../../src/plugins/resource/resource.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"resource.types.d.ts","sourceRoot":"","sources":["../../../src/plugins/resource/resource.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACxE,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,I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