@goast/typescript 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{script/deps/jsr.io/@std/expect/1.0.12 → esm/deps/jsr.io/@std/expect/1.0.13}/_assert_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_is_error.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_not_equals.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assertions.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_asymmetric_matchers.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_build_message.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_custom_equality_tester.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_equal.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_extend.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_inspect_args.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_matchers.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_mock_util.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_serializer.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_types.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_utils.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/expect.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/fn.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/mod.d.ts.map +1 -1
- package/esm/src/ast/nodes/argument.test.js +1 -1
- package/esm/src/ast/nodes/array-type.test.js +1 -1
- package/esm/src/ast/nodes/arrow-function.test.js +1 -1
- package/esm/src/ast/nodes/class.test.js +1 -1
- package/esm/src/ast/nodes/constructor-parameter.test.js +1 -1
- package/esm/src/ast/nodes/constructor.test.js +1 -1
- package/esm/src/ast/nodes/decorator.test.js +1 -1
- package/esm/src/ast/nodes/doc-tag.test.js +1 -1
- package/esm/src/ast/nodes/doc.test.js +1 -1
- package/esm/src/ast/nodes/enum-value.test.js +1 -1
- package/esm/src/ast/nodes/enum.test.js +1 -1
- package/esm/src/ast/nodes/export.test.js +1 -1
- package/esm/src/ast/nodes/function-type.test.js +1 -1
- package/esm/src/ast/nodes/function.test.js +1 -1
- package/esm/src/ast/nodes/generic-parameter.test.js +1 -1
- package/esm/src/ast/nodes/indexer.test.js +1 -1
- package/esm/src/ast/nodes/interface.test.js +1 -1
- package/esm/src/ast/nodes/intersection-type.test.js +1 -1
- package/esm/src/ast/nodes/method.test.js +1 -1
- package/esm/src/ast/nodes/object-type.test.js +1 -1
- package/esm/src/ast/nodes/object.test.js +1 -1
- package/esm/src/ast/nodes/parameter.test.js +1 -1
- package/esm/src/ast/nodes/property-accessor.test.js +1 -1
- package/esm/src/ast/nodes/property.test.js +1 -1
- package/esm/src/ast/nodes/reference.test.js +1 -1
- package/esm/src/ast/nodes/string.test.js +1 -1
- package/esm/src/ast/nodes/tuple.test.js +1 -1
- package/esm/src/ast/nodes/type-alias.test.js +1 -1
- package/esm/src/ast/nodes/union-type.test.js +1 -1
- package/esm/src/ast/nodes/variable.test.js +1 -1
- package/esm/src/generators/services/angular-services/angular-service-generator.d.ts +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 +22 -21
- package/esm/src/generators/services/angular-services/models.d.ts +6 -1
- package/esm/src/generators/services/angular-services/models.d.ts.map +1 -1
- package/esm/src/generators/services/angular-services/models.js +2 -1
- package/esm/src/import-collection.test.js +1 -1
- package/package.json +1 -1
- package/{esm/deps/jsr.io/@std/expect/1.0.12 → script/deps/jsr.io/@std/expect/1.0.13}/_assert_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_is_error.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_not_equals.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assertions.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_asymmetric_matchers.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_build_message.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_custom_equality_tester.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_equal.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_extend.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_inspect_args.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_matchers.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_mock_util.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_serializer.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_types.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_utils.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/expect.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/fn.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/mod.d.ts.map +1 -1
- package/script/src/ast/nodes/argument.test.js +1 -1
- package/script/src/ast/nodes/array-type.test.js +1 -1
- package/script/src/ast/nodes/arrow-function.test.js +1 -1
- package/script/src/ast/nodes/class.test.js +1 -1
- package/script/src/ast/nodes/constructor-parameter.test.js +1 -1
- package/script/src/ast/nodes/constructor.test.js +1 -1
- package/script/src/ast/nodes/decorator.test.js +1 -1
- package/script/src/ast/nodes/doc-tag.test.js +1 -1
- package/script/src/ast/nodes/doc.test.js +1 -1
- package/script/src/ast/nodes/enum-value.test.js +1 -1
- package/script/src/ast/nodes/enum.test.js +1 -1
- package/script/src/ast/nodes/export.test.js +1 -1
- package/script/src/ast/nodes/function-type.test.js +1 -1
- package/script/src/ast/nodes/function.test.js +1 -1
- package/script/src/ast/nodes/generic-parameter.test.js +1 -1
- package/script/src/ast/nodes/indexer.test.js +1 -1
- package/script/src/ast/nodes/interface.test.js +1 -1
- package/script/src/ast/nodes/intersection-type.test.js +1 -1
- package/script/src/ast/nodes/method.test.js +1 -1
- package/script/src/ast/nodes/object-type.test.js +1 -1
- package/script/src/ast/nodes/object.test.js +1 -1
- package/script/src/ast/nodes/parameter.test.js +1 -1
- package/script/src/ast/nodes/property-accessor.test.js +1 -1
- package/script/src/ast/nodes/property.test.js +1 -1
- package/script/src/ast/nodes/reference.test.js +1 -1
- package/script/src/ast/nodes/string.test.js +1 -1
- package/script/src/ast/nodes/tuple.test.js +1 -1
- package/script/src/ast/nodes/type-alias.test.js +1 -1
- package/script/src/ast/nodes/union-type.test.js +1 -1
- package/script/src/ast/nodes/variable.test.js +1 -1
- package/script/src/generators/services/angular-services/angular-service-generator.d.ts +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 +22 -21
- package/script/src/generators/services/angular-services/models.d.ts +6 -1
- package/script/src/generators/services/angular-services/models.d.ts.map +1 -1
- package/script/src/generators/services/angular-services/models.js +2 -1
- package/script/src/import-collection.test.js +1 -1
- package/src/src/ast/nodes/argument.test.ts +1 -1
- package/src/src/ast/nodes/array-type.test.ts +1 -1
- package/src/src/ast/nodes/arrow-function.test.ts +1 -1
- package/src/src/ast/nodes/class.test.ts +1 -1
- package/src/src/ast/nodes/constructor-parameter.test.ts +1 -1
- package/src/src/ast/nodes/constructor.test.ts +1 -1
- package/src/src/ast/nodes/decorator.test.ts +1 -1
- package/src/src/ast/nodes/doc-tag.test.ts +1 -1
- package/src/src/ast/nodes/doc.test.ts +1 -1
- package/src/src/ast/nodes/enum-value.test.ts +1 -1
- package/src/src/ast/nodes/enum.test.ts +1 -1
- package/src/src/ast/nodes/export.test.ts +1 -1
- package/src/src/ast/nodes/function-type.test.ts +1 -1
- package/src/src/ast/nodes/function.test.ts +1 -1
- package/src/src/ast/nodes/generic-parameter.test.ts +1 -1
- package/src/src/ast/nodes/indexer.test.ts +1 -1
- package/src/src/ast/nodes/interface.test.ts +1 -1
- package/src/src/ast/nodes/intersection-type.test.ts +1 -1
- package/src/src/ast/nodes/method.test.ts +1 -1
- package/src/src/ast/nodes/object-type.test.ts +1 -1
- package/src/src/ast/nodes/object.test.ts +1 -1
- package/src/src/ast/nodes/parameter.test.ts +1 -1
- package/src/src/ast/nodes/property-accessor.test.ts +1 -1
- package/src/src/ast/nodes/property.test.ts +1 -1
- package/src/src/ast/nodes/reference.test.ts +1 -1
- package/src/src/ast/nodes/string.test.ts +1 -1
- package/src/src/ast/nodes/tuple.test.ts +1 -1
- package/src/src/ast/nodes/type-alias.test.ts +1 -1
- package/src/src/ast/nodes/union-type.test.ts +1 -1
- package/src/src/ast/nodes/variable.test.ts +1 -1
- package/src/src/generators/services/angular-services/angular-service-generator.ts +7 -5
- package/src/src/generators/services/angular-services/models.ts +9 -2
- package/src/src/import-collection.test.ts +1 -1
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_equals.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_is_error.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_is_error.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_not_equals.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_not_equals.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assertions.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assertions.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_asymmetric_matchers.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_asymmetric_matchers.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_build_message.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_build_message.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_custom_equality_tester.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_custom_equality_tester.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_equal.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_equal.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_extend.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_extend.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_inspect_args.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_inspect_args.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_matchers.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_matchers.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_mock_util.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_mock_util.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_serializer.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_serializer.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_types.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_types.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_utils.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_utils.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/expect.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/expect.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/fn.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/fn.js +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/mod.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/mod.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_equals.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_is_error.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_is_error.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_not_equals.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_not_equals.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assertions.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assertions.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_asymmetric_matchers.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_asymmetric_matchers.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_build_message.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_build_message.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_custom_equality_tester.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_custom_equality_tester.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_equal.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_equal.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_extend.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_extend.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_inspect_args.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_inspect_args.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_matchers.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_matchers.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_mock_util.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_mock_util.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_serializer.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_serializer.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_types.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_types.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_utils.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_utils.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/expect.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/expect.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/fn.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/fn.js +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/mod.d.ts +0 -0
- /package/script/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/mod.js +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_equals.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_is_error.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assert_not_equals.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_assertions.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_asymmetric_matchers.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_build_message.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_custom_equality_tester.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_equal.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_extend.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_inspect_args.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_matchers.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_mock_util.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_serializer.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_types.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/_utils.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/expect.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/fn.ts +0 -0
- /package/src/deps/jsr.io/@std/expect/{1.0.12 → 1.0.13}/mod.ts +0 -0
|
@@ -214,25 +214,22 @@ class DefaultTypeScriptAngularServiceGenerator extends file_generator_js_1.TypeS
|
|
|
214
214
|
body: (0, core_1.appendValueGroup)([
|
|
215
215
|
(0, core_1.builderTemplate) `const rb = new ${ctx.refs.requestBuilder()}(this.rootUrl, ${this.getServiceClassName(ctx)}.${this.getEndpointPathPropertyName(ctx, endpoint)}, '${endpoint.method}');`,
|
|
216
216
|
hasParams
|
|
217
|
-
? (b) => {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
})
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
: null,
|
|
234
|
-
], '\n'), { multiline: true });
|
|
235
|
-
}
|
|
217
|
+
? (b) => b.appendIf(paramsOptional, 'if (params) ').parenthesizeIf(paramsOptional, '{}', (0, core_1.appendValueGroup)([
|
|
218
|
+
...endpoint.parameters
|
|
219
|
+
.filter((p) => p.target === 'path' || p.target === 'query' || p.target === 'header')
|
|
220
|
+
.map((p) => {
|
|
221
|
+
const options = index_js_1.ts.object({
|
|
222
|
+
members: [
|
|
223
|
+
p.style !== undefined ? index_js_1.ts.property('style', { value: index_js_1.ts.string(p.style) }) : null,
|
|
224
|
+
p.explode !== undefined ? index_js_1.ts.property('explode', { value: index_js_1.ts.toNode(p.explode) }) : null,
|
|
225
|
+
],
|
|
226
|
+
});
|
|
227
|
+
return (0, core_1.builderTemplate) `rb.${p.target}(${index_js_1.ts.string(p.name)}, params.${(0, core_1.toCasing)(p.name, ctx.config.propertyNameCasing)}, ${options});`;
|
|
228
|
+
}),
|
|
229
|
+
endpoint.requestBody
|
|
230
|
+
? (0, core_1.builderTemplate) `rb.body(params.body, ${index_js_1.ts.string(this.getEndpointRequestContentType(ctx, endpoint))});`
|
|
231
|
+
: null,
|
|
232
|
+
], '\n'), { multiline: true })
|
|
236
233
|
: null,
|
|
237
234
|
'',
|
|
238
235
|
(0, core_1.builderTemplate) `return ${ctx.refs.waitForResponse([responseModelType])}(${core_1.builderTemplate.indent `
|
|
@@ -256,14 +253,18 @@ class DefaultTypeScriptAngularServiceGenerator extends file_generator_js_1.TypeS
|
|
|
256
253
|
], '\n'),
|
|
257
254
|
});
|
|
258
255
|
}
|
|
256
|
+
getEndpointRequestContentType(ctx, endpoint) {
|
|
257
|
+
var _a, _b, _c;
|
|
258
|
+
return (_c = (_a = ctx.config.defaultRequestContentType) !== null && _a !== void 0 ? _a : (_b = endpoint === null || endpoint === void 0 ? void 0 : endpoint.requestBody) === null || _b === void 0 ? void 0 : _b.content[0].type) !== null && _c !== void 0 ? _c : 'application/json';
|
|
259
|
+
}
|
|
259
260
|
getEndpointSuccessResponseType(ctx, endpoint) {
|
|
260
261
|
var _a, _b, _c, _d, _e, _f;
|
|
261
262
|
const response = this.getEndpointSuccessResponse(ctx, endpoint);
|
|
262
263
|
if (!response)
|
|
263
264
|
return '*/*';
|
|
264
|
-
if (!ctx.config.
|
|
265
|
+
if (!ctx.config.defaultSuccessResponseContentType)
|
|
265
266
|
return (_b = (_a = response.contentOptions[0]) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : '*/*';
|
|
266
|
-
return ((_f = (_d = (_c = response.contentOptions.find((x) => x.type === ctx.config.
|
|
267
|
+
return ((_f = (_d = (_c = response.contentOptions.find((x) => x.type === ctx.config.defaultSuccessResponseContentType)) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : (_e = response.contentOptions[0]) === null || _e === void 0 ? void 0 : _e.type) !== null && _f !== void 0 ? _f : '*/*');
|
|
267
268
|
}
|
|
268
269
|
getEndpointSuccessResponse(_ctx, endpoint) {
|
|
269
270
|
var _a;
|
|
@@ -51,11 +51,16 @@ export type TypeScriptAngularServicesGeneratorConfig = TypeScriptGeneratorConfig
|
|
|
51
51
|
parser: 'text' | 'json';
|
|
52
52
|
type: Exclude<ts.Type<TypeScriptFileBuilder>, Function> | ((schemas: readonly ApiSchema[]) => ApiSchema);
|
|
53
53
|
} | null>;
|
|
54
|
+
/**
|
|
55
|
+
* The default content type which is used for the request. If not defined the first one defined in the OpenApi specification is used.
|
|
56
|
+
* @default undefined
|
|
57
|
+
*/
|
|
58
|
+
defaultRequestContentType: Nullable<string>;
|
|
54
59
|
/**
|
|
55
60
|
* The default content type which is used for the success response. If not defined the first one defined in the OpenApi specification is used.
|
|
56
61
|
* @default undefined
|
|
57
62
|
*/
|
|
58
|
-
|
|
63
|
+
defaultSuccessResponseContentType: Nullable<string>;
|
|
59
64
|
/**
|
|
60
65
|
* The possible status codes that any API endpoint can return.
|
|
61
66
|
* This is only used when `strictResponseTypes` is set to `false`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/src/generators/services/angular-services/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,+BAA+B,EAC/B,oBAAoB,EACpB,QAAQ,EACR,wCAAwC,EACzC,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAoC,KAAK,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,MAAM,MAAM,wCAAwC,GAAG,yBAAyB,GAAG;IACjF;;;;;OAKG;IACH,WAAW,EAAE,MAAM,GAAG,YAAY,CAAC;IAEnC;;;OAGG;IACH,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE7B;;;;OAIG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,8BAA8B,EAAE,MAAM,CACpC,MAAM,EACN;QACE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;QAExB,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,KAAK,SAAS,CAAC,CAAC;KAC1G,GAAG,IAAI,CACT,CAAC;IAEF;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/src/generators/services/angular-services/models.ts"],"names":[],"mappings":"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"}
|
|
@@ -12,7 +12,8 @@ exports.defaultTypeScriptAngularServicesGeneratorConfig = {
|
|
|
12
12
|
403: null,
|
|
13
13
|
500: null,
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
defaultRequestContentType: undefined,
|
|
16
|
+
defaultSuccessResponseContentType: undefined,
|
|
16
17
|
possibleStatusCodes: [
|
|
17
18
|
100,
|
|
18
19
|
101,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
require("../_dnt.test_polyfills.js");
|
|
4
|
-
const mod_js_1 = require("../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
const mod_js_1 = require("../deps/jsr.io/@std/expect/1.0.13/mod.js");
|
|
5
5
|
const bdd_js_1 = require("../deps/jsr.io/@std/testing/1.0.9/bdd.js");
|
|
6
6
|
const import_collection_js_1 = require("./import-collection.js");
|
|
7
7
|
(0, bdd_js_1.describe)('ImportExportCollection', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/mod.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
2
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/mod.js';
|
|
3
3
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
4
4
|
|
|
5
5
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/mod.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/mod.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { normalizeEOL } from '@goast/test-utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/mod.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { normalizeEOL } from '@goast/test-utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { SourceBuilder } from '@goast/core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
2
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
3
3
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
4
4
|
|
|
5
5
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { normalizeEOL } from '@goast/test-utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { normalizeEOL } from '@goast/test-utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { normalizeEOL } from '@goast/test-utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
2
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
3
3
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
4
4
|
|
|
5
5
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import type { TypeScriptImport } from '../../common-results.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
2
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
3
3
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
4
4
|
|
|
5
5
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { normalizeEOL } from '@goast/test-utils';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../../_dnt.test_polyfills.js";
|
|
2
2
|
import { EOL } from 'node:os';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../../../deps/jsr.io/@std/expect/1.0.13/expect.js';
|
|
5
5
|
import { beforeEach, it } from '../../../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { TypeScriptFileBuilder } from '../../file-builder.js';
|
|
@@ -295,9 +295,7 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
295
295
|
}, ${options});`;
|
|
296
296
|
}),
|
|
297
297
|
endpoint.requestBody
|
|
298
|
-
? s`rb.body(params.body, ${
|
|
299
|
-
ts.string(endpoint.requestBody.content[0].type ?? 'application/json')
|
|
300
|
-
});`
|
|
298
|
+
? s`rb.body(params.body, ${ts.string(this.getEndpointRequestContentType(ctx, endpoint))});`
|
|
301
299
|
: null,
|
|
302
300
|
],
|
|
303
301
|
'\n',
|
|
@@ -332,14 +330,18 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
332
330
|
});
|
|
333
331
|
}
|
|
334
332
|
|
|
333
|
+
protected getEndpointRequestContentType(ctx: Context, endpoint: ApiEndpoint): string {
|
|
334
|
+
return ctx.config.defaultRequestContentType ?? endpoint?.requestBody?.content[0].type ?? 'application/json';
|
|
335
|
+
}
|
|
336
|
+
|
|
335
337
|
protected getEndpointSuccessResponseType(ctx: Context, endpoint: ApiEndpoint): string {
|
|
336
338
|
const response = this.getEndpointSuccessResponse(ctx, endpoint);
|
|
337
339
|
if (!response) return '*/*';
|
|
338
340
|
|
|
339
|
-
if (!ctx.config.
|
|
341
|
+
if (!ctx.config.defaultSuccessResponseContentType) return response.contentOptions[0]?.type ?? '*/*';
|
|
340
342
|
|
|
341
343
|
return (
|
|
342
|
-
response.contentOptions.find((x) => x.type === ctx.config.
|
|
344
|
+
response.contentOptions.find((x) => x.type === ctx.config.defaultSuccessResponseContentType)?.type ??
|
|
343
345
|
response.contentOptions[0]?.type ??
|
|
344
346
|
'*/*'
|
|
345
347
|
);
|
|
@@ -69,11 +69,17 @@ export type TypeScriptAngularServicesGeneratorConfig = TypeScriptGeneratorConfig
|
|
|
69
69
|
} | null
|
|
70
70
|
>;
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* The default content type which is used for the request. If not defined the first one defined in the OpenApi specification is used.
|
|
74
|
+
* @default undefined
|
|
75
|
+
*/
|
|
76
|
+
defaultRequestContentType: Nullable<string>;
|
|
77
|
+
|
|
72
78
|
/**
|
|
73
79
|
* The default content type which is used for the success response. If not defined the first one defined in the OpenApi specification is used.
|
|
74
80
|
* @default undefined
|
|
75
81
|
*/
|
|
76
|
-
|
|
82
|
+
defaultSuccessResponseContentType: Nullable<string>;
|
|
77
83
|
|
|
78
84
|
/**
|
|
79
85
|
* The possible status codes that any API endpoint can return.
|
|
@@ -151,7 +157,8 @@ export const defaultTypeScriptAngularServicesGeneratorConfig: DefaultGenerationP
|
|
|
151
157
|
403: null,
|
|
152
158
|
500: null,
|
|
153
159
|
},
|
|
154
|
-
|
|
160
|
+
defaultRequestContentType: undefined,
|
|
161
|
+
defaultSuccessResponseContentType: undefined,
|
|
155
162
|
possibleStatusCodes: [
|
|
156
163
|
100,
|
|
157
164
|
101,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../_dnt.test_polyfills.js";
|
|
2
2
|
import type { SourceBuilderOptions } from '@goast/core';
|
|
3
3
|
|
|
4
|
-
import { expect } from '../deps/jsr.io/@std/expect/1.0.
|
|
4
|
+
import { expect } from '../deps/jsr.io/@std/expect/1.0.13/mod.js';
|
|
5
5
|
import { beforeEach, describe, it } from '../deps/jsr.io/@std/testing/1.0.9/bdd.js';
|
|
6
6
|
|
|
7
7
|
import { ImportExportCollection } from './import-collection.js';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|