@aristid/leav-types 1.3.0-ff0e8449 → 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.
Files changed (35) hide show
  1. package/apps/core/config/default.d.ts +12 -5
  2. package/apps/core/config/development.d.ts +3 -0
  3. package/apps/core/src/_types/config.d.ts +9 -6
  4. package/apps/core/src/_types/permissions.d.ts +1 -0
  5. package/apps/core/src/app/application/applicationApp.d.ts +2 -2
  6. package/apps/core/src/app/auth/authApp.d.ts +2 -2
  7. package/apps/core/src/app/core/globalSettingsApp.d.ts +2 -2
  8. package/apps/core/src/app/core/tasksManagerApp.d.ts +2 -2
  9. package/apps/core/src/domain/eventsManager/eventsManagerDomain.d.ts +2 -2
  10. package/apps/core/src/domain/filesManager/filesManagerDomain.d.ts +2 -2
  11. package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/_types.d.ts +2 -2
  12. package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/handleFileSystemEvent.d.ts +2 -2
  13. package/apps/core/src/domain/filesManager/helpers/handleFileUtilsHelper.d.ts +2 -2
  14. package/apps/core/src/domain/filesManager/helpers/handlePreview.d.ts +2 -2
  15. package/apps/core/src/domain/filesManager/helpers/handlePreviewResponse.d.ts +3 -3
  16. package/apps/core/src/domain/filesManager/helpers/messagesHandler/messagesHandler.d.ts +2 -2
  17. package/apps/core/src/domain/form/formDomain.d.ts +2 -2
  18. package/apps/core/src/domain/form/helpers/getElementValues.d.ts +2 -2
  19. package/apps/core/src/domain/import/importDomain.d.ts +2 -2
  20. package/apps/core/src/domain/indexationManager/indexationManagerDomain.d.ts +2 -2
  21. package/apps/core/src/domain/record/helpers/createRecord.d.ts +3 -6
  22. package/apps/core/src/domain/record/recordDomain.d.ts +5 -8
  23. package/apps/core/src/domain/tasksManager/tasksManagerDomain.d.ts +2 -2
  24. package/apps/core/src/domain/value/helpers/formatLogValue.d.ts +2 -2
  25. package/apps/core/src/domain/value/valueDomain.d.ts +2 -2
  26. package/apps/core/src/infra/application/applicationRepo.d.ts +2 -2
  27. package/apps/core/src/infra/db/dbUtils.d.ts +2 -2
  28. package/apps/core/src/infra/db/helpers/runMigrationFiles.d.ts +2 -2
  29. package/apps/core/src/infra/filesManager/filesManagerRepo.d.ts +2 -2
  30. package/apps/core/src/interface/helpers/handleGraphqlError.d.ts +2 -2
  31. package/apps/core/src/interface/server.d.ts +2 -2
  32. package/apps/core/src/utils/logger/logger.d.ts +3 -6
  33. package/libs/logger/src/config.d.ts +7 -1
  34. package/libs/utils/src/types/forms.d.ts +1 -0
  35. package/package.json +3 -4
