@aristid/leav-types 1.6.0-e2820b2f → 1.6.0-e5914a32

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 (42) hide show
  1. package/apps/core/config/default.d.ts +7 -0
  2. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/_types/_types.d.ts +3 -0
  3. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/domain/fakeDomain.d.ts +8 -0
  4. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/domain/index.d.ts +1 -0
  5. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/index.d.ts +9 -1
  6. package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +3 -2
  7. package/apps/core/src/__tests__/e2e/api/mailpitUtils.d.ts +9 -2
  8. package/apps/core/src/__tests__/e2e/api/notificationUtils.d.ts +5 -0
  9. package/apps/core/src/__tests__/e2e/api/task/taskSubscription.test.d.ts +1 -0
  10. package/apps/core/src/__tests__/e2e/api/task/tasksAdminPermissions.test.d.ts +1 -0
  11. package/apps/core/src/_constants/notifications.d.ts +1 -0
  12. package/apps/core/src/_types/actionsList.d.ts +4 -0
  13. package/apps/core/src/_types/application.d.ts +1 -0
  14. package/apps/core/src/_types/config.d.ts +1 -0
  15. package/apps/core/src/_types/extensionPoints.d.ts +2 -0
  16. package/apps/core/src/_types/notification.d.ts +5 -0
  17. package/apps/core/src/_types/permissions.d.ts +2 -0
  18. package/apps/core/src/_types/tasksManager.d.ts +2 -3
  19. package/apps/core/src/app/application/applicationApp.d.ts +3 -1
  20. package/apps/core/src/app/core/attributeApp/attributeApp.d.ts +2 -0
  21. package/apps/core/src/app/core/libraryApp/libraryApp.d.ts +3 -1
  22. package/apps/core/src/app/core/pluginsApp.d.ts +3 -1
  23. package/apps/core/src/app/core/tasksManagerApp.d.ts +5 -1
  24. package/apps/core/src/app/core/treeApp/treeApp.d.ts +3 -1
  25. package/apps/core/src/domain/application/appStudioDomain.d.ts +17 -0
  26. package/apps/core/src/domain/application/appStudioDomain.spec.d.ts +1 -0
  27. package/apps/core/src/domain/application/index.d.ts +1 -0
  28. package/apps/core/src/domain/attribute/helpers/attributeALHelper.d.ts +2 -1
  29. package/apps/core/src/domain/export/exportProfileDomain.d.ts +18 -8
  30. package/apps/core/src/domain/form/helpers/getElementValues.d.ts +0 -2
  31. package/apps/core/src/domain/permission/attributeDependentValuesPermissionDomain.d.ts +13 -2
  32. package/apps/core/src/domain/tasksManager/tasksManagerDomain.d.ts +5 -1
  33. package/apps/core/src/domain/value/_types.d.ts +1 -0
  34. package/apps/core/src/domain/value/helpers/postDeleteValue.d.ts +28 -0
  35. package/apps/core/src/domain/value/helpers/postSaveValue.d.ts +28 -0
  36. package/apps/core/src/domain/value/valueDomain.d.ts +2 -0
  37. package/apps/core/src/infra/db/helpers/libraryUtils.d.ts +2 -0
  38. package/apps/core/src/infra/mailer/mailerService.d.ts +2 -1
  39. package/libs/logger/src/LoggerCallStack.d.ts +2 -1
  40. package/libs/logger/src/locationInfoFormatter.d.ts +1 -1
  41. package/libs/utils/src/types/forms.d.ts +5 -1
  42. package/package.json +1 -1
