@aristid/leav-types 1.3.0 → 1.4.0
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/apps/core/config/default.d.ts +13 -7
- package/apps/core/config/development.d.ts +3 -1
- package/apps/core/src/__tests__/mocks/shared.d.ts +1 -0
- package/apps/core/src/_types/config.d.ts +10 -8
- package/apps/core/src/_types/permissions.d.ts +1 -0
- package/apps/core/src/_types/record.d.ts +2 -0
- package/apps/core/src/app/application/applicationApp.d.ts +4 -3
- package/apps/core/src/app/auth/authApp.d.ts +2 -2
- package/apps/core/src/app/core/globalSettingsApp.d.ts +2 -2
- package/apps/core/src/app/core/importApp.d.ts +3 -1
- package/apps/core/src/app/core/tasksManagerApp.d.ts +2 -2
- package/apps/core/src/domain/eventsManager/eventsManagerDomain.d.ts +2 -2
- package/apps/core/src/domain/filesManager/filesManagerDomain.d.ts +5 -3
- package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/_types.d.ts +2 -2
- package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/handleFileSystemEvent.d.ts +2 -2
- package/apps/core/src/domain/filesManager/helpers/handleFileUtilsHelper.d.ts +2 -2
- package/apps/core/src/domain/filesManager/helpers/handlePreview.d.ts +2 -2
- package/apps/core/src/domain/filesManager/helpers/handlePreviewResponse.d.ts +4 -3
- package/apps/core/src/domain/filesManager/helpers/messagesHandler/messagesHandler.d.ts +2 -2
- package/apps/core/src/domain/form/formDomain.d.ts +2 -2
- package/apps/core/src/domain/form/helpers/getElementValues.d.ts +2 -2
- package/apps/core/src/domain/import/importDomain.d.ts +2 -2
- package/apps/core/src/domain/indexationManager/indexationManagerDomain.d.ts +2 -2
- package/apps/core/src/domain/permission/helpers/index.d.ts +1 -0
- package/apps/core/src/domain/permission/helpers/recordInCreationBypass.d.ts +6 -0
- package/apps/core/src/domain/permission/recordAttributePermissionDomain.d.ts +4 -0
- package/apps/core/src/domain/permission/recordPermissionDomain.d.ts +5 -1
- package/apps/core/src/domain/record/helpers/createRecord.d.ts +3 -6
- package/apps/core/src/domain/record/recordDomain.d.ts +5 -8
- package/apps/core/src/domain/tasksManager/tasksManagerDomain.d.ts +5 -3
- package/apps/core/src/domain/value/helpers/formatLogValue.d.ts +2 -2
- package/apps/core/src/domain/value/valueDomain.d.ts +2 -2
- package/apps/core/src/infra/application/applicationRepo.d.ts +2 -2
- package/apps/core/src/infra/db/dbUtils.d.ts +5 -3
- package/apps/core/src/infra/db/helpers/runMigrationFiles.d.ts +2 -2
- package/apps/core/src/infra/filesManager/filesManagerRepo.d.ts +2 -2
- package/apps/core/src/infra/record/recordRepo.d.ts +0 -1
- package/apps/core/src/interface/helpers/handleGraphqlError.d.ts +2 -2
- package/apps/core/src/interface/server.d.ts +4 -4
- package/apps/core/src/utils/helpers/getSystemQueryContext.d.ts +1 -1
- package/apps/core/src/utils/logger/logger.d.ts +3 -6
- package/apps/core/src/utils/utils.d.ts +1 -0
- package/libs/logger/src/config.d.ts +7 -1
- package/libs/utils/src/types/forms.d.ts +1 -0
- package/package.json +3 -4
- package/apps/core/src/utils/preview/preview.d.ts +0 -1
|
@@ -4,7 +4,7 @@ export declare namespace server {
|
|
|
4
4
|
let host: string;
|
|
5
5
|
let port: number;
|
|
6
6
|
let publicUrl: string;
|
|
7
|
-
let
|
|
7
|
+
let basePath: string;
|
|
8
8
|
let allowIntrospection: boolean;
|
|
9
9
|
let uploadLimit: string;
|
|
10
10
|
let supportEmail: string;
|
|
@@ -75,6 +75,14 @@ export declare namespace bugsnag {
|
|
|
75
75
|
export let apiKey: string;
|
|
76
76
|
export let appVersion: string;
|
|
77
77
|
export let appType: string;
|
|
78
|
+
export let releaseStage: string;
|
|
79
|
+
}
|
|
80
|
+
export declare namespace matomo {
|
|
81
|
+
let enable_2: boolean;
|
|
82
|
+
export { enable_2 as enable };
|
|
83
|
+
let url_1: string;
|
|
84
|
+
export { url_1 as url };
|
|
85
|
+
export let siteId: string;
|
|
78
86
|
}
|
|
79
87
|
export declare namespace lang {
|
|
80
88
|
export let available: string | string[];
|
|
@@ -131,8 +139,6 @@ export declare namespace filesManager {
|
|
|
131
139
|
namespace rootKeys {
|
|
132
140
|
let files1: string;
|
|
133
141
|
}
|
|
134
|
-
let userId: string;
|
|
135
|
-
let userGroupsIds: string;
|
|
136
142
|
let allowFilesList: string;
|
|
137
143
|
let ignoreFilesList: string;
|
|
138
144
|
}
|
|
@@ -201,13 +207,13 @@ export declare namespace files {
|
|
|
201
207
|
let originalsPathPrefix: string;
|
|
202
208
|
}
|
|
203
209
|
export declare namespace dbProfiler {
|
|
204
|
-
let
|
|
205
|
-
export {
|
|
210
|
+
let enable_3: boolean;
|
|
211
|
+
export { enable_3 as enable };
|
|
206
212
|
}
|
|
207
213
|
export declare namespace elasticSearch {
|
|
208
214
|
export let indexPrefix: string;
|
|
209
|
-
let
|
|
210
|
-
export {
|
|
215
|
+
let url_2: string;
|
|
216
|
+
export { url_2 as url };
|
|
211
217
|
}
|
|
212
218
|
export declare let pluginsPath: string | any[];
|
|
213
219
|
export { _export as export, _import as import };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export namespace server {
|
|
2
|
-
let publicUrl: string;
|
|
3
2
|
let allowIntrospection: boolean;
|
|
4
3
|
}
|
|
5
4
|
export namespace logs {
|
|
@@ -16,3 +15,6 @@ export let debug: boolean;
|
|
|
16
15
|
export namespace dbProfiler {
|
|
17
16
|
let enable: boolean;
|
|
18
17
|
}
|
|
18
|
+
export namespace bugsnag {
|
|
19
|
+
let releaseStage: string;
|
|
20
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ILoggerConfig } from '@leav/logger';
|
|
1
2
|
import { type Options } from 'amqplib';
|
|
2
3
|
import { type IKeyValue } from './shared';
|
|
3
4
|
export interface IConfig {
|
|
@@ -31,6 +32,7 @@ export interface IConfig {
|
|
|
31
32
|
elasticSearch: IElasticSearchConfig;
|
|
32
33
|
pluginsPath: string[];
|
|
33
34
|
bugsnag: IBugsnag;
|
|
35
|
+
matomo: IMatomo;
|
|
34
36
|
}
|
|
35
37
|
export declare enum CoreMode {
|
|
36
38
|
SERVER = "server",
|
|
@@ -45,8 +47,8 @@ export interface IServer {
|
|
|
45
47
|
host: string;
|
|
46
48
|
port: number;
|
|
47
49
|
publicUrl: string;
|
|
50
|
+
basePath: string;
|
|
48
51
|
allowIntrospection: boolean;
|
|
49
|
-
wsUrl: string;
|
|
50
52
|
uploadLimit: number | string;
|
|
51
53
|
supportEmail: string;
|
|
52
54
|
admin: {
|
|
@@ -104,11 +106,7 @@ export interface ILang {
|
|
|
104
106
|
available: string[];
|
|
105
107
|
default: string;
|
|
106
108
|
}
|
|
107
|
-
export
|
|
108
|
-
level: string;
|
|
109
|
-
transport: string;
|
|
110
|
-
destinationFile?: string;
|
|
111
|
-
}
|
|
109
|
+
export type ILogs = ILoggerConfig;
|
|
112
110
|
export interface IPermissions {
|
|
113
111
|
default: boolean;
|
|
114
112
|
enableCache: boolean;
|
|
@@ -138,8 +136,6 @@ export interface IFilesManager {
|
|
|
138
136
|
rootKeys: {
|
|
139
137
|
files1: string;
|
|
140
138
|
};
|
|
141
|
-
userId: string;
|
|
142
|
-
userGroupsIds: string;
|
|
143
139
|
allowFilesList: string;
|
|
144
140
|
ignoreFilesList: string;
|
|
145
141
|
}
|
|
@@ -235,4 +231,10 @@ export interface IBugsnag {
|
|
|
235
231
|
apiKey?: string;
|
|
236
232
|
appVersion?: string;
|
|
237
233
|
appType?: string;
|
|
234
|
+
releaseStage?: string;
|
|
235
|
+
}
|
|
236
|
+
export interface IMatomo {
|
|
237
|
+
enable: boolean;
|
|
238
|
+
url?: string;
|
|
239
|
+
siteId?: string;
|
|
238
240
|
}
|
|
@@ -20,6 +20,7 @@ export declare enum LibraryPermissionsActions {
|
|
|
20
20
|
}
|
|
21
21
|
export declare enum RecordPermissionsActions {
|
|
22
22
|
ACCESS_RECORD = "access_record",
|
|
23
|
+
ACCESS_RECORD_BY_DEFAULT = "access_record_by_default",
|
|
23
24
|
CREATE_RECORD = "create_record",
|
|
24
25
|
EDIT_RECORD = "edit_record",
|
|
25
26
|
DELETE_RECORD = "delete_record"
|
|
@@ -10,8 +10,10 @@ export interface IRecord {
|
|
|
10
10
|
modified_at?: number;
|
|
11
11
|
modified_by?: string;
|
|
12
12
|
active?: boolean;
|
|
13
|
+
[CORE_IN_CREATION_BY]?: string;
|
|
13
14
|
[attributeName: string]: any;
|
|
14
15
|
}
|
|
16
|
+
export declare const CORE_IN_CREATION_BY = "__in_creation_by__";
|
|
15
17
|
export declare enum Operator {
|
|
16
18
|
AND = "AND",
|
|
17
19
|
OR = "OR",
|
|
@@ -5,12 +5,13 @@ import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDom
|
|
|
5
5
|
import { type IPermissionDomain } from 'domain/permission/permissionDomain';
|
|
6
6
|
import { type IRecordDomain } from 'domain/record/recordDomain';
|
|
7
7
|
import { type IUtils } from 'utils/utils';
|
|
8
|
-
import type
|
|
8
|
+
import { type ILogger } from '@leav/logger';
|
|
9
9
|
import { type IApplicationDomain } from '../../domain/application/applicationDomain';
|
|
10
10
|
import { type ValidateRequestTokenFunc } from '../helpers/validateRequestToken';
|
|
11
11
|
import { type IAuthApp } from '../auth/authApp';
|
|
12
12
|
import { type IGlobalSettingsDomain } from '../../domain/globalSettings/globalSettingsDomain';
|
|
13
13
|
import { type IServerRouteAppModule } from 'interface/server';
|
|
14
|
+
import { type IConfig } from '_types/config';
|
|
14
15
|
export type IApplicationApp = IGraphqlAppModule & IServerRouteAppModule;
|
|
15
16
|
export interface IApplicationAppDeps {
|
|
16
17
|
'core.app.graphql': IGraphqlApp;
|
|
@@ -23,8 +24,8 @@ export interface IApplicationAppDeps {
|
|
|
23
24
|
'core.domain.record': IRecordDomain;
|
|
24
25
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
25
26
|
'core.domain.globalSettings': IGlobalSettingsDomain;
|
|
26
|
-
'core.utils.logger':
|
|
27
|
+
'core.utils.logger': ILogger;
|
|
27
28
|
'core.utils': IUtils;
|
|
28
|
-
config:
|
|
29
|
+
config: IConfig;
|
|
29
30
|
}
|
|
30
31
|
export default function ({ 'core.app.graphql': graphqlApp, 'core.app.auth': authApp, 'core.app.helpers.initQueryContext': initQueryContext, 'core.app.helpers.validateRequestToken': validateRequestToken, 'core.app.core.subscriptionsHelper': subscriptionsHelper, 'core.domain.application': applicationDomain, 'core.domain.permission': permissionDomain, 'core.domain.record': recordDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.globalSettings': globalSettings, 'core.utils.logger': logger, 'core.utils': utils, config }: IApplicationAppDeps): IApplicationApp;
|
|
@@ -7,7 +7,7 @@ import { type IConfig } from '_types/config';
|
|
|
7
7
|
import { type ICachesService } from '../../infra/cache/cacheService';
|
|
8
8
|
import { type ITokenUserData } from '../../_types/auth';
|
|
9
9
|
import { type IRequestWithContext } from '../../_types/express';
|
|
10
|
-
import type
|
|
10
|
+
import { type ILogger } from '@leav/logger';
|
|
11
11
|
import { type IOIDCClientService } from '../../infra/oidc/oidcClientService';
|
|
12
12
|
import { type InitQueryContextFunc } from '../helpers/initQueryContext';
|
|
13
13
|
import { type IConvertOIDCIdentifier } from '../helpers/convertOIDCIdentifier';
|
|
@@ -30,7 +30,7 @@ export interface IAuthAppDeps {
|
|
|
30
30
|
'core.domain.apiKey': IApiKeyDomain;
|
|
31
31
|
'core.domain.user': IUserDomain;
|
|
32
32
|
'core.infra.cache.cacheService': ICachesService;
|
|
33
|
-
'core.utils.logger':
|
|
33
|
+
'core.utils.logger': ILogger;
|
|
34
34
|
'core.infra.oidc.oidcClientService': IOIDCClientService;
|
|
35
35
|
'core.app.helpers.initQueryContext': InitQueryContextFunc;
|
|
36
36
|
'core.app.helpers.convertOIDCIdentifier': IConvertOIDCIdentifier;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type InitQueryContextFunc } from 'app/helpers/initQueryContext';
|
|
2
2
|
import { type IRecordDomain } from 'domain/record/recordDomain';
|
|
3
3
|
import { type IUtils } from 'utils/utils';
|
|
4
|
-
import type
|
|
4
|
+
import { type ILogger } from '@leav/logger';
|
|
5
5
|
import { type IConfig } from '_types/config';
|
|
6
6
|
import { type IAppModule } from '_types/shared';
|
|
7
7
|
import { type IGlobalSettingsDomain } from '../../domain/globalSettings/globalSettingsDomain';
|
|
@@ -12,7 +12,7 @@ interface IDeps {
|
|
|
12
12
|
'core.app.helpers.initQueryContext': InitQueryContextFunc;
|
|
13
13
|
'core.domain.globalSettings': IGlobalSettingsDomain;
|
|
14
14
|
'core.domain.record': IRecordDomain;
|
|
15
|
-
'core.utils.logger':
|
|
15
|
+
'core.utils.logger': ILogger;
|
|
16
16
|
'core.utils': IUtils;
|
|
17
17
|
config: IConfig;
|
|
18
18
|
}
|
|
@@ -3,6 +3,7 @@ import { type IImportDomain } from 'domain/import/importDomain';
|
|
|
3
3
|
import { type IUtils } from 'utils/utils';
|
|
4
4
|
import type * as Config from '_types/config';
|
|
5
5
|
import { type IGraphqlAppModule } from '../graphql/graphqlApp';
|
|
6
|
+
import { type GetSystemQueryContext } from '../../utils/helpers/getSystemQueryContext';
|
|
6
7
|
export interface ICoreImportApp extends IGraphqlAppModule {
|
|
7
8
|
importConfig(filepath: string, clear: boolean): Promise<void>;
|
|
8
9
|
importData(filepath: string): Promise<void>;
|
|
@@ -12,6 +13,7 @@ interface IDeps {
|
|
|
12
13
|
'core.domain.helpers.storeUploadFile': StoreUploadFileFunc;
|
|
13
14
|
'core.utils': IUtils;
|
|
14
15
|
config: Config.IConfig;
|
|
16
|
+
'core.utils.getSystemQueryContext': GetSystemQueryContext;
|
|
15
17
|
}
|
|
16
|
-
export default function ({ 'core.domain.import': importDomain, 'core.domain.helpers.storeUploadFile': storeUploadFile, 'core.utils': utils, config }: IDeps): ICoreImportApp;
|
|
18
|
+
export default function ({ 'core.domain.import': importDomain, 'core.domain.helpers.storeUploadFile': storeUploadFile, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext, config }: IDeps): ICoreImportApp;
|
|
17
19
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDomain';
|
|
2
2
|
import { type IRecordDomain } from 'domain/record/recordDomain';
|
|
3
3
|
import { type IUtils } from 'utils/utils';
|
|
4
|
-
import type
|
|
4
|
+
import { type ILogger } from '@leav/logger';
|
|
5
5
|
import { type IConfig } from '_types/config';
|
|
6
6
|
import { type IPaginationParams, type ISortParams } from '_types/list';
|
|
7
7
|
import { type ITasksManagerDomain } from '../../domain/tasksManager/tasksManagerDomain';
|
|
@@ -13,7 +13,7 @@ export interface ITasksManagerApp extends IGraphqlAppModule {
|
|
|
13
13
|
}
|
|
14
14
|
interface IDeps {
|
|
15
15
|
'core.domain.tasksManager'?: ITasksManagerDomain;
|
|
16
|
-
'core.utils.logger'?:
|
|
16
|
+
'core.utils.logger'?: ILogger;
|
|
17
17
|
config?: IConfig;
|
|
18
18
|
'core.utils'?: IUtils;
|
|
19
19
|
'core.domain.record'?: IRecordDomain;
|
|
@@ -2,7 +2,7 @@ import { type IAmqpService } from '@leav/message-broker';
|
|
|
2
2
|
import { EventAction, type IPubSubPayload } from '@leav/utils';
|
|
3
3
|
import type * as amqp from 'amqplib';
|
|
4
4
|
import { type IUtils } from 'utils/utils';
|
|
5
|
-
import type
|
|
5
|
+
import { type ILogger } from '@leav/logger';
|
|
6
6
|
import type * as Config from '_types/config';
|
|
7
7
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
8
8
|
import { type IDbPayloadInternal } from '_types/events';
|
|
@@ -18,7 +18,7 @@ export interface IEventsManagerDomain {
|
|
|
18
18
|
export interface IEventsManagerDomainDeps {
|
|
19
19
|
config: Config.IConfig;
|
|
20
20
|
'core.infra.amqpService': IAmqpService;
|
|
21
|
-
'core.utils.logger':
|
|
21
|
+
'core.utils.logger': ILogger;
|
|
22
22
|
'core.utils': IUtils;
|
|
23
23
|
}
|
|
24
24
|
export default function ({ config, 'core.infra.amqpService': amqpService, 'core.utils.logger': logger, 'core.utils': utils }: IEventsManagerDomainDeps): IEventsManagerDomain;
|
|
@@ -12,13 +12,14 @@ import { type FileUpload } from 'graphql-upload';
|
|
|
12
12
|
import { type i18n } from 'i18next';
|
|
13
13
|
import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
14
14
|
import { type IUtils } from 'utils/utils';
|
|
15
|
-
import type
|
|
15
|
+
import { type ILogger } from '@leav/logger';
|
|
16
16
|
import type * as Config from '_types/config';
|
|
17
17
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
18
18
|
import { type ILibrary } from '../../_types/library';
|
|
19
19
|
import { type IRecord, type IRecordFilterLight } from '../../_types/record';
|
|
20
20
|
import { type IRecordDomain } from '../record/recordDomain';
|
|
21
21
|
import { type IMessagesHandlerHelper } from './helpers/messagesHandler/messagesHandler';
|
|
22
|
+
import { type GetSystemQueryContext } from '../../utils/helpers/getSystemQueryContext';
|
|
22
23
|
interface IForcePreviewsGenerationParams {
|
|
23
24
|
ctx: IQueryInfos;
|
|
24
25
|
libraryId: string;
|
|
@@ -69,7 +70,7 @@ export interface IFilesManagerDomainDeps {
|
|
|
69
70
|
config: Config.IConfig;
|
|
70
71
|
'core.utils': IUtils;
|
|
71
72
|
'core.infra.amqpService': IAmqpService;
|
|
72
|
-
'core.utils.logger':
|
|
73
|
+
'core.utils.logger': ILogger;
|
|
73
74
|
'core.domain.record': IRecordDomain;
|
|
74
75
|
'core.domain.value': IValueDomain;
|
|
75
76
|
'core.domain.tree': ITreeDomain;
|
|
@@ -82,7 +83,8 @@ export interface IFilesManagerDomainDeps {
|
|
|
82
83
|
'core.domain.helpers.createDirectory': CreateDirectoryFunc;
|
|
83
84
|
'core.infra.record': IRecordRepo;
|
|
84
85
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
86
|
+
'core.utils.getSystemQueryContext': GetSystemQueryContext;
|
|
85
87
|
translator: i18n;
|
|
86
88
|
}
|
|
87
|
-
export default function ({ config, 'core.utils': utils, 'core.infra.amqpService': amqpService, 'core.utils.logger': logger, 'core.domain.record': recordDomain, 'core.domain.value': valueDomain, 'core.domain.tree': treeDomain, 'core.domain.permission.library': libraryPermissionDomain, 'core.domain.filesManager.helpers.messagesHandler': messagesHandler, 'core.domain.helpers.storeUploadFile': storeUploadFile, 'core.domain.helpers.createDirectory': createDirectory, 'core.domain.library': libraryDomain, 'core.domain.helpers.updateRecordLastModif': updateRecordLastModif, 'core.domain.record.helpers.sendRecordUpdateEvent': sendRecordUpdateEvent, 'core.domain.eventsManager': eventsManager, 'core.infra.record': recordRepo, translator }: IFilesManagerDomainDeps): IFilesManagerDomain;
|
|
89
|
+
export default function ({ config, 'core.utils': utils, 'core.infra.amqpService': amqpService, 'core.utils.logger': logger, 'core.domain.record': recordDomain, 'core.domain.value': valueDomain, 'core.domain.tree': treeDomain, 'core.domain.permission.library': libraryPermissionDomain, 'core.domain.filesManager.helpers.messagesHandler': messagesHandler, 'core.domain.helpers.storeUploadFile': storeUploadFile, 'core.domain.helpers.createDirectory': createDirectory, 'core.domain.library': libraryDomain, 'core.domain.helpers.updateRecordLastModif': updateRecordLastModif, 'core.domain.record.helpers.sendRecordUpdateEvent': sendRecordUpdateEvent, 'core.domain.eventsManager': eventsManager, 'core.infra.record': recordRepo, 'core.utils.getSystemQueryContext': getSystemQueryContext, translator }: IFilesManagerDomainDeps): IFilesManagerDomain;
|
|
88
90
|
export {};
|
|
@@ -8,7 +8,7 @@ import { type IValueDomain } from 'domain/value/valueDomain';
|
|
|
8
8
|
import { type IFilesManagerRepo } from 'infra/filesManager/filesManagerRepo';
|
|
9
9
|
import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
10
10
|
import { type IUtils } from 'utils/utils';
|
|
11
|
-
import type
|
|
11
|
+
import { type ILogger } from '@leav/logger';
|
|
12
12
|
import { type IConfig } from '_types/config';
|
|
13
13
|
import { type IFileEventData } from '_types/filesManager';
|
|
14
14
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
@@ -20,7 +20,7 @@ export interface IHandleFileSystemEventDeps {
|
|
|
20
20
|
recordRepo: IRecordRepo;
|
|
21
21
|
amqpService: IAmqpService;
|
|
22
22
|
updateRecordLastModif: UpdateRecordLastModifFunc;
|
|
23
|
-
logger:
|
|
23
|
+
logger: ILogger;
|
|
24
24
|
config: IConfig;
|
|
25
25
|
utils: IUtils;
|
|
26
26
|
filesManagerRepo: IFilesManagerRepo;
|
package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/handleFileSystemEvent.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
|
10
10
|
import { type IUtils } from 'utils/utils';
|
|
11
11
|
import { type IConfig } from '_types/config';
|
|
12
12
|
import { type HandleFileSystemEventFunc } from './_types';
|
|
13
|
-
import
|
|
13
|
+
import { type ILogger } from '@leav/logger';
|
|
14
14
|
export interface IFileSystemEventDeps {
|
|
15
15
|
'core.domain.library': ILibraryDomain;
|
|
16
16
|
'core.domain.record': IRecordDomain;
|
|
@@ -21,7 +21,7 @@ export interface IFileSystemEventDeps {
|
|
|
21
21
|
'core.infra.record': IRecordRepo;
|
|
22
22
|
'core.infra.amqpService': IAmqpService;
|
|
23
23
|
'core.infra.filesManager': IFilesManagerRepo;
|
|
24
|
-
'core.utils.logger':
|
|
24
|
+
'core.utils.logger': ILogger;
|
|
25
25
|
'core.utils': IUtils;
|
|
26
26
|
config: IConfig;
|
|
27
27
|
}
|
|
@@ -8,7 +8,7 @@ import { type IQueryInfos } from '_types/queryInfos';
|
|
|
8
8
|
import { type IFileMetadata, type IPreviews, type IPreviewsStatus } from '../../../_types/filesManager';
|
|
9
9
|
import { type IRecord } from '../../../_types/record';
|
|
10
10
|
import { type IHandleFileSystemEventDeps } from './handleFileSystemEvent/_types';
|
|
11
|
-
import
|
|
11
|
+
import { type ILogger } from '@leav/logger';
|
|
12
12
|
export declare const getRecord: ({ fileName, filePath, fileInode }: {
|
|
13
13
|
fileName: string;
|
|
14
14
|
filePath: string;
|
|
@@ -25,7 +25,7 @@ export declare const updateRecordFile: (recordData: IFileMetadata, recordId: str
|
|
|
25
25
|
updateRecordLastModif: UpdateRecordLastModifFunc;
|
|
26
26
|
sendRecordUpdateEvent: SendRecordUpdateEventHelper;
|
|
27
27
|
config: Config.IConfig;
|
|
28
|
-
logger:
|
|
28
|
+
logger: ILogger;
|
|
29
29
|
}, ctx: IQueryInfos) => Promise<void>;
|
|
30
30
|
export declare const getInputData: (input: string) => {
|
|
31
31
|
filePath: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IAmqpService } from '@leav/message-broker';
|
|
2
2
|
import { PreviewPriority } from '@leav/utils';
|
|
3
|
-
import type
|
|
3
|
+
import { type ILogger } from '@leav/logger';
|
|
4
4
|
import type * as Config from '_types/config';
|
|
5
5
|
import { type IPreviewMessage, type IPreviewVersion } from '../../../_types/filesManager';
|
|
6
6
|
export declare const sendPreviewMessage: (previewMessage: IPreviewMessage, priority: PreviewPriority, deps: {
|
|
@@ -15,7 +15,7 @@ export declare const requestPreviewGeneration: ({ recordId, pathAfter, libraryId
|
|
|
15
15
|
versions: IPreviewVersion[];
|
|
16
16
|
priority?: PreviewPriority;
|
|
17
17
|
deps: {
|
|
18
|
-
logger:
|
|
18
|
+
logger: ILogger;
|
|
19
19
|
amqpService: IAmqpService;
|
|
20
20
|
config: Config.IConfig;
|
|
21
21
|
};
|
|
@@ -7,7 +7,8 @@ import { type IValueDomain } from 'domain/value/valueDomain';
|
|
|
7
7
|
import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
8
8
|
import { type IUtils } from 'utils/utils';
|
|
9
9
|
import type * as Config from '_types/config';
|
|
10
|
-
import
|
|
10
|
+
import { type IQueryInfos } from '_types/queryInfos';
|
|
11
|
+
import { type ILogger } from '@leav/logger';
|
|
11
12
|
export interface IHandlePreviewResponseDeps {
|
|
12
13
|
amqpService: IAmqpService;
|
|
13
14
|
libraryDomain: ILibraryDomain;
|
|
@@ -17,7 +18,7 @@ export interface IHandlePreviewResponseDeps {
|
|
|
17
18
|
updateRecordLastModif: UpdateRecordLastModifFunc;
|
|
18
19
|
sendRecordUpdateEvent: SendRecordUpdateEventHelper;
|
|
19
20
|
config: Config.IConfig;
|
|
20
|
-
logger:
|
|
21
|
+
logger: ILogger;
|
|
21
22
|
utils: IUtils;
|
|
22
23
|
}
|
|
23
|
-
export declare const initPreviewResponseHandler: (config: Config.IConfig, logger:
|
|
24
|
+
export declare const initPreviewResponseHandler: (config: Config.IConfig, logger: ILogger, ctx: IQueryInfos, deps: IHandlePreviewResponseDeps) => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ILogger } from '@leav/logger';
|
|
2
2
|
import { type IConfig } from '_types/config';
|
|
3
3
|
import { type IFileEventData } from '_types/filesManager';
|
|
4
4
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
@@ -7,7 +7,7 @@ export interface IMessagesHandlerHelper {
|
|
|
7
7
|
handleMessage(message: IFileEventData, ctx: IQueryInfos): any;
|
|
8
8
|
}
|
|
9
9
|
export interface IMessagesHandlerDeps {
|
|
10
|
-
'core.utils.logger':
|
|
10
|
+
'core.utils.logger': ILogger;
|
|
11
11
|
'core.domain.filesManager.helpers.handleFileSystemEvent': HandleFileSystemEventFunc;
|
|
12
12
|
config: IConfig;
|
|
13
13
|
}
|
|
@@ -9,7 +9,7 @@ import { type ITreeDomain } from 'domain/tree/treeDomain';
|
|
|
9
9
|
import { type i18n } from 'i18next';
|
|
10
10
|
import { type IFormRepo } from 'infra/form/formRepo';
|
|
11
11
|
import { type IUtils } from 'utils/utils';
|
|
12
|
-
import type
|
|
12
|
+
import { type ILogger } from '@leav/logger';
|
|
13
13
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
14
14
|
import { type IGetCoreEntitiesParams } from '_types/shared';
|
|
15
15
|
import { type IValueVersion } from '_types/value';
|
|
@@ -54,7 +54,7 @@ export interface IFormDomainDeps {
|
|
|
54
54
|
'core.domain.tree': ITreeDomain;
|
|
55
55
|
'core.infra.form': IFormRepo;
|
|
56
56
|
'core.utils': IUtils;
|
|
57
|
-
'core.utils.logger':
|
|
57
|
+
'core.utils.logger': ILogger;
|
|
58
58
|
translator: i18n;
|
|
59
59
|
}
|
|
60
60
|
export default function (deps: IFormDomainDeps): IFormDomain;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IRecordDomain } from 'domain/record/recordDomain';
|
|
2
2
|
import { type IUtils } from 'utils/utils';
|
|
3
|
-
import type
|
|
3
|
+
import { type ILogger } from '@leav/logger';
|
|
4
4
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
5
5
|
import { type IValue, type IValueVersion } from '_types/value';
|
|
6
6
|
import { type IFormElement } from '../../../_types/forms';
|
|
@@ -12,7 +12,7 @@ export declare const getElementValues: (params: {
|
|
|
12
12
|
deps: {
|
|
13
13
|
"core.domain.record"?: IRecordDomain;
|
|
14
14
|
"core.utils"?: IUtils;
|
|
15
|
-
"core.utils.logger"?:
|
|
15
|
+
"core.utils.logger"?: ILogger;
|
|
16
16
|
};
|
|
17
17
|
ctx: IQueryInfos;
|
|
18
18
|
}) => Promise<{
|
|
@@ -18,7 +18,7 @@ import { type IQueryInfos } from '../../_types/queryInfos';
|
|
|
18
18
|
import { type ITaskFuncParams } from '../../_types/tasksManager';
|
|
19
19
|
import { type IValidateHelper } from '../helpers/validate';
|
|
20
20
|
import { type IVersionProfileDomain } from '../versionProfile/versionProfileDomain';
|
|
21
|
-
import type
|
|
21
|
+
import { type ILogger } from '@leav/logger';
|
|
22
22
|
export declare const IMPORT_DATA_SCHEMA_PATH: string;
|
|
23
23
|
export declare const IMPORT_CONFIG_SCHEMA_PATH: string;
|
|
24
24
|
export interface IImportExcelParams {
|
|
@@ -76,7 +76,7 @@ export interface IImportDomainDeps {
|
|
|
76
76
|
config: Config.IConfig;
|
|
77
77
|
translator: i18n;
|
|
78
78
|
'core.utils': IUtils;
|
|
79
|
-
'core.utils.logger'?:
|
|
79
|
+
'core.utils.logger'?: ILogger;
|
|
80
80
|
}
|
|
81
81
|
export default function ({ 'core.domain.library': libraryDomain, 'core.domain.record': recordDomain, 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.value': valueDomain, 'core.domain.tree': treeDomain, 'core.domain.versionProfile': versionProfileDomain, 'core.domain.tasksManager': tasksManagerDomain, 'core.domain.permission': permissionDomain, 'core.domain.helpers.updateTaskProgress': updateTaskProgress, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.cache.cacheService': cacheService, 'core.infra.db.dbUtils': dbUtils, 'core.depsManager': depsManager, 'core.utils': utils, 'core.utils.logger': logger, config, translator }: IImportDomainDeps): IImportDomain;
|
|
82
82
|
export {};
|
|
@@ -6,7 +6,7 @@ import { type IRecordDomain } from 'domain/record/recordDomain';
|
|
|
6
6
|
import { type IFindRecordParams } from 'domain/record/_types';
|
|
7
7
|
import { type ITasksManagerDomain } from 'domain/tasksManager/tasksManagerDomain';
|
|
8
8
|
import { type i18n } from 'i18next';
|
|
9
|
-
import type
|
|
9
|
+
import { type ILogger } from '@leav/logger';
|
|
10
10
|
import type * as Config from '_types/config';
|
|
11
11
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
12
12
|
import { type IIndexationService } from '../../infra/indexation/indexationService';
|
|
@@ -34,7 +34,7 @@ export interface IIndexationManagerDomainDeps {
|
|
|
34
34
|
'core.infra.indexation.indexationService': IIndexationService;
|
|
35
35
|
'core.domain.tasksManager': ITasksManagerDomain;
|
|
36
36
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
37
|
-
'core.utils.logger':
|
|
37
|
+
'core.utils.logger': ILogger;
|
|
38
38
|
'core.utils.getSystemQueryContext': GetSystemQueryContext;
|
|
39
39
|
translator: i18n;
|
|
40
40
|
}
|
|
@@ -5,3 +5,4 @@ export { default as permissionsByActions } from './permissionsByActions';
|
|
|
5
5
|
export { default as reducePermissionsArray } from './reducePermissionsArray';
|
|
6
6
|
export { default as simplePermission } from './simplePermission';
|
|
7
7
|
export { default as treeBasedPermissions } from './treeBasedPermissions';
|
|
8
|
+
export { default as recordInCreationByPass } from './recordInCreationBypass';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type IRecord } from '../../../_types/record';
|
|
2
|
+
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
3
|
+
export interface IRecordInCreationByPassHelper {
|
|
4
|
+
recordInCreationByPass: (record: IRecord, ctx: IQueryInfos) => boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function (): IRecordInCreationByPassHelper;
|
|
@@ -7,6 +7,8 @@ import { type IDefaultPermissionHelper } from './helpers/defaultPermission';
|
|
|
7
7
|
import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGroups';
|
|
8
8
|
import { type ITreeBasedPermissionHelper } from './helpers/treeBasedPermissions';
|
|
9
9
|
import { type IGetRecordAttributeHeritedPermissionsParams as IGetRecordAttributeInheritedPermissionsParams } from './_types';
|
|
10
|
+
import { type IRecordRepo } from '../../infra/record/recordRepo';
|
|
11
|
+
import { type IRecordInCreationByPassHelper } from './helpers/recordInCreationBypass';
|
|
10
12
|
export interface IRecordAttributePermissionDomain {
|
|
11
13
|
getRecordAttributePermission(action: RecordAttributePermissionsActions, userGroupId: string, attributeId: string, recordLibrary: string, recordId: string, ctx: IQueryInfos): Promise<boolean>;
|
|
12
14
|
getInheritedRecordAttributePermission(params: IGetRecordAttributeInheritedPermissionsParams, ctx: IQueryInfos): Promise<boolean>;
|
|
@@ -16,7 +18,9 @@ export interface IRecordAttributePermissionDomainDeps {
|
|
|
16
18
|
'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
|
|
17
19
|
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
18
20
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
21
|
+
'core.domain.permission.helpers.recordInCreationByPass': IRecordInCreationByPassHelper;
|
|
19
22
|
'core.domain.attribute': IAttributeDomain;
|
|
20
23
|
'core.infra.value': IValueRepo;
|
|
24
|
+
'core.infra.record': IRecordRepo;
|
|
21
25
|
}
|
|
22
26
|
export default function (deps: IRecordAttributePermissionDomainDeps): IRecordAttributePermissionDomain;
|
|
@@ -5,8 +5,10 @@ import { type IDefaultPermissionHelper } from './helpers/defaultPermission';
|
|
|
5
5
|
import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGroups';
|
|
6
6
|
import { type ITreeBasedPermissionHelper } from './helpers/treeBasedPermissions';
|
|
7
7
|
import { type ILibraryPermissionDomain } from './libraryPermissionDomain';
|
|
8
|
-
import { type
|
|
8
|
+
import { type IEstimateTreeValueRecordPermissionParams, type IGetInheritedRecordPermissionParams, type IGetRecordPermissionParams } from './_types';
|
|
9
9
|
import { type ITreeRepo } from '../../infra/tree/treeRepo';
|
|
10
|
+
import { type IRecordRepo } from '../../infra/record/recordRepo';
|
|
11
|
+
import { type IRecordInCreationByPassHelper } from './helpers/recordInCreationBypass';
|
|
10
12
|
export interface IRecordPermissionDomain {
|
|
11
13
|
getRecordPermission(params: IGetRecordPermissionParams): Promise<boolean>;
|
|
12
14
|
getInheritedRecordPermission(params: IGetInheritedRecordPermissionParams): Promise<boolean>;
|
|
@@ -17,9 +19,11 @@ export interface IRecordPermissionDomainDeps {
|
|
|
17
19
|
'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
|
|
18
20
|
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
19
21
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
22
|
+
'core.domain.permission.helpers.recordInCreationByPass': IRecordInCreationByPassHelper;
|
|
20
23
|
'core.domain.attribute': IAttributeDomain;
|
|
21
24
|
'core.domain.helpers.getCoreEntityById': GetCoreEntityByIdFunc;
|
|
22
25
|
'core.infra.value': IValueRepo;
|
|
23
26
|
'core.infra.tree': ITreeRepo;
|
|
27
|
+
'core.infra.record': IRecordRepo;
|
|
24
28
|
}
|
|
25
29
|
export default function (deps: IRecordPermissionDomainDeps): IRecordPermissionDomain;
|
|
@@ -2,17 +2,14 @@ import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDom
|
|
|
2
2
|
import { type ILibraryPermissionDomain } from 'domain/permission/libraryPermissionDomain';
|
|
3
3
|
import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
4
4
|
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
5
|
-
import { type
|
|
5
|
+
import { type IRecord } from '../../../_types/record';
|
|
6
|
+
import { type ICreateRecordValueError } from '../_types';
|
|
6
7
|
export type IPreCreateRecordCallback = () => Promise<ICreateRecordValueError[]>;
|
|
7
8
|
export type CreateRecordHelper = (params: {
|
|
8
9
|
library: string;
|
|
9
|
-
/**
|
|
10
|
-
* Can be use to validate potential values to post create insert to record
|
|
11
|
-
*/
|
|
12
|
-
preCreateCallback?: IPreCreateRecordCallback;
|
|
13
10
|
ctx: IQueryInfos;
|
|
14
11
|
active?: boolean;
|
|
15
|
-
}) => Promise<
|
|
12
|
+
}) => Promise<IRecord>;
|
|
16
13
|
interface IDeps {
|
|
17
14
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
18
15
|
'core.domain.permission.library': ILibraryPermissionDomain;
|
|
@@ -7,7 +7,6 @@ import { type i18n } from 'i18next';
|
|
|
7
7
|
import { type ILibraryRepo } from 'infra/library/libraryRepo';
|
|
8
8
|
import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
9
9
|
import { type ITreeRepo } from 'infra/tree/treeRepo';
|
|
10
|
-
import { type IValueRepo } from 'infra/value/valueRepo';
|
|
11
10
|
import { type IUtils } from 'utils/utils';
|
|
12
11
|
import type * as Config from '_types/config';
|
|
13
12
|
import { type IListWithCursor } from '_types/list';
|
|
@@ -21,13 +20,12 @@ import { type SendRecordUpdateEventHelper } from './helpers/sendRecordUpdateEven
|
|
|
21
20
|
import { type ICreateRecordResult, type IFindRecordParams } from './_types';
|
|
22
21
|
import { type IFormRepo } from 'infra/form/formRepo';
|
|
23
22
|
import { type IRecordAttributePermissionDomain } from '../permission/recordAttributePermissionDomain';
|
|
24
|
-
import { type IAttributePermissionDomain } from '../permission/attributePermissionDomain';
|
|
25
23
|
import { type IPermissionRepo } from '../../infra/permission/permissionRepo';
|
|
26
24
|
import { type IDefaultPermissionHelper } from 'domain/permission/helpers/defaultPermission';
|
|
27
25
|
import { type DeleteRecordHelper } from './helpers/deleteRecord';
|
|
28
26
|
import { type CreateRecordHelper } from './helpers/createRecord';
|
|
29
27
|
import { type IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
|
|
30
|
-
import type
|
|
28
|
+
import { type ILogger } from '@leav/logger';
|
|
31
29
|
export interface IRecordDomain {
|
|
32
30
|
/**
|
|
33
31
|
* Create empty record
|
|
@@ -36,11 +34,12 @@ export interface IRecordDomain {
|
|
|
36
34
|
createEmptyRecord(params: {
|
|
37
35
|
library: string;
|
|
38
36
|
ctx: IQueryInfos;
|
|
39
|
-
}): Promise<
|
|
37
|
+
}): Promise<IRecord>;
|
|
40
38
|
activateNewRecord(params: {
|
|
41
39
|
library: string;
|
|
42
40
|
recordId: string;
|
|
43
41
|
formId?: string;
|
|
42
|
+
skipVerifyRequiredAttributes?: boolean;
|
|
44
43
|
ctx: IQueryInfos;
|
|
45
44
|
}): Promise<ICreateRecordResult>;
|
|
46
45
|
createRecord(params: {
|
|
@@ -123,7 +122,6 @@ export interface IRecordDomainDeps {
|
|
|
123
122
|
'core.domain.value': IValueDomain;
|
|
124
123
|
'core.domain.permission.record': IRecordPermissionDomain;
|
|
125
124
|
'core.domain.permission.library': ILibraryPermissionDomain;
|
|
126
|
-
'core.domain.permission.attribute': IAttributePermissionDomain;
|
|
127
125
|
'core.domain.permission.recordAttribute': IRecordAttributePermissionDomain;
|
|
128
126
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
129
127
|
'core.domain.helpers.getCoreEntityById': GetCoreEntityByIdFunc;
|
|
@@ -134,13 +132,12 @@ export interface IRecordDomainDeps {
|
|
|
134
132
|
'core.infra.library': ILibraryRepo;
|
|
135
133
|
'core.infra.tree': ITreeRepo;
|
|
136
134
|
'core.domain.tree.helpers.elementAncestors': IElementAncestorsHelper;
|
|
137
|
-
'core.infra.value': IValueRepo;
|
|
138
135
|
'core.infra.form': IFormRepo;
|
|
139
136
|
'core.infra.permission': IPermissionRepo;
|
|
140
137
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
141
138
|
'core.infra.cache.cacheService': ICachesService;
|
|
142
|
-
'core.utils.logger':
|
|
139
|
+
'core.utils.logger': ILogger;
|
|
143
140
|
'core.utils': IUtils;
|
|
144
141
|
translator: i18n;
|
|
145
142
|
}
|
|
146
|
-
export default function ({ config, 'core.infra.record': recordRepo, 'core.domain.attribute': attributeDomain, 'core.domain.value': valueDomain, 'core.domain.permission.record': recordPermissionDomain, 'core.domain.permission.library': libraryPermissionDomain, 'core.domain.permission.
|
|
143
|
+
export default function ({ config, 'core.infra.record': recordRepo, 'core.domain.attribute': attributeDomain, 'core.domain.value': valueDomain, 'core.domain.permission.record': recordPermissionDomain, 'core.domain.permission.library': libraryPermissionDomain, 'core.domain.permission.recordAttribute': recordAttributePermissionDomain, 'core.domain.permission.helpers.defaultPermission': defaultPermHelper, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.helpers.validate': validateHelper, 'core.domain.record.helpers.createRecord': createRecordHelper, 'core.domain.record.helpers.deleteRecord': deleteRecordHelper, 'core.domain.record.helpers.sendRecordUpdateEvent': sendRecordUpdateEvent, 'core.infra.library': libraryRepo, 'core.infra.tree': treeRepo, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, 'core.infra.form': formRepo, 'core.infra.permission': permissionRepo, 'core.domain.eventsManager': eventsManager, 'core.infra.cache.cacheService': cacheService, 'core.utils.logger': logger, 'core.utils': utils, translator }: IRecordDomainDeps): IRecordDomain;
|
|
@@ -2,7 +2,7 @@ import { type IAmqpService } from '@leav/message-broker';
|
|
|
2
2
|
import { type AwilixContainer } from 'awilix';
|
|
3
3
|
import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDomain';
|
|
4
4
|
import { type IUtils } from 'utils/utils';
|
|
5
|
-
import type
|
|
5
|
+
import { type ILogger } from '@leav/logger';
|
|
6
6
|
import type * as Config from '_types/config';
|
|
7
7
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
8
8
|
import { type IGetCoreEntitiesParams } from '_types/shared';
|
|
@@ -10,6 +10,7 @@ import { type ISystemTranslation } from '_types/systemTranslation';
|
|
|
10
10
|
import { type ITaskRepo } from '../../infra/task/taskRepo';
|
|
11
11
|
import { type IList } from '../../_types/list';
|
|
12
12
|
import { type ITask, type ITaskCallback, type ITaskCancelPayload, type ITaskCreatePayload, type ITaskDeletePayload, TaskStatus } from '../../_types/tasksManager';
|
|
13
|
+
import { type GetSystemQueryContext } from '../../utils/helpers/getSystemQueryContext';
|
|
13
14
|
export interface IUpdateData {
|
|
14
15
|
status?: TaskStatus;
|
|
15
16
|
progress?: {
|
|
@@ -61,8 +62,9 @@ export interface ITasksManagerDomainDeps {
|
|
|
61
62
|
'core.infra.task': ITaskRepo;
|
|
62
63
|
'core.depsManager': AwilixContainer;
|
|
63
64
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
64
|
-
'core.utils.logger':
|
|
65
|
+
'core.utils.logger': ILogger;
|
|
65
66
|
'core.utils': IUtils;
|
|
67
|
+
'core.utils.getSystemQueryContext': GetSystemQueryContext;
|
|
66
68
|
}
|
|
67
|
-
export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.task': taskRepo, 'core.depsManager': depsManager, 'core.domain.eventsManager': eventsManager, 'core.utils.logger': logger, 'core.utils': utils }: ITasksManagerDomainDeps): ITasksManagerDomain;
|
|
69
|
+
export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.task': taskRepo, 'core.depsManager': depsManager, 'core.domain.eventsManager': eventsManager, 'core.utils.logger': logger, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext }: ITasksManagerDomainDeps): ITasksManagerDomain;
|
|
68
70
|
export {};
|
|
@@ -6,7 +6,7 @@ import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
|
|
|
6
6
|
import { type IRecordDomain } from 'domain/record/recordDomain';
|
|
7
7
|
import { type ITreeDomain } from 'domain/tree/treeDomain';
|
|
8
8
|
import { type i18n } from 'i18next';
|
|
9
|
-
import type
|
|
9
|
+
import { type ILogger } from '@leav/logger';
|
|
10
10
|
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
11
11
|
export interface IFormatLogValueHelper {
|
|
12
12
|
formatAsString(log: Log, rawData: IDBPayloadData<EventAction.VALUE_DELETE | EventAction.VALUE_SAVE>, ctx: IQueryInfos): Promise<string | null>;
|
|
@@ -16,7 +16,7 @@ interface IDeps {
|
|
|
16
16
|
'core.domain.record': IRecordDomain;
|
|
17
17
|
'core.domain.attribute': IAttributeDomain;
|
|
18
18
|
'core.domain.tree': ITreeDomain;
|
|
19
|
-
'core.utils.logger':
|
|
19
|
+
'core.utils.logger': ILogger;
|
|
20
20
|
translator: i18n;
|
|
21
21
|
}
|
|
22
22
|
export default function ({ 'core.domain.actionsList': actionsListDomain, 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.utils.logger': logger, translator }: IDeps): IFormatLogValueHelper;
|
|
@@ -9,7 +9,7 @@ import { type IRecordRepo } from 'infra/record/recordRepo';
|
|
|
9
9
|
import { type ITreeRepo } from 'infra/tree/treeRepo';
|
|
10
10
|
import { type IValueRepo } from 'infra/value/valueRepo';
|
|
11
11
|
import { type IUtils } from 'utils/utils';
|
|
12
|
-
import type
|
|
12
|
+
import { type ILogger } from '@leav/logger';
|
|
13
13
|
import type * as Config from '_types/config';
|
|
14
14
|
import { type IRecord } from '_types/record';
|
|
15
15
|
import { type IAttribute } from '../../_types/attribute';
|
|
@@ -113,7 +113,7 @@ export interface IValueDomainDeps {
|
|
|
113
113
|
'core.infra.tree': ITreeRepo;
|
|
114
114
|
'core.infra.value': IValueRepo;
|
|
115
115
|
'core.utils': IUtils;
|
|
116
|
-
'core.utils.logger':
|
|
116
|
+
'core.utils.logger': ILogger;
|
|
117
117
|
'core.domain.tree': ITreeDomain;
|
|
118
118
|
}
|
|
119
119
|
declare const valueDomain: ({ config, "core.domain.actionsList": actionsListDomain, "core.domain.attribute": attributeDomain, "core.domain.permission.recordAttribute": recordAttributePermissionDomain, "core.domain.permission.record": recordPermissionDomain, "core.domain.eventsManager": eventsManager, "core.domain.helpers.validate": validate, "core.domain.helpers.updateRecordLastModif": updateRecordLastModif, "core.domain.tree.helpers.elementAncestors": elementAncestors, "core.domain.tree.helpers.getDefaultElement": getDefaultElementHelper, "core.domain.record.helpers.sendRecordUpdateEvent": sendRecordUpdateEvent, "core.domain.record.helpers.createRecord": createRecordHelper, "core.domain.record.helpers.deleteRecord": deleteRecordHelper, "core.domain.attribute.helpers.ifLibraryJoinLinkAttribute": ifLibraryJoinLinkAttribute, "core.domain.versionProfile": versionProfileDomain, "core.infra.record": recordRepo, "core.infra.tree": treeRepo, "core.infra.value": valueRepo, "core.utils": utils, "core.utils.logger": logger }: IValueDomainDeps) => IValueDomain;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ILogger } from '@leav/logger';
|
|
2
2
|
import { type IConfig } from '_types/config';
|
|
3
3
|
import { type IList } from '_types/list';
|
|
4
4
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
@@ -31,7 +31,7 @@ export declare const APPLICATIONS_COLLECTION_NAME = "core_applications";
|
|
|
31
31
|
interface IDeps {
|
|
32
32
|
'core.infra.db.dbService'?: IDbService;
|
|
33
33
|
'core.infra.db.dbUtils'?: IDbUtils;
|
|
34
|
-
'core.utils.logger'?:
|
|
34
|
+
'core.utils.logger'?: ILogger;
|
|
35
35
|
config?: IConfig;
|
|
36
36
|
}
|
|
37
37
|
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.utils.logger': logger, config }?: IDeps): IApplicationRepo;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type GeneratedAqlQuery } from 'arangojs/aql';
|
|
2
2
|
import { type AwilixContainer } from 'awilix';
|
|
3
|
-
import type
|
|
3
|
+
import { type ILogger } from '@leav/logger';
|
|
4
4
|
import { type IConfig } from '_types/config';
|
|
5
5
|
import { type IList, type IPaginationParams, type ISortParams } from '_types/list';
|
|
6
6
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
7
7
|
import { type IKeyValue } from '_types/shared';
|
|
8
8
|
import { type ICachesService } from '../cache/cacheService';
|
|
9
9
|
import { type IDbService } from './dbService';
|
|
10
|
+
import { type GetSystemQueryContext } from '../../utils/helpers/getSystemQueryContext';
|
|
10
11
|
export declare const MIGRATIONS_COLLECTION_NAME = "core_db_migrations";
|
|
11
12
|
export type CustomFilterConditionsFunc = (filterKey: string, filterVal: string | boolean | string[], strictFilters: boolean) => GeneratedAqlQuery;
|
|
12
13
|
export interface IFindCoreEntityParams {
|
|
@@ -31,8 +32,9 @@ export interface IDbUtils {
|
|
|
31
32
|
interface IDeps {
|
|
32
33
|
'core.infra.db.dbService'?: IDbService;
|
|
33
34
|
'core.infra.cache.cacheService'?: ICachesService;
|
|
34
|
-
'core.utils.logger'?:
|
|
35
|
+
'core.utils.logger'?: ILogger;
|
|
35
36
|
config?: IConfig;
|
|
37
|
+
'core.utils.getSystemQueryContext'?: GetSystemQueryContext;
|
|
36
38
|
}
|
|
37
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.cache.cacheService': cacheService, 'core.utils.logger': logger, config }?: IDeps): IDbUtils;
|
|
39
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.cache.cacheService': cacheService, 'core.utils.logger': logger, config, 'core.utils.getSystemQueryContext': getSystemQueryContext }?: IDeps): IDbUtils;
|
|
38
40
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AwilixContainer } from 'awilix';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ILogger } from '@leav/logger';
|
|
3
3
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
4
4
|
import { type IDbService } from '../dbService';
|
|
5
5
|
interface IExecuteMigrationParams {
|
|
@@ -10,7 +10,7 @@ interface IExecuteMigrationParams {
|
|
|
10
10
|
deps?: {
|
|
11
11
|
depsManager: AwilixContainer;
|
|
12
12
|
dbService: IDbService;
|
|
13
|
-
logger:
|
|
13
|
+
logger: ILogger;
|
|
14
14
|
};
|
|
15
15
|
ctx: IQueryInfos;
|
|
16
16
|
}
|
|
@@ -2,11 +2,11 @@ import { type IQueryInfos } from '_types/queryInfos';
|
|
|
2
2
|
import { type IRecord } from '_types/record';
|
|
3
3
|
import { type IDbService } from 'infra/db/dbService';
|
|
4
4
|
import { type IDbUtils } from 'infra/db/dbUtils';
|
|
5
|
-
import type
|
|
5
|
+
import { type ILogger } from '@leav/logger';
|
|
6
6
|
interface IDeps {
|
|
7
7
|
'core.infra.db.dbService'?: IDbService;
|
|
8
8
|
'core.infra.db.dbUtils'?: IDbUtils;
|
|
9
|
-
'core.utils.logger'?:
|
|
9
|
+
'core.utils.logger'?: ILogger;
|
|
10
10
|
}
|
|
11
11
|
export interface IFilesManagerRepo {
|
|
12
12
|
getRecord({ fileName, filePath, fileInode }: {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type GraphQLError, type GraphQLFormattedError } from 'graphql';
|
|
2
2
|
import { type IUtils } from 'utils/utils';
|
|
3
|
-
import type
|
|
3
|
+
import { type ILogger } from '@leav/logger';
|
|
4
4
|
import { type IConfig } from '_types/config';
|
|
5
5
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
6
6
|
export type HandleGraphqlErrorFunc = (err: GraphQLError, ctx: IQueryInfos) => GraphQLFormattedError;
|
|
7
7
|
interface IDeps {
|
|
8
8
|
config: IConfig;
|
|
9
9
|
'core.utils': IUtils;
|
|
10
|
-
'core.utils.logger'?:
|
|
10
|
+
'core.utils.logger'?: ILogger;
|
|
11
11
|
}
|
|
12
12
|
export default function ({ config, 'core.utils': utils, 'core.utils.logger': logger }: IDeps): HandleGraphqlErrorFunc;
|
|
13
13
|
export {};
|
|
@@ -3,9 +3,9 @@ import { type IAuthApp } from 'app/auth/authApp';
|
|
|
3
3
|
import { type ICoreApp } from 'app/core/coreApp';
|
|
4
4
|
import { type IGraphqlApp } from 'app/graphql/graphqlApp';
|
|
5
5
|
import { type AwilixContainer } from 'awilix';
|
|
6
|
-
import
|
|
6
|
+
import express from 'express';
|
|
7
7
|
import { type IUtils } from 'utils/utils';
|
|
8
|
-
import type
|
|
8
|
+
import { type ILogger } from '@leav/logger';
|
|
9
9
|
import { type IConfig } from '_types/config';
|
|
10
10
|
import { type ValidateRequestTokenFunc } from '../app/helpers/validateRequestToken';
|
|
11
11
|
import { type HandleGraphqlErrorFunc } from './helpers/handleGraphqlError';
|
|
@@ -18,7 +18,7 @@ export interface IServerRouteAppModule {
|
|
|
18
18
|
/**
|
|
19
19
|
* @param app Express instance, can be used to extend the app
|
|
20
20
|
*/
|
|
21
|
-
registerRoute(app:
|
|
21
|
+
registerRoute(app: express.Router): void;
|
|
22
22
|
}
|
|
23
23
|
interface IDeps {
|
|
24
24
|
config?: IConfig;
|
|
@@ -29,7 +29,7 @@ interface IDeps {
|
|
|
29
29
|
'core.app.core'?: ICoreApp;
|
|
30
30
|
'core.app.helpers.validateRequestToken'?: ValidateRequestTokenFunc;
|
|
31
31
|
'core.app.helpers.initQueryContext'?: InitQueryContextFunc;
|
|
32
|
-
'core.utils.logger'?:
|
|
32
|
+
'core.utils.logger'?: ILogger;
|
|
33
33
|
'core.utils'?: IUtils;
|
|
34
34
|
'core.depsManager'?: AwilixContainer;
|
|
35
35
|
}
|
|
@@ -3,6 +3,6 @@ import { type IQueryInfos } from '_types/queryInfos';
|
|
|
3
3
|
interface IDeps {
|
|
4
4
|
config?: IConfig;
|
|
5
5
|
}
|
|
6
|
-
export type GetSystemQueryContext = () => IQueryInfos;
|
|
6
|
+
export type GetSystemQueryContext = (trigger?: string) => IQueryInfos;
|
|
7
7
|
export default function ({ config }: IDeps): GetSystemQueryContext;
|
|
8
8
|
export {};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export default function ({ config }?: IDeps): winston.Winston;
|
|
6
|
-
export {};
|
|
1
|
+
import { type IConfig } from '_types/config';
|
|
2
|
+
export default function (): import("@leav/logger").ILogger;
|
|
3
|
+
export declare function setupLogger(config: IConfig): void;
|
|
@@ -86,6 +86,7 @@ export interface IUtils {
|
|
|
86
86
|
getUnixTime(): number;
|
|
87
87
|
getFileExtension(filename: string): string | null;
|
|
88
88
|
getProcessIdentifier(): string;
|
|
89
|
+
getPreviewUrl(relativeUrl: string): string;
|
|
89
90
|
getPreviewsAttributeName(libraryId: string): string;
|
|
90
91
|
getPreviewsStatusAttributeName(libraryId: string): string;
|
|
91
92
|
getPreviewAttributesSettings(library: ILibrary): IPreviewAttributesSettings;
|
|
@@ -4,6 +4,11 @@ export interface ILoggerConfig {
|
|
|
4
4
|
* @default info
|
|
5
5
|
*/
|
|
6
6
|
level: string;
|
|
7
|
+
/**
|
|
8
|
+
* If true, disable all logging
|
|
9
|
+
* Default: true if TS_JEST=1 (tests), false otherwise
|
|
10
|
+
*/
|
|
11
|
+
silent?: boolean;
|
|
7
12
|
/**
|
|
8
13
|
* If transport is file, destination file path
|
|
9
14
|
*/
|
|
@@ -13,6 +18,7 @@ export interface ILoggerConfig {
|
|
|
13
18
|
* Default: false (plain text)
|
|
14
19
|
*/
|
|
15
20
|
useJsonFormat?: boolean;
|
|
21
|
+
onErrorLog?: (message: string, meta: any) => void;
|
|
16
22
|
}
|
|
17
23
|
export declare function envToBool(value: string, defaultValue?: boolean): boolean;
|
|
18
|
-
export declare const
|
|
24
|
+
export declare const defaultLoggerConfig: ILoggerConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristid/leav-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Shared Leav types",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"tscheck": "",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"license": "LGPL3",
|
|
15
15
|
"repository": "https://github.com/leav-solutions/leav-engine",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@leav/utils": "1.
|
|
17
|
+
"@leav/utils": "1.4.0",
|
|
18
18
|
"@types/amqplib": "0.10.7",
|
|
19
19
|
"@types/express": "5.0.0",
|
|
20
20
|
"@types/jest": "29.5.14",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"arangojs": "8.1.0",
|
|
23
23
|
"awilix": "12.0.4",
|
|
24
24
|
"i18next": "24.2.0",
|
|
25
|
-
"jest": "29.7.0"
|
|
26
|
-
"winston": "2.4.6"
|
|
25
|
+
"jest": "29.7.0"
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getPreviewUrl: () => string;
|