@rws-framework/db 2.3.2 → 2.4.1
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.
- package/.bin/add-v.sh +9 -9
- package/.bin/emerge.sh +10 -10
- package/.eslintrc.json +53 -53
- package/README.md +404 -367
- package/dist/decorators/InverseRelation.d.ts +0 -0
- package/dist/decorators/InverseRelation.js +0 -0
- package/dist/decorators/InverseTimeSeries.d.ts +0 -0
- package/dist/decorators/InverseTimeSeries.js +0 -0
- package/dist/decorators/RWSCollection.d.ts +0 -0
- package/dist/decorators/RWSCollection.js +0 -0
- package/dist/decorators/Relation.d.ts +0 -0
- package/dist/decorators/Relation.js +0 -0
- package/dist/decorators/TrackType.d.ts +0 -0
- package/dist/decorators/TrackType.js +0 -0
- package/dist/decorators/index.d.ts +0 -0
- package/dist/decorators/index.js +0 -0
- package/dist/helper/DbHelper.d.ts +0 -0
- package/dist/helper/DbHelper.js +7 -7
- package/dist/helper/FieldsHelper.d.ts +0 -0
- package/dist/helper/FieldsHelper.js +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/models/TimeSeriesModel.d.ts +7 -7
- package/dist/models/TimeSeriesModel.js +33 -33
- package/dist/models/_model.d.ts +0 -0
- package/dist/models/_model.js +0 -0
- package/dist/models/core/RWSModel.d.ts +0 -0
- package/dist/models/core/RWSModel.js +0 -0
- package/dist/models/core/TimeSeriesModel.d.ts +0 -0
- package/dist/models/core/TimeSeriesModel.js +0 -0
- package/dist/models/index.d.ts +0 -0
- package/dist/models/index.js +0 -0
- package/dist/models/interfaces/IModel.d.ts +0 -0
- package/dist/models/interfaces/IModel.js +0 -0
- package/dist/models/interfaces/IRWSModelServices.d.ts +0 -0
- package/dist/models/interfaces/IRWSModelServices.js +0 -0
- package/dist/models/interfaces/OpModelType.d.ts +0 -0
- package/dist/models/interfaces/OpModelType.js +0 -0
- package/dist/models/types/RelationTypes.d.ts +0 -0
- package/dist/models/types/RelationTypes.js +0 -0
- package/dist/models/utils/ModelUtils.d.ts +0 -0
- package/dist/models/utils/ModelUtils.js +0 -0
- package/dist/models/utils/PaginationUtils.d.ts +0 -0
- package/dist/models/utils/PaginationUtils.js +0 -0
- package/dist/models/utils/RelationUtils.d.ts +0 -0
- package/dist/models/utils/RelationUtils.js +0 -0
- package/dist/models/utils/TimeSeriesUtils.d.ts +0 -0
- package/dist/models/utils/TimeSeriesUtils.js +0 -0
- package/dist/services/DBService.d.ts +1 -1
- package/dist/services/DBService.js +6 -6
- package/dist/types/DbConfigHandler.d.ts +3 -2
- package/dist/types/DbConfigHandler.js +0 -0
- package/dist/types/FindParams.d.ts +0 -0
- package/dist/types/FindParams.js +0 -0
- package/dist/types/IRWSModel.d.ts +0 -0
- package/dist/types/IRWSModel.js +0 -0
- package/dist/types/ITimeSeries.d.ts +0 -0
- package/dist/types/ITimeSeries.js +0 -0
- package/exec/console.js +110 -110
- package/exec/db.rws.webpack.config.js +168 -168
- package/exec/src/cli.ts +75 -73
- package/exec/tsconfig.json +32 -32
- package/exec/webpackFilters.js +17 -17
- package/package.json +36 -36
- package/src/decorators/InverseRelation.ts +36 -36
- package/src/decorators/InverseTimeSeries.ts +21 -21
- package/src/decorators/RWSCollection.ts +27 -27
- package/src/decorators/Relation.ts +47 -47
- package/src/decorators/TrackType.ts +69 -69
- package/src/decorators/index.ts +7 -7
- package/src/empty.js +0 -0
- package/src/helper/DbHelper.ts +177 -177
- package/src/helper/FieldsHelper.ts +34 -34
- package/src/index.ts +36 -36
- package/src/models/_model.ts +29 -29
- package/src/models/core/RWSModel.ts +520 -520
- package/src/models/core/TimeSeriesModel.ts +19 -19
- package/src/models/index.ts +20 -20
- package/src/models/interfaces/IModel.ts +12 -12
- package/src/models/interfaces/IRWSModelServices.ts +7 -7
- package/src/models/interfaces/OpModelType.ts +49 -49
- package/src/models/types/RelationTypes.ts +25 -25
- package/src/models/utils/ModelUtils.ts +65 -65
- package/src/models/utils/PaginationUtils.ts +42 -42
- package/src/models/utils/RelationUtils.ts +76 -76
- package/src/models/utils/TimeSeriesUtils.ts +38 -38
- package/src/services/DBService.ts +277 -277
- package/src/types/DbConfigHandler.ts +12 -11
- package/src/types/FindParams.ts +13 -13
- package/src/types/IRWSModel.ts +2 -2
- package/src/types/ITimeSeries.ts +5 -5
- package/tsconfig.json +22 -22
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { RWSModel, OpModelType } from '../models/_model';
|
|
3
|
-
|
|
4
|
-
interface InverseRelationOpts{
|
|
5
|
-
key: string,
|
|
6
|
-
inversionModel: OpModelType<RWSModel<any>>,
|
|
7
|
-
foreignKey: string,
|
|
8
|
-
singular?: boolean
|
|
9
|
-
relationName?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function InverseRelation(inversionModel: () => OpModelType<RWSModel<any>>, sourceModel: () => OpModelType<RWSModel<any>>, relationOptions: Partial<InverseRelationOpts> = null) {
|
|
13
|
-
return function(target: any, key: string) {
|
|
14
|
-
const metadataPromise = Promise.resolve().then(() => {
|
|
15
|
-
const model = inversionModel();
|
|
16
|
-
const source = sourceModel();
|
|
17
|
-
|
|
18
|
-
const metaOpts: InverseRelationOpts = {
|
|
19
|
-
...relationOptions,
|
|
20
|
-
key,
|
|
21
|
-
inversionModel: model,
|
|
22
|
-
foreignKey: relationOptions && relationOptions.foreignKey ? relationOptions.foreignKey : `${source._collection}_id`
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return metaOpts;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Store both the promise and the key information
|
|
29
|
-
Reflect.defineMetadata(`InverseRelation:${key}`, {
|
|
30
|
-
promise: metadataPromise,
|
|
31
|
-
key
|
|
32
|
-
}, target);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default InverseRelation;
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { RWSModel, OpModelType } from '../models/_model';
|
|
3
|
+
|
|
4
|
+
interface InverseRelationOpts{
|
|
5
|
+
key: string,
|
|
6
|
+
inversionModel: OpModelType<RWSModel<any>>,
|
|
7
|
+
foreignKey: string,
|
|
8
|
+
singular?: boolean
|
|
9
|
+
relationName?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function InverseRelation(inversionModel: () => OpModelType<RWSModel<any>>, sourceModel: () => OpModelType<RWSModel<any>>, relationOptions: Partial<InverseRelationOpts> = null) {
|
|
13
|
+
return function(target: any, key: string) {
|
|
14
|
+
const metadataPromise = Promise.resolve().then(() => {
|
|
15
|
+
const model = inversionModel();
|
|
16
|
+
const source = sourceModel();
|
|
17
|
+
|
|
18
|
+
const metaOpts: InverseRelationOpts = {
|
|
19
|
+
...relationOptions,
|
|
20
|
+
key,
|
|
21
|
+
inversionModel: model,
|
|
22
|
+
foreignKey: relationOptions && relationOptions.foreignKey ? relationOptions.foreignKey : `${source._collection}_id`
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return metaOpts;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Store both the promise and the key information
|
|
29
|
+
Reflect.defineMetadata(`InverseRelation:${key}`, {
|
|
30
|
+
promise: metadataPromise,
|
|
31
|
+
key
|
|
32
|
+
}, target);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default InverseRelation;
|
|
37
37
|
export {InverseRelationOpts};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
|
|
3
|
-
interface InverseTimeSeriesOpts{
|
|
4
|
-
timeSeriesModel: string
|
|
5
|
-
hydrationField: string
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function InverseTimeSeries(timeSeriesModel: string, hydrationField: string) {
|
|
9
|
-
|
|
10
|
-
const metaOpts: InverseTimeSeriesOpts = {
|
|
11
|
-
timeSeriesModel: timeSeriesModel,
|
|
12
|
-
hydrationField: hydrationField
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return function(target: any, key: string) {
|
|
17
|
-
Reflect.defineMetadata(`InverseTimeSeries:${key}`, metaOpts, target);
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default InverseTimeSeries;
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
|
|
3
|
+
interface InverseTimeSeriesOpts{
|
|
4
|
+
timeSeriesModel: string
|
|
5
|
+
hydrationField: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function InverseTimeSeries(timeSeriesModel: string, hydrationField: string) {
|
|
9
|
+
|
|
10
|
+
const metaOpts: InverseTimeSeriesOpts = {
|
|
11
|
+
timeSeriesModel: timeSeriesModel,
|
|
12
|
+
hydrationField: hydrationField
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
return function(target: any, key: string) {
|
|
17
|
+
Reflect.defineMetadata(`InverseTimeSeries:${key}`, metaOpts, target);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default InverseTimeSeries;
|
|
22
22
|
export {InverseTimeSeriesOpts};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { OpModelType } from "../models/_model";
|
|
2
|
-
|
|
3
|
-
export interface IRWSCollectionOpts {
|
|
4
|
-
relations?: {
|
|
5
|
-
[key: string]: boolean
|
|
6
|
-
},
|
|
7
|
-
ignored_keys?: string[]
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface IRWSCollectionMeta {
|
|
11
|
-
collectionName: string,
|
|
12
|
-
options?: IRWSCollectionOpts
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export function RWSCollection(collectionName: string, options?: IRWSCollectionOpts) {
|
|
17
|
-
const metaOpts: IRWSCollectionMeta = { collectionName, options };
|
|
18
|
-
return function(target: OpModelType<any>) {
|
|
19
|
-
target._collection = collectionName;
|
|
20
|
-
if(options && options.relations){
|
|
21
|
-
target._RELATIONS = options.relations;
|
|
22
|
-
}
|
|
23
|
-
if(options && options.ignored_keys){
|
|
24
|
-
target._CUT_KEYS = options.ignored_keys;
|
|
25
|
-
}
|
|
26
|
-
Reflect.defineMetadata(`RWSCollection`, metaOpts, target);
|
|
27
|
-
};
|
|
1
|
+
import { OpModelType } from "../models/_model";
|
|
2
|
+
|
|
3
|
+
export interface IRWSCollectionOpts {
|
|
4
|
+
relations?: {
|
|
5
|
+
[key: string]: boolean
|
|
6
|
+
},
|
|
7
|
+
ignored_keys?: string[]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IRWSCollectionMeta {
|
|
11
|
+
collectionName: string,
|
|
12
|
+
options?: IRWSCollectionOpts
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export function RWSCollection(collectionName: string, options?: IRWSCollectionOpts) {
|
|
17
|
+
const metaOpts: IRWSCollectionMeta = { collectionName, options };
|
|
18
|
+
return function(target: OpModelType<any>) {
|
|
19
|
+
target._collection = collectionName;
|
|
20
|
+
if(options && options.relations){
|
|
21
|
+
target._RELATIONS = options.relations;
|
|
22
|
+
}
|
|
23
|
+
if(options && options.ignored_keys){
|
|
24
|
+
target._CUT_KEYS = options.ignored_keys;
|
|
25
|
+
}
|
|
26
|
+
Reflect.defineMetadata(`RWSCollection`, metaOpts, target);
|
|
27
|
+
};
|
|
28
28
|
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { RWSModel, OpModelType } from '../models/_model';
|
|
3
|
-
|
|
4
|
-
type CascadingSetup = 'Cascade' | 'Restrict' | 'NoAction' | 'SetNull';
|
|
5
|
-
|
|
6
|
-
interface IRelationOpts {
|
|
7
|
-
required?: boolean
|
|
8
|
-
key: string
|
|
9
|
-
relationField: string
|
|
10
|
-
relatedToField?: string
|
|
11
|
-
relatedTo: OpModelType<RWSModel<any>>
|
|
12
|
-
many?: boolean
|
|
13
|
-
embed?: boolean
|
|
14
|
-
cascade: {
|
|
15
|
-
onDelete: CascadingSetup,
|
|
16
|
-
onUpdate: CascadingSetup
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const _DEFAULTS: Partial<IRelationOpts> = { required: false, many: false, embed: false, cascade: { onDelete: 'SetNull', onUpdate: 'Cascade' }};
|
|
21
|
-
|
|
22
|
-
function Relation(theModel: () => OpModelType<RWSModel<any>>, relationOptions: Partial<IRelationOpts> = _DEFAULTS) {
|
|
23
|
-
return function(target: any, key: string) {
|
|
24
|
-
// Store the promise in metadata immediately
|
|
25
|
-
const metadataPromise = Promise.resolve().then(() => {
|
|
26
|
-
const relatedTo = theModel();
|
|
27
|
-
|
|
28
|
-
const metaOpts: IRelationOpts = {
|
|
29
|
-
...relationOptions,
|
|
30
|
-
cascade: relationOptions.cascade || _DEFAULTS.cascade,
|
|
31
|
-
relatedTo,
|
|
32
|
-
relationField: relationOptions.relationField ? relationOptions.relationField : relatedTo._collection + '_id',
|
|
33
|
-
key
|
|
34
|
-
};
|
|
35
|
-
return metaOpts;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// Store both the promise and the key information
|
|
39
|
-
Reflect.defineMetadata(`Relation:${key}`, {
|
|
40
|
-
promise: metadataPromise,
|
|
41
|
-
key
|
|
42
|
-
}, target);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export default Relation;
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { RWSModel, OpModelType } from '../models/_model';
|
|
3
|
+
|
|
4
|
+
type CascadingSetup = 'Cascade' | 'Restrict' | 'NoAction' | 'SetNull';
|
|
5
|
+
|
|
6
|
+
interface IRelationOpts {
|
|
7
|
+
required?: boolean
|
|
8
|
+
key: string
|
|
9
|
+
relationField: string
|
|
10
|
+
relatedToField?: string
|
|
11
|
+
relatedTo: OpModelType<RWSModel<any>>
|
|
12
|
+
many?: boolean
|
|
13
|
+
embed?: boolean
|
|
14
|
+
cascade: {
|
|
15
|
+
onDelete: CascadingSetup,
|
|
16
|
+
onUpdate: CascadingSetup
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const _DEFAULTS: Partial<IRelationOpts> = { required: false, many: false, embed: false, cascade: { onDelete: 'SetNull', onUpdate: 'Cascade' }};
|
|
21
|
+
|
|
22
|
+
function Relation(theModel: () => OpModelType<RWSModel<any>>, relationOptions: Partial<IRelationOpts> = _DEFAULTS) {
|
|
23
|
+
return function(target: any, key: string) {
|
|
24
|
+
// Store the promise in metadata immediately
|
|
25
|
+
const metadataPromise = Promise.resolve().then(() => {
|
|
26
|
+
const relatedTo = theModel();
|
|
27
|
+
|
|
28
|
+
const metaOpts: IRelationOpts = {
|
|
29
|
+
...relationOptions,
|
|
30
|
+
cascade: relationOptions.cascade || _DEFAULTS.cascade,
|
|
31
|
+
relatedTo,
|
|
32
|
+
relationField: relationOptions.relationField ? relationOptions.relationField : relatedTo._collection + '_id',
|
|
33
|
+
key
|
|
34
|
+
};
|
|
35
|
+
return metaOpts;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Store both the promise and the key information
|
|
39
|
+
Reflect.defineMetadata(`Relation:${key}`, {
|
|
40
|
+
promise: metadataPromise,
|
|
41
|
+
key
|
|
42
|
+
}, target);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export default Relation;
|
|
48
48
|
export {IRelationOpts};
|
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { OpModelType } from '../models/interfaces/OpModelType';
|
|
3
|
-
|
|
4
|
-
interface ITrackerOpts{
|
|
5
|
-
required?: boolean,
|
|
6
|
-
isArray?: boolean,
|
|
7
|
-
relationField?: string,
|
|
8
|
-
relatedToField?: string,
|
|
9
|
-
relatedTo?: OpModelType<any>,
|
|
10
|
-
inversionModel?: OpModelType<any>,
|
|
11
|
-
relationName?: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface IMetaOpts extends ITrackerOpts{
|
|
15
|
-
type: any,
|
|
16
|
-
tags: string[],
|
|
17
|
-
required: boolean,
|
|
18
|
-
isArray: boolean
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function TrackType(type: any, opts: ITrackerOpts | null = null, tags: string[] = []) {
|
|
22
|
-
if(!opts){
|
|
23
|
-
opts = {
|
|
24
|
-
required: false,
|
|
25
|
-
isArray: false
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if(!opts?.required){
|
|
30
|
-
opts.required = false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if(!opts?.isArray){
|
|
34
|
-
opts.isArray = false;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const required = opts.required;
|
|
38
|
-
const isArray = opts.isArray;
|
|
39
|
-
|
|
40
|
-
const metaOpts: IMetaOpts = {type, tags, required, isArray};
|
|
41
|
-
|
|
42
|
-
if(opts.relatedToField && opts.relatedTo){
|
|
43
|
-
metaOpts.relatedToField = opts.relatedToField;
|
|
44
|
-
metaOpts.relatedTo = opts.relatedTo;
|
|
45
|
-
|
|
46
|
-
if(!opts.relationField){
|
|
47
|
-
metaOpts.relationField = opts.relatedTo + '_id';
|
|
48
|
-
} else{
|
|
49
|
-
metaOpts.relationField = opts.relationField;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if(opts.inversionModel){
|
|
54
|
-
metaOpts.inversionModel = opts.inversionModel;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
//const resolvedType = typeof type === 'function' ? type() : type;
|
|
58
|
-
|
|
59
|
-
if(type._collection){
|
|
60
|
-
metaOpts.type = (type as any);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return function(target: any, key: string) {
|
|
64
|
-
Reflect.defineMetadata(`TrackType:${key}`, metaOpts, target);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default TrackType;
|
|
69
|
-
export {IMetaOpts, ITrackerOpts};
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { OpModelType } from '../models/interfaces/OpModelType';
|
|
3
|
+
|
|
4
|
+
interface ITrackerOpts{
|
|
5
|
+
required?: boolean,
|
|
6
|
+
isArray?: boolean,
|
|
7
|
+
relationField?: string,
|
|
8
|
+
relatedToField?: string,
|
|
9
|
+
relatedTo?: OpModelType<any>,
|
|
10
|
+
inversionModel?: OpModelType<any>,
|
|
11
|
+
relationName?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface IMetaOpts extends ITrackerOpts{
|
|
15
|
+
type: any,
|
|
16
|
+
tags: string[],
|
|
17
|
+
required: boolean,
|
|
18
|
+
isArray: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function TrackType(type: any, opts: ITrackerOpts | null = null, tags: string[] = []) {
|
|
22
|
+
if(!opts){
|
|
23
|
+
opts = {
|
|
24
|
+
required: false,
|
|
25
|
+
isArray: false
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if(!opts?.required){
|
|
30
|
+
opts.required = false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if(!opts?.isArray){
|
|
34
|
+
opts.isArray = false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const required = opts.required;
|
|
38
|
+
const isArray = opts.isArray;
|
|
39
|
+
|
|
40
|
+
const metaOpts: IMetaOpts = {type, tags, required, isArray};
|
|
41
|
+
|
|
42
|
+
if(opts.relatedToField && opts.relatedTo){
|
|
43
|
+
metaOpts.relatedToField = opts.relatedToField;
|
|
44
|
+
metaOpts.relatedTo = opts.relatedTo;
|
|
45
|
+
|
|
46
|
+
if(!opts.relationField){
|
|
47
|
+
metaOpts.relationField = opts.relatedTo + '_id';
|
|
48
|
+
} else{
|
|
49
|
+
metaOpts.relationField = opts.relationField;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if(opts.inversionModel){
|
|
54
|
+
metaOpts.inversionModel = opts.inversionModel;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//const resolvedType = typeof type === 'function' ? type() : type;
|
|
58
|
+
|
|
59
|
+
if(type._collection){
|
|
60
|
+
metaOpts.type = (type as any);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return function(target: any, key: string) {
|
|
64
|
+
Reflect.defineMetadata(`TrackType:${key}`, metaOpts, target);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default TrackType;
|
|
69
|
+
export {IMetaOpts, ITrackerOpts};
|
package/src/decorators/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import InverseRelation from './InverseRelation';
|
|
2
|
-
import Relation from './Relation';
|
|
3
|
-
import TrackType, { IMetaOpts } from './TrackType';
|
|
4
|
-
import InverseTimeSeries from './InverseTimeSeries';
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
InverseRelation, Relation, TrackType, InverseTimeSeries, IMetaOpts
|
|
1
|
+
import InverseRelation from './InverseRelation';
|
|
2
|
+
import Relation from './Relation';
|
|
3
|
+
import TrackType, { IMetaOpts } from './TrackType';
|
|
4
|
+
import InverseTimeSeries from './InverseTimeSeries';
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
InverseRelation, Relation, TrackType, InverseTimeSeries, IMetaOpts
|
|
8
8
|
};
|
package/src/empty.js
CHANGED
|
File without changes
|