@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,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
// https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
|
|
4
2
|
if (!Object.hasOwn) {
|
|
5
3
|
Object.defineProperty(Object, "hasOwn", {
|
|
@@ -14,3 +12,4 @@ if (!Object.hasOwn) {
|
|
|
14
12
|
writable: true,
|
|
15
13
|
});
|
|
16
14
|
}
|
|
15
|
+
export {};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.dntGlobalThis = exports.Deno = void 0;
|
|
4
|
-
const shim_deno_1 = require("@deno/shim-deno");
|
|
5
|
-
var shim_deno_2 = require("@deno/shim-deno");
|
|
6
|
-
Object.defineProperty(exports, "Deno", { enumerable: true, get: function () { return shim_deno_2.Deno; } });
|
|
1
|
+
import { Deno } from "@deno/shim-deno";
|
|
2
|
+
export { Deno } from "@deno/shim-deno";
|
|
7
3
|
const dntGlobals = {
|
|
8
|
-
Deno
|
|
4
|
+
Deno,
|
|
9
5
|
};
|
|
10
|
-
|
|
6
|
+
export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
11
7
|
function createMergeProxy(baseObj, extObj) {
|
|
12
8
|
return new Proxy(baseObj, {
|
|
13
9
|
get(_target, prop, _receiver) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const ts_pattern_1 = require("ts-pattern");
|
|
6
|
-
const RenderContext_js_1 = require("./RenderContext.js");
|
|
7
|
-
class CoreContext {
|
|
1
|
+
import { GenerateContext } from './GenerateContext.js';
|
|
2
|
+
import { match } from 'ts-pattern';
|
|
3
|
+
import { RenderContext } from './RenderContext.js';
|
|
4
|
+
export class CoreContext {
|
|
8
5
|
constructor({ phase }) {
|
|
9
6
|
Object.defineProperty(this, "phase", {
|
|
10
7
|
enumerable: true,
|
|
@@ -15,7 +12,7 @@ class CoreContext {
|
|
|
15
12
|
this.phase = phase;
|
|
16
13
|
}
|
|
17
14
|
setupGeneratePhase({ schemaModel, settings, generatorsMap }) {
|
|
18
|
-
const generateContext = new
|
|
15
|
+
const generateContext = new GenerateContext({
|
|
19
16
|
schemaModel,
|
|
20
17
|
settings,
|
|
21
18
|
generatorsMap
|
|
@@ -24,7 +21,7 @@ class CoreContext {
|
|
|
24
21
|
}
|
|
25
22
|
setupRenderPhase({ files, prettier, packageDependencies, settings, renderDependencies, pinnableGenerators }) {
|
|
26
23
|
console.log('Render dependencies: ', renderDependencies);
|
|
27
|
-
const renderContext = new
|
|
24
|
+
const renderContext = new RenderContext({
|
|
28
25
|
files,
|
|
29
26
|
renderDependencies,
|
|
30
27
|
packageDependencies,
|
|
@@ -35,7 +32,7 @@ class CoreContext {
|
|
|
35
32
|
this.phase = { type: 'render', context: renderContext };
|
|
36
33
|
}
|
|
37
34
|
register({ destinationPath, ...args }) {
|
|
38
|
-
return
|
|
35
|
+
return match(this.phase)
|
|
39
36
|
.with({ type: 'generate' }, ({ context }) => {
|
|
40
37
|
return context.register({ destinationPath, ...args });
|
|
41
38
|
})
|
|
@@ -48,7 +45,7 @@ class CoreContext {
|
|
|
48
45
|
.exhaustive();
|
|
49
46
|
}
|
|
50
47
|
addGeneratorKey({ generatorKey }) {
|
|
51
|
-
return
|
|
48
|
+
return match(this.phase)
|
|
52
49
|
.with({ type: 'generate' }, () => {
|
|
53
50
|
console.log('trying to add generator key during generate phase');
|
|
54
51
|
})
|
|
@@ -61,7 +58,7 @@ class CoreContext {
|
|
|
61
58
|
.exhaustive();
|
|
62
59
|
}
|
|
63
60
|
resolveSchemaRefOnce(refName) {
|
|
64
|
-
return
|
|
61
|
+
return match(this.phase)
|
|
65
62
|
.with({ type: 'generate' }, ({ context }) => {
|
|
66
63
|
return context.resolveSchemaRefOnce(refName);
|
|
67
64
|
})
|
|
@@ -74,7 +71,7 @@ class CoreContext {
|
|
|
74
71
|
.exhaustive();
|
|
75
72
|
}
|
|
76
73
|
addRenderDependency(args) {
|
|
77
|
-
return
|
|
74
|
+
return match(this.phase)
|
|
78
75
|
.with({ type: 'generate' }, ({ context }) => {
|
|
79
76
|
return context.addRenderDependency(args);
|
|
80
77
|
})
|
|
@@ -87,7 +84,7 @@ class CoreContext {
|
|
|
87
84
|
.exhaustive();
|
|
88
85
|
}
|
|
89
86
|
getFile(filePath) {
|
|
90
|
-
return
|
|
87
|
+
return match(this.phase)
|
|
91
88
|
.with({ type: 'generate' }, ({ context }) => {
|
|
92
89
|
return context.getFile(filePath);
|
|
93
90
|
})
|
|
@@ -100,7 +97,7 @@ class CoreContext {
|
|
|
100
97
|
.exhaustive();
|
|
101
98
|
}
|
|
102
99
|
pick(args) {
|
|
103
|
-
return
|
|
100
|
+
return match(this.phase)
|
|
104
101
|
.with({ type: 'generate' }, ({ context }) => context.pick(args))
|
|
105
102
|
.with({ type: 'parse' }, () => {
|
|
106
103
|
throw new Error(`Cannot pick during parse phase`);
|
|
@@ -109,7 +106,7 @@ class CoreContext {
|
|
|
109
106
|
.exhaustive();
|
|
110
107
|
}
|
|
111
108
|
async render(options) {
|
|
112
|
-
return await
|
|
109
|
+
return await match(this.phase)
|
|
113
110
|
.with({ type: 'generate' }, () => {
|
|
114
111
|
throw new Error(`Cannot render during generate phase`);
|
|
115
112
|
})
|
|
@@ -120,7 +117,7 @@ class CoreContext {
|
|
|
120
117
|
.exhaustive();
|
|
121
118
|
}
|
|
122
119
|
addFile(normalisedPath) {
|
|
123
|
-
return
|
|
120
|
+
return match(this.phase)
|
|
124
121
|
.with({ type: 'generate' }, ({ context }) => {
|
|
125
122
|
return context.addFile(normalisedPath);
|
|
126
123
|
})
|
|
@@ -133,7 +130,7 @@ class CoreContext {
|
|
|
133
130
|
.exhaustive();
|
|
134
131
|
}
|
|
135
132
|
getOperationBaseSettings(args) {
|
|
136
|
-
return
|
|
133
|
+
return match(this.phase)
|
|
137
134
|
.with({ type: 'generate' }, ({ context }) => {
|
|
138
135
|
return context.getOperationBaseSettings(args);
|
|
139
136
|
})
|
|
@@ -146,7 +143,7 @@ class CoreContext {
|
|
|
146
143
|
.exhaustive();
|
|
147
144
|
}
|
|
148
145
|
transform(args) {
|
|
149
|
-
return
|
|
146
|
+
return match(this.phase)
|
|
150
147
|
.with({ type: 'generate' }, ({ context }) => {
|
|
151
148
|
return context.transform({ ...args, coreContext: this });
|
|
152
149
|
})
|
|
@@ -159,7 +156,7 @@ class CoreContext {
|
|
|
159
156
|
.exhaustive();
|
|
160
157
|
}
|
|
161
158
|
getModelBaseSettings(args) {
|
|
162
|
-
return
|
|
159
|
+
return match(this.phase)
|
|
163
160
|
.with({ type: 'generate' }, ({ context }) => {
|
|
164
161
|
return context.getModelBaseSettings(args);
|
|
165
162
|
})
|
|
@@ -172,7 +169,7 @@ class CoreContext {
|
|
|
172
169
|
.exhaustive();
|
|
173
170
|
}
|
|
174
171
|
get files() {
|
|
175
|
-
return
|
|
172
|
+
return match(this.phase)
|
|
176
173
|
.with({ type: 'generate' }, ({ context }) => context.files)
|
|
177
174
|
.with({ type: 'parse' }, () => {
|
|
178
175
|
throw new Error(`Cannot access files during parse phase`);
|
|
@@ -181,7 +178,7 @@ class CoreContext {
|
|
|
181
178
|
.exhaustive();
|
|
182
179
|
}
|
|
183
180
|
get renderDependencies() {
|
|
184
|
-
return
|
|
181
|
+
return match(this.phase)
|
|
185
182
|
.with({ type: 'generate' }, ({ context }) => context.renderDependencies)
|
|
186
183
|
.with({ type: 'parse' }, () => {
|
|
187
184
|
throw new Error(`Cannot access files during parse phase`);
|
|
@@ -190,7 +187,7 @@ class CoreContext {
|
|
|
190
187
|
.exhaustive();
|
|
191
188
|
}
|
|
192
189
|
get packageDependencies() {
|
|
193
|
-
return
|
|
190
|
+
return match(this.phase)
|
|
194
191
|
.with({ type: 'generate' }, ({ context }) => context.packageDependencies)
|
|
195
192
|
.with({ type: 'parse' }, () => {
|
|
196
193
|
throw new Error(`Cannot access package dependencies during parse phase`);
|
|
@@ -199,7 +196,7 @@ class CoreContext {
|
|
|
199
196
|
.exhaustive();
|
|
200
197
|
}
|
|
201
198
|
get schemaModel() {
|
|
202
|
-
return
|
|
199
|
+
return match(this.phase)
|
|
203
200
|
.with({ type: 'generate' }, ({ context }) => context.schemaModel)
|
|
204
201
|
.with({ type: 'parse' }, () => {
|
|
205
202
|
throw new Error(`Cannot access schema model during parse phase`);
|
|
@@ -210,7 +207,7 @@ class CoreContext {
|
|
|
210
207
|
.exhaustive();
|
|
211
208
|
}
|
|
212
209
|
get generatorsMap() {
|
|
213
|
-
return
|
|
210
|
+
return match(this.phase)
|
|
214
211
|
.with({ type: 'generate' }, ({ context }) => context.generatorsMap)
|
|
215
212
|
.with({ type: 'parse' }, () => {
|
|
216
213
|
throw new Error(`Cannot access schema model during parse phase`);
|
|
@@ -221,7 +218,7 @@ class CoreContext {
|
|
|
221
218
|
.exhaustive();
|
|
222
219
|
}
|
|
223
220
|
get parsedDocument() {
|
|
224
|
-
return
|
|
221
|
+
return match(this.phase)
|
|
225
222
|
.with({ type: 'parse' }, ({ context }) => context.parsedDocument)
|
|
226
223
|
.with({ type: 'generate' }, () => {
|
|
227
224
|
throw new Error(`Cannot access parsed document during generate phase`);
|
|
@@ -232,7 +229,7 @@ class CoreContext {
|
|
|
232
229
|
.exhaustive();
|
|
233
230
|
}
|
|
234
231
|
get settings() {
|
|
235
|
-
return
|
|
232
|
+
return match(this.phase)
|
|
236
233
|
.with({ type: 'generate' }, ({ context }) => context.settings)
|
|
237
234
|
.with({ type: 'parse' }, () => {
|
|
238
235
|
throw new Error(`Cannot access settings during parse phase`);
|
|
@@ -243,4 +240,3 @@ class CoreContext {
|
|
|
243
240
|
.exhaustive();
|
|
244
241
|
}
|
|
245
242
|
}
|
|
246
|
-
exports.CoreContext = CoreContext;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const OperationDriver_js_1 = require("../dsl/OperationDriver.js");
|
|
8
|
-
const ModelDriver_js_1 = require("../dsl/ModelDriver.js");
|
|
9
|
-
class GenerateContext {
|
|
1
|
+
import { join, normalize } from '../deps/jsr.io/@std/path/1.0.0/mod.js';
|
|
2
|
+
import { Import } from '../dsl/Import.js';
|
|
3
|
+
import { toOperationGeneratorKey } from '../types/GeneratorKeys.js';
|
|
4
|
+
import { OperationDriver } from '../dsl/OperationDriver.js';
|
|
5
|
+
import { ModelDriver } from '../dsl/ModelDriver.js';
|
|
6
|
+
export class GenerateContext {
|
|
10
7
|
constructor({ schemaModel, generatorsMap, settings }) {
|
|
11
8
|
Object.defineProperty(this, "files", {
|
|
12
9
|
enumerable: true,
|
|
@@ -52,7 +49,7 @@ class GenerateContext {
|
|
|
52
49
|
this.settings = settings;
|
|
53
50
|
}
|
|
54
51
|
getFile(filePath, { throwIfNotFound = false } = {}) {
|
|
55
|
-
const normalisedPath =
|
|
52
|
+
const normalisedPath = normalize(filePath);
|
|
56
53
|
const currentFile = this.files.get(normalisedPath);
|
|
57
54
|
if (!currentFile) {
|
|
58
55
|
if (throwIfNotFound) {
|
|
@@ -68,7 +65,7 @@ class GenerateContext {
|
|
|
68
65
|
const currentFile = this.getFile(destinationPath);
|
|
69
66
|
Object.entries(imports).forEach(([importModule, importNames]) => {
|
|
70
67
|
const module = currentFile.imports.get(importModule);
|
|
71
|
-
const importItem = new
|
|
68
|
+
const importItem = new Import({ module: importModule, importNames });
|
|
72
69
|
if (module) {
|
|
73
70
|
importItem.importNames.forEach(n => module.add(`${n}`));
|
|
74
71
|
}
|
|
@@ -88,7 +85,7 @@ class GenerateContext {
|
|
|
88
85
|
transform({ coreContext, generation, destinationPath, ...rest }) {
|
|
89
86
|
if ('operation' in rest) {
|
|
90
87
|
const { creator, operation } = rest;
|
|
91
|
-
const { settings, definition } = new
|
|
88
|
+
const { settings, definition } = new OperationDriver({
|
|
92
89
|
context: coreContext,
|
|
93
90
|
creator,
|
|
94
91
|
operation,
|
|
@@ -99,7 +96,7 @@ class GenerateContext {
|
|
|
99
96
|
}
|
|
100
97
|
else {
|
|
101
98
|
const { creator, refName } = rest;
|
|
102
|
-
const { settings, definition } = new
|
|
99
|
+
const { settings, definition } = new ModelDriver({
|
|
103
100
|
context: coreContext,
|
|
104
101
|
creator,
|
|
105
102
|
refName,
|
|
@@ -115,7 +112,7 @@ class GenerateContext {
|
|
|
115
112
|
? generatorSettings.operations?.[path]?.[method]
|
|
116
113
|
: undefined;
|
|
117
114
|
const exportPath = operationSettings?.exportPath
|
|
118
|
-
?
|
|
115
|
+
? join(generatorSettings?.exportPath ?? '', operationSettings?.exportPath)
|
|
119
116
|
: undefined;
|
|
120
117
|
const baseSettings = {
|
|
121
118
|
exportPath,
|
|
@@ -131,7 +128,7 @@ class GenerateContext {
|
|
|
131
128
|
? generatorSettings?.models?.[refName]
|
|
132
129
|
: undefined;
|
|
133
130
|
const exportPath = modelSettings?.exportPath
|
|
134
|
-
?
|
|
131
|
+
? join(generatorSettings?.exportPath ?? '', modelSettings?.exportPath)
|
|
135
132
|
: undefined;
|
|
136
133
|
const baseSettings = {
|
|
137
134
|
exportPath,
|
|
@@ -166,7 +163,7 @@ class GenerateContext {
|
|
|
166
163
|
}
|
|
167
164
|
const generatorDependencies = this.renderDependencies.get(generatorId);
|
|
168
165
|
dependencies.forEach(dependencyId => {
|
|
169
|
-
generatorDependencies?.add(
|
|
166
|
+
generatorDependencies?.add(toOperationGeneratorKey({ generatorId: dependencyId, operation }));
|
|
170
167
|
});
|
|
171
168
|
}
|
|
172
169
|
/** Produce external instance and return its name */
|
|
@@ -174,4 +171,3 @@ class GenerateContext {
|
|
|
174
171
|
return this.getFile(exportPath).definitions.get(name);
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
|
-
exports.GenerateContext = GenerateContext;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogStore = void 0;
|
|
4
1
|
const LOG_LEVELS = {
|
|
5
2
|
info: 1,
|
|
6
3
|
warn: 3,
|
|
7
4
|
error: 5
|
|
8
5
|
};
|
|
9
|
-
class LogStore {
|
|
6
|
+
export class LogStore {
|
|
10
7
|
constructor() {
|
|
11
8
|
Object.defineProperty(this, "logs", {
|
|
12
9
|
enumerable: true,
|
|
@@ -54,4 +51,3 @@ class LogStore {
|
|
|
54
51
|
};
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
|
-
exports.LogStore = LogStore;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ParseContext = void 0;
|
|
4
|
-
class ParseContext {
|
|
1
|
+
export class ParseContext {
|
|
5
2
|
constructor({ parsedDocument }) {
|
|
6
3
|
Object.defineProperty(this, "parsedDocument", {
|
|
7
4
|
enumerable: true,
|
|
@@ -19,4 +16,3 @@ class ParseContext {
|
|
|
19
16
|
this.refDiffs = [];
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
|
-
exports.ParseContext = ParseContext;
|
|
@@ -1,41 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
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;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.RenderContext = void 0;
|
|
30
|
-
const mod_js_1 = require("../deps/jsr.io/@std/encoding/1.0.1/mod.js");
|
|
31
|
-
const Import_js_1 = require("../dsl/Import.js");
|
|
32
|
-
const standalone_1 = require("prettier/standalone");
|
|
33
|
-
const typescript_1 = __importDefault(require("prettier/plugins/typescript"));
|
|
34
|
-
const estree_1 = __importDefault(require("prettier/plugins/estree"));
|
|
35
|
-
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));
|
|
36
|
-
const mod_js_2 = require("../deps/jsr.io/@std/path/1.0.0/mod.js");
|
|
37
|
-
const Sentry = __importStar(require("@sentry/deno"));
|
|
38
|
-
class RenderContext {
|
|
1
|
+
import { encodeHex } from '../deps/jsr.io/@std/encoding/1.0.1/mod.js';
|
|
2
|
+
import { Import } from '../dsl/Import.js';
|
|
3
|
+
import { format } from 'prettier/standalone';
|
|
4
|
+
import typescript from 'prettier/plugins/typescript';
|
|
5
|
+
import estree from 'prettier/plugins/estree';
|
|
6
|
+
import invariant from 'tiny-invariant';
|
|
7
|
+
import { join, normalize } from '../deps/jsr.io/@std/path/1.0.0/mod.js';
|
|
8
|
+
import * as Sentry from '@sentry/deno';
|
|
9
|
+
export class RenderContext {
|
|
39
10
|
constructor({ files, packageDependencies, prettier, settings, renderDependencies, pinnableGenerators }) {
|
|
40
11
|
Object.defineProperty(this, "files", {
|
|
41
12
|
enumerable: true,
|
|
@@ -179,14 +150,14 @@ class RenderContext {
|
|
|
179
150
|
});
|
|
180
151
|
}
|
|
181
152
|
getFile(filePath) {
|
|
182
|
-
const normalisedPath =
|
|
153
|
+
const normalisedPath = normalize(filePath);
|
|
183
154
|
const currentFile = this.files.get(normalisedPath);
|
|
184
|
-
(
|
|
155
|
+
invariant(currentFile, `File not found during render phase: ${normalisedPath}`);
|
|
185
156
|
return currentFile;
|
|
186
157
|
}
|
|
187
158
|
addGeneratorKey({ generatorKey }) {
|
|
188
159
|
const path = this.currentDestinationPath;
|
|
189
|
-
(
|
|
160
|
+
invariant(!['PRE_RENDER', 'POST_RENDER'].includes(path), `Cannot add generator key during ${path} phase`);
|
|
190
161
|
const currentFile = this.getFile(path);
|
|
191
162
|
currentFile.generatorKeys.add(generatorKey);
|
|
192
163
|
}
|
|
@@ -194,14 +165,13 @@ class RenderContext {
|
|
|
194
165
|
return this.getFile(exportPath).definitions.get(name);
|
|
195
166
|
}
|
|
196
167
|
}
|
|
197
|
-
exports.RenderContext = RenderContext;
|
|
198
168
|
const toHash = async (content) => {
|
|
199
169
|
const messageBuffer = new TextEncoder().encode(content);
|
|
200
170
|
const hashBuffer = await crypto.subtle.digest('SHA-256', messageBuffer);
|
|
201
|
-
return
|
|
171
|
+
return encodeHex(hashBuffer);
|
|
202
172
|
};
|
|
203
173
|
const renderFile = ({ file, destination, basePath }) => {
|
|
204
|
-
const imports = Array.from(file.imports.entries()).map(([module, importItems]) => new
|
|
174
|
+
const imports = Array.from(file.imports.entries()).map(([module, importItems]) => new Import({ module, importNames: Array.from(importItems) }));
|
|
205
175
|
const definitions = Array.from(file.definitions.values());
|
|
206
176
|
const content = [imports, definitions]
|
|
207
177
|
.filter(section => Boolean(section.length))
|
|
@@ -209,7 +179,7 @@ const renderFile = ({ file, destination, basePath }) => {
|
|
|
209
179
|
.join('\n\n');
|
|
210
180
|
return {
|
|
211
181
|
content,
|
|
212
|
-
path:
|
|
182
|
+
path: join(basePath ?? 'dist', destination.replace(/^@\//, '')),
|
|
213
183
|
numberOfLines: content.split('\n').length,
|
|
214
184
|
numberOfCharacters: content.length,
|
|
215
185
|
generatorKeys: Array.from(file.generatorKeys).filter(Boolean) // @TODO Fix null keys
|
|
@@ -219,9 +189,9 @@ const formatContent = async ({ content, prettier }) => {
|
|
|
219
189
|
if (!prettier) {
|
|
220
190
|
return content;
|
|
221
191
|
}
|
|
222
|
-
return await
|
|
192
|
+
return await format(content, {
|
|
223
193
|
parser: 'typescript',
|
|
224
|
-
plugins: [
|
|
194
|
+
plugins: [estree, typescript],
|
|
225
195
|
...prettier
|
|
226
196
|
});
|
|
227
197
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Trail = void 0;
|
|
4
|
-
class Trail {
|
|
1
|
+
export class Trail {
|
|
5
2
|
constructor({ path = [], apiPath, method, schemaRef, document, subMethodIndex } = {}) {
|
|
6
3
|
Object.defineProperty(this, "path", {
|
|
7
4
|
enumerable: true,
|
|
@@ -105,4 +102,3 @@ class Trail {
|
|
|
105
102
|
}, '');
|
|
106
103
|
}
|
|
107
104
|
}
|
|
108
|
-
exports.Trail = Trail;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.validateBinaryLike = validateBinaryLike;
|
|
5
2
|
const encoder = new TextEncoder();
|
|
6
3
|
function getTypeName(value) {
|
|
7
4
|
const type = typeof value;
|
|
@@ -15,7 +12,7 @@ function getTypeName(value) {
|
|
|
15
12
|
return value?.constructor?.name ?? "object";
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
function validateBinaryLike(source) {
|
|
15
|
+
export function validateBinaryLike(source) {
|
|
19
16
|
if (typeof source === "string") {
|
|
20
17
|
return encoder.encode(source);
|
|
21
18
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.encodeAscii85 = encodeAscii85;
|
|
6
|
-
exports.decodeAscii85 = decodeAscii85;
|
|
7
3
|
/**
|
|
8
4
|
* Utilities for working with {@link https://en.wikipedia.org/wiki/Ascii85 | ascii85} encoding.
|
|
9
5
|
*
|
|
@@ -23,7 +19,7 @@ exports.decodeAscii85 = decodeAscii85;
|
|
|
23
19
|
*
|
|
24
20
|
* @module
|
|
25
21
|
*/
|
|
26
|
-
|
|
22
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
27
23
|
const rfc1924 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~";
|
|
28
24
|
const Z85 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#";
|
|
29
25
|
/**
|
|
@@ -42,8 +38,8 @@ const Z85 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=
|
|
|
42
38
|
* assertEquals(encodeAscii85("Hello world!"), "87cURD]j7BEbo80");
|
|
43
39
|
* ```
|
|
44
40
|
*/
|
|
45
|
-
function encodeAscii85(data, options = {}) {
|
|
46
|
-
let uint8 =
|
|
41
|
+
export function encodeAscii85(data, options = {}) {
|
|
42
|
+
let uint8 = validateBinaryLike(data);
|
|
47
43
|
const { standard = "Adobe" } = options;
|
|
48
44
|
let output = [];
|
|
49
45
|
let v;
|
|
@@ -116,7 +112,7 @@ function encodeAscii85(data, options = {}) {
|
|
|
116
112
|
* );
|
|
117
113
|
* ```
|
|
118
114
|
*/
|
|
119
|
-
function decodeAscii85(ascii85, options = {}) {
|
|
115
|
+
export function decodeAscii85(ascii85, options = {}) {
|
|
120
116
|
const { standard = "Adobe" } = options;
|
|
121
117
|
// translate all encodings to most basic adobe/btoa one and decompress some special characters ("z" and "y")
|
|
122
118
|
switch (standard) {
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// Copyright (c) 2014 Jameson Little. MIT License.
|
|
4
3
|
// This module is browser compatible.
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.decodeBase32 = decodeBase32;
|
|
7
|
-
exports.encodeBase32 = encodeBase32;
|
|
8
4
|
/**
|
|
9
5
|
* Utilities for
|
|
10
6
|
* {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-6 | base32}
|
|
@@ -26,7 +22,7 @@ exports.encodeBase32 = encodeBase32;
|
|
|
26
22
|
*
|
|
27
23
|
* @module
|
|
28
24
|
*/
|
|
29
|
-
|
|
25
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
30
26
|
const lookup = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split("");
|
|
31
27
|
const revLookup = [];
|
|
32
28
|
lookup.forEach((c, i) => revLookup[c.charCodeAt(0)] = i);
|
|
@@ -71,7 +67,7 @@ function getByteLength(validLen, placeHoldersLen) {
|
|
|
71
67
|
* );
|
|
72
68
|
* ```
|
|
73
69
|
*/
|
|
74
|
-
function decodeBase32(b32) {
|
|
70
|
+
export function decodeBase32(b32) {
|
|
75
71
|
let tmp;
|
|
76
72
|
const [validLen, placeHoldersLen] = getLens(b32);
|
|
77
73
|
const arr = new Uint8Array(getByteLength(validLen, placeHoldersLen));
|
|
@@ -171,8 +167,8 @@ function encodeChunk(uint8, start, end) {
|
|
|
171
167
|
* assertEquals(encodeBase32("6c60c0"), "GZRTMMDDGA======");
|
|
172
168
|
* ```
|
|
173
169
|
*/
|
|
174
|
-
function encodeBase32(data) {
|
|
175
|
-
const uint8 =
|
|
170
|
+
export function encodeBase32(data) {
|
|
171
|
+
const uint8 = validateBinaryLike(data);
|
|
176
172
|
let tmp;
|
|
177
173
|
const len = uint8.length;
|
|
178
174
|
const extraBytes = len % 5;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.encodeBase58 = encodeBase58;
|
|
6
|
-
exports.decodeBase58 = decodeBase58;
|
|
7
3
|
/**
|
|
8
4
|
* Utilities for
|
|
9
5
|
* {@link https://datatracker.ietf.org/doc/html/draft-msporny-base58-03 | base58}
|
|
@@ -22,7 +18,7 @@ exports.decodeBase58 = decodeBase58;
|
|
|
22
18
|
*
|
|
23
19
|
* @module
|
|
24
20
|
*/
|
|
25
|
-
|
|
21
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
26
22
|
// deno-fmt-ignore
|
|
27
23
|
const mapBase58 = {
|
|
28
24
|
"1": 0, "2": 1, "3": 2, "4": 3, "5": 4, "6": 5, "7": 6, "8": 7, "9": 8, A: 9,
|
|
@@ -49,8 +45,8 @@ const base58alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwx
|
|
|
49
45
|
* assertEquals(encodeBase58("Hello World!"), "2NEpo7TZRRrLZSi2U");
|
|
50
46
|
* ```
|
|
51
47
|
*/
|
|
52
|
-
function encodeBase58(data) {
|
|
53
|
-
const uint8tData =
|
|
48
|
+
export function encodeBase58(data) {
|
|
49
|
+
const uint8tData = validateBinaryLike(data);
|
|
54
50
|
let length = 0;
|
|
55
51
|
let zeroes = 0;
|
|
56
52
|
// Counting leading zeroes
|
|
@@ -100,7 +96,7 @@ function encodeBase58(data) {
|
|
|
100
96
|
* );
|
|
101
97
|
* ```
|
|
102
98
|
*/
|
|
103
|
-
function decodeBase58(b58) {
|
|
99
|
+
export function decodeBase58(b58) {
|
|
104
100
|
const splitInput = b58.trim().split("");
|
|
105
101
|
let length = 0;
|
|
106
102
|
let ones = 0;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
3
2
|
// This module is browser compatible.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.encodeBase64 = encodeBase64;
|
|
6
|
-
exports.decodeBase64 = decodeBase64;
|
|
7
3
|
/**
|
|
8
4
|
* Utilities for
|
|
9
5
|
* {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4 | base64}
|
|
@@ -24,7 +20,7 @@ exports.decodeBase64 = decodeBase64;
|
|
|
24
20
|
*
|
|
25
21
|
* @module
|
|
26
22
|
*/
|
|
27
|
-
|
|
23
|
+
import { validateBinaryLike } from "./_validate_binary_like.js";
|
|
28
24
|
const base64abc = [
|
|
29
25
|
"A",
|
|
30
26
|
"B",
|
|
@@ -107,9 +103,9 @@ const base64abc = [
|
|
|
107
103
|
* assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
|
|
108
104
|
* ```
|
|
109
105
|
*/
|
|
110
|
-
function encodeBase64(data) {
|
|
106
|
+
export function encodeBase64(data) {
|
|
111
107
|
// CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
|
112
|
-
const uint8 =
|
|
108
|
+
const uint8 = validateBinaryLike(data);
|
|
113
109
|
let result = "";
|
|
114
110
|
let i;
|
|
115
111
|
const l = uint8.length;
|
|
@@ -156,7 +152,7 @@ function encodeBase64(data) {
|
|
|
156
152
|
* );
|
|
157
153
|
* ```
|
|
158
154
|
*/
|
|
159
|
-
function decodeBase64(b64) {
|
|
155
|
+
export function decodeBase64(b64) {
|
|
160
156
|
const binString = atob(b64);
|
|
161
157
|
const size = binString.length;
|
|
162
158
|
const bytes = new Uint8Array(size);
|