ts-openapi-codegen 2.0.0-beta.9 → 2.1.0-beta.1
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 +177 -18
- package/README.rus.md +177 -21
- package/dist/cli/analyzeDiff/__tests__/analyzeDiff.cli.test.d.ts +2 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiff.cli.test.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiff.cli.test.js +365 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffRenameAndInvalidRegex.test.d.ts +2 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffRenameAndInvalidRegex.test.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffRenameAndInvalidRegex.test.js +142 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffTypeCoercion.test.d.ts +2 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffTypeCoercion.test.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/__tests__/analyzeDiffTypeCoercion.test.js +137 -0
- package/dist/cli/analyzeDiff/analyzeDiff.d.ts +17 -0
- package/dist/cli/analyzeDiff/analyzeDiff.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/analyzeDiff.js +105 -0
- package/dist/cli/analyzeDiff/buildLegacyReport.d.ts +17 -0
- package/dist/cli/analyzeDiff/buildLegacyReport.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/buildLegacyReport.js +54 -0
- package/dist/cli/analyzeDiff/ciSummary.d.ts +6 -0
- package/dist/cli/analyzeDiff/ciSummary.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/ciSummary.js +20 -0
- package/dist/cli/analyzeDiff/diffEngine.d.ts +54 -0
- package/dist/cli/analyzeDiff/diffEngine.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/diffEngine.js +209 -0
- package/dist/cli/analyzeDiff/ignoreRules.d.ts +33 -0
- package/dist/cli/analyzeDiff/ignoreRules.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/ignoreRules.js +93 -0
- package/dist/cli/analyzeDiff/ignoreSemanticChanges.d.ts +10 -0
- package/dist/cli/analyzeDiff/ignoreSemanticChanges.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/ignoreSemanticChanges.js +84 -0
- package/dist/cli/analyzeDiff/logLegacyReport.d.ts +6 -0
- package/dist/cli/analyzeDiff/logLegacyReport.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/logLegacyReport.js +29 -0
- package/dist/cli/analyzeDiff/miracles.d.ts +89 -0
- package/dist/cli/analyzeDiff/miracles.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/miracles.js +325 -0
- package/dist/cli/analyzeDiff/pluginPaths.d.ts +5 -0
- package/dist/cli/analyzeDiff/pluginPaths.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/pluginPaths.js +13 -0
- package/dist/cli/analyzeDiff/report.d.ts +3 -0
- package/dist/cli/analyzeDiff/report.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/report.js +7 -0
- package/dist/cli/analyzeDiff/semanticDiffContext.d.ts +6 -0
- package/dist/cli/analyzeDiff/semanticDiffContext.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/semanticDiffContext.js +16 -0
- package/dist/cli/analyzeDiff/specParser.d.ts +22 -0
- package/dist/cli/analyzeDiff/specParser.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/specParser.js +80 -0
- package/dist/cli/analyzeDiff/types.d.ts +61 -0
- package/dist/cli/analyzeDiff/types.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/types.js +2 -0
- package/dist/cli/analyzeDiff/writeLegacyReport.d.ts +6 -0
- package/dist/cli/analyzeDiff/writeLegacyReport.d.ts.map +1 -0
- package/dist/cli/analyzeDiff/writeLegacyReport.js +21 -0
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/checkConfig.js +13 -8
- package/dist/cli/checkAndUpdateConfig/constants.d.ts +0 -9
- package/dist/cli/checkAndUpdateConfig/constants.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/constants.js +1 -10
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/updateConfig.js +11 -7
- package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/utils/selectConfigAction.js +6 -3
- package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/utils/updateExistingConfigFile.js +3 -2
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/utils/validateAndMigrateConfigData.js +5 -0
- package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/utils/writeExampleConfigFile.js +2 -2
- package/dist/cli/generateOpenApiClient/__tests__/generateOpenApiClient.strict.test.d.ts +2 -0
- package/dist/cli/generateOpenApiClient/__tests__/generateOpenApiClient.strict.test.d.ts.map +1 -0
- package/dist/cli/generateOpenApiClient/__tests__/generateOpenApiClient.strict.test.js +152 -0
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts +6 -2
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -1
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.js +70 -22
- package/dist/cli/index.js +62 -5
- package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/init.js +19 -6
- package/dist/cli/initOpenApiConfig/initConfig.d.ts +1 -0
- package/dist/cli/initOpenApiConfig/initConfig.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/initConfig.js +47 -24
- package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts +8 -1
- package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/initCustomRequest.js +40 -8
- package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/utils/buildConfig.js +60 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.js +2 -1
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.js +2 -1
- package/dist/cli/interactive/confirmDialog.d.ts.map +1 -1
- package/dist/cli/interactive/confirmDialog.js +3 -2
- package/dist/cli/interactive/constants.d.ts +2 -2
- package/dist/cli/interactive/constants.js +8 -8
- package/dist/cli/interactive/selectDialog.d.ts.map +1 -1
- package/dist/cli/interactive/selectDialog.js +11 -6
- package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -1
- package/dist/cli/previewChanges/previewChanges.js +151 -39
- package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts.map +1 -1
- package/dist/cli/previewChanges/utils/updateOutputPaths.js +6 -0
- package/dist/cli/schemas/analyzeDiff.d.ts +14 -0
- package/dist/cli/schemas/analyzeDiff.d.ts.map +1 -0
- package/dist/cli/schemas/analyzeDiff.js +28 -0
- package/dist/cli/schemas/generate.d.ts +9 -0
- package/dist/cli/schemas/generate.d.ts.map +1 -1
- package/dist/cli/schemas/generate.js +9 -0
- package/dist/cli/schemas/index.d.ts +3 -1
- package/dist/cli/schemas/index.d.ts.map +1 -1
- package/dist/cli/schemas/index.js +2 -0
- package/dist/common/Consts.d.ts +1 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +19 -2
- package/dist/common/Logger.d.ts +20 -1
- package/dist/common/Logger.d.ts.map +1 -1
- package/dist/common/Logger.js +70 -9
- package/dist/common/LoggerMessages.d.ts +136 -33
- package/dist/common/LoggerMessages.d.ts.map +1 -1
- package/dist/common/LoggerMessages.js +119 -45
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +20 -4
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts +4 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +10 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +10 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +10 -2
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts +77 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV4.js +41 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.d.ts +79 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV5.js +19 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +326 -28
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +15 -17
- package/dist/common/VersionedSchema/CommonSchemas.d.ts +52 -4
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +48 -7
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +6 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts +4 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts +4 -0
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +6 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +6 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +6 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts +4 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts +4 -0
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +6 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +40 -1
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__tests__/allUtils.test.js +185 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.js +20 -3
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +19 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +4 -0
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +68 -23
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts +1 -1
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.js +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +10 -0
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +34 -15
- package/dist/common/__tests__/Logger.test.d.ts +2 -0
- package/dist/common/__tests__/Logger.test.d.ts.map +1 -0
- package/dist/common/__tests__/Logger.test.js +100 -0
- package/dist/common/utils/__tests__/convertArrayToObject.test.js +67 -169
- package/dist/common/utils/__tests__/eslintFix.test.d.ts +2 -0
- package/dist/common/utils/__tests__/eslintFix.test.d.ts.map +1 -0
- package/dist/common/utils/__tests__/eslintFix.test.js +134 -0
- package/dist/common/utils/__tests__/format.test.d.ts +2 -0
- package/dist/common/utils/__tests__/format.test.d.ts.map +1 -0
- package/dist/common/utils/__tests__/format.test.js +90 -0
- package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
- package/dist/common/utils/convertArrayToObject.js +54 -14
- package/dist/common/utils/eslintFix.d.ts +7 -0
- package/dist/common/utils/eslintFix.d.ts.map +1 -0
- package/dist/common/utils/eslintFix.js +78 -0
- package/dist/common/utils/format.d.ts +1 -1
- package/dist/common/utils/format.d.ts.map +1 -1
- package/dist/common/utils/format.js +39 -15
- package/dist/common/utils/jsonPath.d.ts +5 -0
- package/dist/common/utils/jsonPath.d.ts.map +1 -0
- package/dist/common/utils/jsonPath.js +27 -0
- package/dist/common/utils/normalizeObject.d.ts +2 -0
- package/dist/common/utils/normalizeObject.d.ts.map +1 -0
- package/dist/common/utils/normalizeObject.js +63 -0
- package/dist/core/Context.d.ts +8 -1
- package/dist/core/Context.d.ts.map +1 -1
- package/dist/core/Context.js +23 -4
- package/dist/core/OpenApiClient.d.ts +2 -0
- package/dist/core/OpenApiClient.d.ts.map +1 -1
- package/dist/core/OpenApiClient.js +127 -6
- package/dist/core/WriteClient.d.ts +12 -1
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +83 -8
- package/dist/core/__tests__/WriteClient.test.js +6 -1
- package/dist/core/api/v2/parser/__tests__/getModel.test.d.ts +2 -0
- package/dist/core/api/v2/parser/__tests__/getModel.test.d.ts.map +1 -0
- package/dist/core/api/v2/parser/__tests__/getModel.test.js +34 -0
- package/dist/core/api/v2/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModel.js +6 -1
- package/dist/core/api/v2/parser/getOperation.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperation.js +2 -0
- package/dist/core/api/v2/parser/getOperationResponses.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationResponses.js +9 -1
- package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getType.js +2 -1
- package/dist/core/api/v2/types/OpenApiSchema.model.d.ts +2 -0
- package/dist/core/api/v2/types/OpenApiSchema.model.d.ts.map +1 -1
- package/dist/core/api/v3/parser/__tests__/getContent.test.d.ts +2 -0
- package/dist/core/api/v3/parser/__tests__/getContent.test.d.ts.map +1 -0
- package/dist/core/api/v3/parser/__tests__/getContent.test.js +65 -0
- package/dist/core/api/v3/parser/__tests__/getModel.test.d.ts +2 -0
- package/dist/core/api/v3/parser/__tests__/getModel.test.d.ts.map +1 -0
- package/dist/core/api/v3/parser/__tests__/getModel.test.js +34 -0
- package/dist/core/api/v3/parser/getContent.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getContent.js +21 -11
- package/dist/core/api/v3/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModel.js +6 -1
- package/dist/core/api/v3/parser/getOperation.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperation.js +2 -0
- package/dist/core/api/v3/parser/getOperationResponses.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationResponses.js +9 -1
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +2 -1
- package/dist/core/api/v3/types/OpenApiSchema.model.d.ts +2 -0
- package/dist/core/api/v3/types/OpenApiSchema.model.d.ts.map +1 -1
- package/dist/core/governance/__tests__/evaluateGovernanceRules.test.d.ts +2 -0
- package/dist/core/governance/__tests__/evaluateGovernanceRules.test.d.ts.map +1 -0
- package/dist/core/governance/__tests__/evaluateGovernanceRules.test.js +100 -0
- package/dist/core/governance/__tests__/loadGovernanceConfig.test.d.ts +2 -0
- package/dist/core/governance/__tests__/loadGovernanceConfig.test.d.ts.map +1 -0
- package/dist/core/governance/__tests__/loadGovernanceConfig.test.js +71 -0
- package/dist/core/governance/evaluateGovernanceRules.d.ts +42 -0
- package/dist/core/governance/evaluateGovernanceRules.d.ts.map +1 -0
- package/dist/core/governance/evaluateGovernanceRules.js +134 -0
- package/dist/core/governance/governanceConfigSchema.d.ts +4 -0
- package/dist/core/governance/governanceConfigSchema.d.ts.map +1 -0
- package/dist/core/governance/governanceConfigSchema.js +39 -0
- package/dist/core/governance/loadGovernanceConfig.d.ts +7 -0
- package/dist/core/governance/loadGovernanceConfig.d.ts.map +1 -0
- package/dist/core/governance/loadGovernanceConfig.js +60 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +4 -2
- package/dist/core/plugins/GeneratorPlugin.model.d.ts +42 -0
- package/dist/core/plugins/GeneratorPlugin.model.d.ts.map +1 -0
- package/dist/core/plugins/GeneratorPlugin.model.js +2 -0
- package/dist/core/plugins/__tests__/applySemanticDiffPluginHooks.test.d.ts +2 -0
- package/dist/core/plugins/__tests__/applySemanticDiffPluginHooks.test.d.ts.map +1 -0
- package/dist/core/plugins/__tests__/applySemanticDiffPluginHooks.test.js +115 -0
- package/dist/core/plugins/__tests__/loadGeneratorPlugins.test.d.ts +2 -0
- package/dist/core/plugins/__tests__/loadGeneratorPlugins.test.d.ts.map +1 -0
- package/dist/core/plugins/__tests__/loadGeneratorPlugins.test.js +62 -0
- package/dist/core/plugins/applySemanticDiffPluginHooks.d.ts +28 -0
- package/dist/core/plugins/applySemanticDiffPluginHooks.d.ts.map +1 -0
- package/dist/core/plugins/applySemanticDiffPluginHooks.js +160 -0
- package/dist/core/plugins/builtins/xTypescriptTypePlugin.d.ts +6 -0
- package/dist/core/plugins/builtins/xTypescriptTypePlugin.d.ts.map +1 -0
- package/dist/core/plugins/builtins/xTypescriptTypePlugin.js +13 -0
- package/dist/core/plugins/getBuiltinPlugins.d.ts +6 -0
- package/dist/core/plugins/getBuiltinPlugins.d.ts.map +1 -0
- package/dist/core/plugins/getBuiltinPlugins.js +10 -0
- package/dist/core/plugins/index.d.ts +4 -0
- package/dist/core/plugins/index.d.ts.map +1 -0
- package/dist/core/plugins/index.js +5 -0
- package/dist/core/plugins/loadGeneratorPlugins.d.ts +6 -0
- package/dist/core/plugins/loadGeneratorPlugins.d.ts.map +1 -0
- package/dist/core/plugins/loadGeneratorPlugins.js +94 -0
- package/dist/core/semanticDiff/__tests__/analyzeOpenApiDiff.test.d.ts +2 -0
- package/dist/core/semanticDiff/__tests__/analyzeOpenApiDiff.test.d.ts.map +1 -0
- package/dist/core/semanticDiff/__tests__/analyzeOpenApiDiff.test.js +537 -0
- package/dist/core/semanticDiff/__tests__/semanticDiffReportSchema.test.d.ts +2 -0
- package/dist/core/semanticDiff/__tests__/semanticDiffReportSchema.test.d.ts.map +1 -0
- package/dist/core/semanticDiff/__tests__/semanticDiffReportSchema.test.js +66 -0
- package/dist/core/semanticDiff/analyzeOpenApiDiff.d.ts +45 -0
- package/dist/core/semanticDiff/analyzeOpenApiDiff.d.ts.map +1 -0
- package/dist/core/semanticDiff/analyzeOpenApiDiff.js +640 -0
- package/dist/core/semanticDiff/semanticDiffReportSchema.d.ts +11 -0
- package/dist/core/semanticDiff/semanticDiffReportSchema.d.ts.map +1 -0
- package/dist/core/semanticDiff/semanticDiffReportSchema.js +132 -0
- package/dist/core/strict/__tests__/validateOpenApiStrict.test.d.ts +2 -0
- package/dist/core/strict/__tests__/validateOpenApiStrict.test.d.ts.map +1 -0
- package/dist/core/strict/__tests__/validateOpenApiStrict.test.js +156 -0
- package/dist/core/strict/validateOpenApiStrict.d.ts +43 -0
- package/dist/core/strict/validateOpenApiStrict.d.ts.map +1 -0
- package/dist/core/strict/validateOpenApiStrict.js +253 -0
- package/dist/core/types/base/ClientArtifacts.model.d.ts +2 -0
- package/dist/core/types/base/ClientArtifacts.model.d.ts.map +1 -1
- package/dist/core/types/base/Templates.model.d.ts +4 -1
- package/dist/core/types/base/Templates.model.d.ts.map +1 -1
- package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts +6 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.d.ts.map +1 -0
- package/dist/core/types/enums/EmptySchemaStrategy.enum.js +9 -0
- package/dist/core/types/enums/ModelsMode.enum.d.ts +5 -0
- package/dist/core/types/enums/ModelsMode.enum.d.ts.map +1 -0
- package/dist/core/types/enums/ModelsMode.enum.js +8 -0
- package/dist/core/types/shared/Client.model.d.ts +2 -0
- package/dist/core/types/shared/Client.model.d.ts.map +1 -1
- package/dist/core/types/shared/DiffInfo.model.d.ts +13 -0
- package/dist/core/types/shared/DiffInfo.model.d.ts.map +1 -0
- package/dist/core/types/shared/DiffInfo.model.js +2 -0
- package/dist/core/types/shared/Miracle.model.d.ts +13 -0
- package/dist/core/types/shared/Miracle.model.d.ts.map +1 -0
- package/dist/core/types/shared/Miracle.model.js +2 -0
- package/dist/core/types/shared/Model.model.d.ts +23 -0
- package/dist/core/types/shared/Model.model.d.ts.map +1 -1
- package/dist/core/types/shared/Operation.model.d.ts +5 -0
- package/dist/core/types/shared/Operation.model.d.ts.map +1 -1
- package/dist/core/utils/__mocks__/templates.d.ts.map +1 -1
- package/dist/core/utils/__mocks__/templates.js +9 -0
- package/dist/core/utils/__tests__/applyDiffReportToClient.test.d.ts +2 -0
- package/dist/core/utils/__tests__/applyDiffReportToClient.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/applyDiffReportToClient.test.js +108 -0
- package/dist/core/utils/__tests__/getMappedType.test.js +2 -0
- package/dist/core/utils/__tests__/getOperationResponseCode.test.js +7 -2
- package/dist/core/utils/__tests__/getOperationResults.test.d.ts +2 -0
- package/dist/core/utils/__tests__/getOperationResults.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/getOperationResults.test.js +43 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.js +27 -0
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/modelHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/modelHelpers.test.js +151 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessModelImports.test.js +67 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts +2 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/postProcessServiceImports.test.js +26 -0
- package/dist/core/utils/__tests__/prepareDtoModels.test.d.ts +2 -0
- package/dist/core/utils/__tests__/prepareDtoModels.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/prepareDtoModels.test.js +116 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts +2 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/resolveRefPath.test.js +22 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts +2 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/serviceHelpers.test.js +122 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts +2 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.d.ts.map +1 -0
- package/dist/core/utils/__tests__/writeClientExecutor.test.js +20 -0
- package/dist/core/utils/__tests__/writeClientModels.test.js +50 -0
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +2 -0
- package/dist/core/utils/applyDiffReportToClient.d.ts +14 -0
- package/dist/core/utils/applyDiffReportToClient.d.ts.map +1 -0
- package/dist/core/utils/applyDiffReportToClient.js +367 -0
- package/dist/core/utils/getMappedType.d.ts.map +1 -1
- package/dist/core/utils/getMappedType.js +2 -0
- package/dist/core/utils/getOperationResponseCode.d.ts.map +1 -1
- package/dist/core/utils/getOperationResponseCode.js +10 -8
- package/dist/core/utils/getRelativeModelPath.d.ts +9 -0
- package/dist/core/utils/getRelativeModelPath.d.ts.map +1 -0
- package/dist/core/utils/getRelativeModelPath.js +37 -0
- package/dist/core/utils/loadDiffReport.d.ts +39 -0
- package/dist/core/utils/loadDiffReport.d.ts.map +1 -0
- package/dist/core/utils/loadDiffReport.js +51 -0
- package/dist/core/utils/modelHelpers.d.ts.map +1 -1
- package/dist/core/utils/modelHelpers.js +37 -3
- package/dist/core/utils/postProcessModelImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessModelImports.js +14 -1
- package/dist/core/utils/postProcessServiceImports.d.ts.map +1 -1
- package/dist/core/utils/postProcessServiceImports.js +1 -2
- package/dist/core/utils/precompileTemplates.js +1 -0
- package/dist/core/utils/prepareDtoModels.d.ts +3 -0
- package/dist/core/utils/prepareDtoModels.d.ts.map +1 -0
- package/dist/core/utils/prepareDtoModels.js +189 -0
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +29 -1
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +48 -41
- package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
- package/dist/core/utils/resolveRefPath.js +1 -4
- package/dist/core/utils/validateRawOptions.d.ts +1 -1
- package/dist/core/utils/validateRawOptions.d.ts.map +1 -1
- package/dist/core/utils/validateRawOptions.js +4 -2
- package/dist/core/utils/writeClientCore.d.ts +2 -0
- package/dist/core/utils/writeClientCore.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.js +6 -1
- package/dist/core/utils/writeClientCoreIndex.d.ts +1 -0
- package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientCoreIndex.js +2 -2
- package/dist/core/utils/writeClientExecutor.d.ts +6 -1
- package/dist/core/utils/writeClientExecutor.d.ts.map +1 -1
- package/dist/core/utils/writeClientExecutor.js +22 -3
- package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientFullIndex.js +3 -1
- package/dist/core/utils/writeClientModels.d.ts +6 -0
- package/dist/core/utils/writeClientModels.d.ts.map +1 -1
- package/dist/core/utils/writeClientModels.js +24 -3
- package/dist/core/utils/writeClientModelsIndex.d.ts +2 -0
- package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientModelsIndex.js +2 -2
- package/dist/core/utils/writeClientSchemas.d.ts +6 -1
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +16 -3
- package/dist/core/utils/writeClientServices.d.ts +2 -0
- package/dist/core/utils/writeClientServices.d.ts.map +1 -1
- package/dist/core/utils/writeClientServices.js +6 -2
- package/dist/templatesCompiled/cli/openApiConfig.d.ts +4 -1
- package/dist/templatesCompiled/cli/openApiConfig.d.ts.map +1 -1
- package/dist/templatesCompiled/cli/openApiConfig.js +88 -37
- package/dist/templatesCompiled/client/core/ApiError.js +1 -1
- package/dist/templatesCompiled/client/core/ApiRequestOptions.js +1 -1
- package/dist/templatesCompiled/client/core/ApiResult.js +1 -1
- package/dist/templatesCompiled/client/core/BaseDto.d.ts +8 -0
- package/dist/templatesCompiled/client/core/BaseDto.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/BaseDto.js +18 -0
- package/dist/templatesCompiled/client/core/axios/getResponseBody.js +1 -1
- package/dist/templatesCompiled/client/core/axios/request.js +3 -3
- package/dist/templatesCompiled/client/core/axios/sendRequest.js +4 -4
- package/dist/templatesCompiled/client/core/dtoUtils.d.ts +8 -0
- package/dist/templatesCompiled/client/core/dtoUtils.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/dtoUtils.js +18 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts +2 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts.map +1 -1
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.js +13 -8
- package/dist/templatesCompiled/client/core/executor/requestExecutor.js +1 -1
- package/dist/templatesCompiled/client/core/fetch/getResponseBody.js +1 -1
- package/dist/templatesCompiled/client/core/fetch/request.js +3 -3
- package/dist/templatesCompiled/client/core/functions/catchErrors.js +1 -1
- package/dist/templatesCompiled/client/core/functions/isBinary.js +1 -1
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.js +1 -1
- package/dist/templatesCompiled/client/core/node/getResponseBody.js +1 -1
- package/dist/templatesCompiled/client/core/node/request.js +3 -3
- package/dist/templatesCompiled/client/core/xhr/getResponseBody.js +1 -1
- package/dist/templatesCompiled/client/core/xhr/request.js +3 -3
- package/dist/templatesCompiled/client/core/xhr/sendRequest.js +4 -4
- package/dist/templatesCompiled/client/exportClient.d.ts +4 -0
- package/dist/templatesCompiled/client/exportClient.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportClient.js +51 -13
- package/dist/templatesCompiled/client/exportModels.d.ts +34 -0
- package/dist/templatesCompiled/client/exportModels.d.ts.map +1 -0
- package/dist/templatesCompiled/client/exportModels.js +280 -0
- package/dist/templatesCompiled/client/exportSchema.d.ts +5 -1
- package/dist/templatesCompiled/client/exportSchema.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportSchema.js +37 -7
- package/dist/templatesCompiled/client/exportService.d.ts +9 -4
- package/dist/templatesCompiled/client/exportService.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportService.js +96 -37
- package/dist/templatesCompiled/client/indexCore.d.ts +3 -1
- package/dist/templatesCompiled/client/indexCore.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexCore.js +13 -2
- package/dist/templatesCompiled/client/indexFull.d.ts +10 -7
- package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexFull.js +54 -33
- package/dist/templatesCompiled/client/indexModels.d.ts +7 -5
- package/dist/templatesCompiled/client/indexModels.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexModels.js +27 -18
- package/dist/templatesCompiled/client/indexSimple.d.ts +1 -0
- package/dist/templatesCompiled/client/indexSimple.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexSimple.js +4 -1
- package/dist/templatesCompiled/client/joi/exportSchema.js +5 -5
- package/dist/templatesCompiled/client/joi/partials/joiSchema.js +7 -7
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.js +4 -4
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts +27 -19
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts.map +1 -1
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.js +144 -63
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +5 -3
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +39 -12
- package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts +1 -0
- package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts.map +1 -1
- package/dist/templatesCompiled/client/jsonschema/exportSchema.js +21 -17
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.js +7 -7
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.js +2 -2
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.js +5 -5
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +3 -1
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +45 -15
- package/dist/templatesCompiled/client/partials/exportInterface.d.ts +13 -5
- package/dist/templatesCompiled/client/partials/exportInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/exportInterface.js +91 -21
- package/dist/templatesCompiled/client/partials/result.d.ts +6 -4
- package/dist/templatesCompiled/client/partials/result.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/result.js +16 -6
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts +1 -0
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/serviceOption.js +11 -4
- package/dist/templatesCompiled/client/yup/exportSchema.js +3 -3
- package/dist/templatesCompiled/client/yup/partials/yupSchema.js +7 -7
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.js +4 -4
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts +22 -16
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts.map +1 -1
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.js +72 -60
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +5 -3
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +39 -12
- package/dist/templatesCompiled/client/zod/exportSchema.js +3 -3
- package/dist/templatesCompiled/client/zod/partials/zodSchema.js +7 -7
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +5 -6
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +14 -28
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +3 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +32 -8
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +3 -4
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +9 -23
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts +27 -19
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.js +77 -61
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +4 -2
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -1
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +18 -7
- package/package.json +8 -6
- package/dist/common/defaultOptions.d.ts +0 -3
- package/dist/common/defaultOptions.d.ts.map +0 -1
- package/dist/common/defaultOptions.js +0 -28
- package/dist/core/utils/advancedDeduplicatePath.d.ts +0 -5
- package/dist/core/utils/advancedDeduplicatePath.d.ts.map +0 -1
- package/dist/core/utils/advancedDeduplicatePath.js +0 -29
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeClientExecutor = writeClientExecutor;
|
|
4
|
+
exports.deduplicateServicesByName = deduplicateServicesByName;
|
|
5
|
+
const eslintFix_1 = require("../../common/utils/eslintFix");
|
|
4
6
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
5
7
|
const format_1 = require("../../common/utils/format");
|
|
6
8
|
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
9
|
+
function deduplicateServicesByName(services) {
|
|
10
|
+
const seen = new Set();
|
|
11
|
+
return services.filter(service => {
|
|
12
|
+
if (seen.has(service.name)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
seen.add(service.name);
|
|
16
|
+
return true;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
7
19
|
async function writeClientExecutor(options) {
|
|
8
|
-
const { outputPath, outputCorePath, templates, services } = options;
|
|
20
|
+
const { outputPath, outputCorePath, templates, services, request, customExecutorPath, useProjectPrettier, useEslintFix } = options;
|
|
9
21
|
const file = (0, pathHelpers_1.resolveHelper)(outputPath, 'createClient.ts');
|
|
22
|
+
const uniqueServices = deduplicateServicesByName(services);
|
|
23
|
+
const hasCustomRequest = !!request;
|
|
10
24
|
this.logger.info(`Началась запись файла ${file}`);
|
|
11
25
|
const templateResult = templates.exports.client({
|
|
12
26
|
outputCore: outputCorePath,
|
|
13
|
-
|
|
27
|
+
useCustomRequest: hasCustomRequest,
|
|
28
|
+
customExecutorPath,
|
|
29
|
+
services: uniqueServices,
|
|
14
30
|
});
|
|
15
|
-
const formattedValue = await (0, format_1.format)(templateResult);
|
|
31
|
+
const formattedValue = await (0, format_1.format)(templateResult, undefined, useProjectPrettier);
|
|
16
32
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
33
|
+
if (useEslintFix) {
|
|
34
|
+
await (0, eslintFix_1.eslintFix)(file);
|
|
35
|
+
}
|
|
17
36
|
this.logger.info(`File recording completed: ${file}`);
|
|
18
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientFullIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientFullIndex.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"writeClientFullIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientFullIndex.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBrG"}
|
|
@@ -9,7 +9,7 @@ const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
|
9
9
|
* library. But yuo can also import individual models and services directly.
|
|
10
10
|
*/
|
|
11
11
|
async function writeClientFullIndex(options) {
|
|
12
|
-
const { templates, outputPath, core, models, schemas, services } = options;
|
|
12
|
+
const { templates, outputPath, core, models, schemas, services, modelsMode, modelsPackage } = options;
|
|
13
13
|
const resolvePathIndex = (0, pathHelpers_1.resolveHelper)(outputPath, 'index.ts');
|
|
14
14
|
this.logger.info(`Data has been written to a file: ${resolvePathIndex}`);
|
|
15
15
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile(resolvePathIndex, templates.indexes.full({
|
|
@@ -17,6 +17,8 @@ async function writeClientFullIndex(options) {
|
|
|
17
17
|
models,
|
|
18
18
|
schemas,
|
|
19
19
|
services,
|
|
20
|
+
modelsMode,
|
|
21
|
+
modelsPackage,
|
|
20
22
|
}));
|
|
21
23
|
this.logger.info(`Writing to the file is completed: ${resolvePathIndex}`);
|
|
22
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Templates } from '../types/base/Templates.model';
|
|
2
2
|
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
3
|
+
import { ModelsMode } from '../types/enums/ModelsMode.enum';
|
|
3
4
|
import type { Model } from '../types/shared/Model.model';
|
|
4
5
|
import { WriteClient } from '../WriteClient';
|
|
5
6
|
/**
|
|
@@ -15,6 +16,11 @@ interface IWriteClientModels {
|
|
|
15
16
|
outputModelsPath: string;
|
|
16
17
|
httpClient: HttpClient;
|
|
17
18
|
useUnionTypes: boolean;
|
|
19
|
+
useOptions?: boolean;
|
|
20
|
+
modelsMode?: ModelsMode;
|
|
21
|
+
outputCorePath?: string;
|
|
22
|
+
useProjectPrettier?: boolean;
|
|
23
|
+
useEslintFix?: boolean;
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
26
|
* Generate Models using the Handlebar template and write to disk.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientModels.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModels.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeClientModels.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModels.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;GAMG;AACH,UAAU,kBAAkB;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwDrG"}
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeClientModels = writeClientModels;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
|
+
const eslintFix_1 = require("../../common/utils/eslintFix");
|
|
5
6
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
6
7
|
const format_1 = require("../../common/utils/format");
|
|
7
8
|
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
9
|
+
const ModelsMode_enum_1 = require("../types/enums/ModelsMode.enum");
|
|
8
10
|
/**
|
|
9
11
|
* Generate Models using the Handlebar template and write to disk.
|
|
10
12
|
* @param models Array of Models to write
|
|
@@ -14,12 +16,28 @@ const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
|
14
16
|
* @param useUnionTypes Use union types instead of enums
|
|
15
17
|
*/
|
|
16
18
|
async function writeClientModels(options) {
|
|
17
|
-
const { models, templates, outputModelsPath, httpClient, useUnionTypes } = options;
|
|
19
|
+
const { models, templates, outputModelsPath, httpClient, useUnionTypes, modelsMode, outputCorePath, useOptions, useProjectPrettier, useEslintFix } = options;
|
|
18
20
|
this.logger.info('Recording of model files begins');
|
|
21
|
+
if (modelsMode === ModelsMode_enum_1.ModelsMode.CLASSES) {
|
|
22
|
+
const file = (0, pathHelpers_1.resolveHelper)(outputModelsPath, 'models.ts');
|
|
23
|
+
const templateResult = templates.exports.models({
|
|
24
|
+
models,
|
|
25
|
+
httpClient,
|
|
26
|
+
useUnionTypes,
|
|
27
|
+
useOptions,
|
|
28
|
+
outputCore: outputCorePath || '../core',
|
|
29
|
+
modelsMode,
|
|
30
|
+
});
|
|
31
|
+
const formattedValue = await (0, format_1.format)(templateResult);
|
|
32
|
+
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
33
|
+
this.logger.info(`File recording completed: ${file}`);
|
|
34
|
+
this.logger.info('Model file recording completed successfully');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
19
37
|
for (const model of models) {
|
|
20
38
|
const modelFolderPath = model?.path;
|
|
21
39
|
if (!modelFolderPath) {
|
|
22
|
-
|
|
40
|
+
continue;
|
|
23
41
|
}
|
|
24
42
|
const dir = (0, pathHelpers_1.dirNameHelper)(modelFolderPath);
|
|
25
43
|
if (dir) {
|
|
@@ -34,8 +52,11 @@ async function writeClientModels(options) {
|
|
|
34
52
|
httpClient,
|
|
35
53
|
useUnionTypes,
|
|
36
54
|
});
|
|
37
|
-
const formattedValue = await (0, format_1.format)(templateResult);
|
|
55
|
+
const formattedValue = await (0, format_1.format)(templateResult, undefined, useProjectPrettier);
|
|
38
56
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
57
|
+
if (useEslintFix) {
|
|
58
|
+
await (0, eslintFix_1.eslintFix)(file);
|
|
59
|
+
}
|
|
39
60
|
this.logger.info(`File recording completed: ${file}`);
|
|
40
61
|
}
|
|
41
62
|
this.logger.info('Model file recording completed successfully');
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Templates } from '../types/base/Templates.model';
|
|
2
2
|
import { Model } from '../types/shared/Model.model';
|
|
3
3
|
import { WriteClient } from '../WriteClient';
|
|
4
|
+
import { ModelsMode } from '../types/enums/ModelsMode.enum';
|
|
4
5
|
interface IOptionsProps {
|
|
5
6
|
models: Model[];
|
|
6
7
|
templates: Templates;
|
|
7
8
|
outputModelsPath: string;
|
|
8
9
|
useSeparatedIndexes?: boolean;
|
|
10
|
+
modelsMode?: ModelsMode;
|
|
9
11
|
}
|
|
10
12
|
export declare function writeClientModelsIndex(this: WriteClient, options: IOptionsProps): Promise<void>;
|
|
11
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientModelsIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModelsIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"writeClientModelsIndex.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientModelsIndex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,UAAU,aAAa;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,iBAcrF"}
|
|
@@ -4,13 +4,13 @@ exports.writeClientModelsIndex = writeClientModelsIndex;
|
|
|
4
4
|
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
5
5
|
const appendUniqueLinesToFile_1 = require("./appendUniqueLinesToFile");
|
|
6
6
|
async function writeClientModelsIndex(options) {
|
|
7
|
-
const { models, templates, outputModelsPath, useSeparatedIndexes } = options;
|
|
7
|
+
const { models, templates, outputModelsPath, useSeparatedIndexes, modelsMode } = options;
|
|
8
8
|
if (!useSeparatedIndexes) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const filePath = (0, pathHelpers_1.resolveHelper)(outputModelsPath, 'index.ts');
|
|
12
12
|
this.logger.info(`Data has been written to a file: ${filePath}`);
|
|
13
|
-
const content = templates.indexes.models({ models });
|
|
13
|
+
const content = templates.indexes.models({ models, modelsMode });
|
|
14
14
|
await (0, appendUniqueLinesToFile_1.appendUniqueLinesToFile)(filePath, content);
|
|
15
15
|
this.logger.info(`Writing to the file is completed: ${filePath}`);
|
|
16
16
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Templates } from '../types/base/Templates.model';
|
|
2
|
+
import { EmptySchemaStrategy } from '../types/enums/EmptySchemaStrategy.enum';
|
|
2
3
|
import { HttpClient } from '../types/enums/HttpClient.enum';
|
|
3
4
|
import { ValidationLibrary } from '../types/enums/ValidationLibrary.enum';
|
|
4
5
|
import type { Model } from '../types/shared/Model.model';
|
|
@@ -17,7 +18,11 @@ interface IWriteClientSchemas {
|
|
|
17
18
|
httpClient: HttpClient;
|
|
18
19
|
useUnionTypes: boolean;
|
|
19
20
|
validationLibrary?: ValidationLibrary;
|
|
21
|
+
emptySchemaStrategy: EmptySchemaStrategy;
|
|
22
|
+
useProjectPrettier?: boolean;
|
|
23
|
+
useEslintFix?: boolean;
|
|
20
24
|
}
|
|
25
|
+
export declare function isEmptySchemaModel(model: Model): boolean;
|
|
21
26
|
/**
|
|
22
27
|
* Generate Schemas using the Handlebar template and write to disk.
|
|
23
28
|
* @param models Array of Models to write
|
|
@@ -26,6 +31,6 @@ interface IWriteClientSchemas {
|
|
|
26
31
|
* @param httpClient The selected httpClient (fetch, xhr or node)
|
|
27
32
|
* @param useUnionTypes Use union types instead of enums
|
|
28
33
|
*/
|
|
29
|
-
export declare function writeClientSchemas(this: WriteClient, options: IWriteClientSchemas): Promise<
|
|
34
|
+
export declare function writeClientSchemas(this: WriteClient, options: IWriteClientSchemas): Promise<Model[]>;
|
|
30
35
|
export {};
|
|
31
36
|
//# sourceMappingURL=writeClientSchemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientSchemas.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSchemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeClientSchemas.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientSchemas.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;GAMG;AACH,UAAU,mBAAmB;IACzB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAExD;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CA2C1G"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEmptySchemaModel = isEmptySchemaModel;
|
|
3
4
|
exports.writeClientSchemas = writeClientSchemas;
|
|
4
5
|
const fs_1 = require("fs");
|
|
6
|
+
const eslintFix_1 = require("../../common/utils/eslintFix");
|
|
5
7
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
6
8
|
const format_1 = require("../../common/utils/format");
|
|
7
9
|
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
10
|
+
const EmptySchemaStrategy_enum_1 = require("../types/enums/EmptySchemaStrategy.enum");
|
|
11
|
+
function isEmptySchemaModel(model) {
|
|
12
|
+
return model.export === 'interface' && model.properties.length === 0;
|
|
13
|
+
}
|
|
8
14
|
/**
|
|
9
15
|
* Generate Schemas using the Handlebar template and write to disk.
|
|
10
16
|
* @param models Array of Models to write
|
|
@@ -14,10 +20,11 @@ const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
|
14
20
|
* @param useUnionTypes Use union types instead of enums
|
|
15
21
|
*/
|
|
16
22
|
async function writeClientSchemas(options) {
|
|
17
|
-
const { models, templates, outputSchemasPath, httpClient, useUnionTypes, validationLibrary } = options;
|
|
23
|
+
const { models, templates, outputSchemasPath, httpClient, useUnionTypes, validationLibrary, emptySchemaStrategy, useProjectPrettier, useEslintFix } = options;
|
|
18
24
|
if (templates.exports.schema) {
|
|
19
25
|
this.logger.info('The recording of model validation schema files begins.');
|
|
20
|
-
|
|
26
|
+
const modelsToWrite = emptySchemaStrategy === EmptySchemaStrategy_enum_1.EmptySchemaStrategy.SKIP ? models.filter(model => !isEmptySchemaModel(model)) : models;
|
|
27
|
+
for (const model of modelsToWrite) {
|
|
21
28
|
const modelFolderPath = model?.path;
|
|
22
29
|
const dir = (0, pathHelpers_1.dirNameHelper)(modelFolderPath);
|
|
23
30
|
if (dir) {
|
|
@@ -32,11 +39,17 @@ async function writeClientSchemas(options) {
|
|
|
32
39
|
httpClient,
|
|
33
40
|
useUnionTypes,
|
|
34
41
|
validationLibrary,
|
|
42
|
+
emptySchemaStrategy,
|
|
35
43
|
});
|
|
36
|
-
const formattedValue = await (0, format_1.format)(templateResult);
|
|
44
|
+
const formattedValue = await (0, format_1.format)(templateResult, undefined, useProjectPrettier);
|
|
37
45
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
46
|
+
if (useEslintFix) {
|
|
47
|
+
await (0, eslintFix_1.eslintFix)(file);
|
|
48
|
+
}
|
|
38
49
|
this.logger.info(`File recording completed: ${file}`);
|
|
39
50
|
}
|
|
40
51
|
this.logger.info('The recording of model validation schema files has been completed successfully');
|
|
52
|
+
return modelsToWrite;
|
|
41
53
|
}
|
|
54
|
+
return [];
|
|
42
55
|
}
|
|
@@ -21,6 +21,8 @@ interface IWriteClientServices {
|
|
|
21
21
|
useUnionTypes: boolean;
|
|
22
22
|
useOptions: boolean;
|
|
23
23
|
useCancelableRequest: boolean;
|
|
24
|
+
useProjectPrettier?: boolean;
|
|
25
|
+
useEslintFix?: boolean;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Generate Services using the Handlebar template and write to disk.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeClientServices.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeClientServices.d.ts","sourceRoot":"","sources":["../../../src/core/utils/writeClientServices.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,eAAe,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BzG"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.writeClientServices = writeClientServices;
|
|
4
|
+
const eslintFix_1 = require("../../common/utils/eslintFix");
|
|
4
5
|
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
5
6
|
const format_1 = require("../../common/utils/format");
|
|
6
7
|
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
@@ -14,7 +15,7 @@ const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
|
14
15
|
* @param useOptions Use options or arguments functions
|
|
15
16
|
*/
|
|
16
17
|
async function writeClientServices(options) {
|
|
17
|
-
const { services, templates, outputPaths, httpClient, useUnionTypes, useOptions, useCancelableRequest } = options;
|
|
18
|
+
const { services, templates, outputPaths, httpClient, useUnionTypes, useOptions, useCancelableRequest, useProjectPrettier, useEslintFix } = options;
|
|
18
19
|
this.logger.info('Recording of service files begins');
|
|
19
20
|
for (const service of services) {
|
|
20
21
|
const file = (0, pathHelpers_1.resolveHelper)(outputPaths.outputServices, `${service.name}.ts`);
|
|
@@ -28,8 +29,11 @@ async function writeClientServices(options) {
|
|
|
28
29
|
outputModels: outputPaths.outputModels,
|
|
29
30
|
useCancelableRequest,
|
|
30
31
|
});
|
|
31
|
-
const formattedValue = await (0, format_1.format)(templateResult);
|
|
32
|
+
const formattedValue = await (0, format_1.format)(templateResult, undefined, useProjectPrettier);
|
|
32
33
|
await fileSystemHelpers_1.fileSystemHelpers.writeFile(file, formattedValue);
|
|
34
|
+
if (useEslintFix) {
|
|
35
|
+
await (0, eslintFix_1.eslintFix)(file);
|
|
36
|
+
}
|
|
33
37
|
this.logger.info(`File recording completed: ${file}`);
|
|
34
38
|
}
|
|
35
39
|
this.logger.info('Service file recording completed successfully');
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
3
3
|
"2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
-
"
|
|
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) => string;
|
|
6
|
+
"7": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
7
|
+
"9": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
8
|
compiler: (string | number)[];
|
|
6
9
|
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
7
10
|
useData: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openApiConfig.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/cli/openApiConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openApiConfig.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/cli/openApiConfig.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,wBA6IiB"}
|
|
@@ -7,81 +7,132 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
/* eslint: disable */
|
|
8
8
|
// @ts-nocheck
|
|
9
9
|
exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
10
|
-
var stack1, alias1 = container.
|
|
10
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), alias2 = container.strict, alias3 = container.lambda, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
11
11
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
12
12
|
return parent[propertyName];
|
|
13
13
|
}
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
|
-
return "{\n \"items\": "
|
|
17
|
-
+ ((stack1 =
|
|
18
|
-
+ ",\n \"httpClient\": \""
|
|
19
|
-
+ ((stack1 = alias2(
|
|
16
|
+
return "{\n \"items\": [\n"
|
|
17
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(lookupProperty(data, "root"), "items"), { "name": "each", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 10, "column": 9 } } })) != null ? stack1 : "")
|
|
18
|
+
+ " ],\n \"httpClient\": \""
|
|
19
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "httpClient", { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
20
20
|
+ "\",\n \"sortByRequired\": "
|
|
21
|
-
+ ((stack1 = alias2(
|
|
21
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 44 } }), depth0)) != null ? stack1 : "")
|
|
22
22
|
+ ",\n \"enumPrefix\": \""
|
|
23
|
-
+ ((stack1 = alias2(
|
|
23
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
24
24
|
+ "\",\n \"excludeCoreServiceFiles\": "
|
|
25
|
-
+ ((stack1 = alias2(
|
|
25
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 15, "column": 33 }, "end": { "line": 15, "column": 62 } }), depth0)) != null ? stack1 : "")
|
|
26
26
|
+ ",\n \"interfacePrefix\": \""
|
|
27
|
-
+ ((stack1 = alias2(
|
|
27
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 47 } }), depth0)) != null ? stack1 : "")
|
|
28
28
|
+ "\",\n \"typePrefix\": \""
|
|
29
|
-
+ ((stack1 = alias2(
|
|
29
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 17, "column": 21 }, "end": { "line": 17, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
30
30
|
+ "\",\n \"useCancelableRequest\": "
|
|
31
|
-
+ ((stack1 = alias2(
|
|
31
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 18, "column": 30 }, "end": { "line": 18, "column": 56 } }), depth0)) != null ? stack1 : "")
|
|
32
32
|
+ ",\n \"useOptions\": "
|
|
33
|
-
+ ((stack1 = alias2(
|
|
33
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useOptions", { "start": { "line": 19, "column": 20 }, "end": { "line": 19, "column": 36 } }), depth0)) != null ? stack1 : "")
|
|
34
34
|
+ ",\n \"useSeparatedIndexes\": "
|
|
35
|
-
+ ((stack1 = alias2(
|
|
35
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 20, "column": 29 }, "end": { "line": 20, "column": 54 } }), depth0)) != null ? stack1 : "")
|
|
36
36
|
+ ",\n \"useUnionTypes\": "
|
|
37
|
-
+ ((stack1 = alias2(
|
|
38
|
-
+ "
|
|
39
|
-
+ ((stack1 = lookupProperty(helpers, "if").call(
|
|
40
|
-
+ "\n
|
|
37
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 21, "column": 23 }, "end": { "line": 21, "column": 42 } }), depth0)) != null ? stack1 : "")
|
|
38
|
+
+ ","
|
|
39
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 21, "column": 45 }, "end": { "line": 22, "column": 41 } } })) != null ? stack1 : "")
|
|
40
|
+
+ "\n \"modelsMode\": \""
|
|
41
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 23, "column": 21 }, "end": { "line": 23, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
42
|
+
+ "\",\n \"useHistory\": "
|
|
43
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useHistory", { "start": { "line": 24, "column": 20 }, "end": { "line": 24, "column": 36 } }), depth0)) != null ? stack1 : "")
|
|
44
|
+
+ ",\n \"diffReport\": \""
|
|
45
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "diffReport", { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
46
|
+
+ "\""
|
|
47
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 25, "column": 40 }, "end": { "line": 26, "column": 41 } } })) != null ? stack1 : "")
|
|
48
|
+
+ ",\n \"models\": {\n \"mode\": \""
|
|
49
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 28, "column": 19 }, "end": { "line": 28, "column": 35 } }), depth0)) != null ? stack1 : "")
|
|
50
|
+
+ "\"\n },\n \"analyze\": {\n \"useHistory\": "
|
|
51
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "useHistory", { "start": { "line": 31, "column": 24 }, "end": { "line": 31, "column": 40 } }), depth0)) != null ? stack1 : "")
|
|
52
|
+
+ ",\n \"reportPath\": \""
|
|
53
|
+
+ ((stack1 = alias3(alias2(lookupProperty(data, "root"), "diffReport", { "start": { "line": 32, "column": 25 }, "end": { "line": 32, "column": 41 } }), depth0)) != null ? stack1 : "")
|
|
54
|
+
+ "\"\n },\n \"miracles\": {\n \"enabled\": true,\n \"confidence\": 1,\n \"types\": [\"RENAME\", \"TYPE_COERCION\"]\n }\n}\n";
|
|
41
55
|
}, "2": function (container, depth0, helpers, partials, data) {
|
|
56
|
+
var stack1, alias1 = container.strict, alias2 = container.lambda, alias3 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
57
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
58
|
+
return parent[propertyName];
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
};
|
|
62
|
+
return " {\n \"input\": \""
|
|
63
|
+
+ ((stack1 = alias2(alias1(depth0, "input", { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 29 } }), depth0)) != null ? stack1 : "")
|
|
64
|
+
+ "\",\n \"output\": \""
|
|
65
|
+
+ ((stack1 = alias2(alias1(depth0, "output", { "start": { "line": 7, "column": 25 }, "end": { "line": 7, "column": 31 } }), depth0)) != null ? stack1 : "")
|
|
66
|
+
+ "\""
|
|
67
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias3, lookupProperty(depth0, "request"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 7, "column": 34 }, "end": { "line": 8, "column": 43 } } })) != null ? stack1 : "")
|
|
68
|
+
+ "\n }"
|
|
69
|
+
+ ((stack1 = lookupProperty(helpers, "unless").call(alias3, lookupProperty(data, "last"), { "name": "unless", "hash": {}, "fn": container.program(5, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 38 } } })) != null ? stack1 : "")
|
|
70
|
+
+ "\n";
|
|
71
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
72
|
+
var stack1;
|
|
73
|
+
return ",\n \"request\": \""
|
|
74
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "request", { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 33 } }), depth0)) != null ? stack1 : "")
|
|
75
|
+
+ "\"";
|
|
76
|
+
}, "5": function (container, depth0, helpers, partials, data) {
|
|
77
|
+
return ",";
|
|
78
|
+
}, "7": function (container, depth0, helpers, partials, data) {
|
|
42
79
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
43
80
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
44
81
|
return parent[propertyName];
|
|
45
82
|
}
|
|
46
83
|
return undefined;
|
|
47
84
|
};
|
|
48
|
-
return "\"request\": \""
|
|
49
|
-
+ ((stack1 = container.lambda(container.strict(lookupProperty(data, "root"), "request", { "start": { "line":
|
|
85
|
+
return ",\n \"request\": \""
|
|
86
|
+
+ ((stack1 = container.lambda(container.strict(lookupProperty(data, "root"), "request", { "start": { "line": 22, "column": 18 }, "end": { "line": 22, "column": 31 } }), depth0)) != null ? stack1 : "")
|
|
50
87
|
+ "\"";
|
|
51
|
-
}, "
|
|
52
|
-
var stack1, alias1 = container.strict, alias2 = container.lambda, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
88
|
+
}, "9": function (container, depth0, helpers, partials, data) {
|
|
89
|
+
var stack1, alias1 = container.strict, alias2 = container.lambda, alias3 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
53
90
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
54
91
|
return parent[propertyName];
|
|
55
92
|
}
|
|
56
93
|
return undefined;
|
|
57
94
|
};
|
|
58
95
|
return "{\n \"input\": \""
|
|
59
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "input", { "start": { "line":
|
|
96
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "input", { "start": { "line": 42, "column": 16 }, "end": { "line": 42, "column": 27 } }), depth0)) != null ? stack1 : "")
|
|
60
97
|
+ "\",\n \"output\": \""
|
|
61
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "output", { "start": { "line":
|
|
98
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "output", { "start": { "line": 43, "column": 17 }, "end": { "line": 43, "column": 29 } }), depth0)) != null ? stack1 : "")
|
|
62
99
|
+ "\",\n \"httpClient\": \""
|
|
63
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "httpClient", { "start": { "line":
|
|
100
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "httpClient", { "start": { "line": 44, "column": 21 }, "end": { "line": 44, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
64
101
|
+ "\",\n \"sortByRequired\": "
|
|
65
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "sortByRequired", { "start": { "line":
|
|
102
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 45, "column": 24 }, "end": { "line": 45, "column": 44 } }), depth0)) != null ? stack1 : "")
|
|
66
103
|
+ ",\n \"enumPrefix\": \""
|
|
67
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "enumPrefix", { "start": { "line":
|
|
104
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 46, "column": 21 }, "end": { "line": 46, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
68
105
|
+ "\",\n \"excludeCoreServiceFiles\": "
|
|
69
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line":
|
|
106
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 47, "column": 33 }, "end": { "line": 47, "column": 62 } }), depth0)) != null ? stack1 : "")
|
|
70
107
|
+ ",\n \"interfacePrefix\": \""
|
|
71
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line":
|
|
108
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 47 } }), depth0)) != null ? stack1 : "")
|
|
72
109
|
+ "\",\n \"typePrefix\": \""
|
|
73
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "typePrefix", { "start": { "line":
|
|
110
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 49, "column": 21 }, "end": { "line": 49, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
74
111
|
+ "\",\n \"useCancelableRequest\": "
|
|
75
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line":
|
|
112
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 50, "column": 30 }, "end": { "line": 50, "column": 56 } }), depth0)) != null ? stack1 : "")
|
|
76
113
|
+ ",\n \"useOptions\": "
|
|
77
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useOptions", { "start": { "line":
|
|
114
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useOptions", { "start": { "line": 51, "column": 20 }, "end": { "line": 51, "column": 36 } }), depth0)) != null ? stack1 : "")
|
|
78
115
|
+ ",\n \"useSeparatedIndexes\": "
|
|
79
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line":
|
|
116
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 52, "column": 29 }, "end": { "line": 52, "column": 54 } }), depth0)) != null ? stack1 : "")
|
|
80
117
|
+ ",\n \"useUnionTypes\": "
|
|
81
|
-
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line":
|
|
82
|
-
+ "
|
|
83
|
-
+ ((stack1 = lookupProperty(helpers, "if").call(
|
|
84
|
-
+ "\n
|
|
118
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 53, "column": 23 }, "end": { "line": 53, "column": 42 } }), depth0)) != null ? stack1 : "")
|
|
119
|
+
+ ","
|
|
120
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias3, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 53, "column": 45 }, "end": { "line": 54, "column": 41 } } })) != null ? stack1 : "")
|
|
121
|
+
+ "\n \"modelsMode\": \""
|
|
122
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 55, "column": 21 }, "end": { "line": 55, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
123
|
+
+ "\",\n \"useHistory\": "
|
|
124
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useHistory", { "start": { "line": 56, "column": 20 }, "end": { "line": 56, "column": 36 } }), depth0)) != null ? stack1 : "")
|
|
125
|
+
+ ",\n \"diffReport\": \""
|
|
126
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "diffReport", { "start": { "line": 57, "column": 21 }, "end": { "line": 57, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
127
|
+
+ "\""
|
|
128
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias3, lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(7, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 57, "column": 40 }, "end": { "line": 58, "column": 41 } } })) != null ? stack1 : "")
|
|
129
|
+
+ ",\n \"models\": {\n \"mode\": \""
|
|
130
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "modelsMode", { "start": { "line": 60, "column": 19 }, "end": { "line": 60, "column": 35 } }), depth0)) != null ? stack1 : "")
|
|
131
|
+
+ "\"\n },\n \"analyze\": {\n \"useHistory\": "
|
|
132
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useHistory", { "start": { "line": 63, "column": 24 }, "end": { "line": 63, "column": 40 } }), depth0)) != null ? stack1 : "")
|
|
133
|
+
+ ",\n \"reportPath\": \""
|
|
134
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "diffReport", { "start": { "line": 64, "column": 25 }, "end": { "line": 64, "column": 41 } }), depth0)) != null ? stack1 : "")
|
|
135
|
+
+ "\"\n },\n \"miracles\": {\n \"enabled\": true,\n \"confidence\": 1,\n \"types\": [\"RENAME\", \"TYPE_COERCION\"]\n }\n}\n";
|
|
85
136
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
86
137
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
87
138
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -89,5 +140,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
89
140
|
}
|
|
90
141
|
return undefined;
|
|
91
142
|
};
|
|
92
|
-
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "
|
|
143
|
+
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "items"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.program(9, data, 0), "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 72, "column": 7 } } })) != null ? stack1 : "");
|
|
93
144
|
}, "useData": true };
|
|
@@ -14,5 +14,5 @@ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, de
|
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
16
|
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
17
|
-
+ "\nexport class ApiError<TBody = unknown> extends Error {\n readonly status: number;\n readonly body?: TBody;\n readonly headers?: Record<string, string>;\n readonly request: RequestConfig;\n\n constructor(params: { status: number; message: string; body?: TBody; headers?: Record<string, string>; request: RequestConfig }) {\n super(params.message);\n this.name = 'ApiError';\n this.status = params.status;\n this.body = params.body;\n this.headers = params.headers;\n this.request = params.request;\n }\n}\n";
|
|
17
|
+
+ "\nimport { RequestConfig } from './executor/requestExecutor';\n\nexport class ApiError<TBody = unknown> extends Error {\n readonly status: number;\n readonly body?: TBody;\n readonly headers?: Record<string, string>;\n readonly request: RequestConfig;\n\n constructor(params: { status: number; message: string; body?: TBody; headers?: Record<string, string>; request: RequestConfig }) {\n super(params.message);\n this.name = 'ApiError';\n this.status = params.status;\n this.body = params.body;\n this.headers = params.headers;\n this.request = params.request;\n }\n}\n";
|
|
18
18
|
}, "usePartial": true, "useData": true };
|
|
@@ -14,5 +14,5 @@ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, de
|
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
16
|
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
17
|
-
+ "\nexport type ApiRequestOptions = {\n readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';\n readonly path: string;\n readonly cookies?: Record<string, any>;\n readonly headers?: Record<string, any>;\n readonly query?: Record<string, any>;\n readonly formData?: Record<string, any>;\n readonly body?: any;\n readonly mediaType?: string;\n readonly responseHeader?: string;\n // TODO TS2344: Redesign the logic for generating errors. Use the string value of the error code.\n // @ts-ignore\n readonly errors?: Record<number, string>;\n}\n";
|
|
17
|
+
+ "\nexport type ApiRequestOptions = {\n readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';\n readonly path: string;\n readonly cookies?: Record<string, any>;\n readonly headers?: Record<string, any>;\n readonly query?: Record<string, any>;\n readonly formData?: Record<string, any>;\n readonly body?: any;\n readonly mediaType?: string;\n readonly responseHeader?: string;\n readonly responseType?: 'blob';\n // TODO TS2344: Redesign the logic for generating errors. Use the string value of the error code.\n // @ts-ignore\n readonly errors?: Record<number, string>;\n}\n";
|
|
18
18
|
}, "usePartial": true, "useData": true };
|
|
@@ -14,5 +14,5 @@ exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, de
|
|
|
14
14
|
return undefined;
|
|
15
15
|
};
|
|
16
16
|
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
17
|
-
+ "\nexport type ApiResult = {\n readonly url: string;\n readonly ok: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly body:
|
|
17
|
+
+ "\nexport type ApiResult<TBody = unknown> = {\n readonly url: string;\n readonly ok: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly body: TBody;\n}\n";
|
|
18
18
|
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseDto.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/BaseDto.ts"],"names":[],"mappings":";;;;;;AAMA,wBAUmC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 = { "compiler": [8, ">= 4.3.0"], "main": 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 ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
17
|
+
+ "\nexport abstract class BaseDto<Raw> {\n protected readonly _raw: Raw;\n\n protected constructor(data: Raw) {\n this._raw = data;\n }\n\n public abstract toJSON(): Raw;\n\n public clone(): this {\n const ctor = this.constructor as new (data: Raw) => this;\n return new ctor(this.toJSON());\n }\n}\n";
|
|
18
|
+
}, "usePartial": true, "useData": true };
|