@typespec/http-client-js 0.1.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/.testignore +2 -0
- package/LICENSE +21 -0
- package/README.md +26 -0
- package/babel.config.js +4 -0
- package/dist/src/components/client-context/client-context-declaration.d.ts +8 -0
- package/dist/src/components/client-context/client-context-declaration.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context-declaration.js +21 -0
- package/dist/src/components/client-context/client-context-declaration.js.map +1 -0
- package/dist/src/components/client-context/client-context-factory.d.ts +8 -0
- package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context-factory.js +154 -0
- package/dist/src/components/client-context/client-context-factory.js.map +1 -0
- package/dist/src/components/client-context/client-context-options.d.ts +8 -0
- package/dist/src/components/client-context/client-context-options.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context-options.js +42 -0
- package/dist/src/components/client-context/client-context-options.js.map +1 -0
- package/dist/src/components/client-context/client-context.d.ts +8 -0
- package/dist/src/components/client-context/client-context.d.ts.map +1 -0
- package/dist/src/components/client-context/client-context.js +33 -0
- package/dist/src/components/client-context/client-context.js.map +1 -0
- package/dist/src/components/client-context/parametrized-endpoint.d.ts +9 -0
- package/dist/src/components/client-context/parametrized-endpoint.d.ts.map +1 -0
- package/dist/src/components/client-context/parametrized-endpoint.js +48 -0
- package/dist/src/components/client-context/parametrized-endpoint.js.map +1 -0
- package/dist/src/components/client-directory.d.ts +11 -0
- package/dist/src/components/client-directory.d.ts.map +1 -0
- package/dist/src/components/client-directory.js +39 -0
- package/dist/src/components/client-directory.js.map +1 -0
- package/dist/src/components/client-operation.d.ts +11 -0
- package/dist/src/components/client-operation.d.ts.map +1 -0
- package/dist/src/components/client-operation.js +74 -0
- package/dist/src/components/client-operation.js.map +1 -0
- package/dist/src/components/client.d.ts +15 -0
- package/dist/src/components/client.d.ts.map +1 -0
- package/dist/src/components/client.js +153 -0
- package/dist/src/components/client.js.map +1 -0
- package/dist/src/components/encoding-provider.d.ts +8 -0
- package/dist/src/components/encoding-provider.d.ts.map +1 -0
- package/dist/src/components/encoding-provider.js +17 -0
- package/dist/src/components/encoding-provider.js.map +1 -0
- package/dist/src/components/external-packages/ts-http-runtime.d.ts +13 -0
- package/dist/src/components/external-packages/ts-http-runtime.d.ts.map +1 -0
- package/dist/src/components/external-packages/ts-http-runtime.js +11 -0
- package/dist/src/components/external-packages/ts-http-runtime.js.map +1 -0
- package/dist/src/components/external-packages/uri-template.d.ts +4 -0
- package/dist/src/components/external-packages/uri-template.d.ts.map +1 -0
- package/dist/src/components/external-packages/uri-template.js +11 -0
- package/dist/src/components/external-packages/uri-template.js.map +1 -0
- package/dist/src/components/http-request-options.d.ts +25 -0
- package/dist/src/components/http-request-options.d.ts.map +1 -0
- package/dist/src/components/http-request-options.js +74 -0
- package/dist/src/components/http-request-options.js.map +1 -0
- package/dist/src/components/http-request-parameters-expression.d.ts +10 -0
- package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -0
- package/dist/src/components/http-request-parameters-expression.js +62 -0
- package/dist/src/components/http-request-parameters-expression.js.map +1 -0
- package/dist/src/components/http-request.d.ts +16 -0
- package/dist/src/components/http-request.d.ts.map +1 -0
- package/dist/src/components/http-request.js +70 -0
- package/dist/src/components/http-request.js.map +1 -0
- package/dist/src/components/http-response.d.ts +14 -0
- package/dist/src/components/http-response.d.ts.map +1 -0
- package/dist/src/components/http-response.js +61 -0
- package/dist/src/components/http-response.js.map +1 -0
- package/dist/src/components/models.d.ts +5 -0
- package/dist/src/components/models.d.ts.map +1 -0
- package/dist/src/components/models.js +41 -0
- package/dist/src/components/models.js.map +1 -0
- package/dist/src/components/operation-options.d.ts +8 -0
- package/dist/src/components/operation-options.d.ts.map +1 -0
- package/dist/src/components/operation-options.js +41 -0
- package/dist/src/components/operation-options.js.map +1 -0
- package/dist/src/components/operation-parameters.d.ts +9 -0
- package/dist/src/components/operation-parameters.d.ts.map +1 -0
- package/dist/src/components/operation-parameters.js +33 -0
- package/dist/src/components/operation-parameters.js.map +1 -0
- package/dist/src/components/output.d.ts +6 -0
- package/dist/src/components/output.d.ts.map +1 -0
- package/dist/src/components/output.js +35 -0
- package/dist/src/components/output.js.map +1 -0
- package/dist/src/components/serializers.d.ts +5 -0
- package/dist/src/components/serializers.d.ts.map +1 -0
- package/dist/src/components/serializers.js +43 -0
- package/dist/src/components/serializers.js.map +1 -0
- package/dist/src/components/static-helpers/bytes-encoding.d.ts +6 -0
- package/dist/src/components/static-helpers/bytes-encoding.d.ts.map +1 -0
- package/dist/src/components/static-helpers/bytes-encoding.js +68 -0
- package/dist/src/components/static-helpers/bytes-encoding.js.map +1 -0
- package/dist/src/components/static-helpers/interfaces.d.ts +5 -0
- package/dist/src/components/static-helpers/interfaces.d.ts.map +1 -0
- package/dist/src/components/static-helpers/interfaces.js +41 -0
- package/dist/src/components/static-helpers/interfaces.js.map +1 -0
- package/dist/src/components/static-helpers/multipart-helpers.d.ts +8 -0
- package/dist/src/components/static-helpers/multipart-helpers.d.ts.map +1 -0
- package/dist/src/components/static-helpers/multipart-helpers.js +83 -0
- package/dist/src/components/static-helpers/multipart-helpers.js.map +1 -0
- package/dist/src/components/static-helpers/rest-error.d.ts +5 -0
- package/dist/src/components/static-helpers/rest-error.d.ts.map +1 -0
- package/dist/src/components/static-helpers/rest-error.js +127 -0
- package/dist/src/components/static-helpers/rest-error.js.map +1 -0
- package/dist/src/components/testing/client-options.d.ts +8 -0
- package/dist/src/components/testing/client-options.d.ts.map +1 -0
- package/dist/src/components/testing/client-options.js +27 -0
- package/dist/src/components/testing/client-options.js.map +1 -0
- package/dist/src/components/transforms/content-type-encoding-provider.d.ts +7 -0
- package/dist/src/components/transforms/content-type-encoding-provider.d.ts.map +1 -0
- package/dist/src/components/transforms/content-type-encoding-provider.js +25 -0
- package/dist/src/components/transforms/content-type-encoding-provider.js.map +1 -0
- package/dist/src/components/transforms/data-transform.d.ts +9 -0
- package/dist/src/components/transforms/data-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/data-transform.js +31 -0
- package/dist/src/components/transforms/data-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-array-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/json-array-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-array-transform.js +71 -0
- package/dist/src/components/transforms/json/json-array-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts +9 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.js +35 -0
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-base-transform.d.ts +9 -0
- package/dist/src/components/transforms/json/json-model-base-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-base-transform.js +13 -0
- package/dist/src/components/transforms/json/json-model-base-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts +9 -0
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-property-transform.js +44 -0
- package/dist/src/components/transforms/json/json-model-property-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-model-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/json-model-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-model-transform.js +96 -0
- package/dist/src/components/transforms/json/json-model-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-record-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/json-record-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-record-transform.js +71 -0
- package/dist/src/components/transforms/json/json-record-transform.js.map +1 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts +16 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.js +82 -0
- package/dist/src/components/transforms/json/json-transform-discriminator.js.map +1 -0
- package/dist/src/components/transforms/json/json-transform.d.ts +14 -0
- package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/json-transform.js +149 -0
- package/dist/src/components/transforms/json/json-transform.js.map +1 -0
- package/dist/src/components/transforms/json/union-transform.d.ts +15 -0
- package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/json/union-transform.js +67 -0
- package/dist/src/components/transforms/json/union-transform.js.map +1 -0
- package/dist/src/components/transforms/json/utils/transport-namer.d.ts +3 -0
- package/dist/src/components/transforms/json/utils/transport-namer.d.ts.map +1 -0
- package/dist/src/components/transforms/json/utils/transport-namer.js +13 -0
- package/dist/src/components/transforms/json/utils/transport-namer.js.map +1 -0
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/array-part-transform.js +29 -0
- package/dist/src/components/transforms/multipart/array-part-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/file-part-transform.js +40 -0
- package/dist/src/components/transforms/multipart/file-part-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts +7 -0
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/multipart-transform.js +26 -0
- package/dist/src/components/transforms/multipart/multipart-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/part-transform.js +35 -0
- package/dist/src/components/transforms/multipart/part-transform.js.map +1 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts +8 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.js +48 -0
- package/dist/src/components/transforms/multipart/simple-part-transform.js.map +1 -0
- package/dist/src/components/transforms/operation-transform-declaration.d.ts +17 -0
- package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -0
- package/dist/src/components/transforms/operation-transform-declaration.js +74 -0
- package/dist/src/components/transforms/operation-transform-declaration.js.map +1 -0
- package/dist/src/components/transforms/operation-transform-expression.d.ts +6 -0
- package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -0
- package/dist/src/components/transforms/operation-transform-expression.js +60 -0
- package/dist/src/components/transforms/operation-transform-expression.js.map +1 -0
- package/dist/src/components/transforms/scalar-transform.d.ts +15 -0
- package/dist/src/components/transforms/scalar-transform.d.ts.map +1 -0
- package/dist/src/components/transforms/scalar-transform.js +317 -0
- package/dist/src/components/transforms/scalar-transform.js.map +1 -0
- package/dist/src/components/transforms/transform-name-policy.d.ts +71 -0
- package/dist/src/components/transforms/transform-name-policy.d.ts.map +1 -0
- package/dist/src/components/transforms/transform-name-policy.js +111 -0
- package/dist/src/components/transforms/transform-name-policy.js.map +1 -0
- package/dist/src/components/utils/unpack-model-property.d.ts +8 -0
- package/dist/src/components/utils/unpack-model-property.d.ts.map +1 -0
- package/dist/src/components/utils/unpack-model-property.js +33 -0
- package/dist/src/components/utils/unpack-model-property.js.map +1 -0
- package/dist/src/components/utils/url-template.d.ts +7 -0
- package/dist/src/components/utils/url-template.d.ts.map +1 -0
- package/dist/src/components/utils/url-template.js +23 -0
- package/dist/src/components/utils/url-template.js.map +1 -0
- package/dist/src/context/encoding/encoding-context.d.ts +6 -0
- package/dist/src/context/encoding/encoding-context.d.ts.map +1 -0
- package/dist/src/context/encoding/encoding-context.js +20 -0
- package/dist/src/context/encoding/encoding-context.js.map +1 -0
- package/dist/src/context/encoding/types.d.ts +6 -0
- package/dist/src/context/encoding/types.d.ts.map +1 -0
- package/dist/src/context/encoding/types.js +1 -0
- package/dist/src/context/encoding/types.js.map +1 -0
- package/dist/src/emitter.d.ts +8 -0
- package/dist/src/emitter.d.ts.map +1 -0
- package/dist/src/emitter.js +68 -0
- package/dist/src/emitter.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib.d.ts +206 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +107 -0
- package/dist/src/lib.js.map +1 -0
- package/dist/src/testing/index.d.ts +3 -0
- package/dist/src/testing/index.d.ts.map +1 -0
- package/dist/src/testing/index.js +8 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/utils/client-discovery.d.ts +7 -0
- package/dist/src/utils/client-discovery.d.ts.map +1 -0
- package/dist/src/utils/client-discovery.js +26 -0
- package/dist/src/utils/client-discovery.js.map +1 -0
- package/dist/src/utils/multipart.d.ts +3 -0
- package/dist/src/utils/multipart.d.ts.map +1 -0
- package/dist/src/utils/multipart.js +26 -0
- package/dist/src/utils/multipart.js.map +1 -0
- package/dist/src/utils/operations.d.ts +3 -0
- package/dist/src/utils/operations.d.ts.map +1 -0
- package/dist/src/utils/operations.js +11 -0
- package/dist/src/utils/operations.js.map +1 -0
- package/dist/src/utils/parameters.d.ts +14 -0
- package/dist/src/utils/parameters.d.ts.map +1 -0
- package/dist/src/utils/parameters.js +98 -0
- package/dist/src/utils/parameters.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/eng/scripts/calculate-coverage.js +36 -0
- package/eng/scripts/emit-e2e.js +329 -0
- package/eng/scripts/run-e2e-tests.js +162 -0
- package/eng/scripts/tspconfig.yaml +6 -0
- package/eng/scripts/upload-spector-results.js +120 -0
- package/package.json +83 -0
- package/src/components/client-context/client-context-declaration.tsx +19 -0
- package/src/components/client-context/client-context-factory.tsx +142 -0
- package/src/components/client-context/client-context-options.tsx +28 -0
- package/src/components/client-context/client-context.tsx +21 -0
- package/src/components/client-context/parametrized-endpoint.tsx +39 -0
- package/src/components/client-directory.tsx +40 -0
- package/src/components/client-operation.tsx +52 -0
- package/src/components/client.tsx +137 -0
- package/src/components/encoding-provider.tsx +19 -0
- package/src/components/external-packages/ts-http-runtime.ts +22 -0
- package/src/components/external-packages/uri-template.ts +11 -0
- package/src/components/http-request-options.tsx +69 -0
- package/src/components/http-request-parameters-expression.tsx +69 -0
- package/src/components/http-request.tsx +58 -0
- package/src/components/http-response.tsx +68 -0
- package/src/components/models.tsx +29 -0
- package/src/components/operation-options.tsx +26 -0
- package/src/components/operation-parameters.tsx +43 -0
- package/src/components/output.tsx +26 -0
- package/src/components/serializers.tsx +47 -0
- package/src/components/static-helpers/bytes-encoding.tsx +41 -0
- package/src/components/static-helpers/interfaces.tsx +26 -0
- package/src/components/static-helpers/multipart-helpers.tsx +59 -0
- package/src/components/static-helpers/rest-error.tsx +61 -0
- package/src/components/testing/client-options.tsx +32 -0
- package/src/components/transforms/content-type-encoding-provider.tsx +28 -0
- package/src/components/transforms/data-transform.tsx +39 -0
- package/src/components/transforms/json/json-array-transform.tsx +83 -0
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +47 -0
- package/src/components/transforms/json/json-model-base-transform.tsx +19 -0
- package/src/components/transforms/json/json-model-property-transform.tsx +41 -0
- package/src/components/transforms/json/json-model-transform.tsx +87 -0
- package/src/components/transforms/json/json-record-transform.tsx +84 -0
- package/src/components/transforms/json/json-transform-discriminator.tsx +114 -0
- package/src/components/transforms/json/json-transform.tsx +113 -0
- package/src/components/transforms/json/union-transform.tsx +73 -0
- package/src/components/transforms/json/utils/transport-namer.ts +12 -0
- package/src/components/transforms/multipart/array-part-transform.tsx +40 -0
- package/src/components/transforms/multipart/file-part-transform.tsx +44 -0
- package/src/components/transforms/multipart/multipart-transform.tsx +32 -0
- package/src/components/transforms/multipart/part-transform.tsx +22 -0
- package/src/components/transforms/multipart/simple-part-transform.tsx +49 -0
- package/src/components/transforms/operation-transform-declaration.tsx +64 -0
- package/src/components/transforms/operation-transform-expression.tsx +54 -0
- package/src/components/transforms/scalar-transform.tsx +289 -0
- package/src/components/transforms/transform-name-policy.ts +133 -0
- package/src/components/utils/unpack-model-property.ts +31 -0
- package/src/components/utils/url-template.tsx +21 -0
- package/src/context/encoding/encoding-context.tsx +26 -0
- package/src/context/encoding/types.ts +6 -0
- package/src/emitter.tsx +53 -0
- package/src/index.ts +5 -0
- package/src/lib.ts +108 -0
- package/src/testing/index.ts +8 -0
- package/src/utils/client-discovery.ts +28 -0
- package/src/utils/multipart.ts +28 -0
- package/src/utils/operations.ts +14 -0
- package/src/utils/parameters.tsx +129 -0
- package/test/e2e/assets/image.jpg +0 -0
- package/test/e2e/assets/image.png +0 -0
- package/test/e2e/http/authentication/api-key/main.test.ts +38 -0
- package/test/e2e/http/authentication/oauth2/main.test.ts +41 -0
- package/test/e2e/http/authentication/union/main.test.ts +29 -0
- package/test/e2e/http/encode/bytes/main.test.ts +191 -0
- package/test/e2e/http/encode/datetime/main.test.ts +176 -0
- package/test/e2e/http/encode/duration/main.test.ts +126 -0
- package/test/e2e/http/encode/numeric/main.test.ts +26 -0
- package/test/e2e/http/parameters/basic/main.test.ts +35 -0
- package/test/e2e/http/parameters/body-optionality/main.test.ts +43 -0
- package/test/e2e/http/parameters/collection-format/main.test.ts +45 -0
- package/test/e2e/http/parameters/spread/main.test.ts +56 -0
- package/test/e2e/http/payload/content-negotiation/main.test.ts +40 -0
- package/test/e2e/http/payload/json-merge-patch/main.test.ts +122 -0
- package/test/e2e/http/payload/media-type/main.test.ts +28 -0
- package/test/e2e/http/payload/multipart/main.test.ts +164 -0
- package/test/e2e/http/payload/pageable/main.test.ts +24 -0
- package/test/e2e/http/payload/xml/main.test.ts +287 -0
- package/test/e2e/http/routes/main.test.ts +284 -0
- package/test/e2e/http/serialization/encoded-name/json/main.test.ts +20 -0
- package/test/e2e/http/server/endpoint/not-defined/main.test.ts +11 -0
- package/test/e2e/http/server/path/multiple/main.test.ts +22 -0
- package/test/e2e/http/server/path/single/main.test.ts +11 -0
- package/test/e2e/http/server/versions/not-versioned/main.test.ts +22 -0
- package/test/e2e/http/server/versions/versioned/main.test.ts +28 -0
- package/test/e2e/http/special-headers/conditional-request/main.test.ts +35 -0
- package/test/e2e/http/special-headers/repeatability/main.test.ts +18 -0
- package/test/e2e/http/special-words/main.test.ts +434 -0
- package/test/e2e/http/type/array/array.test.ts +256 -0
- package/test/e2e/http/type/dictionary/main.test.ts +229 -0
- package/test/e2e/http/type/enum/extensible/main.test.ts +34 -0
- package/test/e2e/http/type/enum/fixed/main.test.ts +29 -0
- package/test/e2e/http/type/model/empty/main.test.ts +21 -0
- package/test/e2e/http/type/model/inheritance/enum-discriminator/main.test.ts +51 -0
- package/test/e2e/http/type/model/inheritance/nested-discriminator/main.test.ts +168 -0
- package/test/e2e/http/type/model/inheritance/not-discriminated/main.test.ts +42 -0
- package/test/e2e/http/type/model/inheritance/recursive/main.test.ts +46 -0
- package/test/e2e/http/type/model/inheritance/single-discriminator/main.test.ts +101 -0
- package/test/e2e/http/type/model/visibility/main.test.ts +64 -0
- package/test/e2e/http/type/property/additional-properties/main.test.ts +185 -0
- package/test/e2e/http/type/property/additional-properties/spreads.test.ts +470 -0
- package/test/e2e/http/type/property/nullable/main.test.ts +275 -0
- package/test/e2e/http/type/property/optionality/main.test.ts +256 -0
- package/test/e2e/http/type/property/value-types/main.test.ts +193 -0
- package/test/e2e/http/type/scalar/main.test.ts +133 -0
- package/test/e2e/http/type/scalar/scalar.test.ts +95 -0
- package/test/e2e/http/type/union/main.test.ts +207 -0
- package/test/e2e/http/versioning/added/main.test.ts +61 -0
- package/test/e2e/http/versioning/madeOptional/main.test.ts +34 -0
- package/test/e2e/http/versioning/removed/main.test.ts +75 -0
- package/test/e2e/http/versioning/renamedFrom/main.test.ts +52 -0
- package/test/e2e/http/versioning/returnTypeChangedFrom/main.test.ts +22 -0
- package/test/e2e/http/versioning/typeChangedFrom/main.test.ts +31 -0
- package/test/scenarios/additional-properties/extends.md +71 -0
- package/test/scenarios/additional-properties/is.md +46 -0
- package/test/scenarios/additional-properties/spread.md +72 -0
- package/test/scenarios/auth/basic_auth.md +67 -0
- package/test/scenarios/auth/bearer.md +67 -0
- package/test/scenarios/auth/client_parameters.md +68 -0
- package/test/scenarios/auth/client_structure.md +38 -0
- package/test/scenarios/auth/key_credential.md +67 -0
- package/test/scenarios/auth/sub_client_override.md +114 -0
- package/test/scenarios/client/client_context.md +36 -0
- package/test/scenarios/client/dotted_namespace.md +30 -0
- package/test/scenarios/client/global_namespace.md +74 -0
- package/test/scenarios/client/multiple_top_level_clients.md +74 -0
- package/test/scenarios/client/nested_client.md +106 -0
- package/test/scenarios/client/wrapping_namespace.md +43 -0
- package/test/scenarios/encoding/bytes_body.md +48 -0
- package/test/scenarios/encoding/bytes_json_property.md +60 -0
- package/test/scenarios/encoding/bytes_nullable.md +153 -0
- package/test/scenarios/encoding/header_bytes.md +142 -0
- package/test/scenarios/encoding/header_date.md +236 -0
- package/test/scenarios/encoding/model_with_bytes_property.md +50 -0
- package/test/scenarios/encoding/query_bytes.md +46 -0
- package/test/scenarios/encoding/query_date.md +236 -0
- package/test/scenarios/http-operations/basic-request.md +162 -0
- package/test/scenarios/http-operations/basic-response.md +246 -0
- package/test/scenarios/http-operations/basic.md +134 -0
- package/test/scenarios/http-operations/constant-header.md +37 -0
- package/test/scenarios/http-operations/create-operation.md +62 -0
- package/test/scenarios/http-operations/on_response.md +56 -0
- package/test/scenarios/http-operations/optional-request-body.md +55 -0
- package/test/scenarios/http-operations/path-parameter-in-model.md +59 -0
- package/test/scenarios/http-operations/path-parameter.md +54 -0
- package/test/scenarios/http-operations/scalar-payload.md +63 -0
- package/test/scenarios/http-operations/with-parameters.md +85 -0
- package/test/scenarios/models/array-properties.md +47 -0
- package/test/scenarios/models/basic.md +118 -0
- package/test/scenarios/models/dictionary-properties.md +44 -0
- package/test/scenarios/models/inheritance_2_discriminators.md +370 -0
- package/test/scenarios/models/inheritance_discriminator.md +92 -0
- package/test/scenarios/models/inline-models.md +29 -0
- package/test/scenarios/models/model_additional_properties.md +79 -0
- package/test/scenarios/models/model_extends.md +101 -0
- package/test/scenarios/models/model_spread.md +65 -0
- package/test/scenarios/models/nested_property.md +45 -0
- package/test/scenarios/models/property_references_property.md +156 -0
- package/test/scenarios/multipart/anonymous_part.md +57 -0
- package/test/scenarios/multipart/file.md +166 -0
- package/test/scenarios/multipart/file_content_type.md +67 -0
- package/test/scenarios/multipart/simple_part.md +69 -0
- package/test/scenarios/operation-parameters/body_root_anonymous.md +92 -0
- package/test/scenarios/operation-parameters/constant_as_optional.md +59 -0
- package/test/scenarios/operation-parameters/default_value_as_optional.md +59 -0
- package/test/scenarios/operation-parameters/no_content_type.md +67 -0
- package/test/scenarios/operation-parameters/no_parameters.md +55 -0
- package/test/scenarios/operation-parameters/only_optional.md +67 -0
- package/test/scenarios/operation-parameters/only_required.md +63 -0
- package/test/scenarios/operation-parameters/reserved_names.md +65 -0
- package/test/scenarios/operation-parameters/spread_body.md +75 -0
- package/test/scenarios/operation-parameters/spread_with_nested.md +87 -0
- package/test/scenarios/operation-parameters/union_body.md +92 -0
- package/test/scenarios/operation-parameters/with_body_property.md +72 -0
- package/test/scenarios/operation-parameters/with_body_root.md +74 -0
- package/test/scenarios/serializers/arrays.md +199 -0
- package/test/scenarios/serializers/basic_model.md +115 -0
- package/test/scenarios/serializers/basic_model_wire_name.md +50 -0
- package/test/scenarios/serializers/discriminated_union.md +86 -0
- package/test/scenarios/serializers/discriminated_union_spread.md +119 -0
- package/test/scenarios/serializers/model_date_time.md +65 -0
- package/test/scenarios/serializers/multipart.md +66 -0
- package/test/scenarios/serializers/polymorphic_single_level_inheritance.md +164 -0
- package/test/scenarios/serializers/record.md +101 -0
- package/test/scenarios/serializers/scalars.md +33 -0
- package/test/scenarios/serializers/spread.md +75 -0
- package/test/scenarios/serializers/string_union.md +61 -0
- package/test/scenarios/server/default_url.md +45 -0
- package/test/scenarios/server/multiple-parameters.md +57 -0
- package/test/scenarios/server/no-server.md +37 -0
- package/test/scenarios/server/parametrized-endpoint.md +53 -0
- package/test/scenarios.test.ts +18 -0
- package/test/test-host.ts +76 -0
- package/tsconfig.json +16 -0
- package/tsconfig.test.json +7 -0
- package/vitest.config.js +23 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
ModelWithArrayOfModelValueClient,
|
|
4
|
+
ModelWithAttributesValueClient,
|
|
5
|
+
ModelWithDictionaryValueClient,
|
|
6
|
+
ModelWithEmptyArrayValueClient,
|
|
7
|
+
ModelWithEncodedNamesValueClient,
|
|
8
|
+
ModelWithOptionalFieldValueClient,
|
|
9
|
+
ModelWithRenamedArraysValueClient,
|
|
10
|
+
ModelWithRenamedFieldsValueClient,
|
|
11
|
+
ModelWithSimpleArraysValueClient,
|
|
12
|
+
ModelWithTextValueClient,
|
|
13
|
+
ModelWithUnwrappedArrayValueClient,
|
|
14
|
+
SimpleModelValueClient,
|
|
15
|
+
} from "../../../generated/payload/xml/src/index.js";
|
|
16
|
+
|
|
17
|
+
describe.skip("Payload.Xml", () => {
|
|
18
|
+
describe("SimpleModelValueClient", () => {
|
|
19
|
+
const client = new SimpleModelValueClient({
|
|
20
|
+
allowInsecureConnection: true,
|
|
21
|
+
retryOptions: {
|
|
22
|
+
maxRetries: 1,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("should handle a SimpleModel value returned from the server", async () => {
|
|
27
|
+
const response = await client.get();
|
|
28
|
+
expect(response).toEqual({ name: "foo", age: 123 });
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("should send a SimpleModel value to the server", async () => {
|
|
32
|
+
await client.put({ name: "foo", age: 123 });
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("ModelWithSimpleArraysValueClient", () => {
|
|
37
|
+
const client = new ModelWithSimpleArraysValueClient({
|
|
38
|
+
allowInsecureConnection: true,
|
|
39
|
+
retryOptions: {
|
|
40
|
+
maxRetries: 1,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("should handle a ModelWithSimpleArrays value returned from the server", async () => {
|
|
45
|
+
const response = await client.get();
|
|
46
|
+
expect(response).toEqual({
|
|
47
|
+
colors: ["red", "green", "blue"],
|
|
48
|
+
counts: [1, 2],
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("should send a ModelWithSimpleArrays value to the server", async () => {
|
|
53
|
+
await client.put({
|
|
54
|
+
colors: ["red", "green", "blue"],
|
|
55
|
+
counts: [1, 2],
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe("ModelWithArrayOfModelValueClient", () => {
|
|
61
|
+
const client = new ModelWithArrayOfModelValueClient({
|
|
62
|
+
allowInsecureConnection: true,
|
|
63
|
+
retryOptions: {
|
|
64
|
+
maxRetries: 1,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("should handle a ModelWithArrayOfModel value returned from the server", async () => {
|
|
69
|
+
const response = await client.get();
|
|
70
|
+
expect(response).toEqual({
|
|
71
|
+
items: [
|
|
72
|
+
{ name: "foo", age: 123 },
|
|
73
|
+
{ name: "bar", age: 456 },
|
|
74
|
+
],
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("should send a ModelWithArrayOfModel value to the server", async () => {
|
|
79
|
+
await client.put({
|
|
80
|
+
items: [
|
|
81
|
+
{ name: "foo", age: 123 },
|
|
82
|
+
{ name: "bar", age: 456 },
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
describe("ModelWithOptionalFieldValueClient", () => {
|
|
89
|
+
const client = new ModelWithOptionalFieldValueClient({
|
|
90
|
+
allowInsecureConnection: true,
|
|
91
|
+
retryOptions: {
|
|
92
|
+
maxRetries: 1,
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("should handle a ModelWithOptionalField value returned from the server", async () => {
|
|
97
|
+
const response = await client.get();
|
|
98
|
+
expect(response).toEqual({ item: "widget" });
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("should send a ModelWithOptionalField value to the server", async () => {
|
|
102
|
+
await client.put({ item: "widget" });
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
describe("ModelWithAttributesValueClient", () => {
|
|
107
|
+
const client = new ModelWithAttributesValueClient({
|
|
108
|
+
allowInsecureConnection: true,
|
|
109
|
+
retryOptions: {
|
|
110
|
+
maxRetries: 1,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("should handle a ModelWithAttributes value returned from the server", async () => {
|
|
115
|
+
const response = await client.get();
|
|
116
|
+
expect(response).toEqual({ id1: 123, id2: "foo", enabled: true });
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("should send a ModelWithAttributes value to the server", async () => {
|
|
120
|
+
await client.put({
|
|
121
|
+
id1: 123,
|
|
122
|
+
id2: "foo",
|
|
123
|
+
enabled: true,
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe("ModelWithUnwrappedArrayValueClient", () => {
|
|
129
|
+
const client = new ModelWithUnwrappedArrayValueClient({
|
|
130
|
+
allowInsecureConnection: true,
|
|
131
|
+
retryOptions: {
|
|
132
|
+
maxRetries: 1,
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("should handle a ModelWithUnwrappedArray value returned from the server", async () => {
|
|
137
|
+
const response = await client.get();
|
|
138
|
+
expect(response).toEqual({
|
|
139
|
+
colors: ["red", "green", "blue"],
|
|
140
|
+
counts: [1, 2],
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("should send a ModelWithUnwrappedArray value to the server", async () => {
|
|
145
|
+
await client.put({
|
|
146
|
+
colors: ["red", "green", "blue"],
|
|
147
|
+
counts: [1, 2],
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
describe("ModelWithRenamedArraysValueClient", () => {
|
|
153
|
+
const client = new ModelWithRenamedArraysValueClient({
|
|
154
|
+
allowInsecureConnection: true,
|
|
155
|
+
retryOptions: {
|
|
156
|
+
maxRetries: 1,
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("should handle a ModelWithRenamedArrays value returned from the server", async () => {
|
|
161
|
+
const response = await client.get();
|
|
162
|
+
expect(response).toEqual({
|
|
163
|
+
colors: ["red", "green", "blue"],
|
|
164
|
+
counts: [1, 2],
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it("should send a ModelWithRenamedArrays value to the server", async () => {
|
|
169
|
+
await client.put({
|
|
170
|
+
colors: ["red", "green", "blue"],
|
|
171
|
+
counts: [1, 2],
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe("ModelWithRenamedFieldsValueClient", () => {
|
|
177
|
+
const client = new ModelWithRenamedFieldsValueClient({
|
|
178
|
+
allowInsecureConnection: true,
|
|
179
|
+
retryOptions: {
|
|
180
|
+
maxRetries: 1,
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("should handle a ModelWithRenamedFields value returned from the server", async () => {
|
|
185
|
+
const response = await client.get();
|
|
186
|
+
expect(response).toEqual({
|
|
187
|
+
inputData: { name: "foo", age: 123 },
|
|
188
|
+
outputData: { name: "bar", age: 456 },
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it("should send a ModelWithRenamedFields value to the server", async () => {
|
|
193
|
+
await client.put({
|
|
194
|
+
inputData: { name: "foo", age: 123 },
|
|
195
|
+
outputData: { name: "bar", age: 456 },
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
describe("ModelWithEmptyArrayValueClient", () => {
|
|
201
|
+
const client = new ModelWithEmptyArrayValueClient({
|
|
202
|
+
allowInsecureConnection: true,
|
|
203
|
+
retryOptions: {
|
|
204
|
+
maxRetries: 1,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it("should handle a ModelWithEmptyArray value returned from the server", async () => {
|
|
209
|
+
const response = await client.get();
|
|
210
|
+
expect(response).toEqual({ items: [] });
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("should send a ModelWithEmptyArray value to the server", async () => {
|
|
214
|
+
await client.put({ items: [] });
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
describe("ModelWithTextValueClient", () => {
|
|
219
|
+
const client = new ModelWithTextValueClient({
|
|
220
|
+
allowInsecureConnection: true,
|
|
221
|
+
retryOptions: {
|
|
222
|
+
maxRetries: 1,
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it("should handle a ModelWithText value returned from the server", async () => {
|
|
227
|
+
const response = await client.get();
|
|
228
|
+
expect(response).toEqual({
|
|
229
|
+
language: "foo",
|
|
230
|
+
content: "This is some text.",
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it("should send a ModelWithText value to the server", async () => {
|
|
235
|
+
await client.put({
|
|
236
|
+
language: "foo",
|
|
237
|
+
content: "This is some text.",
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
describe("ModelWithDictionaryValueClient", () => {
|
|
243
|
+
const client = new ModelWithDictionaryValueClient({
|
|
244
|
+
allowInsecureConnection: true,
|
|
245
|
+
retryOptions: {
|
|
246
|
+
maxRetries: 1,
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("should handle a ModelWithDictionary value returned from the server", async () => {
|
|
251
|
+
const response = await client.get();
|
|
252
|
+
expect(response).toEqual({
|
|
253
|
+
metadata: { Color: "blue", Count: 123, Enabled: false },
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it("should send a ModelWithDictionary value to the server", async () => {
|
|
258
|
+
await client.put({
|
|
259
|
+
metadata: { Color: "blue", Count: 123, Enabled: false } as any,
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
describe("ModelWithEncodedNamesValueClient", () => {
|
|
265
|
+
const client = new ModelWithEncodedNamesValueClient({
|
|
266
|
+
allowInsecureConnection: true,
|
|
267
|
+
retryOptions: {
|
|
268
|
+
maxRetries: 1,
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("should handle a ModelWithEncodedNames value returned from the server", async () => {
|
|
273
|
+
const response = await client.get();
|
|
274
|
+
expect(response).toEqual({
|
|
275
|
+
modelData: { name: "foo", age: 123 },
|
|
276
|
+
colors: ["red", "green", "blue"],
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it("should send a ModelWithEncodedNames value to the server", async () => {
|
|
281
|
+
await client.put({
|
|
282
|
+
modelData: { name: "foo", age: 123 },
|
|
283
|
+
colors: ["red", "green", "blue"],
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
});
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { describe, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
ExplodeClient as ContinuationExplodeClient,
|
|
4
|
+
StandardClient as ContinuationStandardClient,
|
|
5
|
+
InInterfaceClient,
|
|
6
|
+
ExplodeClient as LabelExplodeClient,
|
|
7
|
+
StandardClient as LabelStandardClient,
|
|
8
|
+
ExplodeClient as MatrixExplodeClient,
|
|
9
|
+
StandardClient as MatrixStandardClient,
|
|
10
|
+
ExplodeClient as PathExplodeClient,
|
|
11
|
+
PathParametersClient,
|
|
12
|
+
StandardClient as PathStandardClient,
|
|
13
|
+
ExplodeClient as QueryExplodeClient,
|
|
14
|
+
QueryParametersClient,
|
|
15
|
+
StandardClient as QueryStandardClient,
|
|
16
|
+
ReservedExpansionClient,
|
|
17
|
+
RoutesClient,
|
|
18
|
+
ExplodeClient as SimpleExplodeClient,
|
|
19
|
+
StandardClient as SimpleStandardClient,
|
|
20
|
+
} from "../../generated/routes/src/index.js";
|
|
21
|
+
|
|
22
|
+
describe("Routes", () => {
|
|
23
|
+
const routesClient = new RoutesClient();
|
|
24
|
+
const pathParametersClient = new PathParametersClient();
|
|
25
|
+
const queryParametersClient = new QueryParametersClient();
|
|
26
|
+
|
|
27
|
+
describe("fixed", () => {
|
|
28
|
+
it("should call fixed operation at the root level", async () => {
|
|
29
|
+
await routesClient.fixed();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe("InInterface", () => {
|
|
34
|
+
const inInterfaceClient = new InInterfaceClient();
|
|
35
|
+
|
|
36
|
+
it("should call fixed operation inside interface", async () => {
|
|
37
|
+
await inInterfaceClient.fixed();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe("PathParameters", () => {
|
|
42
|
+
it("should handle implicit path parameter", async () => {
|
|
43
|
+
await pathParametersClient.templateOnly("a");
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("should handle explicit @path parameter", async () => {
|
|
47
|
+
await pathParametersClient.explicit("a");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("should handle @path parameter without explicit route definition", async () => {
|
|
51
|
+
await pathParametersClient.annotationOnly("a");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe("ReservedExpansion", () => {
|
|
55
|
+
const reservedExpansionClient = new ReservedExpansionClient();
|
|
56
|
+
|
|
57
|
+
it("should handle reserved expansion with template", async () => {
|
|
58
|
+
await reservedExpansionClient.template("foo/bar baz");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("should handle reserved expansion with annotation", async () => {
|
|
62
|
+
await reservedExpansionClient.annotation("foo/bar baz");
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
describe("SimpleExpansion", () => {
|
|
67
|
+
describe("Standard", () => {
|
|
68
|
+
const simpleStandardClient = new SimpleStandardClient();
|
|
69
|
+
|
|
70
|
+
it("should handle primitive value with explode: false", async () => {
|
|
71
|
+
await simpleStandardClient.primitive("a");
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("should handle array value with explode: false", async () => {
|
|
75
|
+
await simpleStandardClient.array(["a", "b"]);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("should handle record value with explode: false", async () => {
|
|
79
|
+
await simpleStandardClient.record({ a: 1, b: 2 });
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe("Explode", () => {
|
|
84
|
+
const simpleExplodeClient = new SimpleExplodeClient();
|
|
85
|
+
|
|
86
|
+
it.skip("should handle primitive value with explode: true", async () => {
|
|
87
|
+
await simpleExplodeClient.primitive("a");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("should handle array value with explode: true", async () => {
|
|
91
|
+
await simpleExplodeClient.array(["a", "b"]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("should handle record value with explode: true", async () => {
|
|
95
|
+
await simpleExplodeClient.record({ a: 1, b: 2 });
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
describe("PathExpansion", () => {
|
|
101
|
+
describe("Standard", () => {
|
|
102
|
+
const pathStandardClient = new PathStandardClient();
|
|
103
|
+
|
|
104
|
+
it("should handle primitive value with explode: false", async () => {
|
|
105
|
+
await pathStandardClient.primitive("a");
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it("should handle array value with explode: false", async () => {
|
|
109
|
+
await pathStandardClient.array(["a", "b"]);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("should handle record value with explode: false", async () => {
|
|
113
|
+
await pathStandardClient.record({ a: 1, b: 2 });
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe("Explode", () => {
|
|
118
|
+
const pathExplodeClient = new PathExplodeClient();
|
|
119
|
+
|
|
120
|
+
it.skip("should handle primitive value with explode: true", async () => {
|
|
121
|
+
await pathExplodeClient.primitive("a");
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it("should handle array value with explode: true", async () => {
|
|
125
|
+
await pathExplodeClient.array(["a", "b"]);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("should handle record value with explode: true", async () => {
|
|
129
|
+
await pathExplodeClient.record({ a: 1, b: 2 });
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe("LabelExpansion", () => {
|
|
135
|
+
describe("Standard", () => {
|
|
136
|
+
const labelStandardClient = new LabelStandardClient();
|
|
137
|
+
|
|
138
|
+
it("should handle primitive value with explode: false", async () => {
|
|
139
|
+
await labelStandardClient.primitive("a");
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("should handle array value with explode: false", async () => {
|
|
143
|
+
await labelStandardClient.array(["a", "b"]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("should handle record value with explode: false", async () => {
|
|
147
|
+
await labelStandardClient.record({ a: 1, b: 2 });
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe("Explode", () => {
|
|
152
|
+
const labelExplodeClient = new LabelExplodeClient();
|
|
153
|
+
|
|
154
|
+
it.skip("should handle primitive value with explode: true", async () => {
|
|
155
|
+
await labelExplodeClient.primitive("a");
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("should handle array value with explode: true", async () => {
|
|
159
|
+
await labelExplodeClient.array(["a", "b"]);
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it("should handle record value with explode: true", async () => {
|
|
163
|
+
await labelExplodeClient.record({ a: 1, b: 2 });
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
describe("MatrixExpansion", () => {
|
|
169
|
+
describe("Standard", () => {
|
|
170
|
+
const matrixStandardClient = new MatrixStandardClient();
|
|
171
|
+
|
|
172
|
+
it("should handle primitive value with explode: false", async () => {
|
|
173
|
+
await matrixStandardClient.primitive("a");
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("should handle array value with explode: false", async () => {
|
|
177
|
+
await matrixStandardClient.array(["a", "b"]);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it("should handle record value with explode: false", async () => {
|
|
181
|
+
await matrixStandardClient.record({ a: 1, b: 2 });
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
describe("Explode", () => {
|
|
186
|
+
const matrixExplodeClient = new MatrixExplodeClient();
|
|
187
|
+
|
|
188
|
+
it.skip("should handle primitive value with explode: true", async () => {
|
|
189
|
+
await matrixExplodeClient.primitive("a");
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it("should handle array value with explode: true", async () => {
|
|
193
|
+
await matrixExplodeClient.array(["a", "b"]);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it("should handle record value with explode: true", async () => {
|
|
197
|
+
await matrixExplodeClient.record({ a: 1, b: 2 });
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
describe("QueryParameters", () => {
|
|
204
|
+
it("should handle implicit query parameter", async () => {
|
|
205
|
+
await queryParametersClient.templateOnly("a");
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it("should handle explicit @query parameter", async () => {
|
|
209
|
+
await queryParametersClient.explicit("a");
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
it("should handle @query parameter without explicit route definition", async () => {
|
|
213
|
+
await queryParametersClient.annotationOnly("a");
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
describe("QueryExpansion", () => {
|
|
217
|
+
describe("Standard", () => {
|
|
218
|
+
const queryStandardClient = new QueryStandardClient();
|
|
219
|
+
|
|
220
|
+
it("should handle primitive value with explode: false", async () => {
|
|
221
|
+
await queryStandardClient.primitive("a");
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
it("should handle array value with explode: false", async () => {
|
|
225
|
+
await queryStandardClient.array(["a", "b"]);
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
it("should handle record value with explode: false", async () => {
|
|
229
|
+
await queryStandardClient.record({ a: 1, b: 2 });
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
describe("Explode", () => {
|
|
234
|
+
const queryExplodeClient = new QueryExplodeClient();
|
|
235
|
+
|
|
236
|
+
it.skip("should handle primitive value with explode: true", async () => {
|
|
237
|
+
await queryExplodeClient.primitive("a");
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it("should handle array value with explode: true", async () => {
|
|
241
|
+
await queryExplodeClient.array(["a", "b"]);
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it("should handle record value with explode: true", async () => {
|
|
245
|
+
await queryExplodeClient.record({ a: 1, b: 2 });
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
describe("QueryContinuation", () => {
|
|
251
|
+
describe("Standard", () => {
|
|
252
|
+
const continuationStandardClient = new ContinuationStandardClient();
|
|
253
|
+
|
|
254
|
+
it("should handle primitive value with explode: false", async () => {
|
|
255
|
+
await continuationStandardClient.primitive("a");
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("should handle array value with explode: false", async () => {
|
|
259
|
+
await continuationStandardClient.array(["a", "b"]);
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
it("should handle record value with explode: false", async () => {
|
|
263
|
+
await continuationStandardClient.record({ a: 1, b: 2 });
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
describe("Explode", () => {
|
|
268
|
+
const continuationExplodeClient = new ContinuationExplodeClient();
|
|
269
|
+
|
|
270
|
+
it.skip("should handle primitive value with explode: true", async () => {
|
|
271
|
+
await continuationExplodeClient.primitive("a");
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
it("should handle array value with explode: true", async () => {
|
|
275
|
+
await continuationExplodeClient.array(["a", "b"]);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it("should handle record value with explode: true", async () => {
|
|
279
|
+
await continuationExplodeClient.record({ a: 1, b: 2 });
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { PropertyClient } from "../../../../generated/serialization/encoded-name/json/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Serialization.EncodedName.Json", () => {
|
|
5
|
+
describe("PropertyClient", () => {
|
|
6
|
+
const client = new PropertyClient({ allowInsecureConnection: true });
|
|
7
|
+
|
|
8
|
+
it("should send a JsonEncodedNameModel with 'defaultName' mapped to 'wireName'", async () => {
|
|
9
|
+
await client.send({ defaultName: true });
|
|
10
|
+
// Assert successful request
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should deserialize a JsonEncodedNameModel with 'wireName' mapped to 'defaultName'", async () => {
|
|
14
|
+
const response = await client.get();
|
|
15
|
+
expect(response).toEqual({
|
|
16
|
+
defaultName: true,
|
|
17
|
+
}); // Mock API expected value
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it } from "vitest";
|
|
2
|
+
import { NotDefinedClient } from "../../../../generated/server/endpoint/not-defined/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Server.Endpoint.NotDefined", () => {
|
|
5
|
+
const client = new NotDefinedClient("http://localhost:3000", { allowInsecureConnection: true });
|
|
6
|
+
|
|
7
|
+
it("should handle a request to a server without defining an endpoint", async () => {
|
|
8
|
+
await client.valid();
|
|
9
|
+
// Assert successful request
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { MultipleClient, Versions } from "../../../../generated/server/path/multiple/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Server.Path.Multiple", () => {
|
|
5
|
+
const client = new MultipleClient("http://localhost:3000", Versions.V1_0, {
|
|
6
|
+
allowInsecureConnection: true,
|
|
7
|
+
retryOptions: {
|
|
8
|
+
maxRetries: 0,
|
|
9
|
+
},
|
|
10
|
+
apiVersion: "v1.0",
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it("should call operation with client path parameters", async () => {
|
|
14
|
+
const response = await client.noOperationParams();
|
|
15
|
+
expect(response).toBeUndefined(); // Assert successful request
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("should call operation with client and method path parameters", async () => {
|
|
19
|
+
const response = await client.withOperationPathParam("test");
|
|
20
|
+
expect(response).toBeUndefined(); // Assert successful request
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, it } from "vitest";
|
|
2
|
+
import { SingleClient } from "../../../../generated/server/path/single/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Server.Path.Single", () => {
|
|
5
|
+
const client = new SingleClient("http://localhost:3000", { allowInsecureConnection: true });
|
|
6
|
+
|
|
7
|
+
it("should perform a simple operation in a parameterized server", async () => {
|
|
8
|
+
await client.myOp();
|
|
9
|
+
// Assert successful request
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, it } from "vitest";
|
|
2
|
+
import { NotVersionedClient } from "../../../../generated/server/versions/not-versioned/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Server.Versions.NotVersioned", () => {
|
|
5
|
+
const client = new NotVersionedClient("http://localhost:3000", { allowInsecureConnection: true });
|
|
6
|
+
|
|
7
|
+
it("should execute operation 'withoutApiVersion' without an api-version", async () => {
|
|
8
|
+
await client.withoutApiVersion();
|
|
9
|
+
// Assert successful request
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// Issue with TypeSpec building an invalid uri template with -
|
|
13
|
+
it.skip("should execute operation 'withQueryApiVersion' with query api-version", async () => {
|
|
14
|
+
await client.withQueryApiVersion("v1.0");
|
|
15
|
+
// Assert successful request
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("should execute operation 'withPathApiVersion' with path api-version", async () => {
|
|
19
|
+
await client.withPathApiVersion("v1.0");
|
|
20
|
+
// Assert successful request
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it } from "vitest";
|
|
2
|
+
import { VersionedClient } from "../../../../generated/server/versions/versioned/src/index.js";
|
|
3
|
+
|
|
4
|
+
describe("Server.Versions.Versioned", () => {
|
|
5
|
+
const client = new VersionedClient("http://localhost:3000", { allowInsecureConnection: true });
|
|
6
|
+
|
|
7
|
+
it("should perform operation without api-version in the URL", async () => {
|
|
8
|
+
await client.withoutApiVersion();
|
|
9
|
+
// Assert successful request
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
// Issue with TypeSpec creating an invalid URL Template containing -
|
|
13
|
+
it.skip("should perform operation with query api-version, defaulting to '2022-12-01-preview'", async () => {
|
|
14
|
+
await client.withQueryApiVersion("2022-12-01-preview");
|
|
15
|
+
// Assert successful request
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("should perform operation with path api-version, defaulting to '2022-12-01-preview'", async () => {
|
|
19
|
+
await client.withPathApiVersion("2022-12-01-preview");
|
|
20
|
+
// Assert successful request
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Issue with TypeSpec creating an invalid URL Template containing -
|
|
24
|
+
it.skip("should perform operation with query api-version set to '2021-01-01-preview'", async () => {
|
|
25
|
+
await client.withQueryOldApiVersion("2021-01-01-preview");
|
|
26
|
+
// Assert successful request
|
|
27
|
+
});
|
|
28
|
+
});
|