@aristid/leav-types 1.5.0-d3261f8d → 1.5.0-e0f0cfb7

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.
@@ -8,7 +8,7 @@ import { type ILibraryPermissionDomain } from 'domain/permission/libraryPermissi
8
8
  import { type SendRecordUpdateEventHelper } from 'domain/record/helpers/sendRecordUpdateEvent';
9
9
  import { type ITreeDomain } from 'domain/tree/treeDomain';
10
10
  import { type IValueDomain } from 'domain/value/valueDomain';
11
- import { type FileUpload } from 'graphql-upload';
11
+ import { type FileUpload } from 'graphql-upload/Upload.mjs';
12
12
  import { type i18n } from 'i18next';
13
13
  import { type IRecordRepo } from 'infra/record/recordRepo';
14
14
  import { type IUtils } from 'utils/utils';
@@ -1,4 +1,4 @@
1
- import { type FileUpload } from 'graphql-upload';
1
+ import { type FileUpload } from 'graphql-upload/Upload.mjs';
2
2
  import { type Progress } from 'progress-stream';
3
3
  export type StoreUploadFileFunc = (fileData: FileUpload, path: string, onProgress?: (progress: Progress) => Promise<void>, size?: number) => Promise<void>;
4
4
  export default function (): (fileData: FileUpload, path: string, onProgress?: (progress: Progress) => void, size?: number) => Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import { type IAdminPermissionDomain } from 'domain/permission/adminPermissionDomain';
2
2
  import { type IQueryInfos } from '_types/queryInfos';
3
3
  import { AdminPermissionsActions } from '../../../_types/permissions';
