@aristid/leav-types 0.0.7-ffaf19e → 1.0.0-e073ed8e

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 (99) hide show
  1. package/apps/core/config/default.d.ts +12 -0
  2. package/apps/core/config/development.d.ts +1 -0
  3. package/apps/core/config/test.d.ts +1 -0
  4. package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +1 -0
  5. package/apps/core/src/__tests__/e2e/api/getConditionPart/getConditionPart.test.d.ts +1 -0
  6. package/apps/core/src/__tests__/e2e/api/globalSetup.d.ts +6 -1
  7. package/apps/core/src/__tests__/e2e/api/joinLibraries/joinLibraries.test.d.ts +1 -0
  8. package/apps/core/src/__tests__/integration/globalSetup.d.ts +1 -0
  9. package/apps/core/src/__tests__/integration/globalSetupHook.d.ts +1 -0
  10. package/apps/core/src/__tests__/integration/infra/attributeAdvancedLinkRepo.test.d.ts +1 -0
  11. package/apps/core/src/__tests__/integration/infra/attributeAdvancedRepo.test.d.ts +1 -0
  12. package/apps/core/src/__tests__/integration/infra/attributeSimpleLinkRepo.test.d.ts +1 -0
  13. package/apps/core/src/__tests__/integration/infra/attributeSimpleRepo.test.d.ts +1 -0
  14. package/apps/core/src/__tests__/integration/infra/attributeTreeRepo.test.d.ts +1 -0
  15. package/apps/core/src/__tests__/integration/infra/integrationTestRepoUtils.d.ts +7 -0
  16. package/apps/core/src/__tests__/integration/infra/recordRepo.test.d.ts +1 -0
  17. package/apps/core/src/__tests__/integration/infra/treeRepo.test.d.ts +1 -0
  18. package/apps/core/src/__tests__/integration/teardown.d.ts +1 -0
  19. package/apps/core/src/__tests__/mockers/amqp.d.ts +1 -1
  20. package/apps/core/src/__tests__/mockers/logger.d.ts +4 -4
  21. package/apps/core/src/_types/config.d.ts +34 -1
  22. package/apps/core/src/_types/dbProfiler.d.ts +20 -1
  23. package/apps/core/src/_types/errors.d.ts +1 -0
  24. package/apps/core/src/_types/events.d.ts +45 -0
  25. package/apps/core/src/_types/forms.d.ts +4 -0
  26. package/apps/core/src/_types/library.d.ts +7 -0
  27. package/apps/core/src/_types/permissions.d.ts +3 -1
  28. package/apps/core/src/_types/queryInfos.d.ts +5 -0
  29. package/apps/core/src/_types/record.d.ts +4 -4
  30. package/apps/core/src/_types/tree.d.ts +1 -1
  31. package/apps/core/src/_types/value.d.ts +64 -5
  32. package/apps/core/src/_types/views.d.ts +1 -1
  33. package/apps/core/src/app/application/applicationApp.d.ts +3 -7
  34. package/apps/core/src/app/auth/authApp.d.ts +4 -5
  35. package/apps/core/src/app/core/actionListApp.d.ts +2 -4
  36. package/apps/core/src/app/core/apiKeyApp/apiKeyApp.d.ts +2 -4
  37. package/apps/core/src/app/core/attributeApp/attributeApp.d.ts +2 -5
  38. package/apps/core/src/app/core/coreApp.d.ts +2 -4
  39. package/apps/core/src/app/core/exportApp.d.ts +2 -4
  40. package/apps/core/src/app/core/filesManagerApp.d.ts +3 -5
  41. package/apps/core/src/app/core/formApp/formApp.d.ts +6 -5
  42. package/apps/core/src/app/core/globalSettingsApp.d.ts +3 -6
  43. package/apps/core/src/app/core/importApp.d.ts +2 -4
  44. package/apps/core/src/app/core/libraryApp/libraryApp.d.ts +2 -5
  45. package/apps/core/src/app/core/logApp.d.ts +2 -4
  46. package/apps/core/src/app/core/permissionApp/permissionApp.d.ts +2 -4
  47. package/apps/core/src/app/core/pluginsApp.d.ts +2 -3
  48. package/apps/core/src/app/core/recordApp/recordApp.d.ts +2 -5
  49. package/apps/core/src/app/core/tasksManagerApp.d.ts +2 -3
  50. package/apps/core/src/app/core/treeApp/treeApp.d.ts +5 -6
  51. package/apps/core/src/app/core/userDataApp.d.ts +2 -4
  52. package/apps/core/src/app/core/valueApp.d.ts +2 -4
  53. package/apps/core/src/app/core/versionProfileApp/versionProfileApp.d.ts +2 -4
  54. package/apps/core/src/app/core/viewApp.d.ts +2 -4
  55. package/apps/core/src/app/endpoint/endpointApp.d.ts +3 -8
  56. package/apps/core/src/app/graphql/graphqlApp.d.ts +8 -0
  57. package/apps/core/src/domain/attribute/helpers/ifLibraryJoinLinkAttribute.d.ts +11 -0
  58. package/apps/core/src/domain/attribute/helpers/ifLibraryJoinLinkAttribute.spec.d.ts +1 -0
  59. package/apps/core/src/domain/attribute/helpers/index.d.ts +1 -0
  60. package/apps/core/src/domain/eventsManager/eventsManagerDomain.d.ts +3 -2
  61. package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/handleMoveEvent.d.ts +1 -1
  62. package/apps/core/src/domain/import/importDomain.d.ts +12 -2
  63. package/apps/core/src/domain/indexationManager/indexationManagerDomain.d.ts +4 -2
  64. package/apps/core/src/domain/log/logDomain.d.ts +3 -1
  65. package/apps/core/src/domain/permission/_types.d.ts +10 -2
  66. package/apps/core/src/domain/permission/helpers/globalPermission.d.ts +3 -12
  67. package/apps/core/src/domain/permission/helpers/permissionByUserGroups.d.ts +7 -7
  68. package/apps/core/src/domain/permission/helpers/treeBasedPermissions.d.ts +0 -4
  69. package/apps/core/src/domain/permission/permissionDomain.d.ts +1 -0
  70. package/apps/core/src/domain/permission/recordPermissionDomain.d.ts +4 -1
  71. package/apps/core/src/domain/permission/treeNodePermissionDomain.d.ts +2 -2
  72. package/apps/core/src/domain/record/_types.d.ts +1 -0
  73. package/apps/core/src/domain/record/helpers/createRecord.d.ts +22 -0
  74. package/apps/core/src/domain/record/helpers/deleteRecord.d.ts +19 -0
  75. package/apps/core/src/domain/record/helpers/getAccessPermissionFilters.d.ts +1 -1
  76. package/apps/core/src/domain/record/helpers/index.d.ts +2 -0
  77. package/apps/core/src/domain/record/recordDomain.d.ts +31 -4
  78. package/apps/core/src/domain/tree/treeDomain.d.ts +2 -2
  79. package/apps/core/src/domain/value/helpers/prepareValue.d.ts +3 -3
  80. package/apps/core/src/domain/value/helpers/saveOneValue.d.ts +2 -2
  81. package/apps/core/src/domain/value/helpers/validateValue.d.ts +3 -3
  82. package/apps/core/src/domain/value/valueDomain.d.ts +10 -4
  83. package/apps/core/src/infra/attributeTypes/attributeAdvancedLinkRepo.d.ts +5 -2
  84. package/apps/core/src/infra/attributeTypes/attributeAdvancedRepo.d.ts +3 -1
  85. package/apps/core/src/infra/attributeTypes/attributeSimpleLinkRepo.d.ts +5 -2
  86. package/apps/core/src/infra/attributeTypes/attributeSimpleRepo.d.ts +3 -1
  87. package/apps/core/src/infra/attributeTypes/attributeTreeRepo.d.ts +3 -1
  88. package/apps/core/src/infra/attributeTypes/attributeTypesRepo.d.ts +52 -22
  89. package/apps/core/src/infra/db/migrations/011-moveSkeletonApptoAppStudio.d.ts +7 -0
  90. package/apps/core/src/infra/record/helpers/getSearchVariableName.d.ts +1 -1
  91. package/apps/core/src/infra/record/recordRepo.d.ts +9 -0
  92. package/apps/core/src/infra/tree/treeRepo.d.ts +3 -2
  93. package/apps/core/src/infra/value/valueRepo.d.ts +10 -8
  94. package/apps/core/src/interface/server.d.ts +7 -0
  95. package/apps/core/src/utils/dataloader.d.ts +9 -0
  96. package/apps/core/src/utils/dataloader.spec.d.ts +1 -0
  97. package/apps/core/src/utils/helpers/getSystemQueryContext.d.ts +8 -0
  98. package/apps/core/src/utils/index.d.ts +1 -0
  99. package/package.json +6 -3
