@goast/typescript 0.4.0 → 0.4.1-beta1
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/assets.js +1 -1
- 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/package.json +2 -2
- package/script/src/assets.js +1 -1
- 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/esm/_dnt.test_polyfills.d.ts +0 -18
- package/esm/_dnt.test_polyfills.d.ts.map +0 -1
- package/esm/_dnt.test_polyfills.js +0 -17
- 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.5/_assert_equals.d.ts +0 -20
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +0 -17
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +0 -26
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_assertion.js +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +0 -36
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +0 -124
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +0 -6
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_build_message.js +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +0 -9
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_equal.js +0 -191
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +0 -4
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_extend.js +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +0 -12
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +0 -34
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -564
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +0 -11
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +0 -10
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +0 -838
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_types.js +0 -3
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +0 -8
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/_utils.js +0 -159
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +0 -51
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/expect.js +0 -425
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +0 -29
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/fn.js +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +0 -85
- package/esm/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/expect/1.0.5/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 -18
- package/script/_dnt.test_polyfills.d.ts.map +0 -1
- package/script/_dnt.test_polyfills.js +0 -18
- 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.5/_assert_equals.d.ts +0 -20
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_equals.js +0 -32
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.js +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_assertion.js +0 -13
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts +0 -36
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.js +0 -140
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts +0 -6
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_build_message.js +0 -33
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts +0 -9
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_equal.js +0 -194
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_extend.js +0 -15
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts +0 -3
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_inspect_args.js +0 -17
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts +0 -34
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_matchers.js +0 -598
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts +0 -11
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_mock_util.js +0 -14
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts +0 -838
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_types.js +0 -4
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts +0 -8
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/_utils.js +0 -166
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts +0 -51
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/expect.js +0 -429
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts +0 -29
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/fn.js +0 -88
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts +0 -85
- package/script/deps/jsr.io/@std/expect/1.0.5/mod.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/expect/1.0.5/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 -43
- 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.5/_assert_equals.ts +0 -38
- package/src/deps/jsr.io/@std/expect/1.0.5/_assert_not_equals.ts +0 -35
- package/src/deps/jsr.io/@std/expect/1.0.5/_assertion.ts +0 -13
- package/src/deps/jsr.io/@std/expect/1.0.5/_asymmetric_matchers.ts +0 -147
- package/src/deps/jsr.io/@std/expect/1.0.5/_build_message.ts +0 -51
- package/src/deps/jsr.io/@std/expect/1.0.5/_custom_equality_tester.ts +0 -19
- package/src/deps/jsr.io/@std/expect/1.0.5/_equal.ts +0 -229
- package/src/deps/jsr.io/@std/expect/1.0.5/_extend.ts +0 -16
- package/src/deps/jsr.io/@std/expect/1.0.5/_inspect_args.ts +0 -15
- package/src/deps/jsr.io/@std/expect/1.0.5/_matchers.ts +0 -828
- package/src/deps/jsr.io/@std/expect/1.0.5/_mock_util.ts +0 -22
- package/src/deps/jsr.io/@std/expect/1.0.5/_types.ts +0 -917
- package/src/deps/jsr.io/@std/expect/1.0.5/_utils.ts +0 -201
- package/src/deps/jsr.io/@std/expect/1.0.5/expect.ts +0 -511
- package/src/deps/jsr.io/@std/expect/1.0.5/fn.ts +0 -91
- package/src/deps/jsr.io/@std/expect/1.0.5/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
|
+
}
|
package/esm/src/assets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssetManager } from '@goast/core';
|
|
2
2
|
import { pathToFileURL } from 'node:url';
|
|
3
3
|
const scriptUrl = typeof __filename === 'undefined' ? import.meta.url : pathToFileURL(__filename);
|
|
4
|
-
const manager = new AssetManager(new URL('
|
|
4
|
+
const manager = new AssetManager(new URL('../../assets/', scriptUrl));
|
|
5
5
|
export const getAssetFileContent = manager.getAssetFileContent.bind(manager);
|
|
6
6
|
export const copyAssetFile = manager.copyAssetFile.bind(manager);
|
|
@@ -230,13 +230,13 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
230
230
|
}
|
|
231
231
|
: null,
|
|
232
232
|
'',
|
|
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 `
|
|
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 `
|
|
240
240
|
errorResponseTypes: ${ts.object({
|
|
241
241
|
members: [
|
|
242
242
|
...Object.entries(this.getEndpointStatusCodes(ctx, endpoint))
|
|
@@ -245,8 +245,8 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
245
245
|
return ts.property(key, { value: ts.string(value.parser) });
|
|
246
246
|
}),
|
|
247
247
|
],
|
|
248
|
-
})}`}
|
|
249
|
-
}`}
|
|
248
|
+
})}`}
|
|
249
|
+
}`}
|
|
250
250
|
)`,
|
|
251
251
|
], '\n'),
|
|
252
252
|
});
|
|
@@ -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'),
|
|
@@ -131,7 +131,7 @@ export class DefaultTypeScriptFetchClientGenerator extends TypeScriptFileGenerat
|
|
|
131
131
|
const method = this.getInterfaceEndpointMethod(ctx, endpoint);
|
|
132
132
|
method.accessModifier = 'public';
|
|
133
133
|
method.body = appendValueGroup([
|
|
134
|
-
s `const url = new ${ctx.refs.urlBuilder()}(this.options.baseUrl)${s.indent `
|
|
134
|
+
s `const url = new ${ctx.refs.urlBuilder()}(this.options.baseUrl)${s.indent `
|
|
135
135
|
.withPath(${ts.string(endpoint.path)})${(b) => b.forEach(endpoint.parameters, (b, p) => {
|
|
136
136
|
switch (p.target) {
|
|
137
137
|
case 'path':
|
|
@@ -141,7 +141,7 @@ export class DefaultTypeScriptFetchClientGenerator extends TypeScriptFileGenerat
|
|
|
141
141
|
b.append(s `\n.withQueryParam(${ts.string(p.name)}, params.${toCasing(p.name, ctx.config.paramNameCasing)})`);
|
|
142
142
|
break;
|
|
143
143
|
}
|
|
144
|
-
})}
|
|
144
|
+
})}
|
|
145
145
|
.build();`}`,
|
|
146
146
|
s `const response = (this.options.fetch ?? fetch)(url, ${ts.object({
|
|
147
147
|
members: [
|
|
@@ -188,7 +188,7 @@ export class DefaultTypeScriptK6ClientGenerator extends TypeScriptFileGenerator
|
|
|
188
188
|
],
|
|
189
189
|
}),
|
|
190
190
|
parameters: [ts.constructorParameter('rootUrl'), ts.constructorParameter('defaultK6ParamsFactory')],
|
|
191
|
-
body: s `this.rootUrl = rootUrl;
|
|
191
|
+
body: s `this.rootUrl = rootUrl;
|
|
192
192
|
this._defaultK6ParamsFactory = defaultK6ParamsFactory;`,
|
|
193
193
|
}),
|
|
194
194
|
...ctx.service.endpoints.map((e) => this.getEndpointMethod(ctx, e)),
|
|
@@ -249,11 +249,11 @@ export class DefaultTypeScriptK6ClientGenerator extends TypeScriptFileGenerator
|
|
|
249
249
|
}
|
|
250
250
|
: null,
|
|
251
251
|
'',
|
|
252
|
-
s `return /** @type {${returnType}} */ (${s.indent `
|
|
253
|
-
${ctx.config.async ? 'await rb.buildAsync' : 'rb.build'}({${s.indent `
|
|
254
|
-
accept: ${ts.string(accept)},
|
|
255
|
-
params: this.getK6Params(k6Params),`}
|
|
256
|
-
})`}
|
|
252
|
+
s `return /** @type {${returnType}} */ (${s.indent `
|
|
253
|
+
${ctx.config.async ? 'await rb.buildAsync' : 'rb.build'}({${s.indent `
|
|
254
|
+
accept: ${ts.string(accept)},
|
|
255
|
+
params: this.getK6Params(k6Params),`}
|
|
256
|
+
})`}
|
|
257
257
|
);`,
|
|
258
258
|
], '\n'),
|
|
259
259
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goast/typescript",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1-beta1",
|
|
4
4
|
"description": "Provides gOAst generators for generating TypeScript code from OpenAPI specifications.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Marc Schmidt (MaSch0212)",
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
"@types/fs-extra": "^11.0.4"
|
|
36
36
|
},
|
|
37
37
|
"_generatedBy": "dnt@dev"
|
|
38
|
-
}
|
|
38
|
+
}
|
package/script/src/assets.js
CHANGED
|
@@ -4,6 +4,6 @@ exports.copyAssetFile = exports.getAssetFileContent = void 0;
|
|
|
4
4
|
const core_1 = require("@goast/core");
|
|
5
5
|
const node_url_1 = require("node:url");
|
|
6
6
|
const scriptUrl = typeof __filename === 'undefined' ? require("url").pathToFileURL(__filename).href : (0, node_url_1.pathToFileURL)(__filename);
|
|
7
|
-
const manager = new core_1.AssetManager(new URL('
|
|
7
|
+
const manager = new core_1.AssetManager(new URL('../../assets/', scriptUrl));
|
|
8
8
|
exports.getAssetFileContent = manager.getAssetFileContent.bind(manager);
|
|
9
9
|
exports.copyAssetFile = manager.copyAssetFile.bind(manager);
|