@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,102 +1,102 @@
|
|
|
1
|
-
import { ValueConverterImport } from "@odata2ts/converter-runtime";
|
|
2
|
-
export declare enum ODataVersion {
|
|
3
|
-
V2 = "2.0",
|
|
4
|
-
V4 = "4.0"
|
|
5
|
-
}
|
|
6
|
-
export declare const enum DataTypes {
|
|
7
|
-
PrimitiveType = "PrimitiveType",
|
|
8
|
-
EnumType = "EnumType",
|
|
9
|
-
ComplexType = "ComplexType",
|
|
10
|
-
ModelType = "ModelType"
|
|
11
|
-
}
|
|
12
|
-
export declare const enum OperationTypes {
|
|
13
|
-
Function = "Function",
|
|
14
|
-
Action = "Action"
|
|
15
|
-
}
|
|
16
|
-
export interface PropertyModel {
|
|
17
|
-
odataName: string;
|
|
18
|
-
name: string;
|
|
19
|
-
odataType: string;
|
|
20
|
-
type: string;
|
|
21
|
-
typeModule?: string;
|
|
22
|
-
qObject?: string;
|
|
23
|
-
qPath: string;
|
|
24
|
-
qParam?: string;
|
|
25
|
-
required: boolean;
|
|
26
|
-
isCollection: boolean;
|
|
27
|
-
dataType: DataTypes;
|
|
28
|
-
converters?: Array<ValueConverterImport>;
|
|
29
|
-
managed?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface ModelType extends ComplexType {
|
|
32
|
-
idModelName: string;
|
|
33
|
-
qIdFunctionName: string;
|
|
34
|
-
generateId: boolean;
|
|
35
|
-
keyNames: Array<string>;
|
|
36
|
-
keys: Array<PropertyModel>;
|
|
37
|
-
getKeyUnion(): string;
|
|
38
|
-
}
|
|
39
|
-
export interface ComplexType {
|
|
40
|
-
odataName: string;
|
|
41
|
-
name: string;
|
|
42
|
-
editableName: string;
|
|
43
|
-
qName: string;
|
|
44
|
-
props: Array<PropertyModel>;
|
|
45
|
-
baseProps: Array<PropertyModel>;
|
|
46
|
-
baseClasses: Array<string>;
|
|
47
|
-
}
|
|
48
|
-
export interface EnumType {
|
|
49
|
-
odataName: string;
|
|
50
|
-
name: string;
|
|
51
|
-
members: Array<string>;
|
|
52
|
-
}
|
|
53
|
-
export interface OperationType {
|
|
54
|
-
odataName: string;
|
|
55
|
-
name: string;
|
|
56
|
-
paramsModelName: string;
|
|
57
|
-
qName: string;
|
|
58
|
-
type: OperationTypes;
|
|
59
|
-
parameters: Array<PropertyModel>;
|
|
60
|
-
returnType?: ReturnTypeModel;
|
|
61
|
-
usePost?: boolean;
|
|
62
|
-
}
|
|
63
|
-
export interface ReturnTypeModel extends PropertyModel {
|
|
64
|
-
}
|
|
65
|
-
export type EntityContainerModel = {
|
|
66
|
-
entitySets: {
|
|
67
|
-
[name: string]: EntitySetType;
|
|
68
|
-
};
|
|
69
|
-
singletons: {
|
|
70
|
-
[name: string]: SingletonType;
|
|
71
|
-
};
|
|
72
|
-
functions: {
|
|
73
|
-
[name: string]: FunctionImportType;
|
|
74
|
-
};
|
|
75
|
-
actions: {
|
|
76
|
-
[name: string]: ActionImportType;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
export interface SingletonType {
|
|
80
|
-
odataName: string;
|
|
81
|
-
name: string;
|
|
82
|
-
entityType: ModelType;
|
|
83
|
-
navPropBinding?: Array<NavPropBindingType>;
|
|
84
|
-
}
|
|
85
|
-
export interface EntitySetType {
|
|
86
|
-
odataName: string;
|
|
87
|
-
name: string;
|
|
88
|
-
entityType: ModelType;
|
|
89
|
-
navPropBinding?: Array<NavPropBindingType>;
|
|
90
|
-
}
|
|
91
|
-
export interface NavPropBindingType {
|
|
92
|
-
path: string;
|
|
93
|
-
target: string;
|
|
94
|
-
}
|
|
95
|
-
export interface ActionImportType {
|
|
96
|
-
odataName: string;
|
|
97
|
-
name: string;
|
|
98
|
-
operation: OperationType;
|
|
99
|
-
}
|
|
100
|
-
export interface FunctionImportType extends ActionImportType {
|
|
101
|
-
entitySet: string;
|
|
102
|
-
}
|
|
1
|
+
import { ValueConverterImport } from "@odata2ts/converter-runtime";
|
|
2
|
+
export declare enum ODataVersion {
|
|
3
|
+
V2 = "2.0",
|
|
4
|
+
V4 = "4.0"
|
|
5
|
+
}
|
|
6
|
+
export declare const enum DataTypes {
|
|
7
|
+
PrimitiveType = "PrimitiveType",
|
|
8
|
+
EnumType = "EnumType",
|
|
9
|
+
ComplexType = "ComplexType",
|
|
10
|
+
ModelType = "ModelType"
|
|
11
|
+
}
|
|
12
|
+
export declare const enum OperationTypes {
|
|
13
|
+
Function = "Function",
|
|
14
|
+
Action = "Action"
|
|
15
|
+
}
|
|
16
|
+
export interface PropertyModel {
|
|
17
|
+
odataName: string;
|
|
18
|
+
name: string;
|
|
19
|
+
odataType: string;
|
|
20
|
+
type: string;
|
|
21
|
+
typeModule?: string;
|
|
22
|
+
qObject?: string;
|
|
23
|
+
qPath: string;
|
|
24
|
+
qParam?: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
isCollection: boolean;
|
|
27
|
+
dataType: DataTypes;
|
|
28
|
+
converters?: Array<ValueConverterImport>;
|
|
29
|
+
managed?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface ModelType extends ComplexType {
|
|
32
|
+
idModelName: string;
|
|
33
|
+
qIdFunctionName: string;
|
|
34
|
+
generateId: boolean;
|
|
35
|
+
keyNames: Array<string>;
|
|
36
|
+
keys: Array<PropertyModel>;
|
|
37
|
+
getKeyUnion(): string;
|
|
38
|
+
}
|
|
39
|
+
export interface ComplexType {
|
|
40
|
+
odataName: string;
|
|
41
|
+
name: string;
|
|
42
|
+
editableName: string;
|
|
43
|
+
qName: string;
|
|
44
|
+
props: Array<PropertyModel>;
|
|
45
|
+
baseProps: Array<PropertyModel>;
|
|
46
|
+
baseClasses: Array<string>;
|
|
47
|
+
}
|
|
48
|
+
export interface EnumType {
|
|
49
|
+
odataName: string;
|
|
50
|
+
name: string;
|
|
51
|
+
members: Array<string>;
|
|
52
|
+
}
|
|
53
|
+
export interface OperationType {
|
|
54
|
+
odataName: string;
|
|
55
|
+
name: string;
|
|
56
|
+
paramsModelName: string;
|
|
57
|
+
qName: string;
|
|
58
|
+
type: OperationTypes;
|
|
59
|
+
parameters: Array<PropertyModel>;
|
|
60
|
+
returnType?: ReturnTypeModel;
|
|
61
|
+
usePost?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface ReturnTypeModel extends PropertyModel {
|
|
64
|
+
}
|
|
65
|
+
export type EntityContainerModel = {
|
|
66
|
+
entitySets: {
|
|
67
|
+
[name: string]: EntitySetType;
|
|
68
|
+
};
|
|
69
|
+
singletons: {
|
|
70
|
+
[name: string]: SingletonType;
|
|
71
|
+
};
|
|
72
|
+
functions: {
|
|
73
|
+
[name: string]: FunctionImportType;
|
|
74
|
+
};
|
|
75
|
+
actions: {
|
|
76
|
+
[name: string]: ActionImportType;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export interface SingletonType {
|
|
80
|
+
odataName: string;
|
|
81
|
+
name: string;
|
|
82
|
+
entityType: ModelType;
|
|
83
|
+
navPropBinding?: Array<NavPropBindingType>;
|
|
84
|
+
}
|
|
85
|
+
export interface EntitySetType {
|
|
86
|
+
odataName: string;
|
|
87
|
+
name: string;
|
|
88
|
+
entityType: ModelType;
|
|
89
|
+
navPropBinding?: Array<NavPropBindingType>;
|
|
90
|
+
}
|
|
91
|
+
export interface NavPropBindingType {
|
|
92
|
+
path: string;
|
|
93
|
+
target: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ActionImportType {
|
|
96
|
+
odataName: string;
|
|
97
|
+
name: string;
|
|
98
|
+
operation: OperationType;
|
|
99
|
+
}
|
|
100
|
+
export interface FunctionImportType extends ActionImportType {
|
|
101
|
+
entitySet: string;
|
|
102
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ODataVersion = void 0;
|
|
4
|
-
var ODataVersion;
|
|
5
|
-
(function (ODataVersion) {
|
|
6
|
-
ODataVersion["V2"] = "2.0";
|
|
7
|
-
ODataVersion["V4"] = "4.0";
|
|
8
|
-
})(ODataVersion
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ODataVersion = void 0;
|
|
4
|
+
var ODataVersion;
|
|
5
|
+
(function (ODataVersion) {
|
|
6
|
+
ODataVersion["V2"] = "2.0";
|
|
7
|
+
ODataVersion["V4"] = "4.0";
|
|
8
|
+
})(ODataVersion || (exports.ODataVersion = ODataVersion = {}));
|
|
9
9
|
//# sourceMappingURL=DataTypeModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTypeModel.js","sourceRoot":"","sources":["../../src/data-model/DataTypeModel.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,0BAAU,CAAA;IACV,0BAAU,CAAA;AACZ,CAAC,EAHW,YAAY,
|
|
1
|
+
{"version":3,"file":"DataTypeModel.js","sourceRoot":"","sources":["../../src/data-model/DataTypeModel.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,0BAAU,CAAA;IACV,0BAAU,CAAA;AACZ,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB","sourcesContent":["import { ValueConverterImport } from \"@odata2ts/converter-runtime\";\r\n\r\nexport enum ODataVersion {\r\n V2 = \"2.0\",\r\n V4 = \"4.0\",\r\n}\r\n\r\nexport const enum DataTypes {\r\n PrimitiveType = \"PrimitiveType\",\r\n EnumType = \"EnumType\",\r\n ComplexType = \"ComplexType\",\r\n ModelType = \"ModelType\",\r\n}\r\n\r\nexport const enum OperationTypes {\r\n Function = \"Function\",\r\n Action = \"Action\",\r\n}\r\n\r\nexport interface PropertyModel {\r\n odataName: string;\r\n name: string;\r\n odataType: string;\r\n type: string;\r\n typeModule?: string;\r\n qObject?: string;\r\n qPath: string;\r\n qParam?: string;\r\n required: boolean;\r\n isCollection: boolean;\r\n dataType: DataTypes;\r\n converters?: Array<ValueConverterImport>;\r\n managed?: boolean;\r\n}\r\n\r\nexport interface ModelType extends ComplexType {\r\n idModelName: string;\r\n qIdFunctionName: string;\r\n generateId: boolean;\r\n keyNames: Array<string>;\r\n keys: Array<PropertyModel>;\r\n getKeyUnion(): string;\r\n}\r\n\r\nexport interface ComplexType {\r\n odataName: string;\r\n name: string;\r\n editableName: string;\r\n qName: string;\r\n props: Array<PropertyModel>;\r\n baseProps: Array<PropertyModel>;\r\n baseClasses: Array<string>;\r\n}\r\n\r\nexport interface EnumType {\r\n odataName: string;\r\n name: string;\r\n members: Array<string>;\r\n}\r\n\r\nexport interface OperationType {\r\n odataName: string;\r\n name: string;\r\n paramsModelName: string;\r\n qName: string;\r\n type: OperationTypes;\r\n parameters: Array<PropertyModel>;\r\n returnType?: ReturnTypeModel;\r\n usePost?: boolean;\r\n}\r\n\r\nexport interface ReturnTypeModel extends PropertyModel {}\r\n\r\nexport type EntityContainerModel = {\r\n entitySets: { [name: string]: EntitySetType };\r\n singletons: { [name: string]: SingletonType };\r\n functions: { [name: string]: FunctionImportType };\r\n actions: { [name: string]: ActionImportType };\r\n};\r\n\r\nexport interface SingletonType {\r\n odataName: string;\r\n name: string;\r\n entityType: ModelType;\r\n navPropBinding?: Array<NavPropBindingType>;\r\n}\r\n\r\nexport interface EntitySetType {\r\n odataName: string;\r\n name: string;\r\n entityType: ModelType;\r\n navPropBinding?: Array<NavPropBindingType>;\r\n}\r\n\r\nexport interface NavPropBindingType {\r\n path: string;\r\n target: string;\r\n}\r\n\r\nexport interface ActionImportType {\r\n odataName: string;\r\n name: string;\r\n operation: OperationType;\r\n}\r\n\r\nexport interface FunctionImportType extends ActionImportType {\r\n entitySet: string;\r\n}\r\n"]}
|
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
import { RunOptions } from "../OptionModel";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
private readonly
|
|
7
|
-
private readonly
|
|
8
|
-
private readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import { RunOptions } from "../OptionModel";
|
|
2
|
+
import { PropertyModel } from "./DataTypeModel";
|
|
3
|
+
export interface NamingHelperSettings extends Pick<RunOptions, "allowRenaming" | "naming"> {
|
|
4
|
+
}
|
|
5
|
+
export declare class NamingHelper {
|
|
6
|
+
private readonly allowModelPropRenaming;
|
|
7
|
+
private readonly mainServiceName;
|
|
8
|
+
private readonly servicePrefixes;
|
|
9
|
+
private readonly options;
|
|
10
|
+
constructor(options: NamingHelperSettings, mainServiceName: string, serviceNames?: Array<string>);
|
|
11
|
+
/**
|
|
12
|
+
* The prefix used to reference model or enum types in this schema.
|
|
13
|
+
*
|
|
14
|
+
* @returns service prefix
|
|
15
|
+
*/
|
|
16
|
+
includesServicePrefix(name: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The OData service name as it was found and is used in metadata file.
|
|
19
|
+
*
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
getODataServiceName(): string;
|
|
23
|
+
getFileNames(): {
|
|
24
|
+
model: string;
|
|
25
|
+
qObject: string;
|
|
26
|
+
service: string;
|
|
27
|
+
};
|
|
28
|
+
private getFileName;
|
|
29
|
+
getFileNameService(name: string): string;
|
|
30
|
+
stripServicePrefix(token: string): string;
|
|
31
|
+
private namingFunction;
|
|
32
|
+
private getName;
|
|
33
|
+
private getModelNamingStrategy;
|
|
34
|
+
private getModelPropNamingStrategy;
|
|
35
|
+
private getQObjectNamingStrategy;
|
|
36
|
+
private getQObjectPropNamingStrategy;
|
|
37
|
+
private getOperationNamingStrategy;
|
|
38
|
+
getModelName(name: string): string;
|
|
39
|
+
getModelPropName(name: string): string;
|
|
40
|
+
getEnumName(name: string): string;
|
|
41
|
+
getEditableModelName(name: string): string;
|
|
42
|
+
getIdModelName(name: string): string;
|
|
43
|
+
getOperationParamsModelName(operationName: string, boundEntity?: PropertyModel | undefined): string;
|
|
44
|
+
getQName(name: string): string;
|
|
45
|
+
getQPropName(name: string): string;
|
|
46
|
+
getQIdFunctionName(name: string): string;
|
|
47
|
+
getQFunctionName(operationName: string, boundEntity?: PropertyModel | undefined): string;
|
|
48
|
+
getQActionName(operationName: string, boundEntity?: PropertyModel | undefined): string;
|
|
49
|
+
getMainServiceName(): string;
|
|
50
|
+
getServiceName: (name: string) => string;
|
|
51
|
+
getCollectionServiceName: (name: string) => string;
|
|
52
|
+
private getPrefixedName;
|
|
53
|
+
getFunctionName(operationName: string): string;
|
|
54
|
+
getActionName(operationName: string): string;
|
|
55
|
+
getRelatedServiceGetter(name: string): string;
|
|
56
|
+
getPrivatePropName: (name: string) => string;
|
|
57
|
+
}
|