@skmtc/core 0.0.223 → 0.0.224
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 +31 -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 +8 -8
- 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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { toRefV31 } from '../ref/toRefV31.js';
|
|
2
|
+
import { isRef } from '../../helpers/refFns.js';
|
|
3
|
+
import { match, P } from 'ts-pattern';
|
|
4
|
+
import { toArray } from '../array/toArray.js';
|
|
5
|
+
import { toObject } from '../object/toObject.js';
|
|
6
|
+
import { toInteger } from '../integer/toInteger.js';
|
|
7
|
+
import { toNumber } from '../number/toNumber.js';
|
|
8
|
+
import { toBoolean } from '../boolean/toBoolean.js';
|
|
9
|
+
import { toString } from '../string/toString.js';
|
|
10
|
+
import { toUnknown } from '../unknown/toUnknown.js';
|
|
11
|
+
import { toUnion } from '../union/toUnion.js';
|
|
12
|
+
import { toIntersection } from '../intersection/toIntersection.js';
|
|
13
|
+
export const toSchemasV3 = ({ schemas, trail, context }) => {
|
|
14
|
+
return Object.fromEntries(Object.entries(schemas).map(([key, schema]) => {
|
|
15
|
+
return [
|
|
16
|
+
key,
|
|
17
|
+
toSchemaV3({ schema, trail: trail.addSchemaRef(key), context })
|
|
18
|
+
];
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
export const toOptionalSchemasV3 = ({ schemas, trail, context }) => {
|
|
22
|
+
if (!schemas) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return toSchemasV3({ schemas, trail, context });
|
|
26
|
+
};
|
|
27
|
+
export const toSchemaV3 = ({ schema, trail, context }) => {
|
|
28
|
+
if (isRef(schema)) {
|
|
29
|
+
return toRefV31({ ref: schema, refType: 'schema', trail, context });
|
|
30
|
+
}
|
|
31
|
+
// Workaround for dodgy Reapit schema
|
|
32
|
+
if (schema.type !== 'array' &&
|
|
33
|
+
'optional' in schema &&
|
|
34
|
+
schema.optional === true) {
|
|
35
|
+
schema.nullable = true;
|
|
36
|
+
}
|
|
37
|
+
return match(schema)
|
|
38
|
+
.with({ oneOf: P.array() }, ({ oneOf: members, ...value }) => {
|
|
39
|
+
return toUnion({ value, members, trail, context });
|
|
40
|
+
})
|
|
41
|
+
.with({ anyOf: P.array() }, ({ anyOf: members, ...value }) => {
|
|
42
|
+
return toUnion({ value, members, trail, context });
|
|
43
|
+
})
|
|
44
|
+
.with({ allOf: P.array() }, ({ allOf: members, ...value }) => {
|
|
45
|
+
return toIntersection({ value, members, trail, context });
|
|
46
|
+
})
|
|
47
|
+
.with({ type: 'object' }, value => toObject({ value, trail, context }))
|
|
48
|
+
.with({ type: 'array' }, value => toArray({ value, trail, context }))
|
|
49
|
+
.with({ type: 'integer' }, value => toInteger({ value, trail, context }))
|
|
50
|
+
.with({ type: 'number' }, value => toNumber({ value, trail, context }))
|
|
51
|
+
.with({ type: 'boolean' }, value => toBoolean({ value, trail, context }))
|
|
52
|
+
.with({ type: 'string' }, value => toString({ value, trail, context }))
|
|
53
|
+
.otherwise(value => toUnknown({ value, trail, context }));
|
|
54
|
+
};
|
|
55
|
+
export const toOptionalSchemaV3 = ({ schema, trail, context }) => {
|
|
56
|
+
if (!schema) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
return toSchemaV3({ schema, trail, context });
|
|
60
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.OasString = void 0;
|
|
4
|
-
const OasBase_js_1 = require("../../oas-elements/OasBase.js");
|
|
5
|
-
class OasString extends OasBase_js_1.OasBase {
|
|
1
|
+
import { OasBase } from '../../oas-elements/OasBase.js';
|
|
2
|
+
export class OasString extends OasBase {
|
|
6
3
|
constructor({ fields, trail, skipped, context }) {
|
|
7
4
|
super({ trail, skipped, context });
|
|
8
5
|
Object.defineProperty(this, "oasType", {
|
|
@@ -53,4 +50,3 @@ class OasString extends OasBase_js_1.OasBase {
|
|
|
53
50
|
return this.fields.enums;
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
|
-
exports.OasString = OasString;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const oasStringData = z.object({
|
|
3
|
+
oasType: z.literal('schema'),
|
|
4
|
+
title: z.string().optional(),
|
|
5
|
+
description: z.string().optional(),
|
|
6
|
+
default: z.string().optional(),
|
|
7
|
+
type: z.literal('string'),
|
|
8
|
+
// Add soon
|
|
9
|
+
// maxLength: z.number().optional(),
|
|
10
|
+
// minLength: z.number().optional(),
|
|
11
|
+
pattern: z.string().optional(),
|
|
12
|
+
enums: z.array(z.string()).optional(),
|
|
13
|
+
format: z
|
|
14
|
+
.enum([
|
|
15
|
+
'date-time',
|
|
16
|
+
'time',
|
|
17
|
+
'date',
|
|
18
|
+
'duration',
|
|
19
|
+
'email',
|
|
20
|
+
'hostname',
|
|
21
|
+
'ipv4',
|
|
22
|
+
'ipv6',
|
|
23
|
+
'uuid',
|
|
24
|
+
'uri',
|
|
25
|
+
'regex',
|
|
26
|
+
'binary'
|
|
27
|
+
])
|
|
28
|
+
.optional()
|
|
29
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OasString } from './String.js';
|
|
2
|
+
export const toString = ({ value, trail, context }) => {
|
|
3
|
+
const { type: _type, title, description, enum: enums, nullable, ...skipped } = value;
|
|
4
|
+
const fields = {
|
|
5
|
+
title,
|
|
6
|
+
description,
|
|
7
|
+
enums,
|
|
8
|
+
nullable
|
|
9
|
+
};
|
|
10
|
+
return new OasString({ fields, trail, skipped, context });
|
|
11
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.OasTag = void 0;
|
|
4
|
-
const OasBase_js_1 = require("../../oas-elements/OasBase.js");
|
|
5
|
-
class OasTag extends OasBase_js_1.OasBase {
|
|
1
|
+
import { OasBase } from '../../oas-elements/OasBase.js';
|
|
2
|
+
export class OasTag extends OasBase {
|
|
6
3
|
constructor({ fields, trail, skipped, context }) {
|
|
7
4
|
super({ trail, skipped, context });
|
|
8
5
|
Object.defineProperty(this, "oasType", {
|
|
@@ -26,4 +23,3 @@ class OasTag extends OasBase_js_1.OasBase {
|
|
|
26
23
|
return this.fields.description;
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.OasTag = OasTag;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OasTag } from './Tag.js';
|
|
2
|
+
export const toTagsV3 = ({ tags, trail, context }) => {
|
|
3
|
+
if (!tags) {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
return tags.map(tag => {
|
|
7
|
+
const { name, description, ...skipped } = tag;
|
|
8
|
+
const fields = {
|
|
9
|
+
name,
|
|
10
|
+
description
|
|
11
|
+
};
|
|
12
|
+
return new OasTag({ fields, trail, context, skipped });
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.OasUnion = void 0;
|
|
4
|
-
const OasBase_js_1 = require("../../oas-elements/OasBase.js");
|
|
5
|
-
class OasUnion extends OasBase_js_1.OasBase {
|
|
1
|
+
import { OasBase } from '../../oas-elements/OasBase.js';
|
|
2
|
+
export class OasUnion extends OasBase {
|
|
6
3
|
constructor({ fields, trail, skipped, context }) {
|
|
7
4
|
super({ trail, skipped, context });
|
|
8
5
|
Object.defineProperty(this, "oasType", {
|
|
@@ -50,4 +47,3 @@ class OasUnion extends OasBase_js_1.OasBase {
|
|
|
50
47
|
return this;
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
|
-
exports.OasUnion = OasUnion;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OasUnion } from './Union.js';
|
|
2
|
+
import { toDiscriminatorV3 } from '../discriminator/toDiscriminatorV3.js';
|
|
3
|
+
import { toSchemaV3 } from '../schema/toSchemasV3.js';
|
|
4
|
+
export const toUnion = ({ value, members, trail, context }) => {
|
|
5
|
+
const { discriminator, title, description, nullable, ...skipped } = value;
|
|
6
|
+
const fields = {
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
nullable,
|
|
10
|
+
discriminator: toDiscriminatorV3({
|
|
11
|
+
discriminator,
|
|
12
|
+
trail: trail.add('oneOf').add('discriminator'),
|
|
13
|
+
context
|
|
14
|
+
}),
|
|
15
|
+
members: members.map((item, index) => toSchemaV3({
|
|
16
|
+
schema: item,
|
|
17
|
+
trail: trail.add('oneOf').add(`${index}`),
|
|
18
|
+
context
|
|
19
|
+
}))
|
|
20
|
+
};
|
|
21
|
+
return new OasUnion({ fields, trail, skipped, context });
|
|
22
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { oasSchemaData } from '../schema/schema-types.js';
|
|
3
|
+
import { oasSchemaRefData } from '../ref/ref-types.js';
|
|
4
|
+
import { oasDiscriminatorData } from '../discriminator/discriminator-types.js';
|
|
5
|
+
export const oasUnionData = z.object({
|
|
6
|
+
oasType: z.literal('schema'),
|
|
7
|
+
type: z.literal('union'),
|
|
8
|
+
title: z.string().optional(),
|
|
9
|
+
description: z.string().optional(),
|
|
10
|
+
members: z.lazy(() => z.array(z.union([oasSchemaData, oasSchemaRefData]))),
|
|
11
|
+
discriminator: oasDiscriminatorData.optional()
|
|
12
|
+
});
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.OasUnknown = void 0;
|
|
4
|
-
const OasBase_js_1 = require("../../oas-elements/OasBase.js");
|
|
5
|
-
class OasUnknown extends OasBase_js_1.OasBase {
|
|
1
|
+
import { OasBase } from '../../oas-elements/OasBase.js';
|
|
2
|
+
export class OasUnknown extends OasBase {
|
|
6
3
|
constructor({ fields, trail, skipped, context }) {
|
|
7
4
|
super({ trail, skipped, context });
|
|
8
5
|
Object.defineProperty(this, "oasType", {
|
|
@@ -41,4 +38,3 @@ class OasUnknown extends OasBase_js_1.OasBase {
|
|
|
41
38
|
return this;
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
exports.OasUnknown = OasUnknown;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OasUnknown } from './Unknown.js';
|
|
2
|
+
export const toUnknown = ({ value, trail, context }) => {
|
|
3
|
+
const { type: _type, title, description, ...skipped } = value;
|
|
4
|
+
const fields = {
|
|
5
|
+
title,
|
|
6
|
+
description
|
|
7
|
+
};
|
|
8
|
+
return new OasUnknown({ fields, trail, skipped, context });
|
|
9
|
+
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const OasBase_js_1 = require("../../oas-elements/OasBase.js");
|
|
5
|
-
const Trail_js_1 = require("../../context/Trail.js");
|
|
6
|
-
class OasVoid extends OasBase_js_1.OasBase {
|
|
1
|
+
import { OasBase } from '../../oas-elements/OasBase.js';
|
|
2
|
+
import { Trail } from '../../context/Trail.js';
|
|
3
|
+
export class OasVoid extends OasBase {
|
|
7
4
|
constructor({ fields, trail, skipped, context }) {
|
|
8
5
|
super({ trail, skipped, context });
|
|
9
6
|
Object.defineProperty(this, "oasType", {
|
|
@@ -29,7 +26,7 @@ class OasVoid extends OasBase_js_1.OasBase {
|
|
|
29
26
|
static empty(context) {
|
|
30
27
|
return new OasVoid({
|
|
31
28
|
fields: {},
|
|
32
|
-
trail: new
|
|
29
|
+
trail: new Trail(),
|
|
33
30
|
context,
|
|
34
31
|
skipped: {}
|
|
35
32
|
});
|
|
@@ -50,4 +47,3 @@ class OasVoid extends OasBase_js_1.OasBase {
|
|
|
50
47
|
return this;
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
|
-
exports.OasVoid = OasVoid;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OasBase = void 0;
|
|
4
|
-
class OasBase {
|
|
1
|
+
export class OasBase {
|
|
5
2
|
constructor({ trail, context, skipped }) {
|
|
6
3
|
Object.defineProperty(this, "trail", {
|
|
7
4
|
enumerable: true,
|
|
@@ -28,4 +25,3 @@ class OasBase {
|
|
|
28
25
|
});
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
|
-
exports.OasBase = OasBase;
|
package/esm/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { toDocumentV3 } from '../oas/document/toDocumentV3.js';
|
|
2
|
+
import { Trail } from '../context/Trail.js';
|
|
3
|
+
export const oasToSkmtc = (context) => {
|
|
4
|
+
const { parsedDocument } = context;
|
|
5
|
+
const trail = new Trail({
|
|
6
|
+
document: parsedDocument
|
|
7
|
+
});
|
|
8
|
+
if (!parsedDocument.openapi.startsWith('3.0.')) {
|
|
9
|
+
throw new Error('Only OpenAPI v3 is supported');
|
|
10
|
+
}
|
|
11
|
+
return toDocumentV3({
|
|
12
|
+
document: parsedDocument,
|
|
13
|
+
trail,
|
|
14
|
+
context
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require("../_dnt.polyfills.js");
|
|
4
|
-
exports.default = {
|
|
1
|
+
import "../_dnt.polyfills.js";
|
|
2
|
+
export default {
|
|
5
3
|
"$schema": "https://json-schema.org/draft-07/schema",
|
|
6
4
|
"$id": "https://schemas.skmtc.dev/client.json",
|
|
7
5
|
"title": "Settings",
|
|
@@ -1,49 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
1
|
+
import * as Sentry from '@sentry/deno';
|
|
2
|
+
import { Hono } from 'hono';
|
|
3
|
+
import { match } from 'ts-pattern';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { clientSettings as settingsSchema } from '../types/Settings.js';
|
|
6
|
+
import { generate, parseSchema } from '../generate/generate.js';
|
|
7
|
+
import { ParseContext } from '../context/ParseContext.js';
|
|
8
|
+
import { CoreContext } from '../context/CoreContext.js';
|
|
9
|
+
import { oasToSkmtc } from '../parse/parse.js';
|
|
10
|
+
const postSettingsBody = z.object({
|
|
11
|
+
schema: z.string(),
|
|
12
|
+
clientSettings: settingsSchema.optional()
|
|
17
13
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.createServer = void 0;
|
|
27
|
-
const Sentry = __importStar(require("@sentry/deno"));
|
|
28
|
-
const hono_1 = require("hono");
|
|
29
|
-
const ts_pattern_1 = require("ts-pattern");
|
|
30
|
-
const zod_1 = require("zod");
|
|
31
|
-
const Settings_js_1 = require("../types/Settings.js");
|
|
32
|
-
const generate_js_1 = require("../generate/generate.js");
|
|
33
|
-
const ParseContext_js_1 = require("../context/ParseContext.js");
|
|
34
|
-
const CoreContext_js_1 = require("../context/CoreContext.js");
|
|
35
|
-
const parse_js_1 = require("../parse/parse.js");
|
|
36
|
-
const postSettingsBody = zod_1.z.object({
|
|
37
|
-
schema: zod_1.z.string(),
|
|
38
|
-
clientSettings: Settings_js_1.clientSettings.optional()
|
|
39
|
-
});
|
|
40
|
-
const postGenerateBody = zod_1.z.object({
|
|
41
|
-
schema: zod_1.z.string(),
|
|
42
|
-
clientSettings: Settings_js_1.clientSettings.optional(),
|
|
43
|
-
prettier: zod_1.z.record(zod_1.z.unknown()).optional()
|
|
14
|
+
const postGenerateBody = z.object({
|
|
15
|
+
schema: z.string(),
|
|
16
|
+
clientSettings: settingsSchema.optional(),
|
|
17
|
+
prettier: z.record(z.unknown()).optional()
|
|
44
18
|
});
|
|
45
|
-
const createServer = (generators) => {
|
|
46
|
-
const app = new
|
|
19
|
+
export const createServer = (generators) => {
|
|
20
|
+
const app = new Hono();
|
|
47
21
|
app.post('/artifacts', async (c) => {
|
|
48
22
|
const result = await Sentry.startSpan({ name: 'POST /artifacts' }, async () => {
|
|
49
23
|
console.log('HEADERS ', c.req.header());
|
|
@@ -51,7 +25,7 @@ const createServer = (generators) => {
|
|
|
51
25
|
const { schema, clientSettings, prettier } = await Sentry.startSpan({ name: 'Validate request content' }, () => postGenerateBody.parseAsync(body));
|
|
52
26
|
return await Sentry.startSpan({ name: 'Generate' }, async () => {
|
|
53
27
|
const generatorsMap = Object.fromEntries(generators.map(generator => [generator.id, generator]));
|
|
54
|
-
return await
|
|
28
|
+
return await generate({
|
|
55
29
|
schema,
|
|
56
30
|
prettier,
|
|
57
31
|
settings: clientSettings,
|
|
@@ -72,7 +46,7 @@ const createServer = (generators) => {
|
|
|
72
46
|
const out = generators.map(generator => {
|
|
73
47
|
const generatorSettings = clientSettings?.generators?.find(({ id }) => id === generator.id);
|
|
74
48
|
const generatorType = generator.type;
|
|
75
|
-
return
|
|
49
|
+
return match(generatorType)
|
|
76
50
|
.with('operation', () => ({
|
|
77
51
|
...generatorSettings,
|
|
78
52
|
id: generator.id,
|
|
@@ -103,7 +77,6 @@ const createServer = (generators) => {
|
|
|
103
77
|
});
|
|
104
78
|
return app;
|
|
105
79
|
};
|
|
106
|
-
exports.createServer = createServer;
|
|
107
80
|
const toModels = ({ oasDocument, modelsSettings }) => {
|
|
108
81
|
return Object.fromEntries(Object.keys(oasDocument.components?.schemas ?? {}).map(refName => [
|
|
109
82
|
refName,
|
|
@@ -125,10 +98,10 @@ const toOperations = ({ generator, oasDocument, operationsSettings }) => {
|
|
|
125
98
|
}, {});
|
|
126
99
|
};
|
|
127
100
|
const toOasDocument = (schema) => {
|
|
128
|
-
const parsedDocument =
|
|
129
|
-
const parseContext = new
|
|
130
|
-
const context = new
|
|
101
|
+
const parsedDocument = parseSchema(schema);
|
|
102
|
+
const parseContext = new ParseContext({ parsedDocument });
|
|
103
|
+
const context = new CoreContext({
|
|
131
104
|
phase: { type: 'parse', context: parseContext }
|
|
132
105
|
});
|
|
133
|
-
return
|
|
106
|
+
return oasToSkmtc(context);
|
|
134
107
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isCustomValue = exports.CustomValue = void 0;
|
|
4
|
-
const ValueBase_js_1 = require("../dsl/ValueBase.js");
|
|
5
|
-
class CustomValue extends ValueBase_js_1.ValueBase {
|
|
1
|
+
import { ValueBase } from '../dsl/ValueBase.js';
|
|
2
|
+
export class CustomValue extends ValueBase {
|
|
6
3
|
constructor({ context, value, generatorKey }) {
|
|
7
4
|
super({ context, generatorKey });
|
|
8
5
|
Object.defineProperty(this, "type", {
|
|
@@ -23,11 +20,9 @@ class CustomValue extends ValueBase_js_1.ValueBase {
|
|
|
23
20
|
return `${this.value}`;
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
const isCustomValue = (value) => {
|
|
23
|
+
export const isCustomValue = (value) => {
|
|
28
24
|
return Boolean(value &&
|
|
29
25
|
typeof value === 'object' &&
|
|
30
26
|
'type' in value &&
|
|
31
27
|
value.type === 'custom');
|
|
32
28
|
};
|
|
33
|
-
exports.isCustomValue = isCustomValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* 'force' - will generate content even it is not selected.
|
|
4
3
|
* Use this option when generating code via a dependency.
|
|
@@ -13,4 +12,4 @@
|
|
|
13
12
|
* the value is accessed. This is useful when you want a quick way
|
|
14
13
|
* to access settings for a creator without generating the content.
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const toOperationGeneratorKey = ({ generatorId, ...rest }) => {
|
|
2
|
+
const { path, method } = 'operation' in rest ? rest.operation : rest;
|
|
3
|
+
const nakedKey = `${generatorId}|${path}|${method}`;
|
|
4
|
+
return nakedKey;
|
|
5
|
+
};
|
|
6
|
+
export const toModelGeneratorKey = ({ generatorId, refName }) => {
|
|
7
|
+
const nakedKey = `${generatorId}|${refName}`;
|
|
8
|
+
return nakedKey;
|
|
9
|
+
};
|
|
10
|
+
export const toGeneratorOnlyKey = ({ generatorId }) => {
|
|
11
|
+
const nakedKey = `${generatorId}`;
|
|
12
|
+
return nakedKey;
|
|
13
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const methodValues = [
|
|
3
|
+
'get',
|
|
4
|
+
'put',
|
|
5
|
+
'post',
|
|
6
|
+
'delete',
|
|
7
|
+
'options',
|
|
8
|
+
'head',
|
|
9
|
+
'patch',
|
|
10
|
+
'trace'
|
|
11
|
+
];
|
|
12
|
+
export const methodValuesNoTrace = [
|
|
13
|
+
'get',
|
|
14
|
+
'put',
|
|
15
|
+
'post',
|
|
16
|
+
'delete',
|
|
17
|
+
'options',
|
|
18
|
+
'head',
|
|
19
|
+
'patch'
|
|
20
|
+
];
|
|
21
|
+
export const method = z.enum([
|
|
22
|
+
'get',
|
|
23
|
+
'put',
|
|
24
|
+
'post',
|
|
25
|
+
'delete',
|
|
26
|
+
'options',
|
|
27
|
+
'head',
|
|
28
|
+
'patch',
|
|
29
|
+
'trace'
|
|
30
|
+
]);
|
|
31
|
+
export const methods = z.array(method);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "../_dnt.polyfills.js";
|
|
2
|
+
import { method } from './Method.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export const baseSettings = z.object({
|
|
5
|
+
selected: z.boolean(),
|
|
6
|
+
name: z.string().optional(),
|
|
7
|
+
importFrom: z.string().optional(),
|
|
8
|
+
exportPath: z.string().optional()
|
|
9
|
+
});
|
|
10
|
+
export const operationsGeneratorSettings = z.object({
|
|
11
|
+
id: z.string(),
|
|
12
|
+
exportPath: z.string().optional(),
|
|
13
|
+
description: z.string().optional(),
|
|
14
|
+
operations: z.record(z.record(method, baseSettings))
|
|
15
|
+
});
|
|
16
|
+
export const modelsGeneratorSettings = z.object({
|
|
17
|
+
id: z.string(),
|
|
18
|
+
exportPath: z.string().optional(),
|
|
19
|
+
description: z.string().optional(),
|
|
20
|
+
models: z.record(baseSettings)
|
|
21
|
+
});
|
|
22
|
+
export const clientGeneratorSettings = z.union([
|
|
23
|
+
operationsGeneratorSettings,
|
|
24
|
+
modelsGeneratorSettings
|
|
25
|
+
]);
|
|
26
|
+
export const clientSettings = z.object({
|
|
27
|
+
basePath: z.string().optional(),
|
|
28
|
+
alias: z.record(z.string()).optional(),
|
|
29
|
+
generators: z.array(clientGeneratorSettings)
|
|
30
|
+
});
|
|
31
|
+
export const skmtcClientConfig = z.object({
|
|
32
|
+
serverName: z.string().optional(),
|
|
33
|
+
stackName: z.string().optional(),
|
|
34
|
+
deploymentId: z.string().optional(),
|
|
35
|
+
settings: clientSettings
|
|
36
|
+
});
|
|
37
|
+
export const generatorType = z.enum(['operation', 'model']);
|
|
38
|
+
export const skmtcServerConfig = z.object({
|
|
39
|
+
name: z.string().optional(),
|
|
40
|
+
version: z.string().optional(),
|
|
41
|
+
generators: z.array(z.string())
|
|
42
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const prettierConfigType = z.object({
|
|
3
|
+
printWidth: z.number().optional(),
|
|
4
|
+
tabWidth: z.number().optional(),
|
|
5
|
+
useTabs: z.boolean().optional(),
|
|
6
|
+
semi: z.boolean().optional(),
|
|
7
|
+
singleQuote: z.boolean().optional(),
|
|
8
|
+
quoteProps: z
|
|
9
|
+
.union([
|
|
10
|
+
z.literal('as-needed'),
|
|
11
|
+
z.literal('consistent'),
|
|
12
|
+
z.literal('preserve')
|
|
13
|
+
])
|
|
14
|
+
.optional(),
|
|
15
|
+
jsxSingleQuote: z.boolean().optional(),
|
|
16
|
+
trailingComma: z
|
|
17
|
+
.union([z.literal('none'), z.literal('es5'), z.literal('all')])
|
|
18
|
+
.optional(),
|
|
19
|
+
bracketSameLine: z.boolean().optional(),
|
|
20
|
+
bracketSpacing: z.boolean().optional(),
|
|
21
|
+
jsxBracketSameLine: z.boolean().optional(),
|
|
22
|
+
arrowParens: z.union([z.literal('avoid'), z.literal('always')]).optional(),
|
|
23
|
+
rangeStart: z.number().optional(),
|
|
24
|
+
rangeEnd: z.number().optional(),
|
|
25
|
+
requirePragma: z.boolean().optional(),
|
|
26
|
+
insertPragma: z.boolean().optional(),
|
|
27
|
+
proseWrap: z
|
|
28
|
+
.union([z.literal('always'), z.literal('never'), z.literal('preserve')])
|
|
29
|
+
.optional(),
|
|
30
|
+
htmlWhitespaceSensitivity: z
|
|
31
|
+
.union([z.literal('css'), z.literal('strict'), z.literal('ignore')])
|
|
32
|
+
.optional(),
|
|
33
|
+
vueIndentScriptAndStyle: z.boolean().optional(),
|
|
34
|
+
endOfLine: z
|
|
35
|
+
.union([
|
|
36
|
+
z.literal('auto'),
|
|
37
|
+
z.literal('lf'),
|
|
38
|
+
z.literal('crlf'),
|
|
39
|
+
z.literal('cr')
|
|
40
|
+
])
|
|
41
|
+
.optional(),
|
|
42
|
+
embeddedLanguageFormatting: z
|
|
43
|
+
.union([z.literal('auto'), z.literal('off')])
|
|
44
|
+
.optional(),
|
|
45
|
+
singleAttributePerLine: z.boolean().optional()
|
|
46
|
+
});
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.EntityType = void 0;
|
|
4
|
-
const ts_pattern_1 = require("ts-pattern");
|
|
5
|
-
class EntityType {
|
|
1
|
+
import { match } from 'ts-pattern';
|
|
2
|
+
export class EntityType {
|
|
6
3
|
constructor(type) {
|
|
7
4
|
Object.defineProperty(this, "type", {
|
|
8
5
|
enumerable: true,
|
|
@@ -13,10 +10,9 @@ class EntityType {
|
|
|
13
10
|
this.type = type;
|
|
14
11
|
}
|
|
15
12
|
toString() {
|
|
16
|
-
return
|
|
13
|
+
return match(this.type)
|
|
17
14
|
.with('value', () => 'const')
|
|
18
15
|
.with('type', () => 'type')
|
|
19
16
|
.exhaustive();
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
exports.EntityType = EntityType;
|