@skmtc/core 0.0.223 → 0.0.225
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/{script → esm}/_dnt.polyfills.js +1 -2
- package/{script → esm}/_dnt.shims.js +4 -8
- package/{script → esm}/context/CoreContext.js +24 -28
- package/{script → esm}/context/GenerateContext.js +13 -17
- package/{script → esm}/context/LogStore.js +1 -5
- package/{script → esm}/context/ParseContext.js +1 -5
- package/{script → esm}/context/RenderContext.js +17 -47
- package/{script → esm}/context/Trail.js +1 -5
- package/esm/context/types.js +1 -0
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/_validate_binary_like.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/ascii85.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base32.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base58.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base64.js +4 -8
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/base64url.js +3 -30
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/hex.js +4 -8
- package/esm/deps/jsr.io/@std/encoding/1.0.1/mod.js +22 -0
- package/{script → esm}/deps/jsr.io/@std/encoding/1.0.1/varint.js +8 -14
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/assert_path.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/basename.js +5 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/common.js +1 -4
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/constants.js +46 -0
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/dirname.js +8 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/format.js +2 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/from_file_url.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/glob_to_reg_exp.js +1 -4
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/normalize.js +8 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/normalize_string.js +6 -9
- package/esm/deps/jsr.io/@std/path/1.0.0/_common/relative.js +9 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/strip_trailing_separators.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/_common/to_file_url.js +1 -4
- package/esm/deps/jsr.io/@std/path/1.0.0/_os.js +14 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/basename.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/common.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/constants.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/dirname.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/extname.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/format.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/from_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/glob_to_regexp.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/is_absolute.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/is_glob.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/join.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/join_globs.js +7 -10
- package/esm/deps/jsr.io/@std/path/1.0.0/mod.js +54 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/normalize.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/normalize_glob.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/parse.js +5 -8
- package/esm/deps/jsr.io/@std/path/1.0.0/posix/_util.js +8 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/basename.js +8 -11
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/constants.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/dirname.js +8 -11
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/extname.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/format.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/from_file_url.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/glob_to_regexp.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/is_absolute.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/join.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/join_globs.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/normalize.js +8 -11
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/normalize_glob.js +6 -9
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/parse.js +10 -13
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/relative.js +14 -17
- package/esm/deps/jsr.io/@std/path/1.0.0/posix/resolve.js +59 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/to_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/posix/to_namespaced_path.js +1 -4
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/relative.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/resolve.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/to_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/to_namespaced_path.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/types.js +1 -2
- package/esm/deps/jsr.io/@std/path/1.0.0/windows/_util.js +15 -0
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/basename.js +11 -14
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/constants.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/dirname.js +17 -20
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/extname.js +9 -12
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/format.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/from_file_url.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/glob_to_regexp.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/is_absolute.js +9 -12
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/join.js +10 -13
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/join_globs.js +7 -10
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/normalize.js +17 -20
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/normalize_glob.js +6 -9
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/parse.js +16 -19
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/relative.js +16 -19
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/resolve.js +17 -43
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/to_file_url.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/path/1.0.0/windows/to_namespaced_path.js +11 -14
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_dumper/dumper.js +10 -36
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_dumper/dumper_state.js +2 -6
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_error.js +1 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_loader/loader.js +9 -36
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_loader/loader_state.js +2 -6
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_mark.js +3 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_state.js +3 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/binary.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/bool.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/float.js +5 -8
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/function.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/int.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/map.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/merge.js +2 -5
- package/esm/deps/jsr.io/@std/yaml/0.215.0/_type/mod.js +20 -0
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/nil.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/omap.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/pairs.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/regexp.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/seq.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/set.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/str.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/timestamp.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_type/undefined.js +2 -5
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/_utils.js +15 -32
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/mod.js +4 -20
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/parse.js +5 -9
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/core.js +4 -7
- package/esm/deps/jsr.io/@std/yaml/0.215.0/schema/default.js +15 -0
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/extended.js +6 -9
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/failsafe.js +4 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema/json.js +6 -9
- package/esm/deps/jsr.io/@std/yaml/0.215.0/schema/mod.js +10 -0
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/schema.js +3 -7
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/stringify.js +3 -6
- package/{script → esm}/deps/jsr.io/@std/yaml/0.215.0/type.js +1 -5
- package/{script → esm}/dsl/ContentSettings.js +1 -5
- package/{script → esm}/dsl/Definition.js +4 -8
- package/{script → esm}/dsl/GeneratedValueList.js +3 -7
- package/{script → esm}/dsl/Identifier.js +8 -12
- package/{script → esm}/dsl/Import.js +2 -7
- package/esm/dsl/ModelCreator.js +1 -0
- package/{script → esm}/dsl/ModelDriver.js +14 -18
- package/esm/dsl/OperationCreator.js +1 -0
- package/{script → esm}/dsl/OperationDriver.js +11 -15
- package/esm/dsl/Stringable.js +1 -0
- package/{script → esm}/dsl/ValueBase.js +1 -5
- package/{script → esm}/dsl/base.js +5 -13
- package/esm/dsl/constants.js +1 -0
- package/{script → esm}/dsl/withConfig.js +9 -15
- package/esm/generate/generate.js +47 -0
- package/esm/generate/generateModels.js +29 -0
- package/esm/generate/generateOperations.js +35 -0
- package/{script → esm}/helpers/logStatus.js +2 -7
- package/esm/helpers/naming.js +25 -0
- package/esm/helpers/refFns.js +24 -0
- package/esm/helpers/strings.js +6 -0
- package/{script → esm}/helpers/verifyType.js +1 -4
- package/esm/mod.js +61 -0
- package/{script → esm}/oas/array/Array.js +2 -6
- package/esm/oas/array/array-types.js +17 -0
- package/esm/oas/array/toArray.js +20 -0
- package/{script → esm}/oas/boolean/Boolean.js +2 -6
- package/esm/oas/boolean/boolean-types.js +8 -0
- package/esm/oas/boolean/toBoolean.js +10 -0
- package/{script → esm}/oas/components/Components.js +2 -6
- package/esm/oas/components/toComponentsV3.js +44 -0
- package/esm/oas/contact/contact-types.js +7 -0
- package/{script → esm}/oas/discriminator/Discriminator.js +2 -6
- package/esm/oas/discriminator/discriminator-types.js +6 -0
- package/esm/oas/discriminator/toDiscriminatorV3.js +11 -0
- package/{script → esm}/oas/document/Document.js +2 -6
- package/esm/oas/document/toDocumentV3.js +24 -0
- package/{script → esm}/oas/example/Example.js +2 -6
- package/esm/oas/example/example-types.js +9 -0
- package/esm/oas/example/toExamplesV3.js +45 -0
- package/{script → esm}/oas/header/Header.js +2 -6
- package/esm/oas/header/toHeadersV3.js +42 -0
- package/{script → esm}/oas/info/Info.js +2 -6
- package/{script → esm}/oas/info/toInfoV3.js +3 -7
- package/{script → esm}/oas/integer/Integer.js +2 -6
- package/esm/oas/integer/integer-types.js +18 -0
- package/esm/oas/integer/toInteger.js +13 -0
- package/{script → esm}/oas/intersection/Intersection.js +2 -6
- package/esm/oas/intersection/intersection-types.js +12 -0
- package/esm/oas/intersection/toIntersection.js +22 -0
- package/esm/oas/license/license-types.js +7 -0
- package/esm/oas/markdown/markdown-types.js +2 -0
- package/{script → esm}/oas/mediaType/MediaType.js +2 -6
- package/esm/oas/mediaType/mediaType-types.js +12 -0
- package/esm/oas/mediaType/toMediaTypeItemV3.js +37 -0
- package/esm/oas/null/null-types.js +8 -0
- package/{script → esm}/oas/number/Number.js +2 -6
- package/esm/oas/number/number-types.js +14 -0
- package/esm/oas/number/toNumber.js +10 -0
- package/{script → esm}/oas/object/Object.js +4 -8
- package/esm/oas/object/object-types.js +27 -0
- package/esm/oas/object/toAdditionalPropertiesV3.js +14 -0
- package/esm/oas/object/toObject.js +23 -0
- package/{script → esm}/oas/operation/Operation.js +2 -6
- package/{script → esm}/oas/operation/toOperationsV3.js +13 -18
- package/{script → esm}/oas/parameter/Parameter.js +2 -6
- package/esm/oas/parameter/parameter-types.js +38 -0
- package/{script → esm}/oas/parameter/toParameterV3.js +22 -28
- package/{script → esm}/oas/pathItem/PathItem.js +2 -6
- package/esm/oas/pathItem/toPathItemV3.js +15 -0
- package/{script → esm}/oas/ref/Ref.js +6 -10
- package/esm/oas/ref/ref-types.js +54 -0
- package/esm/oas/ref/toRefV31.js +11 -0
- package/{script → esm}/oas/requestBody/RequestBody.js +2 -6
- package/esm/oas/requestBody/toRequestBodiesV3.js +46 -0
- package/{script → esm}/oas/response/Response.js +2 -6
- package/esm/oas/response/toResponseV3.js +35 -0
- package/esm/oas/schema/Schema.js +1 -0
- package/esm/oas/schema/schema-types.js +23 -0
- package/esm/oas/schema/toSchemasV3.js +60 -0
- package/{script → esm}/oas/string/String.js +2 -6
- package/esm/oas/string/string-types.js +29 -0
- package/esm/oas/string/toString.js +11 -0
- package/{script → esm}/oas/tag/Tag.js +2 -6
- package/esm/oas/tag/toTagsV3.js +14 -0
- package/{script → esm}/oas/union/Union.js +2 -6
- package/esm/oas/union/toUnion.js +22 -0
- package/esm/oas/union/union-types.js +12 -0
- package/{script → esm}/oas/unknown/Unknown.js +2 -6
- package/esm/oas/unknown/toUnknown.js +9 -0
- package/esm/oas/unknown/unknown-types.js +8 -0
- package/{script → esm}/oas/void/Void.js +4 -8
- package/{script → esm}/oas-elements/OasBase.js +1 -5
- package/esm/package.json +3 -0
- package/esm/parse/parse.js +16 -0
- package/{script → esm}/schemas/client.js +2 -4
- package/{script → esm}/server/createServer.js +24 -51
- package/esm/types/Brand.js +1 -0
- package/{script → esm}/types/CustomValue.js +3 -8
- package/esm/types/GeneratedValue.js +1 -0
- package/{script → esm}/types/GenerationType.js +1 -2
- package/esm/types/GeneratorKeys.js +13 -0
- package/esm/types/Method.js +32 -0
- package/esm/types/Modifiers.js +1 -0
- package/esm/types/RefName.js +1 -0
- package/esm/types/Settings.js +42 -0
- package/esm/types/TypeSystem.js +1 -0
- package/esm/types/prettierConfig.js +46 -0
- package/{script → esm}/typescript/EntityType.js +3 -7
- package/{script → esm}/typescript/FunctionParameter.js +10 -17
- package/{script → esm}/typescript/ReactRouterPathParams.js +2 -6
- package/esm/typescript/identifiers.js +7 -0
- package/esm/typescript/keyValues.js +11 -0
- package/{script → esm}/typescript/toDestructuredObject.js +1 -5
- package/{script → esm}/typescript/toOperationArg.js +7 -14
- package/esm/typescript/toOperationResponse.js +17 -0
- package/esm/typescript/toParamsObject.js +12 -0
- package/esm/typescript/toPathTemplate.js +3 -0
- package/esm/typescript/withDescription.js +3 -0
- package/package.json +14 -8
- package/types/types/Method.d.ts +1 -0
- package/types/types/Method.d.ts.map +1 -1
- package/script/context/types.js +0 -2
- package/script/deps/jsr.io/@std/encoding/1.0.1/mod.js +0 -38
- package/script/deps/jsr.io/@std/path/1.0.0/_common/constants.js +0 -49
- package/script/deps/jsr.io/@std/path/1.0.0/_common/dirname.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.0/_common/normalize.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.0/_common/relative.js +0 -12
- package/script/deps/jsr.io/@std/path/1.0.0/_os.js +0 -40
- package/script/deps/jsr.io/@std/path/1.0.0/mod.js +0 -70
- package/script/deps/jsr.io/@std/path/1.0.0/posix/_util.js +0 -11
- package/script/deps/jsr.io/@std/path/1.0.0/posix/resolve.js +0 -85
- package/script/deps/jsr.io/@std/path/1.0.0/windows/_util.js +0 -20
- package/script/deps/jsr.io/@std/yaml/0.215.0/_type/mod.js +0 -39
- package/script/deps/jsr.io/@std/yaml/0.215.0/schema/default.js +0 -18
- package/script/deps/jsr.io/@std/yaml/0.215.0/schema/mod.js +0 -18
- package/script/dsl/ModelCreator.js +0 -2
- package/script/dsl/OperationCreator.js +0 -2
- package/script/dsl/Stringable.js +0 -2
- package/script/dsl/constants.js +0 -4
- package/script/generate/generate.js +0 -75
- package/script/generate/generateModels.js +0 -56
- package/script/generate/generateOperations.js +0 -62
- package/script/helpers/naming.js +0 -33
- package/script/helpers/refFns.js +0 -30
- package/script/helpers/strings.js +0 -11
- package/script/mod.js +0 -77
- package/script/oas/array/array-types.js +0 -20
- package/script/oas/array/toArray.js +0 -24
- package/script/oas/boolean/boolean-types.js +0 -11
- package/script/oas/boolean/toBoolean.js +0 -14
- package/script/oas/components/toComponentsV3.js +0 -48
- package/script/oas/contact/contact-types.js +0 -10
- package/script/oas/discriminator/discriminator-types.js +0 -9
- package/script/oas/discriminator/toDiscriminatorV3.js +0 -15
- package/script/oas/document/toDocumentV3.js +0 -28
- package/script/oas/example/example-types.js +0 -12
- package/script/oas/example/toExamplesV3.js +0 -51
- package/script/oas/header/toHeadersV3.js +0 -46
- package/script/oas/integer/integer-types.js +0 -21
- package/script/oas/integer/toInteger.js +0 -17
- package/script/oas/intersection/intersection-types.js +0 -15
- package/script/oas/intersection/toIntersection.js +0 -26
- package/script/oas/license/license-types.js +0 -10
- package/script/oas/markdown/markdown-types.js +0 -5
- package/script/oas/mediaType/mediaType-types.js +0 -15
- package/script/oas/mediaType/toMediaTypeItemV3.js +0 -43
- package/script/oas/null/null-types.js +0 -11
- package/script/oas/number/number-types.js +0 -17
- package/script/oas/number/toNumber.js +0 -14
- package/script/oas/object/object-types.js +0 -30
- package/script/oas/object/toAdditionalPropertiesV3.js +0 -18
- package/script/oas/object/toObject.js +0 -27
- package/script/oas/parameter/parameter-types.js +0 -41
- package/script/oas/pathItem/toPathItemV3.js +0 -19
- package/script/oas/ref/ref-types.js +0 -57
- package/script/oas/ref/toRefV31.js +0 -15
- package/script/oas/requestBody/toRequestBodiesV3.js +0 -51
- package/script/oas/response/toResponseV3.js +0 -41
- package/script/oas/schema/Schema.js +0 -2
- package/script/oas/schema/schema-types.js +0 -26
- package/script/oas/schema/toSchemasV3.js +0 -67
- package/script/oas/string/string-types.js +0 -32
- package/script/oas/string/toString.js +0 -15
- package/script/oas/tag/toTagsV3.js +0 -18
- package/script/oas/union/toUnion.js +0 -26
- package/script/oas/union/union-types.js +0 -15
- package/script/oas/unknown/toUnknown.js +0 -13
- package/script/oas/unknown/unknown-types.js +0 -11
- package/script/package.json +0 -3
- package/script/parse/parse.js +0 -20
- package/script/types/Brand.js +0 -2
- package/script/types/GeneratedValue.js +0 -2
- package/script/types/GeneratorKeys.js +0 -19
- package/script/types/Method.js +0 -34
- package/script/types/Modifiers.js +0 -2
- package/script/types/RefName.js +0 -2
- package/script/types/Settings.js +0 -45
- package/script/types/TypeSystem.js +0 -2
- package/script/types/prettierConfig.js +0 -49
- package/script/typescript/identifiers.js +0 -12
- package/script/typescript/keyValues.js +0 -15
- package/script/typescript/toOperationResponse.js +0 -21
- package/script/typescript/toParamsObject.js +0 -16
- package/script/typescript/toPathTemplate.js +0 -7
- package/script/typescript/withDescription.js +0 -7
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toOptionalSchemaV3 = exports.toSchemaV3 = exports.toOptionalSchemasV3 = exports.toSchemasV3 = void 0;
|
|
4
|
-
const toRefV31_js_1 = require("../ref/toRefV31.js");
|
|
5
|
-
const refFns_js_1 = require("../../helpers/refFns.js");
|
|
6
|
-
const ts_pattern_1 = require("ts-pattern");
|
|
7
|
-
const toArray_js_1 = require("../array/toArray.js");
|
|
8
|
-
const toObject_js_1 = require("../object/toObject.js");
|
|
9
|
-
const toInteger_js_1 = require("../integer/toInteger.js");
|
|
10
|
-
const toNumber_js_1 = require("../number/toNumber.js");
|
|
11
|
-
const toBoolean_js_1 = require("../boolean/toBoolean.js");
|
|
12
|
-
const toString_js_1 = require("../string/toString.js");
|
|
13
|
-
const toUnknown_js_1 = require("../unknown/toUnknown.js");
|
|
14
|
-
const toUnion_js_1 = require("../union/toUnion.js");
|
|
15
|
-
const toIntersection_js_1 = require("../intersection/toIntersection.js");
|
|
16
|
-
const toSchemasV3 = ({ schemas, trail, context }) => {
|
|
17
|
-
return Object.fromEntries(Object.entries(schemas).map(([key, schema]) => {
|
|
18
|
-
return [
|
|
19
|
-
key,
|
|
20
|
-
(0, exports.toSchemaV3)({ schema, trail: trail.addSchemaRef(key), context })
|
|
21
|
-
];
|
|
22
|
-
}));
|
|
23
|
-
};
|
|
24
|
-
exports.toSchemasV3 = toSchemasV3;
|
|
25
|
-
const toOptionalSchemasV3 = ({ schemas, trail, context }) => {
|
|
26
|
-
if (!schemas) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
return (0, exports.toSchemasV3)({ schemas, trail, context });
|
|
30
|
-
};
|
|
31
|
-
exports.toOptionalSchemasV3 = toOptionalSchemasV3;
|
|
32
|
-
const toSchemaV3 = ({ schema, trail, context }) => {
|
|
33
|
-
if ((0, refFns_js_1.isRef)(schema)) {
|
|
34
|
-
return (0, toRefV31_js_1.toRefV31)({ ref: schema, refType: 'schema', trail, context });
|
|
35
|
-
}
|
|
36
|
-
// Workaround for dodgy Reapit schema
|
|
37
|
-
if (schema.type !== 'array' &&
|
|
38
|
-
'optional' in schema &&
|
|
39
|
-
schema.optional === true) {
|
|
40
|
-
schema.nullable = true;
|
|
41
|
-
}
|
|
42
|
-
return (0, ts_pattern_1.match)(schema)
|
|
43
|
-
.with({ oneOf: ts_pattern_1.P.array() }, ({ oneOf: members, ...value }) => {
|
|
44
|
-
return (0, toUnion_js_1.toUnion)({ value, members, trail, context });
|
|
45
|
-
})
|
|
46
|
-
.with({ anyOf: ts_pattern_1.P.array() }, ({ anyOf: members, ...value }) => {
|
|
47
|
-
return (0, toUnion_js_1.toUnion)({ value, members, trail, context });
|
|
48
|
-
})
|
|
49
|
-
.with({ allOf: ts_pattern_1.P.array() }, ({ allOf: members, ...value }) => {
|
|
50
|
-
return (0, toIntersection_js_1.toIntersection)({ value, members, trail, context });
|
|
51
|
-
})
|
|
52
|
-
.with({ type: 'object' }, value => (0, toObject_js_1.toObject)({ value, trail, context }))
|
|
53
|
-
.with({ type: 'array' }, value => (0, toArray_js_1.toArray)({ value, trail, context }))
|
|
54
|
-
.with({ type: 'integer' }, value => (0, toInteger_js_1.toInteger)({ value, trail, context }))
|
|
55
|
-
.with({ type: 'number' }, value => (0, toNumber_js_1.toNumber)({ value, trail, context }))
|
|
56
|
-
.with({ type: 'boolean' }, value => (0, toBoolean_js_1.toBoolean)({ value, trail, context }))
|
|
57
|
-
.with({ type: 'string' }, value => (0, toString_js_1.toString)({ value, trail, context }))
|
|
58
|
-
.otherwise(value => (0, toUnknown_js_1.toUnknown)({ value, trail, context }));
|
|
59
|
-
};
|
|
60
|
-
exports.toSchemaV3 = toSchemaV3;
|
|
61
|
-
const toOptionalSchemaV3 = ({ schema, trail, context }) => {
|
|
62
|
-
if (!schema) {
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
return (0, exports.toSchemaV3)({ schema, trail, context });
|
|
66
|
-
};
|
|
67
|
-
exports.toOptionalSchemaV3 = toOptionalSchemaV3;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.oasStringData = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.oasStringData = zod_1.z.object({
|
|
6
|
-
oasType: zod_1.z.literal('schema'),
|
|
7
|
-
title: zod_1.z.string().optional(),
|
|
8
|
-
description: zod_1.z.string().optional(),
|
|
9
|
-
default: zod_1.z.string().optional(),
|
|
10
|
-
type: zod_1.z.literal('string'),
|
|
11
|
-
// Add soon
|
|
12
|
-
// maxLength: z.number().optional(),
|
|
13
|
-
// minLength: z.number().optional(),
|
|
14
|
-
pattern: zod_1.z.string().optional(),
|
|
15
|
-
enums: zod_1.z.array(zod_1.z.string()).optional(),
|
|
16
|
-
format: zod_1.z
|
|
17
|
-
.enum([
|
|
18
|
-
'date-time',
|
|
19
|
-
'time',
|
|
20
|
-
'date',
|
|
21
|
-
'duration',
|
|
22
|
-
'email',
|
|
23
|
-
'hostname',
|
|
24
|
-
'ipv4',
|
|
25
|
-
'ipv6',
|
|
26
|
-
'uuid',
|
|
27
|
-
'uri',
|
|
28
|
-
'regex',
|
|
29
|
-
'binary'
|
|
30
|
-
])
|
|
31
|
-
.optional()
|
|
32
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toString = void 0;
|
|
4
|
-
const String_js_1 = require("./String.js");
|
|
5
|
-
const toString = ({ value, trail, context }) => {
|
|
6
|
-
const { type: _type, title, description, enum: enums, nullable, ...skipped } = value;
|
|
7
|
-
const fields = {
|
|
8
|
-
title,
|
|
9
|
-
description,
|
|
10
|
-
enums,
|
|
11
|
-
nullable
|
|
12
|
-
};
|
|
13
|
-
return new String_js_1.OasString({ fields, trail, skipped, context });
|
|
14
|
-
};
|
|
15
|
-
exports.toString = toString;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toTagsV3 = void 0;
|
|
4
|
-
const Tag_js_1 = require("./Tag.js");
|
|
5
|
-
const toTagsV3 = ({ tags, trail, context }) => {
|
|
6
|
-
if (!tags) {
|
|
7
|
-
return undefined;
|
|
8
|
-
}
|
|
9
|
-
return tags.map(tag => {
|
|
10
|
-
const { name, description, ...skipped } = tag;
|
|
11
|
-
const fields = {
|
|
12
|
-
name,
|
|
13
|
-
description
|
|
14
|
-
};
|
|
15
|
-
return new Tag_js_1.OasTag({ fields, trail, context, skipped });
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
exports.toTagsV3 = toTagsV3;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toUnion = void 0;
|
|
4
|
-
const Union_js_1 = require("./Union.js");
|
|
5
|
-
const toDiscriminatorV3_js_1 = require("../discriminator/toDiscriminatorV3.js");
|
|
6
|
-
const toSchemasV3_js_1 = require("../schema/toSchemasV3.js");
|
|
7
|
-
const toUnion = ({ value, members, trail, context }) => {
|
|
8
|
-
const { discriminator, title, description, nullable, ...skipped } = value;
|
|
9
|
-
const fields = {
|
|
10
|
-
title,
|
|
11
|
-
description,
|
|
12
|
-
nullable,
|
|
13
|
-
discriminator: (0, toDiscriminatorV3_js_1.toDiscriminatorV3)({
|
|
14
|
-
discriminator,
|
|
15
|
-
trail: trail.add('oneOf').add('discriminator'),
|
|
16
|
-
context
|
|
17
|
-
}),
|
|
18
|
-
members: members.map((item, index) => (0, toSchemasV3_js_1.toSchemaV3)({
|
|
19
|
-
schema: item,
|
|
20
|
-
trail: trail.add('oneOf').add(`${index}`),
|
|
21
|
-
context
|
|
22
|
-
}))
|
|
23
|
-
};
|
|
24
|
-
return new Union_js_1.OasUnion({ fields, trail, skipped, context });
|
|
25
|
-
};
|
|
26
|
-
exports.toUnion = toUnion;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.oasUnionData = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const schema_types_js_1 = require("../schema/schema-types.js");
|
|
6
|
-
const ref_types_js_1 = require("../ref/ref-types.js");
|
|
7
|
-
const discriminator_types_js_1 = require("../discriminator/discriminator-types.js");
|
|
8
|
-
exports.oasUnionData = zod_1.z.object({
|
|
9
|
-
oasType: zod_1.z.literal('schema'),
|
|
10
|
-
type: zod_1.z.literal('union'),
|
|
11
|
-
title: zod_1.z.string().optional(),
|
|
12
|
-
description: zod_1.z.string().optional(),
|
|
13
|
-
members: zod_1.z.lazy(() => zod_1.z.array(zod_1.z.union([schema_types_js_1.oasSchemaData, ref_types_js_1.oasSchemaRefData]))),
|
|
14
|
-
discriminator: discriminator_types_js_1.oasDiscriminatorData.optional()
|
|
15
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toUnknown = void 0;
|
|
4
|
-
const Unknown_js_1 = require("./Unknown.js");
|
|
5
|
-
const toUnknown = ({ value, trail, context }) => {
|
|
6
|
-
const { type: _type, title, description, ...skipped } = value;
|
|
7
|
-
const fields = {
|
|
8
|
-
title,
|
|
9
|
-
description
|
|
10
|
-
};
|
|
11
|
-
return new Unknown_js_1.OasUnknown({ fields, trail, skipped, context });
|
|
12
|
-
};
|
|
13
|
-
exports.toUnknown = toUnknown;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.oasUnknownData = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.oasUnknownData = zod_1.z.object({
|
|
6
|
-
oasType: zod_1.z.literal('schema'),
|
|
7
|
-
title: zod_1.z.string().optional(),
|
|
8
|
-
description: zod_1.z.string().optional(),
|
|
9
|
-
default: zod_1.z.unknown().optional(),
|
|
10
|
-
type: zod_1.z.literal('unknown')
|
|
11
|
-
});
|
package/script/package.json
DELETED
package/script/parse/parse.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.oasToSkmtc = void 0;
|
|
4
|
-
const toDocumentV3_js_1 = require("../oas/document/toDocumentV3.js");
|
|
5
|
-
const Trail_js_1 = require("../context/Trail.js");
|
|
6
|
-
const oasToSkmtc = (context) => {
|
|
7
|
-
const { parsedDocument } = context;
|
|
8
|
-
const trail = new Trail_js_1.Trail({
|
|
9
|
-
document: parsedDocument
|
|
10
|
-
});
|
|
11
|
-
if (!parsedDocument.openapi.startsWith('3.0.')) {
|
|
12
|
-
throw new Error('Only OpenAPI v3 is supported');
|
|
13
|
-
}
|
|
14
|
-
return (0, toDocumentV3_js_1.toDocumentV3)({
|
|
15
|
-
document: parsedDocument,
|
|
16
|
-
trail,
|
|
17
|
-
context
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
exports.oasToSkmtc = oasToSkmtc;
|
package/script/types/Brand.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toGeneratorOnlyKey = exports.toModelGeneratorKey = exports.toOperationGeneratorKey = void 0;
|
|
4
|
-
const toOperationGeneratorKey = ({ generatorId, ...rest }) => {
|
|
5
|
-
const { path, method } = 'operation' in rest ? rest.operation : rest;
|
|
6
|
-
const nakedKey = `${generatorId}|${path}|${method}`;
|
|
7
|
-
return nakedKey;
|
|
8
|
-
};
|
|
9
|
-
exports.toOperationGeneratorKey = toOperationGeneratorKey;
|
|
10
|
-
const toModelGeneratorKey = ({ generatorId, refName }) => {
|
|
11
|
-
const nakedKey = `${generatorId}|${refName}`;
|
|
12
|
-
return nakedKey;
|
|
13
|
-
};
|
|
14
|
-
exports.toModelGeneratorKey = toModelGeneratorKey;
|
|
15
|
-
const toGeneratorOnlyKey = ({ generatorId }) => {
|
|
16
|
-
const nakedKey = `${generatorId}`;
|
|
17
|
-
return nakedKey;
|
|
18
|
-
};
|
|
19
|
-
exports.toGeneratorOnlyKey = toGeneratorOnlyKey;
|
package/script/types/Method.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.methods = exports.method = exports.methodValuesNoTrace = exports.methodValues = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.methodValues = [
|
|
6
|
-
'get',
|
|
7
|
-
'put',
|
|
8
|
-
'post',
|
|
9
|
-
'delete',
|
|
10
|
-
'options',
|
|
11
|
-
'head',
|
|
12
|
-
'patch',
|
|
13
|
-
'trace'
|
|
14
|
-
];
|
|
15
|
-
exports.methodValuesNoTrace = [
|
|
16
|
-
'get',
|
|
17
|
-
'put',
|
|
18
|
-
'post',
|
|
19
|
-
'delete',
|
|
20
|
-
'options',
|
|
21
|
-
'head',
|
|
22
|
-
'patch'
|
|
23
|
-
];
|
|
24
|
-
exports.method = zod_1.z.enum([
|
|
25
|
-
'get',
|
|
26
|
-
'put',
|
|
27
|
-
'post',
|
|
28
|
-
'delete',
|
|
29
|
-
'options',
|
|
30
|
-
'head',
|
|
31
|
-
'patch',
|
|
32
|
-
'trace'
|
|
33
|
-
]);
|
|
34
|
-
exports.methods = zod_1.z.array(exports.method);
|
package/script/types/RefName.js
DELETED
package/script/types/Settings.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.skmtcServerConfig = exports.generatorType = exports.skmtcClientConfig = exports.clientSettings = exports.clientGeneratorSettings = exports.modelsGeneratorSettings = exports.operationsGeneratorSettings = exports.baseSettings = void 0;
|
|
4
|
-
require("../_dnt.polyfills.js");
|
|
5
|
-
const Method_js_1 = require("./Method.js");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
exports.baseSettings = zod_1.z.object({
|
|
8
|
-
selected: zod_1.z.boolean(),
|
|
9
|
-
name: zod_1.z.string().optional(),
|
|
10
|
-
importFrom: zod_1.z.string().optional(),
|
|
11
|
-
exportPath: zod_1.z.string().optional()
|
|
12
|
-
});
|
|
13
|
-
exports.operationsGeneratorSettings = zod_1.z.object({
|
|
14
|
-
id: zod_1.z.string(),
|
|
15
|
-
exportPath: zod_1.z.string().optional(),
|
|
16
|
-
description: zod_1.z.string().optional(),
|
|
17
|
-
operations: zod_1.z.record(zod_1.z.record(Method_js_1.method, exports.baseSettings))
|
|
18
|
-
});
|
|
19
|
-
exports.modelsGeneratorSettings = zod_1.z.object({
|
|
20
|
-
id: zod_1.z.string(),
|
|
21
|
-
exportPath: zod_1.z.string().optional(),
|
|
22
|
-
description: zod_1.z.string().optional(),
|
|
23
|
-
models: zod_1.z.record(exports.baseSettings)
|
|
24
|
-
});
|
|
25
|
-
exports.clientGeneratorSettings = zod_1.z.union([
|
|
26
|
-
exports.operationsGeneratorSettings,
|
|
27
|
-
exports.modelsGeneratorSettings
|
|
28
|
-
]);
|
|
29
|
-
exports.clientSettings = zod_1.z.object({
|
|
30
|
-
basePath: zod_1.z.string().optional(),
|
|
31
|
-
alias: zod_1.z.record(zod_1.z.string()).optional(),
|
|
32
|
-
generators: zod_1.z.array(exports.clientGeneratorSettings)
|
|
33
|
-
});
|
|
34
|
-
exports.skmtcClientConfig = zod_1.z.object({
|
|
35
|
-
serverName: zod_1.z.string().optional(),
|
|
36
|
-
stackName: zod_1.z.string().optional(),
|
|
37
|
-
deploymentId: zod_1.z.string().optional(),
|
|
38
|
-
settings: exports.clientSettings
|
|
39
|
-
});
|
|
40
|
-
exports.generatorType = zod_1.z.enum(['operation', 'model']);
|
|
41
|
-
exports.skmtcServerConfig = zod_1.z.object({
|
|
42
|
-
name: zod_1.z.string().optional(),
|
|
43
|
-
version: zod_1.z.string().optional(),
|
|
44
|
-
generators: zod_1.z.array(zod_1.z.string())
|
|
45
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prettierConfigType = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.prettierConfigType = zod_1.z.object({
|
|
6
|
-
printWidth: zod_1.z.number().optional(),
|
|
7
|
-
tabWidth: zod_1.z.number().optional(),
|
|
8
|
-
useTabs: zod_1.z.boolean().optional(),
|
|
9
|
-
semi: zod_1.z.boolean().optional(),
|
|
10
|
-
singleQuote: zod_1.z.boolean().optional(),
|
|
11
|
-
quoteProps: zod_1.z
|
|
12
|
-
.union([
|
|
13
|
-
zod_1.z.literal('as-needed'),
|
|
14
|
-
zod_1.z.literal('consistent'),
|
|
15
|
-
zod_1.z.literal('preserve')
|
|
16
|
-
])
|
|
17
|
-
.optional(),
|
|
18
|
-
jsxSingleQuote: zod_1.z.boolean().optional(),
|
|
19
|
-
trailingComma: zod_1.z
|
|
20
|
-
.union([zod_1.z.literal('none'), zod_1.z.literal('es5'), zod_1.z.literal('all')])
|
|
21
|
-
.optional(),
|
|
22
|
-
bracketSameLine: zod_1.z.boolean().optional(),
|
|
23
|
-
bracketSpacing: zod_1.z.boolean().optional(),
|
|
24
|
-
jsxBracketSameLine: zod_1.z.boolean().optional(),
|
|
25
|
-
arrowParens: zod_1.z.union([zod_1.z.literal('avoid'), zod_1.z.literal('always')]).optional(),
|
|
26
|
-
rangeStart: zod_1.z.number().optional(),
|
|
27
|
-
rangeEnd: zod_1.z.number().optional(),
|
|
28
|
-
requirePragma: zod_1.z.boolean().optional(),
|
|
29
|
-
insertPragma: zod_1.z.boolean().optional(),
|
|
30
|
-
proseWrap: zod_1.z
|
|
31
|
-
.union([zod_1.z.literal('always'), zod_1.z.literal('never'), zod_1.z.literal('preserve')])
|
|
32
|
-
.optional(),
|
|
33
|
-
htmlWhitespaceSensitivity: zod_1.z
|
|
34
|
-
.union([zod_1.z.literal('css'), zod_1.z.literal('strict'), zod_1.z.literal('ignore')])
|
|
35
|
-
.optional(),
|
|
36
|
-
vueIndentScriptAndStyle: zod_1.z.boolean().optional(),
|
|
37
|
-
endOfLine: zod_1.z
|
|
38
|
-
.union([
|
|
39
|
-
zod_1.z.literal('auto'),
|
|
40
|
-
zod_1.z.literal('lf'),
|
|
41
|
-
zod_1.z.literal('crlf'),
|
|
42
|
-
zod_1.z.literal('cr')
|
|
43
|
-
])
|
|
44
|
-
.optional(),
|
|
45
|
-
embeddedLanguageFormatting: zod_1.z
|
|
46
|
-
.union([zod_1.z.literal('auto'), zod_1.z.literal('off')])
|
|
47
|
-
.optional(),
|
|
48
|
-
singleAttributePerLine: zod_1.z.boolean().optional()
|
|
49
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handlePropertyName = exports.handleKey = void 0;
|
|
4
|
-
const helper_validator_identifier_1 = require("@babel/helper-validator-identifier");
|
|
5
|
-
const handleKey = (key) => {
|
|
6
|
-
return (0, helper_validator_identifier_1.isIdentifierName)(key) ? key : `'${key}'`;
|
|
7
|
-
};
|
|
8
|
-
exports.handleKey = handleKey;
|
|
9
|
-
const handlePropertyName = (name, parent) => {
|
|
10
|
-
return (0, helper_validator_identifier_1.isIdentifierName)(name) ? `${parent}.${name}` : `${parent}['${name}']`;
|
|
11
|
-
};
|
|
12
|
-
exports.handlePropertyName = handlePropertyName;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.keyValues = void 0;
|
|
4
|
-
const constants_js_1 = require("../dsl/constants.js");
|
|
5
|
-
// Filter out properties with falsy or EMPTY values and return as joined string
|
|
6
|
-
const keyValues = (properties) => {
|
|
7
|
-
const filteredEntries = Object.entries(properties)
|
|
8
|
-
.map(([key, value]) => {
|
|
9
|
-
const renderedValue = value?.toString() || constants_js_1.EMPTY;
|
|
10
|
-
return renderedValue === constants_js_1.EMPTY ? constants_js_1.EMPTY : `${key}: ${renderedValue}`;
|
|
11
|
-
})
|
|
12
|
-
.filter(row => row !== constants_js_1.EMPTY);
|
|
13
|
-
return filteredEntries.length ? `{${filteredEntries.join(',\n')}}` : constants_js_1.EMPTY;
|
|
14
|
-
};
|
|
15
|
-
exports.keyValues = keyValues;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toOperationResponse = void 0;
|
|
4
|
-
const Definition_js_1 = require("../dsl/Definition.js");
|
|
5
|
-
const Void_js_1 = require("../oas/void/Void.js");
|
|
6
|
-
const naming_js_1 = require("../helpers/naming.js");
|
|
7
|
-
const toOperationResponse = ({ context, operation, destinationPath, typeSystemCreator, toIdentifier }) => {
|
|
8
|
-
const successResponse = operation.toSuccessResponse()?.resolve();
|
|
9
|
-
const value = typeSystemCreator.create({
|
|
10
|
-
context,
|
|
11
|
-
schema: successResponse?.toSchema() ?? Void_js_1.OasVoid.empty(context),
|
|
12
|
-
destinationPath
|
|
13
|
-
});
|
|
14
|
-
return new Definition_js_1.Definition({
|
|
15
|
-
context,
|
|
16
|
-
identifier: toIdentifier((0, naming_js_1.toResponseName)(operation)),
|
|
17
|
-
value,
|
|
18
|
-
description: successResponse?.description
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
exports.toOperationResponse = toOperationResponse;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toParamsObject = void 0;
|
|
4
|
-
const identifiers_js_1 = require("./identifiers.js");
|
|
5
|
-
const constants_js_1 = require("../dsl/constants.js");
|
|
6
|
-
const toParamsObject = (parameters, queryArg) => {
|
|
7
|
-
if (!parameters?.length) {
|
|
8
|
-
return constants_js_1.EMPTY;
|
|
9
|
-
}
|
|
10
|
-
const keyValues = parameters.map(({ name }) => {
|
|
11
|
-
const keyValue = `${(0, identifiers_js_1.handleKey)(name)}: ${(0, identifiers_js_1.handlePropertyName)(name, queryArg)}`;
|
|
12
|
-
return keyValue;
|
|
13
|
-
});
|
|
14
|
-
return `{${keyValues.join(',\n')}}`;
|
|
15
|
-
};
|
|
16
|
-
exports.toParamsObject = toParamsObject;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toPathTemplate = void 0;
|
|
4
|
-
const toPathTemplate = (path, queryArg) => {
|
|
5
|
-
return `${path.replaceAll(/{([^}]*)}/g, queryArg ? '${' + queryArg + '.$1}' : '${$1}')}`;
|
|
6
|
-
};
|
|
7
|
-
exports.toPathTemplate = toPathTemplate;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withDescription = void 0;
|
|
4
|
-
const withDescription = (value, { description }) => {
|
|
5
|
-
return description ? `/** ${description} */\n${value}` : `${value}`;
|
|
6
|
-
};
|
|
7
|
-
exports.withDescription = withDescription;
|