@opengis/fcore 0.0.1-beta.1 → 0.0.1-beta.11
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 +5 -5
- package/dist/fastify.d.ts.map +1 -1
- package/dist/fastify.js +1 -1
- package/dist/fcore.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +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 +22 -1
- package/dist/modules/system/schema.d.ts.map +1 -1
- package/dist/modules/system/schema.js +1 -1
- package/dist/modules/system/services/check-system.d.ts.map +1 -1
- package/dist/modules/system/services/check-system.js +1 -1
- package/dist/modules/system/services/get-access.d.ts +14 -0
- package/dist/modules/system/services/get-access.d.ts.map +1 -0
- package/dist/modules/system/services/get-access.js +1 -0
- package/dist/modules/system/services/get-api-list.d.ts +4 -1
- package/dist/modules/system/services/get-api-list.d.ts.map +1 -1
- package/dist/modules/system/services/get-api-list.js +1 -1
- package/dist/modules/system/services/get-audit-log.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 +16 -0
- package/dist/modules/system/services/set-access.d.ts.map +1 -0
- package/dist/modules/system/services/set-access.js +1 -0
- package/dist/modules/system/services/update-dictionary.d.ts +13 -0
- package/dist/modules/system/services/update-dictionary.d.ts.map +1 -0
- package/dist/modules/system/services/update-dictionary.js +1 -0
- package/dist/modules/system/services/update-system-settings.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/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.d.ts +3 -0
- package/dist/plugins/logger/transport.d.ts.map +1 -0
- package/dist/plugins/logger/transport.js +1 -0
- 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 +65 -8
- 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.map +1 -1
- package/dist/plugins/resource/utils/sort.js +1 -1
- package/dist/plugins/resource/utils/sql.js +1 -1
- package/dist/shared/getIP.js +1 -1
- package/dist/type.d.ts +37 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/type.js +1 -0
- 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 +12 -7
- 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,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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/fcore",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.11",
|
|
4
4
|
"description": "Reusable backend foundation for OpenGIS Node.js applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,10 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"bin": {
|
|
29
|
-
"fcore-migrate": "./dist/migrations/cli.js"
|
|
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"
|
|
30
33
|
},
|
|
31
34
|
"scripts": {
|
|
32
35
|
"clean": "rm -rf dist",
|
|
@@ -34,9 +37,11 @@
|
|
|
34
37
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
35
38
|
"test": "node --test --import tsx test/**/*.test.ts",
|
|
36
39
|
"test-env": "node --env-file=.env.test --test --import tsx test/**/env.test.ts",
|
|
37
|
-
"dev": "
|
|
38
|
-
"
|
|
39
|
-
"
|
|
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",
|
|
40
45
|
"migration-test": "node --env-file=.env.test --import tsx src/migrations/cli.ts",
|
|
41
46
|
"prepublishOnly": "npm run build",
|
|
42
47
|
"prepublishOnly1": "npm run build && npm test",
|
|
@@ -48,7 +53,6 @@
|
|
|
48
53
|
"node": ">=20"
|
|
49
54
|
},
|
|
50
55
|
"dependencies": {
|
|
51
|
-
"@sinclair/typebox": "^0.34.52",
|
|
52
56
|
"@aws-sdk/client-s3": "3.1125.0",
|
|
53
57
|
"@aws-sdk/lib-storage": "3.1125.0",
|
|
54
58
|
"@fastify/cookie": "11.1.2",
|
|
@@ -56,12 +60,13 @@
|
|
|
56
60
|
"@fastify/passport": "4.0.2",
|
|
57
61
|
"@fastify/rate-limit": "11.2.0",
|
|
58
62
|
"@fastify/session": "11.1.2",
|
|
63
|
+
"@sinclair/typebox": "^0.34.52",
|
|
59
64
|
"apache-crypt": "1.2.6",
|
|
60
65
|
"dotenv": "17.4.2",
|
|
61
|
-
"fastify-plugin": "6.0.0",
|
|
62
66
|
"fastify-session-redis-store": "7.1.2",
|
|
63
67
|
"file-type": "22.0.2",
|
|
64
68
|
"ioredis": "6.0.0",
|
|
69
|
+
"jose": "^6.2.12",
|
|
65
70
|
"otplib": "13.5.0",
|
|
66
71
|
"pg": "8.23.0",
|
|
67
72
|
"pino": "10.3.1",
|
|
@@ -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(D,L){var u=p,s=D();while(!![]){try{var X=parseInt(u(0x13d))/0x1+-parseInt(u(0x13c))/0x2+parseInt(u(0x13a))/0x3*(-parseInt(u(0x139))/0x4)+-parseInt(u(0x13f))/0x5*(-parseInt(u(0x138))/0x6)+-parseInt(u(0x13b))/0x7+parseInt(u(0x140))/0x8*(parseInt(u(0x13e))/0x9)+parseInt(u(0x141))/0xa;if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x1d6b9));export*from'./route.js';export*from'./services/login.js';export*from'./services/logout.js';export*from'./services/get-current-user.js';export*from'./services/verify-two-factor.js';function p(D,L){D=D-0x138;var s=m();var X=s[D];return X;}function m(){var o=['163010nlDWSg','182760GfkcnL','1561670eACybB','42cqGqIv','85368zVBqKO','18TbexbA','847441EsuIsX','273684NJUOYy','30701HrMfwi','36eRoojh'];m=function(){return o;};return m();}
|
|
@@ -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(D,L){const y=p,s=D();while(!![]){try{const M=-parseInt(y(0x195))/0x1+-parseInt(y(0x17d))/0x2+parseInt(y(0x194))/0x3*(-parseInt(y(0x199))/0x4)+parseInt(y(0x196))/0x5*(-parseInt(y(0x184))/0x6)+-parseInt(y(0x183))/0x7+-parseInt(y(0x181))/0x8+-parseInt(y(0x18e))/0x9*(-parseInt(y(0x191))/0xa);if(M===L)break;else s['push'](s['shift']());}catch(u){s['push'](s['shift']());}}}(m,0x955a6));function p(D,L){D=D-0x17b;const s=m();let X=s[D];return X;}import X from'./verifyPassword.js';function m(){const c=['base','AuAxd','login','metrics','redirectUrl','2547wasnKP','empty\x20redis','logger','157490HqCvKz','link','user.login','1680dfylLD','115308HsjJkw','176885kptDPm','empty\x20pg','tFlVp','4372xtfmBE','auth','hzgzz','948064ZJSgWc','user','jpQJF','afterLogin','7426960IxMipD','password','6312292LmIpLo','138IQzBbO','twofa','twoFactor','empty\x20user','kmKpG'];m=function(){return c;};return m();}export default async function login({ip:M,login:u,password:o},{config:r,pg:i,logger:q,redis:R}){const E=p,B={'AuAxd':function(z,l){return z(l);},'kmKpG':E(0x197),'jpQJF':E(0x18f),'hzgzz':function(z,l,t){return z(l,t);},'tFlVp':E(0x187)};if(!i)throw B[E(0x18a)](Error,B[E(0x188)]);if(!R)throw B[E(0x18a)](Error,B[E(0x17f)]);const O={};O[E(0x18b)]=u,O[E(0x182)]=o,O['ip']=M;const h={};h['pg']=i,h[E(0x190)]=q;const {user:g}=await B[E(0x17c)](X,O,h);if(!g)throw new Error(B[E(0x198)]);q[E(0x18c)](E(0x193));const J=g[E(0x185)]?r[E(0x17b)][E(0x192)]?.[E(0x186)]?.[E(0x18b)]:r[E(0x17b)][E(0x192)]?.[E(0x189)][E(0x180)],S={};return S[E(0x17e)]=g,S[E(0x18d)]=J||'/',S;}
|
|
@@ -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 m(){var q=['FmpwT','66834MjJIOF','11043FuCqYI','action','session','lVfMo','user','userId','write','200dbvWoo','68712PdUsZh','audit','869189VaHkkc','1562fhBpvz','3790LZpkWk','348704DRDEji','resourceId','8953WIPQjN','1559168OMfcji','15bRHjjR','resource','auth','1208PmXvzx','sessionId','module','logout'];m=function(){return q;};return m();}(function(D,L){var r=p,s=D();while(!![]){try{var X=-parseInt(r(0x178))/0x1+parseInt(r(0x17e))/0x2+-parseInt(r(0x165))/0x3*(-parseInt(r(0x17b))/0x4)+-parseInt(r(0x175))/0x5*(parseInt(r(0x16d))/0x6)+-parseInt(r(0x17d))/0x7*(-parseInt(r(0x168))/0x8)+-parseInt(r(0x16e))/0x9*(parseInt(r(0x17a))/0xa)+parseInt(r(0x179))/0xb*(parseInt(r(0x176))/0xc);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x6be2f));function p(D,L){D=D-0x165;var s=m();var X=s[D];return X;}export default async function logout(s,X){var i=p,M={};M[i(0x16c)]=i(0x167),M[i(0x171)]=i(0x170);var u=M,o={};o[i(0x16a)]=u[i(0x16c)],o[i(0x166)]=u[i(0x171)],o[i(0x17c)]=s[i(0x169)],o[i(0x16f)]=i(0x16b),o[i(0x173)]=s[i(0x172)]?.['id'],await X[i(0x177)]?.[i(0x174)]?.(o);}
|
|
@@ -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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(D,L){const G=p,s=D();while(!![]){try{const X=-parseInt(G(0x11e))/0x1+parseInt(G(0x112))/0x2+parseInt(G(0x126))/0x3*(parseInt(G(0x105))/0x4)+parseInt(G(0x117))/0x5*(-parseInt(G(0x11a))/0x6)+-parseInt(G(0x10e))/0x7*(parseInt(G(0x12a))/0x8)+-parseInt(G(0x123))/0x9+-parseInt(G(0x138))/0xa*(-parseInt(G(0x142))/0xb);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x38c28));function p(D,L){D=D-0x100;const s=m();let X=s[D];return X;}import a from'apache-crypt';import F from'node:crypto';import{BadRequestError}from'../../../errors.js';function md5(L){const j=p,s={};s[j(0x135)]=j(0x128),s[j(0x144)]=j(0x141);const X=s;return F[j(0x100)](X[j(0x135)])[j(0x13e)](L)[j(0x127)](X[j(0x144)]);}export function hashPassword(L){const e=p,s={};s[e(0x101)]=e(0x141);const X=s,M=F[e(0x130)](0x10)[e(0x109)](X[e(0x101)]),u=F[e(0x133)](L,M,0x40)[e(0x109)](X[e(0x101)]);return e(0x103)+M+'$'+u;}export function verifyPasswordWithoutSalt(L,s){const Y=p,X={};X[Y(0x145)]=function(R,B){return R!==B;},X[Y(0x119)]=Y(0x147);const M=X,[u,o,r]=s[Y(0x107)]('$');if(M[Y(0x145)](u,M[Y(0x119)])||!o||!r)return![];const i=F[Y(0x133)](L,o,0x40),q=Buffer[Y(0x13d)](r,Y(0x141));return q[Y(0x125)]===i[Y(0x125)]&&F[Y(0x118)](q,i);}export default async function verifyPassword({login:B,password:O,ip:h},{pg:g,logger:J}){const I=p,S={'nJFHE':function(c,H,A){return c(H,A);},'ayzzv':I(0x132),'bcniS':I(0x11d),'wKBvD':I(0x12e),'JeXtc':function(c,H){return c===H;},'IxsuJ':I(0x10d),'rdnmJ':function(c,H){return c!==H;},'NYGqX':I(0x146),'uvopy':I(0x14a),'UFSnk':I(0x129),'iTpYK':function(c,H){return c===H;},'NgjFH':I(0x114),'qbiKi':I(0x10a),'xWdkz':I(0x137),'ZHXuI':function(c,H){return c===H;},'pfouZ':function(c,H){return c<H;},'KMsXA':function(c,H){return c(H);},'yKsbP':function(c,H){return c+H;},'AlnFe':function(c,H){return c===H;},'aNLOV':I(0x110)};if(!g){if(S[I(0x13a)](S[I(0x136)],S[I(0x136)]))throw new Error(S[I(0x102)]);else{const H=S[I(0x134)](E,B,O[I(0x12f)]);if(!H){const P=S[I(0x104)],v={};v[I(0x140)]=S[I(0x143)],v[I(0x149)]=P,v[I(0x13c)]=E,v['ip']=c,y[I(0x121)](v);throw new H(P);}const w={...z};w[I(0x12f)]=l,w[I(0x11b)]=t;const W={};return W[I(0x12c)]=w,W;}}if(!B||S[I(0x13a)](B,'')){if(S[I(0x13b)](S[I(0x139)],S[I(0x148)]))throw new BadRequestError(S[I(0x115)]);else throw new L(S[I(0x102)]);}if(!O||S[I(0x13a)](O,'')){if(S[I(0x113)](S[I(0x13f)],S[I(0x120)])){const V=S[I(0x104)],w={};w[I(0x140)]=S[I(0x143)],w[I(0x149)]=V,w[I(0x13c)]=u,w['ip']=o,M[I(0x121)](w);throw new r(V);}else throw new BadRequestError(S[I(0x116)]);}const z=I(0x111),l=await g[I(0x10f)](z,[B])[I(0x122)](V=>V[I(0x11c)]?.[0x0]);if(!l){const V=I(0x11f),w={};w[I(0x140)]=S[I(0x143)],w[I(0x149)]=V,w[I(0x13c)]=B,w['ip']=h,J[I(0x121)](w);throw new BadRequestError(V);}if(!l[I(0x11b)]){const W=S[I(0x134)](verifyPasswordWithoutSalt,O,l[I(0x12f)]);if(!W){const n=S[I(0x104)],Z={};Z[I(0x140)]=S[I(0x143)],Z[I(0x149)]=n,Z[I(0x13c)]=B,Z['ip']=h,J[I(0x121)](Z);throw new BadRequestError(n);}const P={...l};P[I(0x12f)]=undefined,P[I(0x11b)]=undefined;const v={};return v[I(0x12c)]=P,v;}if(S[I(0x131)](l[I(0x14b)],!![])){const x=await g[I(0x10f)](I(0x108),[O,l[I(0x11b)]])[I(0x122)](b=>b[I(0x11c)]?.[0x0]?.[I(0x10b)]);if(S[I(0x13a)](l[I(0x12f)],x)){const b={...l};b[I(0x12f)]=undefined,b[I(0x11b)]=undefined;const f={};return f[I(0x12c)]=b,f;}const N=I(0x132),U={};U[I(0x140)]=I(0x11d),U[I(0x149)]=N,U[I(0x13c)]=B,U['ip']=h,J[I(0x121)](U);throw new BadRequestError(N);}let t='';for(let Q=0x0;S[I(0x124)](Q,0xa);Q+=0x1){t=S[I(0x12b)](md5,S[I(0x106)](O+t,l[I(0x11b)]));}t=S[I(0x134)](a,t,l[I(0x11b)]);if(S[I(0x13a)](l[I(0x12f)],t)){if(S[I(0x10c)](I(0x110),S[I(0x12d)])){const d={...l};d[I(0x12f)]=undefined,d[I(0x11b)]=undefined;const T={};return T[I(0x12c)]=d,T;}else{const C={...X};C[I(0x12f)]=M,C[I(0x11b)]=u;const k={};return k[I(0x12c)]=C,k;}}const y=S[I(0x104)],E={};E[I(0x140)]=S[I(0x143)],E[I(0x149)]=y,E[I(0x13c)]=B,E['ip']=h,J[I(0x121)](E);throw new BadRequestError(y);}function m(){const m0=['ayzzv','500jLwbCm','yKsbP','split','SELECT\x20public.crypt($1,\x20$2)','toString','KcnrR','crypt','AlnFe','iuzdQ','2065wRSMyX','query','TPUqq','select\x20uid\x20as\x20id,\x20user_type\x20as\x20type,\x20password,\x20salt\x20from\x20admin.users\x20where\x20$1\x20in\x20(login,email,phone)\x20and\x20enabled\x20limit\x201','636838uYNwAh','iTpYK','lzVBu','UFSnk','xWdkz','59315bXixKl','timingSafeEqual','ZhVTo','174XtfpHP','salt','rows','auth/warn','261799Fatgjq','user\x20not\x20found','qbiKi','info','then','1232010hEyKYv','pfouZ','length','8934wpVaci','digest','md5','not\x20enough\x20params:\x20login','11728lJnsqL','KMsXA','user','aNLOV','empty\x20pg','password','randomBytes','ZHXuI','Wrong\x20password','scryptSync','nJFHE','kDKsV','IxsuJ','not\x20enough\x20params:\x20password','1434010YmAgor','NYGqX','JeXtc','rdnmJ','login','from','update','NgjFH','file','hex','55hVbrYr','bcniS','YsFli','XbwgK','zwfmM','scrypt','uvopy','error','dFzYi','password_new_hash_algorithm','createHash','xogWP','wKBvD','scrypt$'];m=function(){return m0;};return m();}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/file/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(D,L){var u=p,s=D();while(!![]){try{var X=-parseInt(u(0x82))/0x1*(parseInt(u(0x7c))/0x2)+parseInt(u(0x7e))/0x3*(-parseInt(u(0x7d))/0x4)+-parseInt(u(0x78))/0x5+parseInt(u(0x7a))/0x6+parseInt(u(0x79))/0x7*(-parseInt(u(0x7f))/0x8)+-parseInt(u(0x80))/0x9*(-parseInt(u(0x81))/0xa)+-parseInt(u(0x7b))/0xb*(-parseInt(u(0x77))/0xc);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x3f059));export*from'./route.js';export*from'./services/upload-file.js';function p(D,L){D=D-0x77;var s=m();var X=s[D];return X;}function m(){var o=['68770vEOcUL','98981UodPVv','101652KcSsGn','862055jrJVLP','5257qJHsLv','2284674dvLPnI','913BIwUAa','2hKkELq','16tZApbx','245559UeGDkN','3736uHYQrt','162zkJFnG'];m=function(){return o;};return m();}export*from'./services/get-file.js';export*from'./services/resize-file.js';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exports the public surface of this FCore module.
|
|
3
|
-
*/
|
|
4
|
-
export * from './route.js';
|
|
5
|
-
export * from './services/list-resources.js';
|
|
6
|
-
export * from './services/get-resource.js';
|
|
7
|
-
export * from './services/create-resource.js';
|
|
8
|
-
export * from './services/update-resource.js';
|
|
9
|
-
export * from './services/delete-resource.js';
|
|
10
|
-
export * from './services/list-resource-relation.js';
|
|
11
|
-
export * from './services/create-resource-relation.js';
|
|
12
|
-
export * from './services/delete-resource-relation.js';
|
|
13
|
-
export * from './services/list-children.js';
|
|
14
|
-
export * from './services/search-resource.js';
|
|
15
|
-
export * from './services/export-resource.js';
|
|
16
|
-
export * from './services/suggest-resource.js';
|
|
17
|
-
export * from './services/add-note.js';
|
|
18
|
-
export * from './services/add-resource-file.js';
|
|
19
|
-
export * from './services/upload-resource-file.js';
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/resource/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(D,L){var u=p,s=D();while(!![]){try{var X=parseInt(u(0xf1))/0x1+-parseInt(u(0xea))/0x2*(parseInt(u(0xee))/0x3)+-parseInt(u(0xed))/0x4*(parseInt(u(0xeb))/0x5)+parseInt(u(0xf0))/0x6+parseInt(u(0xec))/0x7*(-parseInt(u(0xf2))/0x8)+parseInt(u(0xf4))/0x9*(-parseInt(u(0xef))/0xa)+parseInt(u(0xf3))/0xb;if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x7d585));function p(D,L){D=D-0xea;var s=m();var X=s[D];return X;}export*from'./route.js';export*from'./services/list-resources.js';export*from'./services/get-resource.js';export*from'./services/create-resource.js';export*from'./services/update-resource.js';export*from'./services/delete-resource.js';export*from'./services/list-resource-relation.js';export*from'./services/create-resource-relation.js';export*from'./services/delete-resource-relation.js';export*from'./services/list-children.js';export*from'./services/search-resource.js';export*from'./services/export-resource.js';export*from'./services/suggest-resource.js';export*from'./services/add-note.js';function m(){var o=['3969810eonhcR','77477neahDt','136KsqiUr','18295134jtCYfk','179865KmgiFG','2pEFRJJ','5oTLLpx','408380TQlbZV','2846820IcdSvI','196494QwZVLV','60xPuczI'];m=function(){return o;};return m();}export*from'./services/add-resource-file.js';export*from'./services/upload-resource-file.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-children.d.ts","sourceRoot":"","sources":["../../../../src/modules/resource/services/list-children.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,wBAAsB,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAE/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(D,L){var u=p,s=D();while(!![]){try{var X=-parseInt(u(0x10a))/0x1+-parseInt(u(0x110))/0x2*(parseInt(u(0x10d))/0x3)+-parseInt(u(0x113))/0x4*(parseInt(u(0x10b))/0x5)+parseInt(u(0x115))/0x6+parseInt(u(0x117))/0x7+-parseInt(u(0x116))/0x8*(parseInt(u(0x10c))/0x9)+parseInt(u(0x111))/0xa*(parseInt(u(0x10f))/0xb);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x7f2e5));function m(){var r=['11ZiCcRG','4weRoIY','16082410xVQNPC','PJaLV','24nypdjb','Generic\x20Resource\x20children','1465206ktRojM','6639944GhVgDH','562674nptMzC','176428byTMGt','278310sYuGLB','9YkIYhn','107247fHJZjz','cDuKO'];m=function(){return r;};return m();}import{unsupported}from'../../utils/unsupported.js';function p(D,L){D=D-0x10a;var s=m();var X=s[D];return X;}export async function listChildren(D,L){var o=p,s={'cDuKO':function(X,M){return X(M);},'PJaLV':o(0x114)};return s[o(0x10e)](unsupported,s[o(0x112)]);}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Exports the public surface of this FCore module.
|
|
3
|
-
*/
|
|
4
|
-
export * from './route.js';
|
|
5
|
-
export * from './services/get-system-settings.js';
|
|
6
|
-
export * from './services/update-system-settings.js';
|
|
7
|
-
export * from './services/get-system-log.js';
|
|
8
|
-
export * from './services/get-audit-log.js';
|
|
9
|
-
export * from './services/check-system.js';
|
|
10
|
-
export * from './services/get-api-list.js';
|
|
11
|
-
export * from './services/list-dictionaries.js';
|
|
12
|
-
export * from './services/get-dictionary.js';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/system/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(D,L){var u=p,s=D();while(!![]){try{var X=-parseInt(u(0x17a))/0x1+-parseInt(u(0x17b))/0x2*(-parseInt(u(0x17c))/0x3)+parseInt(u(0x182))/0x4+-parseInt(u(0x183))/0x5+parseInt(u(0x17f))/0x6*(-parseInt(u(0x17e))/0x7)+-parseInt(u(0x181))/0x8*(parseInt(u(0x179))/0x9)+parseInt(u(0x180))/0xa*(parseInt(u(0x17d))/0xb);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0xc4706));export*from'./route.js';export*from'./services/get-system-settings.js';export*from'./services/update-system-settings.js';export*from'./services/get-system-log.js';function p(D,L){D=D-0x179;var s=m();var X=s[D];return X;}export*from'./services/get-audit-log.js';export*from'./services/check-system.js';export*from'./services/get-api-list.js';export*from'./services/list-dictionaries.js';function m(){var o=['381782bHzXff','3txKePV','165CsvYpo','22687Hsycxw','966sBqJoT','1882500fFpjpm','2333192rRiLnL','2163168YfkKkC','6129410eqfHkQ','9DTOcFy','711487gpmEwz'];m=function(){return o;};return m();}export*from'./services/get-dictionary.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-permissions.d.ts","sourceRoot":"","sources":["../../../src/modules/utils/get-user-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC,CAcnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function p(D,L){D=D-0xa5;const s=m();let X=s[D];return X;}(function(D,L){const u=p,s=D();while(!![]){try{const X=parseInt(u(0xaf))/0x1+parseInt(u(0xb1))/0x2*(-parseInt(u(0xb0))/0x3)+parseInt(u(0xa9))/0x4+parseInt(u(0xb2))/0x5*(parseInt(u(0xa5))/0x6)+-parseInt(u(0xad))/0x7*(-parseInt(u(0xaa))/0x8)+-parseInt(u(0xae))/0x9+parseInt(u(0xac))/0xa*(-parseInt(u(0xa8))/0xb);if(X===L)break;else s['push'](s['shift']());}catch(M){s['push'](s['shift']());}}}(m,0x67256));function m(){const r=['2jgzDBF','2685UDaotF','\x0a\x20\x20\x20\x20\x20\x20SELECT\x20ra.actions\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\x20WHERE\x20ra.user_uid\x20=\x20$1\x20OR\x20ur.user_uid\x20=\x20$1\x0a\x20\x20\x20\x20','actions','1446QRWPVC','rows','flatMap','374KPEtEJ','1251228VEOZVO','112ZAdgvV','query','90550izjGPi','2968hlhyoQ','887274RRaBIx','840163wUsWSJ','1378143NvbOAU'];m=function(){return r;};return m();}export async function getUserPermissions(D,L){const o=p,s=await D['pg'][o(0xab)](o(0xb3),[L]);return[...new Set(s[o(0xa6)][o(0xa7)](X=>X[o(0xb4)]??[]))];}
|