4
- declare const _default: (existingLib: boolean, userId: string, deps: {
4
+ declare const _default: (existingLib: boolean, deps: {
5
5
  adminPermissionDomain: IAdminPermissionDomain;
6
6
  }, ctx: IQueryInfos) => Promise<{
7
7
  canSave: boolean;
@@ -30,7 +30,6 @@ export type PermByActionsRes = {
30
30
  } | null;
31
31
  export interface IGetAdminPermissionParams {
32
32
  action: AdminPermissionsActions;
33
- userId: string;
34
33
  ctx: IQueryInfos;
35
34
  }
36
35
  export interface IGetInheritedAdminPermissionParams {
@@ -41,13 +40,11 @@ export interface IGetInheritedAdminPermissionParams {
41
40
  export interface IGetLibraryPermissionParams {
42
41
  action: LibraryPermissionsActions;
43
42
  libraryId: string;
44
- userId: string;
45
43
  ctx: IQueryInfos;
46
44
  }
47
45
  export interface IGetTreePermissionParams {
48
46
  action: TreePermissionsActions;
49
47
  treeId: string;
50
- userId: string;
51
48
  ctx: IQueryInfos;
52
49
  }
53
50
  export type GetDefaultTreeLibraryPermission = (params: IGetDefaultPermissionParams) => boolean | null;
@@ -55,24 +52,20 @@ export interface IGetTreeLibraryPermissionParams {
55
52
  action: TreeNodePermissionsActions;
56
53
  treeId: string;
57
54
  libraryId: string;
58
- userId: string;
59
55
  getDefaultTreeLibraryPermission?: GetDefaultTreeLibraryPermission;
60
56
  ctx: IQueryInfos;
61
57
  }
62
58
  export interface IGetApplicationPermissionParams {
63
59
  action: ApplicationPermissionsActions;
64
60
  applicationId: string;
65
- userId: string;
66
61
  ctx: IQueryInfos;
67
62
  }
68
63
  export interface IGetDefaultGlobalPermissionParams extends IGetDefaultPermissionParams {
69
64
  applyTo?: string;
70
- userId?: string;
71
65
  }
72
66
  export type GetDefaultGlobalPermission = (params: IGetDefaultGlobalPermissionParams) => Promise<boolean> | boolean;
73
67
  export interface IGetTreeNodePermissionParams {
74
68
  action: TreeNodePermissionsActions;
75
- userId: string;
76
69
  nodeId: string;
77
70
  treeId: string;
78
71
  ctx: IQueryInfos;
@@ -133,7 +126,6 @@ export interface IGetInheritedPermissionsParams {
133
126
  export interface IIsAllowedParams {
134
127
  type: PermissionTypes;
135
128
  action: PermissionsActions;
136
- userId: string;
137
129
  applyTo?: string;
138
130
  target?: IPermissionTarget;
139
131
  ctx: IQueryInfos;
@@ -153,7 +145,6 @@ export interface IGetRecordAttributeHeritedPermissionsParams {
153
145
  export interface IGetTreeBasedPermissionParams {
154
146
  type: PermissionTypes;
155
147
  action: PermissionsActions;
156
- userId: string;
157
148
  applyTo: string;
158
149
  treeValues: {
159
150
  [treeAttributeId: string]: string[];
@@ -171,7 +162,6 @@ export interface IGetInheritedTreeBasedPermissionParams {
171
162
  }
172
163
  export interface IGetRecordPermissionParams {
173
164
  action: RecordPermissionsActions;
174
- userId: string;
175
165
  library: string;
176
166
  recordId: string;
177
167
  ctx: IQueryInfos;
@@ -186,7 +176,6 @@ export interface IGetInheritedRecordPermissionParams {
186
176
  }
187
177
  export interface IEstimateTreeValueRecordPermissionParams {
188
178
  action: RecordPermissionsActions;
189
- userId: string;
190
179
  libraryId: string;
191
180
  attributeId: string;
192
181
  nodeId: string;
@@ -1,7 +1,7 @@
1
1
  import { type IGlobalPermissionHelper } from './helpers/globalPermission';
2
2
  import { type IGetAdminPermissionParams, type IGetInheritedAdminPermissionParams } from './_types';
3
3
  export interface IAdminPermissionDomain {
4
- getAdminPermission({ action, userId, ctx }: IGetAdminPermissionParams): Promise<boolean>;
4
+ getAdminPermission({ action, ctx }: IGetAdminPermissionParams): Promise<boolean>;
5
5
  getInheritedAdminPermission({ action, userGroupId, ctx }: IGetInheritedAdminPermissionParams): Promise<boolean>;
6
6
  }
7
7
  interface IDeps {
@@ -23,7 +23,7 @@ export interface IPermissionDomain {
23
23
  * Retrieve herited permission: ignore permission defined on given element, force retrieval of herited permission
24
24
  */
25
25
  getInheritedPermissions({ type, applyTo, action, userGroupId, permissionTreeTarget, ctx, }: IGetInheritedPermissionsParams): Promise<boolean>;
26
- isAllowed({ type, action, userId, applyTo, target, ctx }: IIsAllowedParams): Promise<boolean>;
26
+ isAllowed({ type, action, applyTo, target, ctx }: IIsAllowedParams): Promise<boolean>;
27
27
  getActionsByType(params: IGetActionsByTypeParams): ILabeledPermissionsAction[];
28
28
  registerActions(type: PermissionTypes, actions: string[], applyOn?: string[]): void;
29
29
  isAdminOrSystemUser(ctx: IQueryInfos): boolean;
@@ -9,7 +9,7 @@ import { type IGetRecordAttributeHeritedPermissionsParams as IGetRecordAttribute
9
9
  import { type IRecordRepo } from '../../infra/record/recordRepo';
10
10
  import { type IRecordInCreationBypassHelper } from './helpers/recordInCreationBypass';
11
11
  export interface IRecordAttributePermissionDomain {
12
- getRecordAttributePermission(action: RecordAttributePermissionsActions, userGroupId: string, attributeId: string, recordLibrary: string, recordId: string, ctx: IQueryInfos): Promise<boolean>;
12
+ getRecordAttributePermission(action: RecordAttributePermissionsActions, attributeId: string, recordLibrary: string, recordId: string, ctx: IQueryInfos): Promise<boolean>;
13
13
  getInheritedRecordAttributePermission(params: IGetRecordAttributeInheritedPermissionsParams, ctx: IQueryInfos): Promise<boolean>;
14
14
  }
15
15
  export interface IRecordAttributePermissionDomainDeps {
@@ -49,5 +49,5 @@ export interface ILoggerConfig {
49
49
  };
50
50
  onErrorLog?: (message: string, meta: any, getCallStackTrace: () => string) => void;
51
51
  }
52
- export declare function envToBool(value: string, defaultValue?: boolean): boolean;
53
- export declare const defaultLoggerConfig: ILoggerConfig & Required<Omit<ILoggerConfig, 'onErrorLog'>>;
52
+ export declare function envToBool(value?: string, defaultValue?: boolean): boolean;
53
+ export declare const defaultLoggerConfig: ILoggerConfig & Required<Omit<ILoggerConfig, 'onErrorLog' | 'destinationFile'>>;
@@ -12,5 +12,5 @@ export interface IPreviewScalar {
12
12
  pdf?: string;
13
13
  file: FileRecord;
14
14
  original: string;
15
- [key: string]: string | FileRecord;
15
+ [key: string]: string | FileRecord | undefined;
16
16
  }
@@ -29,10 +29,8 @@ export declare const objectToNameValueArray: <T>(obj: IKeyValue<T>) => Array<{
29
29
  name: string;
30
30
  value: T;
31
31
  }>;
32
- export declare const nameValArrayToObj: (arr?: Array<{}>, keyFieldName?: string, valueFieldName?: string) => {
33
- [key: string]: any;
34
- };
35
- export declare const getFileType: (fileName: string) => FileType;
32
+ export declare const nameValArrayToObj: (arr?: Array<Record<string, any>>, keyFieldName?: string, valueFieldName?: string) => Record<string, any> | null;
33
+ export declare const getFileType: (fileName: string) => FileType | null;
36
34
  /**
37
35
  * Return a simplified call stack (for the function who called this function, not this one, obviously)
38
36
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.5.0-d3261f8d",
3
+ "version": "1.5.0-e0f0cfb7",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",