@goast/typescript 0.4.3 → 0.4.4
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/LICENSE +21 -21
- package/README.md +52 -52
- package/assets/client/angular/angular-service.utils.ts +82 -82
- package/assets/client/angular/request-builder.ts +377 -377
- package/assets/client/fetch/fetch-client.utils.ts +52 -52
- package/assets/client/k6/request-builder.js +418 -418
- package/assets/stubs/easy-network-stub/easy-network-stub.utils.ts +259 -259
- package/esm/_dnt.test_polyfills.d.ts +29 -0
- package/esm/_dnt.test_polyfills.d.ts.map +1 -0
- package/esm/_dnt.test_polyfills.js +31 -0
- package/esm/_dnt.test_shims.d.ts +6 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/_dnt.test_shims.js +61 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +30 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/equal.d.ts +17 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/equal.js +183 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/equals.d.ts +35 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/equals.js +58 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/false.js +22 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +25 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.js +54 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +20 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +29 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +18 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +26 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +23 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +32 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +42 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.js +53 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +24 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +57 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +20 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +14 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +43 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +17 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +26 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_assertions.js +13 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +46 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +161 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +6 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_build_message.js +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_equal.js +191 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_extend.js +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +12 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +34 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_matchers.js +714 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +11 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_serializer.js +10 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +843 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_types.js +3 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +9 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/_utils.js +218 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +60 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/expect.js +523 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +29 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/fn.js +85 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +86 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/expect/1.0.12/mod.js +88 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +199 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.js +111 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.js +277 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.js +180 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.js +37 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.js +207 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.js +2 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_mock_utils.d.ts +15 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_mock_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_mock_utils.js +35 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +79 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +380 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +738 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/bdd.js +654 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/mock.d.ts +674 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/mock.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/testing/1.0.9/mock.js +1083 -0
- package/esm/src/assets.js +1 -1
- package/esm/src/ast/nodes/argument.test.d.ts +2 -0
- package/esm/src/ast/nodes/argument.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/argument.test.js +34 -0
- package/esm/src/ast/nodes/array-type.test.d.ts +2 -0
- package/esm/src/ast/nodes/array-type.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/array-type.test.js +26 -0
- package/esm/src/ast/nodes/arrow-function.test.d.ts +2 -0
- package/esm/src/ast/nodes/arrow-function.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/arrow-function.test.js +62 -0
- package/esm/src/ast/nodes/class.test.d.ts +2 -0
- package/esm/src/ast/nodes/class.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/class.test.js +150 -0
- package/esm/src/ast/nodes/constructor-parameter.test.d.ts +2 -0
- package/esm/src/ast/nodes/constructor-parameter.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/constructor-parameter.test.js +99 -0
- package/esm/src/ast/nodes/constructor.test.d.ts +2 -0
- package/esm/src/ast/nodes/constructor.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/constructor.test.js +102 -0
- package/esm/src/ast/nodes/decorator.test.d.ts +2 -0
- package/esm/src/ast/nodes/decorator.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/decorator.test.js +47 -0
- package/esm/src/ast/nodes/doc-tag.test.d.ts +2 -0
- package/esm/src/ast/nodes/doc-tag.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/doc-tag.test.js +30 -0
- package/esm/src/ast/nodes/doc.test.d.ts +2 -0
- package/esm/src/ast/nodes/doc.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/doc.test.js +31 -0
- package/esm/src/ast/nodes/enum-value.test.d.ts +2 -0
- package/esm/src/ast/nodes/enum-value.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/enum-value.test.js +52 -0
- package/esm/src/ast/nodes/enum.test.d.ts +2 -0
- package/esm/src/ast/nodes/enum.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/enum.test.js +66 -0
- package/esm/src/ast/nodes/export.test.d.ts +2 -0
- package/esm/src/ast/nodes/export.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/export.test.js +22 -0
- package/esm/src/ast/nodes/function-type.test.d.ts +2 -0
- package/esm/src/ast/nodes/function-type.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/function-type.test.js +48 -0
- package/esm/src/ast/nodes/function.test.d.ts +2 -0
- package/esm/src/ast/nodes/function.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/function.test.js +108 -0
- package/esm/src/ast/nodes/generic-parameter.test.d.ts +2 -0
- package/esm/src/ast/nodes/generic-parameter.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/generic-parameter.test.js +70 -0
- package/esm/src/ast/nodes/indexer.test.d.ts +2 -0
- package/esm/src/ast/nodes/indexer.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/indexer.test.js +32 -0
- package/esm/src/ast/nodes/interface.test.d.ts +2 -0
- package/esm/src/ast/nodes/interface.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/interface.test.js +115 -0
- package/esm/src/ast/nodes/intersection-type.test.d.ts +2 -0
- package/esm/src/ast/nodes/intersection-type.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/intersection-type.test.js +38 -0
- package/esm/src/ast/nodes/method.test.d.ts +2 -0
- package/esm/src/ast/nodes/method.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/method.test.js +148 -0
- package/esm/src/ast/nodes/object-type.test.d.ts +2 -0
- package/esm/src/ast/nodes/object-type.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/object-type.test.js +30 -0
- package/esm/src/ast/nodes/object.test.d.ts +2 -0
- package/esm/src/ast/nodes/object.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/object.test.js +30 -0
- package/esm/src/ast/nodes/parameter.test.d.ts +2 -0
- package/esm/src/ast/nodes/parameter.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/parameter.test.js +71 -0
- package/esm/src/ast/nodes/property-accessor.test.d.ts +2 -0
- package/esm/src/ast/nodes/property-accessor.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/property-accessor.test.js +102 -0
- package/esm/src/ast/nodes/property.test.d.ts +2 -0
- package/esm/src/ast/nodes/property.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/property.test.js +89 -0
- package/esm/src/ast/nodes/reference.test.d.ts +2 -0
- package/esm/src/ast/nodes/reference.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/reference.test.js +31 -0
- package/esm/src/ast/nodes/string.test.d.ts +2 -0
- package/esm/src/ast/nodes/string.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/string.test.js +28 -0
- package/esm/src/ast/nodes/tuple.test.d.ts +2 -0
- package/esm/src/ast/nodes/tuple.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/tuple.test.js +33 -0
- package/esm/src/ast/nodes/type-alias.test.d.ts +2 -0
- package/esm/src/ast/nodes/type-alias.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/type-alias.test.js +27 -0
- package/esm/src/ast/nodes/union-type.test.d.ts +2 -0
- package/esm/src/ast/nodes/union-type.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/union-type.test.js +38 -0
- package/esm/src/ast/nodes/variable.test.d.ts +2 -0
- package/esm/src/ast/nodes/variable.test.d.ts.map +1 -0
- package/esm/src/ast/nodes/variable.test.js +38 -0
- package/esm/src/generators/services/angular-services/angular-service-generator.js +9 -9
- package/esm/src/generators/services/easy-network-stub/easy-network-stub-generator.js +9 -9
- package/esm/src/generators/services/fetch-clients/fetch-client-generator.js +2 -2
- package/esm/src/generators/services/k6-clients/k6-client-generator.js +6 -6
- package/esm/src/import-collection.test.d.ts +2 -0
- package/esm/src/import-collection.test.d.ts.map +1 -0
- package/esm/src/import-collection.test.js +64 -0
- package/esm/tests/openapi-models.test.d.ts +2 -0
- package/esm/tests/openapi-models.test.d.ts.map +1 -0
- package/esm/tests/openapi-models.test.js +45 -0
- package/package.json +2 -2
- package/script/_dnt.test_polyfills.d.ts +29 -0
- package/script/_dnt.test_polyfills.d.ts.map +1 -0
- package/script/_dnt.test_polyfills.js +32 -0
- package/script/_dnt.test_shims.d.ts +6 -0
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/_dnt.test_shims.js +65 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts +26 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/assertion_error.js +34 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/equal.d.ts +17 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/equal.js +187 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/equals.d.ts +35 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/equals.js +61 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/false.js +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +25 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/is_error.js +57 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +20 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +32 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +18 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +29 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +23 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +35 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +42 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/rejects.js +56 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +24 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts +20 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_equals.js +32 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.js +46 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.js +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_assertions.js +18 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts +46 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.js +183 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts +6 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_build_message.js +33 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_equal.js +194 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_extend.js +15 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts +3 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_inspect_args.js +17 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts +34 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_matchers.js +748 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts +11 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_mock_util.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_serializer.js +14 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts +843 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_types.js +4 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts +9 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/_utils.js +226 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts +60 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/expect.js +527 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts +29 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/fn.js +88 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts +86 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/expect/1.0.12/mod.js +91 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts +160 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/assertion_state.js +204 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +82 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.js +116 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +140 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.js +284 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +99 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.js +186 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts +2 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.js +41 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +159 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.js +220 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts +16 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.js +3 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_mock_utils.d.ts +15 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_mock_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_mock_utils.js +41 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts +79 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/_test_suite.js +385 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts +738 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/bdd.js +665 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/mock.d.ts +674 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/mock.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/testing/1.0.9/mock.js +1102 -0
- package/script/src/assets.js +1 -1
- package/script/src/ast/nodes/argument.test.d.ts +2 -0
- package/script/src/ast/nodes/argument.test.d.ts.map +1 -0
- package/script/src/ast/nodes/argument.test.js +36 -0
- package/script/src/ast/nodes/array-type.test.d.ts +2 -0
- package/script/src/ast/nodes/array-type.test.d.ts.map +1 -0
- package/script/src/ast/nodes/array-type.test.js +28 -0
- package/script/src/ast/nodes/arrow-function.test.d.ts +2 -0
- package/script/src/ast/nodes/arrow-function.test.d.ts.map +1 -0
- package/script/src/ast/nodes/arrow-function.test.js +64 -0
- package/script/src/ast/nodes/class.test.d.ts +2 -0
- package/script/src/ast/nodes/class.test.d.ts.map +1 -0
- package/script/src/ast/nodes/class.test.js +152 -0
- package/script/src/ast/nodes/constructor-parameter.test.d.ts +2 -0
- package/script/src/ast/nodes/constructor-parameter.test.d.ts.map +1 -0
- package/script/src/ast/nodes/constructor-parameter.test.js +101 -0
- package/script/src/ast/nodes/constructor.test.d.ts +2 -0
- package/script/src/ast/nodes/constructor.test.d.ts.map +1 -0
- package/script/src/ast/nodes/constructor.test.js +104 -0
- package/script/src/ast/nodes/decorator.test.d.ts +2 -0
- package/script/src/ast/nodes/decorator.test.d.ts.map +1 -0
- package/script/src/ast/nodes/decorator.test.js +49 -0
- package/script/src/ast/nodes/doc-tag.test.d.ts +2 -0
- package/script/src/ast/nodes/doc-tag.test.d.ts.map +1 -0
- package/script/src/ast/nodes/doc-tag.test.js +32 -0
- package/script/src/ast/nodes/doc.test.d.ts +2 -0
- package/script/src/ast/nodes/doc.test.d.ts.map +1 -0
- package/script/src/ast/nodes/doc.test.js +33 -0
- package/script/src/ast/nodes/enum-value.test.d.ts +2 -0
- package/script/src/ast/nodes/enum-value.test.d.ts.map +1 -0
- package/script/src/ast/nodes/enum-value.test.js +54 -0
- package/script/src/ast/nodes/enum.test.d.ts +2 -0
- package/script/src/ast/nodes/enum.test.d.ts.map +1 -0
- package/script/src/ast/nodes/enum.test.js +68 -0
- package/script/src/ast/nodes/export.test.d.ts +2 -0
- package/script/src/ast/nodes/export.test.d.ts.map +1 -0
- package/script/src/ast/nodes/export.test.js +24 -0
- package/script/src/ast/nodes/function-type.test.d.ts +2 -0
- package/script/src/ast/nodes/function-type.test.d.ts.map +1 -0
- package/script/src/ast/nodes/function-type.test.js +50 -0
- package/script/src/ast/nodes/function.test.d.ts +2 -0
- package/script/src/ast/nodes/function.test.d.ts.map +1 -0
- package/script/src/ast/nodes/function.test.js +110 -0
- package/script/src/ast/nodes/generic-parameter.test.d.ts +2 -0
- package/script/src/ast/nodes/generic-parameter.test.d.ts.map +1 -0
- package/script/src/ast/nodes/generic-parameter.test.js +72 -0
- package/script/src/ast/nodes/indexer.test.d.ts +2 -0
- package/script/src/ast/nodes/indexer.test.d.ts.map +1 -0
- package/script/src/ast/nodes/indexer.test.js +34 -0
- package/script/src/ast/nodes/interface.test.d.ts +2 -0
- package/script/src/ast/nodes/interface.test.d.ts.map +1 -0
- package/script/src/ast/nodes/interface.test.js +117 -0
- package/script/src/ast/nodes/intersection-type.test.d.ts +2 -0
- package/script/src/ast/nodes/intersection-type.test.d.ts.map +1 -0
- package/script/src/ast/nodes/intersection-type.test.js +40 -0
- package/script/src/ast/nodes/method.test.d.ts +2 -0
- package/script/src/ast/nodes/method.test.d.ts.map +1 -0
- package/script/src/ast/nodes/method.test.js +150 -0
- package/script/src/ast/nodes/object-type.test.d.ts +2 -0
- package/script/src/ast/nodes/object-type.test.d.ts.map +1 -0
- package/script/src/ast/nodes/object-type.test.js +32 -0
- package/script/src/ast/nodes/object.test.d.ts +2 -0
- package/script/src/ast/nodes/object.test.d.ts.map +1 -0
- package/script/src/ast/nodes/object.test.js +32 -0
- package/script/src/ast/nodes/parameter.test.d.ts +2 -0
- package/script/src/ast/nodes/parameter.test.d.ts.map +1 -0
- package/script/src/ast/nodes/parameter.test.js +73 -0
- package/script/src/ast/nodes/property-accessor.test.d.ts +2 -0
- package/script/src/ast/nodes/property-accessor.test.d.ts.map +1 -0
- package/script/src/ast/nodes/property-accessor.test.js +104 -0
- package/script/src/ast/nodes/property.test.d.ts +2 -0
- package/script/src/ast/nodes/property.test.d.ts.map +1 -0
- package/script/src/ast/nodes/property.test.js +91 -0
- package/script/src/ast/nodes/reference.test.d.ts +2 -0
- package/script/src/ast/nodes/reference.test.d.ts.map +1 -0
- package/script/src/ast/nodes/reference.test.js +33 -0
- package/script/src/ast/nodes/string.test.d.ts +2 -0
- package/script/src/ast/nodes/string.test.d.ts.map +1 -0
- package/script/src/ast/nodes/string.test.js +30 -0
- package/script/src/ast/nodes/tuple.test.d.ts +2 -0
- package/script/src/ast/nodes/tuple.test.d.ts.map +1 -0
- package/script/src/ast/nodes/tuple.test.js +35 -0
- package/script/src/ast/nodes/type-alias.test.d.ts +2 -0
- package/script/src/ast/nodes/type-alias.test.d.ts.map +1 -0
- package/script/src/ast/nodes/type-alias.test.js +29 -0
- package/script/src/ast/nodes/union-type.test.d.ts +2 -0
- package/script/src/ast/nodes/union-type.test.d.ts.map +1 -0
- package/script/src/ast/nodes/union-type.test.js +40 -0
- package/script/src/ast/nodes/variable.test.d.ts +2 -0
- package/script/src/ast/nodes/variable.test.d.ts.map +1 -0
- package/script/src/ast/nodes/variable.test.js +40 -0
- package/script/src/generators/services/angular-services/angular-service-generator.js +9 -9
- package/script/src/generators/services/easy-network-stub/easy-network-stub-generator.js +9 -9
- package/script/src/generators/services/fetch-clients/fetch-client-generator.js +2 -2
- package/script/src/generators/services/k6-clients/k6-client-generator.js +6 -6
- package/script/src/import-collection.test.d.ts +2 -0
- package/script/src/import-collection.test.d.ts.map +1 -0
- package/script/src/import-collection.test.js +66 -0
- package/script/tests/openapi-models.test.d.ts +2 -0
- package/script/tests/openapi-models.test.d.ts.map +1 -0
- package/script/tests/openapi-models.test.js +48 -0
- package/src/_dnt.test_polyfills.ts +70 -0
- package/src/_dnt.test_shims.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/assertion_error.ts +31 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/equal.ts +210 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/equals.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/false.ts +26 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/instance_of.ts +64 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/is_error.ts +65 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_instance_of.ts +33 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_match.ts +30 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.ts +42 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/rejects.ts +123 -0
- package/src/deps/jsr.io/@std/assert/1.0.11/strict_equals.ts +67 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_equals.ts +38 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_is_error.ts +54 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assert_not_equals.ts +35 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_assertions.ts +18 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_asymmetric_matchers.ts +198 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_build_message.ts +51 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_custom_equality_tester.ts +19 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_equal.ts +230 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_extend.ts +16 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_inspect_args.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_matchers.ts +1028 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_mock_util.ts +22 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_serializer.ts +15 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_types.ts +923 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/_utils.ts +283 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/expect.ts +620 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/fn.ts +91 -0
- package/src/deps/jsr.io/@std/expect/1.0.12/mod.ts +89 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/assertion_state.ts +214 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/build_message.ts +134 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff.ts +317 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/diff_str.ts +204 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/format.ts +39 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/styles.ts +233 -0
- package/src/deps/jsr.io/@std/internal/1.0.5/types.ts +18 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/_mock_utils.ts +43 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/_test_suite.ts +448 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/bdd.ts +1288 -0
- package/src/deps/jsr.io/@std/testing/1.0.9/mock.ts +1807 -0
- package/src/mod.ts +7 -0
- package/src/src/assets.ts +9 -0
- package/src/src/ast/_index.ts +54 -0
- package/src/src/ast/common.ts +1 -0
- package/src/src/ast/index.ts +1 -0
- package/src/src/ast/node.ts +10 -0
- package/src/src/ast/nodes/argument.test.ts +43 -0
- package/src/src/ast/nodes/argument.ts +40 -0
- package/src/src/ast/nodes/array-type.test.ts +34 -0
- package/src/src/ast/nodes/array-type.ts +49 -0
- package/src/src/ast/nodes/arrow-function.test.ts +79 -0
- package/src/src/ast/nodes/arrow-function.ts +91 -0
- package/src/src/ast/nodes/call.ts +55 -0
- package/src/src/ast/nodes/class.test.ts +185 -0
- package/src/src/ast/nodes/class.ts +133 -0
- package/src/src/ast/nodes/constructor-parameter.test.ts +122 -0
- package/src/src/ast/nodes/constructor-parameter.ts +70 -0
- package/src/src/ast/nodes/constructor.test.ts +131 -0
- package/src/src/ast/nodes/constructor.ts +77 -0
- package/src/src/ast/nodes/decorator.test.ts +59 -0
- package/src/src/ast/nodes/decorator.ts +76 -0
- package/src/src/ast/nodes/doc-tag.test.ts +40 -0
- package/src/src/ast/nodes/doc-tag.ts +291 -0
- package/src/src/ast/nodes/doc.test.ts +40 -0
- package/src/src/ast/nodes/doc.ts +102 -0
- package/src/src/ast/nodes/enum-value.test.ts +66 -0
- package/src/src/ast/nodes/enum-value.ts +72 -0
- package/src/src/ast/nodes/enum.test.ts +85 -0
- package/src/src/ast/nodes/enum.ts +77 -0
- package/src/src/ast/nodes/export.test.ts +29 -0
- package/src/src/ast/nodes/export.ts +54 -0
- package/src/src/ast/nodes/function-type.test.ts +61 -0
- package/src/src/ast/nodes/function-type.ts +60 -0
- package/src/src/ast/nodes/function.test.ts +135 -0
- package/src/src/ast/nodes/function.ts +107 -0
- package/src/src/ast/nodes/generic-parameter.test.ts +86 -0
- package/src/src/ast/nodes/generic-parameter.ts +71 -0
- package/src/src/ast/nodes/indexer.test.ts +42 -0
- package/src/src/ast/nodes/indexer.ts +60 -0
- package/src/src/ast/nodes/interface.test.ts +142 -0
- package/src/src/ast/nodes/interface.ts +117 -0
- package/src/src/ast/nodes/intersection-type.test.ts +52 -0
- package/src/src/ast/nodes/intersection-type.ts +67 -0
- package/src/src/ast/nodes/lookup-type.ts +53 -0
- package/src/src/ast/nodes/method.test.ts +185 -0
- package/src/src/ast/nodes/method.ts +138 -0
- package/src/src/ast/nodes/object-type.test.ts +40 -0
- package/src/src/ast/nodes/object-type.ts +52 -0
- package/src/src/ast/nodes/object.test.ts +40 -0
- package/src/src/ast/nodes/object.ts +48 -0
- package/src/src/ast/nodes/parameter.test.ts +88 -0
- package/src/src/ast/nodes/parameter.ts +85 -0
- package/src/src/ast/nodes/property-accessor.test.ts +132 -0
- package/src/src/ast/nodes/property-accessor.ts +173 -0
- package/src/src/ast/nodes/property.test.ts +113 -0
- package/src/src/ast/nodes/property.ts +192 -0
- package/src/src/ast/nodes/reference.test.ts +42 -0
- package/src/src/ast/nodes/reference.ts +194 -0
- package/src/src/ast/nodes/string.test.ts +35 -0
- package/src/src/ast/nodes/string.ts +49 -0
- package/src/src/ast/nodes/tuple.test.ts +45 -0
- package/src/src/ast/nodes/tuple.ts +53 -0
- package/src/src/ast/nodes/type-alias.test.ts +35 -0
- package/src/src/ast/nodes/type-alias.ts +75 -0
- package/src/src/ast/nodes/typeof.ts +42 -0
- package/src/src/ast/nodes/types.ts +40 -0
- package/src/src/ast/nodes/union-type.test.ts +50 -0
- package/src/src/ast/nodes/union-type.ts +62 -0
- package/src/src/ast/nodes/variable.test.ts +49 -0
- package/src/src/ast/nodes/variable.ts +73 -0
- package/src/src/ast/references/angular.ts +24 -0
- package/src/src/ast/references/easy-network-stub.ts +21 -0
- package/src/src/ast/references/index.ts +5 -0
- package/src/src/ast/references/k6.ts +8 -0
- package/src/src/ast/references/rxjs.ts +7 -0
- package/src/src/ast/references/typescript.ts +35 -0
- package/src/src/ast/utils/get-type-script-builder-options.ts +19 -0
- package/src/src/ast/utils/to-ts-node.ts +27 -0
- package/src/src/ast/utils/write-ts-generic-parameters.ts +25 -0
- package/src/src/ast/utils/write-ts-members.ts +28 -0
- package/src/src/ast/utils/write-ts-nodes.ts +35 -0
- package/src/src/ast/utils/write-ts-parameters.ts +25 -0
- package/src/src/common-results.ts +26 -0
- package/src/src/config.ts +89 -0
- package/src/src/file-builder.ts +136 -0
- package/src/src/generators/file-generator.ts +15 -0
- package/src/src/generators/index.ts +6 -0
- package/src/src/generators/models/index.ts +3 -0
- package/src/src/generators/models/model-generator.ts +469 -0
- package/src/src/generators/models/models-generator.ts +108 -0
- package/src/src/generators/models/models.ts +112 -0
- package/src/src/generators/services/angular-services/angular-service-generator.ts +404 -0
- package/src/src/generators/services/angular-services/angular-services-generator.ts +295 -0
- package/src/src/generators/services/angular-services/index.ts +3 -0
- package/src/src/generators/services/angular-services/models.ts +270 -0
- package/src/src/generators/services/angular-services/refs.ts +54 -0
- package/src/src/generators/services/easy-network-stub/easy-network-stub-generator.ts +242 -0
- package/src/src/generators/services/easy-network-stub/easy-network-stubs-generator.ts +211 -0
- package/src/src/generators/services/easy-network-stub/index.ts +3 -0
- package/src/src/generators/services/easy-network-stub/models.ts +124 -0
- package/src/src/generators/services/easy-network-stub/refs.ts +45 -0
- package/src/src/generators/services/fetch-clients/fetch-client-generator.ts +267 -0
- package/src/src/generators/services/fetch-clients/fetch-clients-generator.ts +163 -0
- package/src/src/generators/services/fetch-clients/index.ts +3 -0
- package/src/src/generators/services/fetch-clients/models.ts +130 -0
- package/src/src/generators/services/fetch-clients/refs.ts +21 -0
- package/src/src/generators/services/k6-clients/index.ts +3 -0
- package/src/src/generators/services/k6-clients/k6-client-generator.ts +409 -0
- package/src/src/generators/services/k6-clients/k6-clients-generator.ts +165 -0
- package/src/src/generators/services/k6-clients/models.ts +241 -0
- package/src/src/generators/services/k6-clients/refs.ts +15 -0
- package/src/src/import-collection.test.ts +78 -0
- package/src/src/import-collection.ts +236 -0
- package/src/src/utils.ts +72 -0
- package/src/tests/openapi-models.test.ts +64 -0
- package/test_runner.js +239 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
|
|
6
|
+
import { type AppendParam, type AppendValue, isAppendValue, type Nullable, SourceBuilder } from '@goast/core';
|
|
7
|
+
|
|
8
|
+
import { TsNode } from './ast/node.js';
|
|
9
|
+
import { defaultTypeScriptGeneratorConfig, type TypeScriptGeneratorConfig } from './config.js';
|
|
10
|
+
import type { TypeScriptModelGeneratorOutput } from './generators/index.js';
|
|
11
|
+
import {
|
|
12
|
+
ImportExportCollection,
|
|
13
|
+
type TypeScriptExportOptions,
|
|
14
|
+
type TypeScriptImportOptions,
|
|
15
|
+
} from './import-collection.js';
|
|
16
|
+
|
|
17
|
+
export type TypeScriptAppends<TAdditionalAppends> = TsNode<TypeScriptFileBuilder> | TAdditionalAppends;
|
|
18
|
+
export type TypeScriptAppendParam<TBuilder extends TypeScriptFileBuilder, TAdditionalAppends> = AppendParam<
|
|
19
|
+
TBuilder,
|
|
20
|
+
TypeScriptAppends<TAdditionalAppends>
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
export function isTypeScriptAppendValue<TBuilder extends TypeScriptFileBuilder = TypeScriptFileBuilder>(
|
|
24
|
+
value: unknown,
|
|
25
|
+
): value is AppendValue<TBuilder> {
|
|
26
|
+
return isAppendValue(value) || value instanceof TsNode;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export class TypeScriptFileBuilder<TAdditionalAppends = never>
|
|
30
|
+
extends SourceBuilder<TypeScriptAppends<TAdditionalAppends>> {
|
|
31
|
+
public readonly filePath: string | undefined;
|
|
32
|
+
public readonly imports: ImportExportCollection;
|
|
33
|
+
|
|
34
|
+
public override get options(): TypeScriptGeneratorConfig {
|
|
35
|
+
return super.options as TypeScriptGeneratorConfig;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
constructor(filePath?: string, options?: TypeScriptGeneratorConfig) {
|
|
39
|
+
super(options ?? defaultTypeScriptGeneratorConfig);
|
|
40
|
+
this.filePath = filePath;
|
|
41
|
+
this.imports = new ImportExportCollection({
|
|
42
|
+
filePath: filePath,
|
|
43
|
+
importModuleTransformer: this.options.importModuleTransformer,
|
|
44
|
+
useSingleQuotes: this.options.useSingleQuotes,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public addImport(name: string, moduleNameOrfilePath: string, options?: TypeScriptImportOptions): this {
|
|
49
|
+
this.imports.addImport(name, moduleNameOrfilePath, options);
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public addExport(name: string, filePath: string, options?: TypeScriptExportOptions): this {
|
|
54
|
+
this.imports.addExport(name, filePath, options);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public override clear(): void {
|
|
59
|
+
super.clear();
|
|
60
|
+
this.imports.clear();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public override toString(addPadding: boolean = true): string {
|
|
64
|
+
const builder = new SourceBuilder(this.options);
|
|
65
|
+
if (this.filePath?.match(/\.[cm]?js$/)) {
|
|
66
|
+
builder.appendLine('// @ts-check');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
builder.ensurePreviousLineEmpty();
|
|
70
|
+
this.imports.writeTo(builder);
|
|
71
|
+
|
|
72
|
+
const baseString = super.toString();
|
|
73
|
+
if (baseString && addPadding) {
|
|
74
|
+
builder.ensurePreviousLineEmpty();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
builder.append(baseString);
|
|
78
|
+
|
|
79
|
+
if (addPadding) {
|
|
80
|
+
builder.ensureCurrentLineEmpty();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return builder.toString();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
protected override appendSingle(value: TypeScriptAppendParam<this, TAdditionalAppends>) {
|
|
87
|
+
super.appendSingle(value);
|
|
88
|
+
if (value instanceof TsNode) {
|
|
89
|
+
value.write(this);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public appendModelUsage(type: TypeScriptModelGeneratorOutput, options?: TypeScriptImportOptions): this {
|
|
94
|
+
this.append(type.component);
|
|
95
|
+
for (const i of type.imports) {
|
|
96
|
+
this.addImport(i.name, i.modulePath, { ...i, ...options });
|
|
97
|
+
}
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public writeToFile(filePath?: string): void {
|
|
102
|
+
if (!filePath) filePath = this.filePath;
|
|
103
|
+
if (!filePath) throw new Error('File path is required');
|
|
104
|
+
fs.ensureDirSync(dirname(filePath));
|
|
105
|
+
fs.writeFileSync(filePath, this.toString());
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
public static generate(options: {
|
|
109
|
+
filePath: string;
|
|
110
|
+
logName?: Nullable<string>;
|
|
111
|
+
options?: TypeScriptGeneratorConfig;
|
|
112
|
+
generator: (builder: TypeScriptFileBuilder) => void;
|
|
113
|
+
}): void {
|
|
114
|
+
TypeScriptFileBuilder.tryGenerate(options);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public static tryGenerate({
|
|
118
|
+
filePath,
|
|
119
|
+
generator,
|
|
120
|
+
options,
|
|
121
|
+
logName,
|
|
122
|
+
}: {
|
|
123
|
+
filePath: Nullable<string>;
|
|
124
|
+
logName?: Nullable<string>;
|
|
125
|
+
options?: TypeScriptGeneratorConfig;
|
|
126
|
+
generator: (builder: TypeScriptFileBuilder) => void;
|
|
127
|
+
}) {
|
|
128
|
+
if (!filePath) return;
|
|
129
|
+
if (logName) {
|
|
130
|
+
console.log(`Generating ${logName} to ${filePath}...`);
|
|
131
|
+
}
|
|
132
|
+
const builder = new TypeScriptFileBuilder(filePath, options);
|
|
133
|
+
generator(builder);
|
|
134
|
+
builder.writeToFile();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MaybePromise, OpenApiGenerationProviderContext, OpenApiGeneratorInput, SourceBuilder } from '@goast/core';
|
|
2
|
+
|
|
3
|
+
import { ts } from '../ast/index.js';
|
|
4
|
+
import type { TypeScriptGeneratorConfig } from '../config.js';
|
|
5
|
+
|
|
6
|
+
export abstract class TypeScriptFileGenerator<
|
|
7
|
+
TContext extends OpenApiGenerationProviderContext<OpenApiGeneratorInput, TypeScriptGeneratorConfig>,
|
|
8
|
+
TOutput,
|
|
9
|
+
> {
|
|
10
|
+
public abstract generate(context: TContext): MaybePromise<TOutput>;
|
|
11
|
+
|
|
12
|
+
protected getAnyType(context: TContext): ts.Reference<SourceBuilder> {
|
|
13
|
+
return context.config.preferUnknown ? ts.refs.unknown() : ts.refs.any();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './file-generator.js';
|
|
2
|
+
export * from './models/index.js';
|
|
3
|
+
export * from './services/angular-services/index.js';
|
|
4
|
+
export * from './services/easy-network-stub/index.js';
|
|
5
|
+
export * from './services/fetch-clients/index.js';
|
|
6
|
+
export * from './services/k6-clients/index.js';
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ApiSchema,
|
|
5
|
+
type AppendValue,
|
|
6
|
+
type AppendValueGroup,
|
|
7
|
+
appendValueGroup,
|
|
8
|
+
type ArrayLikeApiSchema,
|
|
9
|
+
type CombinedLikeApiSchema,
|
|
10
|
+
getSchemaReference,
|
|
11
|
+
type MaybePromise,
|
|
12
|
+
notNullish,
|
|
13
|
+
type Nullable,
|
|
14
|
+
type ObjectLikeApiSchema,
|
|
15
|
+
resolveAnyOfAndAllOf,
|
|
16
|
+
type StringLikeApiSchema,
|
|
17
|
+
toCasing,
|
|
18
|
+
} from '@goast/core';
|
|
19
|
+
|
|
20
|
+
import { ts } from '../../ast/index.js';
|
|
21
|
+
import type { TypeScriptComponentOutputKind } from '../../common-results.js';
|
|
22
|
+
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
23
|
+
import { TypeScriptFileGenerator } from '../file-generator.js';
|
|
24
|
+
import type { TypeScriptModelGeneratorContext, TypeScriptModelGeneratorOutput } from './models.js';
|
|
25
|
+
|
|
26
|
+
type Context = TypeScriptModelGeneratorContext;
|
|
27
|
+
type Output = TypeScriptModelGeneratorOutput;
|
|
28
|
+
type Builder = TypeScriptFileBuilder;
|
|
29
|
+
|
|
30
|
+
export interface TypeScriptModelGenerator<TOutput extends Output = Output> {
|
|
31
|
+
generate(ctx: Context): MaybePromise<TOutput>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class DefaultTypeScriptModelGenerator extends TypeScriptFileGenerator<Context, Output>
|
|
35
|
+
implements TypeScriptModelGenerator {
|
|
36
|
+
public generate(ctx: Context): MaybePromise<Output> {
|
|
37
|
+
if (this.shouldGenerateTypeDeclaration(ctx, ctx.schema)) {
|
|
38
|
+
const name = this.getDeclarationTypeName(ctx, ctx.schema);
|
|
39
|
+
const filePath = this.getFilePath(ctx, ctx.schema);
|
|
40
|
+
|
|
41
|
+
const fileContent = this.getFileContent(ctx);
|
|
42
|
+
TypeScriptFileBuilder.generate({
|
|
43
|
+
logName: `model ${name}`,
|
|
44
|
+
filePath,
|
|
45
|
+
options: ctx.config,
|
|
46
|
+
generator: (b) => b.append(fileContent),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const exports = fileContent.values.filter(
|
|
50
|
+
(x): x is AppendValue<Builder> & { name: string; export: true } =>
|
|
51
|
+
typeof x === 'object' && x !== null && 'export' in x && x.export === true && 'name' in x,
|
|
52
|
+
);
|
|
53
|
+
const node = exports.find((x) => x.name === name);
|
|
54
|
+
return {
|
|
55
|
+
component: name,
|
|
56
|
+
filePath,
|
|
57
|
+
imports: [
|
|
58
|
+
{
|
|
59
|
+
kind: 'file',
|
|
60
|
+
name,
|
|
61
|
+
modulePath: filePath,
|
|
62
|
+
type: node instanceof ts.Interface || node instanceof ts.TypeAlias ? 'type-import' : 'import',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
additionalExports: exports
|
|
66
|
+
.filter((x) => x.name !== name)
|
|
67
|
+
.map(
|
|
68
|
+
(x) => ({
|
|
69
|
+
name: x.name,
|
|
70
|
+
type: x instanceof ts.TypeAlias || x instanceof ts.Interface ? 'type-export' : 'export',
|
|
71
|
+
} as const),
|
|
72
|
+
),
|
|
73
|
+
kind: this.getNodeKind(node),
|
|
74
|
+
};
|
|
75
|
+
} else {
|
|
76
|
+
const builder = new TypeScriptFileBuilder(undefined, ctx.config);
|
|
77
|
+
builder.append(this.getType(ctx, ctx.schema));
|
|
78
|
+
const imports = builder.imports.imports;
|
|
79
|
+
builder.imports.clear();
|
|
80
|
+
return { component: builder.toString(false), imports };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
protected getNodeKind(node: unknown): TypeScriptComponentOutputKind | undefined {
|
|
85
|
+
if (node instanceof ts.Interface) return 'interface';
|
|
86
|
+
if (node instanceof ts.TypeAlias) return 'type';
|
|
87
|
+
if (node instanceof ts.Enum) return 'enum';
|
|
88
|
+
if (node instanceof ts.Class) return 'class';
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
protected getFileContent(ctx: Context): AppendValueGroup<Builder> {
|
|
93
|
+
const content = appendValueGroup<Builder>([], '\n');
|
|
94
|
+
const interfaceSchema = this.resolveInterfaceSchema(ctx);
|
|
95
|
+
if (interfaceSchema) {
|
|
96
|
+
content.values.push(this.getInterface(ctx, interfaceSchema));
|
|
97
|
+
} else if (
|
|
98
|
+
ctx.config.enumGeneration !== 'union' &&
|
|
99
|
+
ctx.schema.kind === 'string' &&
|
|
100
|
+
ctx.schema.enum !== undefined &&
|
|
101
|
+
ctx.schema.enum.length > 0
|
|
102
|
+
) {
|
|
103
|
+
content.values.push(this.getEnum(ctx));
|
|
104
|
+
} else if (ctx.schema.discriminator && Object.keys(ctx.schema.discriminator.mapping).length > 0) {
|
|
105
|
+
content.values.push(
|
|
106
|
+
ts.typeAlias(
|
|
107
|
+
this.getDiscriminatorTypeName(ctx, ctx.schema),
|
|
108
|
+
ts.unionType(Object.keys(ctx.schema.discriminator.mapping).map((x) => ts.string(x))),
|
|
109
|
+
),
|
|
110
|
+
ts.typeAlias(
|
|
111
|
+
this.getBaseTypeName(ctx, ctx.schema),
|
|
112
|
+
this.getType(ctx, ctx.schema, { skipSchemas: true }) ?? this.getAnyType(ctx),
|
|
113
|
+
{ export: true },
|
|
114
|
+
),
|
|
115
|
+
this.getTypeAlias(ctx, ctx.schema),
|
|
116
|
+
);
|
|
117
|
+
} else {
|
|
118
|
+
content.values.push(this.getTypeAlias(ctx, ctx.schema));
|
|
119
|
+
if (ctx.schema.enum) {
|
|
120
|
+
content.values.push(this.getEnumValuesVariable(ctx, ctx.schema));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return content;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
protected getEnum(ctx: Context): ts.Enum<Builder> {
|
|
127
|
+
return ts.enum(this.getDeclarationTypeName(ctx, ctx.schema), {
|
|
128
|
+
doc: ts.doc({
|
|
129
|
+
description: ctx.schema.description,
|
|
130
|
+
tags: [ctx.schema.deprecated ? ts.docTag('deprecated') : null],
|
|
131
|
+
}),
|
|
132
|
+
export: true,
|
|
133
|
+
members: (ctx.schema.enum?.map((x) => String(x)) ?? []).map((x) =>
|
|
134
|
+
ts.enumValue(toCasing(x, ctx.config.enumValueNameCasing), { value: ts.string(x) })
|
|
135
|
+
),
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
protected getInterface(ctx: Context, schema: ObjectLikeApiSchema): ts.Interface<Builder> {
|
|
140
|
+
return ts.interface(this.getDeclarationTypeName(ctx, ctx.schema), {
|
|
141
|
+
export: true,
|
|
142
|
+
doc: ts.doc({
|
|
143
|
+
description: schema.description,
|
|
144
|
+
tags: [ctx.schema.deprecated ? ts.docTag('deprecated') : null],
|
|
145
|
+
}),
|
|
146
|
+
members: [...this.getProperties(ctx, schema), this.getIndexer(ctx, schema)],
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
protected getTypeAlias(ctx: Context, schema: ApiSchema): ts.TypeAlias<Builder> {
|
|
151
|
+
const hasDiscriminator = schema.discriminator && Object.keys(schema.discriminator.mapping).length > 0;
|
|
152
|
+
const result = ts.typeAlias<Builder>(
|
|
153
|
+
this.getDeclarationTypeName(ctx, schema),
|
|
154
|
+
(hasDiscriminator ? this.getDiscriminatorType(ctx, schema) : this.getType(ctx, schema, { skipSchemas: true })) ??
|
|
155
|
+
this.getAnyType(ctx),
|
|
156
|
+
{
|
|
157
|
+
export: true,
|
|
158
|
+
doc: ts.doc({
|
|
159
|
+
description: schema.description,
|
|
160
|
+
tags: [ctx.schema.deprecated ? ts.docTag('deprecated') : null],
|
|
161
|
+
}),
|
|
162
|
+
},
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
if (hasDiscriminator) {
|
|
166
|
+
const propertyValue = this.getDiscriminatorTypeName(ctx, ctx.schema);
|
|
167
|
+
result.generics.push(
|
|
168
|
+
ts.genericParameter(this.getDiscriminatorGenericParamName(ctx, schema), {
|
|
169
|
+
constraint: propertyValue,
|
|
170
|
+
default: propertyValue,
|
|
171
|
+
}),
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const inheritedSchemas = this.getInheritedSchemas(ctx, schema);
|
|
176
|
+
if (inheritedSchemas.length > 0) {
|
|
177
|
+
const fixedProperties = inheritedSchemas.reduce((p, c) => {
|
|
178
|
+
const mappingValues = Object.entries(c.discriminator.mapping)
|
|
179
|
+
.filter(([_, value]) => value.id === schema.id)
|
|
180
|
+
.map(([key]) => ts.string(key));
|
|
181
|
+
if (c.discriminator.propertyName in p) {
|
|
182
|
+
p[c.discriminator.propertyName].types.push(...mappingValues);
|
|
183
|
+
} else {
|
|
184
|
+
p[c.discriminator.propertyName] = ts.unionType(mappingValues);
|
|
185
|
+
}
|
|
186
|
+
return p;
|
|
187
|
+
}, {} as Record<string, ts.UnionType<Builder>>);
|
|
188
|
+
result.type = ts.intersectionType([
|
|
189
|
+
ts.refs.omit([result.type, ts.unionType(Object.keys(fixedProperties).map((x) => ts.string(x)))]),
|
|
190
|
+
ts.objectType({
|
|
191
|
+
members: Object.entries(fixedProperties).map(([key, value]) =>
|
|
192
|
+
ts.property(key, { type: value, readonly: ctx.config.immutableTypes })
|
|
193
|
+
),
|
|
194
|
+
}),
|
|
195
|
+
]);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return result;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
protected getEnumValuesVariable(ctx: Context, schema: ApiSchema): ts.Variable<Builder> {
|
|
202
|
+
const enumTypeName = this.getDeclarationTypeName(ctx, schema);
|
|
203
|
+
const values = schema.enum?.map((x) => ts.toNode(x)) ?? [];
|
|
204
|
+
return ts.variable(toCasing(`${enumTypeName}-Values`, ctx.config.constantNameCasing), {
|
|
205
|
+
doc: ts.doc({
|
|
206
|
+
description: `All possible values of the enum \`${enumTypeName}\`.`,
|
|
207
|
+
}),
|
|
208
|
+
export: true,
|
|
209
|
+
readonly: true,
|
|
210
|
+
value: ts.tuple(values, { asConst: true }),
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
protected getIndexer(ctx: Context, schema: ObjectLikeApiSchema): ts.Indexer<Builder> | null {
|
|
215
|
+
return schema.additionalProperties
|
|
216
|
+
? ts.indexer(
|
|
217
|
+
ts.refs.string(),
|
|
218
|
+
(schema.additionalProperties === true ? null : this.getType(ctx, schema.additionalProperties)) ??
|
|
219
|
+
this.getAnyType(ctx),
|
|
220
|
+
{ readonly: ctx.config.immutableTypes },
|
|
221
|
+
)
|
|
222
|
+
: null;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
protected getProperties(ctx: Context, schema: ObjectLikeApiSchema): ts.Property<Builder>[] {
|
|
226
|
+
return Array.from(schema.properties.values()).map((property) => {
|
|
227
|
+
return ts.property(property.name, {
|
|
228
|
+
doc: ts.doc({
|
|
229
|
+
description: property.schema.description,
|
|
230
|
+
tags: [property.schema.deprecated ? ts.docTag('deprecated') : null],
|
|
231
|
+
}),
|
|
232
|
+
readonly: ctx.config.immutableTypes,
|
|
233
|
+
optional: !schema.required.has(property.name),
|
|
234
|
+
type: ts.unionType([this.getType(ctx, property.schema), property.schema.nullable ? 'null' : null]),
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
protected getType(
|
|
240
|
+
ctx: Context,
|
|
241
|
+
schema: Nullable<ApiSchema>,
|
|
242
|
+
options?: { skipSchemas?: boolean; useBaseType?: boolean },
|
|
243
|
+
): ts.Type<Builder> | null {
|
|
244
|
+
if (!schema) return this.getAnyType(ctx);
|
|
245
|
+
|
|
246
|
+
schema = getSchemaReference(schema, ['description']);
|
|
247
|
+
|
|
248
|
+
if (options?.useBaseType && ctx.schema.inheritedSchemas.some((x) => x.id === schema.id)) {
|
|
249
|
+
return ts.reference(this.getBaseTypeName(ctx, schema), this.getFilePath(ctx, schema), {
|
|
250
|
+
importType: 'type-import',
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (!options?.skipSchemas && this.shouldGenerateTypeDeclaration(ctx, schema)) {
|
|
255
|
+
if (schema.id === ctx.schema.id) {
|
|
256
|
+
return null;
|
|
257
|
+
}
|
|
258
|
+
return ts.reference(this.getDeclarationTypeName(ctx, schema), this.getFilePath(ctx, schema), {
|
|
259
|
+
importType: 'type-import',
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (schema.enum) {
|
|
264
|
+
return ts.unionType(schema.enum.map((x) => ts.toNode(x)));
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
switch (schema.kind) {
|
|
268
|
+
case 'boolean':
|
|
269
|
+
return 'boolean';
|
|
270
|
+
case 'integer':
|
|
271
|
+
case 'number':
|
|
272
|
+
return 'number';
|
|
273
|
+
case 'string':
|
|
274
|
+
return this.getStringType(ctx, schema);
|
|
275
|
+
case 'null':
|
|
276
|
+
return 'null';
|
|
277
|
+
case 'unknown':
|
|
278
|
+
return this.getAnyType(ctx);
|
|
279
|
+
case 'array':
|
|
280
|
+
return this.getArrayType(ctx, schema);
|
|
281
|
+
case 'object':
|
|
282
|
+
return this.getObjectType(ctx, schema);
|
|
283
|
+
case 'combined':
|
|
284
|
+
return this.getCombinedType(ctx, schema);
|
|
285
|
+
case 'multi-type':
|
|
286
|
+
return this.getMultiType(ctx, schema);
|
|
287
|
+
case 'oneOf':
|
|
288
|
+
return this.getOneOfType(ctx, schema);
|
|
289
|
+
default:
|
|
290
|
+
return this.getAnyType(ctx);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
protected getStringType(_ctx: Context, schema: StringLikeApiSchema): ts.Type<Builder> {
|
|
295
|
+
if (schema.format === 'binary') {
|
|
296
|
+
return ts.refs.blob();
|
|
297
|
+
}
|
|
298
|
+
return 'string';
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
protected getArrayType(ctx: Context, schema: ArrayLikeApiSchema): ts.Type<Builder> {
|
|
302
|
+
return ts.arrayType(this.getType(ctx, schema.items) ?? this.getAnyType(ctx), {
|
|
303
|
+
readonly: ctx.config.immutableTypes,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
protected getObjectType(ctx: Context, schema: ObjectLikeApiSchema): ts.Type<Builder> {
|
|
308
|
+
const parts = [
|
|
309
|
+
schema.properties.size > 0 ? ts.objectType({ members: this.getProperties(ctx, schema) }) : null,
|
|
310
|
+
schema.additionalProperties ? ts.objectType({ members: [this.getIndexer(ctx, schema)] }) : null,
|
|
311
|
+
schema.allOf.length > 0 || schema.anyOf.length > 0 ? this.getCombinedType(ctx, schema) : null,
|
|
312
|
+
].filter(notNullish);
|
|
313
|
+
if (parts.length === 0) {
|
|
314
|
+
parts.push(
|
|
315
|
+
ts.objectType({
|
|
316
|
+
members: [ts.indexer(ts.refs.string(), ts.refs.never(), { readonly: ctx.config.immutableTypes })],
|
|
317
|
+
}),
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
return ts.intersectionType(parts);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
protected getDiscriminatorType(ctx: Context, schema: ApiSchema): ts.Type<Builder> {
|
|
324
|
+
if (schema.discriminator && Object.keys(schema.discriminator.mapping).length > 0) {
|
|
325
|
+
const discriminator = schema.discriminator;
|
|
326
|
+
return ts.intersectionType([
|
|
327
|
+
this.getBaseTypeName(ctx, schema as ApiSchema),
|
|
328
|
+
ts.lookupType(
|
|
329
|
+
ts.objectType({
|
|
330
|
+
members: Object.entries(discriminator.mapping).map(([key, value]) =>
|
|
331
|
+
ts.property(key, {
|
|
332
|
+
type: ts.intersectionType([
|
|
333
|
+
ts.objectType({
|
|
334
|
+
members: [
|
|
335
|
+
ts.property(discriminator.propertyName, {
|
|
336
|
+
type: ts.string(key),
|
|
337
|
+
readonly: ctx.config.immutableTypes,
|
|
338
|
+
}),
|
|
339
|
+
],
|
|
340
|
+
}),
|
|
341
|
+
this.getType(ctx, value),
|
|
342
|
+
]),
|
|
343
|
+
})
|
|
344
|
+
),
|
|
345
|
+
}),
|
|
346
|
+
this.getDiscriminatorGenericParamName(ctx, schema as ApiSchema),
|
|
347
|
+
),
|
|
348
|
+
]);
|
|
349
|
+
} else {
|
|
350
|
+
return ts.refs.unknown();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
protected getCombinedType(ctx: Context, schema: CombinedLikeApiSchema): ts.Type<Builder> {
|
|
355
|
+
if (schema.allOf.length === 0 && schema.anyOf.length === 0) {
|
|
356
|
+
return this.getAnyType(ctx);
|
|
357
|
+
}
|
|
358
|
+
const useBaseType = schema.id === ctx.schema.id;
|
|
359
|
+
return ts.intersectionType([
|
|
360
|
+
...schema.allOf.map((x) => this.getType(ctx, x, { useBaseType })),
|
|
361
|
+
...schema.anyOf.map((x) => ts.reference('Partial', null, { generics: [this.getType(ctx, x, { useBaseType })] })),
|
|
362
|
+
]);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
protected getOneOfType(ctx: Context, schema: ApiSchema<'oneOf'>): ts.Type<Builder> {
|
|
366
|
+
if (schema.oneOf.length === 0) {
|
|
367
|
+
return this.getAnyType(ctx);
|
|
368
|
+
}
|
|
369
|
+
return ts.unionType(schema.oneOf.map((x) => this.getType(ctx, x)));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
protected getMultiType(ctx: Context, schema: ApiSchema<'multi-type'>): ts.Type<Builder> {
|
|
373
|
+
if (schema.type.length === 0) {
|
|
374
|
+
return this.getAnyType(ctx);
|
|
375
|
+
}
|
|
376
|
+
return ts.unionType(
|
|
377
|
+
schema.type.map((x) => {
|
|
378
|
+
switch (x) {
|
|
379
|
+
case 'string':
|
|
380
|
+
return this.getStringType(ctx, schema);
|
|
381
|
+
case 'number':
|
|
382
|
+
case 'integer':
|
|
383
|
+
return 'number';
|
|
384
|
+
case 'boolean':
|
|
385
|
+
return 'boolean';
|
|
386
|
+
case 'null':
|
|
387
|
+
return 'null';
|
|
388
|
+
case 'array':
|
|
389
|
+
return this.getArrayType(ctx, schema);
|
|
390
|
+
case 'object':
|
|
391
|
+
return this.getObjectType(ctx, schema);
|
|
392
|
+
default:
|
|
393
|
+
return 'never';
|
|
394
|
+
}
|
|
395
|
+
}),
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
protected shouldGenerateTypeDeclaration(ctx: Context, schema: ApiSchema): boolean {
|
|
400
|
+
// All named schemas should have its own type declaration
|
|
401
|
+
if (!schema.isNameGenerated) {
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// All enum types should have its own type declaration
|
|
406
|
+
if (schema.enum !== undefined && schema.enum.length > 0) {
|
|
407
|
+
return true;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// All primitive types already exist and do not need its own type declaration
|
|
411
|
+
if (
|
|
412
|
+
schema.kind !== 'array' &&
|
|
413
|
+
schema.kind !== 'combined' &&
|
|
414
|
+
schema.kind !== 'multi-type' &&
|
|
415
|
+
schema.kind !== 'object' &&
|
|
416
|
+
schema.kind !== 'oneOf'
|
|
417
|
+
) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// Dynamically generated schemas do not have its own type declaration
|
|
422
|
+
if (!ctx.data.schemas.some((x) => x.id === schema.id)) {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// For all other types, check if the user has enabled inline unnamed schemas
|
|
427
|
+
return !ctx.config.inlineUnnamedSchemas;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
protected resolveInterfaceSchema(ctx: Context): ApiSchema<'object'> | undefined {
|
|
431
|
+
if (
|
|
432
|
+
ctx.config.typeDeclaration === 'prefer-interface' &&
|
|
433
|
+
(ctx.schema.kind === 'object' || ctx.schema.kind === 'combined')
|
|
434
|
+
) {
|
|
435
|
+
return resolveAnyOfAndAllOf(ctx.schema, true);
|
|
436
|
+
}
|
|
437
|
+
return undefined;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
protected getDeclarationTypeName(ctx: Context, schema: ApiSchema): string {
|
|
441
|
+
return toCasing(schema.name, ctx.config.typeNameCasing);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
protected getDiscriminatorGenericParamName(ctx: Context, schema: ApiSchema): string {
|
|
445
|
+
return toCasing(schema.discriminator?.propertyName, ctx.config.genericParamNameCasing);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
protected getDiscriminatorTypeName(ctx: Context, schema: ApiSchema): string {
|
|
449
|
+
return toCasing(schema.name + '_Discriminator', ctx.config.typeNameCasing);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
protected getBaseTypeName(ctx: Context, schema: ApiSchema): string {
|
|
453
|
+
return toCasing(schema.name, ctx.config.discriminatorBaseTypeCasing);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
protected getInheritedSchemas(ctx: Context, schema: ApiSchema): ApiSchema['inheritedSchemas'] {
|
|
457
|
+
return schema.inheritedSchemas
|
|
458
|
+
.filter((schema) => this.shouldGenerateTypeDeclaration(ctx, schema) && !schema.isNameGenerated)
|
|
459
|
+
.filter((item, index, self) => self.indexOf(item) === index);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
protected getFilePath(ctx: Context, schema: ApiSchema): string {
|
|
463
|
+
return resolve(
|
|
464
|
+
ctx.config.outputDir,
|
|
465
|
+
ctx.config.modelsDir,
|
|
466
|
+
`${toCasing(schema.name, ctx.config.modelFileNameCasing ?? ctx.config.fileNameCasing)}.ts`,
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
}
|