@odata2ts/odata2ts 0.23.1 → 0.25.0
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/CHANGELOG.md +22 -0
- package/lib/FactoryFunctionModel.d.ts +13 -13
- package/lib/FactoryFunctionModel.js +2 -2
- package/lib/FactoryFunctionModel.js.map +1 -1
- package/lib/NamingModel.d.ts +182 -182
- package/lib/NamingModel.js +11 -11
- package/lib/NamingModel.js.map +1 -1
- package/lib/OptionModel.d.ts +228 -223
- package/lib/OptionModel.js +23 -23
- package/lib/OptionModel.js.map +1 -1
- package/lib/app.d.ts +8 -8
- package/lib/app.js +67 -63
- package/lib/app.js.map +1 -1
- package/lib/cli.d.ts +3 -3
- package/lib/cli.js +153 -153
- package/lib/data-model/DataModel.d.ts +88 -85
- package/lib/data-model/DataModel.js +141 -134
- package/lib/data-model/DataModel.js.map +1 -1
- package/lib/data-model/DataModelDigestion.d.ts +48 -44
- package/lib/data-model/DataModelDigestion.js +299 -274
- package/lib/data-model/DataModelDigestion.js.map +1 -1
- package/lib/data-model/DataModelDigestionV2.d.ts +10 -10
- package/lib/data-model/DataModelDigestionV2.js +210 -200
- package/lib/data-model/DataModelDigestionV2.js.map +1 -1
- package/lib/data-model/DataModelDigestionV4.d.ts +3 -3
- package/lib/data-model/DataModelDigestionV4.js +197 -195
- package/lib/data-model/DataModelDigestionV4.js.map +1 -1
- package/lib/data-model/DataTypeModel.d.ts +102 -102
- package/lib/data-model/DataTypeModel.js +8 -8
- package/lib/data-model/DataTypeModel.js.map +1 -1
- package/lib/data-model/NamingHelper.d.ts +57 -55
- package/lib/data-model/NamingHelper.js +231 -214
- package/lib/data-model/NamingHelper.js.map +1 -1
- package/lib/data-model/ServiceConfigHelper.d.ts +21 -21
- package/lib/data-model/ServiceConfigHelper.js +113 -113
- package/lib/data-model/edmx/ODataEdmxModelBase.d.ts +92 -80
- package/lib/data-model/edmx/ODataEdmxModelBase.js +2 -2
- package/lib/data-model/edmx/ODataEdmxModelBase.js.map +1 -1
- package/lib/data-model/edmx/ODataEdmxModelV3.d.ts +63 -63
- package/lib/data-model/edmx/ODataEdmxModelV3.js +2 -2
- package/lib/data-model/edmx/ODataEdmxModelV4.d.ts +67 -67
- package/lib/data-model/edmx/ODataEdmxModelV4.js +2 -2
- package/lib/defaultConfig.d.ts +9 -9
- package/lib/defaultConfig.js +165 -164
- package/lib/defaultConfig.js.map +1 -1
- package/lib/evaluateConfig.d.ts +25 -25
- package/lib/evaluateConfig.js +82 -82
- package/lib/generator/ImportContainer.d.ts +16 -16
- package/lib/generator/ImportContainer.js +91 -91
- package/lib/generator/ModelGenerator.d.ts +2 -2
- package/lib/generator/ModelGenerator.js +211 -183
- package/lib/generator/ModelGenerator.js.map +1 -1
- package/lib/generator/QueryObjectGenerator.d.ts +2 -2
- package/lib/generator/QueryObjectGenerator.js +239 -239
- package/lib/generator/ServiceGenerator.d.ts +8 -8
- package/lib/generator/ServiceGenerator.js +422 -422
- package/lib/generator/index.d.ts +3 -3
- package/lib/generator/index.js +9 -9
- package/lib/index.d.ts +3 -3
- package/lib/index.js +6 -6
- package/lib/project/ProjectManager.d.ts +30 -30
- package/lib/project/ProjectManager.js +177 -175
- package/lib/project/ProjectManager.js.map +1 -1
- package/lib/project/formatter/BaseFormatter.d.ts +49 -49
- package/lib/project/formatter/BaseFormatter.js +30 -30
- package/lib/project/formatter/FileFormatter.d.ts +16 -16
- package/lib/project/formatter/FileFormatter.js +2 -2
- package/lib/project/formatter/NoopFormatter.d.ts +29 -29
- package/lib/project/formatter/NoopFormatter.js +42 -42
- package/lib/project/formatter/PrettierFormatter.d.ts +46 -46
- package/lib/project/formatter/PrettierFormatter.js +92 -92
- package/lib/project/formatter/index.d.ts +2 -2
- package/lib/project/formatter/index.js +14 -14
- package/lib/project/logger/logFilePath.d.ts +1 -1
- package/lib/project/logger/logFilePath.js +12 -12
- package/lib/run-cli.d.ts +2 -2
- package/lib/run-cli.js +6 -6
- package/package.json +27 -28
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { ComplexType, EntityContainer, EntitySet, EntityType, ODataEdmxModelBase, Property, ReturnType, Schema } from "./ODataEdmxModelBase";
|
|
2
|
-
export interface ODataEdmxModelV4 extends ODataEdmxModelBase<SchemaV4> {
|
|
3
|
-
}
|
|
4
|
-
export interface SchemaV4 extends Schema<EntityTypeV4, ComplexTypeV4> {
|
|
5
|
-
EntityContainer?: Array<EntityContainerV4>;
|
|
6
|
-
Function?: Array<Operation>;
|
|
7
|
-
Action?: Array<Operation>;
|
|
8
|
-
}
|
|
9
|
-
export interface EntityTypeV4 extends EntityType {
|
|
10
|
-
NavigationProperty?: Array<NavigationProperty>;
|
|
11
|
-
}
|
|
12
|
-
export interface ComplexTypeV4 extends ComplexType {
|
|
13
|
-
NavigationProperty?: Array<NavigationProperty>;
|
|
14
|
-
}
|
|
15
|
-
export interface NavigationProperty {
|
|
16
|
-
$: {
|
|
17
|
-
Name: string;
|
|
18
|
-
Type: string;
|
|
19
|
-
Nullable?: "true" | "false";
|
|
20
|
-
Partner?: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface EntityContainerV4 extends EntityContainer<EntitySetV4> {
|
|
24
|
-
Singleton?: Array<Singleton>;
|
|
25
|
-
FunctionImport?: Array<FunctionImport>;
|
|
26
|
-
ActionImport?: Array<ActionImport>;
|
|
27
|
-
}
|
|
28
|
-
export interface EntitySetV4 extends EntitySet {
|
|
29
|
-
NavigationPropertyBinding?: Array<NavigationPropertyBinding>;
|
|
30
|
-
}
|
|
31
|
-
export interface Singleton {
|
|
32
|
-
$: {
|
|
33
|
-
Name: string;
|
|
34
|
-
Type: string;
|
|
35
|
-
};
|
|
36
|
-
NavigationPropertyBinding?: Array<NavigationPropertyBinding>;
|
|
37
|
-
}
|
|
38
|
-
export interface FunctionImport {
|
|
39
|
-
$: {
|
|
40
|
-
Name: string;
|
|
41
|
-
Function: string;
|
|
42
|
-
EntitySet: string;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export interface ActionImport {
|
|
46
|
-
$: {
|
|
47
|
-
Name: string;
|
|
48
|
-
Action: string;
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export interface NavigationPropertyBinding {
|
|
52
|
-
$: {
|
|
53
|
-
Path: string;
|
|
54
|
-
Target: string;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export interface Operation {
|
|
58
|
-
$: {
|
|
59
|
-
Name: string;
|
|
60
|
-
IsBound?: "true" | "false";
|
|
61
|
-
};
|
|
62
|
-
Parameter?: Array<Parameter>;
|
|
63
|
-
ReturnType?: Array<ReturnType>;
|
|
64
|
-
}
|
|
65
|
-
export interface Parameter extends Property {
|
|
66
|
-
Unicode?: boolean;
|
|
67
|
-
}
|
|
1
|
+
import { ComplexType, EntityContainer, EntitySet, EntityType, ODataEdmxModelBase, Property, ReturnType, Schema } from "./ODataEdmxModelBase";
|
|
2
|
+
export interface ODataEdmxModelV4 extends ODataEdmxModelBase<SchemaV4> {
|
|
3
|
+
}
|
|
4
|
+
export interface SchemaV4 extends Schema<EntityTypeV4, ComplexTypeV4> {
|
|
5
|
+
EntityContainer?: Array<EntityContainerV4>;
|
|
6
|
+
Function?: Array<Operation>;
|
|
7
|
+
Action?: Array<Operation>;
|
|
8
|
+
}
|
|
9
|
+
export interface EntityTypeV4 extends EntityType {
|
|
10
|
+
NavigationProperty?: Array<NavigationProperty>;
|
|
11
|
+
}
|
|
12
|
+
export interface ComplexTypeV4 extends ComplexType {
|
|
13
|
+
NavigationProperty?: Array<NavigationProperty>;
|
|
14
|
+
}
|
|
15
|
+
export interface NavigationProperty {
|
|
16
|
+
$: {
|
|
17
|
+
Name: string;
|
|
18
|
+
Type: string;
|
|
19
|
+
Nullable?: "true" | "false";
|
|
20
|
+
Partner?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface EntityContainerV4 extends EntityContainer<EntitySetV4> {
|
|
24
|
+
Singleton?: Array<Singleton>;
|
|
25
|
+
FunctionImport?: Array<FunctionImport>;
|
|
26
|
+
ActionImport?: Array<ActionImport>;
|
|
27
|
+
}
|
|
28
|
+
export interface EntitySetV4 extends EntitySet {
|
|
29
|
+
NavigationPropertyBinding?: Array<NavigationPropertyBinding>;
|
|
30
|
+
}
|
|
31
|
+
export interface Singleton {
|
|
32
|
+
$: {
|
|
33
|
+
Name: string;
|
|
34
|
+
Type: string;
|
|
35
|
+
};
|
|
36
|
+
NavigationPropertyBinding?: Array<NavigationPropertyBinding>;
|
|
37
|
+
}
|
|
38
|
+
export interface FunctionImport {
|
|
39
|
+
$: {
|
|
40
|
+
Name: string;
|
|
41
|
+
Function: string;
|
|
42
|
+
EntitySet: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface ActionImport {
|
|
46
|
+
$: {
|
|
47
|
+
Name: string;
|
|
48
|
+
Action: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface NavigationPropertyBinding {
|
|
52
|
+
$: {
|
|
53
|
+
Path: string;
|
|
54
|
+
Target: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export interface Operation {
|
|
58
|
+
$: {
|
|
59
|
+
Name: string;
|
|
60
|
+
IsBound?: "true" | "false";
|
|
61
|
+
};
|
|
62
|
+
Parameter?: Array<Parameter>;
|
|
63
|
+
ReturnType?: Array<ReturnType>;
|
|
64
|
+
}
|
|
65
|
+
export interface Parameter extends Property {
|
|
66
|
+
Unicode?: boolean;
|
|
67
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=ODataEdmxModelV4.js.map
|
package/lib/defaultConfig.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { RunOptions } from "./OptionModel";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a defensive copy of the default config.
|
|
4
|
-
*/
|
|
5
|
-
export declare function getDefaultConfig(): Omit<RunOptions, "source" | "output">;
|
|
6
|
-
/**
|
|
7
|
-
* Creates a defensive copy of the minimal config: minimal in respect to naming.
|
|
8
|
-
*/
|
|
9
|
-
export declare function getMinimalConfig(): Omit<RunOptions, "source" | "output">;
|
|
1
|
+
import { RunOptions } from "./OptionModel";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a defensive copy of the default config.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getDefaultConfig(): Omit<RunOptions, "source" | "output">;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a defensive copy of the minimal config: minimal in respect to naming.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getMinimalConfig(): Omit<RunOptions, "source" | "output">;
|
package/lib/defaultConfig.js
CHANGED
|
@@ -1,165 +1,166 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMinimalConfig = exports.getDefaultConfig = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const deepmerge_1 = tslib_1.__importDefault(require("deepmerge"));
|
|
6
|
-
const NamingModel_1 = require("./NamingModel");
|
|
7
|
-
const OptionModel_1 = require("./OptionModel");
|
|
8
|
-
/**
|
|
9
|
-
* The default configuration.
|
|
10
|
-
*/
|
|
11
|
-
const defaultConfig = {
|
|
12
|
-
mode: OptionModel_1.Modes.all,
|
|
13
|
-
emitMode: OptionModel_1.EmitModes.js_dts,
|
|
14
|
-
debug: false,
|
|
15
|
-
prettier: false,
|
|
16
|
-
tsconfig: "tsconfig.json",
|
|
17
|
-
converters: [],
|
|
18
|
-
skipEditableModels: false,
|
|
19
|
-
skipIdModels: false,
|
|
20
|
-
skipOperations: false,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMinimalConfig = exports.getDefaultConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const deepmerge_1 = tslib_1.__importDefault(require("deepmerge"));
|
|
6
|
+
const NamingModel_1 = require("./NamingModel");
|
|
7
|
+
const OptionModel_1 = require("./OptionModel");
|
|
8
|
+
/**
|
|
9
|
+
* The default configuration.
|
|
10
|
+
*/
|
|
11
|
+
const defaultConfig = {
|
|
12
|
+
mode: OptionModel_1.Modes.all,
|
|
13
|
+
emitMode: OptionModel_1.EmitModes.js_dts,
|
|
14
|
+
debug: false,
|
|
15
|
+
prettier: false,
|
|
16
|
+
tsconfig: "tsconfig.json",
|
|
17
|
+
converters: [],
|
|
18
|
+
skipEditableModels: false,
|
|
19
|
+
skipIdModels: false,
|
|
20
|
+
skipOperations: false,
|
|
21
|
+
skipComments: false,
|
|
22
|
+
disableAutoManagedKey: false,
|
|
23
|
+
allowRenaming: false,
|
|
24
|
+
v2ModelsWithExtraResultsWrapping: false,
|
|
25
|
+
naming: {
|
|
26
|
+
models: {
|
|
27
|
+
namingStrategy: NamingModel_1.NamingStrategies.PASCAL_CASE,
|
|
28
|
+
propNamingStrategy: NamingModel_1.NamingStrategies.CAMEL_CASE,
|
|
29
|
+
editableModels: {
|
|
30
|
+
prefix: "Editable",
|
|
31
|
+
suffix: "",
|
|
32
|
+
applyModelNaming: true,
|
|
33
|
+
},
|
|
34
|
+
idModels: {
|
|
35
|
+
prefix: "",
|
|
36
|
+
suffix: "Id",
|
|
37
|
+
applyModelNaming: true,
|
|
38
|
+
},
|
|
39
|
+
operationParamModels: {
|
|
40
|
+
prefix: "",
|
|
41
|
+
suffix: "Params",
|
|
42
|
+
applyModelNaming: true,
|
|
43
|
+
},
|
|
44
|
+
fileName: {
|
|
45
|
+
namingStrategy: NamingModel_1.NamingStrategies.PASCAL_CASE,
|
|
46
|
+
prefix: "",
|
|
47
|
+
suffix: "Model",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
queryObjects: {
|
|
51
|
+
namingStrategy: NamingModel_1.NamingStrategies.PASCAL_CASE,
|
|
52
|
+
propNamingStrategy: NamingModel_1.NamingStrategies.CAMEL_CASE,
|
|
53
|
+
prefix: "Q",
|
|
54
|
+
suffix: "",
|
|
55
|
+
idFunctions: {
|
|
56
|
+
prefix: "",
|
|
57
|
+
suffix: "Id",
|
|
58
|
+
},
|
|
59
|
+
fileName: {
|
|
60
|
+
namingStrategy: NamingModel_1.NamingStrategies.PASCAL_CASE,
|
|
61
|
+
prefix: "Q",
|
|
62
|
+
suffix: "",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
services: {
|
|
66
|
+
prefix: "",
|
|
67
|
+
suffix: "Service",
|
|
68
|
+
namingStrategy: NamingModel_1.NamingStrategies.PASCAL_CASE,
|
|
69
|
+
main: {
|
|
70
|
+
applyServiceNaming: true,
|
|
71
|
+
},
|
|
72
|
+
collection: {
|
|
73
|
+
prefix: "",
|
|
74
|
+
suffix: "Collection",
|
|
75
|
+
applyServiceNaming: true,
|
|
76
|
+
},
|
|
77
|
+
operations: {
|
|
78
|
+
namingStrategy: NamingModel_1.NamingStrategies.CAMEL_CASE,
|
|
79
|
+
},
|
|
80
|
+
relatedServiceGetter: {
|
|
81
|
+
namingStrategy: NamingModel_1.NamingStrategies.CAMEL_CASE,
|
|
82
|
+
prefix: "",
|
|
83
|
+
suffix: "",
|
|
84
|
+
},
|
|
85
|
+
privateProps: {
|
|
86
|
+
namingStrategy: NamingModel_1.NamingStrategies.CAMEL_CASE,
|
|
87
|
+
prefix: "_",
|
|
88
|
+
suffix: "",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
propertiesByName: [],
|
|
93
|
+
entitiesByName: [],
|
|
94
|
+
};
|
|
95
|
+
const { models, queryObjects, services } = defaultConfig.naming;
|
|
96
|
+
const minimalNamingConfig = {
|
|
97
|
+
models: {
|
|
98
|
+
fileName: {
|
|
99
|
+
prefix: models.fileName.prefix,
|
|
100
|
+
suffix: models.fileName.suffix,
|
|
101
|
+
},
|
|
102
|
+
idModels: {
|
|
103
|
+
applyModelNaming: true,
|
|
104
|
+
prefix: models.idModels.prefix,
|
|
105
|
+
suffix: models.idModels.suffix,
|
|
106
|
+
},
|
|
107
|
+
editableModels: {
|
|
108
|
+
applyModelNaming: true,
|
|
109
|
+
prefix: models.editableModels.prefix,
|
|
110
|
+
suffix: models.editableModels.suffix,
|
|
111
|
+
},
|
|
112
|
+
operationParamModels: {
|
|
113
|
+
applyModelNaming: true,
|
|
114
|
+
prefix: models.operationParamModels.prefix,
|
|
115
|
+
suffix: models.operationParamModels.suffix,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
queryObjects: {
|
|
119
|
+
prefix: queryObjects.prefix,
|
|
120
|
+
suffix: queryObjects.suffix,
|
|
121
|
+
fileName: {
|
|
122
|
+
prefix: queryObjects.fileName.prefix,
|
|
123
|
+
suffix: queryObjects.fileName.suffix,
|
|
124
|
+
},
|
|
125
|
+
idFunctions: {
|
|
126
|
+
prefix: queryObjects.idFunctions.prefix,
|
|
127
|
+
suffix: queryObjects.idFunctions.suffix,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
services: {
|
|
131
|
+
prefix: services.prefix,
|
|
132
|
+
suffix: services.suffix,
|
|
133
|
+
main: {
|
|
134
|
+
applyServiceNaming: true,
|
|
135
|
+
},
|
|
136
|
+
collection: {
|
|
137
|
+
applyServiceNaming: true,
|
|
138
|
+
prefix: services.collection.prefix,
|
|
139
|
+
suffix: services.collection.suffix,
|
|
140
|
+
},
|
|
141
|
+
privateProps: {
|
|
142
|
+
prefix: services.privateProps.prefix,
|
|
143
|
+
suffix: services.privateProps.suffix,
|
|
144
|
+
},
|
|
145
|
+
relatedServiceGetter: {
|
|
146
|
+
prefix: services.relatedServiceGetter.prefix,
|
|
147
|
+
suffix: services.relatedServiceGetter.suffix,
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Creates a defensive copy of the default config.
|
|
153
|
+
*/
|
|
154
|
+
function getDefaultConfig() {
|
|
155
|
+
return (0, deepmerge_1.default)(defaultConfig, {});
|
|
156
|
+
}
|
|
157
|
+
exports.getDefaultConfig = getDefaultConfig;
|
|
158
|
+
/**
|
|
159
|
+
* Creates a defensive copy of the minimal config: minimal in respect to naming.
|
|
160
|
+
*/
|
|
161
|
+
function getMinimalConfig() {
|
|
162
|
+
const { naming } = defaultConfig, passThrough = tslib_1.__rest(defaultConfig, ["naming"]);
|
|
163
|
+
return (0, deepmerge_1.default)(passThrough, { naming: minimalNamingConfig });
|
|
164
|
+
}
|
|
165
|
+
exports.getMinimalConfig = getMinimalConfig;
|
|
165
166
|
//# sourceMappingURL=defaultConfig.js.map
|
package/lib/defaultConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultConfig.js","sourceRoot":"","sources":["../src/defaultConfig.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAElC,+CAA+D;AAC/D,+CAA6D;AAE7D;;GAEG;AACH,MAAM,aAAa,GAA0C;IAC3D,IAAI,EAAE,mBAAK,CA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mB,EAAE,CAAC,CAAC;AACjE,CAAC;AAHD,4CAGC","sourcesContent":["import deepmerge from \"deepmerge\";\r\n\r\nimport { NameSettings, NamingStrategies } from \"./NamingModel\";\r\nimport { EmitModes, Modes, RunOptions } from \"./OptionModel\";\r\n\r\n/**\r\n * The default configuration.\r\n */\r\nconst defaultConfig: Omit<RunOptions, \"source\" | \"output\"> = {\r\n mode: Modes.all,\r\n emitMode: EmitModes.js_dts,\r\n debug: false,\r\n prettier: false,\r\n tsconfig: \"tsconfig.json\",\r\n converters: [],\r\n skipEditableModels: false,\r\n skipIdModels: false,\r\n skipOperations: false,\r\n disableAutoManagedKey: false,\r\n allowRenaming: false,\r\n v2ModelsWithExtraResultsWrapping: false,\r\n naming: {\r\n models: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n propNamingStrategy: NamingStrategies.CAMEL_CASE,\r\n editableModels: {\r\n prefix: \"Editable\",\r\n suffix: \"\",\r\n applyModelNaming: true,\r\n },\r\n idModels: {\r\n prefix: \"\",\r\n suffix: \"Id\",\r\n applyModelNaming: true,\r\n },\r\n operationParamModels: {\r\n prefix: \"\",\r\n suffix: \"Params\",\r\n applyModelNaming: true,\r\n },\r\n fileName: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n prefix: \"\",\r\n suffix: \"Model\",\r\n },\r\n },\r\n queryObjects: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n propNamingStrategy: NamingStrategies.CAMEL_CASE,\r\n prefix: \"Q\",\r\n suffix: \"\",\r\n idFunctions: {\r\n prefix: \"\",\r\n suffix: \"Id\",\r\n },\r\n fileName: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n prefix: \"Q\",\r\n suffix: \"\",\r\n },\r\n },\r\n services: {\r\n prefix: \"\",\r\n suffix: \"Service\",\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n main: {\r\n applyServiceNaming: true,\r\n },\r\n collection: {\r\n prefix: \"\",\r\n suffix: \"Collection\",\r\n applyServiceNaming: true,\r\n },\r\n operations: {\r\n namingStrategy: NamingStrategies.CAMEL_CASE,\r\n },\r\n relatedServiceGetter: {\r\n namingStrategy: NamingStrategies.CAMEL_CASE,\r\n prefix: \"\",\r\n suffix: \"\",\r\n },\r\n privateProps: {\r\n namingStrategy: NamingStrategies.CAMEL_CASE,\r\n prefix: \"_\",\r\n suffix: \"\",\r\n },\r\n },\r\n },\r\n propertiesByName: [],\r\n entitiesByName: [],\r\n};\r\n\r\nconst { models, queryObjects, services } = defaultConfig.naming;\r\nconst minimalNamingConfig: NameSettings = {\r\n models: {\r\n fileName: {\r\n prefix: models.fileName.prefix,\r\n suffix: models.fileName.suffix,\r\n },\r\n idModels: {\r\n applyModelNaming: true,\r\n prefix: models.idModels.prefix,\r\n suffix: models.idModels.suffix,\r\n },\r\n editableModels: {\r\n applyModelNaming: true,\r\n prefix: models.editableModels.prefix,\r\n suffix: models.editableModels.suffix,\r\n },\r\n operationParamModels: {\r\n applyModelNaming: true,\r\n prefix: models.operationParamModels.prefix,\r\n suffix: models.operationParamModels.suffix,\r\n },\r\n },\r\n queryObjects: {\r\n prefix: queryObjects.prefix,\r\n suffix: queryObjects.suffix,\r\n fileName: {\r\n prefix: queryObjects.fileName.prefix,\r\n suffix: queryObjects.fileName.suffix,\r\n },\r\n idFunctions: {\r\n prefix: queryObjects.idFunctions.prefix,\r\n suffix: queryObjects.idFunctions.suffix,\r\n },\r\n },\r\n services: {\r\n prefix: services.prefix,\r\n suffix: services.suffix,\r\n main: {\r\n applyServiceNaming: true,\r\n },\r\n collection: {\r\n applyServiceNaming: true,\r\n prefix: services.collection.prefix,\r\n suffix: services.collection.suffix,\r\n },\r\n privateProps: {\r\n prefix: services.privateProps.prefix,\r\n suffix: services.privateProps.suffix,\r\n },\r\n relatedServiceGetter: {\r\n prefix: services.relatedServiceGetter.prefix,\r\n suffix: services.relatedServiceGetter.suffix,\r\n },\r\n },\r\n};\r\n\r\n/**\r\n * Creates a defensive copy of the default config.\r\n */\r\nexport function getDefaultConfig(): Omit<RunOptions, \"source\" | \"output\"> {\r\n return deepmerge(defaultConfig, {});\r\n}\r\n\r\n/**\r\n * Creates a defensive copy of the minimal config: minimal in respect to naming.\r\n */\r\nexport function getMinimalConfig(): Omit<RunOptions, \"source\" | \"output\"> {\r\n const { naming, ...passThrough } = defaultConfig;\r\n return deepmerge(passThrough, { naming: minimalNamingConfig });\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"defaultConfig.js","sourceRoot":"","sources":["../src/defaultConfig.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAElC,+CAA+D;AAC/D,+CAA6D;AAE7D;;GAEG;AACH,MAAM,aAAa,GAA0C;IAC3D,IAAI,EAAE,mBAAK,CAAC,GAAG;IACf,QAAQ,EAAE,uBAAS,CAAC,MAAM;IAC1B,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,KAAK;IACzB,YAAY,EAAE,KAAK;IACnB,cAAc,EAAE,KAAK;IACrB,YAAY,EAAE,KAAK;IACnB,qBAAqB,EAAE,KAAK;IAC5B,aAAa,EAAE,KAAK;IACpB,gCAAgC,EAAE,KAAK;IACvC,MAAM,EAAE;QACN,MAAM,EAAE;YACN,cAAc,EAAE,8BAAgB,CAAC,WAAW;YAC5C,kBAAkB,EAAE,8BAAgB,CAAC,UAAU;YAC/C,cAAc,EAAE;gBACd,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,EAAE;gBACV,gBAAgB,EAAE,IAAI;aACvB;YACD,QAAQ,EAAE;gBACR,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,IAAI;gBACZ,gBAAgB,EAAE,IAAI;aACvB;YACD,oBAAoB,EAAE;gBACpB,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,QAAQ;gBAChB,gBAAgB,EAAE,IAAI;aACvB;YACD,QAAQ,EAAE;gBACR,cA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CAAC,YAAY,CAAC,MAAM;SACrC;QACD,oBAAoB,EAAE;YACpB,MAAM,EAAE,QAAQ,CAAC,oBAAoB,CAAC,MAAM;YAC5C,MAAM,EAAE,QAAQ,CAAC,oBAAoB,CAAC,MAAM;SAC7C;KACF;CACF,CAAC;AAEF;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,IAAA,mBAAS,EAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AACtC,CAAC;AAFD,4CAEC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,MAAM,EAAE,MAAM,KAAqB,aAAa,EAA7B,WAAW,kBAAK,aAAa,EAA1C,UAA0B,CAAgB,CAAC;IACjD,OAAO,IAAA,mBAAS,EAAC,WAAW,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;AACjE,CAAC;AAHD,4CAGC","sourcesContent":["import deepmerge from \"deepmerge\";\r\n\r\nimport { NameSettings, NamingStrategies } from \"./NamingModel\";\r\nimport { EmitModes, Modes, RunOptions } from \"./OptionModel\";\r\n\r\n/**\r\n * The default configuration.\r\n */\r\nconst defaultConfig: Omit<RunOptions, \"source\" | \"output\"> = {\r\n mode: Modes.all,\r\n emitMode: EmitModes.js_dts,\r\n debug: false,\r\n prettier: false,\r\n tsconfig: \"tsconfig.json\",\r\n converters: [],\r\n skipEditableModels: false,\r\n skipIdModels: false,\r\n skipOperations: false,\r\n skipComments: false,\r\n disableAutoManagedKey: false,\r\n allowRenaming: false,\r\n v2ModelsWithExtraResultsWrapping: false,\r\n naming: {\r\n models: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n propNamingStrategy: NamingStrategies.CAMEL_CASE,\r\n editableModels: {\r\n prefix: \"Editable\",\r\n suffix: \"\",\r\n applyModelNaming: true,\r\n },\r\n idModels: {\r\n prefix: \"\",\r\n suffix: \"Id\",\r\n applyModelNaming: true,\r\n },\r\n operationParamModels: {\r\n prefix: \"\",\r\n suffix: \"Params\",\r\n applyModelNaming: true,\r\n },\r\n fileName: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n prefix: \"\",\r\n suffix: \"Model\",\r\n },\r\n },\r\n queryObjects: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n propNamingStrategy: NamingStrategies.CAMEL_CASE,\r\n prefix: \"Q\",\r\n suffix: \"\",\r\n idFunctions: {\r\n prefix: \"\",\r\n suffix: \"Id\",\r\n },\r\n fileName: {\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n prefix: \"Q\",\r\n suffix: \"\",\r\n },\r\n },\r\n services: {\r\n prefix: \"\",\r\n suffix: \"Service\",\r\n namingStrategy: NamingStrategies.PASCAL_CASE,\r\n main: {\r\n applyServiceNaming: true,\r\n },\r\n collection: {\r\n prefix: \"\",\r\n suffix: \"Collection\",\r\n applyServiceNaming: true,\r\n },\r\n operations: {\r\n namingStrategy: NamingStrategies.CAMEL_CASE,\r\n },\r\n relatedServiceGetter: {\r\n namingStrategy: NamingStrategies.CAMEL_CASE,\r\n prefix: \"\",\r\n suffix: \"\",\r\n },\r\n privateProps: {\r\n namingStrategy: NamingStrategies.CAMEL_CASE,\r\n prefix: \"_\",\r\n suffix: \"\",\r\n },\r\n },\r\n },\r\n propertiesByName: [],\r\n entitiesByName: [],\r\n};\r\n\r\nconst { models, queryObjects, services } = defaultConfig.naming;\r\nconst minimalNamingConfig: NameSettings = {\r\n models: {\r\n fileName: {\r\n prefix: models.fileName.prefix,\r\n suffix: models.fileName.suffix,\r\n },\r\n idModels: {\r\n applyModelNaming: true,\r\n prefix: models.idModels.prefix,\r\n suffix: models.idModels.suffix,\r\n },\r\n editableModels: {\r\n applyModelNaming: true,\r\n prefix: models.editableModels.prefix,\r\n suffix: models.editableModels.suffix,\r\n },\r\n operationParamModels: {\r\n applyModelNaming: true,\r\n prefix: models.operationParamModels.prefix,\r\n suffix: models.operationParamModels.suffix,\r\n },\r\n },\r\n queryObjects: {\r\n prefix: queryObjects.prefix,\r\n suffix: queryObjects.suffix,\r\n fileName: {\r\n prefix: queryObjects.fileName.prefix,\r\n suffix: queryObjects.fileName.suffix,\r\n },\r\n idFunctions: {\r\n prefix: queryObjects.idFunctions.prefix,\r\n suffix: queryObjects.idFunctions.suffix,\r\n },\r\n },\r\n services: {\r\n prefix: services.prefix,\r\n suffix: services.suffix,\r\n main: {\r\n applyServiceNaming: true,\r\n },\r\n collection: {\r\n applyServiceNaming: true,\r\n prefix: services.collection.prefix,\r\n suffix: services.collection.suffix,\r\n },\r\n privateProps: {\r\n prefix: services.privateProps.prefix,\r\n suffix: services.privateProps.suffix,\r\n },\r\n relatedServiceGetter: {\r\n prefix: services.relatedServiceGetter.prefix,\r\n suffix: services.relatedServiceGetter.suffix,\r\n },\r\n },\r\n};\r\n\r\n/**\r\n * Creates a defensive copy of the default config.\r\n */\r\nexport function getDefaultConfig(): Omit<RunOptions, \"source\" | \"output\"> {\r\n return deepmerge(defaultConfig, {});\r\n}\r\n\r\n/**\r\n * Creates a defensive copy of the minimal config: minimal in respect to naming.\r\n */\r\nexport function getMinimalConfig(): Omit<RunOptions, \"source\" | \"output\"> {\r\n const { naming, ...passThrough } = defaultConfig;\r\n return deepmerge(passThrough, { naming: minimalNamingConfig });\r\n}\r\n"]}
|
package/lib/evaluateConfig.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { CliOptions, ConfigFileOptions, RunOptions } from "./OptionModel";
|
|
2
|
-
/**
|
|
3
|
-
* Provides default values and evaluates the various config file and CLI options.
|
|
4
|
-
* This function always returns a list of RunOptions,
|
|
5
|
-
* whereby each item represents one generation run / one service.
|
|
6
|
-
*
|
|
7
|
-
* Configurations are merged in the following order (last one wins):
|
|
8
|
-
* - default values
|
|
9
|
-
* - config file: base settings
|
|
10
|
-
* - config file: service specific settings
|
|
11
|
-
* - CLI options
|
|
12
|
-
*
|
|
13
|
-
* If the CLI options specify source and output, then the service config is completely ignored and only the
|
|
14
|
-
* base settings are applied from the config file.
|
|
15
|
-
*
|
|
16
|
-
* If the CLI options do not specify source and output, but do specify services, then these services must
|
|
17
|
-
* exist in the config file and each service must supply values for source and output as a minimum.
|
|
18
|
-
*
|
|
19
|
-
* If the CLI options neither entail source nor services, then at least one service must be configured in the
|
|
20
|
-
* config file. All configured services are returned.
|
|
21
|
-
*
|
|
22
|
-
* @param cliOpts CLI passed options
|
|
23
|
-
* @param configOpts config file options
|
|
24
|
-
*/
|
|
25
|
-
export declare function evaluateConfigOptions(cliOpts: CliOptions, configOpts: ConfigFileOptions | undefined): Array<RunOptions>;
|
|
1
|
+
import { CliOptions, ConfigFileOptions, RunOptions } from "./OptionModel";
|
|
2
|
+
/**
|
|
3
|
+
* Provides default values and evaluates the various config file and CLI options.
|
|
4
|
+
* This function always returns a list of RunOptions,
|
|
5
|
+
* whereby each item represents one generation run / one service.
|
|
6
|
+
*
|
|
7
|
+
* Configurations are merged in the following order (last one wins):
|
|
8
|
+
* - default values
|
|
9
|
+
* - config file: base settings
|
|
10
|
+
* - config file: service specific settings
|
|
11
|
+
* - CLI options
|
|
12
|
+
*
|
|
13
|
+
* If the CLI options specify source and output, then the service config is completely ignored and only the
|
|
14
|
+
* base settings are applied from the config file.
|
|
15
|
+
*
|
|
16
|
+
* If the CLI options do not specify source and output, but do specify services, then these services must
|
|
17
|
+
* exist in the config file and each service must supply values for source and output as a minimum.
|
|
18
|
+
*
|
|
19
|
+
* If the CLI options neither entail source nor services, then at least one service must be configured in the
|
|
20
|
+
* config file. All configured services are returned.
|
|
21
|
+
*
|
|
22
|
+
* @param cliOpts CLI passed options
|
|
23
|
+
* @param configOpts config file options
|
|
24
|
+
*/
|
|
25
|
+
export declare function evaluateConfigOptions(cliOpts: CliOptions, configOpts: ConfigFileOptions | undefined): Array<RunOptions>;
|