@aristid/leav-types 1.4.1-44274b8d → 1.4.1-514c3bba

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.
@@ -77,6 +77,12 @@ export declare namespace mailer {
77
77
  }
78
78
  export { auth_1 as auth };
79
79
  }
80
+ export declare namespace actions {
81
+ namespace excel {
82
+ let useNewHyperformula: boolean;
83
+ let debug: boolean;
84
+ }
85
+ }
80
86
  export declare namespace bugsnag {
81
87
  let enable_1: boolean;
82
88
  export { enable_1 as enable };
@@ -93,7 +99,7 @@ export declare namespace matomo {
93
99
  export let siteId: string;
94
100
  }
95
101
  export declare namespace lang {
96
- export let available: string | string[];
102
+ export let available: string[];
97
103
  let _default: string;
98
104
  export { _default as default };
99
105
  }
@@ -169,8 +175,7 @@ export declare namespace eventsManager {
169
175
  }
170
176
  export { routingKeys_2 as routingKeys };
171
177
  export namespace queues_2 {
172
- let pubsub_events_1: string;
173
- export { pubsub_events_1 as pubsub_events };
178
+ let pubsub_events_prefix: string;
174
179
  }
175
180
  export { queues_2 as queues };
176
181
  }
@@ -181,7 +186,7 @@ export declare namespace indexationManager {
181
186
  }
182
187
  export { queues_3 as queues };
183
188
  }
184
- export declare let debug: boolean;
189
+ declare let debug_1: boolean;
185
190
  export declare let defaultUserId: string;