@@ -4,7 +4,6 @@ export declare namespace server {
4
4
  let host: string;
5
5
  let port: number;
6
6
  let publicUrl: string;
7
- let wsUrl: string;
8
7
  let basePath: string;
9
8
  let allowIntrospection: boolean;
10
9
  let uploadLimit: string;
@@ -76,6 +75,14 @@ export declare namespace bugsnag {
76
75
  export let apiKey: string;
77
76
  export let appVersion: string;
78
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;
79
86
  }
80
87
  export declare namespace lang {
81
88
  export let available: string | string[];
@@ -200,13 +207,13 @@ export declare namespace files {
200
207
  let originalsPathPrefix: string;
201
208
  }
202
209
  export declare namespace dbProfiler {
203
- let enable_2: boolean;
204
- export { enable_2 as enable };
210
+ let enable_3: boolean;
211
+ export { enable_3 as enable };
205
212
  }
206
213
  export declare namespace elasticSearch {
207
214
  export let indexPrefix: string;
208
- let url_1: string;
209
- export { url_1 as url };
215
+ let url_2: string;
216
+ export { url_2 as url };
210
217
  }
211
218
  export declare let pluginsPath: string | any[];
212
219
  export { _export as export, _import as import };
@@ -15,3 +15,6 @@ export let debug: boolean;
15
15
  export namespace dbProfiler {
16
16
  let enable: boolean;
17
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",
@@ -47,7 +49,6 @@ export interface IServer {
47
49
  publicUrl: string;
48
50
  basePath: string;
49
51
  allowIntrospection: boolean;
50
- wsUrl: string;
51
52
  uploadLimit: number | string;
52
53
  supportEmail: string;
53
54
  admin: {
@@ -105,11 +106,7 @@ export interface ILang {
105
106
  available: string[];
106
107
  default: string;
107
108
  }
108
- export interface ILogs {
109
- level: string;
110
- transport: string;
111
- destinationFile?: string;
112
- }
109
+ export type ILogs = ILoggerConfig;
113
110
  export interface IPermissions {
114
111
  default: boolean;
115
112
  enableCache: boolean;
@@ -234,4 +231,10 @@ export interface IBugsnag {
234
231
  apiKey?: string;
235
232
  appVersion?: string;
236
233
  appType?: string;
234
+ releaseStage?: string;
235
+ }
236
+ export interface IMatomo {
237
+ enable: boolean;
238
+ url?: string;
239
+ siteId?: string;
237
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"
@@ -5,7 +5,7 @@ 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 winston from 'winston';
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';
@@ -24,7 +24,7 @@ export interface IApplicationAppDeps {
24
24
  'core.domain.record': IRecordDomain;
25
25
  'core.domain.eventsManager': IEventsManagerDomain;
26
26
  'core.domain.globalSettings': IGlobalSettingsDomain;
27
- 'core.utils.logger': winston.Winston;
27
+ 'core.utils.logger': ILogger;
28
28
  'core.utils': IUtils;
29
29
  config: IConfig;
30
30
  }
@@ -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 winston from 'winston';
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': winston.Winston;
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 winston from 'winston';
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': winston.Winston;
15
+ 'core.utils.logger': ILogger;
16
16
  'core.utils': IUtils;
17
17
  config: IConfig;
18
18
  }
@@ -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 winston from 'winston';
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'?: winston.Winston;
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 winston from 'winston';
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': winston.Winston;
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,7 +12,7 @@ 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 winston from 'winston';
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';
@@ -70,7 +70,7 @@ export interface IFilesManagerDomainDeps {
70
70
  config: Config.IConfig;
71
71
  'core.utils': IUtils;
72
72
  'core.infra.amqpService': IAmqpService;
73
- 'core.utils.logger': winston.Winston;
73
+ 'core.utils.logger': ILogger;
74
74
  'core.domain.record': IRecordDomain;
75
75
  'core.domain.value': IValueDomain;
76
76
  'core.domain.tree': ITreeDomain;
@@ -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 winston from 'winston';
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: winston.Winston;
23
+ logger: ILogger;
24
24
  config: IConfig;
25
25
  utils: IUtils;
26
26
  filesManagerRepo: IFilesManagerRepo;
@@ -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 winston = require('winston');
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': winston.Winston;
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 winston = require('winston');
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: winston.Winston;
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 winston from 'winston';
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: winston.Winston;
18
+ logger: ILogger;
19
19
  amqpService: IAmqpService;
20
20
  config: Config.IConfig;
21
21
  };
@@ -8,7 +8,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
10
  import { type IQueryInfos } from '_types/queryInfos';
11
- import winston = require('winston');
11
+ import { type ILogger } from '@leav/logger';
12
12
  export interface IHandlePreviewResponseDeps {
13
13
  amqpService: IAmqpService;
14
14
  libraryDomain: ILibraryDomain;
@@ -18,7 +18,7 @@ export interface IHandlePreviewResponseDeps {
18
18
  updateRecordLastModif: UpdateRecordLastModifFunc;
19
19
  sendRecordUpdateEvent: SendRecordUpdateEventHelper;
20
20
  config: Config.IConfig;
21
- logger: winston.Winston;
21
+ logger: ILogger;
22
22
  utils: IUtils;
23
23
  }
24
- export declare const initPreviewResponseHandler: (config: Config.IConfig, logger: winston.Winston, ctx: IQueryInfos, deps: IHandlePreviewResponseDeps) => Promise<void>;
24
+ export declare const initPreviewResponseHandler: (config: Config.IConfig, logger: ILogger, ctx: IQueryInfos, deps: IHandlePreviewResponseDeps) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import type winston from 'winston';
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': winston.Winston;
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 winston from 'winston';
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': winston.Winston;
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 winston from 'winston';
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"?: winston.Winston;
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 winston from 'winston';
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'?: winston.Winston;
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 winston from 'winston';
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': winston.Winston;
37
+ 'core.utils.logger': ILogger;
38
38
  'core.utils.getSystemQueryContext': GetSystemQueryContext;
39
39
  translator: i18n;
40
40
  }
@@ -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 ICreateRecordResult, type ICreateRecordValueError } from '../_types';
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<ICreateRecordResult>;
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 winston from 'winston';
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<ICreateRecordResult>;
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': winston.Winston;
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.attribute': attrPermissionDomain, '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.value': valueRepo, '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;
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 winston from 'winston';
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';
@@ -62,7 +62,7 @@ export interface ITasksManagerDomainDeps {
62
62
  'core.infra.task': ITaskRepo;
63
63
  'core.depsManager': AwilixContainer;
64
64
  'core.domain.eventsManager': IEventsManagerDomain;
65
- 'core.utils.logger': winston.Winston;
65
+ 'core.utils.logger': ILogger;
66
66
  'core.utils': IUtils;
67
67
  'core.utils.getSystemQueryContext': GetSystemQueryContext;
68
68
  }
@@ -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 winston from 'winston';
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': winston.Winston;
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 winston from 'winston';
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': winston.Winston;
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 winston from 'winston';
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'?: winston.Winston;
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,6 +1,6 @@
1
1
  import { type GeneratedAqlQuery } from 'arangojs/aql';
2
2
  import { type AwilixContainer } from 'awilix';
3
- import type * as winston from 'winston';
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';
@@ -32,7 +32,7 @@ export interface IDbUtils {
32
32
  interface IDeps {
33
33
  'core.infra.db.dbService'?: IDbService;
34
34
  'core.infra.cache.cacheService'?: ICachesService;
35
- 'core.utils.logger'?: winston.Winston;
35
+ 'core.utils.logger'?: ILogger;
36
36
  config?: IConfig;
37
37
  'core.utils.getSystemQueryContext'?: GetSystemQueryContext;
38
38
  }
@@ -1,5 +1,5 @@
1
1
  import { type AwilixContainer } from 'awilix';
2
- import { type Winston } from 'winston';
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: Winston;
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 winston from 'winston';
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'?: winston.Winston;
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 winston from 'winston';
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'?: winston.Winston;
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 {};
@@ -5,7 +5,7 @@ import { type IGraphqlApp } from 'app/graphql/graphqlApp';
5
5
  import { type AwilixContainer } from 'awilix';
6
6
  import express from 'express';
7
7
  import { type IUtils } from 'utils/utils';
8
- import type * as winston from 'winston';
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';
@@ -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'?: winston.Winston;
32
+ 'core.utils.logger'?: ILogger;
33
33
  'core.utils'?: IUtils;
34
34
  'core.depsManager'?: AwilixContainer;
35
35
  }
@@ -1,6 +1,3 @@
1
- import winston from 'winston';
2
- interface IDeps {
3
- config?: any;
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;
@@ -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 loggerConfig: ILoggerConfig;
24
+ export declare const defaultLoggerConfig: ILoggerConfig;
@@ -56,5 +56,6 @@ export interface IFormLinkFieldSettings extends ICommonFieldsSettings {
56
56
  }>;
57
57
  displayRecordIdentity: boolean;
58
58
  tagDisplayMode: boolean;
59
+ editFormId: string;
59
60
  }
60
61
  export declare const FORM_ROOT_CONTAINER_ID = "__root";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.3.0-ff0e8449",
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.3.0",
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
  }