@@ -124,6 +124,13 @@ export declare namespace permissions {
124
124
  export namespace adminGroup {
125
125
  let _default_3: boolean;
126
126
  export { _default_3 as default };
127
+ export namespace library {
128
+ let access_record_by_default: boolean;
129
+ }
130
+ export namespace record {
131
+ let access_record_by_default_1: boolean;
132
+ export { access_record_by_default_1 as access_record_by_default };
133
+ }
127
134
  }
128
135
  let enableCache_1: boolean;
129
136
  export { enableCache_1 as enableCache };
@@ -0,0 +1,3 @@
1
+ export declare enum FakePluginTaskType {
2
+ FAKE_TYPE = "FAKE_TYPE"
3
+ }
@@ -0,0 +1,8 @@
1
+ export interface IFakeDomain {
2
+ execWorker({ fromTask }: {
3
+ fromTask: string;
4
+ }): void;
5
+ startPlugin(): void;
6
+ getPluginStarted(): boolean;
7
+ }
8
+ export default function (): IFakeDomain;
@@ -0,0 +1 @@
1
+ export { default } from './fakeDomain';
@@ -1,7 +1,15 @@
1
1
  import { type i18n } from 'i18next';
2
2
  import { type IPluginInitModule } from '_types/plugin';
3
+ import { type IValueRepo } from '../../../../../infra/value/valueRepo';
4
+ import { type IAttributeDomain } from '../../../../../domain/attribute/attributeDomain';
5
+ import { type ITasksManagerDomain } from 'domain/tasksManager/tasksManagerDomain';
6
+ import { type IFakeDomain } from './domain/fakeDomain';
3
7
  interface IDeps {
4
8
  translator: i18n;
9
+ 'core.infra.value': IValueRepo;
10
+ 'core.domain.attribute': IAttributeDomain;
11
+ 'core.domain.tasksManager': ITasksManagerDomain;
12
+ 'fakeplugin.domain': IFakeDomain;
5
13
  }
6
- export default function ({ translator }: IDeps): IPluginInitModule;
14
+ export default function ({ translator, 'core.infra.value': valueRepo, 'core.domain.attribute': attributeDomain, 'core.domain.tasksManager': tasksManagerDomain, 'fakeplugin.domain': fakeDomain, }: IDeps): IPluginInitModule;
7
15
  export {};
@@ -11,7 +11,7 @@ export interface IGlobalThis {
11
11
  nonAdminUser: IE2EUserParams;
12
12
  nonAdminGroupId: string;
13
13
  }
14
- interface IE2EUser {
14
+ export interface IE2EUser {
15
15
  userId: string;
16
16
  getAuthToken: () => Promise<string>;
17
17
  }
@@ -65,6 +65,7 @@ export declare function gqlCreateRecord(library: string): Promise<string>;
65
65
  * @return Node ID
66
66
  */
67
67
  export declare function gqlAddElemToTree(treeId: string, element: ITreeElement, parent?: string | null, order?: number): Promise<string>;
68
+ export declare function gqlGetValue(libraryId: string, recordId: string, attributeId: string): Promise<any>;
68
69
  export declare function gqlSaveValue(attributeId: string, libraryId: string, recordId: string, value: string | number): Promise<void>;
69
70
  export declare function gqlSaveVersionProfile(profileId: string, label: string, trees: string[]): Promise<void>;
70
71
  /**
@@ -77,7 +78,7 @@ export declare function makeWebSocketGraphQlCall(options?: {
77
78
  export declare function waitGraphqlWebSocketMessage<T>(client: GraphqlWsClient, query: string, variables: Record<string, any>, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
78
79
  timeoutMs: any;
79
80
  }): Promise<T>;
80
- export declare function waitWebSocketMessage<T>(webSocket: WebSocket, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
81
+ export declare function waitWebSocketMessage<T>(webSocket: WebSocket, acceptMessage: (msg: T) => Promise<boolean>, { timeoutMs }: {
81
82
  timeoutMs: any;
82
83
  }): Promise<T>;
83
84
  export {};
@@ -1,3 +1,6 @@
1
+ interface IMailpitMsgHeaders {
2
+ [key: string]: string[];
3
+ }
1
4
  interface IMailpitMsgLight {
2
5
  From: {
3
6
  Name: string;
@@ -13,7 +16,10 @@ interface IMailpitMsgLight {
13
16
  Address: string;
14
17
  }>;
15
18
  }
16
- interface IMailpitMsgFull extends IMailpitMsgLight {
19
+ interface IMailpitMsgLightWithHeaders extends IMailpitMsgLight {
20
+ Headers: IMailpitMsgHeaders;
21
+ }
22
+ export interface IMailpitMsgFull extends IMailpitMsgLight {
17
23
  HTML: string;
18
24
  Text: string;
19
25
  }
@@ -22,7 +28,8 @@ interface IMailpitSearchResult {
22
28
  total: number;
23
29
  unread: number;
24
30
  }
25
- export declare function waitMailpitMessage(acceptMessage: (msg: IMailpitMsgLight) => boolean): Promise<IMailpitMsgFull>;
31
+ export declare function waitMailpitMessage(acceptMessage: (msg: IMailpitMsgLightWithHeaders) => boolean): Promise<IMailpitMsgFull>;
32
+ export declare function getMailpitMessageHeaders(messageId: string): Promise<IMailpitMsgHeaders>;
26
33
  export declare function getMailpitMessage(messageId: string): Promise<IMailpitMsgFull>;
27
34
  export declare function deleteMailpitMessagesBySearch(search: string): Promise<void>;
28
35
  export declare function searchMailpitMessages(search: string): Promise<IMailpitSearchResult>;
@@ -0,0 +1,5 @@
1
+ import { type IPubSubNotificationData } from '_types/eventsManager';
2
+ import { type Client as GraphqlWsClient } from 'graphql-ws';
3
+ import { type IMailpitMsgFull } from './mailpitUtils';
4
+ export declare const waitWebSocketNotification: (graphqlClient: GraphqlWsClient, taskId: string) => Promise<Pick<IPubSubNotificationData, "notification">>;
5
+ export declare const waitEmailNotification: (taskId: string) => Promise<IMailpitMsgFull>;
@@ -0,0 +1 @@
1
+ export declare const NOTIFICATION_EMAIL_TASK_ID_HEADER = "X-Task-Id";
@@ -5,7 +5,9 @@ import { type IValue } from './value';
5
5
  import { type Errors } from './errors';
6
6
  export declare enum ActionsListEvents {
7
7
  SAVE_VALUE = "saveValue",
8
+ POST_SAVE_VALUE = "postSaveValue",
8
9
  DELETE_VALUE = "deleteValue",
10
+ POST_DELETE_VALUE = "postDeleteValue",
9
11
  GET_VALUE = "getValue"
10
12
  }
11
13
  export declare enum ActionsListIOTypes {
@@ -19,6 +21,7 @@ export type ActionsListConfig = {
19
21
  [Event in ActionsListEvents]?: IActionsListSavedAction[];
20
22
  };
21
23
  export interface IActionsListContext extends IQueryInfos {
24
+ actionEvent: ActionsListEvents;
22
25
  attribute?: IAttribute;
23
26
  library?: string;
24
27
  recordId?: string;
@@ -71,6 +74,7 @@ export interface IActionsListSavedAction {
71
74
  error_message?: ISystemTranslation;
72
75
  }
73
76
  export interface IRunActionsListCtx extends IQueryInfos {
77
+ actionEvent: ActionsListEvents;
74
78
  attribute?: IAttribute;
75
79
  recordId?: string;
76
80
  library?: string;
@@ -15,6 +15,7 @@ export interface IApplication extends ICoreEntity {
15
15
  module: string;
16
16
  endpoint: string;
17
17
  settings?: IKeyValue<any>;
18
+ appStudioSettings?: IKeyValue<any>;
18
19
  }
19
20
  /**
20
21
  * Accepted fields to filter attributes list
@@ -44,6 +44,7 @@ export declare enum CoreMode {
44
44
  TASKS_MANAGER_MASTER = "tasksManager:master",
45
45
  TASKS_MANAGER_WORKER = "tasksManager:worker",
46
46
  LOGS_COLLECTOR = "logsCollector",
47
+ E2E_PLAYWRIGHT = "e2ePlaywright",
47
48
  CLI = "cli"
48
49
  }
49
50
  export interface IServer {
@@ -18,6 +18,8 @@ export interface IExtensionPointsFunctions extends IExtensionPoints {
18
18
  registerPermissionActions: (type: PermissionTypes, actions: string[], applyOn?: string[]) => void;
19
19
  registerEventActions: (actions: string[], prefix: string) => void;
20
20
  registerActions: (actions: IActionsListFunction[]) => void;
21
+ registerTaskTypes: (types: string[]) => void;
22
+ registerStart: (fct: () => Promise<void>) => void;
21
23
  /**
22
24
  * Method to register some Express routes inside LEAV Core.
23
25
  *
@@ -22,6 +22,11 @@ export interface INotificationContent {
22
22
  url: string;
23
23
  label: string;
24
24
  }>;
25
+ /**
26
+ * Optional task ID associated with the notification
27
+ * For email, will be added as a custom header (X-Task-Id)
28
+ */
29
+ taskId?: string;
25
30
  }
26
31
  export interface ICreateNotification {
27
32
  emitterUserId: string;
@@ -15,6 +15,7 @@ export declare enum LibraryPermissionsActions {
15
15
  ACCESS_LIBRARY = "access_library",
16
16
  ADMIN_LIBRARY = "admin_library",
17
17
  ACCESS_RECORD = "access_record",
18
+ ACCESS_RECORD_BY_DEFAULT = "access_record_by_default",
18
19
  CREATE_RECORD = "create_record",
19
20
  EDIT_RECORD = "edit_record",
20
21
  DELETE_RECORD = "delete_record"
@@ -113,6 +114,7 @@ export interface ITreePermissionsDependentValuesConf {
113
114
  * IDs of attributes used for permissions
114
115
  */
115
116
  dependenciesTreeAttributes: string[];
117
+ allowByDefault: boolean;
116
118
  }
117
119
  export interface IPermissionsTreeTarget {
118
120
  /**
@@ -30,8 +30,7 @@ export interface ITaskOrder {
30
30
  payload: Payload;
31
31
  }
32
32
  export interface ITaskFunc {
33
- moduleName: string;
34
- subModuleName?: string;
33
+ path: string;
35
34
  name: string;
36
35
  args: {
37
36
  [key: string]: any;
@@ -67,7 +66,7 @@ export declare enum TaskType {
67
66
  SAVE_VALUE_BULK = "SAVE_VALUE_BULK"
68
67
  }
69
68
  export interface ITaskRole {
70
- type: TaskType;
69
+ type: TaskType | string;
71
70
  detail?: string;
72
71
  }
73
72
  export interface ITask {
@@ -6,6 +6,7 @@ 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
8
  import { type ILogger } from '@leav/logger';
9
+ import { type IAppStudioDomain } from '../../domain/application/appStudioDomain';
9
10
  import { type IApplicationDomain } from '../../domain/application/applicationDomain';
10
11
  import { type ValidateRequestTokenFunc } from '../helpers/validateRequestToken';
11
12
  import { type IAuthApp } from '../auth/authApp';
@@ -20,6 +21,7 @@ export interface IApplicationAppDeps {
20
21
  'core.app.helpers.validateRequestToken': ValidateRequestTokenFunc;
21
22
  'core.app.core.subscriptionsHelper': ICoreSubscriptionsHelpersApp;
22
23
  'core.domain.application': IApplicationDomain;
24
+ 'core.domain.application.appStudio': IAppStudioDomain;
23
25
  'core.domain.permission': IPermissionDomain;
24
26
  'core.domain.record': IRecordDomain;
25
27
  'core.domain.eventsManager': IEventsManagerDomain;
@@ -28,4 +30,4 @@ export interface IApplicationAppDeps {
28
30
  'core.utils': IUtils;
29
31
  config: IConfig;
30
32
  }
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;
33
+ 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.application.appStudio': appStudioDomain, '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;
@@ -2,6 +2,7 @@ import { type IActionsListDomain } from 'domain/actionsList/actionsListDomain';
2
2
  import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
3
3
  import { type ILibraryDomain } from 'domain/library/libraryDomain';
4
4
  import { type IPermissionDomain } from 'domain/permission/permissionDomain';
5
+ import { type IAttributeDependentValuesPermissionDomain } from 'domain/permission/attributeDependentValuesPermissionDomain';
5
6
  import { type IRecordDomain } from 'domain/record/recordDomain';
6
7
  import { type ITreeDomain } from 'domain/tree/treeDomain';
7
8
  import { type IVersionProfileDomain } from 'domain/versionProfile/versionProfileDomain';
@@ -16,6 +17,7 @@ interface IDeps {
16
17
  'core.domain.tree': ITreeDomain;
17
18
  'core.domain.actionsList': IActionsListDomain;
18
19
  'core.domain.permission': IPermissionDomain;
20
+ 'core.domain.permission.attributeDependentValues': IAttributeDependentValuesPermissionDomain;
19
21
  'core.domain.versionProfile': IVersionProfileDomain;
20
22
  'core.app.graphql': IGraphqlApp;
21
23
  'core.app.core': ICoreApp;
@@ -6,6 +6,7 @@ import { type ITreeDomain } from 'domain/tree/treeDomain';
6
6
  import { type IViewDomain } from 'domain/view/viewDomain';
7
7
  import { type IGraphqlAppModule, type IGraphqlApp } from '../../graphql/graphqlApp';
8
8
  import { type ICoreApp } from '../coreApp';
9
+ import { type IExportProfileDomain } from 'domain/export/exportProfileDomain';
9
10
  export type ICoreLibraryApp = IGraphqlAppModule;
10
11
  interface IDeps {
11
12
  'core.domain.library'?: ILibraryDomain;
@@ -14,8 +15,9 @@ interface IDeps {
14
15
  'core.domain.tree'?: ITreeDomain;
15
16
  'core.domain.view'?: IViewDomain;
16
17
  'core.domain.permission'?: IPermissionDomain;
18
+ 'core.domain.export.exportProfile'?: IExportProfileDomain;
17
19
  'core.app.graphql'?: IGraphqlApp;
18
20
  'core.app.core'?: ICoreApp;
19
21
  }
20
- export default function ({ 'core.domain.library': libraryDomain, 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.domain.view': viewDomain, 'core.domain.permission': permissionDomain, 'core.app.graphql': graphqlApp, 'core.app.core': coreApp, }?: IDeps): ICoreLibraryApp;
22
+ export default function ({ 'core.domain.library': libraryDomain, 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.domain.view': viewDomain, 'core.domain.permission': permissionDomain, 'core.domain.export.exportProfile': exportProfileDomain, 'core.app.graphql': graphqlApp, 'core.app.core': coreApp, }?: IDeps): ICoreLibraryApp;
21
23
  export {};
@@ -1,7 +1,9 @@
1
1
  import { type IPluginsDomain } from 'domain/plugins/pluginsDomain';
2
2
  import { type IPluginInfos } from '../../_types/plugin';
3
3
  import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
4
- export interface ICorePluginsApp extends IGraphqlAppModule {
4
+ import { type IAppModule } from '_types/shared';
5
+ export interface ICorePluginsApp extends IGraphqlAppModule, IAppModule {
6
+ startPlugins(): Promise<void>;
5
7
  registerPlugin(path: string, plugin: IPluginInfos): void;
6
8
  }
7
9
  interface IDeps {
@@ -7,9 +7,12 @@ import { type IPaginationParams, type ISortParams } from '_types/list';
7
7
  import { type ITasksManagerDomain } from '../../domain/tasksManager/tasksManagerDomain';
8
8
  import { TaskStatus } from '../../_types/tasksManager';
9
9
  import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
10
+ import { type IAdminPermissionDomain } from 'domain/permission/adminPermissionDomain';
11
+ import { type IExtensionPoints } from '_types/extensionPoints';
10
12
  export interface ITasksManagerApp extends IGraphqlAppModule {
11
13
  initMaster(): Promise<NodeJS.Timeout>;
12
14
  initWorker(): Promise<void>;
15
+ extensionPoints?: IExtensionPoints;
13
16
  }
14
17
  interface IDeps {
15
18
  'core.domain.tasksManager'?: ITasksManagerDomain;
@@ -18,6 +21,7 @@ interface IDeps {
18
21
  'core.utils'?: IUtils;
19
22
  'core.domain.record'?: IRecordDomain;
20
23
  'core.domain.eventsManager'?: IEventsManagerDomain;
24
+ 'core.domain.permission.admin'?: IAdminPermissionDomain;
21
25
  }
22
26
  export interface IGetTasksArgs {
23
27
  filters?: ICoreEntityFilterOptions & {
@@ -28,5 +32,5 @@ export interface IGetTasksArgs {
28
32
  pagination?: IPaginationParams;
29
33
  sort?: ISortParams;
30
34
  }
31
- export default function ({ 'core.domain.record': recordDomain, 'core.domain.tasksManager': tasksManagerDomain, 'core.domain.eventsManager': eventsManager, }: IDeps): ITasksManagerApp;
35
+ export default function ({ 'core.domain.record': recordDomain, 'core.domain.tasksManager': tasksManagerDomain, 'core.domain.eventsManager': eventsManager, 'core.domain.permission.admin': adminPermissionDomain, }: IDeps): ITasksManagerApp;
32
36
  export {};
@@ -7,6 +7,7 @@ import { type IGraphqlAppModule, type IGraphqlApp } from '../../graphql/graphqlA
7
7
  import { type ICoreApp } from '../coreApp';
8
8
  import { type ICoreSubscriptionsHelpersApp } from '../helpers/subscriptions';
9
9
  import { type IRecordPermissionDomain } from '../../../domain/permission/recordPermissionDomain';
10
+ import { type IAttributeDependentValuesPermissionDomain } from 'domain/permission/attributeDependentValuesPermissionDomain';
10
11
  export type ITreeAttributeApp = IGraphqlAppModule;
11
12
  interface IDeps {
12
13
  'core.domain.tree': ITreeDomain;
@@ -18,6 +19,7 @@ interface IDeps {
18
19
  'core.app.core.subscriptionsHelper': ICoreSubscriptionsHelpersApp;
19
20
  'core.domain.library': ILibraryDomain;
20
21
  'core.domain.permission.record': IRecordPermissionDomain;
22
+ 'core.domain.permission.attributeDependentValues': IAttributeDependentValuesPermissionDomain;
21
23
  }
22
- export default function ({ 'core.domain.tree': treeDomain, 'core.domain.attribute': attributeDomain, 'core.domain.permission': permissionDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.app.core': coreApp, 'core.app.graphql': graphqlApp, 'core.app.core.subscriptionsHelper': subscriptionsHelper, 'core.domain.library': libraryDomain, 'core.domain.permission.record': recordPermissionDomain, }: IDeps): ITreeAttributeApp;
24
+ export default function ({ 'core.domain.tree': treeDomain, 'core.domain.attribute': attributeDomain, 'core.domain.permission': permissionDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.app.core': coreApp, 'core.app.graphql': graphqlApp, 'core.app.core.subscriptionsHelper': subscriptionsHelper, 'core.domain.library': libraryDomain, 'core.domain.permission.record': recordPermissionDomain, 'core.domain.permission.attributeDependentValues': attributeDependentValuesPermissionDomain, }: IDeps): ITreeAttributeApp;
23
25
  export {};
@@ -0,0 +1,17 @@
1
+ import { type IPermissionDomain } from 'domain/permission/permissionDomain';
2
+ import { type IQueryInfos } from '_types/queryInfos';
3
+ import { type IApplication } from '../../_types/application';
4
+ export interface IAppStudioDomain {
5
+ /**
6
+ * Extract and filter appStudioSettings from application settings.
7
+ * Filters workspaces based on user permissions (ACCESS_LIBRARY for library type, ACCESS_RECORD for record type)
8
+ */
9
+ getAppStudioSettings(params: {
10
+ application: IApplication;
11
+ ctx: IQueryInfos;
12
+ }): Promise<IApplication['appStudioSettings']>;
13
+ }
14
+ export interface IAppStudioDomainDeps {
15
+ 'core.domain.permission': IPermissionDomain;
16
+ }
17
+ export default function ({ 'core.domain.permission': permissionDomain }: IAppStudioDomainDeps): IAppStudioDomain;
@@ -1 +1,2 @@
1
1
  export { default } from './applicationDomain';
2
+ export { default as appStudio } from './appStudioDomain';
@@ -1,6 +1,7 @@
1
1
  import { type IUtils } from 'utils/utils';
2
2
  import { type ActionsListConfig } from '../../../_types/actionsList';
3
3
  import { type IAttribute, type IOAllowedTypes } from '../../../_types/attribute';
4
- export declare const getAllowedInputTypes: (attribute: IAttribute) => IOAllowedTypes;
4
+ declare const getAllowedInputTypes: (attribute: IAttribute) => IOAllowedTypes;
5
+ export default getAllowedInputTypes;
5
6
  export declare const getAllowedOutputTypes: (attribute: IAttribute) => IOAllowedTypes;
6
7
  export declare const getActionsListToSave: (attrDataToSave: IAttribute, existingAttrData: IAttribute, newAttr: boolean, utils: IUtils) => ActionsListConfig;
@@ -1,23 +1,33 @@
1
1
  import { type ILibraryDomain } from '../library/libraryDomain';
2
2
  import { type IQueryInfos } from '../../_types/queryInfos';
3
+ import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
4
+ import { type IConfig } from '_types/config';
5
+ export interface IExportProfileColumn {
6
+ columnLabel: string;
7
+ attribute: string;
8
+ }
9
+ export interface IExportProfile {
10
+ label: string;
11
+ columns: IExportProfileColumn[];
12
+ error?: {
13
+ message: string;
14
+ };
15
+ }
3
16
  export interface IExportProfileConfig {
4
17
  defaultProfile: string;
5
- profiles: Array<{
6
- label: string;
7
- columns: Array<{
8
- columnLabel: string;
9
- attribute: string;
10
- }>;
11
- }>;
18
+ profiles: IExportProfile[];
12
19
  }
13
20
  export interface IExportColumn {
14
21
  columnLabel: string;
15
22
  attribute: string;
16
23
  }
17
24
  export interface IExportProfileDomain {
25
+ getExportProfileConfig(libraryId: string, ctx: IQueryInfos): Promise<IExportProfileConfig | null>;
18
26
  getColumnsFromProfileConfig(profile: string | undefined, library: string, ctx: IQueryInfos): Promise<IExportColumn[]>;
19
27
  }
20
28
  export interface IExportProfileDomainDeps {
21
29
  'core.domain.library': ILibraryDomain;
30
+ 'core.domain.attribute': IAttributeDomain;
31
+ config: IConfig;
22
32
  }
23
- export default function ({ 'core.domain.library': libraryDomain }: IExportProfileDomainDeps): IExportProfileDomain;
33
+ export default function ({ 'core.domain.library': libraryDomain, 'core.domain.attribute': attributeDomain, config, }: IExportProfileDomainDeps): IExportProfileDomain;
@@ -1,6 +1,5 @@
1
1
  import { type IRecordDomain } from 'domain/record/recordDomain';
2
2
  import { type IUtils } from 'utils/utils';
3
- import { type ILogger } from '@leav/logger';
4
3
  import { type IQueryInfos } from '_types/queryInfos';
5
4
  import { type IValue, type IValueVersion } from '_types/value';
6
5
  import { type IFormElement } from '../../../_types/forms';
@@ -12,7 +11,6 @@ export declare const getElementValues: (params: {
12
11
  deps: {
13
12
  "core.domain.record"?: IRecordDomain;
14
13
  "core.utils"?: IUtils;
15
- "core.utils.logger"?: ILogger;
16
14
  };
17
15
  ctx: IQueryInfos;
18
16
  }) => Promise<{
@@ -4,7 +4,6 @@ import { type AttributeDependentValuesPermissionsActions, type IPermissionsDepen
4
4
  import { type IAttributeDomain } from '../attribute/attributeDomain';
5
5
  import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGroups';
6
6
  import { type IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
7
- import { type IDefaultPermissionHelper } from './helpers/defaultPermission';
8
7
  import { type IConfig } from '_types/config';
9
8
  export interface IAttributeDependentValuesPermissionDomain {
10
9
  getAttributeDependentValuesPermission(params: {
@@ -23,10 +22,22 @@ export interface IAttributeDependentValuesPermissionDomain {
23
22
  dependenciesTreeTargets: IPermissionsDependenciesTreeTarget[];
24
23
  ctx: IQueryInfos;
25
24
  }): Promise<boolean>;
25
+ filterAllowedDependentValuesOnItself(params: {
26
+ action: AttributeDependentValuesPermissionsActions;
27
+ attributeId: string;
28
+ targetValue: {
29
+ nodeId: string | null;
30
+ };
31
+ allValues: Array<{
32
+ nodeId: string | null;
33
+ }>;
34
+ ctx: IQueryInfos;
35
+ }): Promise<Array<{
36
+ nodeId: string | null;
37
+ }>>;
26
38
  }
27
39
  export interface IRecordAttributePermissionDomainDeps {
28
40
  'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
29
- 'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
30
41
  'core.domain.attribute': IAttributeDomain;
31
42
  'core.domain.tree.helpers.elementAncestors': IElementAncestorsHelper;
32
43
  'core.infra.value': IValueRepo;
@@ -1,6 +1,7 @@
1
1
  import { type IAmqpService } from '@leav/message-broker';
2
2
  import { type AwilixContainer } from 'awilix';
3
3
  import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDomain';
4
+ import { type IAdminPermissionDomain } from 'domain/permission/adminPermissionDomain';
4
5
  import { type IUtils } from 'utils/utils';
5
6
  import { type ILogger } from '@leav/logger';
6
7
  import type * as Config from '_types/config';
@@ -55,6 +56,8 @@ export interface ITasksManagerDomain {
55
56
  createTask(task: ITaskCreatePayload, ctx: IQueryInfos): Promise<string>;
56
57
  cancelTask(task: ITaskCancelPayload, ctx: IQueryInfos): Promise<void>;
57
58
  deleteTasks(tasks: ITaskDeletePayload[], ctx: IQueryInfos): Promise<void>;
59
+ registerTaskTypes(types: string[]): void;
60
+ getTaskTypes(): string;
58
61
  }
59
62
  export interface ITasksManagerDomainDeps {
60
63
  config: Config.IConfig;
@@ -62,9 +65,10 @@ export interface ITasksManagerDomainDeps {
62
65
  'core.infra.task': ITaskRepo;
63
66
  'core.depsManager': AwilixContainer;
64
67
  'core.domain.eventsManager': IEventsManagerDomain;
68
+ 'core.domain.permission.admin': IAdminPermissionDomain;
65
69
  'core.utils.logger': ILogger;
66
70
  'core.utils': IUtils;
67
71
  'core.utils.getSystemQueryContext': GetSystemQueryContext;
68
72
  }
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;
73
+ export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.task': taskRepo, 'core.depsManager': depsManager, 'core.domain.eventsManager': eventsManager, 'core.domain.permission.admin': adminPermissionDomain, 'core.utils.logger': logger, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext, }: ITasksManagerDomainDeps): ITasksManagerDomain;
70
74
  export {};
@@ -8,6 +8,7 @@ export interface IDeleteValueParams {
8
8
  recordId: string;
9
9
  attribute: string;
10
10
  value?: IValue;
11
+ skipReadonly?: boolean;
11
12
  ctx: IQueryInfos;
12
13
  }
13
14
  export interface IRunActionListParams {
@@ -0,0 +1,28 @@
1
+ import { type IActionsListDomain } from 'domain/actionsList/actionsListDomain';
2
+ import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
3
+ import { type IUtils } from 'utils/utils';
4
+ import { type IAttribute } from '_types/attribute';
5
+ import { type IQueryInfos } from '_types/queryInfos';
6
+ import { type IValue } from '_types/value';
7
+ /**
8
+ * Parameters for post-delete value processing.
9
+ */
10
+ interface IPostDeleteValueParams {
11
+ libraryId: string;
12
+ recordId: string;
13
+ attribute: IAttribute;
14
+ value: IValue;
15
+ ctx: IQueryInfos;
16
+ deps: {
17
+ actionsListDomain: IActionsListDomain;
18
+ attributeDomain: IAttributeDomain;
19
+ utils: IUtils;
20
+ };
21
+ }
22
+ /**
23
+ * Executes post-delete action lists on deleted value
24
+ * Action lists can perform side effects
25
+ * Unlike pre-delete value actions, this runs AFTER the value is persisted to the database.
26
+ */
27
+ declare const postDeleteValue: (params: IPostDeleteValueParams) => Promise<void>;
28
+ export default postDeleteValue;
@@ -0,0 +1,28 @@
1
+ import { type IActionsListDomain } from 'domain/actionsList/actionsListDomain';
2
+ import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
3
+ import { type IUtils } from 'utils/utils';
4
+ import { type IAttribute } from '_types/attribute';
5
+ import { type IQueryInfos } from '_types/queryInfos';
6
+ import { type IValue } from '_types/value';
7
+ /**
8
+ * Parameters for post-save value processing.
9
+ */
10
+ interface IPostSaveValueParams {
11
+ libraryId: string;
12
+ recordId: string;
13
+ attribute: IAttribute;
14
+ value: IValue;
15
+ ctx: IQueryInfos;
16
+ deps: {
17
+ actionsListDomain: IActionsListDomain;
18
+ attributeDomain: IAttributeDomain;
19
+ utils: IUtils;
20
+ };
21
+ }
22
+ /**
23
+ * Executes post-save action lists on saved value
24
+ * Action lists can perform side effects
25
+ * Unlike pre-save value actions, this runs AFTER the value is persisted to the database.
26
+ */
27
+ declare const postSaveValue: (params: IPostSaveValueParams) => Promise<void>;
28
+ export default postSaveValue;
@@ -65,6 +65,7 @@ export interface IValueDomain {
65
65
  recordId: string;
66
66
  attribute: string;
67
67
  value: ISaveValue;
68
+ skipReadonly?: boolean;
68
69
  ctx: IQueryInfos;
69
70
  }): Promise<IValue[]>;
70
71
  /**
@@ -80,6 +81,7 @@ export interface IValueDomain {
80
81
  ctx: IQueryInfos;
81
82
  keepEmpty?: boolean;
82
83
  skipPermission?: boolean;
84
+ skipReadonly?: boolean;
83
85
  }): Promise<ISaveBatchValueResult>;
84
86
  deleteValue(params: IDeleteValueParams): Promise<IValue[]>;
85
87
  formatValue(params: {
@@ -26,7 +26,9 @@ export declare const commonAttributeData: {
26
26
  name: string;
27
27
  is_system: boolean;
28
28
  }[];
29
+ postSaveValue: any[];
29
30
  deleteValue: any[];
31
+ postDeleteValue: any[];
30
32
  };
31
33
  };
32
34
  export declare const createLibraries: (libraries: MigrationLibraryToCreate[], dbService: IDbService, libraryRepo: ILibraryRepo, ctx: IQueryInfos) => Promise<void>;
@@ -4,7 +4,7 @@ import { type IConfig } from '_types/config';
4
4
  import { type IQueryInfos } from '_types/queryInfos';
5
5
  export interface IMailerService {
6
6
  mailer?: nodemailer.Transporter;
7
- sendEmail?: ({ to, subject, text, html, attachments }: ISendMailParams, ctx: IQueryInfos) => Promise<void>;
7
+ sendEmail?: ({ to, subject, text, html, attachments, headers }: ISendMailParams, ctx: IQueryInfos) => Promise<void>;
8
8
  }
9
9
  interface IDeps {
10
10
  config: IConfig;
@@ -21,6 +21,7 @@ interface ISendMailParams {
21
21
  content?: string | Buffer;
22
22
  path?: string;
23
23
  }>;
24
+ headers?: Record<string, string>;
24
25
  }
25
26
  export default function ({ config, 'core.domain.globalSettings': globalSettingsDomain, 'core.infra.mailer': mailer, }: IDeps): IMailerService;
26
27
  export {};
@@ -2,9 +2,10 @@ interface ICallerInfo {
2
2
  path: string;
3
3
  line: string;
4
4
  col: string;
5
+ matchStackIndex: number;
5
6
  }
6
7
  export declare class LoggerCallStack {
7
- private callerLineIndexInStack;
8
+ private callerLineSearchFromIndexInStack;
8
9
  getCallStackTrace(): string | null;
9
10
  getLocationInfo(): ICallerInfo | null;
10
11
  private getStackLines;
@@ -1,2 +1,2 @@
1
1
  import winston from 'winston';
2
- export declare const addLocationInfoInLog: winston.Logform.FormatWrap;
2
+ export declare const addLocationInfoInLog: (isLogLevelEnabled: (level: string) => boolean) => winston.Logform.FormatWrap;
@@ -20,6 +20,10 @@ export declare enum TabsDirection {
20
20
  HORIZONTAL = "horizontal",
21
21
  VERTICAL = "vertical"
22
22
  }
23
+ export declare enum DisplayMode {
24
+ EXPLORER = "EXPLORER",
25
+ TAG = "TAG"
26
+ }
23
27
  export interface ICommonFieldsSettings {
24
28
  label?: Record<string, string | null>;
25
29
  attribute?: string;
@@ -55,7 +59,7 @@ export interface IFormLinkFieldSettings extends ICommonFieldsSettings {
55
59
  label: Record<string, string>;
56
60
  }>;
57
61
  displayRecordIdentity: boolean;
58
- tagDisplayMode: boolean;
62
+ displayMode: DisplayMode;
59
63
  editFormId: string;
60
64
  }
61
65
  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.6.0-e2820b2f",
3
+ "version": "1.6.0-e5914a32",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",