@goast/typescript 0.4.1 → 0.4.2
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/src/generators/models/model-generator.js +1 -1
- package/esm/src/generators/models/models.d.ts +5 -0
- package/esm/src/generators/models/models.d.ts.map +1 -1
- package/esm/src/generators/models/models.js +1 -0
- package/esm/src/generators/services/angular-services/angular-service-generator.d.ts.map +1 -1
- package/esm/src/generators/services/angular-services/angular-service-generator.js +12 -10
- 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/package.json +2 -2
- package/script/src/generators/models/model-generator.js +1 -1
- package/script/src/generators/models/models.d.ts +5 -0
- package/script/src/generators/models/models.d.ts.map +1 -1
- package/script/src/generators/models/models.js +1 -0
- package/script/src/generators/services/angular-services/angular-service-generator.d.ts.map +1 -1
- package/script/src/generators/services/angular-services/angular-service-generator.js +12 -10
- 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/esm/_dnt.test_polyfills.d.ts +0 -29
- package/esm/_dnt.test_polyfills.d.ts.map +0 -1
- package/esm/_dnt.test_polyfills.js +0 -31
- package/esm/_dnt.test_shims.d.ts +0 -6
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/_dnt.test_shims.js +0 -61
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -30
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -136
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -45
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/false.js +0 -22
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -54
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -29
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -26
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -32
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -159
- package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts +0 -42
- package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/rejects.js +0 -53
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -57
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts +0 -20
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_equals.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts +0 -17
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.js +0 -26
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_assertion.js +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts +0 -41
- package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.js +0 -143
- package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts +0 -6
- package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_build_message.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_equal.js +0 -191
- package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_extend.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_inspect_args.js +0 -12
- package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts +0 -34
- package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_matchers.js +0 -564
- package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_mock_util.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.6/_types.d.ts +0 -838
- package/esm/deps/jsr.io/@std/expect/1.0.6/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_types.js +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts +0 -8
- package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/_utils.js +0 -159
- package/esm/deps/jsr.io/@std/expect/1.0.6/expect.d.ts +0 -52
- package/esm/deps/jsr.io/@std/expect/1.0.6/expect.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/expect.js +0 -441
- package/esm/deps/jsr.io/@std/expect/1.0.6/fn.d.ts +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.6/fn.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/fn.js +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.6/mod.d.ts +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.6/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.6/mod.js +0 -87
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -101
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -111
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -277
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -180
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/format.js +0 -37
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -207
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.4/types.js +0 -2
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -340
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -576
- package/esm/deps/jsr.io/@std/testing/1.0.3/mock.d.ts +0 -674
- package/esm/deps/jsr.io/@std/testing/1.0.3/mock.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/testing/1.0.3/mock.js +0 -1117
- package/esm/src/ast/nodes/argument.test.d.ts +0 -2
- package/esm/src/ast/nodes/argument.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/argument.test.js +0 -34
- package/esm/src/ast/nodes/array-type.test.d.ts +0 -2
- package/esm/src/ast/nodes/array-type.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/array-type.test.js +0 -26
- package/esm/src/ast/nodes/arrow-function.test.d.ts +0 -2
- package/esm/src/ast/nodes/arrow-function.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/arrow-function.test.js +0 -62
- package/esm/src/ast/nodes/class.test.d.ts +0 -2
- package/esm/src/ast/nodes/class.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/class.test.js +0 -150
- package/esm/src/ast/nodes/constructor-parameter.test.d.ts +0 -2
- package/esm/src/ast/nodes/constructor-parameter.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/constructor-parameter.test.js +0 -99
- package/esm/src/ast/nodes/constructor.test.d.ts +0 -2
- package/esm/src/ast/nodes/constructor.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/constructor.test.js +0 -102
- package/esm/src/ast/nodes/decorator.test.d.ts +0 -2
- package/esm/src/ast/nodes/decorator.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/decorator.test.js +0 -47
- package/esm/src/ast/nodes/doc-tag.test.d.ts +0 -2
- package/esm/src/ast/nodes/doc-tag.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/doc-tag.test.js +0 -30
- package/esm/src/ast/nodes/doc.test.d.ts +0 -2
- package/esm/src/ast/nodes/doc.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/doc.test.js +0 -31
- package/esm/src/ast/nodes/enum-value.test.d.ts +0 -2
- package/esm/src/ast/nodes/enum-value.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/enum-value.test.js +0 -52
- package/esm/src/ast/nodes/enum.test.d.ts +0 -2
- package/esm/src/ast/nodes/enum.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/enum.test.js +0 -66
- package/esm/src/ast/nodes/export.test.d.ts +0 -2
- package/esm/src/ast/nodes/export.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/export.test.js +0 -22
- package/esm/src/ast/nodes/function-type.test.d.ts +0 -2
- package/esm/src/ast/nodes/function-type.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/function-type.test.js +0 -48
- package/esm/src/ast/nodes/function.test.d.ts +0 -2
- package/esm/src/ast/nodes/function.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/function.test.js +0 -108
- package/esm/src/ast/nodes/generic-parameter.test.d.ts +0 -2
- package/esm/src/ast/nodes/generic-parameter.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/generic-parameter.test.js +0 -70
- package/esm/src/ast/nodes/indexer.test.d.ts +0 -2
- package/esm/src/ast/nodes/indexer.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/indexer.test.js +0 -32
- package/esm/src/ast/nodes/interface.test.d.ts +0 -2
- package/esm/src/ast/nodes/interface.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/interface.test.js +0 -115
- package/esm/src/ast/nodes/intersection-type.test.d.ts +0 -2
- package/esm/src/ast/nodes/intersection-type.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/intersection-type.test.js +0 -38
- package/esm/src/ast/nodes/method.test.d.ts +0 -2
- package/esm/src/ast/nodes/method.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/method.test.js +0 -148
- package/esm/src/ast/nodes/object-type.test.d.ts +0 -2
- package/esm/src/ast/nodes/object-type.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/object-type.test.js +0 -30
- package/esm/src/ast/nodes/object.test.d.ts +0 -2
- package/esm/src/ast/nodes/object.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/object.test.js +0 -30
- package/esm/src/ast/nodes/parameter.test.d.ts +0 -2
- package/esm/src/ast/nodes/parameter.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/parameter.test.js +0 -71
- package/esm/src/ast/nodes/property-accessor.test.d.ts +0 -2
- package/esm/src/ast/nodes/property-accessor.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/property-accessor.test.js +0 -102
- package/esm/src/ast/nodes/property.test.d.ts +0 -2
- package/esm/src/ast/nodes/property.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/property.test.js +0 -89
- package/esm/src/ast/nodes/reference.test.d.ts +0 -2
- package/esm/src/ast/nodes/reference.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/reference.test.js +0 -31
- package/esm/src/ast/nodes/string.test.d.ts +0 -2
- package/esm/src/ast/nodes/string.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/string.test.js +0 -28
- package/esm/src/ast/nodes/tuple.test.d.ts +0 -2
- package/esm/src/ast/nodes/tuple.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/tuple.test.js +0 -33
- package/esm/src/ast/nodes/type-alias.test.d.ts +0 -2
- package/esm/src/ast/nodes/type-alias.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/type-alias.test.js +0 -27
- package/esm/src/ast/nodes/union-type.test.d.ts +0 -2
- package/esm/src/ast/nodes/union-type.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/union-type.test.js +0 -38
- package/esm/src/ast/nodes/variable.test.d.ts +0 -2
- package/esm/src/ast/nodes/variable.test.d.ts.map +0 -1
- package/esm/src/ast/nodes/variable.test.js +0 -38
- package/esm/src/import-collection.test.d.ts +0 -2
- package/esm/src/import-collection.test.d.ts.map +0 -1
- package/esm/src/import-collection.test.js +0 -64
- package/esm/tests/openapi-models.test.d.ts +0 -2
- package/esm/tests/openapi-models.test.d.ts.map +0 -1
- package/esm/tests/openapi-models.test.js +0 -45
- package/script/_dnt.test_polyfills.d.ts +0 -29
- package/script/_dnt.test_polyfills.d.ts.map +0 -1
- package/script/_dnt.test_polyfills.js +0 -32
- package/script/_dnt.test_shims.d.ts +0 -6
- package/script/_dnt.test_shims.d.ts.map +0 -1
- package/script/_dnt.test_shims.js +0 -65
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts +0 -26
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/assertion_error.js +0 -34
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts +0 -17
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/equal.js +0 -139
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts +0 -22
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/equals.js +0 -48
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.6/false.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/false.js +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/instance_of.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts +0 -25
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/is_error.js +0 -57
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.6/match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts +0 -20
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_instance_of.js +0 -32
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts +0 -18
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_match.js +0 -29
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts +0 -23
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.js +0 -35
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts +0 -28
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/object_match.js +0 -162
- package/script/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts +0 -42
- package/script/deps/jsr.io/@std/assert/1.0.6/rejects.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/rejects.js +0 -56
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts +0 -24
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/assert/1.0.6/strict_equals.js +0 -60
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts +0 -20
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_equals.js +0 -32
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.js +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_assertion.js +0 -13
- package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts +0 -41
- package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.js +0 -161
- package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts +0 -6
- package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_build_message.js +0 -33
- package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.6/_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_equal.js +0 -194
- package/script/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.6/_extend.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_extend.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_inspect_args.js +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts +0 -34
- package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_matchers.js +0 -598
- package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts +0 -11
- package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_mock_util.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.6/_types.d.ts +0 -838
- package/script/deps/jsr.io/@std/expect/1.0.6/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_types.js +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts +0 -8
- package/script/deps/jsr.io/@std/expect/1.0.6/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/_utils.js +0 -166
- package/script/deps/jsr.io/@std/expect/1.0.6/expect.d.ts +0 -52
- package/script/deps/jsr.io/@std/expect/1.0.6/expect.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/expect.js +0 -445
- package/script/deps/jsr.io/@std/expect/1.0.6/fn.d.ts +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.6/fn.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/fn.js +0 -88
- package/script/deps/jsr.io/@std/expect/1.0.6/mod.d.ts +0 -85
- package/script/deps/jsr.io/@std/expect/1.0.6/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.6/mod.js +0 -90
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts +0 -75
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/assertion_state.js +0 -106
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts +0 -82
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/build_message.js +0 -116
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts +0 -140
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/diff.js +0 -284
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts +0 -99
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/diff_str.js +0 -186
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts +0 -2
- package/script/deps/jsr.io/@std/internal/1.0.4/format.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/format.js +0 -41
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts +0 -159
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/styles.js +0 -220
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts +0 -16
- package/script/deps/jsr.io/@std/internal/1.0.4/types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/internal/1.0.4/types.js +0 -3
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts +0 -74
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.3/_test_suite.js +0 -345
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts +0 -731
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.3/bdd.js +0 -587
- package/script/deps/jsr.io/@std/testing/1.0.3/mock.d.ts +0 -674
- package/script/deps/jsr.io/@std/testing/1.0.3/mock.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/testing/1.0.3/mock.js +0 -1136
- package/script/src/ast/nodes/argument.test.d.ts +0 -2
- package/script/src/ast/nodes/argument.test.d.ts.map +0 -1
- package/script/src/ast/nodes/argument.test.js +0 -36
- package/script/src/ast/nodes/array-type.test.d.ts +0 -2
- package/script/src/ast/nodes/array-type.test.d.ts.map +0 -1
- package/script/src/ast/nodes/array-type.test.js +0 -28
- package/script/src/ast/nodes/arrow-function.test.d.ts +0 -2
- package/script/src/ast/nodes/arrow-function.test.d.ts.map +0 -1
- package/script/src/ast/nodes/arrow-function.test.js +0 -64
- package/script/src/ast/nodes/class.test.d.ts +0 -2
- package/script/src/ast/nodes/class.test.d.ts.map +0 -1
- package/script/src/ast/nodes/class.test.js +0 -152
- package/script/src/ast/nodes/constructor-parameter.test.d.ts +0 -2
- package/script/src/ast/nodes/constructor-parameter.test.d.ts.map +0 -1
- package/script/src/ast/nodes/constructor-parameter.test.js +0 -101
- package/script/src/ast/nodes/constructor.test.d.ts +0 -2
- package/script/src/ast/nodes/constructor.test.d.ts.map +0 -1
- package/script/src/ast/nodes/constructor.test.js +0 -104
- package/script/src/ast/nodes/decorator.test.d.ts +0 -2
- package/script/src/ast/nodes/decorator.test.d.ts.map +0 -1
- package/script/src/ast/nodes/decorator.test.js +0 -49
- package/script/src/ast/nodes/doc-tag.test.d.ts +0 -2
- package/script/src/ast/nodes/doc-tag.test.d.ts.map +0 -1
- package/script/src/ast/nodes/doc-tag.test.js +0 -32
- package/script/src/ast/nodes/doc.test.d.ts +0 -2
- package/script/src/ast/nodes/doc.test.d.ts.map +0 -1
- package/script/src/ast/nodes/doc.test.js +0 -33
- package/script/src/ast/nodes/enum-value.test.d.ts +0 -2
- package/script/src/ast/nodes/enum-value.test.d.ts.map +0 -1
- package/script/src/ast/nodes/enum-value.test.js +0 -54
- package/script/src/ast/nodes/enum.test.d.ts +0 -2
- package/script/src/ast/nodes/enum.test.d.ts.map +0 -1
- package/script/src/ast/nodes/enum.test.js +0 -68
- package/script/src/ast/nodes/export.test.d.ts +0 -2
- package/script/src/ast/nodes/export.test.d.ts.map +0 -1
- package/script/src/ast/nodes/export.test.js +0 -24
- package/script/src/ast/nodes/function-type.test.d.ts +0 -2
- package/script/src/ast/nodes/function-type.test.d.ts.map +0 -1
- package/script/src/ast/nodes/function-type.test.js +0 -50
- package/script/src/ast/nodes/function.test.d.ts +0 -2
- package/script/src/ast/nodes/function.test.d.ts.map +0 -1
- package/script/src/ast/nodes/function.test.js +0 -110
- package/script/src/ast/nodes/generic-parameter.test.d.ts +0 -2
- package/script/src/ast/nodes/generic-parameter.test.d.ts.map +0 -1
- package/script/src/ast/nodes/generic-parameter.test.js +0 -72
- package/script/src/ast/nodes/indexer.test.d.ts +0 -2
- package/script/src/ast/nodes/indexer.test.d.ts.map +0 -1
- package/script/src/ast/nodes/indexer.test.js +0 -34
- package/script/src/ast/nodes/interface.test.d.ts +0 -2
- package/script/src/ast/nodes/interface.test.d.ts.map +0 -1
- package/script/src/ast/nodes/interface.test.js +0 -117
- package/script/src/ast/nodes/intersection-type.test.d.ts +0 -2
- package/script/src/ast/nodes/intersection-type.test.d.ts.map +0 -1
- package/script/src/ast/nodes/intersection-type.test.js +0 -40
- package/script/src/ast/nodes/method.test.d.ts +0 -2
- package/script/src/ast/nodes/method.test.d.ts.map +0 -1
- package/script/src/ast/nodes/method.test.js +0 -150
- package/script/src/ast/nodes/object-type.test.d.ts +0 -2
- package/script/src/ast/nodes/object-type.test.d.ts.map +0 -1
- package/script/src/ast/nodes/object-type.test.js +0 -32
- package/script/src/ast/nodes/object.test.d.ts +0 -2
- package/script/src/ast/nodes/object.test.d.ts.map +0 -1
- package/script/src/ast/nodes/object.test.js +0 -32
- package/script/src/ast/nodes/parameter.test.d.ts +0 -2
- package/script/src/ast/nodes/parameter.test.d.ts.map +0 -1
- package/script/src/ast/nodes/parameter.test.js +0 -73
- package/script/src/ast/nodes/property-accessor.test.d.ts +0 -2
- package/script/src/ast/nodes/property-accessor.test.d.ts.map +0 -1
- package/script/src/ast/nodes/property-accessor.test.js +0 -104
- package/script/src/ast/nodes/property.test.d.ts +0 -2
- package/script/src/ast/nodes/property.test.d.ts.map +0 -1
- package/script/src/ast/nodes/property.test.js +0 -91
- package/script/src/ast/nodes/reference.test.d.ts +0 -2
- package/script/src/ast/nodes/reference.test.d.ts.map +0 -1
- package/script/src/ast/nodes/reference.test.js +0 -33
- package/script/src/ast/nodes/string.test.d.ts +0 -2
- package/script/src/ast/nodes/string.test.d.ts.map +0 -1
- package/script/src/ast/nodes/string.test.js +0 -30
- package/script/src/ast/nodes/tuple.test.d.ts +0 -2
- package/script/src/ast/nodes/tuple.test.d.ts.map +0 -1
- package/script/src/ast/nodes/tuple.test.js +0 -35
- package/script/src/ast/nodes/type-alias.test.d.ts +0 -2
- package/script/src/ast/nodes/type-alias.test.d.ts.map +0 -1
- package/script/src/ast/nodes/type-alias.test.js +0 -29
- package/script/src/ast/nodes/union-type.test.d.ts +0 -2
- package/script/src/ast/nodes/union-type.test.d.ts.map +0 -1
- package/script/src/ast/nodes/union-type.test.js +0 -40
- package/script/src/ast/nodes/variable.test.d.ts +0 -2
- package/script/src/ast/nodes/variable.test.d.ts.map +0 -1
- package/script/src/ast/nodes/variable.test.js +0 -40
- package/script/src/import-collection.test.d.ts +0 -2
- package/script/src/import-collection.test.d.ts.map +0 -1
- package/script/src/import-collection.test.js +0 -66
- package/script/tests/openapi-models.test.d.ts +0 -2
- package/script/tests/openapi-models.test.d.ts.map +0 -1
- package/script/tests/openapi-models.test.js +0 -48
- package/src/_dnt.test_polyfills.ts +0 -70
- package/src/_dnt.test_shims.ts +0 -64
- package/src/deps/jsr.io/@std/assert/1.0.6/assertion_error.ts +0 -31
- package/src/deps/jsr.io/@std/assert/1.0.6/equal.ts +0 -152
- package/src/deps/jsr.io/@std/assert/1.0.6/equals.ts +0 -52
- package/src/deps/jsr.io/@std/assert/1.0.6/false.ts +0 -26
- package/src/deps/jsr.io/@std/assert/1.0.6/instance_of.ts +0 -64
- package/src/deps/jsr.io/@std/assert/1.0.6/is_error.ts +0 -65
- package/src/deps/jsr.io/@std/assert/1.0.6/match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.6/not_instance_of.ts +0 -33
- package/src/deps/jsr.io/@std/assert/1.0.6/not_match.ts +0 -30
- package/src/deps/jsr.io/@std/assert/1.0.6/not_strict_equals.ts +0 -42
- package/src/deps/jsr.io/@std/assert/1.0.6/object_match.ts +0 -202
- package/src/deps/jsr.io/@std/assert/1.0.6/rejects.ts +0 -123
- package/src/deps/jsr.io/@std/assert/1.0.6/strict_equals.ts +0 -67
- package/src/deps/jsr.io/@std/expect/1.0.6/_assert_equals.ts +0 -38
- package/src/deps/jsr.io/@std/expect/1.0.6/_assert_not_equals.ts +0 -35
- package/src/deps/jsr.io/@std/expect/1.0.6/_assertion.ts +0 -13
- package/src/deps/jsr.io/@std/expect/1.0.6/_asymmetric_matchers.ts +0 -177
- package/src/deps/jsr.io/@std/expect/1.0.6/_build_message.ts +0 -51
- package/src/deps/jsr.io/@std/expect/1.0.6/_custom_equality_tester.ts +0 -19
- package/src/deps/jsr.io/@std/expect/1.0.6/_equal.ts +0 -229
- package/src/deps/jsr.io/@std/expect/1.0.6/_extend.ts +0 -16
- package/src/deps/jsr.io/@std/expect/1.0.6/_inspect_args.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.6/_matchers.ts +0 -828
- package/src/deps/jsr.io/@std/expect/1.0.6/_mock_util.ts +0 -22
- package/src/deps/jsr.io/@std/expect/1.0.6/_types.ts +0 -917
- package/src/deps/jsr.io/@std/expect/1.0.6/_utils.ts +0 -201
- package/src/deps/jsr.io/@std/expect/1.0.6/expect.ts +0 -529
- package/src/deps/jsr.io/@std/expect/1.0.6/fn.ts +0 -91
- package/src/deps/jsr.io/@std/expect/1.0.6/mod.ts +0 -88
- package/src/deps/jsr.io/@std/internal/1.0.4/assertion_state.ts +0 -111
- package/src/deps/jsr.io/@std/internal/1.0.4/build_message.ts +0 -134
- package/src/deps/jsr.io/@std/internal/1.0.4/diff.ts +0 -317
- package/src/deps/jsr.io/@std/internal/1.0.4/diff_str.ts +0 -204
- package/src/deps/jsr.io/@std/internal/1.0.4/format.ts +0 -39
- package/src/deps/jsr.io/@std/internal/1.0.4/styles.ts +0 -233
- package/src/deps/jsr.io/@std/internal/1.0.4/types.ts +0 -18
- package/src/deps/jsr.io/@std/testing/1.0.3/_test_suite.ts +0 -389
- package/src/deps/jsr.io/@std/testing/1.0.3/bdd.ts +0 -1202
- package/src/deps/jsr.io/@std/testing/1.0.3/mock.ts +0 -1839
- package/src/mod.ts +0 -7
- package/src/src/assets.ts +0 -9
- package/src/src/ast/_index.ts +0 -54
- package/src/src/ast/common.ts +0 -1
- package/src/src/ast/index.ts +0 -1
- package/src/src/ast/node.ts +0 -10
- package/src/src/ast/nodes/argument.test.ts +0 -43
- package/src/src/ast/nodes/argument.ts +0 -40
- package/src/src/ast/nodes/array-type.test.ts +0 -34
- package/src/src/ast/nodes/array-type.ts +0 -49
- package/src/src/ast/nodes/arrow-function.test.ts +0 -79
- package/src/src/ast/nodes/arrow-function.ts +0 -91
- package/src/src/ast/nodes/call.ts +0 -55
- package/src/src/ast/nodes/class.test.ts +0 -185
- package/src/src/ast/nodes/class.ts +0 -133
- package/src/src/ast/nodes/constructor-parameter.test.ts +0 -122
- package/src/src/ast/nodes/constructor-parameter.ts +0 -70
- package/src/src/ast/nodes/constructor.test.ts +0 -131
- package/src/src/ast/nodes/constructor.ts +0 -77
- package/src/src/ast/nodes/decorator.test.ts +0 -59
- package/src/src/ast/nodes/decorator.ts +0 -76
- package/src/src/ast/nodes/doc-tag.test.ts +0 -40
- package/src/src/ast/nodes/doc-tag.ts +0 -291
- package/src/src/ast/nodes/doc.test.ts +0 -40
- package/src/src/ast/nodes/doc.ts +0 -102
- package/src/src/ast/nodes/enum-value.test.ts +0 -66
- package/src/src/ast/nodes/enum-value.ts +0 -72
- package/src/src/ast/nodes/enum.test.ts +0 -85
- package/src/src/ast/nodes/enum.ts +0 -77
- package/src/src/ast/nodes/export.test.ts +0 -29
- package/src/src/ast/nodes/export.ts +0 -54
- package/src/src/ast/nodes/function-type.test.ts +0 -61
- package/src/src/ast/nodes/function-type.ts +0 -60
- package/src/src/ast/nodes/function.test.ts +0 -135
- package/src/src/ast/nodes/function.ts +0 -107
- package/src/src/ast/nodes/generic-parameter.test.ts +0 -86
- package/src/src/ast/nodes/generic-parameter.ts +0 -71
- package/src/src/ast/nodes/indexer.test.ts +0 -42
- package/src/src/ast/nodes/indexer.ts +0 -60
- package/src/src/ast/nodes/interface.test.ts +0 -142
- package/src/src/ast/nodes/interface.ts +0 -117
- package/src/src/ast/nodes/intersection-type.test.ts +0 -52
- package/src/src/ast/nodes/intersection-type.ts +0 -67
- package/src/src/ast/nodes/lookup-type.ts +0 -53
- package/src/src/ast/nodes/method.test.ts +0 -185
- package/src/src/ast/nodes/method.ts +0 -138
- package/src/src/ast/nodes/object-type.test.ts +0 -40
- package/src/src/ast/nodes/object-type.ts +0 -52
- package/src/src/ast/nodes/object.test.ts +0 -40
- package/src/src/ast/nodes/object.ts +0 -48
- package/src/src/ast/nodes/parameter.test.ts +0 -88
- package/src/src/ast/nodes/parameter.ts +0 -85
- package/src/src/ast/nodes/property-accessor.test.ts +0 -132
- package/src/src/ast/nodes/property-accessor.ts +0 -173
- package/src/src/ast/nodes/property.test.ts +0 -113
- package/src/src/ast/nodes/property.ts +0 -192
- package/src/src/ast/nodes/reference.test.ts +0 -42
- package/src/src/ast/nodes/reference.ts +0 -194
- package/src/src/ast/nodes/string.test.ts +0 -35
- package/src/src/ast/nodes/string.ts +0 -49
- package/src/src/ast/nodes/tuple.test.ts +0 -45
- package/src/src/ast/nodes/tuple.ts +0 -53
- package/src/src/ast/nodes/type-alias.test.ts +0 -35
- package/src/src/ast/nodes/type-alias.ts +0 -75
- package/src/src/ast/nodes/typeof.ts +0 -42
- package/src/src/ast/nodes/types.ts +0 -40
- package/src/src/ast/nodes/union-type.test.ts +0 -50
- package/src/src/ast/nodes/union-type.ts +0 -62
- package/src/src/ast/nodes/variable.test.ts +0 -49
- package/src/src/ast/nodes/variable.ts +0 -73
- package/src/src/ast/references/angular.ts +0 -24
- package/src/src/ast/references/easy-network-stub.ts +0 -21
- package/src/src/ast/references/index.ts +0 -5
- package/src/src/ast/references/k6.ts +0 -8
- package/src/src/ast/references/rxjs.ts +0 -7
- package/src/src/ast/references/typescript.ts +0 -35
- package/src/src/ast/utils/get-type-script-builder-options.ts +0 -19
- package/src/src/ast/utils/to-ts-node.ts +0 -27
- package/src/src/ast/utils/write-ts-generic-parameters.ts +0 -25
- package/src/src/ast/utils/write-ts-members.ts +0 -28
- package/src/src/ast/utils/write-ts-nodes.ts +0 -35
- package/src/src/ast/utils/write-ts-parameters.ts +0 -25
- package/src/src/common-results.ts +0 -26
- package/src/src/config.ts +0 -89
- package/src/src/file-builder.ts +0 -136
- package/src/src/generators/file-generator.ts +0 -15
- package/src/src/generators/index.ts +0 -6
- package/src/src/generators/models/index.ts +0 -3
- package/src/src/generators/models/model-generator.ts +0 -469
- package/src/src/generators/models/models-generator.ts +0 -108
- package/src/src/generators/models/models.ts +0 -105
- package/src/src/generators/services/angular-services/angular-service-generator.ts +0 -402
- package/src/src/generators/services/angular-services/angular-services-generator.ts +0 -295
- package/src/src/generators/services/angular-services/index.ts +0 -3
- package/src/src/generators/services/angular-services/models.ts +0 -270
- package/src/src/generators/services/angular-services/refs.ts +0 -54
- package/src/src/generators/services/easy-network-stub/easy-network-stub-generator.ts +0 -242
- package/src/src/generators/services/easy-network-stub/easy-network-stubs-generator.ts +0 -211
- package/src/src/generators/services/easy-network-stub/index.ts +0 -3
- package/src/src/generators/services/easy-network-stub/models.ts +0 -124
- package/src/src/generators/services/easy-network-stub/refs.ts +0 -45
- package/src/src/generators/services/fetch-clients/fetch-client-generator.ts +0 -267
- package/src/src/generators/services/fetch-clients/fetch-clients-generator.ts +0 -163
- package/src/src/generators/services/fetch-clients/index.ts +0 -3
- package/src/src/generators/services/fetch-clients/models.ts +0 -130
- package/src/src/generators/services/fetch-clients/refs.ts +0 -21
- package/src/src/generators/services/k6-clients/index.ts +0 -3
- package/src/src/generators/services/k6-clients/k6-client-generator.ts +0 -409
- package/src/src/generators/services/k6-clients/k6-clients-generator.ts +0 -165
- package/src/src/generators/services/k6-clients/models.ts +0 -241
- package/src/src/generators/services/k6-clients/refs.ts +0 -15
- package/src/src/import-collection.test.ts +0 -78
- package/src/src/import-collection.ts +0 -236
- package/src/src/utils.ts +0 -72
- package/src/tests/openapi-models.test.ts +0 -64
- package/test_runner.js +0 -239
|
@@ -1,259 +1,259 @@
|
|
|
1
|
-
import type { EasyNetworkStub } from 'easy-network-stub';
|
|
2
|
-
|
|
3
|
-
import type { ErrorResponse, HttpMethod, RouteResponseCallback } from 'easy-network-stub';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Options for the `EasyNetworkStubWrapper`.
|
|
7
|
-
*/
|
|
8
|
-
export type EasyNetworkStubWrapperOptions = {
|
|
9
|
-
/**
|
|
10
|
-
* Delay in milliseconds before responding.
|
|
11
|
-
* @default 0
|
|
12
|
-
*/
|
|
13
|
-
delay: number;
|
|
14
|
-
/**
|
|
15
|
-
* Whether to log requests to the console.
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
|
-
logRequests: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether to log responses to the console.
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
logResponses: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Whether to remember requests. Remebered requests can be accessed via the `requests` property.
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
rememberRequests: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Function to call when a response is sent.
|
|
31
|
-
* @param response The response that was sent.
|
|
32
|
-
* @default undefined
|
|
33
|
-
*/
|
|
34
|
-
responseCallback?: (response: unknown) => void;
|
|
35
|
-
/**
|
|
36
|
-
* A prefix to add to the URL in log messages.
|
|
37
|
-
* @default /api/
|
|
38
|
-
*/
|
|
39
|
-
logUrlPrefix: string;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Represents a request intercepted by the `EasyNetworkStubWrapper`.
|
|
44
|
-
*/
|
|
45
|
-
export type StubRequestItem = {
|
|
46
|
-
/**
|
|
47
|
-
* The HTTP method of the request.
|
|
48
|
-
*/
|
|
49
|
-
method: HttpMethod;
|
|
50
|
-
/**
|
|
51
|
-
* The route of the request.
|
|
52
|
-
*/
|
|
53
|
-
route: string;
|
|
54
|
-
/**
|
|
55
|
-
* The request information provided by `easy-network-stub`.
|
|
56
|
-
*/
|
|
57
|
-
request: StubRequestInfo;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Represents the request information provided by `easy-network-stub`.
|
|
62
|
-
*/
|
|
63
|
-
export type StubRequestInfo<TRoute extends string = string, TBody = unknown> = Parameters<
|
|
64
|
-
RouteResponseCallback<TRoute, TBody>
|
|
65
|
-
>[0];
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* A strict version of `RouteResponseCallback` that allows for a responder to be passed as the first argument.
|
|
69
|
-
*/
|
|
70
|
-
export type StrictRouteResponseCallback<T, P extends string, R> = (
|
|
71
|
-
respondWith: R,
|
|
72
|
-
...args: Parameters<RouteResponseCallback<P, T>>
|
|
73
|
-
) => ErrorResponse<any> | Promise<ErrorResponse<any>>;
|
|
74
|
-
|
|
75
|
-
type _UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
76
|
-
type __StubResponder<T extends Record<number, unknown>, S> = S extends number
|
|
77
|
-
? [T[S]] extends [never] ? (statusCode: S) => ErrorResponse<T[S]>
|
|
78
|
-
: (statusCode: S, content: T[S]) => ErrorResponse<T[S]>
|
|
79
|
-
: never;
|
|
80
|
-
type _StubResponder<T extends Record<number, unknown>> = _UnionToIntersection<__StubResponder<T, keyof T>>;
|
|
81
|
-
const untypedResponder = (statusCode: number, content?: unknown) => ({ statusCode, content });
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Gets the responder function typed to a specific set of status codes.
|
|
85
|
-
* @returns The responder function.
|
|
86
|
-
*/
|
|
87
|
-
export function getStubResponder<T extends Record<number, unknown>>(): _StubResponder<T> {
|
|
88
|
-
return untypedResponder as _StubResponder<T>;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Wrapper for `EasyNetworkStub` that adds additional functionality.
|
|
93
|
-
*/
|
|
94
|
-
export class EasyNetworkStubWrapper {
|
|
95
|
-
private _requests: StubRequestItem[] = [];
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* The options for the wrapper.
|
|
99
|
-
*/
|
|
100
|
-
public readonly options: Readonly<EasyNetworkStubWrapperOptions>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* The requests that have been intercepted by the wrapper.
|
|
104
|
-
*/
|
|
105
|
-
public get requests(): ReadonlyArray<StubRequestItem> {
|
|
106
|
-
return this._requests;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
constructor(
|
|
110
|
-
public readonly wrappedStub: EasyNetworkStub,
|
|
111
|
-
options?: Partial<EasyNetworkStubWrapperOptions>,
|
|
112
|
-
) {
|
|
113
|
-
this.options = {
|
|
114
|
-
delay: options?.delay ?? 0,
|
|
115
|
-
logRequests: options?.logRequests ?? false,
|
|
116
|
-
logResponses: options?.logResponses ?? false,
|
|
117
|
-
rememberRequests: options?.rememberRequests ?? false,
|
|
118
|
-
responseCallback: options?.responseCallback,
|
|
119
|
-
logUrlPrefix: options?.logUrlPrefix ?? '/api/',
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Add a single api stub to your intercepted routes.
|
|
125
|
-
* @param method The http method that should be stubbed
|
|
126
|
-
* @param route The route that should be stubbed. Supports parameters in the form of {name:type}.
|
|
127
|
-
* @param response The callback in which you can process the request and reply with the stub. When a Promise is returned, the stub response will be delayed until it is resolved.
|
|
128
|
-
*/
|
|
129
|
-
public stub<Route extends string>(
|
|
130
|
-
method: HttpMethod,
|
|
131
|
-
route: Route,
|
|
132
|
-
response: RouteResponseCallback<Route, unknown>,
|
|
133
|
-
): void {
|
|
134
|
-
this.wrappedStub.stub<Route>(method, route, async (request) => {
|
|
135
|
-
if (this.options.delay > 0) await sleep(this.options.delay);
|
|
136
|
-
return await this.runRequest(method, route, response, request);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* The stub2 method provides a way to set the type of the body that is sent.
|
|
142
|
-
* Due to restrictions in TypeScript (https://github.com/microsoft/TypeScript/issues/10571, https://github.com/Microsoft/TypeScript/pull/26349),
|
|
143
|
-
* We have to hacke a bit here. Calling stub2<T>() will return the stub method with a body of type T.
|
|
144
|
-
*
|
|
145
|
-
* Usage:
|
|
146
|
-
* ```
|
|
147
|
-
* .stub2<MyRequest>()('GET', '/api/test', ({ body }) => {
|
|
148
|
-
* // body is of type MyRequest
|
|
149
|
-
* });
|
|
150
|
-
* ```
|
|
151
|
-
* @returns The stub method with a body of type T.
|
|
152
|
-
*/
|
|
153
|
-
public stub2<T>(): <Route extends string>(
|
|
154
|
-
method: HttpMethod,
|
|
155
|
-
route: Route,
|
|
156
|
-
response: RouteResponseCallback<Route, T>,
|
|
157
|
-
) => void {
|
|
158
|
-
return <Route extends string>(method: HttpMethod, route: Route, response: RouteResponseCallback<Route, T>) => {
|
|
159
|
-
this.wrappedStub.stub2<T>()<Route>(method, route, async (request) => {
|
|
160
|
-
if (this.options.delay > 0) await sleep(this.options.delay);
|
|
161
|
-
return await this.runRequest(method, route, response, request);
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Reset the stubs and requests.
|
|
168
|
-
*/
|
|
169
|
-
public reset(): void {
|
|
170
|
-
this._requests = [];
|
|
171
|
-
this.wrappedStub['_config'].stubs = [];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
private async runRequest<Route extends string, T>(
|
|
175
|
-
method: HttpMethod,
|
|
176
|
-
route: Route,
|
|
177
|
-
response: RouteResponseCallback<Route, T>,
|
|
178
|
-
request: StubRequestInfo<Route, T>,
|
|
179
|
-
): Promise<unknown> {
|
|
180
|
-
if (this.options.rememberRequests) {
|
|
181
|
-
this._requests.push({ method, route, request });
|
|
182
|
-
}
|
|
183
|
-
this.log('request', method, route, request, '#7FFFFF');
|
|
184
|
-
try {
|
|
185
|
-
const r = await response(request);
|
|
186
|
-
this.options.responseCallback?.(r);
|
|
187
|
-
this.log('response', method, route, r, '#7FFF8E');
|
|
188
|
-
return r;
|
|
189
|
-
} catch (error: unknown) {
|
|
190
|
-
this.options.responseCallback?.(error);
|
|
191
|
-
if (isHttpResponse(error) && error.statusCode >= 200 && error.statusCode < 300) {
|
|
192
|
-
this.log('response', method, route, error.content, '#7FFF8E');
|
|
193
|
-
throw error;
|
|
194
|
-
} else {
|
|
195
|
-
const isError = isHttpResponse(error) && error.statusCode >= 400 && error.statusCode < 600;
|
|
196
|
-
this.log('response', method, route, error, isError ? '#FF7F7F' : '7F7F7F');
|
|
197
|
-
throw error;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
private log(type: 'request' | 'response', method: HttpMethod, route: string, data: unknown, color: string) {
|
|
203
|
-
if (type === 'request' && !this.options.logRequests) return;
|
|
204
|
-
if (type === 'response' && !this.options.logResponses) return;
|
|
205
|
-
const typeDisplay = type === 'request' ? ' [req]' : '[resp]';
|
|
206
|
-
const strippedRoute = route.match(/[^?]*(?=\?)?/)?.[0];
|
|
207
|
-
console.log(`%c${typeDisplay} ${method}: ${this.options.logUrlPrefix}${strippedRoute}`, `color:${color};`, data);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Base class for generated easy network stubs.
|
|
213
|
-
*/
|
|
214
|
-
export class EasyNetworkStubBase {
|
|
215
|
-
protected readonly stubWrapper: EasyNetworkStubWrapper;
|
|
216
|
-
protected readonly ownsStubWrapper: boolean;
|
|
217
|
-
|
|
218
|
-
constructor(stub: EasyNetworkStub | EasyNetworkStubWrapper, options?: EasyNetworkStubWrapperOptions) {
|
|
219
|
-
this.stubWrapper = stub instanceof EasyNetworkStubWrapper ? stub : new EasyNetworkStubWrapper(stub, options);
|
|
220
|
-
this.ownsStubWrapper = !(stub instanceof EasyNetworkStubWrapper);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
public reset() {
|
|
224
|
-
if (this.ownsStubWrapper) {
|
|
225
|
-
this.stubWrapper.reset();
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export type EasyNetworkStubGroup<Group, GroupContainer> = Group & {
|
|
231
|
-
(stubActions: (stubs: Group) => void): GroupContainer;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
235
|
-
declare interface GroupType<T> extends Function {
|
|
236
|
-
new (stubWrapper: EasyNetworkStubWrapper): T;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export function createEasyNetworkStubGroup<GroupContainer, Group>(
|
|
240
|
-
container: GroupContainer,
|
|
241
|
-
stubWrapper: EasyNetworkStubWrapper,
|
|
242
|
-
groupType: GroupType<Group>,
|
|
243
|
-
): EasyNetworkStubGroup<Group, GroupContainer> {
|
|
244
|
-
const group = new groupType(stubWrapper);
|
|
245
|
-
const groupFn = (stubActions: (stubs: Group) => void) => {
|
|
246
|
-
stubActions(group);
|
|
247
|
-
return container;
|
|
248
|
-
};
|
|
249
|
-
Object.setPrototypeOf(groupFn, groupType.prototype);
|
|
250
|
-
return Object.assign(groupFn, group);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
function sleep(ms: number): Promise<void> {
|
|
254
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function isHttpResponse(value: unknown): value is ErrorResponse<unknown> {
|
|
258
|
-
return typeof value === 'object' && value !== null && 'statusCode' in value;
|
|
259
|
-
}
|
|
1
|
+
import type { EasyNetworkStub } from 'easy-network-stub';
|
|
2
|
+
|
|
3
|
+
import type { ErrorResponse, HttpMethod, RouteResponseCallback } from 'easy-network-stub';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Options for the `EasyNetworkStubWrapper`.
|
|
7
|
+
*/
|
|
8
|
+
export type EasyNetworkStubWrapperOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Delay in milliseconds before responding.
|
|
11
|
+
* @default 0
|
|
12
|
+
*/
|
|
13
|
+
delay: number;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to log requests to the console.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
logRequests: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether to log responses to the console.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
logResponses: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether to remember requests. Remebered requests can be accessed via the `requests` property.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
rememberRequests: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Function to call when a response is sent.
|
|
31
|
+
* @param response The response that was sent.
|
|
32
|
+
* @default undefined
|
|
33
|
+
*/
|
|
34
|
+
responseCallback?: (response: unknown) => void;
|
|
35
|
+
/**
|
|
36
|
+
* A prefix to add to the URL in log messages.
|
|
37
|
+
* @default /api/
|
|
38
|
+
*/
|
|
39
|
+
logUrlPrefix: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Represents a request intercepted by the `EasyNetworkStubWrapper`.
|
|
44
|
+
*/
|
|
45
|
+
export type StubRequestItem = {
|
|
46
|
+
/**
|
|
47
|
+
* The HTTP method of the request.
|
|
48
|
+
*/
|
|
49
|
+
method: HttpMethod;
|
|
50
|
+
/**
|
|
51
|
+
* The route of the request.
|
|
52
|
+
*/
|
|
53
|
+
route: string;
|
|
54
|
+
/**
|
|
55
|
+
* The request information provided by `easy-network-stub`.
|
|
56
|
+
*/
|
|
57
|
+
request: StubRequestInfo;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Represents the request information provided by `easy-network-stub`.
|
|
62
|
+
*/
|
|
63
|
+
export type StubRequestInfo<TRoute extends string = string, TBody = unknown> = Parameters<
|
|
64
|
+
RouteResponseCallback<TRoute, TBody>
|
|
65
|
+
>[0];
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A strict version of `RouteResponseCallback` that allows for a responder to be passed as the first argument.
|
|
69
|
+
*/
|
|
70
|
+
export type StrictRouteResponseCallback<T, P extends string, R> = (
|
|
71
|
+
respondWith: R,
|
|
72
|
+
...args: Parameters<RouteResponseCallback<P, T>>
|
|
73
|
+
) => ErrorResponse<any> | Promise<ErrorResponse<any>>;
|
|
74
|
+
|
|
75
|
+
type _UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
76
|
+
type __StubResponder<T extends Record<number, unknown>, S> = S extends number
|
|
77
|
+
? [T[S]] extends [never] ? (statusCode: S) => ErrorResponse<T[S]>
|
|
78
|
+
: (statusCode: S, content: T[S]) => ErrorResponse<T[S]>
|
|
79
|
+
: never;
|
|
80
|
+
type _StubResponder<T extends Record<number, unknown>> = _UnionToIntersection<__StubResponder<T, keyof T>>;
|
|
81
|
+
const untypedResponder = (statusCode: number, content?: unknown) => ({ statusCode, content });
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Gets the responder function typed to a specific set of status codes.
|
|
85
|
+
* @returns The responder function.
|
|
86
|
+
*/
|
|
87
|
+
export function getStubResponder<T extends Record<number, unknown>>(): _StubResponder<T> {
|
|
88
|
+
return untypedResponder as _StubResponder<T>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Wrapper for `EasyNetworkStub` that adds additional functionality.
|
|
93
|
+
*/
|
|
94
|
+
export class EasyNetworkStubWrapper {
|
|
95
|
+
private _requests: StubRequestItem[] = [];
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The options for the wrapper.
|
|
99
|
+
*/
|
|
100
|
+
public readonly options: Readonly<EasyNetworkStubWrapperOptions>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The requests that have been intercepted by the wrapper.
|
|
104
|
+
*/
|
|
105
|
+
public get requests(): ReadonlyArray<StubRequestItem> {
|
|
106
|
+
return this._requests;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
constructor(
|
|
110
|
+
public readonly wrappedStub: EasyNetworkStub,
|
|
111
|
+
options?: Partial<EasyNetworkStubWrapperOptions>,
|
|
112
|
+
) {
|
|
113
|
+
this.options = {
|
|
114
|
+
delay: options?.delay ?? 0,
|
|
115
|
+
logRequests: options?.logRequests ?? false,
|
|
116
|
+
logResponses: options?.logResponses ?? false,
|
|
117
|
+
rememberRequests: options?.rememberRequests ?? false,
|
|
118
|
+
responseCallback: options?.responseCallback,
|
|
119
|
+
logUrlPrefix: options?.logUrlPrefix ?? '/api/',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Add a single api stub to your intercepted routes.
|
|
125
|
+
* @param method The http method that should be stubbed
|
|
126
|
+
* @param route The route that should be stubbed. Supports parameters in the form of {name:type}.
|
|
127
|
+
* @param response The callback in which you can process the request and reply with the stub. When a Promise is returned, the stub response will be delayed until it is resolved.
|
|
128
|
+
*/
|
|
129
|
+
public stub<Route extends string>(
|
|
130
|
+
method: HttpMethod,
|
|
131
|
+
route: Route,
|
|
132
|
+
response: RouteResponseCallback<Route, unknown>,
|
|
133
|
+
): void {
|
|
134
|
+
this.wrappedStub.stub<Route>(method, route, async (request) => {
|
|
135
|
+
if (this.options.delay > 0) await sleep(this.options.delay);
|
|
136
|
+
return await this.runRequest(method, route, response, request);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The stub2 method provides a way to set the type of the body that is sent.
|
|
142
|
+
* Due to restrictions in TypeScript (https://github.com/microsoft/TypeScript/issues/10571, https://github.com/Microsoft/TypeScript/pull/26349),
|
|
143
|
+
* We have to hacke a bit here. Calling stub2<T>() will return the stub method with a body of type T.
|
|
144
|
+
*
|
|
145
|
+
* Usage:
|
|
146
|
+
* ```
|
|
147
|
+
* .stub2<MyRequest>()('GET', '/api/test', ({ body }) => {
|
|
148
|
+
* // body is of type MyRequest
|
|
149
|
+
* });
|
|
150
|
+
* ```
|
|
151
|
+
* @returns The stub method with a body of type T.
|
|
152
|
+
*/
|
|
153
|
+
public stub2<T>(): <Route extends string>(
|
|
154
|
+
method: HttpMethod,
|
|
155
|
+
route: Route,
|
|
156
|
+
response: RouteResponseCallback<Route, T>,
|
|
157
|
+
) => void {
|
|
158
|
+
return <Route extends string>(method: HttpMethod, route: Route, response: RouteResponseCallback<Route, T>) => {
|
|
159
|
+
this.wrappedStub.stub2<T>()<Route>(method, route, async (request) => {
|
|
160
|
+
if (this.options.delay > 0) await sleep(this.options.delay);
|
|
161
|
+
return await this.runRequest(method, route, response, request);
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Reset the stubs and requests.
|
|
168
|
+
*/
|
|
169
|
+
public reset(): void {
|
|
170
|
+
this._requests = [];
|
|
171
|
+
this.wrappedStub['_config'].stubs = [];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
private async runRequest<Route extends string, T>(
|
|
175
|
+
method: HttpMethod,
|
|
176
|
+
route: Route,
|
|
177
|
+
response: RouteResponseCallback<Route, T>,
|
|
178
|
+
request: StubRequestInfo<Route, T>,
|
|
179
|
+
): Promise<unknown> {
|
|
180
|
+
if (this.options.rememberRequests) {
|
|
181
|
+
this._requests.push({ method, route, request });
|
|
182
|
+
}
|
|
183
|
+
this.log('request', method, route, request, '#7FFFFF');
|
|
184
|
+
try {
|
|
185
|
+
const r = await response(request);
|
|
186
|
+
this.options.responseCallback?.(r);
|
|
187
|
+
this.log('response', method, route, r, '#7FFF8E');
|
|
188
|
+
return r;
|
|
189
|
+
} catch (error: unknown) {
|
|
190
|
+
this.options.responseCallback?.(error);
|
|
191
|
+
if (isHttpResponse(error) && error.statusCode >= 200 && error.statusCode < 300) {
|
|
192
|
+
this.log('response', method, route, error.content, '#7FFF8E');
|
|
193
|
+
throw error;
|
|
194
|
+
} else {
|
|
195
|
+
const isError = isHttpResponse(error) && error.statusCode >= 400 && error.statusCode < 600;
|
|
196
|
+
this.log('response', method, route, error, isError ? '#FF7F7F' : '7F7F7F');
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
private log(type: 'request' | 'response', method: HttpMethod, route: string, data: unknown, color: string) {
|
|
203
|
+
if (type === 'request' && !this.options.logRequests) return;
|
|
204
|
+
if (type === 'response' && !this.options.logResponses) return;
|
|
205
|
+
const typeDisplay = type === 'request' ? ' [req]' : '[resp]';
|
|
206
|
+
const strippedRoute = route.match(/[^?]*(?=\?)?/)?.[0];
|
|
207
|
+
console.log(`%c${typeDisplay} ${method}: ${this.options.logUrlPrefix}${strippedRoute}`, `color:${color};`, data);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Base class for generated easy network stubs.
|
|
213
|
+
*/
|
|
214
|
+
export class EasyNetworkStubBase {
|
|
215
|
+
protected readonly stubWrapper: EasyNetworkStubWrapper;
|
|
216
|
+
protected readonly ownsStubWrapper: boolean;
|
|
217
|
+
|
|
218
|
+
constructor(stub: EasyNetworkStub | EasyNetworkStubWrapper, options?: EasyNetworkStubWrapperOptions) {
|
|
219
|
+
this.stubWrapper = stub instanceof EasyNetworkStubWrapper ? stub : new EasyNetworkStubWrapper(stub, options);
|
|
220
|
+
this.ownsStubWrapper = !(stub instanceof EasyNetworkStubWrapper);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
public reset() {
|
|
224
|
+
if (this.ownsStubWrapper) {
|
|
225
|
+
this.stubWrapper.reset();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export type EasyNetworkStubGroup<Group, GroupContainer> = Group & {
|
|
231
|
+
(stubActions: (stubs: Group) => void): GroupContainer;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
235
|
+
declare interface GroupType<T> extends Function {
|
|
236
|
+
new (stubWrapper: EasyNetworkStubWrapper): T;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export function createEasyNetworkStubGroup<GroupContainer, Group>(
|
|
240
|
+
container: GroupContainer,
|
|
241
|
+
stubWrapper: EasyNetworkStubWrapper,
|
|
242
|
+
groupType: GroupType<Group>,
|
|
243
|
+
): EasyNetworkStubGroup<Group, GroupContainer> {
|
|
244
|
+
const group = new groupType(stubWrapper);
|
|
245
|
+
const groupFn = (stubActions: (stubs: Group) => void) => {
|
|
246
|
+
stubActions(group);
|
|
247
|
+
return container;
|
|
248
|
+
};
|
|
249
|
+
Object.setPrototypeOf(groupFn, groupType.prototype);
|
|
250
|
+
return Object.assign(groupFn, group);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function sleep(ms: number): Promise<void> {
|
|
254
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function isHttpResponse(value: unknown): value is ErrorResponse<unknown> {
|
|
258
|
+
return typeof value === 'object' && value !== null && 'statusCode' in value;
|
|
259
|
+
}
|
|
@@ -352,7 +352,7 @@ export class DefaultTypeScriptModelGenerator extends TypeScriptFileGenerator {
|
|
|
352
352
|
return toCasing(schema.name + '_Discriminator', ctx.config.typeNameCasing);
|
|
353
353
|
}
|
|
354
354
|
getBaseTypeName(ctx, schema) {
|
|
355
|
-
return toCasing(schema.name
|
|
355
|
+
return toCasing(schema.name, ctx.config.discriminatorBaseTypeCasing);
|
|
356
356
|
}
|
|
357
357
|
getInheritedSchemas(ctx, schema) {
|
|
358
358
|
return schema.inheritedSchemas
|
|
@@ -36,6 +36,11 @@ export type TypeScriptModelGeneratorConfig = TypeScriptGeneratorConfig & {
|
|
|
36
36
|
* @default 'type'
|
|
37
37
|
*/
|
|
38
38
|
typeDeclaration: 'type' | 'prefer-interface';
|
|
39
|
+
/**
|
|
40
|
+
* The casing to use for the base type of discriminator schemas.
|
|
41
|
+
* @default `_<SchemaName>Base`
|
|
42
|
+
*/
|
|
43
|
+
discriminatorBaseTypeCasing: ExtendedStringCasing;
|
|
39
44
|
};
|
|
40
45
|
export type TypeScriptModelsGeneratorConfig = TypeScriptModelGeneratorConfig & {
|
|
41
46
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/src/generators/models/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,oBAAoB,EACpB,QAAQ,EACR,uCAAuC,EACxC,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAoC,KAAK,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAEnG,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,GAAG;IACvE;;;;;OAKG;IACH,cAAc,EAAE,OAAO,GAAG,aAAa,CAAC;IAExC;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,mBAAmB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAEpD;;;;;OAKG;IACH,eAAe,EAAE,MAAM,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/src/generators/models/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,oBAAoB,EACpB,QAAQ,EACR,uCAAuC,EACxC,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAoC,KAAK,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAEnG,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,GAAG;IACvE;;;;;OAKG;IACH,cAAc,EAAE,OAAO,GAAG,aAAa,CAAC;IAExC;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,mBAAmB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAEpD;;;;;OAKG;IACH,eAAe,EAAE,MAAM,GAAG,kBAAkB,CAAC;IAE7C;;;OAGG;IACH,2BAA2B,EAAE,oBAAoB,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,8BAA8B,GAAG;IAC7E;;;OAGG;IACH,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,+BAA+B,CAAC,8BAA8B,CAUjH,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,+BAA+B,CAAC,+BAA+B,CAKjH,CAAC;AAGJ,MAAM,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAEhD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,UAAU,EAAE;QACV,MAAM,EAAE;YACN,CAAC,QAAQ,EAAE,MAAM,GAAG,8BAA8B,CAAC;SACpD,CAAC;QACF,UAAU,EAAE;YACV,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;SAC1B,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,CAAC;AAEvE,MAAM,MAAM,gCAAgC,GAAG,uCAAuC,CACpF,8BAA8B,EAC9B,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,CAC/B,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,gCAAgC,GAAG;IAC/E,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC"}
|
|
@@ -7,6 +7,7 @@ export const defaultTypeScriptModelGeneratorConfig = {
|
|
|
7
7
|
modelsDir: 'models',
|
|
8
8
|
modelFileNameCasing: undefined,
|
|
9
9
|
typeDeclaration: 'type',
|
|
10
|
+
discriminatorBaseTypeCasing: { casing: 'pascal', prefix: '_', suffix: 'Base' },
|
|
10
11
|
};
|
|
11
12
|
export const defaultTypeScriptModelsGeneratorConfig = {
|
|
12
13
|
...defaultTypeScriptModelGeneratorConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"angular-service-generator.d.ts","sourceRoot":"","sources":["../../../../../src/src/generators/services/angular-services/angular-service-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,gBAAgB,EAGrB,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,wCAAwC,EAAE,uCAAuC,EAAE,MAAM,aAAa,CAAC;AAErH,KAAK,OAAO,GAAG,wCAAwC,CAAC;AACxD,KAAK,MAAM,GAAG,uCAAuC,CAAC;AACtD,KAAK,OAAO,GAAG,qBAAqB,CAAC;AAErC,MAAM,WAAW,iCAAiC,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAChF,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,qBAAa,wCAAyC,SAAQ,uBAAuB,CAAC,OAAO,EAAE,MAAM,CACnG,YAAW,iCAAiC;IACrC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC;IAqBnD,SAAS,CAAC,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;IAetF,SAAS,CAAC,2BAA2B,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"angular-service-generator.d.ts","sourceRoot":"","sources":["../../../../../src/src/generators/services/angular-services/angular-service-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,gBAAgB,EAGrB,KAAK,YAAY,EAGlB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,wCAAwC,EAAE,uCAAuC,EAAE,MAAM,aAAa,CAAC;AAErH,KAAK,OAAO,GAAG,wCAAwC,CAAC;AACxD,KAAK,MAAM,GAAG,uCAAuC,CAAC;AACtD,KAAK,OAAO,GAAG,qBAAqB,CAAC;AAErC,MAAM,WAAW,iCAAiC,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAChF,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,qBAAa,wCAAyC,SAAQ,uBAAuB,CAAC,OAAO,EAAE,MAAM,CACnG,YAAW,iCAAiC;IACrC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC;IAqBnD,SAAS,CAAC,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC;IAetF,SAAS,CAAC,2BAA2B,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC;IAmErG,SAAS,CAAC,sBAAsB,CAC9B,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,WAAW,GACpB,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC;IAwBtE,SAAS,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;IAWxE,SAAS,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;IAkC3F,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;IAgCnD,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;IAiGpF,SAAS,CAAC,8BAA8B,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM;IAarF,SAAS,CAAC,0BAA0B,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS;IAOnG,SAAS,CAAC,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAInD,SAAS,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM;IAI3E,SAAS,CAAC,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM;IAIhF,SAAS,CAAC,2BAA2B,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM;IAIlF,SAAS,CAAC,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM;IAI5E,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAQlD,SAAS,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAQxD,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO;IAI1E,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;IAMnH,OAAO,CAAC,yBAAyB;CAGlC"}
|
|
@@ -50,7 +50,9 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
50
50
|
...Object.entries(statusCodes).map(([key, value]) => {
|
|
51
51
|
const isSuccess = key.startsWith('2');
|
|
52
52
|
return ts.intersectionType([
|
|
53
|
-
isSuccess
|
|
53
|
+
isSuccess
|
|
54
|
+
? ts.refs.angular.httpResponse([value.type])
|
|
55
|
+
: ts.refs.omit([ts.refs.angular.httpErrorResponse(), ts.string('error')]),
|
|
54
56
|
ts.objectType({
|
|
55
57
|
members: [
|
|
56
58
|
isSuccess ? null : ts.property('error', { type: ts.unionType([value.type, ts.refs.null_()]) }),
|
|
@@ -230,13 +232,13 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
230
232
|
}
|
|
231
233
|
: null,
|
|
232
234
|
'',
|
|
233
|
-
s `return ${ctx.refs.waitForResponse([responseModelType])}(${s.indent `
|
|
234
|
-
this.http.request(rb.build({${s.indent `
|
|
235
|
-
responseType: ${ts.string(responseType)},
|
|
236
|
-
accept: ${ts.string(accept)},
|
|
237
|
-
context,`}
|
|
238
|
-
})),
|
|
239
|
-
{${s.indent `
|
|
235
|
+
s `return ${ctx.refs.waitForResponse([responseModelType])}(${s.indent `
|
|
236
|
+
this.http.request(rb.build({${s.indent `
|
|
237
|
+
responseType: ${ts.string(responseType)},
|
|
238
|
+
accept: ${ts.string(accept)},
|
|
239
|
+
context,`}
|
|
240
|
+
})),
|
|
241
|
+
{${s.indent `
|
|
240
242
|
errorResponseTypes: ${ts.object({
|
|
241
243
|
members: [
|
|
242
244
|
...Object.entries(this.getEndpointStatusCodes(ctx, endpoint))
|
|
@@ -245,8 +247,8 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
245
247
|
return ts.property(key, { value: ts.string(value.parser) });
|
|
246
248
|
}),
|
|
247
249
|
],
|
|
248
|
-
})}`}
|
|
249
|
-
}`}
|
|
250
|
+
})}`}
|
|
251
|
+
}`}
|
|
250
252
|
)`,
|
|
251
253
|
], '\n'),
|
|
252
254
|
});
|
|
@@ -94,15 +94,15 @@ export class DefaultTypeScriptEasyNetworkStubGenerator extends TypeScriptFileGen
|
|
|
94
94
|
],
|
|
95
95
|
returnType: 'this',
|
|
96
96
|
body: appendValueGroup([
|
|
97
|
-
s `this.stubWrapper.stub2<${requestType}>()(${s.indent `
|
|
98
|
-
${ts.string(endpoint.method.toUpperCase())},
|
|
99
|
-
${this.getStubClassName(ctx)}.${this.getEndpointPathPropertyName(ctx, endpoint)},
|
|
100
|
-
async (request) => {${s.indent `
|
|
101
|
-
if (this.stubWrapper.options.rememberRequests) {${s.indent `
|
|
102
|
-
this.${this.getEndpointRequestsFieldName(ctx, endpoint)}.push(request);`}
|
|
103
|
-
}
|
|
104
|
-
throw await response(${this.getResponderVariableName(ctx, endpoint)}, request);`}
|
|
105
|
-
}`}
|
|
97
|
+
s `this.stubWrapper.stub2<${requestType}>()(${s.indent `
|
|
98
|
+
${ts.string(endpoint.method.toUpperCase())},
|
|
99
|
+
${this.getStubClassName(ctx)}.${this.getEndpointPathPropertyName(ctx, endpoint)},
|
|
100
|
+
async (request) => {${s.indent `
|
|
101
|
+
if (this.stubWrapper.options.rememberRequests) {${s.indent `
|
|
102
|
+
this.${this.getEndpointRequestsFieldName(ctx, endpoint)}.push(request);`}
|
|
103
|
+
}
|
|
104
|
+
throw await response(${this.getResponderVariableName(ctx, endpoint)}, request);`}
|
|
105
|
+
}`}
|
|
106
106
|
);`,
|
|
107
107
|
'return this;',
|
|
108
108
|
], '\n'),
|