@aristid/leav-types 0.0.7-128bb5a → 0.0.7-12f71e9

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.
@@ -3,6 +3,7 @@ import { IDbEdge } from 'infra/db/_types';
3
3
  import { IRecord } from './record';
4
4
  import { ITreeNode, TreePaths } from './tree';
5
5
  import { EMPTY_VALUE } from 'infra/value/valueRepo';
6
+ import { AttributeTypes } from './attribute';
6
7
  export type IValueFromGql = Override<Omit<IValue, 'version'>, {
7
8
  value: IValue['payload'];
8
9
  metadata: Array<{
@@ -30,8 +31,12 @@ export interface IValueMetadata {
30
31
  [fieldName: string]: IStandardValue | AnyPrimitive;
31
32
  }
32
33
  export type EmptyValue = typeof EMPTY_VALUE;
33
- export interface IGenericValue {
34
- id_value?: string;
34
+ interface ICommonGenericSaveValue {
35
+ /**
36
+ * The id of the edge for advanced, advanced link or tree values
37
+ * In case of advanced reverse link from simple link, this is the id of the linked record
38
+ */
39
+ id_value?: string | null;
35
40
  attribute?: string;
36
41
  created_at?: number;
37
42
  modified_at?: number;
@@ -39,21 +44,60 @@ export interface IGenericValue {
39
44
  modified_by?: string;
40
45
  version?: IValueVersion;
41
46
  metadata?: IValueMetadata;
47
+ }
48
+ export interface IGenericValue extends ICommonGenericSaveValue {
42
49
  isInherited?: boolean;
43
50
  isCalculated?: boolean;
44
51
  }
45
52
  export interface IStandardValue extends IGenericValue {
53
+ /**
54
+ * Computed value after get actions on attribute are done
55
+ * TODO remove that any when possible
56
+ * TODO remove optional when possible
57
+ */
46
58
  payload?: any | EmptyValue;
47
- raw_payload?: any | EmptyValue;
59
+ /**
60
+ * Raw value from the database, before any computation
61
+ * TODO, remove that any when possible
62
+ */
63
+ raw_payload?: any;
48
64
  }
49
65
  export interface ILinkValue extends IGenericValue {
66
+ /**
67
+ * Linked record
68
+ * TODO remove optional when possible
69
+ */
50
70
  payload?: IRecord;
51
71
  }
52
72
  export interface ITreeValue extends IGenericValue {
73
+ /**
74
+ * Linked tree node
75
+ * TODO remove optional when possible
76
+ */
53
77
  payload?: ITreeNode;
54
78
  treeId: string;
55
79
  }
56
80
  export type IValue = IStandardValue | ILinkValue | ITreeValue;
81
+ type IGenericSaveValue = ICommonGenericSaveValue;
82
+ export interface ISaveStandardValue extends IGenericSaveValue {
83
+ /**
84
+ * Any base type value to save
85
+ */
86
+ payload: number | string | boolean | EmptyValue | null;
87
+ }
88
+ export interface ISaveLinkValue extends IGenericSaveValue {
89
+ /**
90
+ * Record id to link
91
+ */
92
+ payload: string | null;
93
+ }
94
+ export interface ISaveTreeValue extends IGenericSaveValue {
95
+ /**
96
+ * Tree node id to link
97
+ */
98
+ payload: string | null;
99
+ }
100
+ export type ISaveValue = ISaveStandardValue | ISaveLinkValue | ISaveTreeValue;
57
101
  export interface IDateRangeValue<T = string | number> {
58
102
  from: T;
59
103
  to: T;
@@ -78,3 +122,18 @@ export interface IValueEdge extends IDbEdge {
78
122
  version?: IDbValueVersion;
79
123
  metadata?: IValueMetadata;
80
124
  }
125
+ export interface IValueByAttributeType {
126
+ [AttributeTypes.SIMPLE]: IStandardValue;
127
+ [AttributeTypes.SIMPLE_LINK]: ILinkValue;
128
+ [AttributeTypes.ADVANCED]: IStandardValue;
129
+ [AttributeTypes.ADVANCED_LINK]: ILinkValue;
130
+ [AttributeTypes.TREE]: ITreeValue;
131
+ }
132
+ export interface ISaveValueByAttributeType {
133
+ [AttributeTypes.SIMPLE]: ISaveStandardValue;
134
+ [AttributeTypes.SIMPLE_LINK]: ISaveLinkValue;
135
+ [AttributeTypes.ADVANCED]: ISaveStandardValue;
136
+ [AttributeTypes.ADVANCED_LINK]: ISaveLinkValue;
137
+ [AttributeTypes.TREE]: ISaveTreeValue;
138
+ }
139
+ export {};
@@ -11,7 +11,7 @@ import { IValueRepo } from 'infra/value/valueRepo';
11
11
  import { IUtils } from 'utils/utils';
12
12
  import * as Config from '_types/config';
13
13
  import { IListWithCursor } from '_types/list';
14
- import { IValue, IValuesOptions } from '_types/value';
14
+ import { ISaveValue, IValue, IValuesOptions } from '_types/value';
15
15
  import { ICachesService } from '../../infra/cache/cacheService';
16
16
  import { IQueryInfos } from '../../_types/queryInfos';
17
17
  import { IRecord, IRecordFilterLight, IRecordIdentity } from '../../_types/record';
@@ -30,7 +30,7 @@ import { IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
30
30
  export interface IRecordDomain {
31
31
  createRecord(params: {
32
32
  library: string;
33
- values?: IValue[];
33
+ values?: ISaveValue[];
34
34
  verifyRequiredAttributes?: boolean;
35
35
  ctx: IQueryInfos;
36
36
  }): Promise<ICreateRecordResult>;
@@ -3,10 +3,10 @@ import { IAttributeDomain } from 'domain/attribute/attributeDomain';
3
3
  import { IUtils } from 'utils/utils';
4
4
  import { IAttribute } from '_types/attribute';
5
5
  import { IQueryInfos } from '_types/queryInfos';
6
- import { IValue } from '_types/value';
6
+ import { ISaveValue } from '_types/value';
7
7
  interface IPrepareValueParams {
8
8
  attributeProps: IAttribute;
9
- value: IValue;
9
+ value: ISaveValue;
10
10
  library: string;
11
11
  recordId: string;
12
12
  infos?: IQueryInfos;
@@ -18,5 +18,5 @@ interface IPrepareValueParams {
18
18
  };
19
19
  ctx: IQueryInfos;
20
20
  }
21
- declare const _default: (params: IPrepareValueParams) => Promise<IValue[]>;
21
+ declare const _default: (params: IPrepareValueParams) => Promise<ISaveValue[]>;
22
22
  export default _default;
@@ -7,7 +7,7 @@ import { ITreeRepo } from 'infra/tree/treeRepo';
7
7
  import { IValueRepo } from 'infra/value/valueRepo';
8
8
  import { IQueryInfos } from '_types/queryInfos';
9
9
  import { IAttribute } from '../../../_types/attribute';
10
- import { IValue } from '../../../_types/value';
10
+ import { ISaveValue, IValue } from '../../../_types/value';
11
11
  interface ISaveOneValueDeps {
12
12
  valueRepo: IValueRepo;
13
13
  recordRepo: IRecordRepo;
@@ -17,5 +17,5 @@ interface ISaveOneValueDeps {
17
17
  attributeDomain: IAttributeDomain;
18
18
  versionProfileDomain: IVersionProfileDomain;
19
19
  }
20
- declare const _default: (library: string, recordId: string, attribute: IAttribute, value: IValue, deps: ISaveOneValueDeps, ctx: IQueryInfos) => Promise<IValue>;
20
+ declare const _default: (library: string, recordId: string, attribute: IAttribute, value: ISaveValue, deps: ISaveOneValueDeps, ctx: IQueryInfos) => Promise<IValue>;
21
21
  export default _default;
@@ -5,10 +5,10 @@ import { IValueRepo } from 'infra/value/valueRepo';
5
5
  import { IAttribute } from '../../../_types/attribute';
6
6
  import { ErrorFieldDetail } from '../../../_types/errors';
7
7
  import { IQueryInfos } from '../../../_types/queryInfos';
8
- import { IValue } from '../../../_types/value';
8
+ import { ISaveValue } from '../../../_types/value';
9
9
  interface IValidateValueParams {
10
10
  attributeProps: IAttribute;
11
- value: IValue;
11
+ value: ISaveValue;
12
12
  library: string;
13
13
  recordId?: string;
14
14
  infos?: IQueryInfos;
@@ -21,5 +21,5 @@ interface IValidateValueParams {
21
21
  };
22
22
  ctx: IQueryInfos;
23
23
  }
24
- declare const _default: (params: IValidateValueParams) => Promise<ErrorFieldDetail<IValue>>;
24
+ declare const _default: (params: IValidateValueParams) => Promise<ErrorFieldDetail<ISaveValue>>;
25
25
  export default _default;
@@ -14,7 +14,7 @@ import * as Config from '_types/config';
14
14
  import { IRecord } from '_types/record';
15
15
  import { IAttribute } from '../../_types/attribute';
16
16
  import { IQueryInfos } from '../../_types/queryInfos';
17
- import { IValue, IValuesOptions } from '../../_types/value';
17
+ import { ISaveValue, IValue, IValuesOptions } from '../../_types/value';
18
18
  import { IActionsListDomain } from '../actionsList/actionsListDomain';
19
19
  import { IAttributeDomain } from '../attribute/attributeDomain';
20
20
  import { IValidateHelper } from '../helpers/validate';
@@ -61,7 +61,7 @@ export interface IValueDomain {
61
61
  library: string;
62
62
  recordId: string;
63
63
  attribute: string;
64
- value: IValue;
64
+ value: ISaveValue;
65
65
  ctx: IQueryInfos;
66
66
  }): Promise<IValue[]>;
67
67
  /**
@@ -73,7 +73,7 @@ export interface IValueDomain {
73
73
  saveValueBatch(params: {
74
74
  library: string;
75
75
  recordId: string;
76
- values: IValue[];
76
+ values: ISaveValue[];
77
77
  ctx: IQueryInfos;
78
78
  keepEmpty?: boolean;
79
79
  skipPermission?: boolean;
@@ -1,16 +1,19 @@
1
1
  import { IFilterTypesHelper } from 'infra/record/helpers/filterTypes';
2
2
  import { IUtils } from 'utils/utils';
3
+ import { AttributeTypes } from '../../_types/attribute';
3
4
  import { IDbService } from '../db/dbService';
4
5
  import { IDbUtils } from '../db/dbUtils';
5
6
  import { IAttributeTypeRepo } from './attributeTypesRepo';
6
7
  import { GetConditionPart } from './helpers/getConditionPart';
8
+ import { IAttributeSimpleLinkRepo } from './attributeSimpleLinkRepo';
9
+ export type IAttributeAdvancedLinkRepo = IAttributeTypeRepo<AttributeTypes.ADVANCED_LINK>;
7
10
  interface IDeps {
8
11
  'core.infra.db.dbService'?: IDbService;
9
12
  'core.infra.db.dbUtils'?: IDbUtils;
10
- 'core.infra.attributeTypes.attributeSimpleLink'?: IAttributeTypeRepo;
13
+ 'core.infra.attributeTypes.attributeSimpleLink'?: IAttributeSimpleLinkRepo;
11
14
  'core.infra.attributeTypes.helpers.getConditionPart'?: GetConditionPart;
12
15
  'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
13
16
  'core.utils'?: IUtils;
14
17
  }
15
- export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils }?: IDeps): IAttributeTypeRepo;
18
+ export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils }?: IDeps): IAttributeAdvancedLinkRepo;
16
19
  export {};
@@ -1,5 +1,6 @@
1
1
  import { IDbUtils } from 'infra/db/dbUtils';
2
2
  import { IFilterTypesHelper } from 'infra/record/helpers/filterTypes';
3
+ import { AttributeTypes } from '../../_types/attribute';
3
4
  import { IDbService } from '../db/dbService';
4
5
  import { IAttributeTypeRepo } from './attributeTypesRepo';
5
6
  import { GetConditionPart } from './helpers/getConditionPart';
@@ -9,4 +10,5 @@ export interface IAttributeAdvancedRepoDeps {
9
10
  'core.infra.attributeTypes.helpers.getConditionPart': GetConditionPart;
10
11
  'core.infra.record.helpers.filterTypes': IFilterTypesHelper;
11
12
  }
12
- export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper }: IAttributeAdvancedRepoDeps): IAttributeTypeRepo;
13
+ export type IAttributeAdvancedRepo = IAttributeTypeRepo<AttributeTypes.ADVANCED>;
14
+ export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper }: IAttributeAdvancedRepoDeps): IAttributeAdvancedRepo;
@@ -1,14 +1,17 @@
1
1
  import { IFilterTypesHelper } from 'infra/record/helpers/filterTypes';
2
+ import { AttributeTypes } from '../../_types/attribute';
2
3
  import { IDbService } from '../db/dbService';
3
4
  import { IDbUtils } from '../db/dbUtils';
4
5
  import { IAttributeTypeRepo } from './attributeTypesRepo';
5
6
  import { GetConditionPart } from './helpers/getConditionPart';
7
+ import { IAttributeSimpleRepo } from './attributeSimpleRepo';
6
8
  interface IDeps {
7
9
  'core.infra.db.dbService'?: IDbService;
8
10
  'core.infra.db.dbUtils'?: IDbUtils;
9
- 'core.infra.attributeTypes.attributeSimple'?: IAttributeTypeRepo;
11
+ 'core.infra.attributeTypes.attributeSimple'?: IAttributeSimpleRepo;
10
12
  'core.infra.attributeTypes.helpers.getConditionPart'?: GetConditionPart;
11
13
  'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
12
14
  }
13
- 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): IAttributeTypeRepo;
15
+ export type IAttributeSimpleLinkRepo = IAttributeTypeRepo<AttributeTypes.SIMPLE_LINK>;
16
+ 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;
14
17
  export {};
@@ -1,4 +1,5 @@
1
1
  import { IFilterTypesHelper } from 'infra/record/helpers/filterTypes';
2
+ import { AttributeTypes } from '../../_types/attribute';
2
3
  import { IDbService } from '../db/dbService';
3
4
  import { IAttributeTypeRepo } from './attributeTypesRepo';
4
5
  import { GetConditionPart } from './helpers/getConditionPart';
@@ -7,5 +8,6 @@ interface IDeps {
7
8
  'core.infra.attributeTypes.helpers.getConditionPart'?: GetConditionPart;
8
9
  'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
9
10
  }
10
- export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper }?: IDeps): IAttributeTypeRepo;
11
+ export type IAttributeSimpleRepo = IAttributeTypeRepo<AttributeTypes.SIMPLE>;
12
+ export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper }?: IDeps): IAttributeSimpleRepo;
11
13
  export {};
@@ -1,5 +1,6 @@
1
1
  import { IFilterTypesHelper } from 'infra/record/helpers/filterTypes';
2
2
  import { IUtils } from 'utils/utils';
3
+ import { AttributeTypes } from '../../_types/attribute';
3
4
  import { IDbService } from '../db/dbService';
4
5
  import { IDbUtils } from '../db/dbUtils';
5
6
  import { IAttributeTypeRepo } from './attributeTypesRepo';
@@ -11,5 +12,6 @@ interface IDeps {
11
12
  'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
12
13
  'core.utils'?: IUtils;
13
14
  }
14
- export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils }?: IDeps): IAttributeTypeRepo;
15
+ export type IAttributeTreeRepo = IAttributeTypeRepo<AttributeTypes.TREE>;
16
+ export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils }?: IDeps): IAttributeTreeRepo;
15
17
  export {};
@@ -1,13 +1,19 @@
1
1
  import { AqlLiteral, GeneratedAqlQuery } from 'arangojs/aql';
2
2
  import { IQueryInfos } from '_types/queryInfos';
3
- import { IAttribute } from '../../_types/attribute';
3
+ import { AttributeTypes, IAttribute } from '../../_types/attribute';
4
4
  import { AttributeCondition, IRecordFilterOption } from '../../_types/record';
5
- import { IValue, IValuesOptions } from '../../_types/value';
6
- export interface IAttributeWithRepo extends IAttributeWithRevLink {
5
+ import { ISaveValueByAttributeType, IValueByAttributeType, IValuesOptions } from '../../_types/value';
6
+ import { IAttributeSimpleRepo } from './attributeSimpleRepo';
7
+ import { IAttributeSimpleLinkRepo } from './attributeSimpleLinkRepo';
8
+ import { IAttributeAdvancedRepo } from './attributeAdvancedRepo';
9
+ import { IAttributeAdvancedLinkRepo } from './attributeAdvancedLinkRepo';
10
+ import { IAttributeTreeRepo } from './attributeTreeRepo';
11
+ export type IAttributeWithRepo = IAttributeWithRevLink & {
7
12
  _repo: IAttributeTypeRepo;
8
- }
13
+ };
14
+ type IAttributeRepoByType<AttributeType extends AttributeTypes | unknown> = AttributeType extends AttributeTypes.SIMPLE ? IAttributeSimpleRepo : AttributeType extends AttributeTypes.SIMPLE_LINK ? IAttributeSimpleLinkRepo : AttributeType extends AttributeTypes.ADVANCED ? IAttributeAdvancedRepo : AttributeType extends AttributeTypes.ADVANCED_LINK ? IAttributeAdvancedLinkRepo : AttributeType extends AttributeTypes.TREE ? IAttributeTreeRepo : IAttributeTypeRepo;
9
15
  export interface IAttributeTypesRepo {
10
- getTypeRepo?(attribute: IAttribute): IAttributeTypeRepo;
16
+ getTypeRepo<AttributeType extends AttributeTypes | unknown>(attribute: IAttribute): IAttributeRepoByType<AttributeType>;
11
17
  }
12
18
  export interface IAttributeWithRevLink extends IAttribute {
13
19
  reverse_link?: IAttribute;
@@ -17,14 +23,14 @@ export type GetConditionPartFunc = (valueIdentifier: string | AqlLiteral) => Gen
17
23
  /**
18
24
  * Define interface used for all attribute type specific files
19
25
  */
20
- export interface IAttributeTypeRepo {
26
+ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = AttributeTypes, Value = IValueByAttributeType[AttributeType]> {
21
27
  createValue({ library, recordId, attribute, value, ctx }: {
22
28
  library: string;
23
29
  recordId: string;
24
30
  attribute: IAttributeWithRevLink;
25
- value: IValue;
31
+ value: ISaveValueByAttributeType[AttributeType];
26
32
  ctx: IQueryInfos;
27
- }): Promise<IValue>;
33
+ }): Promise<Value>;
28
34
  /**
29
35
  * Update an existing value. Field "id" is expected on the value
30
36
  */
@@ -32,9 +38,9 @@ export interface IAttributeTypeRepo {
32
38
  library: string;
33
39
  recordId: string;
34
40
  attribute: IAttributeWithRevLink;
35
- value: IValue;
41
+ value: ISaveValueByAttributeType[AttributeType];
36
42
  ctx: IQueryInfos;
37
- }): Promise<IValue>;
43
+ }): Promise<Value>;
38
44
  /**
39
45
  * Delete an existing value. Field "id" is expected on the value
40
46
  */
@@ -42,9 +48,9 @@ export interface IAttributeTypeRepo {
42
48
  library: string;
43
49
  recordId: string;
44
50
  attribute: IAttributeWithRevLink;
45
- value: IValue;
51
+ value: Value;
46
52
  ctx: IQueryInfos;
47
- }): Promise<IValue>;
53
+ }): Promise<Value>;
48
54
  /**
49
55
  * Check if a value is unique
50
56
  */
@@ -52,7 +58,7 @@ export interface IAttributeTypeRepo {
52
58
  library: string;
53
59
  excludedRecordId?: string;
54
60
  attribute: IAttribute;
55
- value: IValue;
61
+ value: Value;
56
62
  ctx: IQueryInfos;
57
63
  }): Promise<boolean>;
