@aristid/leav-types 1.9.0 → 1.10.0-028c8eef

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 (52) hide show
  1. package/apps/core/codegen.d.ts +3 -0
  2. package/apps/core/config/default.d.ts +20 -2
  3. package/apps/core/config/development.d.ts +0 -5
  4. package/apps/core/config/test.d.ts +4 -0
  5. package/apps/core/src/__tests__/e2e/_gqlTypes/index.d.ts +1048 -0
  6. package/apps/core/src/__tests__/e2e/api/_fixtures/applications/login/index-hashed.d.ts +0 -0
  7. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/domain/fakeDomain.d.ts +6 -1
  8. package/apps/core/src/__tests__/e2e/api/_fixtures/fakeplugin/index.d.ts +4 -0
  9. package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +32 -2
  10. package/apps/core/src/__tests__/setup.d.ts +1 -0
  11. package/apps/core/src/_constants/globalSettings.d.ts +1 -0
  12. package/apps/core/src/_types/config.d.ts +19 -7
  13. package/apps/core/src/_types/errors.d.ts +8 -3
  14. package/apps/core/src/_types/events.d.ts +3 -3
  15. package/apps/core/src/_types/import.d.ts +4 -0
  16. package/apps/core/src/_types/value.d.ts +1 -1
  17. package/apps/core/src/app/core/recordApp/_types.d.ts +1 -0
  18. package/apps/core/src/domain/application/appStudioDomain.d.ts +24 -5
  19. package/apps/core/src/domain/application/applicationDomain.d.ts +4 -2
  20. package/apps/core/src/domain/application/helpers/getLibrarySystemPanels.d.ts +11 -0
  21. package/apps/core/src/domain/application/helpers/index.d.ts +1 -0
  22. package/apps/core/src/domain/attribute/attributeDomain.d.ts +3 -1
  23. package/apps/core/src/domain/eventsManager/eventsManagerDomain.d.ts +1 -1
  24. package/apps/core/src/domain/import/importDomain.d.ts +1 -7
  25. package/apps/core/src/domain/permission/attributeDependentValuesPermissionDomain.d.ts +0 -2
  26. package/apps/core/src/domain/permission/recordPermissionDomain.d.ts +2 -0
  27. package/apps/core/src/domain/record/_types.d.ts +7 -0
  28. package/apps/core/src/domain/record/helpers/deleteRecord.d.ts +5 -1
  29. package/apps/core/src/domain/record/recordDomain.d.ts +3 -2
  30. package/apps/core/src/domain/value/_types.d.ts +0 -1
  31. package/apps/core/src/domain/value/helpers/areValuesIdentical.d.ts +4 -0
  32. package/apps/core/src/domain/value/helpers/canSaveRecordValue.d.ts +3 -0
  33. package/apps/core/src/domain/value/valueDomain.d.ts +3 -5
  34. package/apps/core/src/infra/attributeTypes/attributeSimpleLinkRepo.d.ts +5 -2
  35. package/apps/core/src/infra/attributeTypes/attributeTypesRepo.d.ts +5 -5
  36. package/apps/core/src/infra/cache/cacheService.d.ts +3 -1
  37. package/apps/core/src/infra/db/migrations/013-threads/constants.d.ts +1 -0
  38. package/apps/core/src/infra/db/migrations/015-addExplorerStudioApp.d.ts +7 -0
  39. package/apps/core/src/infra/db/migrations/016-addStatusIconAttribute.d.ts +9 -0
  40. package/apps/core/src/infra/db/migrations/017-moveLibrariesPanelsFromApplicationsToLibrariesSettings.d.ts +9 -0
  41. package/apps/core/src/infra/db/migrations/018-moveAppStudioToCampaignsManager.d.ts +7 -0
  42. package/apps/core/src/infra/record/recordRepo.d.ts +3 -1
  43. package/apps/core/src/infra/tree/treeRepo.d.ts +3 -1
  44. package/apps/core/src/infra/value/valueRepo.d.ts +4 -4
  45. package/apps/core/src/utils/configureDayjs.d.ts +2 -0
  46. package/apps/core/src/utils/utils.d.ts +1 -2
  47. package/apps/core/tsconfig.types.tsbuildinfo +1 -1
  48. package/package.json +4 -4
  49. package/apps/core/src/domain/application/appStudioDomain.spec.d.ts +0 -1
  50. package/apps/core/src/domain/record/helpers/validateLibrary.d.ts +0 -6
  51. /package/apps/core/src/__tests__/e2e/api/trees/{treeNodeChildrenQuery.test.d.ts → treeNodeChildrenAndContentQuery.test.d.ts} +0 -0
  52. /package/apps/core/src/{__tests__/e2e/api/values/countValuesOccurrences.test.d.ts → domain/value/helpers/areValuesIdentical.spec.d.ts} +0 -0
