@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.
Files changed (78) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/lib/FactoryFunctionModel.d.ts +13 -13
  3. package/lib/FactoryFunctionModel.js +2 -2
  4. package/lib/FactoryFunctionModel.js.map +1 -1
  5. package/lib/NamingModel.d.ts +182 -182
  6. package/lib/NamingModel.js +11 -11
  7. package/lib/NamingModel.js.map +1 -1
  8. package/lib/OptionModel.d.ts +228 -223
  9. package/lib/OptionModel.js +23 -23
  10. package/lib/OptionModel.js.map +1 -1
  11. package/lib/app.d.ts +8 -8
  12. package/lib/app.js +67 -63
  13. package/lib/app.js.map +1 -1
  14. package/lib/cli.d.ts +3 -3
  15. package/lib/cli.js +153 -153
  16. package/lib/data-model/DataModel.d.ts +88 -85
  17. package/lib/data-model/DataModel.js +141 -134
  18. package/lib/data-model/DataModel.js.map +1 -1
  19. package/lib/data-model/DataModelDigestion.d.ts +48 -44
  20. package/lib/data-model/DataModelDigestion.js +299 -274
  21. package/lib/data-model/DataModelDigestion.js.map +1 -1
  22. package/lib/data-model/DataModelDigestionV2.d.ts +10 -10
  23. package/lib/data-model/DataModelDigestionV2.js +210 -200
  24. package/lib/data-model/DataModelDigestionV2.js.map +1 -1
  25. package/lib/data-model/DataModelDigestionV4.d.ts +3 -3
  26. package/lib/data-model/DataModelDigestionV4.js +197 -195
  27. package/lib/data-model/DataModelDigestionV4.js.map +1 -1
  28. package/lib/data-model/DataTypeModel.d.ts +102 -102
  29. package/lib/data-model/DataTypeModel.js +8 -8
  30. package/lib/data-model/DataTypeModel.js.map +1 -1
  31. package/lib/data-model/NamingHelper.d.ts +57 -55
  32. package/lib/data-model/NamingHelper.js +231 -214
  33. package/lib/data-model/NamingHelper.js.map +1 -1
  34. package/lib/data-model/ServiceConfigHelper.d.ts +21 -21
  35. package/lib/data-model/ServiceConfigHelper.js +113 -113
  36. package/lib/data-model/edmx/ODataEdmxModelBase.d.ts +92 -80
  37. package/lib/data-model/edmx/ODataEdmxModelBase.js +2 -2
  38. package/lib/data-model/edmx/ODataEdmxModelBase.js.map +1 -1
  39. package/lib/data-model/edmx/ODataEdmxModelV3.d.ts +63 -63
  40. package/lib/data-model/edmx/ODataEdmxModelV3.js +2 -2
  41. package/lib/data-model/edmx/ODataEdmxModelV4.d.ts +67 -67
  42. package/lib/data-model/edmx/ODataEdmxModelV4.js +2 -2
  43. package/lib/defaultConfig.d.ts +9 -9
  44. package/lib/defaultConfig.js +165 -164
  45. package/lib/defaultConfig.js.map +1 -1
  46. package/lib/evaluateConfig.d.ts +25 -25
  47. package/lib/evaluateConfig.js +82 -82
  48. package/lib/generator/ImportContainer.d.ts +16 -16
  49. package/lib/generator/ImportContainer.js +91 -91
  50. package/lib/generator/ModelGenerator.d.ts +2 -2
  51. package/lib/generator/ModelGenerator.js +211 -183
  52. package/lib/generator/ModelGenerator.js.map +1 -1
  53. package/lib/generator/QueryObjectGenerator.d.ts +2 -2
  54. package/lib/generator/QueryObjectGenerator.js +239 -239
  55. package/lib/generator/ServiceGenerator.d.ts +8 -8
  56. package/lib/generator/ServiceGenerator.js +422 -422
  57. package/lib/generator/index.d.ts +3 -3
  58. package/lib/generator/index.js +9 -9
  59. package/lib/index.d.ts +3 -3
  60. package/lib/index.js +6 -6
  61. package/lib/project/ProjectManager.d.ts +30 -30
  62. package/lib/project/ProjectManager.js +177 -175
  63. package/lib/project/ProjectManager.js.map +1 -1
  64. package/lib/project/formatter/BaseFormatter.d.ts +49 -49
  65. package/lib/project/formatter/BaseFormatter.js +30 -30
  66. package/lib/project/formatter/FileFormatter.d.ts +16 -16
  67. package/lib/project/formatter/FileFormatter.js +2 -2
  68. package/lib/project/formatter/NoopFormatter.d.ts +29 -29
  69. package/lib/project/formatter/NoopFormatter.js +42 -42
  70. package/lib/project/formatter/PrettierFormatter.d.ts +46 -46
  71. package/lib/project/formatter/PrettierFormatter.js +92 -92
  72. package/lib/project/formatter/index.d.ts +2 -2
  73. package/lib/project/formatter/index.js +14 -14
  74. package/lib/project/logger/logFilePath.d.ts +1 -1
  75. package/lib/project/logger/logFilePath.js +12 -12
  76. package/lib/run-cli.d.ts +2 -2
  77. package/lib/run-cli.js +6 -6
  78. package/package.json +27 -28