186
191
  export declare namespace _export {
187
192
  let directory_1: string;
@@ -236,5 +241,5 @@ export declare namespace elasticsearch {
236
241
  export declare namespace logsCollector {
237
242
  let queue: string;
238
243
  }
239
- export declare let pluginsPath: string | any[];
240
- export { _export as export, _import as import };
244
+ export declare let pluginsPath: string[];
245
+ export { debug_1 as debug, _export as export, _import as import };
@@ -14,3 +14,10 @@ export namespace dbProfiler {
14
14
  export namespace bugsnag {
15
15
  let releaseStage: string;
16
16
  }
17
+ export namespace actions {
18
+ namespace excel {
19
+ export let useNewHyperformula: boolean;
20
+ let debug_1: boolean;
21
+ export { debug_1 as debug };
22
+ }
23
+ }
@@ -31,8 +31,7 @@ export namespace eventsManager {
31
31
  let pubsub_events: string;
32
32
  }
33
33
  export namespace queues_1 {
34
- let pubsub_events_1: string;
35
- export { pubsub_events_1 as pubsub_events };
34
+ let pubsub_events_prefix: string;
36
35
  }
37
36
  export { queues_1 as queues };
38
37
  }
@@ -1,11 +1,24 @@
1
1
  import WebSocket from 'ws';
2
2
  import { type Client as GraphqlWsClient } from 'graphql-ws';
3
+ import { type AxiosResponse } from 'axios';
3
4
  import type FormData from 'form-data';
4
5
  import { type ActionsListConfig } from '_types/actionsList';
5
6
  import { type ITreeElement } from '_types/tree';
6
7
  import { AttributeFormats, type AttributeTypes, type IAttributeVersionsConf, type IEmbeddedAttribute } from '../../../_types/attribute';
8
+ interface IE2EUser {
9
+ getAuthToken: () => Promise<string>;
10
+ }
11
+ export declare const e2eAdminUser: () => IE2EUser;
12
+ export declare const e2eGuestUser: () => Promise<IE2EUser>;
7
13
  export declare function getGraphQLUrl(): Promise<string>;
8
- export declare function makeGraphQlCall(query: string | FormData, throwOnErrors?: boolean): Promise<any>;
14
+ export declare class E2EGraphQLError extends Error {
15
+ readonly response: AxiosResponse;
16
+ constructor(message: string, response: AxiosResponse);
17
+ }
18
+ export interface IMakeGraphQlCallOptions {
19
+ user?: IE2EUser;
20
+ }
21
+ export declare function makeGraphQlCall(query: string | FormData, options?: IMakeGraphQlCallOptions): Promise<any>;
9
22
  export declare function gqlSaveLibrary(id: string, label: string, additionalAttributes?: string[]): Promise<any>;
10
23
  export declare function gqlSaveApplication(id: string, label: string, endpoint: string): Promise<any>;
11
24
  export declare function gqlSaveAttribute(params: {
@@ -43,10 +56,13 @@ export declare function gqlSaveVersionProfile(profileId: string, label: string,
43
56
  * Convert object to JSON, escaping quotes to be able to use it in a graphql query
44
57
  **/
45
58
  export declare function toCleanJSON(obj: {}): string;
46
- export declare function makeWebSocketGraphQlCall(): Promise<GraphqlWsClient>;
59
+ export declare function makeWebSocketGraphQlCall(options?: {
60
+ user: IE2EUser;
61
+ }): Promise<GraphqlWsClient>;
47
62
  export declare function waitGraphqlWebSocketMessage<T>(client: GraphqlWsClient, query: string, variables: Record<string, any>, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
48
63
  timeoutMs: any;
49
64
  }): Promise<T>;
50
65
  export declare function waitWebSocketMessage<T>(webSocket: WebSocket, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
51
66
  timeoutMs: any;
52
67
  }): Promise<T>;
68
+ export {};
@@ -25,6 +25,7 @@ export interface IConfig {
25
25
  plugins: IKeyValue<IKeyValue<any>>;
26
26
  preview: IPreview;
27
27
  applications: IApplicationsConfig;
28
+ actions: IActions;
28
29
  files: IFilesConfig;
29
30
  dbProfiler: IDbProfilerConfig;
30
31
  instanceId: string;
@@ -62,6 +63,19 @@ export interface IServer {
62
63
  email: string;
63
64
  };
64
65
  }
66
+ export interface IActions {
67
+ excel: {
68
+ /**
69
+ * Replace deprecated hot-formula-parser npm module by new hyperformula npm module
70
+ * Formulas should be compatible
71
+ */
72
+ useNewHyperformula: boolean;
73
+ /**
74
+ * Add debug log for each calculation with formula and result or error
75
+ */
76
+ debug: boolean;
77
+ };
78
+ }
65
79
  export interface IDb {
66
80
  url: string;
67
81
  name: string;
@@ -158,7 +172,7 @@ export interface IEventsManager {
158
172
  pubsub_events: string;
159
173
  };
160
174
  queues: {
161
- pubsub_events: string;
175
+ pubsub_events_prefix: string;
162
176
  };
163
177
  }
164
178
  export interface IIndexationManager {
@@ -1,6 +1,7 @@
1
1
  export declare enum ErrorTypes {
2
2
  VALIDATION_ERROR = "VALIDATION_ERROR",
3
3
  PERMISSION_ERROR = "PERMISSION_ERROR",
4
+ CUSTOM_CONFIG_ERROR = "CUSTOM_CONFIG_ERROR",
4
5
  INTERNAL_ERROR = "INTERNAL_ERROR"
5
6
  }
6
7
  export declare enum Errors {
@@ -1,11 +1,13 @@
1
+ import { type ILogger } from '@leav/logger';
1
2
  import { type ICalculationVariable } from 'domain/helpers/calculationVariable';
2
- import { type IUtils } from 'utils/utils';
3
3
  import { type IActionsListFunction } from '../../_types/actionsList';
4
+ import { type IConfig } from '_types/config';
4
5
  interface IDeps {
5
- 'core.domain.helpers.calculationVariable'?: ICalculationVariable;
6
- 'core.utils'?: IUtils;
6
+ 'core.domain.helpers.calculationVariable': ICalculationVariable;
7
+ config: IConfig;
8
+ 'core.utils.logger': ILogger;
7
9
  }
8
- export default function ({ 'core.domain.helpers.calculationVariable': calculationVariable }?: IDeps): IActionsListFunction<{
10
+ export default function ({ 'core.domain.helpers.calculationVariable': calculationVariable, 'core.utils.logger': logger, config }: IDeps): IActionsListFunction<{
9
11
  Formula: true;
10
12
  Description: true;
11
13
  }>;
@@ -12,8 +12,10 @@ import { type IRecordFilterLight } from '../../_types/record';
12
12
  import { type ITaskFuncParams } from '../../_types/tasksManager';
13
13
  import { type IValidateHelper } from '../helpers/validate';
14
14
  import { type INotificationDomain } from 'domain/notification/notificationDomain';
15
+ import { type IExportProfileDomain } from './exportProfileDomain';
15
16
  export interface IExportParams {
16
17
  library: string;
18
+ profile: string;
17
19
  attributes: string[];
18
20
  filters?: IRecordFilterLight[];
19
21
  ctx: IQueryInfos;
@@ -41,8 +43,9 @@ export interface IExportDomainDeps {
41
43
  'core.domain.helpers.updateTaskProgress': UpdateTaskProgress;
42
44
  'core.domain.eventsManager': IEventsManagerDomain;
43
45
  'core.domain.notification': INotificationDomain;
46
+ 'core.domain.export.exportProfile': IExportProfileDomain;
44
47
  'core.utils': IUtils;
45
48
  translator: i18n;
46
49
  config: Config.IConfig;
47
50
  }
48
- export default function ({ config, 'core.domain.record': recordDomain, 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.library': libraryDomain, 'core.domain.tasksManager': tasksManager, 'core.domain.helpers.updateTaskProgress': updateTaskProgress, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.notification': notificationDomain, 'core.utils': utils, translator }: IExportDomainDeps): IExportDomain;
51
+ export default function ({ config, 'core.domain.record': recordDomain, 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.library': libraryDomain, 'core.domain.tasksManager': tasksManager, 'core.domain.helpers.updateTaskProgress': updateTaskProgress, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.notification': notificationDomain, 'core.domain.export.exportProfile': exportProfileDomain, 'core.utils': utils, translator }: IExportDomainDeps): IExportDomain;
@@ -0,0 +1,23 @@
1
+ import { type ILibraryDomain } from '../library/libraryDomain';
2
+ import { type IQueryInfos } from '../../_types/queryInfos';
3
+ export interface IExportProfileConfig {
4
+ profileSelected: string;
5
+ profiles: Array<{
6
+ label: string;
7
+ columns: Array<{
8
+ columnLabel: string;
9
+ attribute: string;
10
+ }>;
11
+ }>;
12
+ }
13
+ export interface IExportColumn {
14
+ columnLabel: string;
15
+ attribute: string;
16
+ }
17
+ export interface IExportProfileDomain {
18
+ getColumnsFromProfileConfig(profile: string, library: string, ctx: IQueryInfos): Promise<IExportColumn[]>;
19
+ }
20
+ export interface IExportProfileDomainDeps {
21
+ 'core.domain.library': ILibraryDomain;
22
+ }
23
+ export default function ({ 'core.domain.library': libraryDomain }: IExportProfileDomainDeps): IExportProfileDomain;
@@ -1 +1,2 @@
1
1
  export { default } from './exportDomain';
2
+ export { default as exportProfile } from './exportProfileDomain';
@@ -0,0 +1,4 @@
1
+ import LeavError from './LeavError';
2
+ export default class CustomConfigError<T> extends LeavError<T> {
3
+ constructor(message?: string);
4
+ }
@@ -6,3 +6,7 @@ export declare function envToBool(value: string, defaultValue?: boolean): boolea
6
6
  * To convert process.env string to number
7
7
  */
8
8
  export declare function envToNumber(value: string, defaultValue?: number): number;
9
+ /**
10
+ * To convert process.env string to string array
11
+ */
12
+ export declare function envToStringArray(value: string, separator?: string, defaultValue?: string[]): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.4.1-44274b8d",
3
+ "version": "1.4.1-514c3bba",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",