ts-openapi-codegen 2.0.0-beta.7 → 2.0.0-beta.9
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 +104 -0
- package/README.rus.md +104 -0
- 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/generateOpenApiClient/generateOpenApiClient.d.ts.map +1 -1
- package/dist/cli/generateOpenApiClient/generateOpenApiClient.js +4 -5
- package/dist/cli/index.js +5 -5
- package/dist/cli/initOpenApiConfig/init.d.ts.map +1 -1
- package/dist/cli/initOpenApiConfig/init.js +5 -13
- package/dist/cli/initOpenApiConfig/initConfig.js +3 -3
- package/dist/cli/previewChanges/previewChanges.d.ts.map +1 -1
- package/dist/cli/previewChanges/previewChanges.js +12 -5
- package/dist/cli/schemas/base.d.ts +6 -1
- package/dist/cli/schemas/base.d.ts.map +1 -1
- package/dist/cli/schemas/base.js +10 -6
- package/dist/cli/schemas/checkConfig.d.ts +1 -1
- package/dist/cli/schemas/generate.d.ts +1 -25
- package/dist/cli/schemas/generate.d.ts.map +1 -1
- package/dist/cli/schemas/generate.js +21 -32
- package/dist/cli/schemas/index.d.ts +2 -1
- package/dist/cli/schemas/index.d.ts.map +1 -1
- package/dist/cli/schemas/index.js +1 -0
- package/dist/cli/schemas/init.d.ts +5 -5
- package/dist/cli/schemas/init.d.ts.map +1 -1
- package/dist/cli/schemas/init.js +4 -5
- 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 +1 -1
- package/dist/common/Consts.d.ts +2 -0
- package/dist/common/Consts.d.ts.map +1 -1
- package/dist/common/Consts.js +4 -1
- package/dist/common/LoggerMessages.js +1 -1
- package/dist/common/TRawOptions.d.ts +1 -1
- 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/{cli/validation/errorFormatter.js → common/Validation/formatZodError.js} +14 -13
- package/dist/common/Validation/index.d.ts +3 -0
- package/dist/common/Validation/index.d.ts.map +1 -0
- package/dist/{cli/validation → common/Validation}/index.js +2 -2
- package/dist/{cli/validation/validateCLIOptions.d.ts → common/Validation/validateZodOptions.d.ts} +4 -4
- package/dist/common/Validation/validateZodOptions.d.ts.map +1 -0
- package/dist/{cli/validation/validateCLIOptions.js → common/Validation/validateZodOptions.js} +7 -10
- 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 -14
- 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 +36 -6
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV1.js +33 -37
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts +37 -6
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.d.ts.map +1 -1
- package/dist/common/VersionedSchema/AllVersionedSchemas/UnifiedOptionsSchemaV2.js +30 -37
- 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 -30
- package/dist/common/VersionedSchema/CommonSchemas.d.ts.map +1 -1
- package/dist/common/VersionedSchema/CommonSchemas.js +47 -72
- 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/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/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/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/core/Context.d.ts +6 -5
- package/dist/core/Context.d.ts.map +1 -1
- package/dist/core/Context.js +69 -26
- package/dist/core/OpenApiClient.d.ts.map +1 -1
- package/dist/core/OpenApiClient.js +12 -8
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +4 -0
- package/dist/core/__tests__/WriteClient.test.js +3 -0
- 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 +1 -2
- 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 +2 -2
- 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 +1 -2
- 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.js +2 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/types/base/Templates.model.d.ts +3 -0
- package/dist/core/types/base/Templates.model.d.ts.map +1 -1
- package/dist/core/utils/__mocks__/templates.d.ts.map +1 -1
- package/dist/core/utils/__mocks__/templates.js +3 -0
- package/dist/core/utils/__tests__/isSubdirectory.test.js +2 -2
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +9 -3
- package/dist/core/utils/serviceHelpers.d.ts.map +1 -1
- package/dist/core/utils/serviceHelpers.js +32 -6
- 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.map +1 -1
- package/dist/core/utils/writeClientCore.js +5 -3
- 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.map +1 -0
- package/dist/templatesCompiled/client/core/{createExecutorAdapter.js → executor/createExecutorAdapter.js} +3 -3
- 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/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/{request-executor.d.ts → interceptors/interceptors.d.ts} +2 -1
- 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.map +1 -1
- package/dist/templatesCompiled/client/exportClient.js +14 -10
- package/dist/templatesCompiled/client/exportService.js +1 -1
- package/dist/templatesCompiled/client/indexCore.js +2 -2
- package/dist/templatesCompiled/client/indexFull.js +2 -2
- 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/package.json +1 -1
- package/dist/cli/validation/errorFormatter.d.ts +0 -6
- package/dist/cli/validation/errorFormatter.d.ts.map +0 -1
- package/dist/cli/validation/index.d.ts +0 -3
- package/dist/cli/validation/index.d.ts.map +0 -1
- package/dist/cli/validation/validateCLIOptions.d.ts.map +0 -1
- 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/schemas/configSchemas.d.ts +0 -91
- package/dist/common/schemas/configSchemas.d.ts.map +0 -1
- package/dist/common/schemas/configSchemas.js +0 -131
- 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/utils/__tests__/getRelativeModelPath.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getRelativeModelPath.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getRelativeModelPath.test.js +0 -21
- package/dist/core/utils/getRelativeModelPath.d.ts +0 -9
- package/dist/core/utils/getRelativeModelPath.d.ts.map +0 -1
- package/dist/core/utils/getRelativeModelPath.js +0 -37
- package/dist/templatesCompiled/client/core/createExecutorAdapter.d.ts.map +0 -1
- package/dist/templatesCompiled/client/core/request-executor.d.ts.map +0 -1
- package/dist/templatesCompiled/client/core/request-executor.js +0 -11
- /package/dist/templatesCompiled/client/core/{createExecutorAdapter.d.ts → executor/createExecutorAdapter.d.ts} +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
7
|
-
const node_test_1 = require("node:test");
|
|
8
|
-
const joi_1 = __importDefault(require("joi"));
|
|
9
|
-
const OptionsSchemaV2_1 = require("../../VersionedSchema/OptionsVersioned/OptionsSchemaV2");
|
|
10
|
-
const mergeObjectSchemas_1 = require("../../VersionedSchema/Utils/mergeObjectSchemas");
|
|
11
|
-
(0, node_test_1.describe)('@unit: mergeObjectSchemas', () => {
|
|
12
|
-
(0, node_test_1.test)('should combine multiple schemas correctly', () => {
|
|
13
|
-
const schema1 = joi_1.default.object({ a: joi_1.default.string().required() });
|
|
14
|
-
const schema2 = joi_1.default.object({ b: joi_1.default.number().optional() });
|
|
15
|
-
const mergedSchema = (0, mergeObjectSchemas_1.mergeObjectSchemas)(schema1, schema2);
|
|
16
|
-
const validData = { a: 'test', b: 123 };
|
|
17
|
-
const invalidData = { a: 'test', b: 'not a number' };
|
|
18
|
-
node_assert_1.default.equal(mergedSchema.validate(validData).error, null, 'Valid data should pass validation');
|
|
19
|
-
node_assert_1.default.notEqual(mergedSchema.validate(invalidData).error, null, 'Invalid data should fail validation');
|
|
20
|
-
});
|
|
21
|
-
(0, node_test_1.test)('should work with real schemas from OptionSchemas', () => {
|
|
22
|
-
const validData = {
|
|
23
|
-
input: 'source/path',
|
|
24
|
-
httpClient: 'axios',
|
|
25
|
-
output: 'output/path',
|
|
26
|
-
useOptions: true,
|
|
27
|
-
};
|
|
28
|
-
const invalidData = {
|
|
29
|
-
input: 'source/path',
|
|
30
|
-
httpClient: 'invalid-client',
|
|
31
|
-
};
|
|
32
|
-
node_assert_1.default.equal(OptionsSchemaV2_1.optionsSchemaV2.validate(validData).error, null, 'Valid data should pass optionsSchemaV2 validation');
|
|
33
|
-
node_assert_1.default.notEqual(OptionsSchemaV2_1.optionsSchemaV2.validate(invalidData).error, null, 'Invalid data should fail optionsSchemaV2 validation');
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrationForMultiOptions.test.d.ts","sourceRoot":"","sources":["../../../../src/common/utils/__tests__/migrationForMultiOptions.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
-
const node_test_1 = require("node:test");
|
|
8
|
-
const Enums_1 = require("../../Enums");
|
|
9
|
-
const Enums_2 = require("../../VersionedSchema/Enums");
|
|
10
|
-
const MultiOptionsMigrationPlan_1 = require("../../VersionedSchema/MultiOptionsVersioned/MultiOptionsMigrationPlan");
|
|
11
|
-
const MultiOptionsVersionedSchemas_1 = require("../../VersionedSchema/MultiOptionsVersioned/MultiOptionsVersionedSchemas");
|
|
12
|
-
const migrateDataToLatestSchemaVersion_1 = require("../../VersionedSchema/Utils/migrateDataToLatestSchemaVersion");
|
|
13
|
-
const mockJoiSchema_1 = require("./__mock__/mockJoiSchema");
|
|
14
|
-
node_test_1.describe.skip('@unit: migrationForMultiOptions', () => {
|
|
15
|
-
(0, node_test_1.test)('must successfully migrate MULTI_OPTIONS data to the latest version', async () => {
|
|
16
|
-
const input = { input: 'input/path', output: 'output/path', client: 'fetch', items: [{ input: 'path/item1' }] };
|
|
17
|
-
const result = (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
18
|
-
rawInput: input,
|
|
19
|
-
migrationPlans: MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan,
|
|
20
|
-
versionedSchemas: MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema,
|
|
21
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
22
|
-
});
|
|
23
|
-
strict_1.default.deepEqual(result, {
|
|
24
|
-
value: {
|
|
25
|
-
excludeCoreServiceFiles: false,
|
|
26
|
-
httpClient: 'fetch',
|
|
27
|
-
includeSchemasFiles: false,
|
|
28
|
-
items: [
|
|
29
|
-
{
|
|
30
|
-
input: 'input/path',
|
|
31
|
-
output: 'output/path',
|
|
32
|
-
outputCore: undefined,
|
|
33
|
-
outputModels: undefined,
|
|
34
|
-
outputSchemas: undefined,
|
|
35
|
-
outputServices: undefined,
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
sortByRequired: false,
|
|
39
|
-
useCancelableRequest: false,
|
|
40
|
-
useSeparatedIndexes: false,
|
|
41
|
-
},
|
|
42
|
-
schemaVersion: 'v5',
|
|
43
|
-
schemaType: Enums_2.EVersionedSchemaType.MULTI_OPTIONS,
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
(0, node_test_1.test)('should return null in case of validation error of the last MULTI_OPTIONS scheme', async () => {
|
|
47
|
-
const input = { input: 'input/path' };
|
|
48
|
-
const result = (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
49
|
-
rawInput: input,
|
|
50
|
-
migrationPlans: MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan,
|
|
51
|
-
versionedSchemas: MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema,
|
|
52
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
53
|
-
});
|
|
54
|
-
strict_1.default.equal(result, null);
|
|
55
|
-
});
|
|
56
|
-
(0, node_test_1.test)('should throw an error if the migration plan for MULTI_OPTIONS is not found.', async () => {
|
|
57
|
-
const input = { input: 'input/path', output: 'output/path', client: 'fetch', items: [{ input: 'path/item1' }] };
|
|
58
|
-
strict_1.default.throws(() => (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
59
|
-
rawInput: input,
|
|
60
|
-
migrationPlans: [],
|
|
61
|
-
versionedSchemas: MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema,
|
|
62
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
63
|
-
}), /No migration plan from v1/);
|
|
64
|
-
});
|
|
65
|
-
(0, node_test_1.test)('should throw an error on unrecognized fields in MULTI_OPTIONS', async () => {
|
|
66
|
-
const input = {
|
|
67
|
-
input: 'input/path',
|
|
68
|
-
output: 'output/path',
|
|
69
|
-
client: 'fetch',
|
|
70
|
-
items: [{ input: 'path/item1', name: 'Item1' }],
|
|
71
|
-
};
|
|
72
|
-
strict_1.default.throws(() => (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
73
|
-
rawInput: input,
|
|
74
|
-
migrationPlans: MultiOptionsMigrationPlan_1.multiOptionsMigrationPlan,
|
|
75
|
-
versionedSchemas: MultiOptionsVersionedSchemas_1.multiOptionsVersionedSchema,
|
|
76
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
77
|
-
}), /The "name" field is not recognized./);
|
|
78
|
-
});
|
|
79
|
-
(0, node_test_1.test)('must process an empty array of MULTI_OPTIONS data', async () => {
|
|
80
|
-
const schemas = [
|
|
81
|
-
{
|
|
82
|
-
schema: (0, mockJoiSchema_1.mockJoiSchema)(['name'], true, [], true),
|
|
83
|
-
version: '1.0',
|
|
84
|
-
type: Enums_2.EVersionedSchemaType.MULTI_OPTIONS,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
schema: (0, mockJoiSchema_1.mockJoiSchema)(['name', 'options'], true, [], true),
|
|
88
|
-
version: '2.0',
|
|
89
|
-
type: Enums_2.EVersionedSchemaType.MULTI_OPTIONS,
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
const migrationPlans = [
|
|
93
|
-
{
|
|
94
|
-
fromVersion: '1.0',
|
|
95
|
-
toVersion: '2.0',
|
|
96
|
-
migrate: (input) => input.map((item) => ({ ...item, options: [] })),
|
|
97
|
-
},
|
|
98
|
-
];
|
|
99
|
-
const input = [];
|
|
100
|
-
const result = (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
101
|
-
rawInput: input,
|
|
102
|
-
migrationPlans,
|
|
103
|
-
versionedSchemas: schemas,
|
|
104
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
105
|
-
});
|
|
106
|
-
strict_1.default.deepEqual(result, {
|
|
107
|
-
value: [],
|
|
108
|
-
schemaVersion: '2.0',
|
|
109
|
-
schemaType: Enums_2.EVersionedSchemaType.MULTI_OPTIONS,
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrationForOptions.test.d.ts","sourceRoot":"","sources":["../../../../src/common/utils/__tests__/migrationForOptions.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
-
const node_test_1 = require("node:test");
|
|
8
|
-
const Enums_1 = require("../../Enums");
|
|
9
|
-
const Enums_2 = require("../../VersionedSchema/Enums");
|
|
10
|
-
const OptionsMigrationPlans_1 = require("../../VersionedSchema/OptionsVersioned/OptionsMigrationPlans");
|
|
11
|
-
const OptionsVersionedSchemas_1 = require("../../VersionedSchema/OptionsVersioned/OptionsVersionedSchemas");
|
|
12
|
-
const migrateDataToLatestSchemaVersion_1 = require("../../VersionedSchema/Utils/migrateDataToLatestSchemaVersion");
|
|
13
|
-
node_test_1.describe.skip('@unit: migrationForOptions', () => {
|
|
14
|
-
(0, node_test_1.test)('must migrate data to the latest schema version', async () => {
|
|
15
|
-
const input = { input: 'input/path', output: 'output/path', client: 'fetch' };
|
|
16
|
-
const result = (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
17
|
-
rawInput: input,
|
|
18
|
-
migrationPlans: OptionsMigrationPlans_1.optionsMigrationPlans,
|
|
19
|
-
versionedSchemas: OptionsVersionedSchemas_1.optionsVersionedSchemas,
|
|
20
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
21
|
-
});
|
|
22
|
-
strict_1.default.deepEqual(result, {
|
|
23
|
-
value: {
|
|
24
|
-
excludeCoreServiceFiles: false,
|
|
25
|
-
httpClient: 'fetch',
|
|
26
|
-
includeSchemasFiles: false,
|
|
27
|
-
input: 'input/path',
|
|
28
|
-
output: 'output/path',
|
|
29
|
-
sortByRequired: false,
|
|
30
|
-
useCancelableRequest: false,
|
|
31
|
-
useSeparatedIndexes: false,
|
|
32
|
-
},
|
|
33
|
-
schemaVersion: 'v4',
|
|
34
|
-
schemaType: Enums_2.EVersionedSchemaType.OPTIONS,
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
(0, node_test_1.test)('should return null if the validation error occurred for the last schema.', async () => {
|
|
38
|
-
const input = { input: 'input/path' };
|
|
39
|
-
const result = (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
40
|
-
rawInput: input,
|
|
41
|
-
migrationPlans: OptionsMigrationPlans_1.optionsMigrationPlans,
|
|
42
|
-
versionedSchemas: OptionsVersionedSchemas_1.optionsVersionedSchemas,
|
|
43
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
44
|
-
});
|
|
45
|
-
strict_1.default.equal(result, null);
|
|
46
|
-
});
|
|
47
|
-
(0, node_test_1.test)('It should throw an error if the migration plan is not found.', async () => {
|
|
48
|
-
const input = { input: 'input/path', output: 'output/path', client: 'fetch' };
|
|
49
|
-
strict_1.default.throws(() => (0, migrateDataToLatestSchemaVersion_1.migrateDataToLatestSchemaVersion)({
|
|
50
|
-
rawInput: input,
|
|
51
|
-
migrationPlans: [],
|
|
52
|
-
versionedSchemas: OptionsVersionedSchemas_1.optionsVersionedSchemas,
|
|
53
|
-
migrationMode: Enums_1.EMigrationMode.GENERATE_OPENAPI,
|
|
54
|
-
}), /No migration plan from v1/);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRelativeModelPath.test.d.ts","sourceRoot":"","sources":["../../../../src/core/utils/__tests__/getRelativeModelPath.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
7
|
-
const node_test_1 = require("node:test");
|
|
8
|
-
const getRelativeModelPath_1 = require("../getRelativeModelPath");
|
|
9
|
-
node_test_1.describe.skip('@unit: getRelativeModelPath', () => {
|
|
10
|
-
(0, node_test_1.test)('hould return model relative path', () => {
|
|
11
|
-
const modelRelativePath = '../../../models/truck';
|
|
12
|
-
const result = (0, getRelativeModelPath_1.getRelativeModelPath)(undefined, modelRelativePath);
|
|
13
|
-
node_assert_1.default.strictEqual(result, '../../../models/truck');
|
|
14
|
-
});
|
|
15
|
-
(0, node_test_1.test)('should return correct model relative path considering navigation symbols', () => {
|
|
16
|
-
const rootPath = '/home/generated';
|
|
17
|
-
const modelRelativePath = '../../../models/truck';
|
|
18
|
-
const result = (0, getRelativeModelPath_1.getRelativeModelPath)(rootPath, modelRelativePath);
|
|
19
|
-
node_assert_1.default.strictEqual(result, 'models/Truck');
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The function calculates the relative path to the model.
|
|
3
|
-
* Removes the transition to the directory with a level above.
|
|
4
|
-
* @param folderPath Root folder.
|
|
5
|
-
* @param relativeModelPath Relative path to the model.
|
|
6
|
-
* @returns Correct relative model path.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getRelativeModelPath(folderPath: string | undefined, relativeModelPath: string): string;
|
|
9
|
-
//# sourceMappingURL=getRelativeModelPath.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRelativeModelPath.d.ts","sourceRoot":"","sources":["../../../src/core/utils/getRelativeModelPath.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,iBAAiB,EAAE,MAAM,UA2B7F"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRelativeModelPath = getRelativeModelPath;
|
|
4
|
-
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
5
|
-
const getTypeName_1 = require("./getTypeName");
|
|
6
|
-
const isInsideDirectory_1 = require("./isInsideDirectory");
|
|
7
|
-
/**
|
|
8
|
-
* The function calculates the relative path to the model.
|
|
9
|
-
* Removes the transition to the directory with a level above.
|
|
10
|
-
* @param folderPath Root folder.
|
|
11
|
-
* @param relativeModelPath Relative path to the model.
|
|
12
|
-
* @returns Correct relative model path.
|
|
13
|
-
*/
|
|
14
|
-
function getRelativeModelPath(folderPath, relativeModelPath) {
|
|
15
|
-
if (!folderPath) {
|
|
16
|
-
return relativeModelPath;
|
|
17
|
-
}
|
|
18
|
-
const pathSep = '/';
|
|
19
|
-
let mappedPaths = '';
|
|
20
|
-
let modelPath = relativeModelPath;
|
|
21
|
-
// If absolute path (filesystem or URL-like), collapse to type name only
|
|
22
|
-
if (modelPath.startsWith('/')) {
|
|
23
|
-
return (0, getTypeName_1.getTypeName)(modelPath);
|
|
24
|
-
}
|
|
25
|
-
if (modelPath.startsWith('../')) {
|
|
26
|
-
const pathArray = modelPath.split(pathSep).filter(Boolean);
|
|
27
|
-
while (pathArray[0] === '..') {
|
|
28
|
-
pathArray.shift();
|
|
29
|
-
}
|
|
30
|
-
modelPath = pathArray.join(pathSep);
|
|
31
|
-
}
|
|
32
|
-
const resolvedPath = (0, pathHelpers_1.resolveHelper)(folderPath, modelPath);
|
|
33
|
-
if ((0, isInsideDirectory_1.isInsideDirectory)(resolvedPath, folderPath)) {
|
|
34
|
-
mappedPaths = modelPath;
|
|
35
|
-
}
|
|
36
|
-
return mappedPaths;
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createExecutorAdapter.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/createExecutorAdapter.ts"],"names":[],"mappings":";;;;;;;;;;AAMA,wBAwBmC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"request-executor.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/request-executor.ts"],"names":[],"mappings":";;;;;AAMA,wBAEiB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
return "export 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}";
|
|
11
|
-
}, "useData": true };
|
|
File without changes
|