@@ -1,3 +1,4 @@
1
+ import { type IEventsManagerDomain } from '../../../../../../domain/eventsManager/eventsManagerDomain';
1
2
  export interface IFakeDomain {
2
3
  execWorker({ fromTask }: {
3
4
  fromTask: string;
@@ -5,4 +6,8 @@ export interface IFakeDomain {
5
6
  startPlugin(): void;
6
7
  getPluginStarted(): boolean;
7
8
  }
8
- export default function (): IFakeDomain;
9
+ interface IDeps {
10
+ 'core.domain.eventsManager': IEventsManagerDomain;
11
+ }
12
+ export default function ({ 'core.domain.eventsManager': eventsManagerDomain }: IDeps): IFakeDomain;
13
+ export {};
@@ -13,5 +13,9 @@ interface IDeps {
13
13
  'core.domain.notification': INotificationDomain;
14
14
  'fakeplugin.domain': IFakeDomain;
15
15
  }
16
+ export declare enum FakePluginActions {
17
+ FAKE_PLUGIN_ACTION = "fakeplugin_FAKE_PLUGIN_ACTION",
18
+ FAKE_PLUGIN_ACTION2 = "fakeplugin_FAKE_PLUGIN_ACTION2"
19
+ }
16
20
  export default function ({ translator, 'core.infra.value': valueRepo, 'core.domain.attribute': attributeDomain, 'core.domain.tasksManager': tasksManagerDomain, 'core.domain.notification': notificationDomain, 'fakeplugin.domain': fakeDomain, }: IDeps): IPluginInitModule;
17
21
  export {};
@@ -2,6 +2,7 @@ import WebSocket from 'ws';
2
2
  import { type Client as GraphqlWsClient } from 'graphql-ws';
3
3
  import { type AxiosResponse } from 'axios';
4
4
  import FormData from 'form-data';
5
+ import { getSdk } from '../_gqlTypes';
5
6
  import { type ActionsListConfig } from '_types/actionsList';
6
7
  import { type ITreeElement } from '_types/tree';
7
8
  import { AttributeFormats, type AttributeTypes, type IAttributeVersionsConf, type IEmbeddedAttribute } from '../../../_types/attribute';
@@ -11,6 +12,7 @@ export interface IGlobalThis {
11
12
  guestUser: IE2EUserParams;
12
13
  nonAdminUser: IE2EUserParams;
13
14
  nonAdminGroupId: string;
15
+ graphqlUrl: string;
14
16
  }
15
17
  export interface IE2EUser {
16
18
  userId: string;
@@ -24,7 +26,7 @@ export declare const e2eAdminUser: () => IE2EUser;
24
26
  export declare const e2eGuestUser: () => IE2EUser;
25
27
  export declare const e2eNonAdminUser: () => IE2EUser;
26
28
  export declare const e2eNonAdminGroupId: () => string;
27
- export declare function getGraphQLUrl(): Promise<string>;
29
+ export declare const getGraphQLUrl: () => string;
28
30
  export declare class E2EGraphQLError extends Error {
29
31
  readonly response: AxiosResponse;
30
32
  constructor(message: string, response: AxiosResponse);
@@ -33,9 +35,37 @@ export interface IMakeGraphQlCallOptions {
33
35
  user?: IE2EUser;
34
36
  skipLogErrors?: boolean;
35
37
  }
38
+ export declare const getSdkWithUser: (user: IE2EUser) => ReturnType<typeof getSdk>;
39
+ export declare const adminUserSdk: {
40
+ SaveApiKey(variables: import("../_gqlTypes").SaveApiKeyMutationVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").SaveApiKeyMutation>;
41
+ GetApiKeys(variables?: import("../_gqlTypes").GetApiKeysQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").GetApiKeysQuery>;
42
+ DeleteApiKey(variables: import("../_gqlTypes").DeleteApiKeyMutationVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").DeleteApiKeyMutation>;
43
+ Me(variables?: import("../_gqlTypes").MeQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").MeQuery>;
44
+ GetRecord(variables: import("../_gqlTypes").GetRecordQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").GetRecordQuery>;
45
+ };
46
+ export declare const guestUserSdk: {
47
+ SaveApiKey(variables: import("../_gqlTypes").SaveApiKeyMutationVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").SaveApiKeyMutation>;
48
+ GetApiKeys(variables?: import("../_gqlTypes").GetApiKeysQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").GetApiKeysQuery>;
49
+ DeleteApiKey(variables: import("../_gqlTypes").DeleteApiKeyMutationVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").DeleteApiKeyMutation>;
50
+ Me(variables?: import("../_gqlTypes").MeQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").MeQuery>;
51
+ GetRecord(variables: import("../_gqlTypes").GetRecordQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").GetRecordQuery>;
52
+ };
53
+ export declare const nonAdminUserSdk: {
54
+ SaveApiKey(variables: import("../_gqlTypes").SaveApiKeyMutationVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").SaveApiKeyMutation>;
55
+ GetApiKeys(variables?: import("../_gqlTypes").GetApiKeysQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").GetApiKeysQuery>;
56
+ DeleteApiKey(variables: import("../_gqlTypes").DeleteApiKeyMutationVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").DeleteApiKeyMutation>;
57
+ Me(variables?: import("../_gqlTypes").MeQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").MeQuery>;
58
+ GetRecord(variables: import("../_gqlTypes").GetRecordQueryVariables, requestHeaders?: HeadersInit, signal?: RequestInit["signal"]): Promise<import("../_gqlTypes").GetRecordQuery>;
59
+ };
36
60
  export declare function makeGraphQlCall(query: string | FormData, options?: IMakeGraphQlCallOptions): Promise<any>;
37
61
  export declare function importFileGraphQlCall(query: string, filePath: string, sheets?: any): Promise<any>;
38
- export declare function gqlSaveLibrary(id: string, label: string, additionalAttributes?: string[], settings?: string): Promise<any>;
62
+ export declare function gqlSaveLibrary(id: string, label: string, additionalAttributes?: string[], settings?: string, recordIdentityConf?: {
63
+ label: string;
64
+ subLabel?: string;
65
+ preview?: string;
66
+ color?: string;
67
+ treeColorPreview?: string;
68
+ }): Promise<any>;
39
69
  export declare function gqlSaveApplication(id: string, label: string, endpoint: string): Promise<any>;
40
70
  export declare function gqlSaveAttribute(params: {
41
71
  id: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1,3 @@
1
1
  export declare const APP_DEFAULT_NAME = "LEAV Engine";
2
2
  export declare const DEFAULT_APPLICATION = "portal";
3
+ export declare const EXPLORER_STUDIO_APPLICATION = "explorer_studio";
@@ -68,11 +68,6 @@ export interface IServer {
68
68
  }
69
69
  export interface IActions {
70
70
  excel: {
71
- /**
72
- * Replace deprecated hot-formula-parser npm module by new hyperformula npm module
73
- * Formulas should be compatible
74
- */
75
- useNewHyperformula: boolean;
76
71
  /**
77
72
  * Add debug log for each calculation with formula and result or error
78
73
  */
@@ -172,7 +167,6 @@ export interface IPermissions {
172
167
  adminGroup: IPermissionsByTypesAndActions;
173
168
  enableCache: boolean;
174
169
  enableAccessRecordByDefaultBackendFilter: boolean;
175
- enableAttributeDependentValuesPermissions: boolean;
176
170
  }
177
171
  export interface IAmqp {
178
172
  connOpt: Options.Connect;
@@ -246,6 +240,14 @@ export interface IImport {
246
240
  */
247
241
  delayTaskExecMs: number;
248
242
  }
243
+ interface ICommonDataLoaderConfig {
244
+ /**
245
+ * Split batch in multiple batch if number of keys to load is superior to this value.
246
+ * Too low value can cause performance issue, to many arangodb or redis requeste, too high value can cause memory, performance and availability issue.
247
+ * Adjust according to your use case and data size
248
+ */
249
+ maxBatchSize?: number;
250
+ }
249
251
  /**
250
252
  * Data loaders configuration for performances
251
253
  */
@@ -267,7 +269,16 @@ export interface IDataLoaders {
267
269
  * Temporary, to be removed in future
268
270
  */
269
271
  useBatch: boolean;
270
- };
272
+ } & ICommonDataLoaderConfig;
273
+ };
274
+ recordRepo: {
275
+ getRecord: ICommonDataLoaderConfig;
276
+ };
277
+ treeRepo: {
278
+ getRecordByNodeId: ICommonDataLoaderConfig;
279
+ };
280
+ cacheService: {
281
+ ramCache: ICommonDataLoaderConfig;
271
282
  };
272
283
  }
273
284
  export interface IDiskCache {
@@ -278,6 +289,7 @@ export interface IPreview {
278
289
  }
279
290
  export interface IApplicationsConfig {
280
291
  rootFolder: string;
292
+ assetsMaxAge?: string;
281
293
  }
282
294
  export interface IFilesConfig {
283
295
  rootPaths: string;
@@ -5,6 +5,8 @@ export declare enum ErrorTypes {
5
5
  INTERNAL_ERROR = "INTERNAL_ERROR"
6
6
  }
7
7
  export declare enum Errors {
8
+ APP_STUDIO_WORKSPACE_LIBRARY_ID_REQUIRED = "APP_STUDIO_WORKSPACE_LIBRARY_ID_REQUIRED",
9
+ APP_STUDIO_WORKSPACE_RECORD_ID_REQUIRED = "APP_STUDIO_WORKSPACE_RECORD_ID_REQUIRED",
8
10
  ATTRIBUTE_USED_BY_LIBRARY = "ATTRIBUTE_USED_BY_LIBRARY",
9
11
  ATTRIBUTE_USED_IN_METADATA = "ATTRIBUTE_USED_IN_METADATA",
10
12
  CANNOT_SAVE_METADATA = "CANNOT_SAVE_METADATA",
@@ -13,7 +15,8 @@ export declare enum Errors {
13
15
  DUPLICATE_FILENAMES = "DUPLICATE_FILENAMES",
14
16
  ELEMENT_ALREADY_PRESENT = "ELEMENT_ALREADY_PRESENT",
15
17
  ELEMENT_ALREADY_PRESENT_IN_ANCESTORS = "ELEMENT_ALREADY_PRESENT_IN_ANCESTORS",
16
- ELEMENT_NOT_IN_TREE = "ELEMENT_NOT_IN_TREE",
18
+ NODE_NOT_IN_TREE = "NODE_NOT_IN_TREE",
19
+ RECORD_NOT_IN_TREE = "RECORD_NOT_IN_TREE",
17
20
  ELEMENT_WITH_SAME_PATH_ALREADY_PRESENT = "ELEMENT_WITH_SAME_PATH_ALREADY_PRESENT",
18
21
  ENCRYPT_ERROR = "ENCRYPT_ERROR",
19
22
  ERROR = "ERROR",
@@ -23,6 +26,7 @@ export declare enum Errors {
23
26
  FORBIDDEN_ID = "FORBIDDEN_ID",
24
27
  FORBIDDEN_KEY = "FORBIDDEN_KEY",
25
28
  FORMAT_ERROR = "FORMAT_ERROR",
29
+ IMMUTABLE_CORE_SYSTEM_ATTRIBUTE = "IMMUTABLE_CORE_SYSTEM_ATTRIBUTE",
26
30
  INVALID_ACTION_TYPE = "INVALID_ACTION_TYPE",
27
31
  INVALID_ATTRIBUTE_TYPE = "INVALID_ATTRIBUTE_TYPE",
28
32
  INVALID_ATTRIBUTE_FILTER_FORMAT = "INVALID_ATTRIBUTE_FILTER_FORMAT",
@@ -51,7 +55,7 @@ export declare enum Errors {
51
55
  LIBRARY_FORBIDDEN_AS_CHILD = "LIBRARY FORBIDDEN AS CHILD",
52
56
  METADATA_PERMISSION_ERROR = "METADATA_PERMISSION_ERROR",
53
57
  MISSING_ACTION_PREFIX = "MISSING_ACTION_PREFIX",
54
- MISSING_ELEMENTS = "MISSING_ELEMENTS",
58
+ MISSING_IMPORT_ELEMENTS = "MISSING_IMPORT_ELEMENTS",
55
59
  MISSING_FIELDS = "MISSING_FIELDS",
56
60
  MISSING_LIBRARY_ID = "MISSING_LIBRARY_ID",
57
61
  MISSING_RECORD_ID = "MISSING_RECORD_ID",
@@ -65,8 +69,8 @@ export declare enum Errors {
65
69
  PREVIEWS_SETTINGS_DUPLICATE_NAMES = "PREVIEWS_SETTINGS_DUPLICATE_NAMES",
66
70
  PREVIEWS_SETTINGS_NOT_ALLOWED = "PREVIEWS_SETTINGS_NOT_ALLOWED",
67
71
  PROTECTED_ENDPOINT = "PROTECTED_ENDPOINT",
68
- READONLY_ATTRIBUTE = "READONLY_ATTRIBUTE",
69
72
  RECORD_ACTIVATION_FAILED = "RECORD_ACTIVATION_FAILED",
73
+ RECORD_NOT_FOUND_FOR_IMPORT_MATCH = "RECORD_NOT_FOUND_FOR_IMPORT_MATCH",
70
74
  REQUIRED_ATTRIBUTE = "REQUIRED_ATTRIBUTE",
71
75
  REQUIRED_ATTRIBUTE_FORMAT = "REQUIRED_ATTRIBUTE_FORMAT",
72
76
  REQUIRED_ATTRIBUTE_LABEL = "REQUIRED_ATTRIBUTE_LABEL",
@@ -75,6 +79,7 @@ export declare enum Errors {
75
79
  REQUIRED_ATTRIBUTE_TYPE = "REQUIRED_ATTRIBUTE_TYPE",
76
80
  SYSTEM_ATTRIBUTE_DELETION = "SYSTEM_ATTRIBUTE_DELETION",
77
81
  SYSTEM_LIBRARY_DELETION = "SYSTEM_LIBRARY_DELETION",
82
+ SYSTEM_APPLICATION_DELETION = "SYSTEM_APPLICATION_DELETION",
78
83
  SYSTEM_TREE_DELETION = "SYSTEM_TREE_DELETION",
79
84
  TOO_MUCH_LIBRARIES_ON_FILES_TREE = "TOO_MUCH_LIBRARIES_ON_FILES_TREE",
80
85
  UNBINDED_ATTRIBUTES = "UNBINDED_ATTRIBUTES",
@@ -14,8 +14,8 @@ type OnlyObject<T> = T extends object ? T : never;
14
14
  * Maybe move all DBPayloadData types in @leav/utils type to allow event consumers outside core to use them
15
15
  * without having to redeclare them. For now before and after are any in @leav/utils
16
16
  */
17
- export interface IDbPayloadInternal<DBPayloadAction extends EventAction> extends IDbPayload {
18
- action: DBPayloadAction;
17
+ export interface IDbPayloadInternal<DBPayloadAction extends EventAction | unknown> extends IDbPayload {
18
+ action: DBPayloadAction extends EventAction ? DBPayloadAction : string;
19
19
  before?: OnlyObject<IDBPayloadData<DBPayloadAction>>;
20
20
  after?: OnlyObject<IDBPayloadData<DBPayloadAction>>;
21
21
  }
@@ -42,5 +42,5 @@ interface IDBPayloadDataMap {
42
42
  [EventAction.TREE_DELETE]: ITree;
43
43
  [EventAction.PERMISSION_SAVE]: IPermission;
44
44
  }
45
- export type IDBPayloadData<DBPayloadAction extends EventAction> = DBPayloadAction extends keyof IDBPayloadDataMap ? IDBPayloadDataMap[DBPayloadAction] : never;
45
+ export type IDBPayloadData<DBPayloadAction extends EventAction | unknown> = DBPayloadAction extends keyof IDBPayloadDataMap ? IDBPayloadDataMap[DBPayloadAction] : DBPayloadAction extends string ? object : never;
46
46
  export {};
@@ -40,6 +40,10 @@ export interface IElement {
40
40
  matches: IMatch[];
41
41
  mode: ImportMode;
42
42
  data: IData[];
43
+ excelMapping?: {
44
+ sheet: number;
45
+ line: number;
46
+ };
43
47
  }
44
48
  export interface ITree {
45
49
  library: string;
@@ -151,7 +151,7 @@ export interface IBaseValueByAttributeType {
151
151
  [AttributeTypes.ADVANCED_LINK]: ILinkBaseValue;
152
152
  [AttributeTypes.TREE]: ITreeBaseValue;
153
153
  }
154
- export type IValuesOccurrences<SimpleValueType extends IBaseValue = IBaseValue> = Array<{
154
+ export type IDistinctValue<SimpleValueType extends IBaseValue = IBaseValue> = Array<{
155
155
  value: SimpleValueType['payload'] | null;
156
156
  count: number;
157
157
  }>;
@@ -10,6 +10,7 @@ export type ICreateRecordValue = Override<Omit<IValue, 'version'>, {
10
10
  }>;
11
11
  export interface ICreateRecordParams {
12
12
  library: string;
13
+ skipActivate?: boolean;
13
14
  data?: {
14
15
  values: ICreateRecordValue[];
15
16
  version: IValueVersionFromGql;
@@ -1,17 +1,36 @@
1
- import { type IPermissionDomain } from 'domain/permission/permissionDomain';
2
- import { type IQueryInfos } from '_types/queryInfos';
1
+ import { type IPermissionDomain } from '../../domain/permission/permissionDomain';
2
+ import { type IQueryInfos } from '../../_types/queryInfos';
3
3
  import { type IApplication } from '../../_types/application';
4
+ import { type ILibraryDomain } from '../../domain/library/libraryDomain';
5
+ import { type IRecordDomain } from '../../domain/record/recordDomain';
6
+ import { type IConfig } from '../../_types/config';
7
+ import { type IGetLibrarySystemPanelsHelper } from './helpers/getLibrarySystemPanels';
4
8
  export interface IAppStudioDomain {
5
9
  /**
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)
10
+ * Extract and dynamically generate appStudioSettings from application and libraries settings.
11
+ *
12
+ * Also:
13
+ * - Filters workspaces based on user permissions (ACCESS_LIBRARY for library type, ACCESS_RECORD for record type).
14
+ * - Sets titles for workspaces if not provided.
15
+ * - Recursively gets library panels based on workspaces and library recordsPanels.
8
16
  */
9
17
  getAppStudioSettings(params: {
10
18
  application: IApplication;
11
19
  ctx: IQueryInfos;
12
20
  }): Promise<IApplication['appStudioSettings']>;
21
+ /**
22
+ * Check if application has defined panels on each library and delete them
23
+ */
24
+ deleteLibraryPanelsForApplication(params: {
25
+ applicationId: string;
26
+ ctx: IQueryInfos;
27
+ }): Promise<void>;
13
28
  }
14
29
  export interface IAppStudioDomainDeps {
30
+ config: IConfig;
15
31
  'core.domain.permission': IPermissionDomain;
32
+ 'core.domain.library': ILibraryDomain;
33
+ 'core.domain.record': IRecordDomain;
34
+ 'core.domain.application.helpers.getLibrarySystemPanels': IGetLibrarySystemPanelsHelper;
16
35
  }
17
- export default function ({ 'core.domain.permission': permissionDomain }: IAppStudioDomainDeps): IAppStudioDomain;
36
+ export default function ({ config, 'core.domain.permission': permissionDomain, 'core.domain.library': libraryDomain, 'core.domain.record': recordDomain, 'core.domain.application.helpers.getLibrarySystemPanels': librarySystemPanelsHelper, }: IAppStudioDomainDeps): IAppStudioDomain;
@@ -8,6 +8,7 @@ import { type IConfig } from '_types/config';
8
8
  import { type IQueryInfos } from '_types/queryInfos';
9
9
  import { type IApplication, type IApplicationModule, type IGetCoreApplicationsParams } from '../../_types/application';
10
10
  import { type IList } from '../../_types/list';
11
+ import { type IAppStudioDomain } from './appStudioDomain';
11
12
  export declare const MAX_CONSULTATION_HISTORY_SIZE = 10;
12
13
  export interface IApplicationDomain {
13
14
  getApplicationProperties(params: {
@@ -50,8 +51,9 @@ export interface IApplicationDomainDeps {
50
51
  'core.domain.user': IUserDomain;
51
52
  'core.domain.eventsManager': IEventsManagerDomain;
52
53
  'core.infra.application': IApplicationRepo;
54
+ 'core.domain.application.appStudio': IAppStudioDomain;
53
55
  'core.utils': IUtils;
54
- translator: i18n;
55
56
  config: IConfig;
57
+ translator: i18n;
56
58
  }
57
- export default function ({ 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.user': userDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.application': applicationRepo, 'core.utils': utils, translator, config, }: IApplicationDomainDeps): IApplicationDomain;
59
+ export default function ({ 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.user': userDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.application': applicationRepo, 'core.domain.application.appStudio': appStudioDomain, 'core.utils': utils, config, translator, }: IApplicationDomainDeps): IApplicationDomain;
@@ -0,0 +1,11 @@
1
+ import { type IApplication } from '_types/application';
2
+ import { type i18n } from 'i18next';
3
+ import { type IConfig } from '_types/config';
4
+ export interface IGetLibrarySystemPanelsHelperDeps {
5
+ translator: i18n;
6
+ config: IConfig;
7
+ }
8
+ export interface IGetLibrarySystemPanelsHelper {
9
+ getLibrarySystemPanels: (libraryId: string, applicationId: string) => IApplication['appStudioSettings'];
10
+ }
11
+ export default function ({ translator, config }: IGetLibrarySystemPanelsHelperDeps): IGetLibrarySystemPanelsHelper;
@@ -0,0 +1 @@
1
+ export { default as getLibrarySystemPanels } from './getLibrarySystemPanels';
@@ -13,6 +13,7 @@ import { type ICachesService } from '../../infra/cache/cacheService';
13
13
  import { type IAttribute, type IGetCoreAttributesParams, type IGetCoreFormAttributesParams, type IOAllowedTypes } from '../../_types/attribute';
14
14
  import { type IList } from '../../_types/list';
15
15
  import { type IActionsListDomain } from '../actionsList/actionsListDomain';
16
+ import { type IValidateHelper } from 'domain/helpers/validate';
16
17
  export interface IAttributeDomain {
17
18
  getAttributeProperties({ id, ctx }: {
18
19
  id: string;
@@ -67,6 +68,7 @@ export interface IAttributeDomainDeps {
67
68
  'core.domain.helpers.getCoreEntityById': GetCoreEntityByIdFunc;
68
69
  'core.domain.versionProfile': IVersionProfileDomain;
69
70
  'core.domain.eventsManager': IEventsManagerDomain;
71
+ 'core.domain.helpers.validate': IValidateHelper;
70
72
  'core.infra.form': IFormRepo;
71
73
  'core.infra.library': ILibraryRepo;
72
74
  'core.infra.tree': ITreeRepo;
@@ -74,4 +76,4 @@ export interface IAttributeDomainDeps {
74
76
  'core.utils': IUtils;
75
77
  config: any;
76
78
  }
77
- export default function ({ 'core.infra.attribute': attributeRepo, 'core.domain.actionsList': actionsListDomain, 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.versionProfile': versionProfileDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.form': formRepo, 'core.infra.library': libraryRepo, 'core.infra.tree': treeRepo, 'core.infra.cache.cacheService': cacheService, 'core.utils': utils, config, }: IAttributeDomainDeps): IAttributeDomain;
79
+ export default function ({ 'core.infra.attribute': attributeRepo, 'core.domain.actionsList': actionsListDomain, 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.versionProfile': versionProfileDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.helpers.validate': validateHelper, 'core.infra.form': formRepo, 'core.infra.library': libraryRepo, 'core.infra.tree': treeRepo, 'core.infra.cache.cacheService': cacheService, 'core.utils': utils, config, }: IAttributeDomainDeps): IAttributeDomain;
@@ -7,7 +7,7 @@ import type * as Config from '_types/config';
7
7
  import { type IQueryInfos } from '_types/queryInfos';
8
8
  import { type IDbPayloadInternal } from '_types/events';
9
9
  export interface IEventsManagerDomain {
10
- sendDatabaseEvent<DBPayloadAction extends EventAction>(payload: IDbPayloadInternal<DBPayloadAction>, ctx: IQueryInfos): Promise<void>;
10
+ sendDatabaseEvent<DBPayloadAction extends EventAction | unknown>(payload: IDbPayloadInternal<DBPayloadAction>, ctx: IQueryInfos): Promise<void>;
11
11
  sendPubSubEvent(payload: IPubSubPayload, ctx: IQueryInfos): Promise<void>;
12
12
  subscribe(triggersName: string[]): AsyncIterator<any>;
13
13
  initPubSubEventsConsumer(): Promise<void>;
@@ -37,8 +37,8 @@ export interface IImportExcelParams {
37
37
  }
38
38
  interface IImportDataParams {
39
39
  filename: string;
40
+ fromExcel?: boolean;
40
41
  ctx: IQueryInfos;
41
- excelMapping?: IExcelMapping;
42
42
  }
43
43
  interface IImportConfigParams {
44
44
  filepath: string;
@@ -52,12 +52,6 @@ export interface IImportDomain {
52
52
  importData(params: IImportDataParams, task?: ITaskFuncParams): Promise<string>;
53
53
  importExcel({ filename, sheets, startAt }: IImportExcelParams, ctx: IQueryInfos): Promise<string>;
54
54
  }
55
- interface IExcelMapping {
56
- [elementIndex: number]: {
57
- sheet: number;
58
- line: number;
59
- };
60
- }
61
55
  export interface IImportDomainDeps {
62
56
  'core.domain.library': ILibraryDomain;
63
57
  'core.domain.record': IRecordDomain;
@@ -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 IConfig } from '_types/config';
8
7
  export interface IAttributeDependentValuesPermissionDomain {
9
8
  getAttributeDependentValuesPermission(params: {
10
9
  action: AttributeDependentValuesPermissionsActions;
@@ -41,6 +40,5 @@ export interface IRecordAttributePermissionDomainDeps {
41
40
  'core.domain.attribute': IAttributeDomain;
42
41
  'core.domain.tree.helpers.elementAncestors': IElementAncestorsHelper;
43
42
  'core.infra.value': IValueRepo;
44
- config: IConfig;
45
43
  }
46
44
  export default function (deps: IRecordAttributePermissionDomainDeps): IAttributeDependentValuesPermissionDomain;
@@ -8,6 +8,7 @@ import { type IEstimateTreeValueRecordPermissionParams, type IGetInheritedRecord
8
8
  import { type ITreeRepo } from '../../infra/tree/treeRepo';
9
9
  import { type IRecordRepo } from '../../infra/record/recordRepo';
10
10
  import { type IRecordInCreationBypassHelper } from './helpers/recordInCreationBypass';
11
+ import { type IUtils } from 'utils/utils';
11
12
  export interface IRecordPermissionDomain {
12
13
  getRecordPermission(params: IGetRecordPermissionParams): Promise<boolean>;
13
14
  getInheritedRecordPermission(params: IGetInheritedRecordPermissionParams): Promise<boolean>;
@@ -23,5 +24,6 @@ export interface IRecordPermissionDomainDeps {
23
24
  'core.infra.value': IValueRepo;
24
25
  'core.infra.tree': ITreeRepo;
25
26
  'core.infra.record': IRecordRepo;
27
+ 'core.utils': IUtils;
26
28
  }
27
29
  export default function (deps: IRecordPermissionDomainDeps): IRecordPermissionDomain;
@@ -24,6 +24,7 @@ export interface ICreateRecordParams {
24
24
  }
25
25
  export interface ICreateRecordValueError {
26
26
  attribute: string;
27
+ library?: string;
27
28
  type: ErrorTypes | Errors;
28
29
  message: string;
29
30
  input?: any;
@@ -32,3 +33,9 @@ export interface ICreateRecordResult {
32
33
  record?: IRecord;
33
34
  valuesErrors?: ICreateRecordValueError[];
34
35
  }
36
+ export interface IDuplicateRecordValueError extends ICreateRecordValueError {
37
+ originalId?: string;
38
+ }
39
+ export interface IDuplicateRecordResult extends ICreateRecordResult {
40
+ valuesErrors?: IDuplicateRecordValueError[];
41
+ }
@@ -6,14 +6,18 @@ import { type IRecordRepo } from 'infra/record/recordRepo';
6
6
  import { type ITreeRepo } from 'infra/tree/treeRepo';
7
7
  import { type IValueRepo } from 'infra/value/valueRepo';
8
8
  import { type IRecord } from '../../../_types/record';
9
+ import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
10
+ import { type IAttributeSimpleLinkRepo } from 'infra/attributeTypes/attributeSimpleLinkRepo';
9
11
  export type DeleteRecordHelper = (library: string, id: string, ctx: IQueryInfos) => Promise<IRecord>;
10
12
  interface IDeps {
11
13
  'core.domain.helpers.validate': IValidateHelper;
12
14
  'core.domain.eventsManager': IEventsManagerDomain;
13
15
  'core.domain.permission.record': IRecordPermissionDomain;
16
+ 'core.domain.attribute': IAttributeDomain;
17
+ 'core.infra.attributeTypes.attributeSimpleLink'?: IAttributeSimpleLinkRepo;
14
18
  'core.infra.record': IRecordRepo;
15
19
  'core.infra.tree': ITreeRepo;
16
20
  'core.infra.value': IValueRepo;
17
21
  }
18
- export default function ({ 'core.domain.eventsManager': eventsManager, 'core.domain.helpers.validate': validateHelper, 'core.domain.permission.record': recordPermissionDomain, 'core.infra.record': recordRepo, 'core.infra.tree': treeRepo, 'core.infra.value': valueRepo, }: IDeps): DeleteRecordHelper;
22
+ export default function ({ 'core.domain.eventsManager': eventsManager, 'core.domain.helpers.validate': validateHelper, 'core.domain.permission.record': recordPermissionDomain, 'core.domain.attribute': attributeDomain, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.record': recordRepo, 'core.infra.tree': treeRepo, 'core.infra.value': valueRepo, }: IDeps): DeleteRecordHelper;
19
23
  export {};
@@ -14,7 +14,7 @@ import { type IRecord, type IRecordFilterLight, type IRecordIdentity } from '../
14
14
  import { type IAttributeDomain } from '../attribute/attributeDomain';
15
15
  import { type IRecordPermissionDomain } from '../permission/recordPermissionDomain';
16
16
  import { type SendRecordUpdateEventHelper } from './helpers/sendRecordUpdateEvent';
17
- import { type ICreateRecordResult, type ICreateRecordValueError, type IFindRecordParams } from './_types';
17
+ import { type IDuplicateRecordResult, type ICreateRecordResult, type ICreateRecordValueError, type IFindRecordParams } from './_types';
18
18
  import { type IFormRepo } from 'infra/form/formRepo';
19
19
  import { type DeleteRecordHelper } from './helpers/deleteRecord';
20
20
  import { type CreateRecordHelper } from './helpers/createRecord';
@@ -50,6 +50,7 @@ export interface IRecordDomain {
50
50
  library: string;
51
51
  values?: ISaveValue[];
52
52
  verifyRequiredAttributes?: boolean;
53
+ skipActivate?: boolean;
53
54
  ctx: IQueryInfos;
54
55
  }): Promise<ICreateRecordResult>;
55
56
  /**
@@ -114,7 +115,7 @@ export interface IRecordDomain {
114
115
  recordIds: string[];
115
116
  duplicateRules?: IDuplicateRecordRules;
116
117
  ctx: IQueryInfos;
117
- }): Promise<ICreateRecordResult[]>;
118
+ }): Promise<IDuplicateRecordResult[]>;
118
119
  }
119
120
  export interface IRecordDomainDeps {
120
121
  config: Config.IConfig;
@@ -8,7 +8,6 @@ export interface IDeleteValueParams {
8
8
  recordId: string;
9
9
  attribute: string;
10
10
  value?: IValue;
11
- skipReadonly?: boolean;
12
11
  skipActions?: boolean;
13
12
  ctx: IQueryInfos;
14
13
  }
@@ -0,0 +1,4 @@
1
+ import { type ISaveValue, type IValue } from '_types/value';
2
+ import { type IAttribute } from '../../../_types/attribute';
3
+ declare const _default: (attribute: IAttribute, value: IValue, saveValue: ISaveValue) => boolean;
4
+ export default _default;
@@ -26,5 +26,8 @@ interface ICanSaveRecordValueParams {
26
26
  config: IConfig;
27
27
  };
28
28
  }
29
+ export declare const IMMUTABLE_CORE_SYSTEM_FILES_ATTRIBUTE_IDS: string[];
30
+ export declare const IMMUTABLE_CORE_SYSTEM_COMMON_ATTRIBUTE_IDS: string[];
31
+ export declare const IMMUTABLE_CORE_SYSTEM_ATTRIBUTE_IDS: string[];
29
32
  declare const _default: (params: ICanSaveRecordValueParams) => Promise<ICanSaveRecordValueRes>;
30
33
  export default _default;
@@ -14,7 +14,7 @@ import type * as Config from '_types/config';
14
14
  import { type IRecordFilterLight, type IRecord } from '_types/record';
15
15
  import { type IAttribute } from '../../_types/attribute';
16
16
  import { type IQueryInfos } from '../../_types/queryInfos';
17
- import { type IValueVersion, type ISaveValue, type IValue, type IValuesOptions, type IValuesOccurrences } from '../../_types/value';
17
+ import { type IValueVersion, type ISaveValue, type IValue, type IValuesOptions, type IDistinctValue } from '../../_types/value';
18
18
  import { type IActionsListDomain } from '../actionsList/actionsListDomain';
19
19
  import { type IAttributeDomain } from '../attribute/attributeDomain';
20
20
  import { type IValidateHelper } from '../helpers/validate';
@@ -65,7 +65,6 @@ export interface IValueDomain {
65
65
  recordId: string;
66
66
  attribute: string;
67
67
  value: ISaveValue;
68
- skipReadonly?: boolean;
69
68
  ctx: IQueryInfos;
70
69
  }): Promise<IValue[]>;
71
70
  /**
@@ -81,7 +80,6 @@ export interface IValueDomain {
81
80
  ctx: IQueryInfos;
82
81
  keepEmpty?: boolean;
83
82
  skipPermission?: boolean;
84
- skipReadonly?: boolean;
85
83
  }): Promise<ISaveBatchValueResult>;
86
84
  deleteValue(params: IDeleteValueParams): Promise<IValue[]>;
87
85
  formatValue(params: {
@@ -110,7 +108,7 @@ export interface IValueDomain {
110
108
  options?: IValuesOptions;
111
109
  ctx: IQueryInfos;
112
110
  }): Promise<IValue[]>;
113
- countValuesOccurrences({ libraryId, attributeId, recordFilters, options, ctx, }: {
111
+ listDistinctValues({ libraryId, attributeId, recordFilters, options, ctx, }: {
114
112
  libraryId: string;
115
113
  attributeId: string;
116
114
  recordFilters: IRecordFilterLight[];
@@ -118,7 +116,7 @@ export interface IValueDomain {
118
116
  version?: IValueVersion;
119
117
  };
120
118
  ctx: IQueryInfos;
121
- }): Promise<IValuesOccurrences>;
119
+ }): Promise<IDistinctValue>;
122
120
  }
123
121
  export interface IValueDomainDeps {
124
122
  config: Config.IConfig;
@@ -1,10 +1,11 @@
1
1
  import { type IFilterTypesHelper } from 'infra/record/helpers/filterTypes';
2
- import { AttributeTypes } from '../../_types/attribute';
2
+ import { AttributeTypes, type IAttribute } from '../../_types/attribute';
3
3
  import { type IDbService } from '../db/dbService';
4
4
  import { type IDbUtils } from '../db/dbUtils';
5
5
  import { type IAttributeTypeRepo } from './attributeTypesRepo';
6
6
  import { type GetConditionPart } from './helpers/getConditionPart';
7
7
  import { type IAttributeSimpleRepo } from './attributeSimpleRepo';
8
+ import { type IQueryInfos } from '_types/queryInfos';
8
9
  interface IDeps {
9
10
  'core.infra.db.dbService'?: IDbService;
10
11
  'core.infra.db.dbUtils'?: IDbUtils;
@@ -12,6 +13,8 @@ interface IDeps {
12
13
  'core.infra.attributeTypes.helpers.getConditionPart'?: GetConditionPart;
13
14
  'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
14
15
  }
15
- export type IAttributeSimpleLinkRepo = IAttributeTypeRepo<AttributeTypes.SIMPLE_LINK>;
16
+ export type IAttributeSimpleLinkRepo = IAttributeTypeRepo<AttributeTypes.SIMPLE_LINK> & {
17
+ deleteAllLinkValueTo(library: string, attribute: IAttribute, linkedRecordId: string, ctx: IQueryInfos): Promise<void>;
18
+ };
16
19
  export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.attributeSimple': attributeSimpleRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper, }?: IDeps): IAttributeSimpleLinkRepo;
17
20
  export {};