@odata2ts/odata2ts 0.40.1 → 0.41.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 +68 -0
- package/lib/FactoryFunctionModel.d.ts +2 -2
- package/lib/FactoryFunctionModel.js.map +1 -1
- package/lib/OptionModel.d.ts +8 -0
- package/lib/OptionModel.js.map +1 -1
- package/lib/data-model/DataModelDigestion.js +23 -5
- package/lib/data-model/DataModelDigestion.js.map +1 -1
- package/lib/data-model/DataModelDigestionV4.js +2 -0
- package/lib/data-model/DataModelDigestionV4.js.map +1 -1
- package/lib/data-model/DataTypeModel.d.ts +1 -0
- package/lib/data-model/DataTypeModel.js.map +1 -1
- package/lib/data-model/QueryObjectTypes.d.ts +13 -0
- package/lib/data-model/QueryObjectTypes.js +15 -0
- package/lib/data-model/QueryObjectTypes.js.map +1 -0
- package/lib/data-model/edmx/ODataEdmxModelV4.d.ts +1 -0
- package/lib/data-model/edmx/ODataEdmxModelV4.js.map +1 -1
- package/lib/defaultConfig.js +1 -0
- package/lib/defaultConfig.js.map +1 -1
- package/lib/generator/ImportContainer.d.ts +3 -0
- package/lib/generator/ImportContainer.js +18 -2
- package/lib/generator/ImportContainer.js.map +1 -1
- package/lib/generator/QueryObjectGenerator.js +79 -64
- package/lib/generator/QueryObjectGenerator.js.map +1 -1
- package/lib/generator/ServiceGenerator.js +44 -35
- package/lib/generator/ServiceGenerator.js.map +1 -1
- package/lib/generator/import/ImportObjects.d.ts +16 -12
- package/lib/generator/import/ImportObjects.js +13 -9
- package/lib/generator/import/ImportObjects.js.map +1 -1
- package/lib/generator/import/ImportResponseHelper.d.ts +5 -0
- package/lib/generator/import/ImportResponseHelper.js +47 -0
- package/lib/generator/import/ImportResponseHelper.js.map +1 -0
- package/lib/project/ProjectManager.js +2 -2
- package/lib/project/ProjectManager.js.map +1 -1
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportObjects.js","sourceRoot":"","sources":["../../../src/generator/import/ImportObjects.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImportObjects.js","sourceRoot":"","sources":["../../../src/generator/import/ImportObjects.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,+BAA+B;IACxC,SAAS,EAAE,2BAA2B;IACtC,OAAO,EAAE,yBAAyB;CACnC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,mEAAe,CAAA;IACf,mFAAuB,CAAA;IACvB,6EAAoB,CAAA;IACpB,yEAAkB,CAAA;IAClB,yFAA0B,CAAA;IAC1B,2FAA2B,CAAA;AAC7B,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,WAAW,CAAC,uBAAuB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAE5G;;GAEG;AACH,MAAM,CAAN,IAAY,kBAgBX;AAhBD,WAAY,kBAAkB;IAC5B,iDAA2B,CAAA;IAC3B,+EAAyD,CAAA;IACzD,iCAAW,CAAA;IACX,iDAA2B,CAAA;IAC3B,iDAA2B,CAAA;IAC3B,yCAAmB,CAAA;IACnB,uDAAiC,CAAA;IACjC,qDAA+B,CAAA;IAC/B,qFAA+D,CAAA;IAC/D,qFAA+D,CAAA;IAC/D,2EAAqD,CAAA;IACrD,2EAAqD,CAAA;IACrD,2EAAqD,CAAA;IACrD,6EAAuD,CAAA;IACvD,+EAAyD,CAAA;AAC3D,CAAC,EAhBW,kBAAkB,KAAlB,kBAAkB,QAgB7B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6EAAe,CAAA;IACf,yFAAqB,CAAA;IACrB,iFAAiB,CAAA;IACjB,+EAAgB,CAAA;AAClB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,cAYX;AAZD,WAAY,cAAc;IACxB,mEAAY,CAAA;IACZ,iFAAmB,CAAA;IACnB,iGAA2B,CAAA;IAC3B,6EAAiB,CAAA;IACjB,mFAAoB,CAAA;IACpB,6EAAiB,CAAA;IACjB,2EAAgB,CAAA;IAChB,+EAAkB,CAAA;IAClB,qEAAa,CAAA;IACb,2EAAgB,CAAA;IAChB,0FAAuB,CAAA;AACzB,CAAC,EAZW,cAAc,KAAd,cAAc,QAYzB;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,cAAc,CAAC,iBAAiB;IAChC,cAAc,CAAC,oBAAoB;IACnC,cAAc,CAAC,iBAAiB;IAChC,cAAc,CAAC,gBAAgB;IAC/B,cAAc,CAAC,kBAAkB;CAClC,CAAC","sourcesContent":["/**\n * All module names of the main dependencies.\n */\nexport const LIB_MODULES = {\n core: \"@odata2ts/odata-core\",\n qObject: \"@odata2ts/odata-query-objects\",\n clientApi: \"@odata2ts/http-client-api\",\n service: \"@odata2ts/odata-service\",\n};\n\n/**\n * All imported entity names from the core API.\n * Includes versioned file names, i.e. according to OData version.\n */\nexport enum CoreImports {\n DeferredContent,\n ODataCollectionResponse, // versioned\n ODataModelResponseV4,\n ODataValueResponse, // versioned\n ODataEntityModelResponseV2,\n ODataComplexModelResponseV2,\n}\n\n/**\n * For all core imports that are versioned two files exist, one for V2, one for V4.\n * ODataCollectionResponse = ODataCollectionResponseV2 + ODataCollectionResponseV4\n *\n */\nexport const VERSIONED_CORE_IMPORTS = [CoreImports.ODataCollectionResponse, CoreImports.ODataValueResponse];\n\n/**\n * Most relevant, but not all imports from query objects library\n */\nexport enum QueryObjectImports {\n QueryObject = \"QueryObject\",\n ENUMERABLE_PROP_DEFINITION = \"ENUMERABLE_PROP_DEFINITION\",\n QId = \"QId\",\n QFunctionV2 = \"QFunctionV2\",\n QFunctionV4 = \"QFunctionV4\",\n QAction = \"QAction\",\n EnumCollection = \"EnumCollection\",\n QComplexParam = \"QComplexParam\",\n CollectionResponseConverterV4 = \"CollectionResponseConverterV4\",\n CollectionResponseConverterV2 = \"CollectionResponseConverterV2\",\n ValueResponseConverterV4 = \"ValueResponseConverterV4\",\n ValueResponseConverterV2 = \"ValueResponseConverterV2\",\n ModelResponseConverterV4 = \"ModelResponseConverterV4\",\n EntityResponseConverterV2 = \"EntityResponseConverterV2\",\n ComplexResponseConverterV2 = \"ComplexResponseConverterV2\",\n}\n\n/**\n * All imports from HTTP client API.\n */\nexport enum ClientApiImports {\n ODataHttpClient,\n ODataHttpClientConfig,\n HttpResponseModel,\n ODataHttpMethods,\n}\n\n/**\n * All imports from service library.\n * Includes versioned file names, i.e. according to OData version.\n */\nexport enum ServiceImports {\n ODataService,\n ODataServiceOptions,\n ODataServiceOptionsInternal,\n EntityTypeService,\n PrimitiveTypeService,\n CollectionService,\n EntitySetService,\n ComplexTypeService,\n UrlRequestCmd,\n UrlGetRequestCmd,\n ComposableUrlRequestCmd,\n}\n\n/**\n * For all versioned imports two files exist, one for V2, one for V4.\n * EntityTypeService = EntityTypeServiceV2 + EntityTypeServiceV4\n */\nexport const VERSIONED_SERVICE_IMPORTS = [\n ServiceImports.EntityTypeService,\n ServiceImports.PrimitiveTypeService,\n ServiceImports.CollectionService,\n ServiceImports.EntitySetService,\n ServiceImports.ComplexTypeService,\n];\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ODataVersions } from "@odata2ts/odata-core";
|
|
2
|
+
import { ReturnTypeModel } from "../../data-model/DataTypeModel.js";
|
|
3
|
+
import { ImportContainer } from "../ImportContainer.js";
|
|
4
|
+
export declare function importReturnType(version: ODataVersions, imports: ImportContainer, returnType: ReturnTypeModel): string;
|
|
5
|
+
export declare function importMainResponseConverter(version: ODataVersions, imports: ImportContainer, returnType: ReturnTypeModel): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ODataVersions } from "@odata2ts/odata-core";
|
|
2
|
+
import { CoreImports, QueryObjectImports } from "./ImportObjects.js";
|
|
3
|
+
export function importReturnType(version, imports, returnType) {
|
|
4
|
+
const typeToImport = returnType.isCollection
|
|
5
|
+
? CoreImports.ODataCollectionResponse
|
|
6
|
+
: returnType.dataType === "PrimitiveType" /* DataTypes.PrimitiveType */
|
|
7
|
+
? CoreImports.ODataValueResponse
|
|
8
|
+
: undefined;
|
|
9
|
+
if (typeToImport) {
|
|
10
|
+
return imports.addCoreLib(version, typeToImport);
|
|
11
|
+
}
|
|
12
|
+
return version === ODataVersions.V2
|
|
13
|
+
? importReturnTypeV2(imports, returnType)
|
|
14
|
+
: importReturnTypeV4(imports, returnType);
|
|
15
|
+
}
|
|
16
|
+
function importReturnTypeV4(imports, returnType) {
|
|
17
|
+
return imports.addCoreLib(ODataVersions.V4, CoreImports.ODataModelResponseV4);
|
|
18
|
+
}
|
|
19
|
+
function importReturnTypeV2(imports, returnType) {
|
|
20
|
+
return imports.addCoreLib(ODataVersions.V2, returnType.dataType === "ComplexType" /* DataTypes.ComplexType */
|
|
21
|
+
? CoreImports.ODataComplexModelResponseV2
|
|
22
|
+
: CoreImports.ODataEntityModelResponseV2);
|
|
23
|
+
}
|
|
24
|
+
export function importMainResponseConverter(version, imports, returnType) {
|
|
25
|
+
return version === ODataVersions.V2
|
|
26
|
+
? importMainResponseConverterV2(imports, returnType)
|
|
27
|
+
: importMainResponseConverterV4(imports, returnType);
|
|
28
|
+
}
|
|
29
|
+
function importMainResponseConverterV4(imports, returnType) {
|
|
30
|
+
const toImport = returnType.isCollection
|
|
31
|
+
? QueryObjectImports.CollectionResponseConverterV4
|
|
32
|
+
: returnType.dataType === "PrimitiveType" /* DataTypes.PrimitiveType */
|
|
33
|
+
? QueryObjectImports.ValueResponseConverterV4
|
|
34
|
+
: QueryObjectImports.ModelResponseConverterV4;
|
|
35
|
+
return imports.addQObject(toImport);
|
|
36
|
+
}
|
|
37
|
+
function importMainResponseConverterV2(imports, returnType) {
|
|
38
|
+
const toImport = returnType.isCollection
|
|
39
|
+
? QueryObjectImports.CollectionResponseConverterV2
|
|
40
|
+
: returnType.dataType === "PrimitiveType" /* DataTypes.PrimitiveType */
|
|
41
|
+
? QueryObjectImports.ValueResponseConverterV2
|
|
42
|
+
: returnType.dataType === "ComplexType" /* DataTypes.ComplexType */
|
|
43
|
+
? QueryObjectImports.ComplexResponseConverterV2
|
|
44
|
+
: QueryObjectImports.EntityResponseConverterV2;
|
|
45
|
+
return imports.addQObject(toImport);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=ImportResponseHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportResponseHelper.js","sourceRoot":"","sources":["../../../src/generator/import/ImportResponseHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,UAAU,gBAAgB,CAC9B,OAAsB,EACtB,OAAwB,EACxB,UAA2B;IAE3B,MAAM,YAAY,GAA4B,UAAU,CAAC,YAAY;QACnE,CAAC,CAAC,WAAW,CAAC,uBAAuB;QACrC,CAAC,CAAC,UAAU,CAAC,QAAQ,kDAA4B;YAC/C,CAAC,CAAC,WAAW,CAAC,kBAAkB;YAChC,CAAC,CAAC,SAAS,CAAC;IAEhB,IAAI,YAAY,EAAE;QAChB,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;KAClD;IAED,OAAO,OAAO,KAAK,aAAa,CAAC,EAAE;QACjC,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC;QACzC,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAwB,EAAE,UAA2B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;gBAC/C,CAAC,CAAC,kBAAkB,CAAC,yBAAyB,CAAC;IAErD,OAAO,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { ODataVersions } from \"@odata2ts/odata-core\";\nimport { DataTypes, ReturnTypeModel } from \"../../data-model/DataTypeModel.js\";\nimport { ImportContainer } from \"../ImportContainer.js\";\nimport { CoreImports, QueryObjectImports } from \"./ImportObjects.js\";\n\nexport function importReturnType(\n version: ODataVersions,\n imports: ImportContainer,\n returnType: ReturnTypeModel,\n): string {\n const typeToImport: CoreImports | undefined = returnType.isCollection\n ? CoreImports.ODataCollectionResponse\n : returnType.dataType === DataTypes.PrimitiveType\n ? CoreImports.ODataValueResponse\n : undefined;\n\n if (typeToImport) {\n return imports.addCoreLib(version, typeToImport);\n }\n\n return version === ODataVersions.V2\n ? importReturnTypeV2(imports, returnType)\n : importReturnTypeV4(imports, returnType);\n}\n\nfunction importReturnTypeV4(imports: ImportContainer, returnType: ReturnTypeModel) {\n return imports.addCoreLib(ODataVersions.V4, CoreImports.ODataModelResponseV4);\n}\n\nfunction importReturnTypeV2(imports: ImportContainer, returnType: ReturnTypeModel) {\n return imports.addCoreLib(\n ODataVersions.V2,\n returnType.dataType === DataTypes.ComplexType\n ? CoreImports.ODataComplexModelResponseV2\n : CoreImports.ODataEntityModelResponseV2,\n );\n}\n\nexport function importMainResponseConverter(\n version: ODataVersions,\n imports: ImportContainer,\n returnType: ReturnTypeModel,\n) {\n return version === ODataVersions.V2\n ? importMainResponseConverterV2(imports, returnType)\n : importMainResponseConverterV4(imports, returnType);\n}\n\nfunction importMainResponseConverterV4(imports: ImportContainer, returnType: ReturnTypeModel): string {\n const toImport: QueryObjectImports = returnType.isCollection\n ? QueryObjectImports.CollectionResponseConverterV4\n : returnType.dataType === DataTypes.PrimitiveType\n ? QueryObjectImports.ValueResponseConverterV4\n : QueryObjectImports.ModelResponseConverterV4;\n\n return imports.addQObject(toImport);\n}\n\nfunction importMainResponseConverterV2(imports: ImportContainer, returnType: ReturnTypeModel): string {\n const toImport: QueryObjectImports = returnType.isCollection\n ? QueryObjectImports.CollectionResponseConverterV2\n : returnType.dataType === DataTypes.PrimitiveType\n ? QueryObjectImports.ValueResponseConverterV2\n : returnType.dataType === DataTypes.ComplexType\n ? QueryObjectImports.ComplexResponseConverterV2\n : QueryObjectImports.EntityResponseConverterV2;\n\n return imports.addQObject(toImport);\n}\n"]}
|
|
@@ -168,14 +168,14 @@ export class ProjectManager {
|
|
|
168
168
|
return this.mainQFile;
|
|
169
169
|
}
|
|
170
170
|
createOrGetModelFile(folderPath, name, reservedNames) {
|
|
171
|
-
if (this.
|
|
171
|
+
if (this.options.bundledFileGeneration) {
|
|
172
172
|
return this.mainModelFile;
|
|
173
173
|
}
|
|
174
174
|
// model files always allow for type checking
|
|
175
175
|
return this.createFile(name, reservedNames, folderPath, true);
|
|
176
176
|
}
|
|
177
177
|
createOrGetQObjectFile(folderPath, name, reservedNames) {
|
|
178
|
-
if (this.
|
|
178
|
+
if (this.options.bundledFileGeneration) {
|
|
179
179
|
return this.mainQFile;
|
|
180
180
|
}
|
|
181
181
|
return this.createFile(name, reservedNames, folderPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectManager.js","sourceRoot":"","sources":["../../src/project/ProjectManager.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAmB,OAAO,EAAc,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI9D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,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,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;YACtC,OAAO,IAAI,CAAC,eAAgB,CAAC;SAC9B;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;IAEY,YAAY,CAAC,IAAiB;;YACzC,gGAAgG;YAChG,IACE,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB;gBACnC,IAAI,CAAC,IAAI,KAAK,EAAE;gBAChB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EACxE;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KAAA;CACF","sourcesContent":["import * as path from \"path\";\nimport { mkdirp } from \"mkdirp\";\nimport { CompilerOptions, Project, SourceFile } from \"ts-morph\";\nimport { firstCharLowerCase } from \"xml2js/lib/processors.js\";\nimport { DataModel } from \"../data-model/DataModel.js\";\nimport { EntityType } from \"../data-model/DataTypeModel.js\";\nimport { NamingHelper } from \"../data-model/NamingHelper.js\";\nimport { ImportContainer } from \"../generator/ImportContainer.js\";\nimport { EmitModes } from \"../OptionModel.js\";\nimport { FileHandler } from \"./FileHandler.js\";\nimport { FileFormatter } from \"./formatter/FileFormatter.js\";\nimport { createFormatter } from \"./formatter/index.js\";\nimport { loadTsMorphCompilerOptions } from \"./TsMorphHelper.js\";\n\nexport interface ProjectManagerOptions {\n usePrettier?: boolean;\n tsConfigPath?: string;\n bundledFileGeneration?: boolean;\n /**\n * for testing purposes, turn this on and retrieve all generated files via getCachedFiles\n */\n noOutput?: boolean;\n allowTypeChecking?: boolean;\n}\n\nexport async function createProjectManager(\n outputDir: string,\n emitMode: EmitModes,\n namingHelper: NamingHelper,\n dataModel: DataModel,\n options: ProjectManagerOptions,\n): Promise<ProjectManager> {\n const { usePrettier = false, tsConfigPath = \"tsconfig.json\" } = options;\n const formatter = usePrettier ? await createFormatter(outputDir, usePrettier) : undefined;\n\n const compilerOpts: CompilerOptions = await loadTsMorphCompilerOptions(tsConfigPath, emitMode, outputDir);\n\n const pm = new ProjectManager(outputDir, emitMode, namingHelper, dataModel, formatter, compilerOpts, {\n usePrettier,\n tsConfigPath,\n ...options,\n });\n\n await pm.init();\n\n return pm;\n}\n\nexport class ProjectManager {\n private project!: Project;\n\n private mainServiceFile: FileHandler | undefined;\n private mainModelFile: FileHandler | undefined;\n private mainQFile: FileHandler | undefined;\n\n private readonly cachedFiles: Map<string, SourceFile> | undefined;\n\n constructor(\n protected outputDir: string,\n protected emitMode: EmitModes,\n protected namingHelper: NamingHelper,\n protected dataModel: DataModel,\n protected formatter: FileFormatter | undefined,\n compilerOptions: CompilerOptions | undefined,\n protected options: ProjectManagerOptions,\n ) {\n // Create ts-morph project\n this.project = new Project({\n // manipulationSettings: this.formatter.getSettings(),\n skipAddingFilesFromTsConfig: true,\n compilerOptions,\n });\n\n if (options.noOutput) {\n this.cachedFiles = new Map();\n }\n }\n\n public getDataModel() {\n return this.dataModel;\n }\n\n /**\n * Only filled when noOutput=true\n */\n public getCachedFiles() {\n return this.cachedFiles!;\n }\n\n private async writeFile(fileHandler: FileHandler) {\n if (this.options.noOutput) {\n await fileHandler.write(this.emitMode, true);\n this.cachedFiles!.set(fileHandler.getFullFilePath(), fileHandler.getFile());\n\n return;\n }\n\n return fileHandler.write(this.emitMode);\n }\n\n private createFile(\n name: string,\n reservedNames?: Array<string> | undefined,\n additionalPath: string = \"\",\n forceTypeChecking = false,\n ): FileHandler {\n const fileName = path.join(this.outputDir, additionalPath, `${name}.ts`);\n const imports = new ImportContainer(\n additionalPath,\n name,\n this.dataModel,\n this.namingHelper.getFileNames(),\n !!this.options.bundledFileGeneration,\n reservedNames,\n );\n\n return new FileHandler(\n additionalPath,\n name,\n this.project.createSourceFile(fileName),\n imports,\n this.formatter,\n forceTypeChecking || !!this.options.allowTypeChecking,\n );\n }\n\n public async init() {\n if (!this.options.bundledFileGeneration) {\n // ensure folder for each model: we do this at this point for performance reasons\n await Promise.all(this.dataModel.getModelTypes().map((mt) => mkdirp(path.join(this.outputDir, mt.folderPath))));\n }\n }\n\n public initModels() {\n if (this.options.bundledFileGeneration) {\n // collect reserved names, that is names of classes we're going to create => imports must take them into account\n const reservedWords = this.dataModel.getModelTypes().reduce<Array<string>>((collector, model) => {\n const asEntityType = model as EntityType;\n collector.push(model.modelName);\n if (asEntityType.editableName) {\n collector.push(asEntityType.editableName);\n }\n if (asEntityType.id?.modelName) {\n collector.push(asEntityType.id.modelName);\n }\n this.dataModel.getAllEntityOperations(model.fqName).forEach((op) => {\n if (op.parameters.length) {\n collector.push(op.paramsModelName);\n }\n });\n\n return collector;\n }, []);\n this.dataModel.getUnboundOperationTypes().forEach((op) => {\n if (op.parameters.length) {\n reservedWords.push(op.paramsModelName);\n }\n });\n\n this.mainModelFile = this.createFile(this.namingHelper.getFileNames().model, reservedWords);\n }\n }\n\n public async finalizeModels() {\n if (\n this.mainModelFile &&\n (this.options.bundledFileGeneration || this.mainModelFile.getFile().getFullText().length)\n ) {\n await this.writeFile(this.mainModelFile);\n }\n }\n\n public initQObjects() {\n if (this.options.bundledFileGeneration) {\n // collect reserved names, that is names of classes we're going to create => imports must take them into account\n const reservedWords = this.dataModel.getModelTypes().reduce<Array<string>>((collector, model) => {\n const asEntityType = model as EntityType;\n if (asEntityType.qName) {\n collector.push(asEntityType.qName, firstCharLowerCase(asEntityType.qName));\n }\n if (asEntityType.id?.qName) {\n collector.push(asEntityType.id.qName);\n }\n this.dataModel.getAllEntityOperations(model.fqName).forEach((op) => {\n collector.push(op.qName);\n });\n\n return collector;\n }, []);\n this.dataModel.getUnboundOperationTypes().forEach((op) => {\n reservedWords.push(op.qName);\n });\n\n this.mainQFile = this.createFile(this.namingHelper.getFileNames().qObject, reservedWords);\n }\n }\n\n public async finalizeQObjects() {\n if (this.mainQFile && (this.options.bundledFileGeneration || this.mainQFile.getFile().getFullText().length)) {\n await this.writeFile(this.mainQFile);\n }\n }\n\n public initServices() {\n const mainServiceName = this.namingHelper.getMainServiceName();\n const reservedNames = [mainServiceName];\n\n if (this.options.bundledFileGeneration) {\n [...this.dataModel.getEntityTypes(), ...this.dataModel.getComplexTypes()].reduce((collector, model) => {\n collector.push(model.serviceName, model.serviceCollectionName);\n return collector;\n }, reservedNames);\n }\n\n this.mainServiceFile = this.createFile(mainServiceName, reservedNames);\n }\n\n public async finalizeServices() {\n if (this.mainServiceFile) {\n await this.writeFile(this.mainServiceFile);\n }\n }\n\n public getMainServiceFile() {\n return this.mainServiceFile!;\n }\n\n public createOrGetMainModelFile(reservedNames?: Array<string>) {\n if (!this.mainModelFile) {\n this.mainModelFile = this.createFile(this.namingHelper.getFileNames().model, reservedNames, \"\", true);\n }\n return this.mainModelFile;\n }\n\n public createOrGetMainQObjectFile(reservedNames?: Array<string>) {\n if (!this.mainQFile) {\n this.mainQFile = this.createFile(this.namingHelper.getFileNames().qObject, reservedNames);\n }\n return this.mainQFile;\n }\n\n public createOrGetModelFile(folderPath: string, name: string, reservedNames?: Array<string> | undefined) {\n if (this.mainModelFile) {\n return this.mainModelFile;\n }\n\n // model files always allow for type checking\n return this.createFile(name, reservedNames, folderPath, true);\n }\n public createOrGetQObjectFile(folderPath: string, name: string, reservedNames?: Array<string> | undefined) {\n if (this.mainQFile) {\n return this.mainQFile;\n }\n\n return this.createFile(name, reservedNames, folderPath);\n }\n public createOrGetServiceFile(folderPath: string, name: string, reservedNames?: Array<string> | undefined) {\n if (this.options.bundledFileGeneration) {\n return this.mainServiceFile!;\n }\n\n return this.createFile(name, reservedNames, folderPath);\n }\n\n public async finalizeFile(file: FileHandler) {\n // write individual files in unbundled mode & if this is not one of the main files on root level\n if (\n !this.options.bundledFileGeneration &&\n file.path !== \"\" &&\n !Object.values(this.namingHelper.getFileNames()).includes(file.fileName)\n ) {\n await this.writeFile(file);\n }\n }\n}\n"]}
|
|
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IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;YACtC,OAAO,IAAI,CAAC,aAAc,CAAC;SAC5B;QAED,6CAA6C;QAC7C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAChE,CAAC;IACM,sBAAsB,CAAC,UAAkB,EAAE,IAAY,EAAE,aAAyC;QACvG,IAAI,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;YACtC,OAAO,IAAI,CAAC,SAAU,CAAC;SACxB;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;IACM,sBAAsB,CAAC,UAAkB,EAAE,IAAY,EAAE,aAAyC;QACvG,IAAI,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE;YACtC,OAAO,IAAI,CAAC,eAAgB,CAAC;SAC9B;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;IAC1D,CAAC;IAEY,YAAY,CAAC,IAAiB;;YACzC,gGAAgG;YAChG,IACE,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB;gBACnC,IAAI,CAAC,IAAI,KAAK,EAAE;gBAChB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EACxE;gBACA,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;aAC5B;QACH,CAAC;KAAA;CACF","sourcesContent":["import * as path from \"path\";\nimport { mkdirp } from \"mkdirp\";\nimport { CompilerOptions, Project, SourceFile } from \"ts-morph\";\nimport { firstCharLowerCase } from \"xml2js/lib/processors.js\";\nimport { DataModel } from \"../data-model/DataModel.js\";\nimport { EntityType } from \"../data-model/DataTypeModel.js\";\nimport { NamingHelper } from \"../data-model/NamingHelper.js\";\nimport { ImportContainer } from \"../generator/ImportContainer.js\";\nimport { EmitModes } from \"../OptionModel.js\";\nimport { FileHandler } from \"./FileHandler.js\";\nimport { FileFormatter } from \"./formatter/FileFormatter.js\";\nimport { createFormatter } from \"./formatter/index.js\";\nimport { loadTsMorphCompilerOptions } from \"./TsMorphHelper.js\";\n\nexport interface ProjectManagerOptions {\n usePrettier?: boolean;\n tsConfigPath?: string;\n bundledFileGeneration?: boolean;\n /**\n * for testing purposes, turn this on and retrieve all generated files via getCachedFiles\n */\n noOutput?: boolean;\n allowTypeChecking?: boolean;\n}\n\nexport async function createProjectManager(\n outputDir: string,\n emitMode: EmitModes,\n namingHelper: NamingHelper,\n dataModel: DataModel,\n options: ProjectManagerOptions,\n): Promise<ProjectManager> {\n const { usePrettier = false, tsConfigPath = \"tsconfig.json\" } = options;\n const formatter = usePrettier ? await createFormatter(outputDir, usePrettier) : undefined;\n\n const compilerOpts: CompilerOptions = await loadTsMorphCompilerOptions(tsConfigPath, emitMode, outputDir);\n\n const pm = new ProjectManager(outputDir, emitMode, namingHelper, dataModel, formatter, compilerOpts, {\n usePrettier,\n tsConfigPath,\n ...options,\n });\n\n await pm.init();\n\n return pm;\n}\n\nexport class ProjectManager {\n private project!: Project;\n\n private mainServiceFile: FileHandler | undefined;\n private mainModelFile: FileHandler | undefined;\n private mainQFile: FileHandler | undefined;\n\n private readonly cachedFiles: Map<string, SourceFile> | undefined;\n\n constructor(\n protected outputDir: string,\n protected emitMode: EmitModes,\n protected namingHelper: NamingHelper,\n protected dataModel: DataModel,\n protected formatter: FileFormatter | undefined,\n compilerOptions: CompilerOptions | undefined,\n protected options: ProjectManagerOptions,\n ) {\n // Create ts-morph project\n this.project = new Project({\n // manipulationSettings: this.formatter.getSettings(),\n skipAddingFilesFromTsConfig: true,\n compilerOptions,\n });\n\n if (options.noOutput) {\n this.cachedFiles = new Map();\n }\n }\n\n public getDataModel() {\n return this.dataModel;\n }\n\n /**\n * Only filled when noOutput=true\n */\n public getCachedFiles() {\n return this.cachedFiles!;\n }\n\n private async writeFile(fileHandler: FileHandler) {\n if (this.options.noOutput) {\n await fileHandler.write(this.emitMode, true);\n this.cachedFiles!.set(fileHandler.getFullFilePath(), fileHandler.getFile());\n\n return;\n }\n\n return fileHandler.write(this.emitMode);\n }\n\n private createFile(\n name: string,\n reservedNames?: Array<string> | undefined,\n additionalPath: string = \"\",\n forceTypeChecking = false,\n ): FileHandler {\n const fileName = path.join(this.outputDir, additionalPath, `${name}.ts`);\n const imports = new ImportContainer(\n additionalPath,\n name,\n this.dataModel,\n this.namingHelper.getFileNames(),\n !!this.options.bundledFileGeneration,\n reservedNames,\n );\n\n return new FileHandler(\n additionalPath,\n name,\n this.project.createSourceFile(fileName),\n imports,\n this.formatter,\n forceTypeChecking || !!this.options.allowTypeChecking,\n );\n }\n\n public async init() {\n if (!this.options.bundledFileGeneration) {\n // ensure folder for each model: we do this at this point for performance reasons\n await Promise.all(this.dataModel.getModelTypes().map((mt) => mkdirp(path.join(this.outputDir, mt.folderPath))));\n }\n }\n\n public initModels() {\n if (this.options.bundledFileGeneration) {\n // collect reserved names, that is names of classes we're going to create => imports must take them into account\n const reservedWords = this.dataModel.getModelTypes().reduce<Array<string>>((collector, model) => {\n const asEntityType = model as EntityType;\n collector.push(model.modelName);\n if (asEntityType.editableName) {\n collector.push(asEntityType.editableName);\n }\n if (asEntityType.id?.modelName) {\n collector.push(asEntityType.id.modelName);\n }\n this.dataModel.getAllEntityOperations(model.fqName).forEach((op) => {\n if (op.parameters.length) {\n collector.push(op.paramsModelName);\n }\n });\n\n return collector;\n }, []);\n this.dataModel.getUnboundOperationTypes().forEach((op) => {\n if (op.parameters.length) {\n reservedWords.push(op.paramsModelName);\n }\n });\n\n this.mainModelFile = this.createFile(this.namingHelper.getFileNames().model, reservedWords);\n }\n }\n\n public async finalizeModels() {\n if (\n this.mainModelFile &&\n (this.options.bundledFileGeneration || this.mainModelFile.getFile().getFullText().length)\n ) {\n await this.writeFile(this.mainModelFile);\n }\n }\n\n public initQObjects() {\n if (this.options.bundledFileGeneration) {\n // collect reserved names, that is names of classes we're going to create => imports must take them into account\n const reservedWords = this.dataModel.getModelTypes().reduce<Array<string>>((collector, model) => {\n const asEntityType = model as EntityType;\n if (asEntityType.qName) {\n collector.push(asEntityType.qName, firstCharLowerCase(asEntityType.qName));\n }\n if (asEntityType.id?.qName) {\n collector.push(asEntityType.id.qName);\n }\n this.dataModel.getAllEntityOperations(model.fqName).forEach((op) => {\n collector.push(op.qName);\n });\n\n return collector;\n }, []);\n this.dataModel.getUnboundOperationTypes().forEach((op) => {\n reservedWords.push(op.qName);\n });\n\n this.mainQFile = this.createFile(this.namingHelper.getFileNames().qObject, reservedWords);\n }\n }\n\n public async finalizeQObjects() {\n if (this.mainQFile && (this.options.bundledFileGeneration || this.mainQFile.getFile().getFullText().length)) {\n await this.writeFile(this.mainQFile);\n }\n }\n\n public initServices() {\n const mainServiceName = this.namingHelper.getMainServiceName();\n const reservedNames = [mainServiceName];\n\n if (this.options.bundledFileGeneration) {\n [...this.dataModel.getEntityTypes(), ...this.dataModel.getComplexTypes()].reduce((collector, model) => {\n collector.push(model.serviceName, model.serviceCollectionName);\n return collector;\n }, reservedNames);\n }\n\n this.mainServiceFile = this.createFile(mainServiceName, reservedNames);\n }\n\n public async finalizeServices() {\n if (this.mainServiceFile) {\n await this.writeFile(this.mainServiceFile);\n }\n }\n\n public getMainServiceFile() {\n return this.mainServiceFile!;\n }\n\n public createOrGetMainModelFile(reservedNames?: Array<string>) {\n if (!this.mainModelFile) {\n this.mainModelFile = this.createFile(this.namingHelper.getFileNames().model, reservedNames, \"\", true);\n }\n return this.mainModelFile;\n }\n\n public createOrGetMainQObjectFile(reservedNames?: Array<string>) {\n if (!this.mainQFile) {\n this.mainQFile = this.createFile(this.namingHelper.getFileNames().qObject, reservedNames);\n }\n return this.mainQFile;\n }\n\n public createOrGetModelFile(folderPath: string, name: string, reservedNames?: Array<string> | undefined) {\n if (this.options.bundledFileGeneration) {\n return this.mainModelFile!;\n }\n\n // model files always allow for type checking\n return this.createFile(name, reservedNames, folderPath, true);\n }\n public createOrGetQObjectFile(folderPath: string, name: string, reservedNames?: Array<string> | undefined) {\n if (this.options.bundledFileGeneration) {\n return this.mainQFile!;\n }\n\n return this.createFile(name, reservedNames, folderPath);\n }\n public createOrGetServiceFile(folderPath: string, name: string, reservedNames?: Array<string> | undefined) {\n if (this.options.bundledFileGeneration) {\n return this.mainServiceFile!;\n }\n\n return this.createFile(name, reservedNames, folderPath);\n }\n\n public async finalizeFile(file: FileHandler) {\n // write individual files in unbundled mode & if this is not one of the main files on root level\n if (\n !this.options.bundledFileGeneration &&\n file.path !== \"\" &&\n !Object.values(this.namingHelper.getFileNames()).includes(file.fileName)\n ) {\n await this.writeFile(file);\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odata2ts/odata2ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "Flexible generator to produce various TypeScript artefacts (from simple model interfaces to complete odata clients) from OData metadata files",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"odata2ts",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"clean-v2": "rimraf build/v2",
|
|
37
37
|
"clean-v4": "rimraf build/v4",
|
|
38
38
|
"compile": "tsc -p tsconfig.compile.json",
|
|
39
|
+
"coverage": "vitest run --dir test --coverage --testTimeout=30000",
|
|
39
40
|
"dev": "yarn generate trippin odata",
|
|
40
41
|
"generate": "npx tsx src/run-cli.ts",
|
|
41
42
|
"int-test": "yarn clean && vitest run --dir int-test",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"dependencies": {
|
|
48
49
|
"@odata2ts/converter-api": "^0.2.5",
|
|
49
50
|
"@odata2ts/converter-runtime": "^0.5.5",
|
|
50
|
-
"@odata2ts/http-client-api": "^0.6.
|
|
51
|
+
"@odata2ts/http-client-api": "^0.6.5",
|
|
51
52
|
"@odata2ts/odata-core": "^0.6.1",
|
|
52
53
|
"@prettier/plugin-xml": "^3.4.1",
|
|
53
54
|
"@types/xml2js": "^0.4.11",
|
|
@@ -68,14 +69,14 @@
|
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@odata2ts/converter-v2-to-v4": "^0.5.1",
|
|
71
|
-
"@odata2ts/odata-query-objects": "^0.
|
|
72
|
-
"@odata2ts/odata-service": "^0.
|
|
72
|
+
"@odata2ts/odata-query-objects": "^0.29.0",
|
|
73
|
+
"@odata2ts/odata-service": "^0.24.0",
|
|
73
74
|
"@odata2ts/test-converters": "^0.5.0",
|
|
74
75
|
"@types/node": "^22.4.0"
|
|
75
76
|
},
|
|
76
77
|
"peerDependencies": {
|
|
77
|
-
"@odata2ts/odata-query-objects": "^0.
|
|
78
|
-
"@odata2ts/odata-service": "^0.
|
|
78
|
+
"@odata2ts/odata-query-objects": "^0.29.0",
|
|
79
|
+
"@odata2ts/odata-service": "^0.24.0",
|
|
79
80
|
"typescript": ">= 4.7"
|
|
80
81
|
},
|
|
81
82
|
"publishConfig": {
|