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,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// This is an automatically generated file for the hbs template.
|
|
4
|
+
// You don't need to change it, run npm run build:hbs to update it.
|
|
5
|
+
/* istanbul ignore file */
|
|
6
|
+
/* tslint: disable */
|
|
7
|
+
/* eslint: disable */
|
|
8
|
+
// @ts-nocheck
|
|
9
|
+
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
12
|
+
return parent[propertyName];
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
};
|
|
16
|
+
return "\n"
|
|
17
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "schemas"), { "name": "each", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 7, "column": 9 } } })) != null ? stack1 : "");
|
|
18
|
+
}, "2": function (container, depth0, helpers, partials, data) {
|
|
19
|
+
var stack1, alias1 = container.strict, alias2 = container.lambda, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
21
|
+
return parent[propertyName];
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
};
|
|
25
|
+
return "export { "
|
|
26
|
+
+ ((stack1 = alias2(alias1(depth0, "name", { "start": { "line": 6, "column": 12 }, "end": { "line": 6, "column": 16 } }), depth0)) != null ? stack1 : "")
|
|
27
|
+
+ "Schema"
|
|
28
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "alias"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 6, "column": 67 } } })) != null ? stack1 : "")
|
|
29
|
+
+ " } from './"
|
|
30
|
+
+ ((stack1 = alias2(alias1(depth0, "path", { "start": { "line": 6, "column": 81 }, "end": { "line": 6, "column": 85 } }), depth0)) != null ? stack1 : "")
|
|
31
|
+
+ "Schema';\n";
|
|
32
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
33
|
+
var stack1;
|
|
34
|
+
return " as "
|
|
35
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "alias", { "start": { "line": 6, "column": 46 }, "end": { "line": 6, "column": 51 } }), depth0)) != null ? stack1 : "")
|
|
36
|
+
+ "Schema";
|
|
37
|
+
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
38
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
40
|
+
return parent[propertyName];
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
};
|
|
44
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
45
|
+
+ "\n"
|
|
46
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "schemas"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 8, "column": 7 } } })) != null ? stack1 : "");
|
|
47
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"1": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => any;
|
|
3
|
+
"2": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
|
|
4
|
+
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
|
+
"5": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => any;
|
|
6
|
+
"6": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
|
|
7
|
+
"7": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
8
|
+
"9": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => any;
|
|
9
|
+
"10": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
|
|
10
|
+
"11": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
11
|
+
"13": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => any;
|
|
12
|
+
"14": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
|
|
13
|
+
"15": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
14
|
+
compiler: (string | number)[];
|
|
15
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
|
|
16
|
+
usePartial: boolean;
|
|
17
|
+
useData: boolean;
|
|
18
|
+
useDepths: boolean;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
//# sourceMappingURL=indexSimple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexSimple.d.ts","sourceRoot":"","sources":["../../src/templatesCompiled/indexSimple.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,wBA6HoD"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// This is an automatically generated file for the hbs template.
|
|
4
|
+
// You don't need to change it, run npm run build:hbs to update it.
|
|
5
|
+
/* istanbul ignore file */
|
|
6
|
+
/* tslint: disable */
|
|
7
|
+
/* eslint: disable */
|
|
8
|
+
// @ts-nocheck
|
|
9
|
+
exports.default = { "1": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
10
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
12
|
+
return parent[propertyName];
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
};
|
|
16
|
+
return ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "core"), { "name": "each", "hash": {}, "fn": container.program(2, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 9 } } })) != null ? stack1 : "");
|
|
17
|
+
}, "2": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
18
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
20
|
+
return parent[propertyName];
|
|
21
|
+
}
|
|
22
|
+
return undefined;
|
|
23
|
+
};
|
|
24
|
+
return "export *"
|
|
25
|
+
+ ((stack1 = lookupProperty(helpers, "notEquals").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(depths[1], "core"), "length"), 1, { "name": "notEquals", "hash": {}, "fn": container.program(3, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 74 } } })) != null ? stack1 : "")
|
|
26
|
+
+ " from './"
|
|
27
|
+
+ ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "")
|
|
28
|
+
+ "';\n";
|
|
29
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
30
|
+
var stack1;
|
|
31
|
+
return " as Core$"
|
|
32
|
+
+ ((stack1 = container.lambda(container.strict(data, "index", { "start": { "line": 5, "column": 51 }, "end": { "line": 5, "column": 57 } }), depth0)) != null ? stack1 : "");
|
|
33
|
+
}, "5": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
34
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
36
|
+
return parent[propertyName];
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
};
|
|
40
|
+
return ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "models"), { "name": "each", "hash": {}, "fn": container.program(6, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 12, "column": 9 } } })) != null ? stack1 : "");
|
|
41
|
+
}, "6": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
42
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
43
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
44
|
+
return parent[propertyName];
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
};
|
|
48
|
+
return "export *"
|
|
49
|
+
+ ((stack1 = lookupProperty(helpers, "notEquals").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(depths[1], "models"), "length"), 1, { "name": "notEquals", "hash": {}, "fn": container.program(7, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 78 } } })) != null ? stack1 : "")
|
|
50
|
+
+ " from './"
|
|
51
|
+
+ ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "")
|
|
52
|
+
+ "';\n";
|
|
53
|
+
}, "7": function (container, depth0, helpers, partials, data) {
|
|
54
|
+
var stack1;
|
|
55
|
+
return " as Models$"
|
|
56
|
+
+ ((stack1 = container.lambda(container.strict(data, "index", { "start": { "line": 11, "column": 55 }, "end": { "line": 11, "column": 61 } }), depth0)) != null ? stack1 : "");
|
|
57
|
+
}, "9": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
58
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
59
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
60
|
+
return parent[propertyName];
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
};
|
|
64
|
+
return ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "schemas"), { "name": "each", "hash": {}, "fn": container.program(10, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 19, "column": 9 } } })) != null ? stack1 : "");
|
|
65
|
+
}, "10": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
66
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
67
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
68
|
+
return parent[propertyName];
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
};
|
|
72
|
+
return "export *"
|
|
73
|
+
+ ((stack1 = lookupProperty(helpers, "notEquals").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(depths[1], "schemas"), "length"), 1, { "name": "notEquals", "hash": {}, "fn": container.program(11, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 18, "column": 80 } } })) != null ? stack1 : "")
|
|
74
|
+
+ " from './"
|
|
75
|
+
+ ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "")
|
|
76
|
+
+ "';\n";
|
|
77
|
+
}, "11": function (container, depth0, helpers, partials, data) {
|
|
78
|
+
var stack1;
|
|
79
|
+
return " as Schemas$"
|
|
80
|
+
+ ((stack1 = container.lambda(container.strict(data, "index", { "start": { "line": 18, "column": 57 }, "end": { "line": 18, "column": 63 } }), depth0)) != null ? stack1 : "");
|
|
81
|
+
}, "13": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
82
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
83
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
84
|
+
return parent[propertyName];
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
};
|
|
88
|
+
return ((stack1 = lookupProperty(helpers, "each").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "services"), { "name": "each", "hash": {}, "fn": container.program(14, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 23, "column": 0 }, "end": { "line": 25, "column": 9 } } })) != null ? stack1 : "");
|
|
89
|
+
}, "14": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
90
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
91
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
92
|
+
return parent[propertyName];
|
|
93
|
+
}
|
|
94
|
+
return undefined;
|
|
95
|
+
};
|
|
96
|
+
return "export *"
|
|
97
|
+
+ ((stack1 = lookupProperty(helpers, "notEquals").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(depths[1], "services"), "length"), 1, { "name": "notEquals", "hash": {}, "fn": container.program(15, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 82 } } })) != null ? stack1 : "")
|
|
98
|
+
+ " from './"
|
|
99
|
+
+ ((stack1 = container.lambda(depth0, depth0)) != null ? stack1 : "")
|
|
100
|
+
+ "';\n";
|
|
101
|
+
}, "15": function (container, depth0, helpers, partials, data) {
|
|
102
|
+
var stack1;
|
|
103
|
+
return " as Services$"
|
|
104
|
+
+ ((stack1 = container.lambda(container.strict(data, "index", { "start": { "line": 24, "column": 59 }, "end": { "line": 24, "column": 65 } }), depth0)) != null ? stack1 : "");
|
|
105
|
+
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data, blockParams, depths) {
|
|
106
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
107
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
108
|
+
return parent[propertyName];
|
|
109
|
+
}
|
|
110
|
+
return undefined;
|
|
111
|
+
};
|
|
112
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
113
|
+
+ "\n"
|
|
114
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "core"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 7, "column": 7 } } })) != null ? stack1 : "")
|
|
115
|
+
+ "\n"
|
|
116
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "models"), { "name": "if", "hash": {}, "fn": container.program(5, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 13, "column": 7 } } })) != null ? stack1 : "")
|
|
117
|
+
+ "\n\n"
|
|
118
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "schemas"), { "name": "if", "hash": {}, "fn": container.program(9, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 16, "column": 0 }, "end": { "line": 20, "column": 7 } } })) != null ? stack1 : "")
|
|
119
|
+
+ "\n"
|
|
120
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "services"), { "name": "if", "hash": {}, "fn": container.program(13, data, 0, blockParams, depths), "inverse": container.noop, "data": data, "loc": { "start": { "line": 22, "column": 0 }, "end": { "line": 26, "column": 7 } } })) != null ? stack1 : "");
|
|
121
|
+
}, "usePartial": true, "useData": true, "useDepths": true };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-openapi-codegen",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
4
|
"description": "Library that generates Typescript clients based on the OpenAPI specification. It bases on openapi-typescript-codegen",
|
|
5
5
|
"author": "Alexey Zverev",
|
|
6
6
|
"homepage": "https://github.com/ozonophore/openapi-codegen.git",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
],
|
|
45
45
|
"scripts": {
|
|
46
46
|
"clean": "rimraf ./dist ./generated ./test/generated ./test/e2e/generated ./samples/generated ./coverage ./node_modules/.cache",
|
|
47
|
-
"build": "tsc -p .",
|
|
47
|
+
"build": "tsc -p . && npm run test:unit",
|
|
48
48
|
"build:hbs": "tsx ./src/core/utils/precompileTemplates.ts",
|
|
49
49
|
"release": "npm run build:hbs && npm run build",
|
|
50
50
|
"run": "node ./test/index.js",
|
|
@@ -56,9 +56,11 @@
|
|
|
56
56
|
"prettier": "prettier \"./src/**/*.ts\" \"./types/index.d.ts\" --check",
|
|
57
57
|
"prettier:fix": "prettier \"./src/**/*.ts\" \"./types/index.d.ts\" --write",
|
|
58
58
|
"prepublish": "npm run clean && npm run release",
|
|
59
|
-
"codecov": "codecov --token=89a9fe76-2714-4b5b-83e3-9d809615064d"
|
|
59
|
+
"codecov": "codecov --token=89a9fe76-2714-4b5b-83e3-9d809615064d",
|
|
60
|
+
"find-deadcode": "ts-prune -e"
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
63
|
+
"@apidevtools/swagger-parser": "12.0.0",
|
|
62
64
|
"boxen": "^5.1.2",
|
|
63
65
|
"camelcase": "6.2.0",
|
|
64
66
|
"chalk": "^4.1.2",
|
|
@@ -69,7 +71,6 @@
|
|
|
69
71
|
"handlebars": "4.7.6",
|
|
70
72
|
"joi": "^17.13.3",
|
|
71
73
|
"json-schema": "0.4.0",
|
|
72
|
-
"json-schema-ref-parser": "9.0.7",
|
|
73
74
|
"leven": "^4.0.0",
|
|
74
75
|
"mkdirp": "1.0.4",
|
|
75
76
|
"rimraf": "3.0.2",
|
|
@@ -89,6 +90,7 @@
|
|
|
89
90
|
"@types/configstore": "^6.0.2",
|
|
90
91
|
"@types/express": "4.17.13",
|
|
91
92
|
"@types/figlet": "^1.5.8",
|
|
93
|
+
"@types/glob": "^8.1.0",
|
|
92
94
|
"@types/json-schema": "^7.0.15",
|
|
93
95
|
"@types/lodash-es": "^4.17.12",
|
|
94
96
|
"@types/node": "22.5.1",
|
|
@@ -117,6 +119,7 @@
|
|
|
117
119
|
"prettier": "^3.4.2",
|
|
118
120
|
"puppeteer": "10.1.0",
|
|
119
121
|
"qs": "6.10.1",
|
|
122
|
+
"ts-prune": "^0.10.3",
|
|
120
123
|
"tsx": "^4.20.3",
|
|
121
124
|
"typescript": "5.8.3"
|
|
122
125
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOptionsMigrationPlan.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/MultiOptionsMigrationPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAyBpG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOptionsSchemaV1.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/MultiOptionsSchemaV1.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB;;GAEG;AACH,eAAO,MAAM,oBAAoB,uBAchC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOptionsSchemaV2.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/MultiOptionsSchemaV2.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB;;GAEG;AACH,eAAO,MAAM,oBAAoB,uBAchC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOptionsSchemaV3.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/MultiOptionsSchemaV3.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,oBAAoB,iCAAyE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOptionsSchemaV4.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/MultiOptionsSchemaV4.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB;;GAEG;AACH,eAAO,MAAM,oBAAoB,uBAgBhC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiOptionsVersionedSchemas.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/MultiOptionsVersionedSchemas.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,2BAA2B,EAAE,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAgB5E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsMigrationPlans.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/OptionsMigrationPlans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAQ/F,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optionsMigrationPlans = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Migration plan for option models.
|
|
6
|
-
*/
|
|
7
|
-
exports.optionsMigrationPlans = [{
|
|
8
|
-
fromVersion: '1.0.0',
|
|
9
|
-
toVersion: '1.0.1',
|
|
10
|
-
migrate: ({ client, ...otherProps }) => ({ ...otherProps, httpClient: client })
|
|
11
|
-
}, {
|
|
12
|
-
fromVersion: '1.0.1',
|
|
13
|
-
toVersion: '2.0.0',
|
|
14
|
-
migrate: (input) => ({ ...input, useCancelableRequest: false })
|
|
15
|
-
}];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsSchemaV1.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/OptionsSchemaV1.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB;;GAEG;AACH,eAAO,MAAM,eAAe,uBAQ3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsSchemaV2.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/OptionsSchemaV2.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAMtB;;GAEG;AACH,eAAO,MAAM,eAAe,uBAQ3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsSchemaV3.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/OptionsSchemaV3.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,eAAe,iCAAoE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsVersionedSchemas.d.ts","sourceRoot":"","sources":["../../../src/common/VersionedSchema/OptionsVersionedSchemas.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAYxE,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The type of object passed via ref
|
|
3
|
-
*/
|
|
4
|
-
export declare enum TypeRef {
|
|
5
|
-
SCHEMA = 0,
|
|
6
|
-
OTHERS = 1
|
|
7
|
-
}
|
|
8
|
-
export declare enum HttpClient {
|
|
9
|
-
FETCH = "fetch",
|
|
10
|
-
XHR = "xhr",
|
|
11
|
-
NODE = "node",
|
|
12
|
-
AXIOS = "axios"
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=Enums.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Enums.d.ts","sourceRoot":"","sources":["../../../src/core/types/Enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,OAAO;IACf,MAAM,IAAA;IACN,MAAM,IAAA;CACT;AAED,oBAAY,UAAU;IAClB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;CAClB"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { GROUP_PRIORITY_EXTENDED, GROUP_PRIORITY_SIMPLE } from './Consts';
|
|
2
|
-
import { TypeRef } from './Enums';
|
|
3
|
-
/**
|
|
4
|
-
* @param output The relative location of the output directory(or index)
|
|
5
|
-
* @param outputCore The relative location of the output directory for core
|
|
6
|
-
* @param outputServices The relative location of the output directory for services
|
|
7
|
-
* @param outputModels The relative location of the output directory for models
|
|
8
|
-
* @param outputSchemas The relative location of the output directory for schemas
|
|
9
|
-
*/
|
|
10
|
-
export interface IOutput {
|
|
11
|
-
output: string;
|
|
12
|
-
outputCore: string;
|
|
13
|
-
outputServices: string;
|
|
14
|
-
outputModels: string;
|
|
15
|
-
outputSchemas: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Ref With type
|
|
19
|
-
* @prop value Value
|
|
20
|
-
* @prop type The type of object passed via ref
|
|
21
|
-
*/
|
|
22
|
-
export interface IRefWithtype {
|
|
23
|
-
value: string;
|
|
24
|
-
type: TypeRef;
|
|
25
|
-
}
|
|
26
|
-
export interface $Root {
|
|
27
|
-
path: string;
|
|
28
|
-
fileName?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface Prefix {
|
|
31
|
-
interface: string;
|
|
32
|
-
enum: string;
|
|
33
|
-
type: string;
|
|
34
|
-
}
|
|
35
|
-
export type TPropertyGroupExtended = keyof typeof GROUP_PRIORITY_EXTENDED;
|
|
36
|
-
export type TPropertyGroupSimple = keyof typeof GROUP_PRIORITY_SIMPLE;
|
|
37
|
-
//# sourceMappingURL=Models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Models.d.ts","sourceRoot":"","sources":["../../../src/core/types/Models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,MAAM;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,qBAAqB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConverterData.model.d.ts","sourceRoot":"","sources":["../../../../src/core/types/shared/ConverterData.model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,aAAa,EAAE,CAAC;CAC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientIndex.test.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__tests__/writeClientIndex.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Templates } from './registerHandlebarTemplates';
|
|
2
|
-
/**
|
|
3
|
-
* @param name: The name of the model
|
|
4
|
-
* @param alias: The alias of the model(when there are several similar models in the one specification)
|
|
5
|
-
* @param path: The name of the file witch contains this model
|
|
6
|
-
* @param package: The relative location of this service
|
|
7
|
-
* @param enum: Then flag for mark an enum
|
|
8
|
-
* @param useUnionTypes: Use union types instead of enums
|
|
9
|
-
* @param enums: Then flag for mark an enums
|
|
10
|
-
*/
|
|
11
|
-
export interface IModel {
|
|
12
|
-
name: string;
|
|
13
|
-
alias: string;
|
|
14
|
-
path: string;
|
|
15
|
-
package: string;
|
|
16
|
-
enum: boolean;
|
|
17
|
-
useUnionTypes: boolean;
|
|
18
|
-
enums: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @param name: The name of the service
|
|
22
|
-
* @param package: The relative location of this service
|
|
23
|
-
*/
|
|
24
|
-
export interface IService {
|
|
25
|
-
name: string;
|
|
26
|
-
package: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @param templates: The loaded handlebar templates
|
|
30
|
-
* @param outputPath: Directory to write the generated files to
|
|
31
|
-
* @param useUnionTypes: Use union types instead of enums
|
|
32
|
-
* @param exportCore: Generate core
|
|
33
|
-
* @param exportServices: Generate services
|
|
34
|
-
* @param exportModels: Generate models
|
|
35
|
-
* @param exportSchemas: Generate schemas
|
|
36
|
-
*/
|
|
37
|
-
export interface IClientIndex {
|
|
38
|
-
templates: Templates;
|
|
39
|
-
outputPath: string;
|
|
40
|
-
core: string[];
|
|
41
|
-
models: IModel[];
|
|
42
|
-
schemas: IModel[];
|
|
43
|
-
services: IService[];
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Generate the OpenAPI client index file using the Handlebar template and write it to disk.
|
|
47
|
-
* The index file just contains all the exports you need to use the client as a standalone
|
|
48
|
-
* library. But yuo can also import individual models and services directly.
|
|
49
|
-
* @param client: Client object, containing, models, schemas and services
|
|
50
|
-
* @param templates: The loaded handlebar templates
|
|
51
|
-
* @param outputPath: Directory to write the generated files to
|
|
52
|
-
* @param useUnionTypes: Use union types instead of enums
|
|
53
|
-
* @param exportCore: Generate core
|
|
54
|
-
* @param exportServices: Generate services
|
|
55
|
-
* @param exportModels: Generate models
|
|
56
|
-
* @param exportSchemas: Generate schemas
|
|
57
|
-
*/
|
|
58
|
-
export declare function writeClientIndex(options: IClientIndex): Promise<void>;
|
|
59
|
-
//# sourceMappingURL=writeClientIndex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientIndex.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAW3E"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeClientIndex = writeClientIndex;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const fileSystem_1 = require("./fileSystem");
|
|
6
|
-
/**
|
|
7
|
-
* Generate the OpenAPI client index file using the Handlebar template and write it to disk.
|
|
8
|
-
* The index file just contains all the exports you need to use the client as a standalone
|
|
9
|
-
* library. But yuo can also import individual models and services directly.
|
|
10
|
-
* @param client: Client object, containing, models, schemas and services
|
|
11
|
-
* @param templates: The loaded handlebar templates
|
|
12
|
-
* @param outputPath: Directory to write the generated files to
|
|
13
|
-
* @param useUnionTypes: Use union types instead of enums
|
|
14
|
-
* @param exportCore: Generate core
|
|
15
|
-
* @param exportServices: Generate services
|
|
16
|
-
* @param exportModels: Generate models
|
|
17
|
-
* @param exportSchemas: Generate schemas
|
|
18
|
-
*/
|
|
19
|
-
async function writeClientIndex(options) {
|
|
20
|
-
const { templates, outputPath, core, models, schemas, services } = options;
|
|
21
|
-
await fileSystem_1.fileSystem.writeFile((0, path_1.resolve)(outputPath, 'index.ts'), templates.index({
|
|
22
|
-
core,
|
|
23
|
-
models,
|
|
24
|
-
schemas,
|
|
25
|
-
services,
|
|
26
|
-
}));
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templatesCompiled/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBA8LoD"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|