@typespec/http-client-js 0.2.0-dev.2 → 0.2.0-dev.4
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/src/components/client-context/client-context-declaration.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-declaration.js.map +1 -1
- package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-factory.js +7 -4
- package/dist/src/components/client-context/client-context-factory.js.map +1 -1
- package/dist/src/components/client-context/client-context-options.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-options.js +13 -9
- package/dist/src/components/client-context/client-context-options.js.map +1 -1
- package/dist/src/components/client-context/client-context.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context.js +7 -12
- package/dist/src/components/client-context/client-context.js.map +1 -1
- package/dist/src/components/client-context/parametrized-endpoint.d.ts +1 -1
- package/dist/src/components/client-context/parametrized-endpoint.d.ts.map +1 -1
- package/dist/src/components/client-context/parametrized-endpoint.js +22 -13
- package/dist/src/components/client-context/parametrized-endpoint.js.map +1 -1
- package/dist/src/components/client-directory.d.ts +2 -2
- package/dist/src/components/client-directory.d.ts.map +1 -1
- package/dist/src/components/client-directory.js +33 -21
- package/dist/src/components/client-directory.js.map +1 -1
- package/dist/src/components/client-operation.d.ts.map +1 -1
- package/dist/src/components/client-operation.js +6 -6
- package/dist/src/components/client-operation.js.map +1 -1
- package/dist/src/components/client.d.ts +1 -1
- package/dist/src/components/client.d.ts.map +1 -1
- package/dist/src/components/client.js +83 -64
- package/dist/src/components/client.js.map +1 -1
- package/dist/src/components/encoding-provider.d.ts.map +1 -1
- package/dist/src/components/encoding-provider.js +0 -1
- package/dist/src/components/encoding-provider.js.map +1 -1
- package/dist/src/components/http-request-options.d.ts.map +1 -1
- package/dist/src/components/http-request-options.js +3 -3
- package/dist/src/components/http-request-options.js.map +1 -1
- package/dist/src/components/http-request-parameters-expression.d.ts +1 -2
- package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -1
- package/dist/src/components/http-request-parameters-expression.js +37 -33
- package/dist/src/components/http-request-parameters-expression.js.map +1 -1
- package/dist/src/components/http-request.d.ts.map +1 -1
- package/dist/src/components/http-request.js +24 -20
- package/dist/src/components/http-request.js.map +1 -1
- package/dist/src/components/http-response.d.ts +1 -1
- package/dist/src/components/http-response.d.ts.map +1 -1
- package/dist/src/components/http-response.js +36 -33
- package/dist/src/components/http-response.js.map +1 -1
- package/dist/src/components/models.d.ts.map +1 -1
- package/dist/src/components/models.js +21 -18
- package/dist/src/components/models.js.map +1 -1
- package/dist/src/components/operation-options.d.ts.map +1 -1
- package/dist/src/components/operation-options.js +17 -14
- package/dist/src/components/operation-options.js.map +1 -1
- package/dist/src/components/output.d.ts.map +1 -1
- package/dist/src/components/output.js +2 -1
- package/dist/src/components/output.js.map +1 -1
- package/dist/src/components/serializers.d.ts.map +1 -1
- package/dist/src/components/serializers.js +3 -3
- package/dist/src/components/serializers.js.map +1 -1
- package/dist/src/components/static-helpers/bytes-encoding.d.ts.map +1 -1
- package/dist/src/components/static-helpers/bytes-encoding.js +2 -2
- package/dist/src/components/static-helpers/bytes-encoding.js.map +1 -1
- package/dist/src/components/static-helpers/interfaces.d.ts.map +1 -1
- package/dist/src/components/static-helpers/interfaces.js.map +1 -1
- package/dist/src/components/static-helpers/multipart-helpers.d.ts.map +1 -1
- package/dist/src/components/static-helpers/multipart-helpers.js +4 -4
- package/dist/src/components/static-helpers/multipart-helpers.js.map +1 -1
- package/dist/src/components/static-helpers/rest-error.d.ts.map +1 -1
- package/dist/src/components/static-helpers/rest-error.js +66 -57
- package/dist/src/components/static-helpers/rest-error.js.map +1 -1
- package/dist/src/components/testing/client-options.d.ts.map +1 -1
- package/dist/src/components/testing/client-options.js +0 -2
- package/dist/src/components/testing/client-options.js.map +1 -1
- package/dist/src/components/transforms/content-type-encoding-provider.d.ts.map +1 -1
- package/dist/src/components/transforms/content-type-encoding-provider.js +0 -1
- package/dist/src/components/transforms/content-type-encoding-provider.js.map +1 -1
- package/dist/src/components/transforms/json/json-array-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-array-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.js +4 -4
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-model-base-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-base-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-property-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-model-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-transform.js +20 -17
- package/dist/src/components/transforms/json/json-model-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-record-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-record-transform.js.map +1 -1
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-transform-discriminator.js +5 -10
- package/dist/src/components/transforms/json/json-transform-discriminator.js.map +1 -1
- package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-transform.js.map +1 -1
- package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/union-transform.js +2 -2
- package/dist/src/components/transforms/json/union-transform.js.map +1 -1
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/array-part-transform.js.map +1 -1
- package/dist/src/components/transforms/multipart/file-part-transform.js +1 -1
- package/dist/src/components/transforms/multipart/file-part-transform.js.map +1 -1
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/multipart-transform.js +9 -6
- package/dist/src/components/transforms/multipart/multipart-transform.js.map +1 -1
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/simple-part-transform.js +1 -1
- package/dist/src/components/transforms/multipart/simple-part-transform.js.map +1 -1
- package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -1
- package/dist/src/components/transforms/operation-transform-declaration.js +2 -2
- package/dist/src/components/transforms/operation-transform-declaration.js.map +1 -1
- package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -1
- package/dist/src/components/transforms/operation-transform-expression.js.map +1 -1
- package/dist/src/components/utils/url-template.d.ts.map +1 -1
- package/dist/src/components/utils/url-template.js.map +1 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +6 -6
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/utils/operations.d.ts +13 -1
- package/dist/src/utils/operations.d.ts.map +1 -1
- package/dist/src/utils/operations.js +71 -0
- package/dist/src/utils/operations.js.map +1 -1
- package/dist/src/utils/parameters.d.ts.map +1 -1
- package/dist/src/utils/parameters.js +1 -1
- package/dist/src/utils/parameters.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -5
- package/src/components/client-context/client-context-declaration.tsx +8 -1
- package/src/components/client-context/client-context-factory.tsx +50 -30
- package/src/components/client-context/client-context-options.tsx +13 -6
- package/src/components/client-context/client-context.tsx +5 -3
- package/src/components/client-context/parametrized-endpoint.tsx +26 -15
- package/src/components/client-directory.tsx +26 -16
- package/src/components/client-operation.tsx +24 -12
- package/src/components/client.tsx +77 -39
- package/src/components/encoding-provider.tsx +1 -3
- package/src/components/http-request-options.tsx +24 -14
- package/src/components/http-request-parameters-expression.tsx +34 -37
- package/src/components/http-request.tsx +26 -16
- package/src/components/http-response.tsx +31 -26
- package/src/components/models.tsx +18 -14
- package/src/components/operation-options.tsx +18 -5
- package/src/components/output.tsx +10 -9
- package/src/components/serializers.tsx +9 -5
- package/src/components/static-helpers/bytes-encoding.tsx +26 -8
- package/src/components/static-helpers/interfaces.tsx +14 -9
- package/src/components/static-helpers/multipart-helpers.tsx +34 -13
- package/src/components/static-helpers/rest-error.tsx +56 -18
- package/src/components/testing/client-options.tsx +0 -3
- package/src/components/transforms/content-type-encoding-provider.tsx +1 -3
- package/src/components/transforms/json/json-array-transform.tsx +6 -4
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +18 -13
- package/src/components/transforms/json/json-model-base-transform.tsx +6 -1
- package/src/components/transforms/json/json-model-property-transform.tsx +7 -9
- package/src/components/transforms/json/json-model-transform.tsx +44 -16
- package/src/components/transforms/json/json-record-transform.tsx +5 -3
- package/src/components/transforms/json/json-transform-discriminator.tsx +17 -30
- package/src/components/transforms/json/json-transform.tsx +5 -3
- package/src/components/transforms/json/union-transform.tsx +20 -8
- package/src/components/transforms/multipart/array-part-transform.tsx +6 -3
- package/src/components/transforms/multipart/file-part-transform.tsx +1 -1
- package/src/components/transforms/multipart/multipart-transform.tsx +4 -6
- package/src/components/transforms/multipart/part-transform.tsx +1 -1
- package/src/components/transforms/multipart/simple-part-transform.tsx +7 -10
- package/src/components/transforms/operation-transform-declaration.tsx +24 -7
- package/src/components/transforms/operation-transform-expression.tsx +12 -5
- package/src/components/utils/url-template.tsx +10 -6
- package/src/emitter.tsx +4 -3
- package/src/utils/operations.ts +96 -1
- package/src/utils/parameters.tsx +5 -1
- package/test/e2e/http/type/property/additional-properties/spreads.test.ts +4 -1
- package/test/scenarios/additional-properties/extends.md +0 -4
- package/test/scenarios/additional-properties/is.md +0 -4
- package/test/scenarios/additional-properties/spread.md +0 -4
- package/test/scenarios/auth/basic_auth.md +0 -1
- package/test/scenarios/auth/bearer.md +0 -1
- package/test/scenarios/auth/client_parameters.md +0 -1
- package/test/scenarios/auth/key_credential.md +0 -1
- package/test/scenarios/auth/sub_client_override.md +0 -2
- package/test/scenarios/client/dotted_namespace.md +0 -1
- package/test/scenarios/client/global_namespace.md +0 -5
- package/test/scenarios/client/multiple_top_level_clients.md +0 -2
- package/test/scenarios/client/nested_client.md +0 -2
- package/test/scenarios/encoding/bytes_body.md +0 -4
- package/test/scenarios/encoding/bytes_json_property.md +0 -5
- package/test/scenarios/encoding/bytes_nullable.md +0 -14
- package/test/scenarios/encoding/header_bytes.md +0 -12
- package/test/scenarios/encoding/header_date.md +0 -20
- package/test/scenarios/encoding/model_with_bytes_property.md +0 -5
- package/test/scenarios/encoding/query_bytes.md +0 -4
- package/test/scenarios/encoding/query_date.md +0 -20
- package/test/scenarios/http-operations/basic-request.md +0 -12
- package/test/scenarios/http-operations/basic-response.md +0 -19
- package/test/scenarios/http-operations/basic.md +0 -6
- package/test/scenarios/http-operations/constant-header.md +0 -4
- package/test/scenarios/http-operations/create-operation.md +0 -4
- package/test/scenarios/http-operations/on_response.md +0 -4
- package/test/scenarios/http-operations/optional-request-body.md +0 -5
- package/test/scenarios/http-operations/path-parameter-in-model.md +0 -4
- package/test/scenarios/http-operations/path-parameter.md +0 -4
- package/test/scenarios/http-operations/scalar-payload.md +0 -4
- package/test/scenarios/http-operations/with-parameters.md +0 -5
- package/test/scenarios/models/inheritance_2_discriminators.md +0 -24
- package/test/scenarios/models/inheritance_discriminator.md +0 -4
- package/test/scenarios/models/inline-models.md +1 -4
- package/test/scenarios/models/model_additional_properties.md +0 -4
- package/test/scenarios/models/model_extends.md +0 -4
- package/test/scenarios/models/model_spread.md +0 -2
- package/test/scenarios/models/nested_property.md +0 -4
- package/test/scenarios/models/property_references_property.md +0 -6
- package/test/scenarios/multipart/anonymous_part.md +1 -10
- package/test/scenarios/multipart/file.md +0 -12
- package/test/scenarios/multipart/file_content_type.md +0 -5
- package/test/scenarios/multipart/simple_part.md +0 -4
- package/test/scenarios/operation-parameters/body_root_anonymous.md +2 -17
- package/test/scenarios/operation-parameters/constant_as_optional.md +0 -5
- package/test/scenarios/operation-parameters/default_value_as_optional.md +0 -5
- package/test/scenarios/operation-parameters/no_content_type.md +0 -5
- package/test/scenarios/operation-parameters/no_parameters.md +0 -5
- package/test/scenarios/operation-parameters/only_optional.md +0 -5
- package/test/scenarios/operation-parameters/only_required.md +0 -5
- package/test/scenarios/operation-parameters/reserved_names.md +0 -5
- package/test/scenarios/operation-parameters/spread_body.md +0 -5
- package/test/scenarios/operation-parameters/spread_with_nested.md +0 -5
- package/test/scenarios/operation-parameters/union_body.md +0 -6
- package/test/scenarios/operation-parameters/with_body_property.md +0 -5
- package/test/scenarios/operation-parameters/with_body_root.md +0 -5
- package/test/scenarios/serializers/arrays.md +0 -8
- package/test/scenarios/serializers/basic_model.md +0 -4
- package/test/scenarios/serializers/basic_model_wire_name.md +0 -2
- package/test/scenarios/serializers/discriminated_union.md +1 -1
- package/test/scenarios/serializers/discriminated_union_spread.md +1 -5
- package/test/scenarios/serializers/multipart.md +0 -4
- package/test/scenarios/serializers/polymorphic_single_level_inheritance.md +0 -5
- package/test/scenarios/serializers/record.md +0 -4
- package/test/scenarios/serializers/scalars.md +0 -5
- package/test/scenarios/serializers/spread.md +0 -4
- package/test/scenarios/serializers/string_union.md +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import { code,
|
|
3
|
+
import { code, For } from "@alloy-js/core";
|
|
4
4
|
import { isVoidType } from "@typespec/compiler";
|
|
5
5
|
import { $ } from "@typespec/compiler/experimental/typekit";
|
|
6
6
|
import { getCreateRestErrorRefkey } from "./static-helpers/rest-error.js";
|
|
@@ -11,51 +11,54 @@ export function HttpResponse(props) {
|
|
|
11
11
|
get operation() {
|
|
12
12
|
return props.operation;
|
|
13
13
|
}
|
|
14
|
-
}),
|
|
14
|
+
}), _$memo(() => code`throw ${getCreateRestErrorRefkey()}(response);`)];
|
|
15
15
|
}
|
|
16
16
|
export function HttpResponses(props) {
|
|
17
17
|
// Handle response by status code and content type
|
|
18
18
|
const responses = $.httpOperation.flattenResponses(props.operation.httpOperation);
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
return _$createComponent(For, {
|
|
20
|
+
get each() {
|
|
21
|
+
return responses.filter(r => !$.httpResponse.isErrorResponse(r));
|
|
22
|
+
},
|
|
23
|
+
children: ({
|
|
24
|
+
statusCode,
|
|
25
|
+
contentType,
|
|
26
|
+
responseContent,
|
|
27
|
+
type
|
|
28
|
+
}) => {
|
|
29
|
+
const body = responseContent.body;
|
|
30
|
+
let expression = code`return;`;
|
|
31
|
+
const contentTypeCheck = body ? ` && response.headers["content-type"]?.includes("${contentType}")` : " && !response.body";
|
|
32
|
+
if (body && (body.bodyKind === "single" || type && !isVoidType(type))) {
|
|
33
|
+
expression = _$createComponent(ContentTypeEncodingProvider, {
|
|
34
|
+
contentType: contentType,
|
|
35
|
+
get children() {
|
|
36
|
+
return ["return", " ", _$createComponent(JsonTransform, {
|
|
37
|
+
itemRef: "response.body",
|
|
38
|
+
target: "application",
|
|
39
|
+
get type() {
|
|
40
|
+
return body.type;
|
|
41
|
+
}
|
|
42
|
+
}), "!;"];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if ($.httpResponse.statusCode.isSingle(statusCode)) {
|
|
47
|
+
return code`
|
|
44
48
|
if (+response.status === ${statusCode}${contentTypeCheck}) {
|
|
45
49
|
${expression}
|
|
46
50
|
}
|
|
47
51
|
`;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
}
|
|
53
|
+
if ($.httpResponse.statusCode.isRange(statusCode)) {
|
|
54
|
+
return code`
|
|
51
55
|
if (+response.status >= ${statusCode.start} && +response.status <= ${statusCode.end} ${contentTypeCheck}) {
|
|
52
56
|
${expression}
|
|
53
57
|
}
|
|
54
58
|
`;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
55
61
|
}
|
|
56
|
-
return null;
|
|
57
|
-
}, {
|
|
58
|
-
joiner: "\n\n"
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
//# sourceMappingURL=http-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-response.js","names":["code","
|
|
1
|
+
{"version":3,"file":"http-response.js","names":["code","For","isVoidType","$","getCreateRestErrorRefkey","ContentTypeEncodingProvider","JsonTransform","HttpResponse","props","_$createComponent","HttpResponses","operation","_$memo","responses","httpOperation","flattenResponses","each","filter","r","httpResponse","isErrorResponse","children","statusCode","contentType","responseContent","type","body","expression","contentTypeCheck","bodyKind","itemRef","target","isSingle","isRange","start","end"],"sources":["../../../src/components/http-response.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAAmBA,IAAI,EAAEC,GAAG,QAAgB,gBAAgB;AAC5D,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,CAAC,QAAQ,yCAAyC;AAE3D,SAASC,wBAAwB;AACjC,SAASC,2BAA2B;AACpC,SAASC,aAAa;AAOtB,OAAO,SAASC,YAAYA,CAACC,KAAwB,EAAE;EACrD,QAAAC,iBAAA,CAEKC,aAAa;IAAA,IAACC,SAASA,CAAA;MAAA,OAAEH,KAAK,CAACG,SAAS;IAAA;EAAA,IAAAC,MAAA,OAExCZ,IAAI,SAASI,wBAAwB,CAAC,CAAC,aAAa;AAG3D;AAOA,OAAO,SAASM,aAAaA,CAACF,KAAyB,EAAE;EACvD;EACA,MAAMK,SAAS,GAAGV,CAAC,CAACW,aAAa,CAACC,gBAAgB,CAACP,KAAK,CAACG,SAAS,CAACG,aAAa,CAAC;EACjF,OAAAL,iBAAA,CACGR,GAAG;IAAA,IAACe,IAAIA,CAAA;MAAA,OAAEH,SAAS,CAAC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-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/models.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/models.tsx"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,qCAqBxC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { For, refkey } from "@alloy-js/core";
|
|
4
4
|
import * as ts from "@alloy-js/typescript";
|
|
5
5
|
import { $ } from "@typespec/compiler/experimental/typekit";
|
|
6
6
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
@@ -14,26 +14,29 @@ export function Models(props) {
|
|
|
14
14
|
return props.path ?? "models.ts";
|
|
15
15
|
},
|
|
16
16
|
get children() {
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
return _$createComponent(For, {
|
|
18
|
+
each: dataTypes,
|
|
19
|
+
joiner: "\n",
|
|
20
|
+
hardline: true,
|
|
21
|
+
children: type => {
|
|
22
|
+
if ($.model.is(type) && $.model.isHttpFile(type)) {
|
|
23
|
+
return _$createComponent(ts.TypeDeclaration, {
|
|
24
|
+
name: "File",
|
|
25
|
+
"export": true,
|
|
26
|
+
kind: "type",
|
|
27
|
+
get refkey() {
|
|
28
|
+
return refkey(type);
|
|
29
|
+
},
|
|
30
|
+
get children() {
|
|
31
|
+
return getFileTypeReference();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return $.array.is(type) || $.record.is(type) ? null : _$createComponent(ef.TypeDeclaration, {
|
|
21
36
|
"export": true,
|
|
22
|
-
|
|
23
|
-
get refkey() {
|
|
24
|
-
return refkey(type);
|
|
25
|
-
},
|
|
26
|
-
get children() {
|
|
27
|
-
return getFileTypeReference();
|
|
28
|
-
}
|
|
37
|
+
type: type
|
|
29
38
|
});
|
|
30
39
|
}
|
|
31
|
-
return $.array.is(type) || $.record.is(type) ? null : _$createComponent(ef.TypeDeclaration, {
|
|
32
|
-
"export": true,
|
|
33
|
-
type: type
|
|
34
|
-
});
|
|
35
|
-
}, {
|
|
36
|
-
joiner: "\n\n"
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
42
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","names":["
|
|
1
|
+
{"version":3,"file":"models.js","names":["For","refkey","ts","$","ef","useClientLibrary","getFileTypeReference","Models","props","clientLibrary","dataTypes","_$createComponent","SourceFile","path","children","each","joiner","hardline","type","model","is","isHttpFile","TypeDeclaration","name","kind","array","record"],"sources":["../../../src/components/models.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SAASA,GAAG,EAAEC,MAAM,QAAQ,gBAAgB;AAC5C,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAC1C,SAASC,CAAC,QAAQ,yCAAyC;AAC3D,OAAO,KAAKC,EAAE,MAAM,wCAAwC;AAC5D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,oBAAoB;AAM7B,OAAO,SAASC,MAAMA,CAACC,KAAkB,EAAE;EACzC,MAAMC,aAAa,GAAGJ,gBAAgB,CAAC,CAAC;EACxC,MAAMK,SAAS,GAAGD,aAAa,CAACC,SAAS;EACzC,OAAAC,iBAAA,CACGT,EAAE,CAACU,UAAU;IAAA,IAACC,IAAIA,CAAA;MAAA,OAAEL,KAAK,CAACK,IAAI,IAAI,WAAW;IAAA;IAAA,IAAAC,SAAA;MAAA,OAAAH,iBAAA,CAC3CX,GAAG;QAACe,IAAI,EAAEL,SAAS;QAAEM,MAAM,EAAE,IAAI;QAAEC,QAAQ;QAAAH,QAAA,EACxCI,IAAI,IAAK;UACT,IAAIf,CAAC,CAACgB,KAAK,CAACC,EAAE,CAACF,IAAI,CAAC,IAAIf,CAAC,CAACgB,KAAK,CAACE,UAAU,CAACH,IAAI,CAAC,EAAE;YAChD,OAAAP,iBAAA,CACGT,EAAE,CAACoB,eAAe;cAACC,IAAI;cAAA;cAAeC,IAAI;cAAA,IAAQvB,MAAMA,CAAA;gBAAA,OAAEA,MAAM,CAACiB,IAAI,CAAC;cAAA;cAAA,IAAAJ,SAAA;gBAAA,OACpER,oBAAoB,CAAC,CAAC;cAAA;YAAA;UAG7B;UACA,OAAOH,CAAC,CAACsB,KAAK,CAACL,EAAE,CAACF,IAAI,CAAC,IAAIf,CAAC,CAACuB,MAAM,CAACN,EAAE,CAACF,IAAI,CAAC,GAAG,IAAI,GAAAP,iBAAA,CAChDP,EAAE,CAACkB,eAAe;YAAA;YAAQJ,IAAI,EAAEA;UAAI,EACtC;QACH;MAAC;IAAA;EAAA;AAIT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-options.d.ts","sourceRoot":"","sources":["../../../src/components/operation-options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,aAAa,aAErE;AACD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"operation-options.d.ts","sourceRoot":"","sources":["../../../src/components/operation-options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,aAAa,aAErE;AACD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,eAyBvE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import * as ay from "@alloy-js/core";
|
|
4
3
|
import * as ts from "@alloy-js/typescript";
|
|
5
4
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
@@ -22,19 +21,23 @@ export function OperationOptionsDeclaration(props) {
|
|
|
22
21
|
return getOperationOptionsTypeRefkey(props.operation);
|
|
23
22
|
},
|
|
24
23
|
get children() {
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
return _$createComponent(ay.For, {
|
|
25
|
+
each: optionalParameters,
|
|
26
|
+
line: true,
|
|
27
|
+
children: parameter => _$createComponent(ts.InterfaceMember, {
|
|
28
|
+
get name() {
|
|
29
|
+
return parameter.property.name;
|
|
30
|
+
},
|
|
31
|
+
optional: true,
|
|
32
|
+
get type() {
|
|
33
|
+
return _$createComponent(ef.TypeExpression, {
|
|
34
|
+
get type() {
|
|
35
|
+
return parameter.property.type;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
});
|
|
38
41
|
}
|
|
39
42
|
});
|
|
40
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-options.js","names":["ay","ts","ef","hasDefaultValue","getOperationOptionsInterfaceRefkey","getOperationOptionsTypeRefkey","operation","refkey","OperationOptionsDeclaration","props","namePolicy","useTSNamePolicy","interfaceName","getName","name","optionalParameters","parameters","properties","filter","p","property","optional","_$createComponent","InterfaceDeclaration","extends","children","
|
|
1
|
+
{"version":3,"file":"operation-options.js","names":["ay","ts","ef","hasDefaultValue","getOperationOptionsInterfaceRefkey","getOperationOptionsTypeRefkey","operation","refkey","OperationOptionsDeclaration","props","namePolicy","useTSNamePolicy","interfaceName","getName","name","optionalParameters","parameters","properties","filter","p","property","optional","_$createComponent","InterfaceDeclaration","extends","children","For","each","line","parameter","InterfaceMember","type","TypeExpression"],"sources":["../../../src/components/operation-options.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAC1C,OAAO,KAAKC,EAAE,MAAM,wCAAwC;AAE5D,SAASC,eAAe;AACxB,SAASC,kCAAkC;AAK3C,OAAO,SAASC,6BAA6BA,CAACC,SAAwB,EAAE;EACtE,OAAON,EAAE,CAACO,MAAM,CAACD,SAAS,EAAE,mBAAmB,CAAC;AAClD;AACA,OAAO,SAASE,2BAA2BA,CAACC,KAA4B,EAAE;EACxE,MAAMC,UAAU,GAAGT,EAAE,CAACU,eAAe,CAAC,CAAC;EACvC,MAAMC,aAAa,GAAGF,UAAU,CAACG,OAAO,CAACJ,KAAK,CAACH,SAAS,CAACA,SAAS,CAACQ,IAAI,GAAG,SAAS,EAAE,WAAW,CAAC;EACjG,MAAMC,kBAAkB,GAAGN,KAAK,CAACH,SAAS,CAACU,UAAU,CAACC,UAAU,CAACC,MAAM,CACpEC,CAAC,IAAKA,CAAC,CAACC,QAAQ,CAACC,QAAQ,IAAIlB,eAAe,CAACgB,CAAC,CACjD,CAAC;EAED,OAAAG,iBAAA,CACGrB,EAAE,CAACsB,oBAAoB;IAAA;IAEtBT,IAAI,EAAEF,aAAa;IAAA,eAAAY,CAAA;MAAA,OACVpB,kCAAkC,CAAC,CAAC;IAAA;IAAA,IAC7CG,MAAMA,CAAA;MAAA,OAAEF,6BAA6B,CAACI,KAAK,CAACH,SAAS,CAAC;IAAA;IAAA,IAAAmB,SAAA;MAAA,OAAAH,iBAAA,CAErDtB,EAAE,CAAC0B,GAAG;QAACC,IAAI,EAAEZ,kBAAkB;QAAEa,IAAI;QAAAH,QAAA,EAClCI,SAAS,IAAAP,iBAAA,CACRrB,EAAE,CAAC6B,eAAe;UAAA,IACjBhB,IAAIA,CAAA;YAAA,OAAEe,SAAS,CAACT,QAAQ,CAACN,IAAI;UAAA;UAC7BO,QAAQ;UAAA,IACRU,IAAIA,CAAA;YAAA,OAAAT,iBAAA,CAAGpB,EAAE,CAAC8B,cAAc;cAAA,IAACD,IAAIA,CAAA;gBAAA,OAAEF,SAAS,CAACT,QAAQ,CAACW,IAAI;cAAA;YAAA;UAAA;QAAA;MAEzD;IAAA;EAAA;AAIT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/components/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/components/output.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAUrC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC;CACxB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAYxC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import * as ay from "@alloy-js/core";
|
|
4
3
|
import * as ts from "@alloy-js/typescript";
|
|
5
4
|
import { TransformNamePolicyContext } from "@typespec/emitter-framework";
|
|
6
5
|
import { ClientLibrary } from "@typespec/http-client/components";
|
|
6
|
+
import { httpParamsMutator } from "../utils/operations.js";
|
|
7
7
|
import { EncodingProvider } from "./encoding-provider.js";
|
|
8
8
|
import { httpRuntimeTemplateLib } from "./external-packages/ts-http-runtime.js";
|
|
9
9
|
import { uriTemplateLib } from "./external-packages/uri-template.js";
|
|
@@ -16,6 +16,7 @@ export function Output(props) {
|
|
|
16
16
|
externals: [uriTemplateLib, httpRuntimeTemplateLib],
|
|
17
17
|
get children() {
|
|
18
18
|
return _$createComponent(ClientLibrary, {
|
|
19
|
+
operationMutators: [httpParamsMutator],
|
|
19
20
|
get children() {
|
|
20
21
|
return _$createComponent(TransformNamePolicyContext.Provider, {
|
|
21
22
|
value: defaultTransformNamePolicy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","names":["ay","ts","TransformNamePolicyContext","ClientLibrary","EncodingProvider","httpRuntimeTemplateLib","uriTemplateLib","createTransformNamePolicy","Output","props","tsNamePolicy","createTSNamePolicy","defaultTransformNamePolicy","_$createComponent","namePolicy","externals","children","Provider","value"],"sources":["../../../src/components/output.tsx"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.js","names":["ay","ts","TransformNamePolicyContext","ClientLibrary","httpParamsMutator","EncodingProvider","httpRuntimeTemplateLib","uriTemplateLib","createTransformNamePolicy","Output","props","tsNamePolicy","createTSNamePolicy","defaultTransformNamePolicy","_$createComponent","namePolicy","externals","children","operationMutators","Provider","value"],"sources":["../../../src/components/output.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAC1C,SAASC,0BAA0B,QAAQ,6BAA6B;AACxE,SAASC,aAAa,QAAQ,kCAAkC;AAChE,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,gBAAgB;AACzB,SAASC,sBAAsB,QAAQ,wCAAwC;AAC/E,SAASC,cAAc,QAAQ,qCAAqC;AACpE,SAASC,yBAAyB,QAAQ,uCAAuC;AAMjF,OAAO,SAASC,MAAMA,CAACC,KAAkB,EAAE;EACzC,MAAMC,YAAY,GAAGV,EAAE,CAACW,kBAAkB,CAAC,CAAC;EAC5C,MAAMC,0BAA0B,GAAGL,yBAAyB,CAAC,CAAC;EAC9D,OAAAM,iBAAA,CACGd,EAAE,CAACS,MAAM;IAACM,UAAU,EAAEJ,YAAY;IAAEK,SAAS,EAAE,CAACT,cAAc,EAAED,sBAAsB,CAAC;IAAA,IAAAW,SAAA;MAAA,OAAAH,iBAAA,CACrFX,aAAa;QAACe,iBAAiB,EAAE,CAACd,iBAAiB,CAAC;QAAA,IAAAa,SAAA;UAAA,OAAAH,iBAAA,CAClDZ,0BAA0B,CAACiB,QAAQ;YAACC,KAAK,EAAEP,0BAA0B;YAAA,IAAAI,SAAA;cAAA,OAAAH,iBAAA,CACnET,gBAAgB;gBAAA,IAAAY,SAAA;kBAAA,OAAEP,KAAK,CAACO,QAAQ;gBAAA;cAAA;YAAA;UAAA;QAAA;MAAA;IAAA;EAAA;AAK3C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/components/serializers.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/components/serializers.tsx"],"names":[],"mappings":"AAeA,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qCA+B5D"}
|
|
@@ -21,9 +21,9 @@ export function ModelSerializers(props) {
|
|
|
21
21
|
return props.path ?? "serializers.ts";
|
|
22
22
|
},
|
|
23
23
|
get children() {
|
|
24
|
-
return [_$createComponent(DecodeBase64, {}),
|
|
24
|
+
return [_$createComponent(DecodeBase64, {}), _$createComponent(EncodeUint8Array, {}), _$createComponent(DateDeserializer, {}), _$createComponent(DateRfc7231Deserializer, {}), _$createComponent(DateRfc3339Serializer, {}), _$createComponent(DateRfc7231Serializer, {}), _$createComponent(DateUnixTimestampSerializer, {}), _$createComponent(DateUnixTimestampDeserializer, {}), _$memo(() => operations.map(o => _$createComponent(TransformDeclaration, {
|
|
25
25
|
operation: o
|
|
26
|
-
}))),
|
|
26
|
+
}))), _$memo(() => dataTypes.filter(m => m.kind === "Model" || m.kind === "Union").map(type => _$createComponent(EncodingProvider, {
|
|
27
27
|
defaults: {
|
|
28
28
|
bytes: "base64"
|
|
29
29
|
},
|
|
@@ -31,7 +31,7 @@ export function ModelSerializers(props) {
|
|
|
31
31
|
return [_$createComponent(JsonTransformDeclaration, {
|
|
32
32
|
type: type,
|
|
33
33
|
target: "transport"
|
|
34
|
-
}),
|
|
34
|
+
}), _$createComponent(JsonTransformDeclaration, {
|
|
35
35
|
type: type,
|
|
36
36
|
target: "application"
|
|
37
37
|
})];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializers.js","names":["ts","DateDeserializer","DateRfc3339Serializer","DateRfc7231Deserializer","DateRfc7231Serializer","DateUnixTimestampDeserializer","DateUnixTimestampSerializer","useClientLibrary","flattenClients","EncodingProvider","DecodeBase64","EncodeUint8Array","JsonTransformDeclaration","TransformDeclaration","ModelSerializers","props","clientLibrary","dataTypes","flatClients","topLevel","flatMap","c","operations","_$createComponent","SourceFile","path","children","_$memo","map","o","operation","filter","m","kind","type","defaults","bytes","target"],"sources":["../../../src/components/serializers.tsx"],"sourcesContent":[null],"mappings":";;AAAA,OAAO,KAAKA,EAAE,MAAM,sBAAsB;AAC1C,SACEC,gBAAgB,EAChBC,qBAAqB,EACrBC,uBAAuB,EACvBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,QACtB,wCAAwC;AAC/C,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,gBAAgB;AACzB,SAASC,YAAY,EAAEC,gBAAgB;AACvC,SAASC,wBAAwB;AACjC,SAASC,oBAAoB;AAK7B,OAAO,SAASC,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,MAAMC,aAAa,GAAGT,gBAAgB,CAAC,CAAC;EACxC,MAAMU,SAAS,GAAGD,aAAa,CAACC,SAAS;EACzC,MAAMC,WAAW,GAAGF,aAAa,CAACG,QAAQ,CAACC,OAAO,CAAEC,CAAC,IAAKb,cAAc,CAACa,CAAC,CAAC,CAAC;EAC5E,MAAMC,UAAU,GAAGJ,WAAW,CAACE,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACC,UAAU,CAAC;EAC3D;EACA;EACA;EACA,OAAAC,iBAAA,
|
|
1
|
+
{"version":3,"file":"serializers.js","names":["ts","DateDeserializer","DateRfc3339Serializer","DateRfc7231Deserializer","DateRfc7231Serializer","DateUnixTimestampDeserializer","DateUnixTimestampSerializer","useClientLibrary","flattenClients","EncodingProvider","DecodeBase64","EncodeUint8Array","JsonTransformDeclaration","TransformDeclaration","ModelSerializers","props","clientLibrary","dataTypes","flatClients","topLevel","flatMap","c","operations","_$createComponent","SourceFile","path","children","_$memo","map","o","operation","filter","m","kind","type","defaults","bytes","target"],"sources":["../../../src/components/serializers.tsx"],"sourcesContent":[null],"mappings":";;AAAA,OAAO,KAAKA,EAAE,MAAM,sBAAsB;AAC1C,SACEC,gBAAgB,EAChBC,qBAAqB,EACrBC,uBAAuB,EACvBC,qBAAqB,EACrBC,6BAA6B,EAC7BC,2BAA2B,QACtB,wCAAwC;AAC/C,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,gBAAgB;AACzB,SAASC,YAAY,EAAEC,gBAAgB;AACvC,SAASC,wBAAwB;AACjC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A,IAAAd,iBAAA,CAC3CX,wBAAwB;YAACsB,IAAI,EAAEA,IAAI;YAAEG,MAAM;UAAA;QAAA;MAAA,EAE/C,CAAC;IAAA;EAAA;AAGV","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytes-encoding.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/bytes-encoding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGrC,wBAAgB,sBAAsB,IAAI,EAAE,CAAC,MAAM,CAElD;AAED,wBAAgB,gBAAgB,IAAI,EAAE,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"bytes-encoding.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/bytes-encoding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGrC,wBAAgB,sBAAsB,IAAI,EAAE,CAAC,MAAM,CAElD;AAED,wBAAgB,gBAAgB,IAAI,EAAE,CAAC,QAAQ,CAuB9C;AAED,wBAAgB,sBAAsB,IAAI,EAAE,CAAC,MAAM,CAElD;AACD,wBAAgB,YAAY,IAAI,EAAE,CAAC,QAAQ,CAuB1C"}
|
|
@@ -52,7 +52,7 @@ export function DecodeBase64() {
|
|
|
52
52
|
returnType: "Uint8Array | undefined",
|
|
53
53
|
refkey: refkey,
|
|
54
54
|
get children() {
|
|
55
|
-
return
|
|
55
|
+
return ay.code`
|
|
56
56
|
if(!${valueRef}) {
|
|
57
57
|
return ${valueRef} as any;
|
|
58
58
|
}
|
|
@@ -61,7 +61,7 @@ export function DecodeBase64() {
|
|
|
61
61
|
.padEnd(${valueRef}.length + (4 - (${valueRef}.length % 4)) % 4, '=');
|
|
62
62
|
|
|
63
63
|
return new Uint8Array(Buffer.from(base64, 'base64'));
|
|
64
|
-
|
|
64
|
+
`;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytes-encoding.js","names":["ay","ts","getEncodeUint8ArrayRef","refkey","EncodeUint8Array","valueRef","encodingRef","_$createComponent","FunctionDeclaration","name","parameters","value","type","encoding","returnType","children","code","getDecodeUint8ArrayRef","DecodeBase64"
|
|
1
|
+
{"version":3,"file":"bytes-encoding.js","names":["ay","ts","getEncodeUint8ArrayRef","refkey","EncodeUint8Array","valueRef","encodingRef","_$createComponent","FunctionDeclaration","name","parameters","value","type","encoding","returnType","children","code","getDecodeUint8ArrayRef","DecodeBase64"],"sources":["../../../../src/components/static-helpers/bytes-encoding.tsx"],"sourcesContent":[null],"mappings":";;AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAE1C,OAAO,SAASC,sBAAsBA,CAAA,EAAc;EAClD,OAAOF,EAAE,CAACG,MAAM,CAAC,kBAAkB,CAAC;AACtC;AAEA,OAAO,SAASC,gBAAgBA,CAAA,EAAgB;EAC9C,MAAMC,QAAQ,GAAGL,EAAE,CAACG,MAAM,CAAC,CAAC;EAC5B,MAAMG,WAAW,GAAGN,EAAE,CAACG,MAAM,CAAC,CAAC;EAC/B,MAAMA,MAAM,GAAGD,sBAAsB,CAAC,CAAC;EACvC,OAAAK,iBAAA,CACGN,EAAE,CAACO,mBAAmB;IAAA;IAErBL,MAAM,EAAEA,MAAM;IACdM,IAAI;IACJC,UAAU,EAAE;MACVC,KAAK,EAAE;QAAEC,IAAI,EAAE,+BAA+B;QAAET,MAAM,EAAEE;MAAS,CAAC;MAClEQ,QAAQ,EAAE;QAAED,IAAI,EAAE,gBAAgB;QAAET,MAAM,EAAEG;MAAY;IAC1D,CAAC;IACDQ,UAAU;IAAA,IAAAC,SAAA;MAAA,OAETf,EAAE,CAACgB,IAAI;AACd,aAAaX,QAAQ;AACrB,iBAAiBA,QAAQ;AACzB;AACA,2BAA2BA,QAAQ,cAAcC,WAAW;AAC5D,IAAI;IAAA;EAAA;AAGJ;AAEA,OAAO,SAASW,sBAAsBA,CAAA,EAAc;EAClD,OAAOjB,EAAE,CAACG,MAAM,CAAC,kBAAkB,CAAC;AACtC;AACA,OAAO,SAASe,YAAYA,CAAA,EAAgB;EAC1C,MAAMf,MAAM,GAAGc,sBAAsB,CAAC,CAAC;EACvC,MAAMZ,QAAQ,GAAGL,EAAE,CAACG,MAAM,CAAC,CAAC;EAC5B,OAAAI,iBAAA,CACGN,EAAE,CAACO,mBAAmB;IAAA;IAErBC,IAAI;IACJC,UAAU,EAAE;MAAEC,KAAK,EAAE;QAAEC,IAAI,EAAE,QAAQ;QAAET,MAAM,EAAEE;MAAS;IAAE,CAAC;IAC3DS,UAAU;IACVX,MAAM,EAAEA,MAAM;IAAA,IAAAY,SAAA;MAAA,OAEbf,EAAE,CAACgB,IAAI;AACd,YAAYX,QAAQ;AACpB,iBAAiBA,QAAQ;AACzB;AACA;AACA,uBAAuBA,QAAQ;AAC/B,oBAAoBA,QAAQ,mBAAmBA,QAAQ;AACvD;AACA;AACA,KAAK;IAAA;EAAA;AAGL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/interfaces.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,wBAAgB,kCAAkC,cAEjD;AAED,wBAAgB,oCAAoC,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/interfaces.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,wBAAgB,kCAAkC,cAEjD;AAED,wBAAgB,oCAAoC,gBAcnD;AAED,wBAAgB,UAAU,gBAMzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","names":["ay","ts","httpRuntimeTemplateLib","getOperationOptionsInterfaceRefkey","refkey","OperationOptionsInterfaceDeclaration","declarationRefkey","onResponseCallback","code","PathUncheckedResponse","operationOptions","_$createComponent","InterfaceExpression","children","InterfaceMember","name","optional","type","InterfaceDeclaration","Interfaces","SourceFile","path"],"sources":["../../../../src/components/static-helpers/interfaces.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAC1C,SAASC,sBAAsB,QAAQ,yCAAyC;AAEhF,OAAO,SAASC,kCAAkCA,CAAA,EAAG;EACnD,OAAOH,EAAE,CAACI,MAAM,CAAC,kBAAkB,EAAE,WAAW,CAAC;AACnD;AAEA,OAAO,SAASC,oCAAoCA,CAAA,EAAG;EACrD,MAAMC,iBAAiB,GAAGH,kCAAkC,CAAC,CAAC;EAC9D,MAAMI,kBAAkB,GAAGP,EAAE,CAACQ,IAAI,iBAAiBN,sBAAsB,CAACO,qBAAqB,WAAW;EAE1G,MAAMC,gBAAgB,GAAAC,iBAAA,CACnBV,EAAE,CAACW,mBAAmB;IAAA,IAAAC,SAAA;MAAA,OAAAF,iBAAA,
|
|
1
|
+
{"version":3,"file":"interfaces.js","names":["ay","ts","httpRuntimeTemplateLib","getOperationOptionsInterfaceRefkey","refkey","OperationOptionsInterfaceDeclaration","declarationRefkey","onResponseCallback","code","PathUncheckedResponse","operationOptions","_$createComponent","InterfaceExpression","children","InterfaceMember","name","optional","type","InterfaceDeclaration","Interfaces","SourceFile","path"],"sources":["../../../../src/components/static-helpers/interfaces.tsx"],"sourcesContent":[null],"mappings":";AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAC1C,SAASC,sBAAsB,QAAQ,yCAAyC;AAEhF,OAAO,SAASC,kCAAkCA,CAAA,EAAG;EACnD,OAAOH,EAAE,CAACI,MAAM,CAAC,kBAAkB,EAAE,WAAW,CAAC;AACnD;AAEA,OAAO,SAASC,oCAAoCA,CAAA,EAAG;EACrD,MAAMC,iBAAiB,GAAGH,kCAAkC,CAAC,CAAC;EAC9D,MAAMI,kBAAkB,GAAGP,EAAE,CAACQ,IAAI,iBAAiBN,sBAAsB,CAACO,qBAAqB,WAAW;EAE1G,MAAMC,gBAAgB,GAAAC,iBAAA,CACnBV,EAAE,CAACW,mBAAmB;IAAA,IAAAC,SAAA;MAAA,OAAAF,iBAAA,CACpBV,EAAE,CAACa,eAAe;QAACC,IAAI;QAAcC,QAAQ;QAACC,IAAI,EAAEV;MAAkB;IAAA;EAAA,EAE1E;EACD,OAAAI,iBAAA,CACGV,EAAE,CAACiB,oBAAoB;IAAA;IAAQH,IAAI;IAAoBX,MAAM,EAAEE,iBAAiB;IAAA,IAAAO,SAAA;MAAA,OAAAF,iBAAA,CAC9EV,EAAE,CAACa,eAAe;QAACC,IAAI;QAAoBC,QAAQ;QAACC,IAAI,EAAEP;MAAgB;IAAA;EAAA;AAGjF;AAEA,OAAO,SAASS,UAAUA,CAAA,EAAG;EAC3B,OAAAR,iBAAA,CACGV,EAAE,CAACmB,UAAU;IAACC,IAAI;IAAA,IAAAR,SAAA;MAAA,OAAAF,iBAAA,CAChBN,oCAAoC;IAAA;EAAA;AAG3C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart-helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/multipart-helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,WAAW,qBAAqB;CAAG;AAEzC,wBAAgB,4BAA4B,cAE3C;AAED,wBAAgB,oCAAoC,cAEnD;AAED,wBAAgB,oBAAoB,cAEnC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"multipart-helpers.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/multipart-helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,WAAW,qBAAqB;CAAG;AAEzC,wBAAgB,4BAA4B,cAE3C;AAED,wBAAgB,oCAAoC,cAEnD;AAED,wBAAgB,oBAAoB,cAEnC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,eAkD5D"}
|
|
@@ -22,9 +22,9 @@ export function MultipartHelpers(props) {
|
|
|
22
22
|
return getFileTypeReference();
|
|
23
23
|
},
|
|
24
24
|
get children() {
|
|
25
|
-
return ["contents: ", _$memo(() => getFileContentsTypeReference()), "
|
|
25
|
+
return ["contents: ", _$memo(() => getFileContentsTypeReference()), "; contentType?: string; filename?: string;"];
|
|
26
26
|
}
|
|
27
|
-
}),
|
|
27
|
+
}), _$createComponent(ts.TypeDeclaration, {
|
|
28
28
|
name: "FileContents",
|
|
29
29
|
"export": true,
|
|
30
30
|
kind: "type",
|
|
@@ -32,11 +32,11 @@ export function MultipartHelpers(props) {
|
|
|
32
32
|
return getFileContentsTypeReference();
|
|
33
33
|
},
|
|
34
34
|
get children() {
|
|
35
|
-
return ay.mapJoin(["string", "NodeJS.ReadableStream", "ReadableStream<Uint8Array>", "Uint8Array", "Blob"], t => t, {
|
|
35
|
+
return ay.mapJoin(() => ["string", "NodeJS.ReadableStream", "ReadableStream<Uint8Array>", "Uint8Array", "Blob"], t => t, {
|
|
36
36
|
joiner: " | "
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
}),
|
|
39
|
+
}), _$createComponent(ts.FunctionDeclaration, {
|
|
40
40
|
name: "createFilePartDescriptor",
|
|
41
41
|
get parameters() {
|
|
42
42
|
return getCreateFilePartParameters();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart-helpers.js","names":["ay","ts","getFileContentsTypeReference","refkey","getCreateFilePartDescriptorReference","getFileTypeReference","MultipartHelpers","props","_$createComponent","SourceFile","path","children","InterfaceDeclaration","name","_$memo","TypeDeclaration","kind","mapJoin","t","joiner","FunctionDeclaration","parameters","getCreateFilePartParameters","returnType","code","partName","fileInput","defaultContentType","optional","key","type"],"sources":["../../../../src/components/static-helpers/multipart-helpers.tsx"],"sourcesContent":[null],"mappings":";;AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAG1C,OAAO,SAASC,4BAA4BA,CAAA,EAAG;EAC7C,OAAOF,EAAE,CAACG,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,gBAAgB,CAAC;AAC5D;AAEA,OAAO,SAASC,oCAAoCA,CAAA,EAAG;EACrD,OAAOJ,EAAE,CAACG,MAAM,CAAC,0BAA0B,EAAE,UAAU,EAAE,gBAAgB,CAAC;AAC5E;AAEA,OAAO,SAASE,oBAAoBA,CAAA,EAAG;EACrC,OAAOL,EAAE,CAACG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC;AACpD;AAEA,OAAO,SAASG,gBAAgBA,CAACC,KAA4B,EAAE;EAC7D,OAAAC,iBAAA,
|
|
1
|
+
{"version":3,"file":"multipart-helpers.js","names":["ay","ts","getFileContentsTypeReference","refkey","getCreateFilePartDescriptorReference","getFileTypeReference","MultipartHelpers","props","_$createComponent","SourceFile","path","children","InterfaceDeclaration","name","_$memo","TypeDeclaration","kind","mapJoin","t","joiner","FunctionDeclaration","parameters","getCreateFilePartParameters","returnType","code","partName","fileInput","defaultContentType","optional","key","type"],"sources":["../../../../src/components/static-helpers/multipart-helpers.tsx"],"sourcesContent":[null],"mappings":";;AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAG1C,OAAO,SAASC,4BAA4BA,CAAA,EAAG;EAC7C,OAAOF,EAAE,CAACG,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,gBAAgB,CAAC;AAC5D;AAEA,OAAO,SAASC,oCAAoCA,CAAA,EAAG;EACrD,OAAOJ,EAAE,CAACG,MAAM,CAAC,0B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A,SAASF,2BAA2BA,CAAA,EAAG;EACrC,OAAO;IACLG,QAAQ,EAAE,QAAQ;IAClBC,SAAS,EAAE,KAAK;IAChBC,kBAAkB,EAAE;MAClBC,QAAQ,EAAE,IAAI;MACdC,GAAG,EAAE,oBAAoB;MACzB1B,MAAM,EAAEH,EAAE,CAACG,MAAM,CAAC,CAAC;MACnB2B,IAAI,EAAE;IACR;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-error.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/rest-error.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,wBAAgB,kBAAkB,cAEjC;AAED,wBAAgB,wBAAwB,cAEvC;AAED,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"rest-error.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/rest-error.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,wBAAgB,kBAAkB,cAEjC;AAED,wBAAgB,wBAAwB,cAEvC;AAED,wBAAgB,SAAS,kBAsFxB"}
|
|
@@ -25,49 +25,56 @@ export function RestError() {
|
|
|
25
25
|
return getRestErrorRefkey();
|
|
26
26
|
},
|
|
27
27
|
get children() {
|
|
28
|
-
return [_$createComponent(
|
|
29
|
-
"public": true,
|
|
30
|
-
name: "request",
|
|
31
|
-
get type() {
|
|
32
|
-
return httpRuntimeTemplateLib.PipelineRequest;
|
|
33
|
-
},
|
|
34
|
-
refkey: requestRefkey
|
|
35
|
-
}), "\n", _$createComponent(ts.ClassField, {
|
|
36
|
-
"public": true,
|
|
37
|
-
name: "response",
|
|
38
|
-
get type() {
|
|
39
|
-
return httpRuntimeTemplateLib.HttpResponse;
|
|
40
|
-
},
|
|
41
|
-
refkey: responseRefkey
|
|
42
|
-
}), "\n", _$createComponent(ts.ClassField, {
|
|
43
|
-
"public": true,
|
|
44
|
-
name: "status",
|
|
45
|
-
type: "string",
|
|
46
|
-
refkey: statusRefkey
|
|
47
|
-
}), "\n", _$createComponent(ts.ClassField, {
|
|
48
|
-
"public": true,
|
|
49
|
-
name: "body",
|
|
50
|
-
type: "any",
|
|
51
|
-
refkey: bodyRefkey
|
|
52
|
-
}), "\n", _$createComponent(ts.ClassField, {
|
|
53
|
-
"public": true,
|
|
54
|
-
name: "headers",
|
|
55
|
-
get type() {
|
|
56
|
-
return httpRuntimeTemplateLib.RawHttpHeaders;
|
|
57
|
-
},
|
|
58
|
-
refkey: headersRefkey
|
|
59
|
-
}), "\n\n", _$createComponent(ts.ClassMethod, {
|
|
60
|
-
name: "constructor",
|
|
61
|
-
get parameters() {
|
|
62
|
-
return {
|
|
63
|
-
message: "string",
|
|
64
|
-
response: httpRuntimeTemplateLib.HttpResponse
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
returnType: null,
|
|
68
|
-
refkey: constructorRefkey,
|
|
28
|
+
return [_$createComponent(ay.StatementList, {
|
|
69
29
|
get children() {
|
|
70
|
-
return
|
|
30
|
+
return [_$createComponent(ts.ClassField, {
|
|
31
|
+
"public": true,
|
|
32
|
+
name: "request",
|
|
33
|
+
get type() {
|
|
34
|
+
return httpRuntimeTemplateLib.PipelineRequest;
|
|
35
|
+
},
|
|
36
|
+
refkey: requestRefkey
|
|
37
|
+
}), _$createComponent(ts.ClassField, {
|
|
38
|
+
"public": true,
|
|
39
|
+
name: "response",
|
|
40
|
+
get type() {
|
|
41
|
+
return httpRuntimeTemplateLib.HttpResponse;
|
|
42
|
+
},
|
|
43
|
+
refkey: responseRefkey
|
|
44
|
+
}), _$createComponent(ts.ClassField, {
|
|
45
|
+
"public": true,
|
|
46
|
+
name: "status",
|
|
47
|
+
type: "string",
|
|
48
|
+
refkey: statusRefkey
|
|
49
|
+
}), _$createComponent(ts.ClassField, {
|
|
50
|
+
"public": true,
|
|
51
|
+
name: "body",
|
|
52
|
+
type: "any",
|
|
53
|
+
refkey: bodyRefkey
|
|
54
|
+
}), _$createComponent(ts.ClassField, {
|
|
55
|
+
"public": true,
|
|
56
|
+
name: "headers",
|
|
57
|
+
get type() {
|
|
58
|
+
return httpRuntimeTemplateLib.RawHttpHeaders;
|
|
59
|
+
},
|
|
60
|
+
refkey: headersRefkey
|
|
61
|
+
})];
|
|
62
|
+
}
|
|
63
|
+
}), _$createComponent(ay.List, {
|
|
64
|
+
hardline: true,
|
|
65
|
+
get children() {
|
|
66
|
+
return [_$createComponent(ts.ClassMethod, {
|
|
67
|
+
name: "constructor",
|
|
68
|
+
get parameters() {
|
|
69
|
+
return {
|
|
70
|
+
message: "string",
|
|
71
|
+
response: httpRuntimeTemplateLib.HttpResponse
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
returnType: null,
|
|
75
|
+
refkey: constructorRefkey,
|
|
76
|
+
get children() {
|
|
77
|
+
return ay.code`
|
|
71
78
|
// Create an error message that includes relevant details.
|
|
72
79
|
super(\`$\{message\} - HTTP $\{response.status} received for $\{response.request.method} $\{response.request.url}\`);
|
|
73
80
|
this.name = 'RestError';
|
|
@@ -80,24 +87,26 @@ export function RestError() {
|
|
|
80
87
|
// Set the prototype explicitly.
|
|
81
88
|
Object.setPrototypeOf(this, RestError.prototype);
|
|
82
89
|
`;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
}
|
|
91
|
+
}), _$createComponent(ts.ClassMethod, {
|
|
92
|
+
"static": true,
|
|
93
|
+
name: "fromHttpResponse",
|
|
94
|
+
get parameters() {
|
|
95
|
+
return {
|
|
96
|
+
response: httpRuntimeTemplateLib.HttpResponse
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
get returnType() {
|
|
100
|
+
return getRestErrorRefkey();
|
|
101
|
+
},
|
|
102
|
+
refkey: fromHttpResponseRefkey,
|
|
103
|
+
get children() {
|
|
104
|
+
return ay.code`
|
|
98
105
|
const defaultMessage = \`Unexpected HTTP status code: $\{response.status}\`;
|
|
99
106
|
return new RestError(defaultMessage, response);
|
|
100
107
|
`;
|
|
108
|
+
}
|
|
109
|
+
})];
|
|
101
110
|
}
|
|
102
111
|
})];
|
|
103
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rest-error.js","names":["ay","ts","httpRuntimeTemplateLib","getRestErrorRefkey","refkey","getCreateRestErrorRefkey","RestError","requestRefkey","responseRefkey","statusRefkey","bodyRefkey","headersRefkey","constructorRefkey","fromHttpResponseRefkey","restErrorClass","_$createComponent","ClassDeclaration","name","children","ClassField","type","PipelineRequest","HttpResponse","RawHttpHeaders","ClassMethod","parameters","message","response","returnType","code","createRestError","FunctionDeclaration"],"sources":["../../../../src/components/static-helpers/rest-error.tsx"],"sourcesContent":[null],"mappings":";;AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAC1C,SAASC,sBAAsB,QAAQ,yCAAyC;AAEhF,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,OAAOH,EAAE,CAACI,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,CAAC;AAC3D;AAEA,OAAO,SAASC,wBAAwBA,CAAA,EAAG;EACzC,OAAOL,EAAE,CAACI,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,UAAU,CAAC;AACrE;AAEA,OAAO,SAASE,SAASA,CAAA,EAAG;EAC1B,MAAMC,aAAa,GAAGP,EAAE,CAACI,MAAM,CAAC,SAAS,EAAE,wBAAwB,CAAC;EACpE,MAAMI,cAAc,GAAGR,EAAE,CAACI,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC;EACtE,MAAMK,YAAY,GAAGT,EAAE,CAACI,MAAM,CAAC,QAAQ,EAAE,wBAAwB,CAAC;EAClE,MAAMM,UAAU,GAAGV,EAAE,CAACI,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC;EAC9D,MAAMO,aAAa,GAAGX,EAAE,CAACI,MAAM,CAAC,SAAS,EAAE,wBAAwB,CAAC;EACpE,MAAMQ,iBAAiB,GAAGZ,EAAE,CAACI,MAAM,CAAC,aAAa,EAAE,yBAAyB,CAAC;EAC7E,MAAMS,sBAAsB,GAAGb,EAAE,CAACI,MAAM,CAAC,oBAAoB,EAAE,yBAAyB,CAAC;EAEzF,MAAMU,cAAc,GAAAC,iBAAA,CACjBd,EAAE,CAACe,gBAAgB;IAAA;IAAQC,IAAI;IAAA;IAAA,IAA6Bb,MAAMA,CAAA;MAAA,OAAED,kBAAkB,CAAC,CAAC;IAAA;IAAA,IAAAe,SAAA;MAAA,QAAAH,iBAAA,
|
|
1
|
+
{"version":3,"file":"rest-error.js","names":["ay","ts","httpRuntimeTemplateLib","getRestErrorRefkey","refkey","getCreateRestErrorRefkey","RestError","requestRefkey","responseRefkey","statusRefkey","bodyRefkey","headersRefkey","constructorRefkey","fromHttpResponseRefkey","restErrorClass","_$createComponent","ClassDeclaration","name","children","StatementList","ClassField","type","PipelineRequest","HttpResponse","RawHttpHeaders","List","hardline","ClassMethod","parameters","message","response","returnType","code","createRestError","FunctionDeclaration"],"sources":["../../../../src/components/static-helpers/rest-error.tsx"],"sourcesContent":[null],"mappings":";;AAAA,OAAO,KAAKA,EAAE,MAAM,gBAAgB;AACpC,OAAO,KAAKC,EAAE,MAAM,sBAAsB;AAC1C,SAASC,sBAAsB,QAAQ,yCAAyC;AAEhF,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACnC,OAAOH,EAAE,CAACI,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,CAAC;AAC3D;AAEA,OAAO,SAASC,wBAAwBA,CAAA,EAAG;EACzC,OAAOL,EAAE,CAACI,MAAM,CAAC,mBAAmB,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AA,IACJW,UAAUA,CAAA;MAAA,OAAE;QAAEE,QAAQ,EAAE5B,sBAAsB,CAACqB;MAAa,CAAC;IAAA;IAAA,IAC7DQ,UAAUA,CAAA;MAAA,OAAE5B,kBAAkB,CAAC,CAAC;IAAA;IAAA,IAChCC,MAAMA,CAAA;MAAA,OAAEC,wBAAwB,CAAC,CAAC;IAAA;IAAA,IAAAa,SAAA;MAAA,OAEjClB,EAAE,CAACgC,IAAI;AACd,eAAenB,sBAAsB;AACrC,KAAK;IAAA;EAAA,EAEF;EAED,OAAO,CAACC,cAAc,EAAE,MAAM,EAAEmB,eAAe,CAAC;AAClD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-options.d.ts","sourceRoot":"","sources":["../../../../src/components/testing/client-options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"client-options.d.ts","sourceRoot":"","sources":["../../../../src/components/testing/client-options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErC,MAAM,WAAW,iBAAiB;CAAG;AAErC,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,qBAU1D;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,EAAE,CAAC,QAAQ,EAAE,EACtB,QAAQ,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAA0B,QAUlE"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import * as ay from "@alloy-js/core";
|
|
3
|
-
import { config } from "dotenv";
|
|
4
|
-
config();
|
|
5
3
|
export function ClientTestOptions(_props) {
|
|
6
4
|
if (process.env.TYPESPEC_JS_EMITTER_TESTING !== "true") {
|
|
7
5
|
return null;
|