@@ -1,8 +1,9 @@
1
1
  import { IDbService } from 'infra/db/dbService';
2
+ import { IConfig } from '_types/config';
2
3
  import { IAttribute } from '_types/attribute';
3
4
  import { IQueryInfos } from '_types/queryInfos';
4
- import { IValue, IValuesOptions } from '_types/value';
5
- import { IAttributeTypesRepo, IAttributeWithRevLink } from '../attributeTypes/attributeTypesRepo';
5
+ import { ISaveValue, IValue } from '_types/value';
6
+ import { IAttributeTypesRepo, IAttributeWithRevLink, IGetValuesOptions } from '../attributeTypes/attributeTypesRepo';
6
7
  export declare const VALUES_LINKS_COLLECTION = "core_edge_values_links";
7
8
  export declare const VALUES_COLLECTION = "core_values";
8
9
  export declare const EMPTY_VALUE = "__empty_value__";
@@ -11,7 +12,7 @@ export interface IValueRepo {
11
12
  library: string;
12
13
  recordId: string;
13
14
  attribute: IAttributeWithRevLink;
14
- value: IValue;
15
+ value: ISaveValue;
15
16
  ctx: IQueryInfos;
16
17
  }): Promise<IValue>;
17
18
  /**
@@ -21,7 +22,7 @@ export interface IValueRepo {
21
22
  library: string;
22
23
  recordId: string;
23
24
  attribute: IAttributeWithRevLink;
24
- value: IValue;
25
+ value: ISaveValue;
25
26
  ctx: IQueryInfos;
26
27
  }): Promise<IValue>;
27
28
  /**
@@ -55,7 +56,7 @@ export interface IValueRepo {
55
56
  recordId: string;
56
57
  attribute: IAttributeWithRevLink;
57
58
  forceGetAllValues?: boolean;
58
- options?: IValuesOptions;
59
+ options?: IGetValuesOptions;
59
60
  ctx: IQueryInfos;
60
61
  }): Promise<IValue[]>;
61
62
  /**
@@ -81,8 +82,9 @@ export interface IValueRepo {
81
82
  }): Promise<void>;
82
83
  }
83
84
  interface IDeps {
84
- 'core.infra.attributeTypes'?: IAttributeTypesRepo;
85
- 'core.infra.db.dbService'?: IDbService;
85
+ config?: IConfig;
86
+ 'core.infra.attributeTypes': IAttributeTypesRepo;
87
+ 'core.infra.db.dbService': IDbService;
86
88
  }
87
- export default function ({ 'core.infra.attributeTypes': attributeTypesRepo, 'core.infra.db.dbService': dbService }?: IDeps): IValueRepo;
89
+ export default function ({ config, 'core.infra.attributeTypes': attributeTypesRepo, 'core.infra.db.dbService': dbService }: IDeps): IValueRepo;
88
90
  export {};
@@ -3,6 +3,7 @@ import { IAuthApp } from 'app/auth/authApp';
3
3
  import { ICoreApp } from 'app/core/coreApp';
4
4
  import { IGraphqlApp } from 'app/graphql/graphqlApp';
5
5
  import { AwilixContainer } from 'awilix';
6
+ import { Express } from 'express';
6
7
  import { IUtils } from 'utils/utils';
7
8
  import * as winston from 'winston';
8
9
  import { IConfig } from '_types/config';
@@ -13,6 +14,12 @@ export interface IServer {
13
14
  init(): Promise<void>;
14
15
  initConsumers(): Promise<void>;
15
16
  }
17
+ export interface IServerRouteAppModule {
18
+ /**
19
+ * @param app Express instance, can be used to extend the app
20
+ */
21
+ registerRoute(app: Express): void;
22
+ }
16
23
  interface IDeps {
17
24
  config?: IConfig;
18
25
  'core.interface.helpers.handleGraphqlError'?: HandleGraphqlErrorFunc;
@@ -0,0 +1,9 @@
1
+ import DataLoader from 'dataloader';
2
+ import { IQueryInfos } from '_types/queryInfos';
3
+ export declare const dataloaderCtxKey: keyof IQueryInfos;
4
+ /**
5
+ * Get or create a DataLoader in the request context.
6
+ * Each usage (not each call) of this function should use a unique name to avoid conflicts among different DataLoaders.
7
+ * Name is used has key to store the DataLoader in ctx.dataLoaders.
8
+ */
9
+ export declare function getOrCreateDataLoaderInCtx<DL extends DataLoader<unknown, unknown>>(ctx: IQueryInfos, name: string, create: () => DL): DL;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { IConfig } from '_types/config';
2
+ import { IQueryInfos } from '_types/queryInfos';
3
+ interface IDeps {
4
+ config?: IConfig;
5
+ }
6
+ export type GetSystemQueryContext = () => IQueryInfos;
7
+ export default function ({ config }: IDeps): GetSystemQueryContext;
8
+ export {};
@@ -1,3 +1,4 @@
1
1
  export { default as logger } from './logger/logger';
2
2
  export { default } from './utils';
3
+ export { default as getSystemQueryContext } from './helpers/getSystemQueryContext';
3
4
  export { TypeGuards } from './typeGuards';
package/package.json CHANGED
@@ -1,17 +1,20 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "0.0.7-ffaf19e",
3
+ "version": "1.0.0-e073ed8e",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",
7
7
  "test:ci": "",
8
8
  "test:commit": "",
9
- "publish-types": "npm publish --access public"
9
+ "publish-types": "npm publish --access public",
10
+ "generate": "yarn workspace core build-types && mv ../../apps/core/dist-types/* . && rmdir ../../apps/core/dist-types",
11
+ "get-version": "jq -r '.version' package.json",
12
+ "set-version": "jq --arg v $1 '.version = $v' package.json > package.tmp.json && mv package.tmp.json package.json"
10
13
  },
11
14
  "license": "LGPL3",
12
15
  "repository": "https://github.com/leav-solutions/leav-engine",
13
16
  "dependencies": {
14
- "@leav/utils": "0.0.3",
17
+ "@leav/utils": "workspace:libs/utils",
15
18
  "@types/amqplib": "^0",
16
19
  "@types/express": "5.0.0",
17
20
  "@types/jest": "29.5.14",