ts-openapi-codegen 2.0.0-beta.0 → 2.0.0-beta.10
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 +175 -55
- package/README.rus.md +175 -54
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts +2 -1
- package/dist/cli/checkAndUpdateConfig/checkConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/checkConfig.js +14 -6
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts +2 -1
- package/dist/cli/checkAndUpdateConfig/updateConfig.d.ts.map +1 -1
- package/dist/cli/checkAndUpdateConfig/updateConfig.js +13 -5
- package/dist/cli/{generate/runGenerateOpenApi.d.ts → generateOpenApiClient/generateOpenApiClient.d.ts} +2 -2
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -0
- package/dist/cli/{generate/runGenerateOpenApi.js → generateOpenApiClient/generateOpenApiClient.js} +31 -11
- package/dist/cli/index.js +29 -8
- package/dist/cli/initOpenApiConfig/Types.d.ts +4 -4
- package/dist/cli/initOpenApiConfig/Types.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/init.d.ts +6 -0
- package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/init.js +53 -0
- package/dist/cli/initOpenApiConfig/initConfig.d.ts +11 -0
- package/dist/cli/initOpenApiConfig/initConfig.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/initConfig.js +102 -0
- package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts +3 -0
- package/dist/cli/initOpenApiConfig/initCustomRequest.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/initCustomRequest.js +23 -0
- package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts +21 -0
- package/dist/cli/initOpenApiConfig/utils/buildConfig.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/buildConfig.js +107 -0
- package/dist/cli/initOpenApiConfig/utils/findSpecFiles.d.ts +8 -0
- package/dist/cli/initOpenApiConfig/utils/findSpecFiles.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/findSpecFiles.js +40 -0
- package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.d.ts +3 -0
- package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/registerHandlebarTemplates.js +53 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts +7 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFile.js +23 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.d.ts +11 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/validateSpecFiles.js +24 -0
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts +11 -0
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.d.ts.map +1 -0
- package/dist/cli/initOpenApiConfig/utils/writeConfigFile.js +31 -0
- package/dist/cli/previewChanges/previewChanges.d.ts +8 -0
- package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -0
- package/dist/cli/previewChanges/previewChanges.js +189 -0
- package/dist/cli/previewChanges/utils/compareFiles.d.ts +6 -0
- package/dist/cli/previewChanges/utils/compareFiles.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/compareFiles.js +50 -0
- package/dist/cli/previewChanges/utils/formatDiff.d.ts +6 -0
- package/dist/cli/previewChanges/utils/formatDiff.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/formatDiff.js +30 -0
- package/dist/cli/previewChanges/utils/isDirectoryEmpty.d.ts +5 -0
- package/dist/cli/previewChanges/utils/isDirectoryEmpty.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/isDirectoryEmpty.js +17 -0
- package/dist/cli/previewChanges/utils/readDirectoryRecursive.d.ts +5 -0
- package/dist/cli/previewChanges/utils/readDirectoryRecursive.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/readDirectoryRecursive.js +28 -0
- package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts +10 -0
- package/dist/cli/previewChanges/utils/updateOutputPaths.d.ts.map +1 -0
- package/dist/cli/previewChanges/utils/updateOutputPaths.js +106 -0
- package/dist/cli/schemas/base.d.ts +22 -0
- package/dist/cli/schemas/base.d.ts.map +1 -0
- package/dist/cli/schemas/base.js +23 -0
- package/dist/cli/schemas/checkConfig.d.ts +6 -0
- package/dist/cli/schemas/checkConfig.d.ts.map +1 -0
- package/dist/cli/schemas/checkConfig.js +5 -0
- package/dist/cli/schemas/generate.d.ts +8 -0
- package/dist/cli/schemas/generate.d.ts.map +1 -0
- package/dist/cli/schemas/generate.js +45 -0
- package/dist/cli/schemas/index.d.ts +8 -0
- package/dist/cli/schemas/index.d.ts.map +1 -0
- package/dist/cli/schemas/index.js +22 -0
- package/dist/cli/schemas/init.d.ts +10 -0
- package/dist/cli/schemas/init.d.ts.map +1 -0
- package/dist/cli/schemas/init.js +11 -0
- package/dist/cli/schemas/previewChanges.d.ts +9 -0
- package/dist/cli/schemas/previewChanges.d.ts.map +1 -0
- package/dist/cli/schemas/previewChanges.js +11 -0
- package/dist/cli/schemas/updateConfig.d.ts +6 -0
- package/dist/cli/schemas/updateConfig.d.ts.map +1 -0
- package/dist/cli/schemas/updateConfig.js +5 -0
- package/dist/common/Consts.d.ts +5 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +9 -2
- package/dist/common/LoggerMessages.js +1 -1
- package/dist/common/TRawOptions.d.ts +4 -36
- package/dist/common/TRawOptions.d.ts.map +1 -1
- package/dist/common/Validation/formatZodError.d.ts +10 -0
- package/dist/common/Validation/formatZodError.d.ts.map +1 -0
- package/dist/common/Validation/formatZodError.js +114 -0
- package/dist/common/Validation/index.d.ts +3 -0
- package/dist/common/Validation/index.d.ts.map +1 -0
- package/dist/common/Validation/index.js +18 -0
- package/dist/common/Validation/validateZodOptions.d.ts +27 -0
- package/dist/common/Validation/validateZodOptions.d.ts.map +1 -0
- package/dist/common/Validation/validateZodOptions.js +35 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllMigrationPlans.js +10 -4
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts +6 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/AllVersionedSchemas.js +8 -8
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts +28 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedBase.js +25 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts +37 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.js +37 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +38 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.js +34 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts +40 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV3.js +36 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts +65 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.d.ts.map +1 -0
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedVersionedSchemas.js +31 -0
- package/dist/common/VersionedSchema/CommonSchemas.d.ts +53 -29
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +44 -62
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan.js +9 -16
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts +25 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV1.js +34 -17
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts +25 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV2.js +28 -19
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts +25 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV3.js +29 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts +25 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV4.js +30 -14
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts +23 -5
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsSchemaV5.js +33 -18
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts +3 -2
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas.js +18 -11
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsMigrationPlans.js +2 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts +22 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV1.js +30 -12
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts +22 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV2.js +27 -13
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts +22 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV3.js +28 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts +22 -5
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsSchemaV4.js +31 -12
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts +3 -2
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/OptionsVersioned/OptionsVersionedSchemas.js +15 -9
- package/dist/common/VersionedSchema/Types.d.ts +5 -5
- package/dist/common/VersionedSchema/Types.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts +16 -0
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__mocks__/compatibilityCases.js +85 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__tests__/compareShapes.test.js +23 -0
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts +2 -0
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/__tests__/migrateDataToLatestSchemaVersion.test.js +75 -0
- package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts +12 -0
- package/dist/common/VersionedSchema/Utils/buildVersionedSchema.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/buildVersionedSchema.js +13 -0
- package/dist/common/VersionedSchema/Utils/compareShapes.d.ts +16 -0
- package/dist/common/VersionedSchema/Utils/compareShapes.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/compareShapes.js +30 -0
- package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.d.ts +32 -0
- package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/createFieldTransformationMigration.js +40 -0
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts +2 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/determineBestMatchingSchemaVersion.js +5 -5
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts +2 -2
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/getCurrentErrorMessage.js +15 -7
- package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.d.ts +16 -0
- package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.d.ts.map +1 -0
- package/dist/common/VersionedSchema/Utils/getLatestVersionFromMigrationPlans.js +23 -0
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts +2 -2
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/getUniqueKeysFromSchemas.js +16 -3
- package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/getUniqueObjectKeys.js +19 -2
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts +2 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.d.ts.map +1 -1
- package/dist/common/VersionedSchema/Utils/migrateDataToLatestSchemaVersion.js +10 -9
- package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts +4 -0
- package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.d.ts.map +1 -0
- package/dist/common/VersionedSchema/refinements/dependentOptionsRefinement.js +43 -0
- package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts +4 -0
- package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.d.ts.map +1 -0
- package/dist/common/VersionedSchema/refinements/singleOrMultiRefinement.js +21 -0
- package/dist/common/defaultOptions.d.ts.map +1 -1
- package/dist/common/defaultOptions.js +2 -1
- package/dist/common/utils/__tests__/convertArrayToObject.test.js +5 -6
- package/dist/common/utils/convertArrayToObject.d.ts.map +1 -1
- package/dist/common/utils/convertArrayToObject.js +1 -2
- package/dist/common/utils/fileSystemHelpers.d.ts +3 -1
- package/dist/common/utils/fileSystemHelpers.d.ts.map +1 -1
- package/dist/common/utils/fileSystemHelpers.js +3 -0
- package/dist/core/Context.d.ts +25 -2
- package/dist/core/Context.d.ts.map +1 -1
- package/dist/core/Context.js +144 -4
- package/dist/core/OpenApiClient.d.ts.map +1 -1
- package/dist/core/OpenApiClient.js +54 -13
- package/dist/core/WriteClient.d.ts +6 -13
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +32 -22
- package/dist/core/__tests__/WriteClient.test.js +8 -1
- package/dist/core/api/v2/Parser.d.ts +1 -1
- package/dist/core/api/v2/Parser.d.ts.map +1 -1
- package/dist/core/api/v2/Parser.js +2 -2
- package/dist/core/api/v2/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModel.js +2 -5
- package/dist/core/api/v2/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModelProperties.js +1 -3
- package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModels.js +2 -4
- package/dist/core/api/v2/parser/getOperationParameter.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationParameter.js +2 -5
- package/dist/core/api/v2/parser/getOperationParameters.js +1 -1
- package/dist/core/api/v2/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getOperationResponse.js +1 -3
- package/dist/core/api/v2/parser/getOperationResponses.js +1 -1
- package/dist/core/api/v2/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getServices.js +4 -3
- package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getType.js +16 -9
- package/dist/core/api/v3/Parser.d.ts +1 -1
- package/dist/core/api/v3/Parser.d.ts.map +1 -1
- package/dist/core/api/v3/Parser.js +2 -2
- package/dist/core/api/v3/parser/getModel.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModel.js +2 -5
- package/dist/core/api/v3/parser/getModelProperties.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModelProperties.js +1 -3
- package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModels.js +2 -4
- package/dist/core/api/v3/parser/getOperation.js +1 -1
- package/dist/core/api/v3/parser/getOperationParameter.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationParameter.js +2 -5
- package/dist/core/api/v3/parser/getOperationParameters.js +1 -1
- package/dist/core/api/v3/parser/getOperationRequestBody.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationRequestBody.js +1 -3
- package/dist/core/api/v3/parser/getOperationResponse.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getOperationResponse.js +1 -3
- package/dist/core/api/v3/parser/getOperationResponses.js +1 -1
- package/dist/core/api/v3/parser/getServices.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getServices.js +4 -3
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +16 -9
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/types/base/ClientArtifacts.model.d.ts +1 -1
- package/dist/core/types/base/ClientArtifacts.model.d.ts.map +1 -1
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts +1 -1
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts.map +1 -1
- package/dist/core/types/base/Templates.model.d.ts +32 -0
- package/dist/core/types/base/Templates.model.d.ts.map +1 -0
- package/dist/core/types/enums/ValidationLibrary.enum.d.ts +8 -0
- package/dist/core/types/enums/ValidationLibrary.enum.d.ts.map +1 -0
- package/dist/core/types/enums/ValidationLibrary.enum.js +11 -0
- package/dist/core/utils/__mocks__/templates.d.ts +3 -0
- package/dist/core/utils/__mocks__/templates.d.ts.map +1 -0
- package/dist/core/utils/__mocks__/templates.js +33 -0
- package/dist/core/utils/__tests__/getRelativeModelPath.test.js +9 -3
- package/dist/core/utils/__tests__/isSubdirectory.test.js +2 -2
- 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__/registerHandlebarTemplates.test.js +2 -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 +121 -0
- package/dist/core/utils/__tests__/writeClientCore.test.js +2 -25
- 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__/writeClientFullIndex.test.js +2 -25
- package/dist/core/utils/__tests__/writeClientModels.test.js +2 -25
- package/dist/core/utils/__tests__/writeClientSchemas.test.js +4 -25
- package/dist/core/utils/__tests__/writeClientServices.test.js +2 -25
- package/dist/core/utils/getOpenApiSpec.d.ts +0 -6
- package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
- package/dist/core/utils/getOpenApiSpec.js +26 -23
- 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 +7 -0
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +85 -0
- package/dist/core/utils/registerHandlebarTemplates.d.ts +3 -25
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +97 -2
- package/dist/core/utils/resolveRefPath.d.ts.map +1 -1
- package/dist/core/utils/resolveRefPath.js +1 -4
- package/dist/core/utils/serviceHelpers.d.ts.map +1 -1
- package/dist/core/utils/serviceHelpers.js +32 -6
- package/dist/core/utils/stripNamespace.js +1 -1
- package/dist/core/utils/validateRawOptions.d.ts +3 -0
- package/dist/core/utils/validateRawOptions.d.ts.map +1 -0
- package/dist/core/utils/validateRawOptions.js +15 -0
- package/dist/core/utils/writeClientCore.d.ts +1 -1
- package/dist/core/utils/writeClientCore.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.js +7 -1
- package/dist/core/utils/writeClientCoreIndex.d.ts +1 -1
- package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientExecutor.d.ts +13 -0
- package/dist/core/utils/writeClientExecutor.d.ts.map +1 -0
- package/dist/core/utils/writeClientExecutor.js +30 -0
- package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientFullIndex.js +1 -1
- package/dist/core/utils/writeClientModels.d.ts +1 -1
- package/dist/core/utils/writeClientModels.d.ts.map +1 -1
- package/dist/core/utils/writeClientModelsIndex.d.ts +1 -1
- package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.d.ts +3 -1
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.js +23 -20
- package/dist/core/utils/writeClientSchemasIndex.d.ts +1 -1
- package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientServices.d.ts +1 -1
- package/dist/core/utils/writeClientServices.d.ts.map +1 -1
- package/dist/core/utils/writeClientServicesIndex.d.ts +1 -1
- package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSimpleIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSimpleIndex.js +1 -1
- package/dist/templatesCompiled/cli/customRequest.d.ts +11 -0
- package/dist/templatesCompiled/cli/customRequest.d.ts.map +1 -0
- package/dist/templatesCompiled/cli/customRequest.js +27 -0
- package/dist/templatesCompiled/cli/customRequestExecutor.d.ts +11 -0
- package/dist/templatesCompiled/cli/customRequestExecutor.d.ts.map +1 -0
- package/dist/templatesCompiled/cli/customRequestExecutor.js +27 -0
- package/dist/templatesCompiled/cli/openApiConfig.d.ts +2 -1
- package/dist/templatesCompiled/cli/openApiConfig.d.ts.map +1 -1
- package/dist/templatesCompiled/cli/openApiConfig.js +76 -4
- package/dist/templatesCompiled/client/core/ApiError.js +1 -1
- package/dist/templatesCompiled/client/core/CancelablePromise.d.ts +1 -0
- package/dist/templatesCompiled/client/core/CancelablePromise.d.ts.map +1 -1
- package/dist/templatesCompiled/client/core/CancelablePromise.js +9 -2
- package/dist/templatesCompiled/client/core/HttpStatusCode.d.ts +1 -0
- package/dist/templatesCompiled/client/core/HttpStatusCode.d.ts.map +1 -1
- package/dist/templatesCompiled/client/core/HttpStatusCode.js +9 -2
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts +12 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/executor/createExecutorAdapter.js +32 -0
- package/dist/templatesCompiled/client/core/executor/requestExecutor.d.ts +8 -0
- package/dist/templatesCompiled/client/core/executor/requestExecutor.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/executor/requestExecutor.js +18 -0
- package/dist/templatesCompiled/client/core/functions/catchErrors.js +1 -1
- package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.d.ts +8 -0
- package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/interceptors/apiErrorInterceptor.js +18 -0
- package/dist/templatesCompiled/client/core/interceptors/interceptors.d.ts +8 -0
- package/dist/templatesCompiled/client/core/interceptors/interceptors.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/interceptors/interceptors.js +18 -0
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.d.ts +8 -0
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/interceptors/withInterceptors.js +18 -0
- package/dist/templatesCompiled/client/exportClient.d.ts +10 -0
- package/dist/templatesCompiled/client/exportClient.d.ts.map +1 -0
- package/dist/templatesCompiled/client/exportClient.js +53 -0
- package/dist/templatesCompiled/client/exportService.d.ts.map +1 -1
- package/dist/templatesCompiled/client/exportService.js +46 -50
- package/dist/templatesCompiled/client/indexCore.js +2 -2
- package/dist/templatesCompiled/client/indexFull.d.ts +13 -9
- package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexFull.js +72 -46
- 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 +5 -1
- package/dist/templatesCompiled/client/joi/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/joi/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/exportSchema.js +71 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchema.js +129 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.d.ts +16 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaArray.js +84 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.d.ts +18 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaComposition.js +96 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.d.ts +14 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaDictionary.js +72 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.d.ts +14 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaEnum.js +74 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts +35 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaGeneric.js +201 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts +14 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaInterface.js +50 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/joi/partials/joiSchemaReference.js +25 -0
- package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/jsonschema/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/exportSchema.js +69 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchema.js +129 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.d.ts +16 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaArray.js +74 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.d.ts +16 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaComposition.js +84 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.d.ts +13 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaDictionary.js +56 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.d.ts +12 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaEnum.js +49 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.d.ts +29 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaGeneric.js +175 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts +15 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaInterface.js +63 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/jsonschema/partials/jsonschemaSchemaReference.js +25 -0
- package/dist/templatesCompiled/client/partials/exportComposition.d.ts +2 -0
- package/dist/templatesCompiled/client/partials/exportComposition.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/exportComposition.js +17 -9
- package/dist/templatesCompiled/client/partials/parameters.js +1 -1
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts +2 -4
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/serviceOption.js +32 -46
- package/dist/templatesCompiled/client/yup/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/yup/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/exportSchema.js +73 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchema.js +129 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.d.ts +16 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaArray.js +84 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.d.ts +18 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaComposition.js +96 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.d.ts +14 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaDictionary.js +72 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.d.ts +14 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaEnum.js +74 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts +34 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaGeneric.js +201 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts +14 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaInterface.js +50 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/yup/partials/yupSchemaReference.js +25 -0
- package/dist/templatesCompiled/client/zod/exportSchema.d.ts +11 -0
- package/dist/templatesCompiled/client/zod/exportSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/exportSchema.js +67 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchema.d.ts +22 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchema.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchema.js +129 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts +14 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaArray.js +65 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts +15 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaComposition.js +70 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts +12 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaDictionary.js +53 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.d.ts +15 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaEnum.js +86 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts +34 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaGeneric.js +193 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts +14 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaInterface.js +50 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.d.ts +9 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.d.ts.map +1 -0
- package/dist/templatesCompiled/client/zod/partials/zodSchemaReference.js +25 -0
- package/package.json +9 -4
- package/dist/cli/generate/runGenerateOpenApi.d.ts.map +0 -1
- package/dist/cli/initOpenApiConfig/Enums.d.ts +0 -5
- package/dist/cli/initOpenApiConfig/Enums.d.ts.map +0 -1
- package/dist/cli/initOpenApiConfig/Enums.js +0 -8
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts +0 -3
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.d.ts.map +0 -1
- package/dist/cli/initOpenApiConfig/runInitOpenapiConfig.js +0 -70
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts +0 -3
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.d.ts.map +0 -1
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsMigrationPlan.js +0 -28
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts +0 -7
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.d.ts.map +0 -1
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsSchemaV1.js +0 -42
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts +0 -3
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.d.ts.map +0 -1
- package/dist/common/VersionedSchema/UnifiedOptionsVersioned/UnifiedOptionsVersionedSchemas.js +0 -10
- package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts +0 -6
- package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/getErrorFieldsFromValidation.js +0 -7
- package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts +0 -6
- package/dist/common/VersionedSchema/Utils/joiHandlers.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/joiHandlers.js +0 -59
- package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts +0 -3
- package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/mergeObjectSchemas.js +0 -12
- package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts +0 -3
- package/dist/common/VersionedSchema/Utils/traverseObjectStructure.d.ts.map +0 -1
- package/dist/common/VersionedSchema/Utils/traverseObjectStructure.js +0 -31
- package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts +0 -19
- package/dist/common/utils/__tests__/__mock__/mockJoiSchema.d.ts.map +0 -1
- package/dist/common/utils/__tests__/__mock__/mockJoiSchema.js +0 -14
- package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts +0 -2
- package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/determineBestMatchingSchemaVersion.test.js +0 -38
- package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts +0 -2
- package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/getUniqueKeysFromSchemas.test.js +0 -20
- package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts +0 -2
- package/dist/common/utils/__tests__/mergeObjectSchemas.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/mergeObjectSchemas.test.js +0 -35
- package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts +0 -2
- package/dist/common/utils/__tests__/migrationForMultiOptions.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/migrationForMultiOptions.test.js +0 -112
- package/dist/common/utils/__tests__/migrationForOptions.test.d.ts +0 -2
- package/dist/common/utils/__tests__/migrationForOptions.test.d.ts.map +0 -1
- package/dist/common/utils/__tests__/migrationForOptions.test.js +0 -56
- package/dist/core/types/base/RefWithtype.model.d.ts +0 -11
- package/dist/core/types/base/RefWithtype.model.d.ts.map +0 -1
- package/dist/core/types/enums/TypeRef.enum.d.ts +0 -8
- package/dist/core/types/enums/TypeRef.enum.d.ts.map +0 -1
- package/dist/core/types/enums/TypeRef.enum.js +0 -11
- package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getGatheringRefs.test.js +0 -26
- package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getRefFromSchema.test.js +0 -167
- package/dist/core/utils/__tests__/refResolver.test.d.ts +0 -2
- package/dist/core/utils/__tests__/refResolver.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/refResolver.test.js +0 -55
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts +0 -2
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.js +0 -376
- 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
- package/dist/core/utils/findCommonParent.d.ts +0 -7
- package/dist/core/utils/findCommonParent.d.ts.map +0 -1
- package/dist/core/utils/findCommonParent.js +0 -20
- package/dist/core/utils/getGatheringRefs.d.ts +0 -4
- package/dist/core/utils/getGatheringRefs.d.ts.map +0 -1
- package/dist/core/utils/getGatheringRefs.js +0 -68
- package/dist/core/utils/getRefFromSchema.d.ts +0 -3
- package/dist/core/utils/getRefFromSchema.d.ts.map +0 -1
- package/dist/core/utils/getRefFromSchema.js +0 -9
- package/dist/core/utils/isBoolean.d.ts +0 -2
- package/dist/core/utils/isBoolean.d.ts.map +0 -1
- package/dist/core/utils/isBoolean.js +0 -12
- package/dist/core/utils/isFileName.d.ts +0 -7
- package/dist/core/utils/isFileName.d.ts.map +0 -1
- package/dist/core/utils/isFileName.js +0 -30
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts +0 -10
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts.map +0 -1
- package/dist/core/utils/mapPathToTargetDirSafe.js +0 -48
- package/dist/core/utils/normalizeAllRefs.d.ts +0 -6
- package/dist/core/utils/normalizeAllRefs.d.ts.map +0 -1
- package/dist/core/utils/normalizeAllRefs.js +0 -35
- package/dist/core/utils/resolveRefToImportPath.d.ts +0 -13
- package/dist/core/utils/resolveRefToImportPath.d.ts.map +0 -1
- package/dist/core/utils/resolveRefToImportPath.js +0 -105
- /package/dist/core/types/base/{RefWithtype.model.js → Templates.model.js} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
return "import type { CancelablePromise } from './CancelablePromise';\n";
|
|
11
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
12
|
+
return "export function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): CancelablePromise<T> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const abortController = new AbortController();\n \n if (options?.timeout) {\n const timeoutId = setTimeout(() => abortController.abort(), options.timeout);\n onCancel(() => clearTimeout(timeoutId));\n }\n \n onCancel(() => abortController.abort());\n \n if (onCancel.isCancelled) {\n return;\n }\n \n // Ваша пользовательская логика запросов здесь\n const response = await fetch(config.url, {\n method: config.method,\n headers: config.headers,\n body: config.body ? JSON.stringify(config.body) : undefined,\n signal: abortController.signal,\n });\n \n if (!response.ok) {\n throw new Error(`Request failed: ${response.statusText}`);\n }\n \n const data = await response.json();\n resolve(data);\n } catch (error) {\n reject(error);\n }\n });\n};\n";
|
|
13
|
+
}, "5": function (container, depth0, helpers, partials, data) {
|
|
14
|
+
return "export async function request<T>(options: ApiRequestOptions, config: TOpenAPIConfig): Promise<T> {\n return new Promise(async (resolve, reject) => {\n try {\n const url = getUrl(options, config);\n const response = await sendRequest(options, url, config);\n const responseBody = getResponseBody(response);\n const responseHeader = getResponseHeader(response, options.responseHeader);\n\n const result: ApiResult = {\n url,\n ok: isSuccess(response.status),\n status: response.status,\n statusText: response.statusText,\n body: responseHeader || responseBody,\n };\n\n catchErrors(options, result);\n resolve(result.body);\n } catch (error) {\n reject(error);\n }\n });\n}\n";
|
|
15
|
+
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
16
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
18
|
+
return parent[propertyName];
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
};
|
|
22
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
23
|
+
+ "\nimport type { RequestExecutor, RequestConfig } from './request-executor';\n"
|
|
24
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 7 } } })) != null ? stack1 : "")
|
|
25
|
+
+ "\n/**\n * Определите свой тип опций (опционально)\n * Измените этот интерфейс в соответствии с вашими потребностями\n */\ninterface MyCustomOptions {\n timeout?: number;\n retries?: number;\n}\n\n/**\n * Создайте пользовательский executor\n * Реализуйте свою логику запросов здесь\n *\n * @example Пример использования:\n * \n * import { createLegacyExecutor } from './generated/core/legacy-request-adapter';\n * import { SimpleService } from './generated/services/SimpleService';\n *\n * const executorWithOptions = createLegacyExecutor<MyCustomOptions>(OpenAPI, (options) => {\n * // Мапьте ваши пользовательские опции в ApiRequestOptions при необходимости\n * return {\n * // Добавьте любые поля ApiRequestOptions на основе options\n * };\n * });\n * \n * const simpleService = new SimpleService(executorWithOptions);\n * await simpleService.getCallWithoutParametersAndResponse();\n */\n"
|
|
26
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 36, "column": 0 }, "end": { "line": 96, "column": 7 } } })) != null ? stack1 : "");
|
|
27
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
3
|
+
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
"5": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
|
+
compiler: (string | number)[];
|
|
6
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
7
|
+
usePartial: boolean;
|
|
8
|
+
useData: boolean;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=customRequestExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customRequestExecutor.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/cli/customRequestExecutor.ts"],"names":[],"mappings":";;;;;;;;;AAMA,wBAmBmC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
return "import type { CancelablePromise } from './CancelablePromise';\n";
|
|
11
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
12
|
+
return "export const customExecutor: RequestExecutor<MyCustomOptions> = {\n async request<TResponse>(config: RequestConfig, options?: MyCustomOptions): CancelablePromise<TResponse> {\n return new CancelablePromise(async (resolve, reject, onCancel) => {\n try {\n const abortController = new AbortController();\n \n if (options?.timeout) {\n const timeoutId = setTimeout(() => abortController.abort(), options.timeout);\n onCancel(() => clearTimeout(timeoutId));\n }\n \n onCancel(() => abortController.abort());\n \n if (onCancel.isCancelled) {\n return;\n }\n \n // Ваша пользовательская логика запросов здесь\n const response = await fetch(config.url, {\n method: config.method,\n headers: config.headers,\n body: config.body ? JSON.stringify(config.body) : undefined,\n signal: abortController.signal,\n });\n \n if (!response.ok) {\n throw new Error(`Request failed: ${response.statusText}`);\n }\n \n const data = await response.json();\n resolve(data);\n } catch (error) {\n reject(error);\n }\n });\n },\n};\n";
|
|
13
|
+
}, "5": function (container, depth0, helpers, partials, data) {
|
|
14
|
+
return "export const customExecutor: RequestExecutor<MyCustomOptions> = {\n async request<TResponse>(config: RequestConfig, options?: MyCustomOptions): Promise<TResponse> {\n // Ваша пользовательская логика запросов здесь\n const response = await fetch(config.url, {\n method: config.method,\n headers: config.headers,\n body: config.body ? JSON.stringify(config.body) : undefined,\n signal: options?.timeout ? AbortSignal.timeout(options.timeout) : undefined,\n });\n \n if (!response.ok) {\n throw new Error(`Request failed: ${response.statusText}`);\n }\n \n return response.json();\n },\n};\n";
|
|
15
|
+
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
16
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
18
|
+
return parent[propertyName];
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
};
|
|
22
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
23
|
+
+ "\nimport type { RequestExecutor, RequestConfig } from './request-executor';\n"
|
|
24
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 7 } } })) != null ? stack1 : "")
|
|
25
|
+
+ "\n/**\n * Определите свой тип опций (опционально)\n * Измените этот интерфейс в соответствии с вашими потребностями\n */\ninterface MyCustomOptions {\n timeout?: number;\n retries?: number;\n}\n\n/**\n * Создайте пользовательский executor\n * Реализуйте свою логику запросов здесь\n *\n * @example Пример использования:\n * \n * import { SimpleService } from './generated/services/SimpleService';\n * \n * const simpleService = new SimpleService<MyCustomOptions>(customExecutor);\n * await simpleService.getCallWithoutParametersAndResponse({ timeout: 5000, retries: 3 });\n */\n"
|
|
26
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(depth0, "useCancelableRequest"), { "name": "if", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.program(5, data, 0), "data": data, "loc": { "start": { "line": 28, "column": 0 }, "end": { "line": 84, "column": 7 } } })) != null ? stack1 : "");
|
|
27
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -1,6 +1,7 @@
|
|
|
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": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
5
|
compiler: (string | number)[];
|
|
5
6
|
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
|
|
6
7
|
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,wBAwFiB"}
|
|
@@ -7,9 +7,81 @@ 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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var stack1, alias1 = container.strict, alias2 = container.lambda, 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 \"items\": "
|
|
17
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "items", { "start": { "line": 3, "column": 15 }, "end": { "line": 3, "column": 26 } }), depth0)) != null ? stack1 : "")
|
|
18
|
+
+ ",\n \"httpClient\": \""
|
|
19
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "httpClient", { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
20
|
+
+ "\",\n \"sortByRequired\": "
|
|
21
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 5, "column": 24 }, "end": { "line": 5, "column": 44 } }), depth0)) != null ? stack1 : "")
|
|
22
|
+
+ ",\n \"enumPrefix\": \""
|
|
23
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
24
|
+
+ "\",\n \"excludeCoreServiceFiles\": "
|
|
25
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 7, "column": 33 }, "end": { "line": 7, "column": 62 } }), depth0)) != null ? stack1 : "")
|
|
26
|
+
+ ",\n \"interfacePrefix\": \""
|
|
27
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 47 } }), depth0)) != null ? stack1 : "")
|
|
28
|
+
+ "\",\n \"typePrefix\": \""
|
|
29
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
30
|
+
+ "\",\n \"useCancelableRequest\": "
|
|
31
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 10, "column": 30 }, "end": { "line": 10, "column": 56 } }), depth0)) != null ? stack1 : "")
|
|
32
|
+
+ ",\n \"useOptions\": "
|
|
33
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useOptions", { "start": { "line": 11, "column": 20 }, "end": { "line": 11, "column": 36 } }), depth0)) != null ? stack1 : "")
|
|
34
|
+
+ ",\n \"useSeparatedIndexes\": "
|
|
35
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 12, "column": 29 }, "end": { "line": 12, "column": 54 } }), depth0)) != null ? stack1 : "")
|
|
36
|
+
+ ",\n \"useUnionTypes\": "
|
|
37
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 13, "column": 23 }, "end": { "line": 13, "column": 42 } }), depth0)) != null ? stack1 : "")
|
|
38
|
+
+ ",\n "
|
|
39
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 62 } } })) != null ? stack1 : "")
|
|
40
|
+
+ "\n}\n";
|
|
41
|
+
}, "2": function (container, depth0, helpers, partials, data) {
|
|
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 "\"request\": \""
|
|
49
|
+
+ ((stack1 = container.lambda(container.strict(lookupProperty(data, "root"), "request", { "start": { "line": 14, "column": 39 }, "end": { "line": 14, "column": 52 } }), depth0)) != null ? stack1 : "")
|
|
50
|
+
+ "\"";
|
|
51
|
+
}, "4": function (container, depth0, helpers, partials, data) {
|
|
52
|
+
var stack1, alias1 = container.strict, alias2 = container.lambda, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
54
|
+
return parent[propertyName];
|
|
55
|
+
}
|
|
56
|
+
return undefined;
|
|
57
|
+
};
|
|
58
|
+
return "{\n \"input\": \""
|
|
59
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "input", { "start": { "line": 18, "column": 16 }, "end": { "line": 18, "column": 27 } }), depth0)) != null ? stack1 : "")
|
|
60
|
+
+ "\",\n \"output\": \""
|
|
61
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "output", { "start": { "line": 19, "column": 17 }, "end": { "line": 19, "column": 29 } }), depth0)) != null ? stack1 : "")
|
|
62
|
+
+ "\",\n \"httpClient\": \""
|
|
63
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "httpClient", { "start": { "line": 20, "column": 21 }, "end": { "line": 20, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
64
|
+
+ "\",\n \"sortByRequired\": "
|
|
65
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "sortByRequired", { "start": { "line": 21, "column": 24 }, "end": { "line": 21, "column": 44 } }), depth0)) != null ? stack1 : "")
|
|
66
|
+
+ ",\n \"enumPrefix\": \""
|
|
67
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "enumPrefix", { "start": { "line": 22, "column": 21 }, "end": { "line": 22, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
68
|
+
+ "\",\n \"excludeCoreServiceFiles\": "
|
|
69
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "excludeCoreServiceFiles", { "start": { "line": 23, "column": 33 }, "end": { "line": 23, "column": 62 } }), depth0)) != null ? stack1 : "")
|
|
70
|
+
+ ",\n \"interfacePrefix\": \""
|
|
71
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "interfacePrefix", { "start": { "line": 24, "column": 26 }, "end": { "line": 24, "column": 47 } }), depth0)) != null ? stack1 : "")
|
|
72
|
+
+ "\",\n \"typePrefix\": \""
|
|
73
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "typePrefix", { "start": { "line": 25, "column": 21 }, "end": { "line": 25, "column": 37 } }), depth0)) != null ? stack1 : "")
|
|
74
|
+
+ "\",\n \"useCancelableRequest\": "
|
|
75
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useCancelableRequest", { "start": { "line": 26, "column": 30 }, "end": { "line": 26, "column": 56 } }), depth0)) != null ? stack1 : "")
|
|
76
|
+
+ ",\n \"useOptions\": "
|
|
77
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useOptions", { "start": { "line": 27, "column": 20 }, "end": { "line": 27, "column": 36 } }), depth0)) != null ? stack1 : "")
|
|
78
|
+
+ ",\n \"useSeparatedIndexes\": "
|
|
79
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useSeparatedIndexes", { "start": { "line": 28, "column": 29 }, "end": { "line": 28, "column": 54 } }), depth0)) != null ? stack1 : "")
|
|
80
|
+
+ ",\n \"useUnionTypes\": "
|
|
81
|
+
+ ((stack1 = alias2(alias1(lookupProperty(data, "root"), "useUnionTypes", { "start": { "line": 29, "column": 23 }, "end": { "line": 29, "column": 42 } }), depth0)) != null ? stack1 : "")
|
|
82
|
+
+ ",\n "
|
|
83
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "request"), { "name": "if", "hash": {}, "fn": container.program(2, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 62 } } })) != null ? stack1 : "")
|
|
84
|
+
+ "\n}\n";
|
|
13
85
|
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
14
86
|
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
15
87
|
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
@@ -17,5 +89,5 @@ exports.default = { "1": function (container, depth0, helpers, partials, data) {
|
|
|
17
89
|
}
|
|
18
90
|
return undefined;
|
|
19
91
|
};
|
|
20
|
-
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(
|
|
92
|
+
return ((stack1 = lookupProperty(helpers, "if").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(lookupProperty(data, "root"), "useMultyOptions"), { "name": "if", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.program(4, data, 0), "data": data, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 32, "column": 7 } } })) != null ? stack1 : "");
|
|
21
93
|
}, "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
|
-
+ "\nimport
|
|
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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancelablePromise.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/CancelablePromise.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CancelablePromise.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/CancelablePromise.ts"],"names":[],"mappings":";;;;;;AAMA,wBAUmC"}
|
|
@@ -7,5 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
/* eslint: disable */
|
|
8
8
|
// @ts-nocheck
|
|
9
9
|
exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
10
|
-
|
|
11
|
-
|
|
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 interface ICancelProps {\n readonly isResolved: boolean;\n readonly isRejected: boolean;\n readonly isCancelled: boolean;\n\n (cancelHandler: () => void): void;\n}\n\nexport class CancelablePromise<T> implements Promise<T> {\n readonly [Symbol.toStringTag]!: string;\n\n private _isResolved: boolean;\n private _isRejected: boolean;\n private _isCancelled: boolean;\n private readonly _cancelHandlers: (() => void)[];\n private readonly _promise: Promise<T>;\n private _resolve?: (value: T | PromiseLike<T>) => void;\n private _reject?: (reason?: any) => void;\n\n constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: ICancelProps) => void) {\n this._isResolved = false;\n this._isRejected = false;\n this._isCancelled = false;\n this._cancelHandlers = [];\n this._promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n\n const onResolve = (value: T | PromiseLike<T>): void => {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this._isResolved = true;\n this._resolve?.(value);\n };\n\n const onReject = (reason?: any): void => {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this._isRejected = true;\n this._reject?.(reason);\n };\n\n const onCancel = (cancelHandler: () => void): void => {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this._cancelHandlers.push(cancelHandler);\n };\n\n Object.defineProperty(onCancel, 'isResolved', {\n get: (): boolean => this._isResolved,\n });\n\n Object.defineProperty(onCancel, 'isRejected', {\n get: (): boolean => this._isRejected,\n });\n\n Object.defineProperty(onCancel, 'isCancelled', {\n get: (): boolean => this._isCancelled,\n });\n\n return executor(onResolve, onReject, onCancel as ICancelProps);\n });\n }\n\n public then<TResult1 = T, TResult2 = never>(\n onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null\n ): Promise<TResult1 | TResult2> {\n return this._promise.then(onFulfilled, onRejected);\n }\n\n public catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult> {\n return this._promise.catch(onRejected);\n }\n\n public finally(onFinally?: (() => void) | null): Promise<T> {\n return this._promise.finally(onFinally);\n }\n\n public cancel(): void {\n if (this._isResolved || this._isRejected || this._isCancelled) {\n return;\n }\n this._isCancelled = true;\n if (this._cancelHandlers.length) {\n try {\n for (const cancelHandler of this._cancelHandlers) {\n cancelHandler();\n }\n } catch (error) {\n console.warn('Cancellation threw an error', error);\n return;\n }\n }\n this._cancelHandlers.length = 0;\n this._reject?.(new Error('CancelError: Request aborted'));\n }\n}";
|
|
18
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpStatusCode.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/HttpStatusCode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HttpStatusCode.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/HttpStatusCode.ts"],"names":[],"mappings":";;;;;;AAMA,wBAUmC"}
|
|
@@ -7,5 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
/* eslint: disable */
|
|
8
8
|
// @ts-nocheck
|
|
9
9
|
exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
10
|
-
|
|
11
|
-
|
|
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 enum EHTTP_STATUS_CODES {\n BAD_REQUEST = 400,\n UNAUTHORIZED = 401,\n FORBIDDEN = 403,\n NOT_FOUND = 404,\n INTERNAL_SERVER_ERROR = 500,\n BAD_GATEWAY = 502,\n SERVICE_UNAVAILABLE = 503,\n}\n\nexport enum EHTTP_STATUS_NAME {\n BAD_REQUEST = 'Bad Request',\n UNAUTHORIZED = 'Unauthorized',\n FORBIDDEN = 'Forbidden',\n NOT_FOUND = 'Not Found',\n INTERNAL_SERVER_ERROR = 'Internal Server Error',\n BAD_GATEWAY = 'Bad Gateway',\n SERVICE_UNAVAILABLE = 'Service Unavailable',\n}\n\n";
|
|
18
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
3
|
+
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
"5": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
5
|
+
"7": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
6
|
+
compiler: (string | number)[];
|
|
7
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
8
|
+
usePartial: boolean;
|
|
9
|
+
useData: boolean;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
//# sourceMappingURL=createExecutorAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createExecutorAdapter.d.ts","sourceRoot":"","sources":["../../../../../src/templatesCompiled/client/core/executor/createExecutorAdapter.ts"],"names":[],"mappings":";;;;;;;;;;AAMA,wBAwBmC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
return "import type { ApiRequestOptions } from '../ApiRequestOptions';\nimport type { TOpenAPIConfig } from '../OpenAPI';\nimport { OpenAPI } from '../OpenAPI';\n";
|
|
11
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
12
|
+
return " openApiConfig: TOpenAPIConfig = OpenAPI,\n mapOptions?: (options: TRequestOptions | undefined) => Partial<ApiRequestOptions>,\n";
|
|
13
|
+
}, "5": function (container, depth0, helpers, partials, data) {
|
|
14
|
+
return " request<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<TResponse> {\n return __request(config, options) as Promise<TResponse>;\n },\n";
|
|
15
|
+
}, "7": function (container, depth0, helpers, partials, data) {
|
|
16
|
+
return " request<TResponse>(config: RequestConfig, options?: TRequestOptions): Promise<TResponse> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.path,\n headers: config.headers,\n query: config.query,\n body: config.body,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __request<TResponse>(mergedOptions, openApiConfig);\n },\n";
|
|
17
|
+
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
18
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), 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 ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
25
|
+
+ "\nimport type { RequestExecutor, RequestConfig } from './requestExecutor';\n"
|
|
26
|
+
+ ((stack1 = lookupProperty(helpers, "unless").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 8, "column": 11 } } })) != null ? stack1 : "")
|
|
27
|
+
+ "import { request as __request } from '../request';\n\nexport function createExecutorAdapter<TRequestOptions extends Record<string, any>>(\n"
|
|
28
|
+
+ ((stack1 = lookupProperty(helpers, "unless").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "unless", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 15, "column": 11 } } })) != null ? stack1 : "")
|
|
29
|
+
+ "): RequestExecutor<TRequestOptions> {\n return {\n"
|
|
30
|
+
+ ((stack1 = lookupProperty(helpers, "if").call(alias1, lookupProperty(lookupProperty(data, "root"), "useCustomRequest"), { "name": "if", "hash": {}, "fn": container.program(5, data, 0), "inverse": container.program(7, data, 0), "data": data, "loc": { "start": { "line": 18, "column": 8 }, "end": { "line": 39, "column": 15 } } })) != null ? stack1 : "")
|
|
31
|
+
+ " };\n}\n";
|
|
32
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
compiler: (string | number)[];
|
|
3
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
usePartial: boolean;
|
|
5
|
+
useData: boolean;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=requestExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestExecutor.d.ts","sourceRoot":"","sources":["../../../../../src/templatesCompiled/client/core/executor/requestExecutor.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 interface RequestConfig {\n method: string;\n path: string;\n\n headers?: Record<string, string>;\n query?: Record<string, any>;\n body?: unknown;\n\n requestMediaType?: string;\n cookies?: Record<string, string>;\n}\n\nexport interface RequestExecutor<TOptions = unknown> {\n request<TResponse>(\n config: RequestConfig,\n options?: TOptions\n ): Promise<TResponse>;\n}";
|
|
18
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
/* eslint: disable */
|
|
8
8
|
// @ts-nocheck
|
|
9
9
|
exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
10
|
-
return "function catchErrors(options: ApiRequestOptions, result: ApiResult): void {\n const errors: Record<string, string> = {\n [EHTTP_STATUS_CODES.BAD_GATEWAY]: EHTTP_STATUS_NAME.BAD_GATEWAY,\n [EHTTP_STATUS_CODES.BAD_REQUEST]: EHTTP_STATUS_NAME.BAD_REQUEST,\n [EHTTP_STATUS_CODES.FORBIDDEN]: EHTTP_STATUS_NAME.FORBIDDEN,\n [EHTTP_STATUS_CODES.INTERNAL_SERVER_ERROR]: EHTTP_STATUS_NAME.INTERNAL_SERVER_ERROR,\n [EHTTP_STATUS_CODES.NOT_FOUND]: EHTTP_STATUS_NAME.NOT_FOUND,\n [EHTTP_STATUS_CODES.SERVICE_UNAVAILABLE]: EHTTP_STATUS_NAME.SERVICE_UNAVAILABLE,\n [EHTTP_STATUS_CODES.UNAUTHORIZED]: EHTTP_STATUS_NAME.UNAUTHORIZED,\n ...options.errors,\n }\n\n const error = errors[result.status];\n if (error) {\n throw new ApiError(result
|
|
10
|
+
return "function catchErrors(options: ApiRequestOptions, result: ApiResult): void {\n const errors: Record<string, string> = {\n [EHTTP_STATUS_CODES.BAD_GATEWAY]: EHTTP_STATUS_NAME.BAD_GATEWAY,\n [EHTTP_STATUS_CODES.BAD_REQUEST]: EHTTP_STATUS_NAME.BAD_REQUEST,\n [EHTTP_STATUS_CODES.FORBIDDEN]: EHTTP_STATUS_NAME.FORBIDDEN,\n [EHTTP_STATUS_CODES.INTERNAL_SERVER_ERROR]: EHTTP_STATUS_NAME.INTERNAL_SERVER_ERROR,\n [EHTTP_STATUS_CODES.NOT_FOUND]: EHTTP_STATUS_NAME.NOT_FOUND,\n [EHTTP_STATUS_CODES.SERVICE_UNAVAILABLE]: EHTTP_STATUS_NAME.SERVICE_UNAVAILABLE,\n [EHTTP_STATUS_CODES.UNAUTHORIZED]: EHTTP_STATUS_NAME.UNAUTHORIZED,\n ...options.errors,\n }\n\n const error = errors[result.status];\n if (error) {\n throw new ApiError({\n message: result.statusText,\n status: result.status,\n request: options,\n });\n }\n\n if (!result.ok) {\n throw new ApiError({\n message: 'Generic Error',\n status: result.status,\n request: options,\n });\n }\n}\n";
|
|
11
11
|
}, "useData": true };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
compiler: (string | number)[];
|
|
3
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
usePartial: boolean;
|
|
5
|
+
useData: boolean;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=apiErrorInterceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiErrorInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/templatesCompiled/client/core/interceptors/apiErrorInterceptor.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
|
+
+ "\nimport { ErrorInterceptor } from './interceptors';\nimport { ApiError } from '../ApiError';\n\ninterface ExecutorError {\n status: number;\n body?: unknown;\n headers?: Record<string, string>;\n}\n\nexport const apiErrorInterceptor: ErrorInterceptor = (error, request) => {\n if (typeof error === 'object' && error && 'status' in error) {\n const e = error as ExecutorError;\n\n throw new ApiError({\n status: e.status,\n message: `Request failed with status ${e.status}`,\n body: e.body,\n headers: e.headers,\n request,\n });\n }\n\n throw error;\n};";
|
|
18
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
compiler: (string | number)[];
|
|
3
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
usePartial: boolean;
|
|
5
|
+
useData: boolean;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=interceptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../../../../../src/templatesCompiled/client/core/interceptors/interceptors.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
|
+
+ "\nimport { RequestConfig } from '../executor/requestExecutor';\n\nexport type RequestInterceptor =\n (config: RequestConfig) => RequestConfig | Promise<RequestConfig>;\n\nexport type ResponseInterceptor<T = unknown> =\n (response: T, context: RequestConfig) => T | Promise<T>;\n\nexport type ErrorInterceptor =\n (error: unknown, context: RequestConfig) => unknown | Promise<unknown>;";
|
|
18
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
compiler: (string | number)[];
|
|
3
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
usePartial: boolean;
|
|
5
|
+
useData: boolean;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=withInterceptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withInterceptors.d.ts","sourceRoot":"","sources":["../../../../../src/templatesCompiled/client/core/interceptors/withInterceptors.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
|
+
+ "\nimport { RequestInterceptor, ResponseInterceptor, ErrorInterceptor } from './interceptors';\nimport { RequestConfig, RequestExecutor } from '../executor/requestExecutor';\n\nexport function withInterceptors<TOptions extends Record<string, any> = Record<string, never>>(\n executor: RequestExecutor<TOptions>,\n interceptors: {\n onRequest?: RequestInterceptor[];\n onResponse?: ResponseInterceptor[];\n onError?: ErrorInterceptor[];\n }\n): RequestExecutor<TOptions> {\n return {\n async request<TResponse>(config: RequestConfig, options?: TOptions): Promise<TResponse> {\n let currentConfig = config;\n\n try {\n for (const i of interceptors.onRequest ?? []) {\n currentConfig = await i(currentConfig);\n }\n\n let response: Awaited<TResponse> = await executor.request<TResponse>(config, options);\n\n for (const interceptor of interceptors.onResponse ?? []) {\n response = (await interceptor(response, config)) as Awaited<TResponse>;\n }\n\n return response as TResponse;\n } catch (caught) {\n let error = caught;\n\n for (const interceptor of interceptors.onError ?? []) {\n error = await interceptor(error, config);\n }\n\n throw error;\n }\n },\n };\n}\n";
|
|
18
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
3
|
+
"3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
4
|
+
compiler: (string | number)[];
|
|
5
|
+
main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
|
|
6
|
+
usePartial: boolean;
|
|
7
|
+
useData: boolean;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=exportClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportClient.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportClient.ts"],"names":[],"mappings":";;;;;;;;AAMA,wBA+CmC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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, alias1 = container.strict, alias2 = container.lambda;
|
|
11
|
+
return "import { "
|
|
12
|
+
+ ((stack1 = alias2(alias1(depth0, "name", { "start": { "line": 11, "column": 11 }, "end": { "line": 11, "column": 15 } }), depth0)) != null ? stack1 : "")
|
|
13
|
+
+ " } from './services/"
|
|
14
|
+
+ ((stack1 = alias2(alias1(depth0, "name", { "start": { "line": 11, "column": 39 }, "end": { "line": 11, "column": 43 } }), depth0)) != null ? stack1 : "")
|
|
15
|
+
+ "';\n";
|
|
16
|
+
}, "3": function (container, depth0, helpers, partials, data) {
|
|
17
|
+
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
19
|
+
return parent[propertyName];
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
23
|
+
return " "
|
|
24
|
+
+ ((stack1 = lookupProperty(helpers, "camelCase").call(depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty(depth0, "name"), { "name": "camelCase", "hash": {}, "data": data, "loc": { "start": { "line": 42, "column": 4 }, "end": { "line": 42, "column": 22 } } })) != null ? stack1 : "")
|
|
25
|
+
+ ": new "
|
|
26
|
+
+ ((stack1 = container.lambda(container.strict(depth0, "name", { "start": { "line": 42, "column": 30 }, "end": { "line": 42, "column": 34 } }), depth0)) != null ? stack1 : "")
|
|
27
|
+
+ "(executor),\n";
|
|
28
|
+
}, "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
29
|
+
var stack1, alias1 = depth0 != null ? depth0 : (container.nullContext || {}), lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
31
|
+
return parent[propertyName];
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
};
|
|
35
|
+
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
36
|
+
+ "\nimport { OpenAPI } from '"
|
|
37
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "OpenAPI", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 66 } } })) != null ? stack1 : "")
|
|
38
|
+
+ "';\nimport type { TOpenAPIConfig } from '"
|
|
39
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "OpenAPI", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 4, "column": 37 }, "end": { "line": 4, "column": 78 } } })) != null ? stack1 : "")
|
|
40
|
+
+ "';\nimport { createExecutorAdapter } from '"
|
|
41
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./executor/createExecutorAdapter", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 5, "column": 39 }, "end": { "line": 5, "column": 105 } } })) != null ? stack1 : "")
|
|
42
|
+
+ "';\nimport { RequestInterceptor, ResponseInterceptor, ErrorInterceptor } from '"
|
|
43
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/interceptors", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 6, "column": 75 }, "end": { "line": 6, "column": 136 } } })) != null ? stack1 : "")
|
|
44
|
+
+ "';\nimport { withInterceptors } from '"
|
|
45
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/withInterceptors", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 7, "column": 34 }, "end": { "line": 7, "column": 99 } } })) != null ? stack1 : "")
|
|
46
|
+
+ "';\nimport { apiErrorInterceptor } from '"
|
|
47
|
+
+ ((stack1 = lookupProperty(helpers, "joinPath").call(alias1, lookupProperty(lookupProperty(data, "root"), "outputCore"), "./interceptors/apiErrorInterceptor", { "name": "joinPath", "hash": {}, "data": data, "loc": { "start": { "line": 8, "column": 37 }, "end": { "line": 8, "column": 105 } } })) != null ? stack1 : "")
|
|
48
|
+
+ "';\n\n"
|
|
49
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "services"), { "name": "each", "hash": {}, "fn": container.program(1, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 12, "column": 9 } } })) != null ? stack1 : "")
|
|
50
|
+
+ "\nexport interface ClientOptions<TExecutorOptions extends Record<string, any>> {\n openApi?: Partial<TOpenAPIConfig>;\n interceptors?: {\n onRequest?: RequestInterceptor[];\n onResponse?: ResponseInterceptor[];\n onError?: ErrorInterceptor[];\n }\n}\n\nexport function createClient<TExecutorOptions extends Record<string, any>>(\n options: ClientOptions<TExecutorOptions> = {},\n) {\n const openApiConfig: TOpenAPIConfig = {\n ...OpenAPI,\n ...options.openApi,\n };\n\n let executor = createExecutorAdapter<TExecutorOptions>(openApiConfig);\n if (options?.interceptors) {\n executor = withInterceptors(executor, {\n onError: [apiErrorInterceptor, ...(options.interceptors?.onError ?? [])],\n onRequest: options.interceptors?.onRequest,\n onResponse: options.interceptors?.onResponse,\n });\n }\n\n return {\n"
|
|
51
|
+
+ ((stack1 = lookupProperty(helpers, "each").call(alias1, lookupProperty(depth0, "services"), { "name": "each", "hash": {}, "fn": container.program(3, data, 0), "inverse": container.noop, "data": data, "loc": { "start": { "line": 41, "column": 4 }, "end": { "line": 43, "column": 13 } } })) != null ? stack1 : "")
|
|
52
|
+
+ " };\n}\n";
|
|
53
|
+
}, "usePartial": true, "useData": true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exportService.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"exportService.d.ts","sourceRoot":"","sources":["../../../src/templatesCompiled/client/exportService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAiNoD"}
|