@typespec/http-client-js 0.16.2-dev.1 → 0.16.2-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -9
- package/.github/copilot-instructions.md +0 -180
- package/.testignore +0 -19
- package/.turbo/turbo-build.log +0 -3
- package/CHANGELOG.md +0 -159
- package/eng/scripts/calculate-coverage.ts +0 -33
- package/eng/scripts/emit-e2e.ts +0 -317
- package/eng/scripts/run-e2e-tests.ts +0 -166
- package/eng/scripts/tspconfig.yaml +0 -6
- package/eng/scripts/upload-spector-results.ts +0 -139
- package/src/components/client-context/client-context-declaration.tsx +0 -26
- package/src/components/client-context/client-context-factory.tsx +0 -218
- package/src/components/client-context/client-context-options.tsx +0 -36
- package/src/components/client-context/client-context.tsx +0 -23
- package/src/components/client-context/parametrized-endpoint.tsx +0 -51
- package/src/components/client-directory.tsx +0 -51
- package/src/components/client-operation.tsx +0 -102
- package/src/components/client.tsx +0 -177
- package/src/components/encoding-provider.tsx +0 -17
- package/src/components/external-packages/ts-http-runtime.ts +0 -28
- package/src/components/external-packages/uri-template.ts +0 -11
- package/src/components/http-request-options.tsx +0 -88
- package/src/components/http-request-parameters-expression.tsx +0 -191
- package/src/components/http-request.tsx +0 -80
- package/src/components/http-response.tsx +0 -74
- package/src/components/index.ts +0 -12
- package/src/components/models.tsx +0 -26
- package/src/components/operation-handlers/index.tsx +0 -2
- package/src/components/operation-handlers/operation-pipeline.tsx +0 -33
- package/src/components/operation-handlers/paging/page-item.tsx +0 -14
- package/src/components/operation-handlers/paging/page-response.tsx +0 -57
- package/src/components/operation-handlers/paging/page-settings.tsx +0 -53
- package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +0 -200
- package/src/components/operation-handlers/paging/request-send.tsx +0 -85
- package/src/components/operation-handlers/paging/response-deserialize.tsx +0 -60
- package/src/components/operation-handlers/paging/util.ts +0 -70
- package/src/components/operation-handlers/types.tsx +0 -18
- package/src/components/operation-options.tsx +0 -42
- package/src/components/operation-parameters.tsx +0 -44
- package/src/components/output.tsx +0 -32
- package/src/components/serializers.tsx +0 -74
- package/src/components/static-helpers/bytes-encoding.tsx +0 -61
- package/src/components/static-helpers/interfaces.tsx +0 -31
- package/src/components/static-helpers/multipart-helpers.tsx +0 -80
- package/src/components/static-helpers/paging-helper.tsx +0 -202
- package/src/components/static-helpers/rest-error.tsx +0 -102
- package/src/components/testing/client-options.tsx +0 -30
- package/src/components/transforms/content-type-encoding-provider.tsx +0 -26
- package/src/components/transforms/data-transform.tsx +0 -40
- package/src/components/transforms/json/json-array-transform.tsx +0 -87
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +0 -54
- package/src/components/transforms/json/json-model-base-transform.tsx +0 -24
- package/src/components/transforms/json/json-model-property-transform.tsx +0 -53
- package/src/components/transforms/json/json-model-transform.tsx +0 -115
- package/src/components/transforms/json/json-record-transform.tsx +0 -88
- package/src/components/transforms/json/json-transform-discriminator.tsx +0 -111
- package/src/components/transforms/json/json-transform.tsx +0 -120
- package/src/components/transforms/json/union-transform.tsx +0 -87
- package/src/components/transforms/json/utils/transport-namer.ts +0 -12
- package/src/components/transforms/multipart/array-part-transform.tsx +0 -44
- package/src/components/transforms/multipart/file-part-transform.tsx +0 -45
- package/src/components/transforms/multipart/multipart-transform.tsx +0 -30
- package/src/components/transforms/multipart/part-transform.tsx +0 -22
- package/src/components/transforms/multipart/simple-part-transform.tsx +0 -42
- package/src/components/transforms/operation-transform-declaration.tsx +0 -83
- package/src/components/transforms/operation-transform-expression.tsx +0 -62
- package/src/components/transforms/scalar-transform.tsx +0 -301
- package/src/components/transforms/transform-name-policy.ts +0 -134
- package/src/components/utils/unpack-model-property.ts +0 -44
- package/src/components/utils/url-template.tsx +0 -25
- package/src/context/encoding/encoding-context.tsx +0 -28
- package/src/context/encoding/types.ts +0 -6
- package/src/emitter.tsx +0 -85
- package/src/index.ts +0 -5
- package/src/lib.ts +0 -120
- package/src/testing/index.ts +0 -11
- package/src/utils/client-discovery.ts +0 -28
- package/src/utils/multipart.ts +0 -29
- package/src/utils/operations.ts +0 -112
- package/src/utils/parameters.tsx +0 -155
- 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 +0 -38
- package/test/e2e/http/authentication/oauth2/main.test.ts +0 -31
- package/test/e2e/http/authentication/union/main.test.ts +0 -26
- package/test/e2e/http/encode/bytes/main.test.ts +0 -191
- package/test/e2e/http/encode/datetime/main.test.ts +0 -176
- package/test/e2e/http/encode/duration/main.test.ts +0 -126
- package/test/e2e/http/encode/numeric/main.test.ts +0 -26
- package/test/e2e/http/parameters/basic/main.test.ts +0 -35
- package/test/e2e/http/parameters/body-optionality/main.test.ts +0 -43
- package/test/e2e/http/parameters/collection-format/main.test.ts +0 -40
- package/test/e2e/http/parameters/spread/main.test.ts +0 -56
- package/test/e2e/http/payload/content-negotiation/main.test.ts +0 -40
- package/test/e2e/http/payload/json-merge-patch/main.test.ts +0 -122
- package/test/e2e/http/payload/media-type/main.test.ts +0 -28
- package/test/e2e/http/payload/multipart/main.test.ts +0 -200
- package/test/e2e/http/payload/pageable/main.test.ts +0 -78
- package/test/e2e/http/payload/xml/main.test.ts +0 -287
- package/test/e2e/http/routes/main.test.ts +0 -284
- package/test/e2e/http/serialization/encoded-name/json/main.test.ts +0 -20
- package/test/e2e/http/server/endpoint/not-defined/main.test.ts +0 -11
- package/test/e2e/http/server/path/multiple/main.test.ts +0 -22
- package/test/e2e/http/server/path/single/main.test.ts +0 -11
- package/test/e2e/http/server/versions/not-versioned/main.test.ts +0 -22
- package/test/e2e/http/server/versions/versioned/main.test.ts +0 -28
- package/test/e2e/http/special-headers/conditional-request/main.test.ts +0 -35
- package/test/e2e/http/special-headers/repeatability/main.test.ts +0 -18
- package/test/e2e/http/special-words/main.test.ts +0 -434
- package/test/e2e/http/type/array/array.test.ts +0 -256
- package/test/e2e/http/type/dictionary/main.test.ts +0 -229
- package/test/e2e/http/type/enum/extensible/main.test.ts +0 -34
- package/test/e2e/http/type/enum/fixed/main.test.ts +0 -29
- package/test/e2e/http/type/model/empty/main.test.ts +0 -21
- package/test/e2e/http/type/model/inheritance/enum-discriminator/main.test.ts +0 -51
- package/test/e2e/http/type/model/inheritance/nested-discriminator/main.test.ts +0 -168
- package/test/e2e/http/type/model/inheritance/not-discriminated/main.test.ts +0 -42
- package/test/e2e/http/type/model/inheritance/recursive/main.test.ts +0 -46
- package/test/e2e/http/type/model/inheritance/single-discriminator/main.test.ts +0 -99
- package/test/e2e/http/type/model/visibility/main.test.ts +0 -64
- package/test/e2e/http/type/property/additional-properties/main.test.ts +0 -185
- package/test/e2e/http/type/property/additional-properties/spreads.test.ts +0 -448
- package/test/e2e/http/type/property/nullable/main.test.ts +0 -275
- package/test/e2e/http/type/property/optionality/main.test.ts +0 -256
- package/test/e2e/http/type/property/value-types/main.test.ts +0 -193
- package/test/e2e/http/type/scalar/main.test.ts +0 -133
- package/test/e2e/http/type/scalar/scalar.test.ts +0 -95
- package/test/e2e/http/type/union/main.test.ts +0 -207
- package/test/e2e/http/versioning/added/main.test.ts +0 -60
- package/test/e2e/http/versioning/madeOptional/main.test.ts +0 -34
- package/test/e2e/http/versioning/removed/main.test.ts +0 -75
- package/test/e2e/http/versioning/renamedFrom/main.test.ts +0 -52
- package/test/e2e/http/versioning/returnTypeChangedFrom/main.test.ts +0 -22
- package/test/e2e/http/versioning/typeChangedFrom/main.test.ts +0 -31
- package/test/scenarios/additional-properties/extends.md +0 -67
- package/test/scenarios/additional-properties/is.md +0 -42
- package/test/scenarios/additional-properties/spread.md +0 -68
- package/test/scenarios/auth/basic_auth.md +0 -68
- package/test/scenarios/auth/bearer.md +0 -68
- package/test/scenarios/auth/client_parameters.md +0 -78
- package/test/scenarios/auth/client_structure.md +0 -36
- package/test/scenarios/auth/key_credential.md +0 -69
- package/test/scenarios/auth/oauth2.md +0 -90
- package/test/scenarios/auth/sub_client_override.md +0 -114
- package/test/scenarios/client/client_context.md +0 -34
- package/test/scenarios/client/dotted_namespace.md +0 -27
- package/test/scenarios/client/global_namespace.md +0 -69
- package/test/scenarios/client/multiple_top_level_clients.md +0 -72
- package/test/scenarios/client/nested_client.md +0 -102
- package/test/scenarios/client/wrapping_namespace.md +0 -41
- package/test/scenarios/encoding/bytes_body.md +0 -44
- package/test/scenarios/encoding/bytes_json_property.md +0 -55
- package/test/scenarios/encoding/bytes_nullable.md +0 -139
- package/test/scenarios/encoding/header_bytes.md +0 -130
- package/test/scenarios/encoding/header_date.md +0 -216
- package/test/scenarios/encoding/model_with_bytes_property.md +0 -45
- package/test/scenarios/encoding/query_bytes.md +0 -42
- package/test/scenarios/encoding/query_date.md +0 -216
- package/test/scenarios/http-operations/basic-request.md +0 -144
- package/test/scenarios/http-operations/basic-response.md +0 -219
- package/test/scenarios/http-operations/basic.md +0 -128
- package/test/scenarios/http-operations/constant-header.md +0 -33
- package/test/scenarios/http-operations/create-operation.md +0 -58
- package/test/scenarios/http-operations/on_response.md +0 -52
- package/test/scenarios/http-operations/optional-request-body.md +0 -50
- package/test/scenarios/http-operations/paging.md +0 -242
- package/test/scenarios/http-operations/path-parameter-in-model.md +0 -53
- package/test/scenarios/http-operations/path-parameter.md +0 -48
- package/test/scenarios/http-operations/query-parameter.md +0 -41
- package/test/scenarios/http-operations/scalar-payload.md +0 -57
- package/test/scenarios/http-operations/with-parameters.md +0 -78
- package/test/scenarios/models/array-properties.md +0 -47
- package/test/scenarios/models/basic.md +0 -118
- package/test/scenarios/models/dictionary-properties.md +0 -44
- package/test/scenarios/models/inheritance_2_discriminators.md +0 -346
- package/test/scenarios/models/inheritance_discriminator.md +0 -88
- package/test/scenarios/models/inline-models.md +0 -29
- package/test/scenarios/models/model_additional_properties.md +0 -75
- package/test/scenarios/models/model_extends.md +0 -97
- package/test/scenarios/models/model_spread.md +0 -63
- package/test/scenarios/models/nested_property.md +0 -41
- package/test/scenarios/models/property_references_property.md +0 -150
- package/test/scenarios/multipart/anonymous_part.md +0 -53
- package/test/scenarios/multipart/file.md +0 -154
- package/test/scenarios/multipart/file_content_type.md +0 -92
- package/test/scenarios/multipart/non-string-float.md +0 -55
- package/test/scenarios/multipart/simple_part.md +0 -65
- package/test/scenarios/operation-parameters/body_root_anonymous.md +0 -87
- package/test/scenarios/operation-parameters/constant_as_optional.md +0 -54
- package/test/scenarios/operation-parameters/default_value_as_optional.md +0 -54
- package/test/scenarios/operation-parameters/no_content_type.md +0 -62
- package/test/scenarios/operation-parameters/no_parameters.md +0 -50
- package/test/scenarios/operation-parameters/only_optional.md +0 -62
- package/test/scenarios/operation-parameters/only_required.md +0 -58
- package/test/scenarios/operation-parameters/reserved_names.md +0 -60
- package/test/scenarios/operation-parameters/spread_body.md +0 -70
- package/test/scenarios/operation-parameters/spread_with_nested.md +0 -82
- package/test/scenarios/operation-parameters/union_body.md +0 -86
- package/test/scenarios/operation-parameters/with_body_property.md +0 -67
- package/test/scenarios/operation-parameters/with_body_root.md +0 -69
- package/test/scenarios/serializers/arrays.md +0 -191
- package/test/scenarios/serializers/basic_model.md +0 -111
- package/test/scenarios/serializers/basic_model_wire_name.md +0 -48
- package/test/scenarios/serializers/discriminated_union.md +0 -86
- package/test/scenarios/serializers/discriminated_union_spread.md +0 -115
- package/test/scenarios/serializers/file.md +0 -67
- package/test/scenarios/serializers/model_date_time.md +0 -65
- package/test/scenarios/serializers/multipart.md +0 -62
- package/test/scenarios/serializers/polymorphic_single_level_inheritance.md +0 -157
- package/test/scenarios/serializers/property_references_property.md +0 -72
- package/test/scenarios/serializers/record.md +0 -97
- package/test/scenarios/serializers/scalars.md +0 -34
- package/test/scenarios/serializers/spread.md +0 -69
- package/test/scenarios/serializers/string_union.md +0 -55
- package/test/scenarios/server/default_url.md +0 -45
- package/test/scenarios/server/multiple-parameters.md +0 -55
- package/test/scenarios/server/no-server.md +0 -37
- package/test/scenarios/server/parametrized-endpoint.md +0 -51
- package/test/scenarios.test.ts +0 -24
- package/test/test-host.ts +0 -22
- package/tsconfig.json +0 -16
- package/tsconfig.test.json +0 -9
- package/vitest.config.e2e.ts +0 -16
- package/vitest.config.ts +0 -15
|
@@ -1,434 +0,0 @@
|
|
|
1
|
-
import { describe, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
ModelPropertiesClient,
|
|
4
|
-
ModelsClient,
|
|
5
|
-
OperationsClient,
|
|
6
|
-
ParametersClient,
|
|
7
|
-
} from "../../generated/special-words/src/index.js";
|
|
8
|
-
|
|
9
|
-
describe("SpecialWords", () => {
|
|
10
|
-
describe("OperationsClient", () => {
|
|
11
|
-
const client = new OperationsClient({ allowInsecureConnection: true });
|
|
12
|
-
|
|
13
|
-
it("should handle operation 'and'", async () => {
|
|
14
|
-
await client.and();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("should handle operation 'as'", async () => {
|
|
18
|
-
await client.as_();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("should handle operation 'assert'", async () => {
|
|
22
|
-
await client.assert();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("should handle operation 'async'", async () => {
|
|
26
|
-
await client.async();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("should handle operation 'await'", async () => {
|
|
30
|
-
await client.await_();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it("should handle operation 'break'", async () => {
|
|
34
|
-
await client.break_();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("should handle operation 'class'", async () => {
|
|
38
|
-
await client.class_();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("should handle operation 'constructor'", async () => {
|
|
42
|
-
await client.constructor_2();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("should handle operation 'continue'", async () => {
|
|
46
|
-
await client.continue_();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("should handle operation 'def'", async () => {
|
|
50
|
-
await client.def();
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("should handle operation 'del'", async () => {
|
|
54
|
-
await client.del();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("should handle operation 'elif'", async () => {
|
|
58
|
-
await client.elif();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("should handle operation 'else'", async () => {
|
|
62
|
-
await client.else_();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it("should handle operation 'except'", async () => {
|
|
66
|
-
await client.except();
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("should handle operation 'exec'", async () => {
|
|
70
|
-
await client.exec();
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
it("should handle operation 'finally'", async () => {
|
|
74
|
-
await client.finally_();
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it("should handle operation 'for'", async () => {
|
|
78
|
-
await client.for_();
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("should handle operation 'from'", async () => {
|
|
82
|
-
await client.from();
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("should handle operation 'global'", async () => {
|
|
86
|
-
await client.global();
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it("should handle operation 'if'", async () => {
|
|
90
|
-
await client.if_();
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it("should handle operation 'import'", async () => {
|
|
94
|
-
await client.import_();
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it("should handle operation 'in'", async () => {
|
|
98
|
-
await client.in_();
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it("should handle operation 'is'", async () => {
|
|
102
|
-
await client.is();
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it("should handle operation 'lambda'", async () => {
|
|
106
|
-
await client.lambda();
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it("should handle operation 'not'", async () => {
|
|
110
|
-
await client.not();
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it("should handle operation 'or'", async () => {
|
|
114
|
-
await client.or();
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
it("should handle operation 'pass'", async () => {
|
|
118
|
-
await client.pass();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it("should handle operation 'raise'", async () => {
|
|
122
|
-
await client.raise();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("should handle operation 'return'", async () => {
|
|
126
|
-
await client.return_();
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("should handle operation 'try'", async () => {
|
|
130
|
-
await client.try_();
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it("should handle operation 'while'", async () => {
|
|
134
|
-
await client.while_();
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it("should handle operation 'with'", async () => {
|
|
138
|
-
await client.with_();
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
it("should handle operation 'yield'", async () => {
|
|
142
|
-
await client.yield_();
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
describe("ParametersClient", () => {
|
|
147
|
-
const client = new ParametersClient({ allowInsecureConnection: true });
|
|
148
|
-
|
|
149
|
-
it("should handle parameter 'and'", async () => {
|
|
150
|
-
await client.withAnd("ok");
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it("should handle parameter 'as'", async () => {
|
|
154
|
-
await client.withAs("ok");
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
it("should handle parameter 'assert'", async () => {
|
|
158
|
-
await client.withAssert("ok");
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it("should handle parameter 'async'", async () => {
|
|
162
|
-
await client.withAsync("ok");
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
it("should handle parameter 'await'", async () => {
|
|
166
|
-
await client.withAwait("ok");
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
it("should handle parameter 'break'", async () => {
|
|
170
|
-
await client.withBreak("ok");
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
it("should handle parameter 'class'", async () => {
|
|
174
|
-
await client.withClass("ok");
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it("should handle parameter 'constructor'", async () => {
|
|
178
|
-
await client.withConstructor("ok");
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
it("should handle parameter 'continue'", async () => {
|
|
182
|
-
await client.withContinue("ok");
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
it("should handle parameter 'def'", async () => {
|
|
186
|
-
await client.withDef("ok");
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it("should handle parameter 'del'", async () => {
|
|
190
|
-
await client.withDel("ok");
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
it("should handle parameter 'elif'", async () => {
|
|
194
|
-
await client.withElif("ok");
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it("should handle parameter 'else'", async () => {
|
|
198
|
-
await client.withElse("ok");
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
it("should handle parameter 'except'", async () => {
|
|
202
|
-
await client.withExcept("ok");
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it("should handle parameter 'exec'", async () => {
|
|
206
|
-
await client.withExec("ok");
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
it("should handle parameter 'finally'", async () => {
|
|
210
|
-
await client.withFinally("ok");
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
it("should handle parameter 'for'", async () => {
|
|
214
|
-
await client.withFor("ok");
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
it("should handle parameter 'from'", async () => {
|
|
218
|
-
await client.withFrom("ok");
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
it("should handle parameter 'global'", async () => {
|
|
222
|
-
await client.withGlobal("ok");
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
it("should handle parameter 'if'", async () => {
|
|
226
|
-
await client.withIf("ok");
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it("should handle parameter 'import'", async () => {
|
|
230
|
-
await client.withImport("ok");
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
it("should handle parameter 'in'", async () => {
|
|
234
|
-
await client.withIn("ok");
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
it("should handle parameter 'is'", async () => {
|
|
238
|
-
await client.withIs("ok");
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
it("should handle parameter 'lambda'", async () => {
|
|
242
|
-
await client.withLambda("ok");
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
it("should handle parameter 'not'", async () => {
|
|
246
|
-
await client.withNot("ok");
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
it("should handle parameter 'or'", async () => {
|
|
250
|
-
await client.withOr("ok");
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
it("should handle parameter 'pass'", async () => {
|
|
254
|
-
await client.withPass("ok");
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
it("should handle parameter 'raise'", async () => {
|
|
258
|
-
await client.withRaise("ok");
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
it("should handle parameter 'return'", async () => {
|
|
262
|
-
await client.withReturn("ok");
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
it("should handle parameter 'try'", async () => {
|
|
266
|
-
await client.withTry("ok");
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
it("should handle parameter 'while'", async () => {
|
|
270
|
-
await client.withWhile("ok");
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
it("should handle parameter 'with'", async () => {
|
|
274
|
-
await client.withWith("ok");
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
it("should handle parameter 'yield'", async () => {
|
|
278
|
-
await client.withYield("ok");
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
it("should handle parameter 'cancellationToken'", async () => {
|
|
282
|
-
await client.withCancellationToken("ok");
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
describe("ModelsClient", () => {
|
|
287
|
-
const client = new ModelsClient({ allowInsecureConnection: true });
|
|
288
|
-
|
|
289
|
-
it("should handle model 'and'", async () => {
|
|
290
|
-
await client.withAnd({ name: "ok" });
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
it("should handle model 'as'", async () => {
|
|
294
|
-
await client.withAs({ name: "ok" });
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
it("should handle model 'assert'", async () => {
|
|
298
|
-
await client.withAssert({ name: "ok" });
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
it("should handle model 'async'", async () => {
|
|
302
|
-
await client.withAsync({ name: "ok" });
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
it("should handle model 'await'", async () => {
|
|
306
|
-
await client.withAwait({ name: "ok" });
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
it("should handle model 'break'", async () => {
|
|
310
|
-
await client.withBreak({ name: "ok" });
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
it("should handle model 'class'", async () => {
|
|
314
|
-
await client.withClass({ name: "ok" });
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
it("should handle model 'constructor'", async () => {
|
|
318
|
-
await client.withConstructor({ name: "ok" });
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
it("should handle model 'continue'", async () => {
|
|
322
|
-
await client.withContinue({ name: "ok" });
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
it("should handle model 'def'", async () => {
|
|
326
|
-
await client.withDef({ name: "ok" });
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
it("should handle model 'del'", async () => {
|
|
330
|
-
await client.withDel({ name: "ok" });
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
it("should handle model 'elif'", async () => {
|
|
334
|
-
await client.withElif({ name: "ok" });
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
it("should handle model 'else'", async () => {
|
|
338
|
-
await client.withElse({ name: "ok" });
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
it("should handle model 'except'", async () => {
|
|
342
|
-
await client.withExcept({ name: "ok" });
|
|
343
|
-
});
|
|
344
|
-
|
|
345
|
-
it("should handle model 'exec'", async () => {
|
|
346
|
-
await client.withExec({ name: "ok" });
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
it("should handle model 'finally'", async () => {
|
|
350
|
-
await client.withFinally({ name: "ok" });
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
it("should handle model 'for'", async () => {
|
|
354
|
-
await client.withFor({ name: "ok" });
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
it("should handle model 'from'", async () => {
|
|
358
|
-
await client.withFrom({ name: "ok" });
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
it("should handle model 'global'", async () => {
|
|
362
|
-
await client.withGlobal({ name: "ok" });
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
it("should handle model 'if'", async () => {
|
|
366
|
-
await client.withIf({ name: "ok" });
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
it("should handle model 'import'", async () => {
|
|
370
|
-
await client.withImport({ name: "ok" });
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
it("should handle model 'in'", async () => {
|
|
374
|
-
await client.withIn({ name: "ok" });
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
it("should handle model 'is'", async () => {
|
|
378
|
-
await client.withIs({ name: "ok" });
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
it("should handle model 'lambda'", async () => {
|
|
382
|
-
await client.withLambda({ name: "ok" });
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
it("should handle model 'not'", async () => {
|
|
386
|
-
await client.withNot({ name: "ok" });
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
it("should handle model 'or'", async () => {
|
|
390
|
-
await client.withOr({ name: "ok" });
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
it("should handle model 'pass'", async () => {
|
|
394
|
-
await client.withPass({ name: "ok" });
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
it("should handle model 'raise'", async () => {
|
|
398
|
-
await client.withRaise({ name: "ok" });
|
|
399
|
-
});
|
|
400
|
-
|
|
401
|
-
it("should handle model 'return'", async () => {
|
|
402
|
-
await client.withReturn({ name: "ok" });
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
it("should handle model 'try'", async () => {
|
|
406
|
-
await client.withTry({ name: "ok" });
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
it("should handle model 'while'", async () => {
|
|
410
|
-
await client.withWhile({ name: "ok" });
|
|
411
|
-
});
|
|
412
|
-
|
|
413
|
-
it("should handle model 'with'", async () => {
|
|
414
|
-
await client.withWith({ name: "ok" });
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
it("should handle model 'yield'", async () => {
|
|
418
|
-
await client.withYield({ name: "ok" });
|
|
419
|
-
});
|
|
420
|
-
});
|
|
421
|
-
|
|
422
|
-
describe("ModelPropertiesClient", () => {
|
|
423
|
-
const client = new ModelPropertiesClient({
|
|
424
|
-
allowInsecureConnection: true,
|
|
425
|
-
retryOptions: {
|
|
426
|
-
maxRetries: 1,
|
|
427
|
-
},
|
|
428
|
-
});
|
|
429
|
-
|
|
430
|
-
it("should handle property same as the model name", async () => {
|
|
431
|
-
await client.sameAsModel({ sameAsModel: "ok" });
|
|
432
|
-
});
|
|
433
|
-
});
|
|
434
|
-
});
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
BooleanValueClient,
|
|
4
|
-
DatetimeValueClient,
|
|
5
|
-
DurationValueClient,
|
|
6
|
-
Float32ValueClient,
|
|
7
|
-
Int32ValueClient,
|
|
8
|
-
Int64ValueClient,
|
|
9
|
-
ModelValueClient,
|
|
10
|
-
NullableBooleanValueClient,
|
|
11
|
-
NullableFloatValueClient,
|
|
12
|
-
NullableInt32ValueClient,
|
|
13
|
-
NullableModelValueClient,
|
|
14
|
-
NullableStringValueClient,
|
|
15
|
-
StringValueClient,
|
|
16
|
-
UnknownValueClient,
|
|
17
|
-
} from "../../../generated/type/array/src/index.js";
|
|
18
|
-
|
|
19
|
-
describe("Type.Array", () => {
|
|
20
|
-
describe("Int32ValueClient", () => {
|
|
21
|
-
const client = new Int32ValueClient({ allowInsecureConnection: true });
|
|
22
|
-
|
|
23
|
-
it("should handle an array of int32 values returned from the server", async () => {
|
|
24
|
-
const response = await client.get();
|
|
25
|
-
expect(response).toEqual([1, 2]);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("should send an array of int32 values to the server", async () => {
|
|
29
|
-
await client.put([1, 2]);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
describe("Int64ValueClient", () => {
|
|
34
|
-
const client = new Int64ValueClient({ allowInsecureConnection: true });
|
|
35
|
-
|
|
36
|
-
it("should handle an array of int64 values returned from the server", async () => {
|
|
37
|
-
const response = await client.get();
|
|
38
|
-
expect(response).toEqual([9007199254740991, -9007199254740991]);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it.skip("should send an array of int64 values to the server", async () => {
|
|
42
|
-
await client.put([0x7fffffffffffffffn, -0x7fffffffffffffffn]);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe("BooleanValueClient", () => {
|
|
47
|
-
const client = new BooleanValueClient({
|
|
48
|
-
allowInsecureConnection: true,
|
|
49
|
-
retryOptions: {
|
|
50
|
-
maxRetries: 1,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it("should handle an array of boolean values returned from the server", async () => {
|
|
55
|
-
const response = await client.get();
|
|
56
|
-
expect(response).toEqual([true, false]);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it("should send an array of boolean values to the server", async () => {
|
|
60
|
-
await client.put([true, false]);
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe("StringValueClient", () => {
|
|
65
|
-
const client = new StringValueClient({
|
|
66
|
-
allowInsecureConnection: true,
|
|
67
|
-
retryOptions: {
|
|
68
|
-
maxRetries: 1,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it("should handle an array of string values returned from the server", async () => {
|
|
73
|
-
const response = await client.get();
|
|
74
|
-
expect(response).toEqual(["hello", ""]);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it("should send an array of string values to the server", async () => {
|
|
78
|
-
await client.put(["hello", ""]);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
describe("Float32ValueClient", () => {
|
|
83
|
-
const client = new Float32ValueClient({
|
|
84
|
-
allowInsecureConnection: true,
|
|
85
|
-
retryOptions: {
|
|
86
|
-
maxRetries: 1,
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it("should handle an array of float values returned from the server", async () => {
|
|
91
|
-
const response = await client.get();
|
|
92
|
-
expect(response).toEqual([43.125]);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it("should send an array of float values to the server", async () => {
|
|
96
|
-
await client.put([43.125]);
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
describe("DatetimeValueClient", () => {
|
|
101
|
-
const client = new DatetimeValueClient({
|
|
102
|
-
allowInsecureConnection: true,
|
|
103
|
-
retryOptions: {
|
|
104
|
-
maxRetries: 1,
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it("should handle an array of datetime values returned from the server", async () => {
|
|
109
|
-
const response = await client.get();
|
|
110
|
-
expect(response).toEqual([new Date("2022-08-26T18:38:00Z")]);
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
it("should send an array of datetime values to the server", async () => {
|
|
114
|
-
await client.put([new Date("2022-08-26T18:38:00Z")]);
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
describe("DurationValueClient", () => {
|
|
119
|
-
const client = new DurationValueClient({
|
|
120
|
-
allowInsecureConnection: true,
|
|
121
|
-
retryOptions: {
|
|
122
|
-
maxRetries: 1,
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it("should handle an array of duration values returned from the server", async () => {
|
|
127
|
-
const response = await client.get();
|
|
128
|
-
expect(response).toEqual(["P123DT22H14M12.011S"]);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it("should send an array of duration values to the server", async () => {
|
|
132
|
-
await client.put(["P123DT22H14M12.011S"]);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe("UnknownValueClient", () => {
|
|
137
|
-
const client = new UnknownValueClient({
|
|
138
|
-
allowInsecureConnection: true,
|
|
139
|
-
retryOptions: {
|
|
140
|
-
maxRetries: 1,
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it("should handle an array of unknown values returned from the server", async () => {
|
|
145
|
-
const response = await client.get();
|
|
146
|
-
expect(response).toEqual([1, "hello", null]);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it("should send an array of unknown values to the server", async () => {
|
|
150
|
-
await client.put([1, "hello", null]);
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
describe("ModelValueClient", () => {
|
|
155
|
-
const client = new ModelValueClient({ allowInsecureConnection: true });
|
|
156
|
-
|
|
157
|
-
it("should handle an array of model values returned from the server", async () => {
|
|
158
|
-
const response = await client.get();
|
|
159
|
-
expect(response).toEqual([{ property: "hello" }, { property: "world" }]);
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
it("should send an array of model values to the server", async () => {
|
|
163
|
-
await client.put([{ property: "hello" }, { property: "world" }]);
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
describe("NullableFloatValueClient", () => {
|
|
168
|
-
const client = new NullableFloatValueClient({
|
|
169
|
-
allowInsecureConnection: true,
|
|
170
|
-
retryOptions: {
|
|
171
|
-
maxRetries: 1,
|
|
172
|
-
},
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
it("should handle an array of nullable float values returned from the server", async () => {
|
|
176
|
-
const response = await client.get();
|
|
177
|
-
expect(response).toEqual([1.25, null, 3.0]);
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it("should send an array of nullable float values to the server", async () => {
|
|
181
|
-
await client.put([1.25, null, 3.0]);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
describe("NullableInt32ValueClient", () => {
|
|
186
|
-
const client = new NullableInt32ValueClient({
|
|
187
|
-
allowInsecureConnection: true,
|
|
188
|
-
retryOptions: {
|
|
189
|
-
maxRetries: 1,
|
|
190
|
-
},
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
it("should handle an array of nullable int32 values returned from the server", async () => {
|
|
194
|
-
const response = await client.get();
|
|
195
|
-
expect(response).toEqual([1, null, 3]);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
it("should send an array of nullable int32 values to the server", async () => {
|
|
199
|
-
await client.put([1, null, 3]);
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
describe("NullableBooleanValueClient", () => {
|
|
204
|
-
const client = new NullableBooleanValueClient({
|
|
205
|
-
allowInsecureConnection: true,
|
|
206
|
-
retryOptions: {
|
|
207
|
-
maxRetries: 1,
|
|
208
|
-
},
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
it("should handle an array of nullable boolean values returned from the server", async () => {
|
|
212
|
-
const response = await client.get();
|
|
213
|
-
expect(response).toEqual([true, null, false]);
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
it("should send an array of nullable boolean values to the server", async () => {
|
|
217
|
-
await client.put([true, null, false]);
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
describe("NullableStringValueClient", () => {
|
|
222
|
-
const client = new NullableStringValueClient({
|
|
223
|
-
allowInsecureConnection: true,
|
|
224
|
-
retryOptions: {
|
|
225
|
-
maxRetries: 1,
|
|
226
|
-
},
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
it("should handle an array of nullable string values returned from the server", async () => {
|
|
230
|
-
const response = await client.get();
|
|
231
|
-
expect(response).toEqual(["hello", null, "world"]);
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
it("should send an array of nullable string values to the server", async () => {
|
|
235
|
-
await client.put(["hello", null, "world"]);
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
describe("NullableModelValueClient", () => {
|
|
240
|
-
const client = new NullableModelValueClient({
|
|
241
|
-
allowInsecureConnection: true,
|
|
242
|
-
retryOptions: {
|
|
243
|
-
maxRetries: 1,
|
|
244
|
-
},
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
it("should handle an array of nullable model values returned from the server", async () => {
|
|
248
|
-
const response = await client.get();
|
|
249
|
-
expect(response).toEqual([{ property: "hello" }, null, { property: "world" }]);
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
it("should send an array of nullable model values to the server", async () => {
|
|
253
|
-
await client.put([{ property: "hello" }, null, { property: "world" }]);
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
});
|