@aristid/leav-types 1.2.1-ae53abf0 → 1.3.0-7deb6b23

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.
@@ -5,6 +5,7 @@ export declare namespace server {
5
5
  let port: number;
6
6
  let publicUrl: string;
7
7
  let wsUrl: string;
8
+ let basePath: string;
8
9
  let allowIntrospection: boolean;
9
10
  let uploadLimit: string;
10
11
  let supportEmail: string;
@@ -1,5 +1,4 @@
1
1
  export namespace server {
2
- let publicUrl: string;
3
2
  let allowIntrospection: boolean;
4
3
  }
5
4
  export namespace logs {
@@ -45,6 +45,7 @@ export interface IServer {
45
45
  host: string;
46
46
  port: number;
47
47
  publicUrl: string;
48
+ basePath: string;
48
49
  allowIntrospection: boolean;
49
50
  wsUrl: string;
50
51
  uploadLimit: number | string;
@@ -10,8 +10,10 @@ export interface IRecord {
10
10
  modified_at?: number;
11
11
  modified_by?: string;
12
12
  active?: boolean;
13
+ [CORE_IN_CREATION_BY]?: string;
13
14
  [attributeName: string]: any;
14
15
  }
16
+ export declare const CORE_IN_CREATION_BY = "__in_creation_by__";
15
17
  export declare enum Operator {
16
18
  AND = "AND",
17
19
  OR = "OR",
@@ -11,6 +11,7 @@ import { type ValidateRequestTokenFunc } from '../helpers/validateRequestToken';
11
11
  import { type IAuthApp } from '../auth/authApp';
12
12
  import { type IGlobalSettingsDomain } from '../../domain/globalSettings/globalSettingsDomain';
13
13
  import { type IServerRouteAppModule } from 'interface/server';
14
+ import { type IConfig } from '_types/config';
14
15
  export type IApplicationApp = IGraphqlAppModule & IServerRouteAppModule;
15
16
  export interface IApplicationAppDeps {
16
17
  'core.app.graphql': IGraphqlApp;
@@ -25,6 +26,6 @@ export interface IApplicationAppDeps {
25
26
  'core.domain.globalSettings': IGlobalSettingsDomain;
26
27
  'core.utils.logger': winston.Winston;
27
28
  'core.utils': IUtils;
28
- config: any;
29
+ config: IConfig;
29
30
  }
30
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;
@@ -5,3 +5,4 @@ export { default as permissionsByActions } from './permissionsByActions';
5
5
  export { default as reducePermissionsArray } from './reducePermissionsArray';
6
6
  export { default as simplePermission } from './simplePermission';
7
7
  export { default as treeBasedPermissions } from './treeBasedPermissions';
8
+ export { default as recordInCreationByPass } from './recordInCreationBypass';
@@ -0,0 +1,6 @@
1
+ import { type IRecord } from '../../../_types/record';
2
+ import { type IQueryInfos } from '../../../_types/queryInfos';
3
+ export interface IRecordInCreationByPassHelper {
4
+ recordInCreationByPass: (record: IRecord, ctx: IQueryInfos) => boolean;
5
+ }
6
+ export default function (): IRecordInCreationByPassHelper;
@@ -7,6 +7,8 @@ import { type IDefaultPermissionHelper } from './helpers/defaultPermission';
7
7
  import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGroups';
8
8
  import { type ITreeBasedPermissionHelper } from './helpers/treeBasedPermissions';
9
9
  import { type IGetRecordAttributeHeritedPermissionsParams as IGetRecordAttributeInheritedPermissionsParams } from './_types';
10
+ import { type IRecordRepo } from '../../infra/record/recordRepo';
11
+ import { type IRecordInCreationByPassHelper } from './helpers/recordInCreationBypass';
10
12
  export interface IRecordAttributePermissionDomain {
11
13
  getRecordAttributePermission(action: RecordAttributePermissionsActions, userGroupId: string, attributeId: string, recordLibrary: string, recordId: string, ctx: IQueryInfos): Promise<boolean>;
12
14
  getInheritedRecordAttributePermission(params: IGetRecordAttributeInheritedPermissionsParams, ctx: IQueryInfos): Promise<boolean>;
@@ -16,7 +18,9 @@ export interface IRecordAttributePermissionDomainDeps {
16
18
  'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
17
19
  'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
18
20
  'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
21
+ 'core.domain.permission.helpers.recordInCreationByPass': IRecordInCreationByPassHelper;
19
22
  'core.domain.attribute': IAttributeDomain;
20
23
  'core.infra.value': IValueRepo;
24
+ 'core.infra.record': IRecordRepo;
21
25
  }
22
26
  export default function (deps: IRecordAttributePermissionDomainDeps): IRecordAttributePermissionDomain;
@@ -5,8 +5,10 @@ import { type IDefaultPermissionHelper } from './helpers/defaultPermission';
5
5
  import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGroups';
6
6
  import { type ITreeBasedPermissionHelper } from './helpers/treeBasedPermissions';
7
7
  import { type ILibraryPermissionDomain } from './libraryPermissionDomain';
8
- import { type IGetInheritedRecordPermissionParams, type IGetRecordPermissionParams, type IEstimateTreeValueRecordPermissionParams } from './_types';
8
+ import { type IEstimateTreeValueRecordPermissionParams, type IGetInheritedRecordPermissionParams, type IGetRecordPermissionParams } from './_types';
9
9
  import { type ITreeRepo } from '../../infra/tree/treeRepo';
10
+ import { type IRecordRepo } from '../../infra/record/recordRepo';
11
+ import { type IRecordInCreationByPassHelper } from './helpers/recordInCreationBypass';
10
12
  export interface IRecordPermissionDomain {
11
13
  getRecordPermission(params: IGetRecordPermissionParams): Promise<boolean>;
12
14
  getInheritedRecordPermission(params: IGetInheritedRecordPermissionParams): Promise<boolean>;
@@ -17,9 +19,11 @@ export interface IRecordPermissionDomainDeps {
17
19
  'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
18
20
  'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
19
21
  'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
22
+ 'core.domain.permission.helpers.recordInCreationByPass': IRecordInCreationByPassHelper;
20
23
  'core.domain.attribute': IAttributeDomain;
21
24
  'core.domain.helpers.getCoreEntityById': GetCoreEntityByIdFunc;
22
25
  'core.infra.value': IValueRepo;
23
26
  'core.infra.tree': ITreeRepo;
27
+ 'core.infra.record': IRecordRepo;
24
28
  }
25
29
  export default function (deps: IRecordPermissionDomainDeps): IRecordPermissionDomain;
@@ -25,7 +25,6 @@ export interface IRecordRepo {
25
25
  updateRecord({ libraryId, recordData, ctx }: {
26
26
  libraryId: string;
27
27
  recordData: IRecord;
28
- mergeObjects?: boolean;
29
28
  ctx: IQueryInfos;
30
29
  }): Promise<{
31
30
  old: IRecord;
@@ -3,7 +3,7 @@ import { type IAuthApp } from 'app/auth/authApp';
3
3
  import { type ICoreApp } from 'app/core/coreApp';
4
4
  import { type IGraphqlApp } from 'app/graphql/graphqlApp';
5
5
  import { type AwilixContainer } from 'awilix';
6
- import { type Express } from 'express';
6
+ import express from 'express';
7
7
  import { type IUtils } from 'utils/utils';
8
8
  import type * as winston from 'winston';
9
9
  import { type IConfig } from '_types/config';
@@ -18,7 +18,7 @@ export interface IServerRouteAppModule {
18
18
  /**
19
19
  * @param app Express instance, can be used to extend the app
20
20
  */
21
- registerRoute(app: Express): void;
21
+ registerRoute(app: express.Router): void;
22
22
  }
23
23
  interface IDeps {
24
24
  config?: IConfig;
@@ -86,6 +86,7 @@ export interface IUtils {
86
86
  getUnixTime(): number;
87
87
  getFileExtension(filename: string): string | null;
88
88
  getProcessIdentifier(): string;
89
+ getPreviewUrl(relativeUrl: string): string;
89
90
  getPreviewsAttributeName(libraryId: string): string;
90
91
  getPreviewsStatusAttributeName(libraryId: string): string;
91
92
  getPreviewAttributesSettings(library: ILibrary): IPreviewAttributesSettings;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.2.1-ae53abf0",
3
+ "version": "1.3.0-7deb6b23",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",
@@ -14,7 +14,7 @@
14
14
  "license": "LGPL3",
15
15
  "repository": "https://github.com/leav-solutions/leav-engine",
16
16
  "dependencies": {
17
- "@leav/utils": "1.2.1",
17
+ "@leav/utils": "1.3.0",
18
18
  "@types/amqplib": "0.10.7",
19
19
  "@types/express": "5.0.0",
20
20
  "@types/jest": "29.5.14",
@@ -1 +0,0 @@
1
- export declare const getPreviewUrl: () => string;