@@ -1,85 +1,88 @@
1
- import { MappedConverterChains } from "@odata2ts/converter-runtime";
2
- import { ODataTypesV2, ODataTypesV4 } from "@odata2ts/odata-core";
3
- import { ActionImportType, ComplexType, EntityContainerModel, EntitySetType, EnumType, FunctionImportType, ModelType, ODataVersion, OperationType, SingletonType } from "./DataTypeModel";
4
- export interface ProjectFiles {
5
- model: string;
6
- qObject: string;
7
- service: string;
8
- }
9
- export declare class DataModel {
10
- private version;
11
- private readonly converters;
12
- private modelTypes;
13
- private complexTypes;
14
- private enumTypes;
15
- private operationTypes;
16
- private container;
17
- constructor(version: ODataVersion, converters?: MappedConverterChains);
18
- /**
19
- * OData version: 2.0 or 4.0.
20
- * @returns
21
- */
22
- getODataVersion(): ODataVersion;
23
- isV2(): boolean;
24
- isV4(): boolean;
25
- addModel(name: string, model: ModelType): void;
26
- /**
27
- * Get a specific model by its name.
28
- *
29
- * @param modelName the final model name that is generated
30
- * @returns the model type
31
- */
32
- getModel(modelName: string): ModelType;
33
- /**
34
- * Retrieve all known EntityType models from the EDMX model.
35
- *
36
- * @returns list of model types
37
- */
38
- getModels(): ModelType[];
39
- /**
40
- * Set all model entity types
41
- *
42
- * @param models new model types
43
- */
44
- setModels(models: {
45
- [name: string]: ModelType;
46
- }): void;
47
- addComplexType(name: string, model: ComplexType): void;
48
- /**
49
- * Get a specific model by its name.
50
- *
51
- * @param name the final model name that is generated
52
- * @returns the model type
53
- */
54
- getComplexType(name: string): ComplexType;
55
- /**
56
- * Retrieve all known ComplexType models from the EDMX model.
57
- *
58
- * @returns list of model types
59
- */
60
- getComplexTypes(): ComplexType[];
61
- /**
62
- * Set all complex types
63
- *
64
- * @param models new complex types
65
- */
66
- setComplexTypes(complexTypes: {
67
- [name: string]: ComplexType;
68
- }): void;
69
- addEnum(name: string, type: EnumType): void;
70
- /**
71
- * Get list of all known enums, i.e. EnumType nodes from the EDMX model.
72
- * @returns list of enum types
73
- */
74
- getEnums(): EnumType[];
75
- addOperationType(binding: string, operationType: OperationType): void;
76
- getUnboundOperationTypes(): Array<OperationType>;
77
- getOperationTypeByBinding(binding: string): Array<OperationType>;
78
- getOperationTypeByEntityOrCollectionBinding(binding: string): Array<OperationType>;
79
- addAction(name: string, action: ActionImportType): void;
80
- addFunction(name: string, func: FunctionImportType): void;
81
- addSingleton(name: string, singleton: SingletonType): void;
82
- addEntitySet(name: string, entitySet: EntitySetType): void;
83
- getEntityContainer(): EntityContainerModel;
84
- getConverter(dataType: ODataTypesV2 | ODataTypesV4 | string): import("@odata2ts/converter-runtime").ValueConverterChain | undefined;
85
- }
1
+ import { MappedConverterChains } from "@odata2ts/converter-runtime";
2
+ import { ODataTypesV2, ODataTypesV4 } from "@odata2ts/odata-core";
3
+ import { ActionImportType, ComplexType, EntityContainerModel, EntitySetType, EnumType, FunctionImportType, ModelType, ODataVersion, OperationType, SingletonType } from "./DataTypeModel";
4
+ export interface ProjectFiles {
5
+ model: string;
6
+ qObject: string;
7
+ service: string;
8
+ }
9
+ export declare class DataModel {
10
+ private version;
11
+ private readonly converters;
12
+ private modelTypes;
13
+ private complexTypes;
14
+ private enumTypes;
15
+ private operationTypes;
16
+ private typeDefinitions;
17
+ private container;
18
+ constructor(version: ODataVersion, converters?: MappedConverterChains);
19
+ /**
20
+ * OData version: 2.0 or 4.0.
21
+ * @returns
22
+ */
23
+ getODataVersion(): ODataVersion;
24
+ isV2(): boolean;
25
+ isV4(): boolean;
26
+ addTypeDefinition(name: string, type: string): void;
27
+ getPrimitiveType(name: string): string | undefined;
28
+ addModel(name: string, model: ModelType): void;
29
+ /**
30
+ * Get a specific model by its name.
31
+ *
32
+ * @param modelName the final model name that is generated
33
+ * @returns the model type
34
+ */
35
+ getModel(modelName: string): ModelType;
36
+ /**
37
+ * Retrieve all known EntityType models from the EDMX model.
38
+ *
39
+ * @returns list of model types
40
+ */
41
+ getModels(): ModelType[];
42
+ /**
43
+ * Set all model entity types
44
+ *
45
+ * @param models new model types
46
+ */
47
+ setModels(models: {
48
+ [name: string]: ModelType;
49
+ }): void;
50
+ addComplexType(name: string, model: ComplexType): void;
51
+ /**
52
+ * Get a specific model by its name.
53
+ *
54
+ * @param name the final model name that is generated
55
+ * @returns the model type
56
+ */
57
+ getComplexType(name: string): ComplexType;
58
+ /**
59
+ * Retrieve all known ComplexType models from the EDMX model.
60
+ *
61
+ * @returns list of model types
62
+ */
63
+ getComplexTypes(): ComplexType[];
64
+ /**
65
+ * Set all complex types
66
+ *
67
+ * @param models new complex types
68
+ */
69
+ setComplexTypes(complexTypes: {
70
+ [name: string]: ComplexType;
71
+ }): void;
72
+ addEnum(name: string, type: EnumType): void;
73
+ /**
74
+ * Get list of all known enums, i.e. EnumType nodes from the EDMX model.
75
+ * @returns list of enum types
76
+ */
77
+ getEnums(): EnumType[];
78
+ addOperationType(binding: string, operationType: OperationType): void;
79
+ getUnboundOperationTypes(): Array<OperationType>;
80
+ getOperationTypeByBinding(binding: string): Array<OperationType>;
81
+ getOperationTypeByEntityOrCollectionBinding(binding: string): Array<OperationType>;
82
+ addAction(name: string, action: ActionImportType): void;
83
+ addFunction(name: string, func: FunctionImportType): void;
84
+ addSingleton(name: string, singleton: SingletonType): void;
85
+ addEntitySet(name: string, entitySet: EntitySetType): void;
86
+ getEntityContainer(): EntityContainerModel;
87
+ getConverter(dataType: ODataTypesV2 | ODataTypesV4 | string): import("@odata2ts/converter-runtime").ValueConverterChain | undefined;
88
+ }
@@ -1,135 +1,142 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataModel = void 0;
4
- const DataTypeModel_1 = require("./DataTypeModel");
5
- const ROOT_OPERATION_BINDING = "/";
6
- class DataModel {
7
- constructor(version, converters = new Map()) {
8
- this.version = version;
9
- this.modelTypes = {};
10
- this.complexTypes = {};
11
- this.enumTypes = {};
12
- // combines functions & actions
13
- this.operationTypes = {};
14
- this.container = { entitySets: {}, singletons: {}, functions: {}, actions: {} };
15
- this.converters = converters;
16
- }
17
- /**
18
- * OData version: 2.0 or 4.0.
19
- * @returns
20
- */
21
- getODataVersion() {
22
- return this.version;
23
- }
24
- isV2() {
25
- return this.version === DataTypeModel_1.ODataVersion.V2;
26
- }
27
- isV4() {
28
- return this.version === DataTypeModel_1.ODataVersion.V4;
29
- }
30
- addModel(name, model) {
31
- this.modelTypes[name] = model;
32
- }
33
- /**
34
- * Get a specific model by its name.
35
- *
36
- * @param modelName the final model name that is generated
37
- * @returns the model type
38
- */
39
- getModel(modelName) {
40
- return this.modelTypes[modelName];
41
- }
42
- /**
43
- * Retrieve all known EntityType models from the EDMX model.
44
- *
45
- * @returns list of model types
46
- */
47
- getModels() {
48
- return Object.values(this.modelTypes);
49
- }
50
- /**
51
- * Set all model entity types
52
- *
53
- * @param models new model types
54
- */
55
- setModels(models) {
56
- this.modelTypes = models;
57
- }
58
- addComplexType(name, model) {
59
- this.complexTypes[name] = model;
60
- }
61
- /**
62
- * Get a specific model by its name.
63
- *
64
- * @param name the final model name that is generated
65
- * @returns the model type
66
- */
67
- getComplexType(name) {
68
- return this.complexTypes[name];
69
- }
70
- /**
71
- * Retrieve all known ComplexType models from the EDMX model.
72
- *
73
- * @returns list of model types
74
- */
75
- getComplexTypes() {
76
- return Object.values(this.complexTypes);
77
- }
78
- /**
79
- * Set all complex types
80
- *
81
- * @param models new complex types
82
- */
83
- setComplexTypes(complexTypes) {
84
- this.complexTypes = complexTypes;
85
- }
86
- addEnum(name, type) {
87
- this.enumTypes[name] = type;
88
- }
89
- /**
90
- * Get list of all known enums, i.e. EnumType nodes from the EDMX model.
91
- * @returns list of enum types
92
- */
93
- getEnums() {
94
- return Object.values(this.enumTypes);
95
- }
96
- addOperationType(binding, operationType) {
97
- if (!this.operationTypes[binding]) {
98
- this.operationTypes[binding] = [];
99
- }
100
- this.operationTypes[binding].push(operationType);
101
- }
102
- getUnboundOperationTypes() {
103
- const operations = this.operationTypes[ROOT_OPERATION_BINDING];
104
- return !operations ? [] : [...operations];
105
- }
106
- getOperationTypeByBinding(binding) {
107
- const operations = this.operationTypes[binding];
108
- return !operations ? [] : [...operations];
109
- }
110
- getOperationTypeByEntityOrCollectionBinding(binding) {
111
- const entityOps = this.operationTypes[binding] || [];
112
- const collOps = this.operationTypes[`Collection(${binding})`] || [];
113
- return [...collOps, ...entityOps];
114
- }
115
- addAction(name, action) {
116
- this.container.actions[name] = action;
117
- }
118
- addFunction(name, func) {
119
- this.container.functions[name] = func;
120
- }
121
- addSingleton(name, singleton) {
122
- this.container.singletons[name] = singleton;
123
- }
124
- addEntitySet(name, entitySet) {
125
- this.container.entitySets[name] = entitySet;
126
- }
127
- getEntityContainer() {
128
- return this.container;
129
- }
130
- getConverter(dataType) {
131
- return this.converters.get(dataType);
132
- }
133
- }
134
- exports.DataModel = DataModel;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataModel = void 0;
4
+ const DataTypeModel_1 = require("./DataTypeModel");
5
+ const ROOT_OPERATION_BINDING = "/";
6
+ class DataModel {
7
+ constructor(version, converters = new Map()) {
8
+ this.version = version;
9
+ this.modelTypes = {};
10
+ this.complexTypes = {};
11
+ this.enumTypes = {};
12
+ // combines functions & actions
13
+ this.operationTypes = {};
14
+ this.typeDefinitions = {};
15
+ this.container = { entitySets: {}, singletons: {}, functions: {}, actions: {} };
16
+ this.converters = converters;
17
+ }
18
+ /**
19
+ * OData version: 2.0 or 4.0.
20
+ * @returns
21
+ */
22
+ getODataVersion() {
23
+ return this.version;
24
+ }
25
+ isV2() {
26
+ return this.version === DataTypeModel_1.ODataVersion.V2;
27
+ }
28
+ isV4() {
29
+ return this.version === DataTypeModel_1.ODataVersion.V4;
30
+ }
31
+ addTypeDefinition(name, type) {
32
+ this.typeDefinitions[name] = type;
33
+ }
34
+ getPrimitiveType(name) {
35
+ return this.typeDefinitions[name];
36
+ }
37
+ addModel(name, model) {
38
+ this.modelTypes[name] = model;
39
+ }
40
+ /**
41
+ * Get a specific model by its name.
42
+ *
43
+ * @param modelName the final model name that is generated
44
+ * @returns the model type
45
+ */
46
+ getModel(modelName) {
47
+ return this.modelTypes[modelName];
48
+ }
49
+ /**
50
+ * Retrieve all known EntityType models from the EDMX model.
51
+ *
52
+ * @returns list of model types
53
+ */
54
+ getModels() {
55
+ return Object.values(this.modelTypes);
56
+ }
57
+ /**
58
+ * Set all model entity types
59
+ *
60
+ * @param models new model types
61
+ */
62
+ setModels(models) {
63
+ this.modelTypes = models;
64
+ }
65
+ addComplexType(name, model) {
66
+ this.complexTypes[name] = model;
67
+ }
68
+ /**
69
+ * Get a specific model by its name.
70
+ *
71
+ * @param name the final model name that is generated
72
+ * @returns the model type
73
+ */
74
+ getComplexType(name) {
75
+ return this.complexTypes[name];
76
+ }
77
+ /**
78
+ * Retrieve all known ComplexType models from the EDMX model.
79
+ *
80
+ * @returns list of model types
81
+ */
82
+ getComplexTypes() {
83
+ return Object.values(this.complexTypes);
84
+ }
85
+ /**
86
+ * Set all complex types
87
+ *
88
+ * @param models new complex types
89
+ */
90
+ setComplexTypes(complexTypes) {
91
+ this.complexTypes = complexTypes;
92
+ }
93
+ addEnum(name, type) {
94
+ this.enumTypes[name] = type;
95
+ }
96
+ /**
97
+ * Get list of all known enums, i.e. EnumType nodes from the EDMX model.
98
+ * @returns list of enum types
99
+ */
100
+ getEnums() {
101
+ return Object.values(this.enumTypes);
102
+ }
103
+ addOperationType(binding, operationType) {
104
+ if (!this.operationTypes[binding]) {
105
+ this.operationTypes[binding] = [];
106
+ }
107
+ this.operationTypes[binding].push(operationType);
108
+ }
109
+ getUnboundOperationTypes() {
110
+ const operations = this.operationTypes[ROOT_OPERATION_BINDING];
111
+ return !operations ? [] : [...operations];
112
+ }
113
+ getOperationTypeByBinding(binding) {
114
+ const operations = this.operationTypes[binding];
115
+ return !operations ? [] : [...operations];
116
+ }
117
+ getOperationTypeByEntityOrCollectionBinding(binding) {
118
+ const entityOps = this.operationTypes[binding] || [];
119
+ const collOps = this.operationTypes[`Collection(${binding})`] || [];
120
+ return [...collOps, ...entityOps];
121
+ }
122
+ addAction(name, action) {
123
+ this.container.actions[name] = action;
124
+ }
125
+ addFunction(name, func) {
126
+ this.container.functions[name] = func;
127
+ }
128
+ addSingleton(name, singleton) {
129
+ this.container.singletons[name] = singleton;
130
+ }
131
+ addEntitySet(name, entitySet) {
132
+ this.container.entitySets[name] = entitySet;
133
+ }
134
+ getEntityContainer() {
135
+ return this.container;
136
+ }
137
+ getConverter(dataType) {
138
+ return this.converters.get(dataType);
139
+ }
140
+ }
141
+ exports.DataModel = DataModel;
135
142
  //# sourceMappingURL=DataModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataModel.js","sourceRoot":"","sources":["../../src/data-model/DataModel.ts"],"names":[],"mappings":";;;AAGA,mDAWyB;AAQzB,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC,MAAa,SAAS;IAUpB,YAAoB,OAAqB,EAAE,aAAoC,IAAI,GAAG,EAAE;QAApE,YAAO,GAAP,OAAO,CAAc;QAPjC,eAAU,GAAkC,EAAE,CAAC;QAC/C,iBAAY,GAAoC,EAAE,CAAC;QACnD,cAAS,GAAiC,EAAE,CAAC;QACrD,+BAA+B;QACvB,mBAAc,GAAgD,EAAE,CAAC;QACjE,cAAS,GAAyB,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAGvG,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACI,eAAe;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,O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M,YAAY,CAAC,IAAY,EAAE,SAAwB;QACxD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,YAAY,CAAC,QAA8C;QAChE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF;AAzJD,8BAyJC","sourcesContent":["import { MappedConverterChains } from \"@odata2ts/converter-runtime\";\r\nimport { ODataTypesV2, ODataTypesV4 } from \"@odata2ts/odata-core\";\r\n\r\nimport {\r\n ActionImportType,\r\n ComplexType,\r\n EntityContainerModel,\r\n EntitySetType,\r\n EnumType,\r\n FunctionImportType,\r\n ModelType,\r\n ODataVersion,\r\n OperationType,\r\n SingletonType,\r\n} from \"./DataTypeModel\";\r\n\r\nexport interface ProjectFiles {\r\n model: string;\r\n qObject: string;\r\n service: string;\r\n}\r\n\r\nconst ROOT_OPERATION_BINDING = \"/\";\r\n\r\nexport class DataModel {\r\n private readonly converters: MappedConverterChains;\r\n\r\n private modelTypes: { [name: string]: ModelType } = {};\r\n private complexTypes: { [name: string]: ComplexType } = {};\r\n private enumTypes: { [name: string]: EnumType } = {};\r\n // combines functions & actions\r\n private operationTypes: { [binding: string]: Array<OperationType> } = {};\r\n private container: EntityContainerModel = { entitySets: {}, singletons: {}, functions: {}, actions: {} };\r\n\r\n constructor(private version: ODataVersion, converters: MappedConverterChains = new Map()) {\r\n this.converters = converters;\r\n }\r\n\r\n /**\r\n * OData version: 2.0 or 4.0.\r\n * @returns\r\n */\r\n public getODataVersion() {\r\n return this.version;\r\n }\r\n\r\n public isV2() {\r\n return this.version === ODataVersion.V2;\r\n }\r\n\r\n public isV4() {\r\n return this.version === ODataVersion.V4;\r\n }\r\n\r\n public addModel(name: string, model: ModelType) {\r\n this.modelTypes[name] = model;\r\n }\r\n\r\n /**\r\n * Get a specific model by its name.\r\n *\r\n * @param modelName the final model name that is generated\r\n * @returns the model type\r\n */\r\n public getModel(modelName: string) {\r\n return this.modelTypes[modelName];\r\n }\r\n\r\n /**\r\n * Retrieve all known EntityType models from the EDMX model.\r\n *\r\n * @returns list of model types\r\n */\r\n public getModels() {\r\n return Object.values(this.modelTypes);\r\n }\r\n\r\n /**\r\n * Set all model entity types\r\n *\r\n * @param models new model types\r\n */\r\n public setModels(models: { [name: string]: ModelType }) {\r\n this.modelTypes = models;\r\n }\r\n\r\n public addComplexType(name: string, model: ComplexType) {\r\n this.complexTypes[name] = model;\r\n }\r\n\r\n /**\r\n * Get a specific model by its name.\r\n *\r\n * @param name the final model name that is generated\r\n * @returns the model type\r\n */\r\n public getComplexType(name: string) {\r\n return this.complexTypes[name];\r\n }\r\n\r\n /**\r\n * Retrieve all known ComplexType models from the EDMX model.\r\n *\r\n * @returns list of model types\r\n */\r\n public getComplexTypes() {\r\n return Object.values(this.complexTypes);\r\n }\r\n\r\n /**\r\n * Set all complex types\r\n *\r\n * @param models new complex types\r\n */\r\n public setComplexTypes(complexTypes: { [name: string]: ComplexType }) {\r\n this.complexTypes = complexTypes;\r\n }\r\n\r\n public addEnum(name: string, type: EnumType) {\r\n this.enumTypes[name] = type;\r\n }\r\n\r\n /**\r\n * Get list of all known enums, i.e. EnumType nodes from the EDMX model.\r\n * @returns list of enum types\r\n */\r\n public getEnums() {\r\n return Object.values(this.enumTypes);\r\n }\r\n\r\n public addOperationType(binding: string, operationType: OperationType) {\r\n if (!this.operationTypes[binding]) {\r\n this.operationTypes[binding] = [];\r\n }\r\n\r\n this.operationTypes[binding].push(operationType);\r\n }\r\n\r\n public getUnboundOperationTypes(): Array<OperationType> {\r\n const operations = this.operationTypes[ROOT_OPERATION_BINDING];\r\n return !operations ? [] : [...operations];\r\n }\r\n\r\n public getOperationTypeByBinding(binding: string): Array<OperationType> {\r\n const operations = this.operationTypes[binding];\r\n return !operations ? [] : [...operations];\r\n }\r\n\r\n public getOperationTypeByEntityOrCollectionBinding(binding: string): Array<OperationType> {\r\n const entityOps = this.operationTypes[binding] || [];\r\n const collOps = this.operationTypes[`Collection(${binding})`] || [];\r\n return [...collOps, ...entityOps];\r\n }\r\n\r\n public addAction(name: string, action: ActionImportType) {\r\n this.container.actions[name] = action;\r\n }\r\n\r\n public addFunction(name: string, func: FunctionImportType) {\r\n this.container.functions[name] = func;\r\n }\r\n\r\n public addSingleton(name: string, singleton: SingletonType) {\r\n this.container.singletons[name] = singleton;\r\n }\r\n\r\n public addEntitySet(name: string, entitySet: EntitySetType) {\r\n this.container.entitySets[name] = entitySet;\r\n }\r\n\r\n public getEntityContainer() {\r\n return this.container;\r\n }\r\n\r\n public getConverter(dataType: ODataTypesV2 | ODataTypesV4 | string) {\r\n return this.converters.get(dataType);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"DataModel.js","sourceRoot":"","sources":["../../src/data-model/DataModel.ts"],"names":[],"mappings":";;;AAGA,mDAWyB;AAQzB,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC,MAAa,SAAS;IAWpB,YAAoB,OAAqB,EAAE,aAAoC,IAAI,GAAG,EAAE;QAApE,YAAO,GAAP,OAAO,CAAc;QARjC,eAAU,GAAkC,EAAE,CAAC;QAC/C,iBAAY,GAAoC,EAAE,CAAC;QACnD,cAAS,GAAiC,EAAE,CAAC;QACrD,+BAA+B;QACvB,mBAAc,GAAgD,EAAE,CAAC;QACjE,oBAAe,GAA+B,EAAE,CAAC;QACjD,cAAS,GAAyB,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAGvG,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACI,eAAe;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,IAAI;QACT,OAAO,IAAI,CAAC,OAAO,KAAK,4BA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S,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,CAAC;IAEM,YAAY,CAAC,IAAY,EAAE,SAAwB;QACxD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,CAAC;IAEM,YAAY,CAAC,IAAY,EAAE,SAAwB;QACxD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC9C,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAEM,YAAY,CAAC,QAA8C;QAChE,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACF;AAlKD,8BAkKC","sourcesContent":["import { MappedConverterChains } from \"@odata2ts/converter-runtime\";\r\nimport { ODataTypesV2, ODataTypesV4 } from \"@odata2ts/odata-core\";\r\n\r\nimport {\r\n ActionImportType,\r\n ComplexType,\r\n EntityContainerModel,\r\n EntitySetType,\r\n EnumType,\r\n FunctionImportType,\r\n ModelType,\r\n ODataVersion,\r\n OperationType,\r\n SingletonType,\r\n} from \"./DataTypeModel\";\r\n\r\nexport interface ProjectFiles {\r\n model: string;\r\n qObject: string;\r\n service: string;\r\n}\r\n\r\nconst ROOT_OPERATION_BINDING = \"/\";\r\n\r\nexport class DataModel {\r\n private readonly converters: MappedConverterChains;\r\n\r\n private modelTypes: { [name: string]: ModelType } = {};\r\n private complexTypes: { [name: string]: ComplexType } = {};\r\n private enumTypes: { [name: string]: EnumType } = {};\r\n // combines functions & actions\r\n private operationTypes: { [binding: string]: Array<OperationType> } = {};\r\n private typeDefinitions: { [name: string]: string } = {};\r\n private container: EntityContainerModel = { entitySets: {}, singletons: {}, functions: {}, actions: {} };\r\n\r\n constructor(private version: ODataVersion, converters: MappedConverterChains = new Map()) {\r\n this.converters = converters;\r\n }\r\n\r\n /**\r\n * OData version: 2.0 or 4.0.\r\n * @returns\r\n */\r\n public getODataVersion() {\r\n return this.version;\r\n }\r\n\r\n public isV2() {\r\n return this.version === ODataVersion.V2;\r\n }\r\n\r\n public isV4() {\r\n return this.version === ODataVersion.V4;\r\n }\r\n\r\n public addTypeDefinition(name: string, type: string) {\r\n this.typeDefinitions[name] = type;\r\n }\r\n\r\n public getPrimitiveType(name: string): string | undefined {\r\n return this.typeDefinitions[name];\r\n }\r\n\r\n public addModel(name: string, model: ModelType) {\r\n this.modelTypes[name] = model;\r\n }\r\n\r\n /**\r\n * Get a specific model by its name.\r\n *\r\n * @param modelName the final model name that is generated\r\n * @returns the model type\r\n */\r\n public getModel(modelName: string) {\r\n return this.modelTypes[modelName];\r\n }\r\n\r\n /**\r\n * Retrieve all known EntityType models from the EDMX model.\r\n *\r\n * @returns list of model types\r\n */\r\n public getModels() {\r\n return Object.values(this.modelTypes);\r\n }\r\n\r\n /**\r\n * Set all model entity types\r\n *\r\n * @param models new model types\r\n */\r\n public setModels(models: { [name: string]: ModelType }) {\r\n this.modelTypes = models;\r\n }\r\n\r\n public addComplexType(name: string, model: ComplexType) {\r\n this.complexTypes[name] = model;\r\n }\r\n\r\n /**\r\n * Get a specific model by its name.\r\n *\r\n * @param name the final model name that is generated\r\n * @returns the model type\r\n */\r\n public getComplexType(name: string) {\r\n return this.complexTypes[name];\r\n }\r\n\r\n /**\r\n * Retrieve all known ComplexType models from the EDMX model.\r\n *\r\n * @returns list of model types\r\n */\r\n public getComplexTypes() {\r\n return Object.values(this.complexTypes);\r\n }\r\n\r\n /**\r\n * Set all complex types\r\n *\r\n * @param models new complex types\r\n */\r\n public setComplexTypes(complexTypes: { [name: string]: ComplexType }) {\r\n this.complexTypes = complexTypes;\r\n }\r\n\r\n public addEnum(name: string, type: EnumType) {\r\n this.enumTypes[name] = type;\r\n }\r\n\r\n /**\r\n * Get list of all known enums, i.e. EnumType nodes from the EDMX model.\r\n * @returns list of enum types\r\n */\r\n public getEnums() {\r\n return Object.values(this.enumTypes);\r\n }\r\n\r\n public addOperationType(binding: string, operationType: OperationType) {\r\n if (!this.operationTypes[binding]) {\r\n this.operationTypes[binding] = [];\r\n }\r\n\r\n this.operationTypes[binding].push(operationType);\r\n }\r\n\r\n public getUnboundOperationTypes(): Array<OperationType> {\r\n const operations = this.operationTypes[ROOT_OPERATION_BINDING];\r\n return !operations ? [] : [...operations];\r\n }\r\n\r\n public getOperationTypeByBinding(binding: string): Array<OperationType> {\r\n const operations = this.operationTypes[binding];\r\n return !operations ? [] : [...operations];\r\n }\r\n\r\n public getOperationTypeByEntityOrCollectionBinding(binding: string): Array<OperationType> {\r\n const entityOps = this.operationTypes[binding] || [];\r\n const collOps = this.operationTypes[`Collection(${binding})`] || [];\r\n return [...collOps, ...entityOps];\r\n }\r\n\r\n public addAction(name: string, action: ActionImportType) {\r\n this.container.actions[name] = action;\r\n }\r\n\r\n public addFunction(name: string, func: FunctionImportType) {\r\n this.container.functions[name] = func;\r\n }\r\n\r\n public addSingleton(name: string, singleton: SingletonType) {\r\n this.container.singletons[name] = singleton;\r\n }\r\n\r\n public addEntitySet(name: string, entitySet: EntitySetType) {\r\n this.container.entitySets[name] = entitySet;\r\n }\r\n\r\n public getEntityContainer() {\r\n return this.container;\r\n }\r\n\r\n public getConverter(dataType: ODataTypesV2 | ODataTypesV4 | string) {\r\n return this.converters.get(dataType);\r\n }\r\n}\r\n"]}
