ts-openapi-codegen 1.0.0-beta.6 → 1.0.0-beta.7
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/README.md +43 -58
- package/dist/cli/chekOpenApiConfig/chekOpenApiConfig.js +2 -2
- package/dist/cli/generate/runGenerateOpenApi.js +4 -4
- package/dist/cli/index.js +11 -13
- package/dist/cli/utils.d.ts +0 -17
- package/dist/cli/utils.d.ts.map +1 -1
- package/dist/cli/utils.js +0 -20
- package/dist/common/Options.d.ts +4 -6
- package/dist/common/Options.d.ts.map +1 -1
- package/dist/common/Utils.d.ts.map +1 -1
- package/dist/common/Utils.js +8 -9
- package/dist/common/VersionedSchema/CommonSchemas.d.ts +12 -0
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +27 -1
- package/dist/common/VersionedSchema/{MultiOptionsMigrationPlan.d.ts → MultiOptionsVersioned/MultiOptionsMigrationPlan.d.ts} +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{MultiOptionsMigrationPlan.js → MultiOptionsVersioned/MultiOptionsMigrationPlan.js} +18 -7
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +6 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{MultiOptionsSchemaV1.js → MultiOptionsVersioned/MultiOptionsSchemaV1.js} +4 -4
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts +6 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{MultiOptionsSchemaV2.js → MultiOptionsVersioned/MultiOptionsSchemaV2.js} +4 -4
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts +5 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{MultiOptionsSchemaV3.js → MultiOptionsVersioned/MultiOptionsSchemaV3.js} +3 -3
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +6 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{MultiOptionsSchemaV4.js → MultiOptionsVersioned/MultiOptionsSchemaV4.js} +4 -4
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +6 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts.map +1 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.js +22 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts +3 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{MultiOptionsVersionedSchemas.js → MultiOptionsVersioned/MultiOptionsVersionedSchemas.js} +10 -5
- package/dist/common/VersionedSchema/{OptionsMigrationPlans.d.ts → OptionsVersioned/OptionsMigrationPlans.d.ts} +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.d.ts.map +1 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.js +23 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +6 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{OptionsSchemaV1.js → OptionsVersioned/OptionsSchemaV1.js} +4 -4
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts +6 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{OptionsSchemaV2.js → OptionsVersioned/OptionsSchemaV2.js} +4 -4
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts +5 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{OptionsSchemaV3.js → OptionsVersioned/OptionsSchemaV3.js} +3 -3
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +6 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts.map +1 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.js +17 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts +3 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts.map +1 -0
- package/dist/common/VersionedSchema/{OptionsVersionedSchemas.js → OptionsVersioned/OptionsVersionedSchemas.js} +9 -4
- package/dist/common/VersionedSchema/Types.d.ts +0 -4
- package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
- package/dist/common/__tests__/convertArrayToObject.test.js +62 -59
- package/dist/common/__tests__/mergeObjectSchemas.test.js +1 -1
- package/dist/common/__tests__/migrationForMultiOptions.test.js +9 -5
- package/dist/common/__tests__/migrationForOptions.test.js +17 -8
- package/dist/common/defaultOptions.d.ts.map +1 -1
- package/dist/common/defaultOptions.js +5 -7
- package/dist/core/Context.d.ts +15 -7
- package/dist/core/Context.d.ts.map +1 -1
- package/dist/core/Context.js +3 -0
- package/dist/core/WriteClient.d.ts +43 -45
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +156 -81
- package/dist/core/__tests__/WriteClient.test.js +12 -8
- package/dist/core/api/v2/parser/__tests__/getType.test.js +7 -25
- package/dist/core/api/v2/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModel.js +5 -2
- package/dist/core/api/v2/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModelProperties.js +3 -1
- package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModels.js +3 -29
- package/dist/core/api/v2/parser/getOperation.d.ts +1 -1
- package/dist/core/api/v2/parser/getOperation.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperation.js +3 -3
- package/dist/core/api/v2/parser/getOperationParameter.d.ts +1 -1
- package/dist/core/api/v2/parser/getOperationParameter.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationParameter.js +4 -2
- package/dist/core/api/v2/parser/getOperationParameters.d.ts +1 -1
- package/dist/core/api/v2/parser/getOperationParameters.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationParameters.js +2 -2
- package/dist/core/api/v2/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationResponse.js +3 -1
- package/dist/core/api/v2/parser/getOperationResponses.d.ts +1 -1
- package/dist/core/api/v2/parser/getOperationResponses.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationResponses.js +2 -2
- package/dist/core/api/v2/parser/getServiceName.d.ts +3 -0
- package/dist/core/api/v2/parser/getServiceName.d.ts.map +1 -0
- package/dist/core/api/v2/parser/getServiceName.js +8 -0
- package/dist/core/api/v2/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getServices.js +21 -32
- package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getType.js +13 -9
- package/dist/core/api/v3/parser/__tests__/getType.test.js +6 -24
- package/dist/core/api/v3/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModel.js +5 -2
- package/dist/core/api/v3/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModelProperties.js +3 -1
- package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModels.js +3 -29
- package/dist/core/api/v3/parser/getOperation.d.ts +1 -1
- package/dist/core/api/v3/parser/getOperation.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperation.js +4 -4
- package/dist/core/api/v3/parser/getOperationParameter.d.ts +1 -1
- package/dist/core/api/v3/parser/getOperationParameter.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationParameter.js +6 -3
- package/dist/core/api/v3/parser/getOperationParameters.d.ts +1 -1
- package/dist/core/api/v3/parser/getOperationParameters.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationParameters.js +2 -2
- package/dist/core/api/v3/parser/getOperationRequestBody.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationRequestBody.js +3 -1
- package/dist/core/api/v3/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationResponse.js +3 -1
- package/dist/core/api/v3/parser/getOperationResponses.d.ts +1 -1
- package/dist/core/api/v3/parser/getOperationResponses.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationResponses.js +2 -2
- package/dist/core/api/v3/parser/getServiceName.d.ts +3 -0
- package/dist/core/api/v3/parser/getServiceName.d.ts.map +1 -0
- package/dist/core/api/v3/parser/getServiceName.js +8 -0
- package/dist/core/api/v3/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getServices.js +18 -84
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +22 -10
- package/dist/core/api/v3/types/OpenApiPath.model.d.ts +2 -1
- package/dist/core/api/v3/types/OpenApiPath.model.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +19 -20
- package/dist/core/types/base/ClientArtifacts.model.d.ts +12 -0
- package/dist/core/types/base/ClientArtifacts.model.d.ts.map +1 -0
- package/dist/core/types/base/ExportedModel.model.d.ts +17 -0
- package/dist/core/types/base/ExportedModel.model.d.ts.map +1 -0
- package/dist/core/types/base/ExportedService.model.d.ts +9 -0
- package/dist/core/types/base/ExportedService.model.d.ts.map +1 -0
- package/dist/core/types/base/ExportedService.model.js +2 -0
- package/dist/core/types/base/OutputPaths.model.d.ts +15 -0
- package/dist/core/types/base/OutputPaths.model.d.ts.map +1 -0
- package/dist/core/types/base/OutputPaths.model.js +2 -0
- package/dist/core/types/base/PrefixArtifacts.model.d.ts +6 -0
- package/dist/core/types/base/PrefixArtifacts.model.d.ts.map +1 -0
- package/dist/core/types/base/PrefixArtifacts.model.js +2 -0
- package/dist/core/types/base/PropertyGroup.model.d.ts +4 -0
- package/dist/core/types/base/PropertyGroup.model.d.ts.map +1 -0
- package/dist/core/types/base/PropertyGroup.model.js +2 -0
- package/dist/core/types/base/RefWithtype.model.d.ts +11 -0
- package/dist/core/types/base/RefWithtype.model.d.ts.map +1 -0
- package/dist/core/types/base/RefWithtype.model.js +2 -0
- package/dist/core/types/base/Root.model.d.ts +5 -0
- package/dist/core/types/base/Root.model.d.ts.map +1 -0
- package/dist/core/types/base/Root.model.js +2 -0
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts +10 -0
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts.map +1 -0
- package/dist/core/types/base/SimpleClientArtifacts.model.js +2 -0
- package/dist/core/types/enums/HttpClient.enum.d.ts +7 -0
- package/dist/core/types/enums/HttpClient.enum.d.ts.map +1 -0
- package/dist/core/types/{Enums.js → enums/HttpClient.enum.js} +1 -9
- package/dist/core/types/enums/TypeRef.enum.d.ts +8 -0
- package/dist/core/types/enums/TypeRef.enum.d.ts.map +1 -0
- package/dist/core/types/enums/TypeRef.enum.js +11 -0
- package/dist/core/utils/__tests__/getAbsolutePath.test.js +1 -1
- package/dist/core/utils/__tests__/getGatheringRefs.test.js +3 -6
- package/dist/core/utils/__tests__/getRefFromSchema.test.js +1 -1
- package/dist/core/utils/__tests__/pathHelpers.test.js +4 -4
- package/dist/core/utils/__tests__/refResolver.test.d.ts +2 -0
- package/dist/core/utils/__tests__/refResolver.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/refResolver.test.js +55 -0
- package/dist/core/utils/__tests__/registerHandlebarHelpers.test.js +2 -2
- package/dist/core/utils/__tests__/registerHandlebarTemplates.test.js +7 -3
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.js +67 -0
- package/dist/core/utils/__tests__/sortByRequiredExtended.test.js +24 -24
- package/dist/core/utils/__tests__/sortByRequiredSimple.test.js +13 -13
- package/dist/core/utils/__tests__/writeClientCore.test.js +14 -6
- package/dist/core/utils/__tests__/writeClientFullIndex.test.d.ts +2 -0
- package/dist/core/utils/__tests__/writeClientFullIndex.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/{writeClientIndex.test.js → writeClientFullIndex.test.js} +15 -7
- package/dist/core/utils/__tests__/writeClientModels.test.js +15 -7
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +15 -7
- package/dist/core/utils/__tests__/writeClientServices.test.js +15 -7
- package/dist/core/utils/advancedDeduplicatePath.d.ts +5 -0
- package/dist/core/utils/advancedDeduplicatePath.d.ts.map +1 -0
- package/dist/core/utils/advancedDeduplicatePath.js +29 -0
- package/dist/core/utils/appendUniqueLinesToFile.d.ts +2 -0
- package/dist/core/utils/appendUniqueLinesToFile.d.ts.map +1 -0
- package/dist/core/utils/appendUniqueLinesToFile.js +24 -0
- package/dist/core/utils/createNormalizedRef.d.ts +7 -0
- package/dist/core/utils/createNormalizedRef.d.ts.map +1 -0
- package/dist/core/utils/createNormalizedRef.js +24 -0
- package/dist/core/utils/findCommonParent.d.ts +7 -0
- package/dist/core/utils/findCommonParent.d.ts.map +1 -0
- package/dist/core/utils/findCommonParent.js +20 -0
- package/dist/core/utils/getAbsolutePath.d.ts.map +1 -1
- package/dist/core/utils/getAbsolutePath.js +16 -5
- package/dist/core/utils/getGatheringRefs.d.ts +2 -2
- package/dist/core/utils/getGatheringRefs.d.ts.map +1 -1
- package/dist/core/utils/getGatheringRefs.js +26 -17
- package/dist/core/utils/getMappedType.d.ts +0 -1
- package/dist/core/utils/getMappedType.d.ts.map +1 -1
- package/dist/core/utils/getMappedType.js +3 -4
- package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
- package/dist/core/utils/getOpenApiSpec.js +9 -32
- package/dist/core/utils/getOutputPaths.d.ts +2 -2
- package/dist/core/utils/getOutputPaths.d.ts.map +1 -1
- package/dist/core/utils/getPropertyGroupExtended.d.ts +2 -2
- package/dist/core/utils/getPropertyGroupExtended.d.ts.map +1 -1
- package/dist/core/utils/getPropertyGroupSimple.d.ts +2 -2
- package/dist/core/utils/getPropertyGroupSimple.d.ts.map +1 -1
- package/dist/core/utils/getRefFromSchema.js +2 -2
- package/dist/core/utils/getRelativeModelImportPath.js +1 -1
- package/dist/core/utils/getRelativeModelPath.d.ts.map +1 -1
- package/dist/core/utils/getRelativeModelPath.js +5 -0
- package/dist/core/utils/isDirectory.d.ts +2 -0
- package/dist/core/utils/isDirectory.d.ts.map +1 -0
- package/dist/core/utils/isDirectory.js +13 -0
- package/dist/core/utils/isFileName.d.ts +7 -0
- package/dist/core/utils/isFileName.d.ts.map +1 -0
- package/dist/core/utils/isFileName.js +30 -0
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts +10 -0
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts.map +1 -0
- package/dist/core/utils/mapPathToTargetDirSafe.js +49 -0
- package/dist/core/utils/modelHelpers.d.ts +28 -0
- package/dist/core/utils/modelHelpers.d.ts.map +1 -0
- package/dist/core/utils/modelHelpers.js +73 -0
- package/dist/core/utils/normalizeAllRefs.d.ts +6 -0
- package/dist/core/utils/normalizeAllRefs.d.ts.map +1 -0
- package/dist/core/utils/normalizeAllRefs.js +35 -0
- package/dist/core/utils/normalizePath.d.ts +5 -0
- package/dist/core/utils/normalizePath.d.ts.map +1 -0
- package/dist/core/utils/normalizePath.js +19 -0
- package/dist/core/utils/normalizeRef.d.ts +5 -0
- package/dist/core/utils/normalizeRef.d.ts.map +1 -0
- package/dist/core/utils/normalizeRef.js +17 -0
- package/dist/core/utils/parseRef.d.ts +18 -0
- package/dist/core/utils/parseRef.d.ts.map +1 -0
- package/dist/core/utils/parseRef.js +64 -0
- package/dist/core/utils/pathHelpers.d.ts +1 -0
- package/dist/core/utils/pathHelpers.d.ts.map +1 -1
- package/dist/core/utils/pathHelpers.js +23 -3
- package/dist/core/utils/prepareAlias.d.ts +2 -6
- package/dist/core/utils/prepareAlias.d.ts.map +1 -1
- package/dist/core/utils/prepareAlias.js +0 -4
- package/dist/core/utils/prepareOptions.d.ts.map +1 -1
- package/dist/core/utils/prepareOptions.js +5 -7
- package/dist/core/utils/registerHandlebarHelpers.d.ts +1 -1
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.d.ts +9 -2
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +14 -2
- package/dist/core/utils/resolveRefPath.d.ts +7 -0
- package/dist/core/utils/resolveRefPath.d.ts.map +1 -0
- package/dist/core/utils/resolveRefPath.js +34 -0
- package/dist/core/utils/resolveRefToImportPath.d.ts +7 -0
- package/dist/core/utils/resolveRefToImportPath.d.ts.map +1 -0
- package/dist/core/utils/resolveRefToImportPath.js +45 -0
- package/dist/core/utils/serviceHelpers.d.ts +41 -0
- package/dist/core/utils/serviceHelpers.d.ts.map +1 -0
- package/dist/core/utils/serviceHelpers.js +115 -0
- package/dist/core/utils/sortModelByName.d.ts +2 -2
- package/dist/core/utils/sortModelByName.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.d.ts +4 -2
- package/dist/core/utils/writeClientCore.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.js +4 -1
- package/dist/core/utils/writeClientCoreIndex.d.ts +11 -0
- package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -0
- package/dist/core/utils/writeClientCoreIndex.js +16 -0
- package/dist/core/utils/writeClientFullIndex.d.ts +9 -0
- package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -0
- package/dist/core/utils/writeClientFullIndex.js +22 -0
- package/dist/core/utils/writeClientModels.d.ts +3 -2
- package/dist/core/utils/writeClientModels.d.ts.map +1 -1
- package/dist/core/utils/writeClientModels.js +5 -0
- package/dist/core/utils/writeClientModelsIndex.d.ts +12 -0
- package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -0
- package/dist/core/utils/writeClientModelsIndex.js +16 -0
- package/dist/core/utils/writeClientSchemas.d.ts +3 -2
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +5 -0
- package/dist/core/utils/writeClientSchemasIndex.d.ts +12 -0
- package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -0
- package/dist/core/utils/writeClientSchemasIndex.js +16 -0
- package/dist/core/utils/writeClientServices.d.ts +5 -4
- package/dist/core/utils/writeClientServices.d.ts.map +1 -1
- package/dist/core/utils/writeClientServices.js +4 -0
- package/dist/core/utils/writeClientServicesIndex.d.ts +12 -0
- package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -0
- package/dist/core/utils/writeClientServicesIndex.js +16 -0
- package/dist/core/utils/writeClientSimpleIndex.d.ts +9 -0
- package/dist/core/utils/writeClientSimpleIndex.d.ts.map +1 -0
- package/dist/core/utils/writeClientSimpleIndex.js +22 -0
- package/dist/templatesCompiled/exportModel.js +2 -2
- package/dist/templatesCompiled/indexCore.d.ts +9 -0
- package/dist/templatesCompiled/indexCore.d.ts.map +1 -0
- package/dist/templatesCompiled/indexCore.js +22 -0
- package/dist/templatesCompiled/{index.d.ts → indexFull.d.ts} +1 -1
- package/dist/templatesCompiled/indexFull.d.ts.map +1 -0
- package/dist/templatesCompiled/indexModels.d.ts +15 -0
- package/dist/templatesCompiled/indexModels.d.ts.map +1 -0
- package/dist/templatesCompiled/indexModels.js +82 -0
- package/dist/templatesCompiled/indexServices.d.ts +10 -0
- package/dist/templatesCompiled/indexServices.d.ts.map +1 -0
- package/dist/templatesCompiled/indexServices.js +35 -0
- package/dist/templatesCompiled/indexShemas.d.ts +11 -0
- package/dist/templatesCompiled/indexShemas.d.ts.map +1 -0
- package/dist/templatesCompiled/indexShemas.js +47 -0
- package/dist/templatesCompiled/indexSimple.d.ts +21 -0
- package/dist/templatesCompiled/indexSimple.d.ts.map +1 -0
- package/dist/templatesCompiled/indexSimple.js +121 -0
- package/package.json +7 -4
- package/dist/common/VersionedSchema/MultiOptionsMigrationPlan.d.ts.map +0 -1
- package/dist/common/VersionedSchema/MultiOptionsSchemaV1.d.ts +0 -6
- package/dist/common/VersionedSchema/MultiOptionsSchemaV1.d.ts.map +0 -1
- package/dist/common/VersionedSchema/MultiOptionsSchemaV2.d.ts +0 -6
- package/dist/common/VersionedSchema/MultiOptionsSchemaV2.d.ts.map +0 -1
- package/dist/common/VersionedSchema/MultiOptionsSchemaV3.d.ts +0 -5
- package/dist/common/VersionedSchema/MultiOptionsSchemaV3.d.ts.map +0 -1
- package/dist/common/VersionedSchema/MultiOptionsSchemaV4.d.ts +0 -6
- package/dist/common/VersionedSchema/MultiOptionsSchemaV4.d.ts.map +0 -1
- package/dist/common/VersionedSchema/MultiOptionsVersionedSchemas.d.ts +0 -3
- package/dist/common/VersionedSchema/MultiOptionsVersionedSchemas.d.ts.map +0 -1
- package/dist/common/VersionedSchema/OptionsMigrationPlans.d.ts.map +0 -1
- package/dist/common/VersionedSchema/OptionsMigrationPlans.js +0 -15
- package/dist/common/VersionedSchema/OptionsSchemaV1.d.ts +0 -6
- package/dist/common/VersionedSchema/OptionsSchemaV1.d.ts.map +0 -1
- package/dist/common/VersionedSchema/OptionsSchemaV2.d.ts +0 -6
- package/dist/common/VersionedSchema/OptionsSchemaV2.d.ts.map +0 -1
- package/dist/common/VersionedSchema/OptionsSchemaV3.d.ts +0 -5
- package/dist/common/VersionedSchema/OptionsSchemaV3.d.ts.map +0 -1
- package/dist/common/VersionedSchema/OptionsVersionedSchemas.d.ts +0 -3
- package/dist/common/VersionedSchema/OptionsVersionedSchemas.d.ts.map +0 -1
- package/dist/core/types/Enums.d.ts +0 -14
- package/dist/core/types/Enums.d.ts.map +0 -1
- package/dist/core/types/Models.d.ts +0 -37
- package/dist/core/types/Models.d.ts.map +0 -1
- package/dist/core/types/shared/ConverterData.model.d.ts +0 -7
- package/dist/core/types/shared/ConverterData.model.d.ts.map +0 -1
- package/dist/core/utils/__tests__/writeClientIndex.test.d.ts +0 -2
- package/dist/core/utils/__tests__/writeClientIndex.test.d.ts.map +0 -1
- package/dist/core/utils/writeClientIndex.d.ts +0 -59
- package/dist/core/utils/writeClientIndex.d.ts.map +0 -1
- package/dist/core/utils/writeClientIndex.js +0 -27
- package/dist/templatesCompiled/index.d.ts.map +0 -1
- /package/dist/core/types/{Models.js → base/ClientArtifacts.model.js} +0 -0
- /package/dist/core/types/{shared/ConverterData.model.js → base/ExportedModel.model.js} +0 -0
- /package/dist/templatesCompiled/{index.js → indexFull.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeRef.d.ts","sourceRoot":"","sources":["../../../src/core/utils/normalizeRef.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAQxE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeRef = normalizeRef;
|
|
4
|
+
const createNormalizedRef_1 = require("./createNormalizedRef");
|
|
5
|
+
const normalizePath_1 = require("./normalizePath");
|
|
6
|
+
const parseRef_1 = require("./parseRef");
|
|
7
|
+
const resolveRefPath_1 = require("./resolveRefPath");
|
|
8
|
+
/**
|
|
9
|
+
* Normalize a single $ref (returns normalized resolved path + fragment when present).
|
|
10
|
+
*/
|
|
11
|
+
function normalizeRef(ref, parentFilePath) {
|
|
12
|
+
const parsedRef = (0, parseRef_1.parseRef)(ref);
|
|
13
|
+
const resolvedPath = (0, resolveRefPath_1.resolveRefPath)(parsedRef, parentFilePath);
|
|
14
|
+
// Normalize the path to prevent duplication issues
|
|
15
|
+
const normalizedPath = (0, normalizePath_1.normalizePath)(resolvedPath);
|
|
16
|
+
return (0, createNormalizedRef_1.createNormalizedRef)(parsedRef, normalizedPath);
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare enum RefType {
|
|
2
|
+
LOCAL_FRAGMENT = "local_fragment",
|
|
3
|
+
EXTERNAL_FILE = "external_file",
|
|
4
|
+
EXTERNAL_FILE_FRAGMENT = "external_file_fragment",
|
|
5
|
+
HTTP_URL = "http_url",
|
|
6
|
+
ABSOLUTE_PATH = "absolute_path"
|
|
7
|
+
}
|
|
8
|
+
export interface ParsedRef {
|
|
9
|
+
type: RefType;
|
|
10
|
+
filePath?: string;
|
|
11
|
+
fragment?: string;
|
|
12
|
+
originalRef: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Parse a $ref string to determine its type and components
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseRef(ref: string): ParsedRef;
|
|
18
|
+
//# sourceMappingURL=parseRef.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseRef.d.ts","sourceRoot":"","sources":["../../../src/core/utils/parseRef.ts"],"names":[],"mappings":"AAEA,oBAAY,OAAO;IACf,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,sBAAsB,2BAA2B;IACjD,QAAQ,aAAa;IACrB,aAAa,kBAAkB;CAClC;AAED,MAAM,WAAW,SAAS;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAiD/C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RefType = void 0;
|
|
7
|
+
exports.parseRef = parseRef;
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
var RefType;
|
|
10
|
+
(function (RefType) {
|
|
11
|
+
RefType["LOCAL_FRAGMENT"] = "local_fragment";
|
|
12
|
+
RefType["EXTERNAL_FILE"] = "external_file";
|
|
13
|
+
RefType["EXTERNAL_FILE_FRAGMENT"] = "external_file_fragment";
|
|
14
|
+
RefType["HTTP_URL"] = "http_url";
|
|
15
|
+
RefType["ABSOLUTE_PATH"] = "absolute_path";
|
|
16
|
+
})(RefType || (exports.RefType = RefType = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Parse a $ref string to determine its type and components
|
|
19
|
+
*/
|
|
20
|
+
function parseRef(ref) {
|
|
21
|
+
if (!ref || typeof ref !== 'string') {
|
|
22
|
+
return { type: RefType.LOCAL_FRAGMENT, originalRef: ref };
|
|
23
|
+
}
|
|
24
|
+
// HTTP URLs
|
|
25
|
+
if (ref.startsWith('http://') || ref.startsWith('https://')) {
|
|
26
|
+
return {
|
|
27
|
+
type: RefType.HTTP_URL,
|
|
28
|
+
originalRef: ref
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Absolute paths (POSIX/Windows handled by path.isAbsolute)
|
|
32
|
+
if (path_1.default.isAbsolute(ref)) {
|
|
33
|
+
const [filePath, fragment] = ref.split('#');
|
|
34
|
+
return {
|
|
35
|
+
type: RefType.ABSOLUTE_PATH,
|
|
36
|
+
filePath,
|
|
37
|
+
fragment: fragment ? `#${fragment}` : undefined,
|
|
38
|
+
originalRef: ref
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Local fragment
|
|
42
|
+
if (ref.startsWith('#/')) {
|
|
43
|
+
return {
|
|
44
|
+
type: RefType.LOCAL_FRAGMENT,
|
|
45
|
+
fragment: ref,
|
|
46
|
+
originalRef: ref
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
// External file references (may include fragment)
|
|
50
|
+
const [filePath, fragment] = ref.split('#');
|
|
51
|
+
if (fragment) {
|
|
52
|
+
return {
|
|
53
|
+
type: RefType.EXTERNAL_FILE_FRAGMENT,
|
|
54
|
+
filePath,
|
|
55
|
+
fragment: `#${fragment}`,
|
|
56
|
+
originalRef: ref
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
type: RefType.EXTERNAL_FILE,
|
|
61
|
+
filePath,
|
|
62
|
+
originalRef: ref
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -3,4 +3,5 @@ export declare function join(...paths: string[]): string;
|
|
|
3
3
|
export declare function relative(from: string, to: string): string;
|
|
4
4
|
export declare function resolve(...pathSegments: string[]): string;
|
|
5
5
|
export declare function normalize(p: string): string;
|
|
6
|
+
export declare function joinToDir(parentFilePath: string, fileName: string): string;
|
|
6
7
|
//# sourceMappingURL=pathHelpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/pathHelpers.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"pathHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/pathHelpers.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAyBzD;AAED,wBAAgB,OAAO,CAAC,GAAG,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1E"}
|
|
@@ -8,6 +8,7 @@ exports.join = join;
|
|
|
8
8
|
exports.relative = relative;
|
|
9
9
|
exports.resolve = resolve;
|
|
10
10
|
exports.normalize = normalize;
|
|
11
|
+
exports.joinToDir = joinToDir;
|
|
11
12
|
const path_1 = __importDefault(require("path"));
|
|
12
13
|
const Consts_1 = require("../types/Consts");
|
|
13
14
|
function dirName(p) {
|
|
@@ -17,9 +18,25 @@ function join(...paths) {
|
|
|
17
18
|
return path_1.default.join(...paths).replace(Consts_1.SEARCH_REGEXP, '/');
|
|
18
19
|
}
|
|
19
20
|
function relative(from, to) {
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
// Defensive defaults
|
|
22
|
+
const fromSafe = from || '.';
|
|
23
|
+
const toSafe = to || '.';
|
|
24
|
+
// Get native relative and convert to POSIX separators
|
|
25
|
+
const relativePath = path_1.default.relative(fromSafe, toSafe).replace(Consts_1.SEARCH_REGEXP, '/');
|
|
26
|
+
// If empty -> same path
|
|
27
|
+
if (!relativePath || relativePath === '') {
|
|
28
|
+
return './';
|
|
29
|
+
}
|
|
30
|
+
// If result is absolute (starts with '/'), return normalized absolute
|
|
31
|
+
if (relativePath.startsWith('/')) {
|
|
32
|
+
return relativePath;
|
|
33
|
+
}
|
|
34
|
+
// If it already starts with '.' (./ or ../) return as-is
|
|
35
|
+
if (relativePath.startsWith('.')) {
|
|
36
|
+
return relativePath;
|
|
37
|
+
}
|
|
38
|
+
// Otherwise make explicit relative path (./something)
|
|
39
|
+
return `./${relativePath}`;
|
|
23
40
|
}
|
|
24
41
|
function resolve(...pathSegments) {
|
|
25
42
|
return path_1.default.resolve(...pathSegments).replace(Consts_1.SEARCH_REGEXP, '/');
|
|
@@ -27,3 +44,6 @@ function resolve(...pathSegments) {
|
|
|
27
44
|
function normalize(p) {
|
|
28
45
|
return path_1.default.normalize(p).replace(Consts_1.SEARCH_REGEXP, '/');
|
|
29
46
|
}
|
|
47
|
+
function joinToDir(parentFilePath, fileName) {
|
|
48
|
+
return resolve(dirName(parentFilePath), fileName);
|
|
49
|
+
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
* Function for creating aliases for names
|
|
4
|
-
* @param models Array of models
|
|
5
|
-
*/
|
|
6
|
-
export declare function prepareAlias(models: IModel[]): void;
|
|
1
|
+
import { ExportedModel } from "../types/base/ExportedModel.model";
|
|
2
|
+
export declare function prepareAlias(models: ExportedModel[]): void;
|
|
7
3
|
//# sourceMappingURL=prepareAlias.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareAlias.d.ts","sourceRoot":"","sources":["../../../src/core/utils/prepareAlias.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"prepareAlias.d.ts","sourceRoot":"","sources":["../../../src/core/utils/prepareAlias.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,QAenD"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareAlias = prepareAlias;
|
|
4
|
-
/**
|
|
5
|
-
* Function for creating aliases for names
|
|
6
|
-
* @param models Array of models
|
|
7
|
-
*/
|
|
8
4
|
function prepareAlias(models) {
|
|
9
5
|
let modelPrevious = undefined;
|
|
10
6
|
let index = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareOptions.d.ts","sourceRoot":"","sources":["../../../src/core/utils/prepareOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAI/C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"prepareOptions.d.ts","sourceRoot":"","sources":["../../../src/core/utils/prepareOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAI/C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAoB1D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareOptions = prepareOptions;
|
|
4
|
-
const
|
|
4
|
+
const HttpClient_enum_1 = require("../types/enums/HttpClient.enum");
|
|
5
5
|
const isBoolean_1 = require("./isBoolean");
|
|
6
6
|
/**
|
|
7
7
|
* Preparation the configuration
|
|
@@ -16,18 +16,16 @@ function prepareOptions(options) {
|
|
|
16
16
|
outputServices: options?.outputServices ? options.outputServices : '',
|
|
17
17
|
outputModels: options?.outputModels ? options.outputModels : '',
|
|
18
18
|
outputSchemas: options?.outputSchemas ? options.outputSchemas : '',
|
|
19
|
-
httpClient: options?.httpClient ? options.httpClient :
|
|
19
|
+
httpClient: options?.httpClient ? options.httpClient : HttpClient_enum_1.HttpClient.FETCH,
|
|
20
20
|
useOptions: (0, isBoolean_1.isBoolean)(options?.useOptions),
|
|
21
21
|
useUnionTypes: (0, isBoolean_1.isBoolean)(options?.useUnionTypes),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
exportModels: (0, isBoolean_1.isBoolean)(options?.exportModels, true),
|
|
25
|
-
exportSchemas: (0, isBoolean_1.isBoolean)(options?.exportSchemas),
|
|
26
|
-
clean: (0, isBoolean_1.isBoolean)(options?.clean, true),
|
|
22
|
+
excludeCoreServiceFiles: (0, isBoolean_1.isBoolean)(options?.excludeCoreServiceFiles, false),
|
|
23
|
+
includeSchemasFiles: (0, isBoolean_1.isBoolean)(options?.includeSchemasFiles, false),
|
|
27
24
|
request: options?.request ? options.request : '',
|
|
28
25
|
interfacePrefix: options?.interfacePrefix ? options.interfacePrefix : 'I',
|
|
29
26
|
enumPrefix: options?.enumPrefix ? options.enumPrefix : 'E',
|
|
30
27
|
typePrefix: options?.typePrefix ? options.typePrefix : 'T',
|
|
31
28
|
useCancelableRequest: (0, isBoolean_1.isBoolean)(options?.useCancelableRequest),
|
|
29
|
+
useSeparatedIndexes: (0, isBoolean_1.isBoolean)(options?.useSeparatedIndexes),
|
|
32
30
|
};
|
|
33
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerHandlebarHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/registerHandlebarHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"registerHandlebarHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/registerHandlebarHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAK5D,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAgD5H"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import * as Handlebars from 'handlebars/runtime';
|
|
2
|
-
import { HttpClient } from '../types/
|
|
2
|
+
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
3
3
|
export interface Templates {
|
|
4
|
-
|
|
4
|
+
indexes: {
|
|
5
|
+
full: Handlebars.TemplateDelegate;
|
|
6
|
+
simple: Handlebars.TemplateDelegate;
|
|
7
|
+
core: Handlebars.TemplateDelegate;
|
|
8
|
+
models: Handlebars.TemplateDelegate;
|
|
9
|
+
schemas: Handlebars.TemplateDelegate;
|
|
10
|
+
services: Handlebars.TemplateDelegate;
|
|
11
|
+
};
|
|
5
12
|
exports: {
|
|
6
13
|
model: Handlebars.TemplateDelegate;
|
|
7
14
|
schema: Handlebars.TemplateDelegate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerHandlebarTemplates.d.ts","sourceRoot":"","sources":["../../../src/core/utils/registerHandlebarTemplates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"registerHandlebarTemplates.d.ts","sourceRoot":"","sources":["../../../src/core/utils/registerHandlebarTemplates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAuFjD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE;QACL,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAClC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACpC,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAClC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACpC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACrC,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC;KACzC,CAAA;IACD,OAAO,EAAE;QACL,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACnC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACpC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC;KACxC,CAAC;IACF,IAAI,EAAE;QACF,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACtC,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACtC,iBAAiB,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAC/C,SAAS,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACvC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC;QACrC,iBAAiB,EAAE,UAAU,CAAC,gBAAgB,CAAC;QAC/C,cAAc,EAAE,UAAU,CAAC,gBAAgB,CAAC;KAC/C,CAAC;CACL;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CA4GnI"}
|
|
@@ -86,7 +86,12 @@ const sendRequest_4 = __importDefault(require("../../templatesCompiled/core/xhr/
|
|
|
86
86
|
const exportModel_1 = __importDefault(require("../../templatesCompiled/exportModel"));
|
|
87
87
|
const exportSchema_1 = __importDefault(require("../../templatesCompiled/exportSchema"));
|
|
88
88
|
const exportService_1 = __importDefault(require("../../templatesCompiled/exportService"));
|
|
89
|
-
const
|
|
89
|
+
const indexFull_1 = __importDefault(require("../../templatesCompiled/indexFull"));
|
|
90
|
+
const indexSimple_1 = __importDefault(require("../../templatesCompiled/indexSimple"));
|
|
91
|
+
const indexCore_1 = __importDefault(require("../../templatesCompiled/indexCore"));
|
|
92
|
+
const indexModels_1 = __importDefault(require("../../templatesCompiled/indexModels"));
|
|
93
|
+
const indexShemas_1 = __importDefault(require("../../templatesCompiled/indexShemas"));
|
|
94
|
+
const indexServices_1 = __importDefault(require("../../templatesCompiled/indexServices"));
|
|
90
95
|
const base_1 = __importDefault(require("../../templatesCompiled/partials/base"));
|
|
91
96
|
const exportComposition_1 = __importDefault(require("../../templatesCompiled/partials/exportComposition"));
|
|
92
97
|
const exportEnum_1 = __importDefault(require("../../templatesCompiled/partials/exportEnum"));
|
|
@@ -127,7 +132,14 @@ function registerHandlebarTemplates(root) {
|
|
|
127
132
|
(0, registerHandlebarHelpers_1.registerHandlebarHelpers)(root);
|
|
128
133
|
// Main templates (entry points for the files we write to disk)
|
|
129
134
|
const templates = {
|
|
130
|
-
|
|
135
|
+
indexes: {
|
|
136
|
+
full: Handlebars.template(indexFull_1.default),
|
|
137
|
+
simple: Handlebars.template(indexSimple_1.default),
|
|
138
|
+
core: Handlebars.template(indexCore_1.default),
|
|
139
|
+
models: Handlebars.template(indexModels_1.default),
|
|
140
|
+
schemas: Handlebars.template(indexShemas_1.default),
|
|
141
|
+
services: Handlebars.template(indexServices_1.default),
|
|
142
|
+
},
|
|
131
143
|
exports: {
|
|
132
144
|
model: Handlebars.template(exportModel_1.default),
|
|
133
145
|
schema: Handlebars.template(exportSchema_1.default),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ParsedRef } from './parseRef';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a parsed reference to an absolute path (when applicable).
|
|
4
|
+
* parentFilePath is expected to be a file path (absolute or relative).
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveRefPath(parsedRef: ParsedRef, parentFilePath: string): string;
|
|
7
|
+
//# sourceMappingURL=resolveRefPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRefPath.d.ts","sourceRoot":"","sources":["../../../src/core/utils/resolveRefPath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAW,MAAM,YAAY,CAAC;AAGhD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CA4BnF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRefPath = resolveRefPath;
|
|
4
|
+
const advancedDeduplicatePath_1 = require("./advancedDeduplicatePath");
|
|
5
|
+
const parseRef_1 = require("./parseRef");
|
|
6
|
+
const pathHelpers_1 = require("./pathHelpers");
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a parsed reference to an absolute path (when applicable).
|
|
9
|
+
* parentFilePath is expected to be a file path (absolute or relative).
|
|
10
|
+
*/
|
|
11
|
+
function resolveRefPath(parsedRef, parentFilePath) {
|
|
12
|
+
// For correct operation, parentDir must be the path to the directory, not the file.
|
|
13
|
+
const parentDir = (0, pathHelpers_1.dirName)(parentFilePath.split('#')[0]);
|
|
14
|
+
switch (parsedRef.type) {
|
|
15
|
+
case parseRef_1.RefType.LOCAL_FRAGMENT:
|
|
16
|
+
// For local fragments, use the parent file path
|
|
17
|
+
return parentFilePath.split('#')[0];
|
|
18
|
+
case parseRef_1.RefType.EXTERNAL_FILE:
|
|
19
|
+
case parseRef_1.RefType.EXTERNAL_FILE_FRAGMENT:
|
|
20
|
+
// Resolve relative to parent file directory
|
|
21
|
+
if (parsedRef.filePath) {
|
|
22
|
+
const resolvedPath = (0, pathHelpers_1.resolve)(parentDir, parsedRef.filePath);
|
|
23
|
+
// Clean any duplicate path segments
|
|
24
|
+
return (0, advancedDeduplicatePath_1.advancedDeduplicatePath)(resolvedPath);
|
|
25
|
+
}
|
|
26
|
+
return parentFilePath;
|
|
27
|
+
case parseRef_1.RefType.ABSOLUTE_PATH:
|
|
28
|
+
return parsedRef.filePath || parentFilePath;
|
|
29
|
+
case parseRef_1.RefType.HTTP_URL:
|
|
30
|
+
return parsedRef.originalRef;
|
|
31
|
+
default:
|
|
32
|
+
return parentFilePath;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function resolveRefToImportPath({ mainSpecPath, parentFilePath, refValuePath, outputModelsPath, }: {
|
|
2
|
+
mainSpecPath: string;
|
|
3
|
+
parentFilePath: string;
|
|
4
|
+
refValuePath: string;
|
|
5
|
+
outputModelsPath: string;
|
|
6
|
+
}): string;
|
|
7
|
+
//# sourceMappingURL=resolveRefToImportPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRefToImportPath.d.ts","sourceRoot":"","sources":["../../../src/core/utils/resolveRefToImportPath.ts"],"names":[],"mappings":"AASA,wBAAgB,sBAAsB,CAAC,EACnC,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,gBAAgB,GACnB,EAAE;IACC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC5B,UA+CA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRefToImportPath = resolveRefToImportPath;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const isDirectory_1 = require("./isDirectory");
|
|
6
|
+
const isFileName_1 = require("./isFileName");
|
|
7
|
+
const mapPathToTargetDirSafe_1 = require("./mapPathToTargetDirSafe");
|
|
8
|
+
const parseRef_1 = require("./parseRef");
|
|
9
|
+
const pathHelpers_1 = require("./pathHelpers");
|
|
10
|
+
const stripNamespace_1 = require("./stripNamespace");
|
|
11
|
+
function resolveRefToImportPath({ mainSpecPath, parentFilePath, refValuePath, outputModelsPath, }) {
|
|
12
|
+
const absOutputModelsPath = (0, path_1.resolve)(outputModelsPath);
|
|
13
|
+
const sourceRoot = (0, isDirectory_1.isDirectory)(mainSpecPath) ? mainSpecPath : (0, path_1.dirname)(mainSpecPath);
|
|
14
|
+
const parsed = (0, parseRef_1.parseRef)(refValuePath);
|
|
15
|
+
// KEY CASE: internal link (#/components/schemas/Xxx)
|
|
16
|
+
if (parsed.type === parseRef_1.RefType.LOCAL_FRAGMENT) {
|
|
17
|
+
// stripNamespace transform "#/components/schemas/AccountField" → "AccountField"
|
|
18
|
+
const modelName = (0, stripNamespace_1.stripNamespace)(refValuePath);
|
|
19
|
+
// Determinarea de unde provine legătura (pentru o cale relativă)
|
|
20
|
+
const cleanParent = (0, stripNamespace_1.stripNamespace)(parentFilePath || mainSpecPath);
|
|
21
|
+
const parentDirInSource = (0, path_1.dirname)(cleanParent);
|
|
22
|
+
const parentDirInOutput = (0, mapPathToTargetDirSafe_1.mapPathToTargetDirSafe)(parentDirInSource, sourceRoot, outputModelsPath);
|
|
23
|
+
// Crearea căii către fișierul model
|
|
24
|
+
const modelFilePathInOutput = (0, path_1.resolve)(parentDirInOutput, modelName);
|
|
25
|
+
const absModelPath = (0, path_1.resolve)(modelFilePathInOutput);
|
|
26
|
+
if (!absModelPath.startsWith(absOutputModelsPath + '/') && absModelPath !== absOutputModelsPath) {
|
|
27
|
+
return `./${modelName}`;
|
|
28
|
+
}
|
|
29
|
+
const relativePath = (0, path_1.relative)(absOutputModelsPath, absModelPath);
|
|
30
|
+
return `./${relativePath.replace(/\\/g, '/')}`;
|
|
31
|
+
}
|
|
32
|
+
// Restul cazurilor sunt legături externe (funcționează ca înainte)
|
|
33
|
+
const parentClean = (0, stripNamespace_1.stripNamespace)(parentFilePath || '') || '';
|
|
34
|
+
const refValueClean = (0, stripNamespace_1.stripNamespace)(refValuePath || '') || refValuePath;
|
|
35
|
+
const parentDirForResolve = parentClean ? (0, path_1.dirname)(parentClean) : sourceRoot;
|
|
36
|
+
const targetFileAbs = (0, isFileName_1.isFileName)(refValueClean) ? (0, pathHelpers_1.joinToDir)(parentDirForResolve, refValueClean) : (0, path_1.resolve)(parentDirForResolve, refValueClean);
|
|
37
|
+
const targetPathInOutput = (0, mapPathToTargetDirSafe_1.mapPathToTargetDirSafe)(targetFileAbs, sourceRoot, outputModelsPath);
|
|
38
|
+
const absTargetPath = (0, path_1.resolve)(targetPathInOutput);
|
|
39
|
+
if (!absTargetPath.startsWith(absOutputModelsPath + '/') && absTargetPath !== absOutputModelsPath) {
|
|
40
|
+
const fallbackName = (0, stripNamespace_1.stripNamespace)((0, path_1.basename)(targetFileAbs));
|
|
41
|
+
return `./${fallbackName}`;
|
|
42
|
+
}
|
|
43
|
+
const relativePath = (0, path_1.relative)(absOutputModelsPath, absTargetPath);
|
|
44
|
+
return `./${relativePath.replace(/\\/g, '/')}`;
|
|
45
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Service } from '../types/shared/Service.model';
|
|
2
|
+
/**
|
|
3
|
+
* Iterate over supported HTTP methods in a path object and call callback for each found operation.
|
|
4
|
+
*
|
|
5
|
+
* @param pathObj - OpenAPI Path object (may contain methods like get, post, etc.)
|
|
6
|
+
* @param cb - callback invoked as cb(method, operation)
|
|
7
|
+
*/
|
|
8
|
+
export declare function forEachOperationInPath(pathObj: Record<string, any>, cb: (method: string, op: any) => void): void;
|
|
9
|
+
/**
|
|
10
|
+
* Ensure service exists in the services map or create a new one.
|
|
11
|
+
*
|
|
12
|
+
* @param services - Map of services
|
|
13
|
+
* @param name - service name
|
|
14
|
+
* @param originName - originName (optional) used when creating a new service
|
|
15
|
+
* @returns existing or newly created Service
|
|
16
|
+
*/
|
|
17
|
+
export declare function ensureService(services: Map<string, Service>, name: string, originName?: string): Service;
|
|
18
|
+
/**
|
|
19
|
+
* Merge operation.imports into service.imports.
|
|
20
|
+
* - Reuse existing import objects in service.imports by matching path.
|
|
21
|
+
* - Replace operation.imports entries with the reused ones when found.
|
|
22
|
+
*
|
|
23
|
+
* This preserves identity of import objects so alias assignment is consistent.
|
|
24
|
+
*
|
|
25
|
+
* @param service - service to merge into
|
|
26
|
+
* @param operation - operation whose imports should be merged
|
|
27
|
+
*/
|
|
28
|
+
export declare function mergeOperationImportsIntoService(service: Service, operation: any): void;
|
|
29
|
+
/**
|
|
30
|
+
* Finalize imports for a service:
|
|
31
|
+
* - Deduplicate and sort imports
|
|
32
|
+
* - Assign aliases for duplicate import names (name, name$1, name$2, ...)
|
|
33
|
+
* - Propagate assigned aliases to models referenced in operations (results, parameters)
|
|
34
|
+
*
|
|
35
|
+
* Modifies service in-place and returns it.
|
|
36
|
+
*
|
|
37
|
+
* @param service - Service to finalize
|
|
38
|
+
* @returns service
|
|
39
|
+
*/
|
|
40
|
+
export declare function finalizeServiceImports(service: Service): Service;
|
|
41
|
+
//# sourceMappingURL=serviceHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceHelpers.d.ts","sourceRoot":"","sources":["../../../src/core/utils/serviceHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAK7D;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAOhH;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAWxG;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAMvF;AAcD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiChE"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.forEachOperationInPath = forEachOperationInPath;
|
|
4
|
+
exports.ensureService = ensureService;
|
|
5
|
+
exports.mergeOperationImportsIntoService = mergeOperationImportsIntoService;
|
|
6
|
+
exports.finalizeServiceImports = finalizeServiceImports;
|
|
7
|
+
const unique_1 = require("./unique");
|
|
8
|
+
const SUPPORTED_METHODS = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch'];
|
|
9
|
+
/**
|
|
10
|
+
* Iterate over supported HTTP methods in a path object and call callback for each found operation.
|
|
11
|
+
*
|
|
12
|
+
* @param pathObj - OpenAPI Path object (may contain methods like get, post, etc.)
|
|
13
|
+
* @param cb - callback invoked as cb(method, operation)
|
|
14
|
+
*/
|
|
15
|
+
function forEachOperationInPath(pathObj, cb) {
|
|
16
|
+
for (const method in pathObj) {
|
|
17
|
+
if (!Object.prototype.hasOwnProperty.call(pathObj, method))
|
|
18
|
+
continue;
|
|
19
|
+
if (SUPPORTED_METHODS.includes(method) && pathObj[method]) {
|
|
20
|
+
cb(method, pathObj[method]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Ensure service exists in the services map or create a new one.
|
|
26
|
+
*
|
|
27
|
+
* @param services - Map of services
|
|
28
|
+
* @param name - service name
|
|
29
|
+
* @param originName - originName (optional) used when creating a new service
|
|
30
|
+
* @returns existing or newly created Service
|
|
31
|
+
*/
|
|
32
|
+
function ensureService(services, name, originName) {
|
|
33
|
+
const existing = services.get(name);
|
|
34
|
+
if (existing)
|
|
35
|
+
return existing;
|
|
36
|
+
const s = {
|
|
37
|
+
name,
|
|
38
|
+
originName: originName ?? name,
|
|
39
|
+
operations: [],
|
|
40
|
+
imports: [],
|
|
41
|
+
};
|
|
42
|
+
services.set(name, s);
|
|
43
|
+
return s;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Merge operation.imports into service.imports.
|
|
47
|
+
* - Reuse existing import objects in service.imports by matching path.
|
|
48
|
+
* - Replace operation.imports entries with the reused ones when found.
|
|
49
|
+
*
|
|
50
|
+
* This preserves identity of import objects so alias assignment is consistent.
|
|
51
|
+
*
|
|
52
|
+
* @param service - service to merge into
|
|
53
|
+
* @param operation - operation whose imports should be merged
|
|
54
|
+
*/
|
|
55
|
+
function mergeOperationImportsIntoService(service, operation) {
|
|
56
|
+
operation.imports = operation.imports.map((item) => {
|
|
57
|
+
const existing = service.imports.find(si => si.path === item.path);
|
|
58
|
+
return existing ?? item;
|
|
59
|
+
});
|
|
60
|
+
service.imports.push(...operation.imports);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Internal helper: apply alias value to models that reference the import.
|
|
64
|
+
*/
|
|
65
|
+
function fillModelsByAlias(items = [], value) {
|
|
66
|
+
items
|
|
67
|
+
.filter(result => result.path === value.path && result.type === value.name && value.alias)
|
|
68
|
+
.forEach(result => {
|
|
69
|
+
result.alias = value.alias;
|
|
70
|
+
result.base = value.alias;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Finalize imports for a service:
|
|
75
|
+
* - Deduplicate and sort imports
|
|
76
|
+
* - Assign aliases for duplicate import names (name, name$1, name$2, ...)
|
|
77
|
+
* - Propagate assigned aliases to models referenced in operations (results, parameters)
|
|
78
|
+
*
|
|
79
|
+
* Modifies service in-place and returns it.
|
|
80
|
+
*
|
|
81
|
+
* @param service - Service to finalize
|
|
82
|
+
* @returns service
|
|
83
|
+
*/
|
|
84
|
+
function finalizeServiceImports(service) {
|
|
85
|
+
service.imports = service.imports.filter(unique_1.unique).sort((a, b) => {
|
|
86
|
+
const nameA = a.name.toLowerCase();
|
|
87
|
+
const nameB = b.name.toLowerCase();
|
|
88
|
+
return nameA.localeCompare(nameB, 'en');
|
|
89
|
+
});
|
|
90
|
+
let previous;
|
|
91
|
+
let index = 1;
|
|
92
|
+
service.imports = service.imports.map(value => {
|
|
93
|
+
if (previous && previous.name === value.name) {
|
|
94
|
+
if (index === 1) {
|
|
95
|
+
previous.alias = `${value.name}$${index}`;
|
|
96
|
+
index++;
|
|
97
|
+
}
|
|
98
|
+
value.alias = `${value.name}$${index}`;
|
|
99
|
+
index++;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
value.alias = '';
|
|
103
|
+
index = 1;
|
|
104
|
+
}
|
|
105
|
+
previous = value;
|
|
106
|
+
return value;
|
|
107
|
+
});
|
|
108
|
+
for (const item of service.imports) {
|
|
109
|
+
for (const operation of service.operations) {
|
|
110
|
+
fillModelsByAlias(operation.results, item);
|
|
111
|
+
fillModelsByAlias(operation.parameters, item);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return service;
|
|
115
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function sortModelByName(a:
|
|
1
|
+
import { ExportedModel } from "../types/base/ExportedModel.model";
|
|
2
|
+
export declare function sortModelByName(a: ExportedModel, b: ExportedModel): number;
|
|
3
3
|
//# sourceMappingURL=sortModelByName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortModelByName.d.ts","sourceRoot":"","sources":["../../../src/core/utils/sortModelByName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sortModelByName.d.ts","sourceRoot":"","sources":["../../../src/core/utils/sortModelByName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,wBAAgB,eAAe,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,GAAG,MAAM,CAQ1E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { HttpClient } from '../types/
|
|
1
|
+
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
2
2
|
import type { Client } from '../types/shared/Client.model';
|
|
3
|
+
import { WriteClient } from '../WriteClient';
|
|
3
4
|
import { Templates } from './registerHandlebarTemplates';
|
|
4
5
|
/**
|
|
5
6
|
* @param client Client object, containing, models, schemas and services
|
|
@@ -16,6 +17,7 @@ interface IWriteClientCore {
|
|
|
16
17
|
httpClient: HttpClient;
|
|
17
18
|
request?: string;
|
|
18
19
|
useCancelableRequest?: boolean;
|
|
20
|
+
useSeparatedIndexes?: boolean;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* Generate OpenAPI core files, this includes the basic boilerplate code to handle requests.
|
|
@@ -26,6 +28,6 @@ interface IWriteClientCore {
|
|
|
26
28
|
* @param request: Path to custom request file
|
|
27
29
|
* @param useCancelableRequest Use cancelable request type
|
|
28
30
|
*/
|
|
29
|
-
export declare function writeClientCore(options: IWriteClientCore): Promise<void>;
|
|
31
|
+
export declare function writeClientCore(this: WriteClient, options: IWriteClientCore): Promise<void>;
|
|
30
32
|
export {};
|
|
31
33
|
//# sourceMappingURL=writeClientCore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientCore.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientCore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"writeClientCore.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientCore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD;;;;;;;GAOG;AACH,UAAU,gBAAgB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCjG"}
|
|
@@ -13,13 +13,15 @@ const fileSystem_1 = require("./fileSystem");
|
|
|
13
13
|
* @param useCancelableRequest Use cancelable request type
|
|
14
14
|
*/
|
|
15
15
|
async function writeClientCore(options) {
|
|
16
|
-
const { client, templates, outputCorePath, httpClient, request, useCancelableRequest } = options;
|
|
16
|
+
const { client, templates, outputCorePath, httpClient, request, useCancelableRequest, useSeparatedIndexes } = options;
|
|
17
17
|
const context = {
|
|
18
18
|
httpClient,
|
|
19
19
|
server: client.server,
|
|
20
20
|
version: client.version,
|
|
21
21
|
useCancelableRequest,
|
|
22
|
+
useSeparatedIndexes,
|
|
22
23
|
};
|
|
24
|
+
this.logger.info("The recording of the kernel files begins");
|
|
23
25
|
await fileSystem_1.fileSystem.writeFile((0, path_1.resolve)(outputCorePath, 'OpenAPI.ts'), templates.core.settings(context));
|
|
24
26
|
await fileSystem_1.fileSystem.writeFile((0, path_1.resolve)(outputCorePath, 'ApiError.ts'), templates.core.apiError({}));
|
|
25
27
|
await fileSystem_1.fileSystem.writeFile((0, path_1.resolve)(outputCorePath, 'ApiRequestOptions.ts'), templates.core.apiRequestOptions({}));
|
|
@@ -37,4 +39,5 @@ async function writeClientCore(options) {
|
|
|
37
39
|
}
|
|
38
40
|
await fileSystem_1.fileSystem.copyFile(requestFile, (0, path_1.resolve)(outputCorePath, 'request.ts'));
|
|
39
41
|
}
|
|
42
|
+
this.logger.info("The writing of the kernel files has been completed successfully");
|
|
40
43
|
}
|