58
64
  /**
@@ -67,7 +73,7 @@ export interface IAttributeTypeRepo {
67
73
  forceGetAllValues?: boolean;
68
74
  options?: IValuesOptions;
69
75
  ctx: IQueryInfos;
70
- }): Promise<IValue[]>;
76
+ }): Promise<Value[]>;
71
77
  /**
72
78
  * Get all reverse values for given attribute / value
73
79
  *
@@ -78,7 +84,7 @@ export interface IAttributeTypeRepo {
78
84
  value: string;
79
85
  forceGetAllValues: boolean;
80
86
  ctx: IQueryInfos;
81
- }): Promise<IValue[]>;
87
+ }): Promise<Value[]>;
82
88
  /**
83
89
  * Return a specific value based on its ID. Field "id" is expect on the value
84
90
  *
@@ -90,7 +96,7 @@ export interface IAttributeTypeRepo {
90
96
  attribute: IAttribute;
91
97
  valueId: string;
92
98
  ctx: IQueryInfos;
93
- }): Promise<IValue>;
99
+ }): Promise<Value>;
94
100
  /**
95
101
  * Return AQL query part to retrieve value for this attribute.
96
102
  * If will be concatenate with other filters and full query
@@ -118,11 +124,11 @@ export declare const ATTRIB_COLLECTION_NAME = "core_attributes";
118
124
  export declare const BASE_QUERY_IDENTIFIER = "r";
119
125
  export declare const isValuesCountCondition: (condition: AttributeCondition) => boolean;
120
126
  interface IDeps {
121
- 'core.infra.attributeTypes.attributeSimple'?: IAttributeTypeRepo;
122
- 'core.infra.attributeTypes.attributeSimpleLink'?: IAttributeTypeRepo;
123
- 'core.infra.attributeTypes.attributeAdvanced'?: IAttributeTypeRepo;
124
- 'core.infra.attributeTypes.attributeAdvancedLink'?: IAttributeTypeRepo;
125
- 'core.infra.attributeTypes.attributeTree'?: IAttributeTypeRepo;
127
+ 'core.infra.attributeTypes.attributeSimple'?: IAttributeSimpleRepo;
128
+ 'core.infra.attributeTypes.attributeSimpleLink'?: IAttributeSimpleLinkRepo;
129
+ 'core.infra.attributeTypes.attributeAdvanced'?: IAttributeAdvancedRepo;
130
+ 'core.infra.attributeTypes.attributeAdvancedLink'?: IAttributeAdvancedLinkRepo;
131
+ 'core.infra.attributeTypes.attributeTree'?: IAttributeTreeRepo;
126
132
  }
127
133
  export default function ({ 'core.infra.attributeTypes.attributeSimple': attributeSimpleRepo, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.attributeTypes.attributeAdvanced': attributeAdvancedRepo, 'core.infra.attributeTypes.attributeAdvancedLink': attributeAdvancedLinkRepo, 'core.infra.attributeTypes.attributeTree': attributeTreeRepo }?: IDeps): IAttributeTypesRepo;
128
134
  export {};
@@ -0,0 +1,7 @@
1
+ import { type IDbService } from '../dbService';
2
+ import { type IMigration } from '../../../_types/migration';
3
+ interface IDeps {
4
+ 'core.infra.db.dbService'?: IDbService;
5
+ }
6
+ export default function ({ 'core.infra.db.dbService': dbService }?: IDeps): IMigration;
7
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { IDbService } from 'infra/db/dbService';
2
2
  import { IAttribute } from '_types/attribute';
3
3
  import { IQueryInfos } from '_types/queryInfos';
4
- import { IValue, IValuesOptions } from '_types/value';
4
+ import { ISaveValue, IValue, IValuesOptions } from '_types/value';
5
5
  import { IAttributeTypesRepo, IAttributeWithRevLink } from '../attributeTypes/attributeTypesRepo';
6
6
  export declare const VALUES_LINKS_COLLECTION = "core_edge_values_links";
7
7
  export declare const VALUES_COLLECTION = "core_values";
@@ -11,7 +11,7 @@ export interface IValueRepo {
11
11
  library: string;
12
12
  recordId: string;
13
13
  attribute: IAttributeWithRevLink;
14
- value: IValue;
14
+ value: ISaveValue;
15
15
  ctx: IQueryInfos;
16
16
  }): Promise<IValue>;
17
17
  /**
@@ -21,7 +21,7 @@ export interface IValueRepo {
21
21
  library: string;
22
22
  recordId: string;
23
23
  attribute: IAttributeWithRevLink;
24
- value: IValue;
24
+ value: ISaveValue;
25
25
  ctx: IQueryInfos;
26
26
  }): Promise<IValue>;
27
27
  /**
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "0.0.7-128bb5a",
3
+ "version": "0.0.7-12f71e9",
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 tsc --emitDeclarationOnly --declaration --outDir dist-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",