@@ -1,44 +1,48 @@
1
- import { MappedConverterChains } from "@odata2ts/converter-runtime";
2
- import { DigestionOptions } from "../FactoryFunctionModel";
3
- import { DataModel } from "./DataModel";
4
- import { ODataVersion, PropertyModel } from "./DataTypeModel";
5
- import { ComplexType, EntityType, Property, Schema } from "./edmx/ODataEdmxModelBase";
6
- import { NamingHelper } from "./NamingHelper";
7
- import { ServiceConfigHelper } from "./ServiceConfigHelper";
8
- export interface TypeModel {
9
- outputType: string;
10
- qPath: string;
11
- qCollection: string;
12
- qParam: string | undefined;
13
- }
14
- export declare abstract class Digester<S extends Schema<ET, CT>, ET extends EntityType, CT extends ComplexType> {
15
- protected version: ODataVersion;
16
- protected schema: S;
17
- protected options: DigestionOptions;
18
- protected namingHelper: NamingHelper;
19
- protected static EDM_PREFIX: string;
20
- protected static ROOT_OPERATION: string;
21
- protected readonly dataModel: DataModel;
22
- protected readonly serviceConfigHelper: ServiceConfigHelper;
23
- private model2Type;
24
- protected constructor(version: ODataVersion, schema: S, options: DigestionOptions, namingHelper: NamingHelper, converters?: MappedConverterChains);
25
- protected abstract getNavigationProps(entityType: ET | ComplexType): Array<Property>;
26
- protected abstract digestEntityContainer(): void;
27
- /**
28
- * Get essential infos about a given odata type from the version specific service variants.
29
- *
30
- * @param type
31
- * @return tuple of return type, query object, query collection object
32
- */
33
- protected abstract mapODataType(type: string): TypeModel;
34
- digest(): Promise<DataModel>;
35
- private collectModelTypes;
36
- private digestSchema;
37
- private getBaseModel;
38
- private addComplexType;
39
- private addEntityType;
40
- private postProcessModel;
41
- private sortModelsByInheritance;
42
- private collectBaseClassPropsAndKeys;
43
- protected mapProp: (p: Property) => PropertyModel;
44
- }
1
+ import { MappedConverterChains } from "@odata2ts/converter-runtime";
2
+ import { DigestionOptions } from "../FactoryFunctionModel";
3
+ import { DataModel } from "./DataModel";
4
+ import { ODataVersion, PropertyModel } from "./DataTypeModel";
5
+ import { ComplexType, EntityType, Property, Schema } from "./edmx/ODataEdmxModelBase";
6
+ import { SchemaV3 } from "./edmx/ODataEdmxModelV3";
7
+ import { SchemaV4 } from "./edmx/ODataEdmxModelV4";
8
+ import { NamingHelper } from "./NamingHelper";
9
+ import { ServiceConfigHelper } from "./ServiceConfigHelper";
10
+ export interface TypeModel {
11
+ outputType: string;
12
+ qPath: string;
13
+ qCollection: string;
14
+ qParam: string | undefined;
15
+ }
16
+ export declare abstract class Digester<S extends Schema<ET, CT>, ET extends EntityType, CT extends ComplexType> {
17
+ protected version: ODataVersion;
18
+ protected schemas: Array<S>;
19
+ protected options: DigestionOptions;
20
+ protected namingHelper: NamingHelper;
21
+ protected static EDM_PREFIX: string;
22
+ protected static ROOT_OPERATION: string;
23
+ protected readonly dataModel: DataModel;
24
+ protected readonly serviceConfigHelper: ServiceConfigHelper;
25
+ private model2Type;
26
+ protected constructor(version: ODataVersion, schemas: Array<S>, options: DigestionOptions, namingHelper: NamingHelper, converters?: MappedConverterChains);
27
+ protected abstract getNavigationProps(entityType: ET | ComplexType): Array<Property>;
28
+ protected abstract digestOperations(schema: SchemaV3 | SchemaV4): void;
29
+ protected abstract digestEntityContainer(schema: SchemaV3 | SchemaV4): void;
30
+ /**
31
+ * Get essential infos about a given odata type from the version specific service variants.
32
+ *
33
+ * @param type
34
+ * @return tuple of return type, query object, query collection object
35
+ */
36
+ protected abstract mapODataType(type: string): TypeModel;
37
+ digest(): Promise<DataModel>;
38
+ private collectModelTypes;
39
+ private digestEntityTypesAndOperations;
40
+ private getBaseModel;
41
+ private addTypeDefinition;
42
+ private addComplexType;
43
+ private addEntityType;
44
+ private postProcessModel;
45
+ private sortModelsByInheritance;
46
+ private collectBaseClassPropsAndKeys;
47
+ protected mapProp: (p: Property) => PropertyModel;
48
+ }