@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
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function r(n,k){n=n-0xee;const Z=g();let K=Z[n];return K;}import{ValidationError}from'../../../errors.js';export const quoteIdentifier=n=>'\x22'+n['replace'](/"/g,'\x22\x22')+'\x22';export const quoteTable=n=>n['split']('.')['map'](quoteIdentifier)['join']('.');export function fieldColumn(n,k){const B=r;if(k===n['key'])return n[B(0xee)];const Z=n['fields'][k];if(!Z)throw new ValidationError(B(0xef)+k);return Z['column']??k;}function g(){const R=['key','Unknown\x20field:\x20','entries','read','all','map','column','\x20AS\x20','unshift','write','date','push'];g=function(){return R;};return g();}export function readableFields(n,k){const l=r,Z=Object[l(0xf0)](n['fields'])['filter'](([,K])=>K[l(0xf1)]!==![]&&K['readable']!==![]&&(k?(K['scope']??l(0xf2))===k:!![]))[l(0xf3)](([K,d])=>quoteIdentifier(d[l(0xf4)]??K)+l(0xf5)+quoteIdentifier(K));return!n['fields'][n['key']]&&Z[l(0xf6)](quoteIdentifier(n['key'])),Z;}export function writableData(n,k){const f=r,Z=[];for(const [K,d]of Object['entries'](k)){const J=n['fields'][K];if(!J||J[f(0xf7)]===![]||J['writable']===![])throw new ValidationError('Field\x20is\x20not\x20writable:\x20'+K);if((J['write']??J['writable'])!==!![])continue;if(J['type']===f(0xf8)&&!k[K])continue;Z[f(0xf9)]([J[f(0xf4)]??K,d]);}return Z;}export const qi=quoteIdentifier;export const qt=quoteTable;
|
package/dist/shared/getIP.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function r(n,k){n=n-0x190;const Z=g();let K=Z[n];return K;}const k=r,getIP=n=>(n['headers']?.['x-real-ip']||n['headers']?.[k(0x190)]||n['ip']||n['connection']?.[k(0x191)]||'')[k(0x192)](':')['pop']();function g(){const Z=['x-forwarded-for','remoteAddress','split'];g=function(){return Z;};return g();}export default getIP;
|
package/dist/type.d.ts
CHANGED
|
@@ -19,5 +19,19 @@ type AccessMetadata = {
|
|
|
19
19
|
};
|
|
20
20
|
/** Повна схема Fastify і метадані маршруту API. */
|
|
21
21
|
export type ApiRouteSchema = FastifySchema & AccessMetadata;
|
|
22
|
+
/** Короткий опис зареєстрованого HTTP API-маршруту. */
|
|
23
|
+
export interface ApiRouteShort {
|
|
24
|
+
method: string;
|
|
25
|
+
endpoint: string;
|
|
26
|
+
package: string;
|
|
27
|
+
}
|
|
28
|
+
/** Розширений опис маршруту з OpenAPI та access metadata. */
|
|
29
|
+
export interface ApiRoute extends ApiRouteShort {
|
|
30
|
+
tags: string[];
|
|
31
|
+
summary: string;
|
|
32
|
+
description: string;
|
|
33
|
+
access: RouteAccess;
|
|
34
|
+
permissions: RoutePermission[];
|
|
35
|
+
}
|
|
22
36
|
export {};
|
|
23
37
|
//# sourceMappingURL=type.d.ts.map
|
package/dist/type.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACtD,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAGpD,KAAK,cAAc,GAAG;IACpB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,MAAM,EAAE,WAAW,CAAC;IACpB,2FAA2F;IAC3F,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACtD,oFAAoF;AACpF,MAAM,MAAM,eAAe,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAGpD,KAAK,cAAc,GAAG;IACpB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,MAAM,EAAE,WAAW,CAAC;IACpB,2FAA2F;IAC3F,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,cAAc,CAAC;AAE5D,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,6DAA6D;AAC7D,MAAM,WAAW,QAAS,SAAQ,aAAa;IAC7C,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC"}
|
|
@@ -6,29 +6,29 @@ AS $$
|
|
|
6
6
|
SELECT encode(gen_random_bytes(6), 'hex')::text
|
|
7
7
|
$$;
|
|
8
8
|
|
|
9
|
+
DROP SCHEMA IF EXISTS admin CASCADE;
|
|
9
10
|
CREATE SCHEMA IF NOT EXISTS admin;
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
CREATE TABLE IF NOT EXISTS admin.users (
|
|
13
14
|
uid text PRIMARY KEY DEFAULT next_id(),
|
|
14
15
|
login text,
|
|
15
|
-
|
|
16
|
+
password_hash text,
|
|
16
17
|
first_name text,
|
|
17
18
|
middle_name text,
|
|
18
19
|
last_name text,
|
|
19
20
|
email text,
|
|
20
21
|
phone text,
|
|
21
22
|
avatar text,
|
|
23
|
+
twofa boolean NOT NULL DEFAULT false,
|
|
22
24
|
enabled boolean DEFAULT true,
|
|
23
25
|
user_personal_code text,
|
|
24
26
|
last_activity_date timestamptz,
|
|
25
|
-
user_type text NOT NULL DEFAULT 'regular',
|
|
26
|
-
salt text,
|
|
27
|
+
user_type text NOT NULL DEFAULT 'regular',
|
|
27
28
|
created_by text,
|
|
28
29
|
updated_by text,
|
|
29
30
|
created_at timestamp NOT NULL DEFAULT now(),
|
|
30
|
-
updated_at timestamp NOT NULL DEFAULT now(),
|
|
31
|
-
twofa boolean NOT NULL DEFAULT false,
|
|
31
|
+
updated_at timestamp NOT NULL DEFAULT now(),
|
|
32
32
|
UNIQUE (user_personal_code)
|
|
33
33
|
);
|
|
34
34
|
|
|
@@ -107,18 +107,19 @@ CREATE TABLE IF NOT EXISTS admin.user_roles (
|
|
|
107
107
|
|
|
108
108
|
CREATE TABLE IF NOT EXISTS admin.role_access (
|
|
109
109
|
access_id text PRIMARY KEY DEFAULT next_id(),
|
|
110
|
-
|
|
110
|
+
|
|
111
111
|
role_id text REFERENCES admin.roles(role_id),
|
|
112
|
-
user_uid text,
|
|
112
|
+
user_uid text REFERENCES admin.users(uid),
|
|
113
113
|
scope text,
|
|
114
114
|
actions text[],
|
|
115
|
-
|
|
115
|
+
resource text,
|
|
116
116
|
|
|
117
|
-
created_by text,
|
|
118
|
-
updated_by text,
|
|
117
|
+
created_by text REFERENCES admin.users(uid) ,
|
|
118
|
+
updated_by text REFERENCES admin.users(uid) ,
|
|
119
119
|
created_at timestamp NOT NULL DEFAULT now(),
|
|
120
120
|
updated_at timestamp NOT NULL DEFAULT now(),
|
|
121
|
-
UNIQUE (
|
|
121
|
+
UNIQUE (resource, user_uid),
|
|
122
|
+
UNIQUE (resource, role_id)
|
|
122
123
|
);
|
|
123
124
|
|
|
124
125
|
|
|
@@ -131,8 +132,8 @@ CREATE TABLE IF NOT EXISTS admin.dictionaries (
|
|
|
131
132
|
source text NOT NULL DEFAULT 'git' CHECK (source IN ('git', 'custom')),
|
|
132
133
|
editable boolean NOT NULL DEFAULT false,
|
|
133
134
|
system boolean NOT NULL DEFAULT false,
|
|
134
|
-
created_by text,
|
|
135
|
-
updated_by text,
|
|
135
|
+
created_by text REFERENCES admin.users(uid) ,
|
|
136
|
+
updated_by text REFERENCES admin.users(uid) ,
|
|
136
137
|
created_at timestamp NOT NULL DEFAULT now(),
|
|
137
138
|
updated_at timestamp NOT NULL DEFAULT now()
|
|
138
139
|
);
|
|
@@ -150,6 +151,8 @@ CREATE TABLE IF NOT EXISTS admin.dictionary_items (
|
|
|
150
151
|
active boolean NOT NULL DEFAULT true,
|
|
151
152
|
system boolean NOT NULL DEFAULT false,
|
|
152
153
|
metadata jsonb,
|
|
154
|
+
created_by text REFERENCES admin.users(uid) ,
|
|
155
|
+
updated_by text REFERENCES admin.users(uid) ,
|
|
153
156
|
created_at timestamp NOT NULL DEFAULT now(),
|
|
154
157
|
updated_at timestamp NOT NULL DEFAULT now(),
|
|
155
158
|
UNIQUE (dictionary_id, code)
|
|
@@ -161,9 +164,9 @@ CREATE TABLE IF NOT EXISTS admin.notes (
|
|
|
161
164
|
resource text NOT NULL,
|
|
162
165
|
resource_id text NOT NULL,
|
|
163
166
|
body text NOT NULL,
|
|
164
|
-
created_by text,
|
|
167
|
+
created_by text REFERENCES admin.users(uid) ,
|
|
165
168
|
created_at timestamptz DEFAULT now(),
|
|
166
|
-
updated_by text,
|
|
169
|
+
updated_by text REFERENCES admin.users(uid) ,
|
|
167
170
|
updated_at timestamptz DEFAULT now()
|
|
168
171
|
);
|
|
169
172
|
|
|
@@ -179,14 +182,17 @@ CREATE TABLE IF NOT EXISTS admin.files (
|
|
|
179
182
|
file_status numeric,
|
|
180
183
|
file_name text,
|
|
181
184
|
size numeric,
|
|
182
|
-
|
|
185
|
+
mime_type text,
|
|
183
186
|
tags text[],
|
|
184
|
-
file_path text,
|
|
187
|
+
file_path text,
|
|
188
|
+
field_name text,
|
|
189
|
+
status text DEFAULT 'pending', // File processing status, e.g., 'pending', 'attached'
|
|
190
|
+
expires_at timestamptz DEFAULT now() + interval '1 day',
|
|
185
191
|
verified boolean DEFAULT false,
|
|
186
192
|
resized boolean,
|
|
187
|
-
created_by text,
|
|
193
|
+
created_by text REFERENCES admin.users(uid) ,
|
|
188
194
|
created_at timestamptz DEFAULT now(),
|
|
189
|
-
updated_by text,
|
|
195
|
+
updated_by text REFERENCES admin.users(uid) ,
|
|
190
196
|
updated_at timestamptz default now()
|
|
191
197
|
);
|
|
192
198
|
|
|
@@ -199,9 +205,9 @@ CREATE TABLE IF NOT EXISTS admin.settings (
|
|
|
199
205
|
key text NOT NULL,
|
|
200
206
|
value jsonb,
|
|
201
207
|
|
|
202
|
-
updated_by text,
|
|
208
|
+
updated_by text REFERENCES admin.users(uid) ,
|
|
203
209
|
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
204
|
-
created_by text,
|
|
210
|
+
created_by text REFERENCES admin.users(uid) ,
|
|
205
211
|
created_at timestamptz NOT NULL DEFAULT now()
|
|
206
212
|
);
|
|
207
213
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
CREATE SCHEMA IF NOT EXISTS admin;
|
|
2
|
-
|
|
3
|
-
DO $$
|
|
4
|
-
BEGIN
|
|
5
|
-
IF to_regclass('crm.notes') IS NOT NULL
|
|
6
|
-
AND to_regclass('admin.notes') IS NULL THEN
|
|
7
|
-
ALTER TABLE crm.notes SET SCHEMA admin;
|
|
8
|
-
END IF;
|
|
9
|
-
|
|
10
|
-
IF to_regclass('crm.files') IS NOT NULL
|
|
11
|
-
AND to_regclass('admin.files') IS NULL THEN
|
|
12
|
-
ALTER TABLE crm.files SET SCHEMA admin;
|
|
13
|
-
END IF;
|
|
14
|
-
END
|
|
15
|
-
$$;
|
|
16
|
-
|
|
17
|
-
ALTER INDEX IF EXISTS crm_notes_resource_idx RENAME TO admin_notes_resource_idx;
|
|
1
|
+
CREATE SCHEMA IF NOT EXISTS admin;
|
|
2
|
+
|
|
3
|
+
DO $$
|
|
4
|
+
BEGIN
|
|
5
|
+
IF to_regclass('crm.notes') IS NOT NULL
|
|
6
|
+
AND to_regclass('admin.notes') IS NULL THEN
|
|
7
|
+
ALTER TABLE crm.notes SET SCHEMA admin;
|
|
8
|
+
END IF;
|
|
9
|
+
|
|
10
|
+
IF to_regclass('crm.files') IS NOT NULL
|
|
11
|
+
AND to_regclass('admin.files') IS NULL THEN
|
|
12
|
+
ALTER TABLE crm.files SET SCHEMA admin;
|
|
13
|
+
END IF;
|
|
14
|
+
END
|
|
15
|
+
$$;
|
|
16
|
+
|
|
17
|
+
ALTER INDEX IF EXISTS crm_notes_resource_idx RENAME TO admin_notes_resource_idx;
|
|
18
18
|
ALTER INDEX IF EXISTS crm_notes_uid_idx RENAME TO admin_notes_uid_idx;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
alter table admin.files add column if not exists mime_type text;
|
|
3
|
+
alter table admin.files add column if not exists status text default 'pending';
|
|
4
|
+
alter table admin.files add column if not exists expires_at timestamptz default now() + interval '1 day';
|
|
5
|
+
alter table admin.files add column if not exists field_name text;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
CREATE SCHEMA IF NOT EXISTS admin;
|
|
2
|
-
|
|
3
|
-
CREATE TABLE IF NOT EXISTS admin.settings (
|
|
4
|
-
id text PRIMARY KEY DEFAULT next_id(),
|
|
5
|
-
resource text NOT NULL DEFAULT 'system',
|
|
6
|
-
resource_id text,
|
|
7
|
-
key text NOT NULL,
|
|
8
|
-
value jsonb,
|
|
9
|
-
updated_by text,
|
|
10
|
-
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
11
|
-
created_by text,
|
|
12
|
-
created_at timestamptz NOT NULL DEFAULT now()
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
DROP INDEX IF EXISTS settings_resource_key_uidx;
|
|
16
|
-
|
|
17
|
-
CREATE UNIQUE INDEX settings_resource_key_uidx
|
|
18
|
-
ON admin.settings (resource, resource_id, key)
|
|
1
|
+
CREATE SCHEMA IF NOT EXISTS admin;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE IF NOT EXISTS admin.settings (
|
|
4
|
+
id text PRIMARY KEY DEFAULT next_id(),
|
|
5
|
+
resource text NOT NULL DEFAULT 'system',
|
|
6
|
+
resource_id text,
|
|
7
|
+
key text NOT NULL,
|
|
8
|
+
value jsonb,
|
|
9
|
+
updated_by text,
|
|
10
|
+
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
11
|
+
created_by text,
|
|
12
|
+
created_at timestamptz NOT NULL DEFAULT now()
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
DROP INDEX IF EXISTS settings_resource_key_uidx;
|
|
16
|
+
|
|
17
|
+
CREATE UNIQUE INDEX settings_resource_key_uidx
|
|
18
|
+
ON admin.settings (resource, resource_id, key)
|
|
19
19
|
NULLS NOT DISTINCT;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
ALTER TABLE admin.users
|
|
2
|
+
ADD CONSTRAINT users_created_by_fkey
|
|
3
|
+
FOREIGN KEY (created_by) REFERENCES admin.users(uid) ON DELETE SET NULL,
|
|
4
|
+
ADD CONSTRAINT users_updated_by_fkey
|
|
5
|
+
FOREIGN KEY (updated_by) REFERENCES admin.users(uid) ON DELETE SET NULL;
|
|
6
|
+
|
|
7
|
+
ALTER TABLE admin.user_roles
|
|
8
|
+
ADD CONSTRAINT user_roles_created_by_fkey
|
|
9
|
+
FOREIGN KEY (created_by) REFERENCES admin.users(uid) ON DELETE SET NULL,
|
|
10
|
+
ADD CONSTRAINT user_roles_updated_by_fkey
|
|
11
|
+
FOREIGN KEY (updated_by) REFERENCES admin.users(uid) ON DELETE SET NULL;
|
|
12
|
+
|
|
13
|
+
ALTER TABLE admin.role_access
|
|
14
|
+
ADD CONSTRAINT role_access_user_uid_fkey
|
|
15
|
+
FOREIGN KEY (user_uid) REFERENCES admin.users(uid) ON DELETE CASCADE,
|
|
16
|
+
ADD CONSTRAINT role_access_created_by_fkey
|
|
17
|
+
FOREIGN KEY (created_by) REFERENCES admin.users(uid) ON DELETE SET NULL,
|
|
18
|
+
ADD CONSTRAINT role_access_updated_by_fkey
|
|
19
|
+
FOREIGN KEY (updated_by) REFERENCES admin.users(uid) ON DELETE SET NULL;
|
|
20
|
+
|
|
21
|
+
ALTER TABLE admin.dictionaries
|
|
22
|
+
ADD CONSTRAINT dictionaries_created_by_fkey
|
|
23
|
+
FOREIGN KEY (created_by) REFERENCES admin.users(uid) ON DELETE SET NULL,
|
|
24
|
+
ADD CONSTRAINT dictionaries_updated_by_fkey
|
|
25
|
+
FOREIGN KEY (updated_by) REFERENCES admin.users(uid) ON DELETE SET NULL;
|
|
26
|
+
|
|
27
|
+
ALTER TABLE admin.notes
|
|
28
|
+
ADD CONSTRAINT notes_created_by_fkey
|
|
29
|
+
FOREIGN KEY (created_by) REFERENCES admin.users(uid) ON DELETE SET NULL,
|
|
30
|
+
ADD CONSTRAINT notes_updated_by_fkey
|
|
31
|
+
FOREIGN KEY (updated_by) REFERENCES admin.users(uid) ON DELETE SET NULL;
|
|
32
|
+
|
|
33
|
+
ALTER TABLE admin.files
|
|
34
|
+
ADD CONSTRAINT files_created_by_fkey
|
|
35
|
+
FOREIGN KEY (created_by) REFERENCES admin.users(uid) ON DELETE SET NULL,
|
|
36
|
+
ADD CONSTRAINT files_updated_by_fkey
|
|
37
|
+
FOREIGN KEY (updated_by) REFERENCES admin.users(uid) ON DELETE SET NULL;
|
|
38
|
+
|
|
39
|
+
ALTER TABLE admin.settings
|
|
40
|
+
ADD CONSTRAINT settings_created_by_fkey
|
|
41
|
+
FOREIGN KEY (created_by) REFERENCES admin.users(uid) ON DELETE SET NULL,
|
|
42
|
+
ADD CONSTRAINT settings_updated_by_fkey
|
|
43
|
+
FOREIGN KEY (updated_by) REFERENCES admin.users(uid) ON DELETE SET NULL;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
DO $$
|
|
2
|
+
declare
|
|
3
|
+
_password_column_exists boolean;
|
|
4
|
+
BEGIN
|
|
5
|
+
IF to_regclass('admin.users') IS NOT NULL then
|
|
6
|
+
|
|
7
|
+
select true from pg_attribute where attrelid::regclass::text='admin.users' and attname='password' into _password_column_exists;
|
|
8
|
+
|
|
9
|
+
IF _password_column_exists is true then
|
|
10
|
+
alter table admin.users add column if not exists password_hash text;
|
|
11
|
+
update admin.users set password_hash = password where password is not null and password_hash is null;
|
|
12
|
+
alter table admin.users drop column if exists password;
|
|
13
|
+
END IF;
|
|
14
|
+
|
|
15
|
+
alter table admin.users add column if not exists twofa boolean not null default false;
|
|
16
|
+
|
|
17
|
+
END IF;
|
|
18
|
+
|
|
19
|
+
END
|
|
20
|
+
$$;
|
|
21
|
+
|
|
22
|
+
CREATE OR REPLACE FUNCTION next_id()
|
|
23
|
+
RETURNS text AS
|
|
24
|
+
$BODY$
|
|
25
|
+
DECLARE
|
|
26
|
+
|
|
27
|
+
BEGIN
|
|
28
|
+
return encode(public.gen_random_bytes(6), 'hex');
|
|
29
|
+
END;
|
|
30
|
+
$BODY$
|
|
31
|
+
LANGUAGE plpgsql VOLATILE
|
|
32
|
+
COST 100;
|
package/package.json
CHANGED
|
@@ -1,88 +1,93 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@opengis/fcore",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
4
|
-
"description": "Reusable backend foundation for OpenGIS Node.js applications",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"migrations",
|
|
11
|
-
"README.md",
|
|
12
|
-
"LICENSE"
|
|
13
|
-
],
|
|
14
|
-
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"types": "./dist/index.d.ts",
|
|
17
|
-
"import": "./dist/index.js"
|
|
18
|
-
},
|
|
19
|
-
"./fastify": {
|
|
20
|
-
"types": "./dist/fastify.d.ts",
|
|
21
|
-
"import": "./dist/fastify.js"
|
|
22
|
-
},
|
|
23
|
-
"./migrate": {
|
|
24
|
-
"types": "./dist/migrations/runner.d.ts",
|
|
25
|
-
"import": "./dist/migrations/runner.js"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"bin": {
|
|
29
|
-
"fcore-migrate": "./dist/migrations/cli.js"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@fastify/
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"fastify-
|
|
62
|
-
"fastify
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/fcore",
|
|
3
|
+
"version": "0.0.1-beta.21",
|
|
4
|
+
"description": "Reusable backend foundation for OpenGIS Node.js applications",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"migrations",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./fastify": {
|
|
20
|
+
"types": "./dist/fastify.d.ts",
|
|
21
|
+
"import": "./dist/fastify.js"
|
|
22
|
+
},
|
|
23
|
+
"./migrate": {
|
|
24
|
+
"types": "./dist/migrations/runner.d.ts",
|
|
25
|
+
"import": "./dist/migrations/runner.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"bin": {
|
|
29
|
+
"fcore-migrate": "./dist/migrations/cli.js",
|
|
30
|
+
"fcore-adduser": "./dist/modules/auth/adduser-cli.js",
|
|
31
|
+
"fcore-passwd": "./dist/modules/auth/passwd-cli.js",
|
|
32
|
+
"fcore-permission": "./dist/modules/auth/permission-cli.js"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
|
+
"build": "npm run clean && tsc -p tsconfig.json && node scripts/obfuscate.mjs",
|
|
37
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"test": "node --test --import tsx test/**/*.test.ts",
|
|
39
|
+
"test-env": "node --env-file=.env.test --test --import tsx test/**/env.test.ts",
|
|
40
|
+
"dev": "bun ./server.ts",
|
|
41
|
+
"adduser": "node --import tsx ./src/modules/auth/adduser-cli.ts",
|
|
42
|
+
"passwd": "node --import tsx ./src/modules/auth/passwd-cli.ts",
|
|
43
|
+
"permission": "node --import tsx ./src/modules/auth/permission-cli.ts",
|
|
44
|
+
"migrate": "node --import tsx src/migrations/cli.ts",
|
|
45
|
+
"migration-test": "node --env-file=.env.test --import tsx src/migrations/cli.ts",
|
|
46
|
+
"prepublishOnly": "npm run build",
|
|
47
|
+
"prepublishOnly1": "npm run build && npm test",
|
|
48
|
+
"patch": "npm version patch && git push && npm publish",
|
|
49
|
+
"minor": "npm version minor && git push && npm publish",
|
|
50
|
+
"major": "npm version major && git push && npm publish"
|
|
51
|
+
},
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=20"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@aws-sdk/client-s3": "3.1125.0",
|
|
57
|
+
"@aws-sdk/lib-storage": "3.1125.0",
|
|
58
|
+
"@fastify/cookie": "11.1.2",
|
|
59
|
+
"@fastify/multipart": "10.1.1",
|
|
60
|
+
"@fastify/passport": "4.0.2",
|
|
61
|
+
"@fastify/rate-limit": "11.2.0",
|
|
62
|
+
"@fastify/session": "11.1.2",
|
|
63
|
+
"@sinclair/typebox": "^0.34.52",
|
|
64
|
+
"apache-crypt": "1.2.6",
|
|
65
|
+
"dotenv": "17.4.2",
|
|
66
|
+
"fastify-session-redis-store": "7.1.2",
|
|
67
|
+
"file-type": "22.0.2",
|
|
68
|
+
"ioredis": "6.0.0",
|
|
69
|
+
"jose": "^6.2.12",
|
|
70
|
+
"otplib": "13.5.0",
|
|
71
|
+
"pg": "8.23.0",
|
|
72
|
+
"pino": "10.3.1",
|
|
73
|
+
"pino-abstract-transport": "3.0.0",
|
|
74
|
+
"qrcode": "1.5.4",
|
|
75
|
+
"sharp": "0.35.4"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"fastify": ">=5.12.1"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@types/node": "22.20.1",
|
|
82
|
+
"@types/passport": "1.0.17",
|
|
83
|
+
"@types/passport-local": "1.0.38",
|
|
84
|
+
"@types/pg": "8.23.1",
|
|
85
|
+
"@types/qrcode": "1.5.6",
|
|
86
|
+
"fastify": "5.12.1",
|
|
87
|
+
"javascript-obfuscator": "5.6.0",
|
|
88
|
+
"tsx": "4.23.13",
|
|
89
|
+
"typescript": "7.0.2",
|
|
90
|
+
"vitest": "4.1.11"
|
|
91
|
+
},
|
|
92
|
+
"license": "UNLICENSED"
|
|
93
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exports the public surface of this FCore module.
|
|
3
|
-
*/
|
|
4
|
-
export * from './route.js';
|
|
5
|
-
export * from './services/login.js';
|
|
6
|
-
export * from './services/logout.js';
|
|
7
|
-
export * from './services/get-current-user.js';
|
|
8
|
-
export * from './services/verify-two-factor.js';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(_0x5c39f8,_0xd6c04f){var _0x279e1b=_0xb4de,_0x4e7593=_0x5c39f8();while(!![]){try{var _0x29d586=parseInt(_0x279e1b(0x156))/0x1*(parseInt(_0x279e1b(0x154))/0x2)+-parseInt(_0x279e1b(0x158))/0x3*(-parseInt(_0x279e1b(0x15a))/0x4)+parseInt(_0x279e1b(0x152))/0x5*(parseInt(_0x279e1b(0x15b))/0x6)+-parseInt(_0x279e1b(0x15c))/0x7*(-parseInt(_0x279e1b(0x153))/0x8)+parseInt(_0x279e1b(0x157))/0x9+-parseInt(_0x279e1b(0x155))/0xa*(parseInt(_0x279e1b(0x15d))/0xb)+-parseInt(_0x279e1b(0x159))/0xc;if(_0x29d586===_0xd6c04f)break;else _0x4e7593['push'](_0x4e7593['shift']());}catch(_0xd903f6){_0x4e7593['push'](_0x4e7593['shift']());}}}(_0x4a71,0x1b915));function _0xb4de(_0x382be1,_0x40b2a2){_0x382be1=_0x382be1-0x152;var _0x4a717d=_0x4a71();var _0xb4de9d=_0x4a717d[_0x382be1];return _0xb4de9d;}export*from'./route.js';export*from'./services/login.js';export*from'./services/logout.js';function _0x4a71(){var _0x43d77e=['9046HvVucd','1498158jeDUqo','8121KMDZxw','6450408oTlgQX','12mYfyQS','1130838PUeWGt','462CIMWEn','316811caqPbl','5hQPzus','22976xfjgOr','28pUMrbW','10SSBCSt'];_0x4a71=function(){return _0x43d77e;};return _0x4a71();}export*from'./services/get-current-user.js';export*from'./services/verify-two-factor.js';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ContextDependencies } from "../../../context.js";
|
|
2
|
-
export default function login({ ip, login, password }: {
|
|
3
|
-
ip: string;
|
|
4
|
-
login: string;
|
|
5
|
-
password: string;
|
|
6
|
-
}, { config, pg, logger, redis, }: Pick<ContextDependencies, "config" | "pg" | "logger" | "redis">): Promise<{
|
|
7
|
-
user: any;
|
|
8
|
-
redirectUrl: string;
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/services/login.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,wBAA8B,KAAK,CACjC,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EACxE,EACE,MAAM,EACN,EAAE,EACF,MAAM,EACN,KAAK,GACN,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC;;;GAiCnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function _0x3438(_0x41fdb0,_0x424507){_0x41fdb0=_0x41fdb0-0x80;const _0x254c92=_0x254c();let _0x343863=_0x254c92[_0x41fdb0];return _0x343863;}(function(_0x2ffa12,_0x9c3fb3){const _0x22614c=_0x3438,_0x279a51=_0x2ffa12();while(!![]){try{const _0x3436d6=-parseInt(_0x22614c(0x85))/0x1*(-parseInt(_0x22614c(0x96))/0x2)+-parseInt(_0x22614c(0x97))/0x3+-parseInt(_0x22614c(0x94))/0x4*(parseInt(_0x22614c(0x9d))/0x5)+-parseInt(_0x22614c(0x91))/0x6*(-parseInt(_0x22614c(0x9f))/0x7)+-parseInt(_0x22614c(0x8b))/0x8*(parseInt(_0x22614c(0x8c))/0x9)+-parseInt(_0x22614c(0x88))/0xa*(parseInt(_0x22614c(0x8e))/0xb)+parseInt(_0x22614c(0x9b))/0xc;if(_0x3436d6===_0x9c3fb3)break;else _0x279a51['push'](_0x279a51['shift']());}catch(_0x38a20f){_0x279a51['push'](_0x279a51['shift']());}}}(_0x254c,0xedf53));function _0x254c(){const _0x2efe62=['nPYwU','1455bAHWvB','OwxBs','7tRfOCX','yJOub','logger','FXwMK','password','twoFactor','13SGSAaC','base','metrics','3811010DmvSCz','VRbRf','login','7600216IgUOeq','18IznTSl','link','11YcHTCT','user.login','auth','6383298wDTsnT','empty\x20pg','empty\x20user','364hHlmfU','empty\x20redis','234070gCVVen','5225298oOSGEl','SnxrE','twofa','afterLogin','29264868ibVDpd'];_0x254c=function(){return _0x2efe62;};return _0x254c();}import _0xc9e467 from'./verifyPassword.js';export default async function login({ip:_0x4021d5,login:_0xb4931d,password:_0x3c34c2},{config:_0x3b9e3d,pg:_0x4ac7be,logger:_0xa64d9d,redis:_0x2cdba8}){const _0x396696=_0x3438,_0x56396c={'nPYwU':function(_0x3a1ea3,_0x5e584a){return _0x3a1ea3(_0x5e584a);},'SnxrE':_0x396696(0x92),'FXwMK':function(_0x1d2003,_0x5f353d,_0x319df3){return _0x1d2003(_0x5f353d,_0x319df3);},'VRbRf':_0x396696(0x93),'yJOub':_0x396696(0x8f),'OwxBs':function(_0x2ee62f,_0xc728ed){return _0x2ee62f||_0xc728ed;}};if(!_0x4ac7be)throw _0x56396c[_0x396696(0x9c)](Error,_0x56396c[_0x396696(0x98)]);if(!_0x2cdba8)throw _0x56396c[_0x396696(0x9c)](Error,_0x396696(0x95));const _0x3d7e40={};_0x3d7e40[_0x396696(0x8a)]=_0xb4931d,_0x3d7e40[_0x396696(0x83)]=_0x3c34c2,_0x3d7e40['ip']=_0x4021d5;const _0x5798e5={};_0x5798e5['pg']=_0x4ac7be,_0x5798e5[_0x396696(0x81)]=_0xa64d9d;const {user:_0x468c42}=await _0x56396c[_0x396696(0x82)](_0xc9e467,_0x3d7e40,_0x5798e5);if(!_0x468c42)throw new Error(_0x56396c[_0x396696(0x89)]);_0xa64d9d[_0x396696(0x87)](_0x56396c[_0x396696(0x80)]);const _0x35d3dd=_0x468c42[_0x396696(0x99)]?_0x3b9e3d[_0x396696(0x90)][_0x396696(0x8d)]?.[_0x396696(0x84)]?.[_0x396696(0x8a)]:_0x3b9e3d[_0x396696(0x90)][_0x396696(0x8d)]?.[_0x396696(0x86)][_0x396696(0x9a)];return{'user':_0x468c42,'redirectUrl':_0x56396c[_0x396696(0x9e)](_0x35d3dd,'/')};}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Implements the logout application service for its module.
|
|
3
|
-
*/
|
|
4
|
-
import type { AppContext, User } from "../../../context.js";
|
|
5
|
-
export default function logout(params: {
|
|
6
|
-
sessionId?: string;
|
|
7
|
-
user?: User;
|
|
8
|
-
}, ctx: AppContext): Promise<void>;
|
|
9
|
-
//# sourceMappingURL=logout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/services/logout.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC5D,wBAA8B,MAAM,CAClC,MAAM,EAAE;IACN,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,EACD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function _0x42e0(_0x3f99d4,_0x23a702){_0x3f99d4=_0x3f99d4-0x142;var _0x5241bc=_0x5241();var _0x42e09f=_0x5241bc[_0x3f99d4];return _0x42e09f;}function _0x5241(){var _0x4dde4e=['9dmzJBI','afvgF','6150284xDNfxh','action','25642GFMjcB','audit','fQkQm','sessionId','3414815rSYKMk','723884iYPxXm','userId','resourceId','auth','resource','2659168NhRyIw','198297gcJpQI','6gStagF','module','8698480GBYnDc','session','user','write','logout'];_0x5241=function(){return _0x4dde4e;};return _0x5241();}(function(_0x4b4ccc,_0x2e595c){var _0x53bbb8=_0x42e0,_0x36a1ae=_0x4b4ccc();while(!![]){try{var _0x16cb80=parseInt(_0x53bbb8(0x152))/0x1+-parseInt(_0x53bbb8(0x14d))/0x2*(-parseInt(_0x53bbb8(0x149))/0x3)+-parseInt(_0x53bbb8(0x157))/0x4+-parseInt(_0x53bbb8(0x151))/0x5*(-parseInt(_0x53bbb8(0x142))/0x6)+parseInt(_0x53bbb8(0x14b))/0x7+-parseInt(_0x53bbb8(0x144))/0x8+-parseInt(_0x53bbb8(0x158))/0x9;if(_0x16cb80===_0x2e595c)break;else _0x36a1ae['push'](_0x36a1ae['shift']());}catch(_0x4e1419){_0x36a1ae['push'](_0x36a1ae['shift']());}}}(_0x5241,0x8639b));export default async function logout(_0x1c1dfc,_0x195c3f){var _0x35bd21=_0x42e0,_0x1e63dd={};_0x1e63dd[_0x35bd21(0x14a)]=_0x35bd21(0x155),_0x1e63dd[_0x35bd21(0x14f)]=_0x35bd21(0x145);var _0x172151=_0x1e63dd,_0x1d7a13={};_0x1d7a13[_0x35bd21(0x143)]=_0x172151[_0x35bd21(0x14a)],_0x1d7a13[_0x35bd21(0x156)]=_0x172151[_0x35bd21(0x14f)],_0x1d7a13[_0x35bd21(0x154)]=_0x1c1dfc[_0x35bd21(0x150)],_0x1d7a13[_0x35bd21(0x14c)]=_0x35bd21(0x148),_0x1d7a13[_0x35bd21(0x153)]=_0x1c1dfc[_0x35bd21(0x146)]?.['id'],await _0x195c3f[_0x35bd21(0x14e)]?.[_0x35bd21(0x147)]?.(_0x1d7a13);}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ContextDependencies } from "../../../context.js";
|
|
2
|
-
export declare function hashPassword(password: string): string;
|
|
3
|
-
export declare function verifyPasswordWithoutSalt(password: string, stored: string): boolean;
|
|
4
|
-
export default function verifyPassword({ login, password, ip, }: {
|
|
5
|
-
login: string;
|
|
6
|
-
password: string;
|
|
7
|
-
ip: string;
|
|
8
|
-
}, { pg, logger }: Pick<ContextDependencies, "pg" | "logger">): Promise<{
|
|
9
|
-
user: any;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=verifyPassword.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verifyPassword.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/services/verifyPassword.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAQ,MAAM,qBAAqB,CAAC;AAOhE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIrD;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,OAAO,CAST;AAED,wBAA8B,cAAc,CAC1C,EACE,KAAK,EACL,QAAQ,EACR,EAAE,GACH,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ,EACD,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,GAAG,QAAQ,CAAC;;GAmE3D"}
|