@typespec/http-client-js 0.4.0-dev.6 → 0.4.0-dev.8
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.js +1 -2
- package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-factory.js +12 -5
- package/dist/src/components/client-context/client-context-options.js +1 -2
- package/dist/src/components/client-context/client-context.js +1 -2
- package/dist/src/components/client-context/parametrized-endpoint.js +2 -4
- package/dist/src/components/client-directory.js +1 -2
- package/dist/src/components/client-operation.d.ts.map +1 -1
- package/dist/src/components/client-operation.js +5 -3
- package/dist/src/components/client.d.ts.map +1 -1
- package/dist/src/components/client.js +15 -5
- package/dist/src/components/encoding-provider.js +1 -2
- package/dist/src/components/external-packages/ts-http-runtime.js +1 -2
- package/dist/src/components/external-packages/uri-template.js +1 -2
- package/dist/src/components/http-request-options.js +1 -2
- package/dist/src/components/http-request-parameters-expression.js +2 -4
- package/dist/src/components/http-request.js +2 -5
- package/dist/src/components/http-response.d.ts.map +1 -1
- package/dist/src/components/http-response.js +6 -5
- package/dist/src/components/models.d.ts.map +1 -1
- package/dist/src/components/models.js +6 -5
- package/dist/src/components/operation-handlers/index.js +1 -2
- package/dist/src/components/operation-handlers/operation-pipeline.js +1 -2
- package/dist/src/components/operation-handlers/paging/page-item.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/page-item.js +5 -3
- package/dist/src/components/operation-handlers/paging/page-response.js +1 -2
- package/dist/src/components/operation-handlers/paging/page-settings.js +1 -2
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js +9 -5
- package/dist/src/components/operation-handlers/paging/request-send.js +2 -4
- package/dist/src/components/operation-handlers/paging/response-deserialize.js +2 -4
- package/dist/src/components/operation-handlers/paging/util.js +1 -2
- package/dist/src/components/operation-options.js +1 -2
- package/dist/src/components/operation-parameters.js +1 -2
- package/dist/src/components/output.d.ts +2 -0
- package/dist/src/components/output.d.ts.map +1 -1
- package/dist/src/components/output.js +7 -7
- package/dist/src/components/serializers.d.ts.map +1 -1
- package/dist/src/components/serializers.js +9 -8
- package/dist/src/components/static-helpers/bytes-encoding.js +2 -4
- package/dist/src/components/static-helpers/interfaces.js +1 -2
- package/dist/src/components/static-helpers/multipart-helpers.js +2 -4
- package/dist/src/components/static-helpers/paging-helper.js +2 -4
- package/dist/src/components/static-helpers/rest-error.js +2 -4
- package/dist/src/components/testing/client-options.js +1 -2
- package/dist/src/components/transforms/content-type-encoding-provider.js +1 -2
- package/dist/src/components/transforms/data-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/data-transform.js +5 -3
- package/dist/src/components/transforms/json/json-array-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-array-transform.js +9 -5
- 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 +6 -5
- package/dist/src/components/transforms/json/json-model-base-transform.js +2 -4
- 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 +5 -3
- package/dist/src/components/transforms/json/json-model-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-transform.js +9 -6
- package/dist/src/components/transforms/json/json-record-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-record-transform.js +9 -5
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-transform-discriminator.js +9 -6
- package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-transform.js +11 -3
- package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/union-transform.js +6 -6
- package/dist/src/components/transforms/json/utils/transport-namer.d.ts +2 -1
- package/dist/src/components/transforms/json/utils/transport-namer.d.ts.map +1 -1
- package/dist/src/components/transforms/json/utils/transport-namer.js +2 -4
- package/dist/src/components/transforms/multipart/array-part-transform.js +2 -4
- package/dist/src/components/transforms/multipart/file-part-transform.js +1 -2
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/multipart-transform.js +5 -4
- package/dist/src/components/transforms/multipart/part-transform.js +1 -2
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/simple-part-transform.js +5 -3
- package/dist/src/components/transforms/operation-transform-declaration.js +1 -2
- package/dist/src/components/transforms/operation-transform-expression.d.ts.map +1 -1
- package/dist/src/components/transforms/operation-transform-expression.js +5 -4
- package/dist/src/components/transforms/scalar-transform.js +96 -80
- package/dist/src/components/transforms/transform-name-policy.d.ts.map +1 -1
- package/dist/src/components/transforms/transform-name-policy.js +7 -3
- package/dist/src/components/utils/unpack-model-property.d.ts.map +1 -1
- package/dist/src/components/utils/unpack-model-property.js +5 -3
- package/dist/src/components/utils/url-template.js +2 -4
- package/dist/src/context/encoding/encoding-context.d.ts.map +1 -1
- package/dist/src/context/encoding/encoding-context.js +5 -3
- package/dist/src/emitter.js +5 -3
- package/dist/src/index.js +1 -2
- package/dist/src/lib.js +1 -2
- package/dist/src/testing/index.js +1 -2
- package/dist/src/utils/client-discovery.js +1 -2
- package/dist/src/utils/multipart.d.ts.map +1 -1
- package/dist/src/utils/multipart.js +5 -3
- package/dist/src/utils/operations.d.ts +3 -2
- package/dist/src/utils/operations.d.ts.map +1 -1
- package/dist/src/utils/operations.js +13 -15
- package/dist/src/utils/parameters.d.ts.map +1 -1
- package/dist/src/utils/parameters.js +8 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -10
- package/src/components/client-context/client-context-factory.tsx +4 -1
- package/src/components/client-operation.tsx +2 -1
- package/src/components/client.tsx +5 -1
- package/src/components/http-response.tsx +2 -1
- package/src/components/models.tsx +2 -1
- package/src/components/operation-handlers/paging/page-item.tsx +2 -1
- package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +3 -1
- package/src/components/output.tsx +10 -5
- package/src/components/serializers.tsx +6 -4
- package/src/components/transforms/data-transform.tsx +2 -1
- package/src/components/transforms/json/json-array-transform.tsx +3 -1
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +2 -1
- package/src/components/transforms/json/json-model-property-transform.tsx +2 -1
- package/src/components/transforms/json/json-model-transform.tsx +3 -1
- package/src/components/transforms/json/json-record-transform.tsx +3 -1
- package/src/components/transforms/json/json-transform-discriminator.tsx +3 -1
- package/src/components/transforms/json/json-transform.tsx +4 -1
- package/src/components/transforms/json/union-transform.tsx +2 -1
- package/src/components/transforms/json/utils/transport-namer.ts +2 -2
- package/src/components/transforms/multipart/multipart-transform.tsx +2 -2
- package/src/components/transforms/multipart/simple-part-transform.tsx +2 -1
- package/src/components/transforms/operation-transform-expression.tsx +2 -2
- package/src/components/transforms/scalar-transform.tsx +42 -32
- package/src/components/transforms/transform-name-policy.ts +2 -1
- package/src/components/utils/unpack-model-property.ts +2 -1
- package/src/context/encoding/encoding-context.tsx +2 -1
- package/src/emitter.tsx +2 -2
- package/src/utils/multipart.ts +2 -1
- package/src/utils/operations.ts +13 -11
- package/src/utils/parameters.tsx +3 -1
- package/vitest.config.ts +2 -9
- package/babel.config.js +0 -4
- package/dist/src/components/client-context/client-context-declaration.js.map +0 -1
- package/dist/src/components/client-context/client-context-factory.js.map +0 -1
- package/dist/src/components/client-context/client-context-options.js.map +0 -1
- package/dist/src/components/client-context/client-context.js.map +0 -1
- package/dist/src/components/client-context/parametrized-endpoint.js.map +0 -1
- package/dist/src/components/client-directory.js.map +0 -1
- package/dist/src/components/client-operation.js.map +0 -1
- package/dist/src/components/client.js.map +0 -1
- package/dist/src/components/encoding-provider.js.map +0 -1
- package/dist/src/components/external-packages/ts-http-runtime.js.map +0 -1
- package/dist/src/components/external-packages/uri-template.js.map +0 -1
- package/dist/src/components/http-request-options.js.map +0 -1
- package/dist/src/components/http-request-parameters-expression.js.map +0 -1
- package/dist/src/components/http-request.js.map +0 -1
- package/dist/src/components/http-response.js.map +0 -1
- package/dist/src/components/models.js.map +0 -1
- package/dist/src/components/operation-handlers/index.js.map +0 -1
- package/dist/src/components/operation-handlers/operation-pipeline.js.map +0 -1
- package/dist/src/components/operation-handlers/paging/page-item.js.map +0 -1
- package/dist/src/components/operation-handlers/paging/page-response.js.map +0 -1
- package/dist/src/components/operation-handlers/paging/page-settings.js.map +0 -1
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.js.map +0 -1
- package/dist/src/components/operation-handlers/paging/request-send.js.map +0 -1
- package/dist/src/components/operation-handlers/paging/response-deserialize.js.map +0 -1
- package/dist/src/components/operation-handlers/paging/util.js.map +0 -1
- package/dist/src/components/operation-handlers/types.js.map +0 -1
- package/dist/src/components/operation-options.js.map +0 -1
- package/dist/src/components/operation-parameters.js.map +0 -1
- package/dist/src/components/output.js.map +0 -1
- package/dist/src/components/serializers.js.map +0 -1
- package/dist/src/components/static-helpers/bytes-encoding.js.map +0 -1
- package/dist/src/components/static-helpers/interfaces.js.map +0 -1
- package/dist/src/components/static-helpers/multipart-helpers.js.map +0 -1
- package/dist/src/components/static-helpers/paging-helper.js.map +0 -1
- package/dist/src/components/static-helpers/rest-error.js.map +0 -1
- package/dist/src/components/testing/client-options.js.map +0 -1
- package/dist/src/components/transforms/content-type-encoding-provider.js.map +0 -1
- package/dist/src/components/transforms/data-transform.js.map +0 -1
- package/dist/src/components/transforms/json/json-array-transform.js.map +0 -1
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.js.map +0 -1
- package/dist/src/components/transforms/json/json-model-base-transform.js.map +0 -1
- package/dist/src/components/transforms/json/json-model-property-transform.js.map +0 -1
- package/dist/src/components/transforms/json/json-model-transform.js.map +0 -1
- package/dist/src/components/transforms/json/json-record-transform.js.map +0 -1
- package/dist/src/components/transforms/json/json-transform-discriminator.js.map +0 -1
- package/dist/src/components/transforms/json/json-transform.js.map +0 -1
- package/dist/src/components/transforms/json/union-transform.js.map +0 -1
- package/dist/src/components/transforms/json/utils/transport-namer.js.map +0 -1
- package/dist/src/components/transforms/multipart/array-part-transform.js.map +0 -1
- package/dist/src/components/transforms/multipart/file-part-transform.js.map +0 -1
- package/dist/src/components/transforms/multipart/multipart-transform.js.map +0 -1
- package/dist/src/components/transforms/multipart/part-transform.js.map +0 -1
- package/dist/src/components/transforms/multipart/simple-part-transform.js.map +0 -1
- package/dist/src/components/transforms/operation-transform-declaration.js.map +0 -1
- package/dist/src/components/transforms/operation-transform-expression.js.map +0 -1
- package/dist/src/components/transforms/scalar-transform.js.map +0 -1
- package/dist/src/components/transforms/transform-name-policy.js.map +0 -1
- package/dist/src/components/utils/unpack-model-property.js.map +0 -1
- package/dist/src/components/utils/url-template.js.map +0 -1
- package/dist/src/context/encoding/encoding-context.js.map +0 -1
- package/dist/src/context/encoding/types.js.map +0 -1
- package/dist/src/emitter.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib.js.map +0 -1
- package/dist/src/testing/index.js.map +0 -1
- package/dist/src/utils/client-discovery.js.map +0 -1
- package/dist/src/utils/multipart.js.map +0 -1
- package/dist/src/utils/operations.js.map +0 -1
- package/dist/src/utils/parameters.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-context-factory.d.ts","sourceRoot":"","sources":["../../../../src/components/client-context/client-context-factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAKrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAE3D;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"client-context-factory.d.ts","sourceRoot":"","sources":["../../../../src/components/client-context/client-context-factory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAKrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAE3D;AAED,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,yBAAyB,eA+C/E"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, 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
|
-
import {
|
|
4
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
6
5
|
import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
|
|
7
6
|
import { reportDiagnostic } from "../../lib.js";
|
|
8
7
|
import { buildClientParameters } from "../../utils/parameters.js";
|
|
@@ -14,6 +13,9 @@ export function getClientContextFactoryRef(client) {
|
|
|
14
13
|
return ay.refkey(client, "contextFactory");
|
|
15
14
|
}
|
|
16
15
|
export function ClientContextFactoryDeclaration(props) {
|
|
16
|
+
const {
|
|
17
|
+
$
|
|
18
|
+
} = useTsp();
|
|
17
19
|
const ref = getClientContextFactoryRef(props.client);
|
|
18
20
|
const contextDeclarationRef = getClientcontextDeclarationRef(props.client);
|
|
19
21
|
const namePolicy = ts.useTSNamePolicy();
|
|
@@ -75,6 +77,9 @@ function ClientFactoryArguments(props) {
|
|
|
75
77
|
}) : _$createComponent(ClientOptionsExpression, {})];
|
|
76
78
|
}
|
|
77
79
|
function AuthScheme(props) {
|
|
80
|
+
const {
|
|
81
|
+
$
|
|
82
|
+
} = useTsp();
|
|
78
83
|
switch (props.scheme.type) {
|
|
79
84
|
case "http":
|
|
80
85
|
return _$createComponent(ts.ObjectExpression, {
|
|
@@ -174,6 +179,9 @@ function OAuth2Flow(props) {
|
|
|
174
179
|
});
|
|
175
180
|
}
|
|
176
181
|
function AuthSchemeOptions(props) {
|
|
182
|
+
const {
|
|
183
|
+
$
|
|
184
|
+
} = useTsp();
|
|
177
185
|
const clientCredential = $.client.getAuth(props.client);
|
|
178
186
|
if (clientCredential.schemes.length === 0) {
|
|
179
187
|
return null;
|
|
@@ -220,5 +228,4 @@ function ClientOptionsExpression(props) {
|
|
|
220
228
|
});
|
|
221
229
|
}
|
|
222
230
|
});
|
|
223
|
-
}
|
|
224
|
-
//# sourceMappingURL=client-context-factory.js.map
|
|
231
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, 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 { useTransformNamePolicy } from "@typespec/emitter-framework";
|
|
@@ -53,5 +52,4 @@ export function ParametrizedEndpoint(props) {
|
|
|
53
52
|
return [params, resolvedEndpoint];
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=parametrized-endpoint.js.map
|
|
55
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-operation.d.ts","sourceRoot":"","sources":["../../../src/components/client-operation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAU5C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,eAqB5D;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"client-operation.d.ts","sourceRoot":"","sources":["../../../src/components/client-operation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAU5C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,eAqB5D;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,eAwC1D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import * as ay from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
|
-
import {
|
|
4
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
5
5
|
import { FunctionDeclaration, TypeExpression } from "@typespec/emitter-framework/typescript";
|
|
6
6
|
import * as cl from "@typespec/http-client";
|
|
7
7
|
import { reportDiagnostic } from "../lib.js";
|
|
@@ -37,6 +37,9 @@ export function ClientOperations(props) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
export function ClientOperation(props) {
|
|
40
|
+
const {
|
|
41
|
+
$
|
|
42
|
+
} = useTsp();
|
|
40
43
|
const clientLibrary = cl.useClientLibrary();
|
|
41
44
|
const client = clientLibrary.getClientForOperation(props.httpOperation);
|
|
42
45
|
if (!client) {
|
|
@@ -100,5 +103,4 @@ export function ClientOperation(props) {
|
|
|
100
103
|
}), ";"];
|
|
101
104
|
}
|
|
102
105
|
});
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=client-operation.js.map
|
|
106
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/components/client.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,WAAW;CAAG;AAE/B,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/components/client.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIrC,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ5C,MAAM,WAAW,WAAW;CAAG;AAE/B,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAoBxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAElD;AAKD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAiDlD;AAkED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic } 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
|
-
import {
|
|
4
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
6
5
|
import { ClassMethod } from "@typespec/emitter-framework/typescript";
|
|
7
6
|
import { useClientLibrary } from "@typespec/http-client";
|
|
8
7
|
import { flattenClients } from "../utils/client-discovery.js";
|
|
@@ -11,6 +10,9 @@ import { getClientcontextDeclarationRef } from "./client-context/client-context-
|
|
|
11
10
|
import { getClientContextFactoryRef } from "./client-context/client-context-factory.js";
|
|
12
11
|
import { getOperationParameters } from "./operation-parameters.js";
|
|
13
12
|
export function Client(props) {
|
|
13
|
+
const {
|
|
14
|
+
$
|
|
15
|
+
} = useTsp();
|
|
14
16
|
const namePolicy = ts.useTSNamePolicy();
|
|
15
17
|
const {
|
|
16
18
|
topLevel
|
|
@@ -43,6 +45,9 @@ function getClientContextFieldRef(client) {
|
|
|
43
45
|
return ay.refkey(client.type, "client-context");
|
|
44
46
|
}
|
|
45
47
|
export function ClientClass(props) {
|
|
48
|
+
const {
|
|
49
|
+
$
|
|
50
|
+
} = useTsp();
|
|
46
51
|
const namePolicy = ts.useTSNamePolicy();
|
|
47
52
|
const clientName = namePolicy.getName($.client.getName(props.client), "class");
|
|
48
53
|
const contextMemberRef = getClientContextFieldRef(props.client);
|
|
@@ -112,6 +117,9 @@ function getSubClientClassFieldRef(client) {
|
|
|
112
117
|
return ay.refkey(client.type, "client-field");
|
|
113
118
|
}
|
|
114
119
|
function SubClientClassField(props) {
|
|
120
|
+
const {
|
|
121
|
+
$
|
|
122
|
+
} = useTsp();
|
|
115
123
|
const parent = props.client.parent;
|
|
116
124
|
// If sub client has different parameters than client, don't add it as a subclass field
|
|
117
125
|
// Todo: We need to detect the extra parameters and make this field a factory for the subclient
|
|
@@ -129,6 +137,9 @@ function SubClientClassField(props) {
|
|
|
129
137
|
});
|
|
130
138
|
}
|
|
131
139
|
function ClientConstructor(props) {
|
|
140
|
+
const {
|
|
141
|
+
$
|
|
142
|
+
} = useTsp();
|
|
132
143
|
const subClients = props.client.subClients.filter(sc => $.client.haveSameConstructor(sc, props.client));
|
|
133
144
|
const clientContextFieldRef = getClientContextFieldRef(props.client);
|
|
134
145
|
const clientContextFactoryRef = getClientContextFactoryRef(props.client);
|
|
@@ -171,5 +182,4 @@ function NewClientExpression(props) {
|
|
|
171
182
|
return props.args;
|
|
172
183
|
}
|
|
173
184
|
})];
|
|
174
|
-
}
|
|
175
|
-
//# sourceMappingURL=client.js.map
|
|
185
|
+
}
|
|
@@ -7,5 +7,4 @@ export const httpRuntimeTemplateLib = createPackage({
|
|
|
7
7
|
named: ["Client", "ClientOptions", "getClient", "ApiKeyCredential", "BasicCredential", "BearerTokenCredential", "OAuth2TokenCredential", "AuthorizationCodeFlow", "ClientCredentialsFlow", "ImplicitFlow", "PasswordFlow", "PathUncheckedResponse", "PipelineRequest", "HttpResponse", "RawHttpHeaders"]
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=ts-http-runtime.js.map
|
|
10
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } 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 { useTransformNamePolicy } from "@typespec/emitter-framework";
|
|
@@ -169,5 +168,4 @@ function findHttpPropertyByPath(httpOperation, path) {
|
|
|
169
168
|
}
|
|
170
169
|
}
|
|
171
170
|
return undefined;
|
|
172
|
-
}
|
|
173
|
-
//# sourceMappingURL=http-request-parameters-expression.js.map
|
|
171
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, memo as _$memo, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
|
|
4
2
|
import { code, List, refkey, StatementList } from "@alloy-js/core";
|
|
5
3
|
import * as ts from "@alloy-js/typescript";
|
|
6
4
|
import { Reference } from "@alloy-js/typescript";
|
|
@@ -75,5 +73,4 @@ HttpRequest.Url = function HttpUrlDeclaration(props) {
|
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
});
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=http-request.js.map
|
|
76
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-response.d.ts","sourceRoot":"","sources":["../../../src/components/http-response.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,YAOpD;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"http-response.d.ts","sourceRoot":"","sources":["../../../src/components/http-response.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,YAOpD;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,YA6CtD"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import { code, For, List } from "@alloy-js/core";
|
|
4
3
|
import { isVoidType } from "@typespec/compiler";
|
|
5
|
-
import {
|
|
4
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
6
5
|
import { getCreateRestErrorRefkey } from "./static-helpers/rest-error.js";
|
|
7
6
|
import { ContentTypeEncodingProvider } from "./transforms/content-type-encoding-provider.js";
|
|
8
7
|
import { JsonTransform } from "./transforms/json/json-transform.js";
|
|
@@ -19,6 +18,9 @@ export function HttpResponse(props) {
|
|
|
19
18
|
});
|
|
20
19
|
}
|
|
21
20
|
export function HttpResponses(props) {
|
|
21
|
+
const {
|
|
22
|
+
$
|
|
23
|
+
} = useTsp();
|
|
22
24
|
// Handle response by status code and content type
|
|
23
25
|
const responses = $.httpOperation.flattenResponses(props.httpOperation);
|
|
24
26
|
return _$createComponent(For, {
|
|
@@ -65,5 +67,4 @@ export function HttpResponses(props) {
|
|
|
65
67
|
return null;
|
|
66
68
|
}
|
|
67
69
|
});
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=http-response.js.map
|
|
70
|
+
}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,qCAsBxC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import { For, refkey } from "@alloy-js/core";
|
|
4
3
|
import * as ts from "@alloy-js/typescript";
|
|
5
|
-
import {
|
|
4
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
6
5
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
7
6
|
import { useClientLibrary } from "@typespec/http-client";
|
|
8
7
|
import { getFileTypeReference } from "./static-helpers/multipart-helpers.js";
|
|
9
8
|
export function Models(props) {
|
|
9
|
+
const {
|
|
10
|
+
$
|
|
11
|
+
} = useTsp();
|
|
10
12
|
const clientLibrary = useClientLibrary();
|
|
11
13
|
const dataTypes = clientLibrary.dataTypes;
|
|
12
14
|
return _$createComponent(ts.SourceFile, {
|
|
@@ -40,5 +42,4 @@ export function Models(props) {
|
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
44
|
});
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=models.js.map
|
|
45
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"page-item.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe,qCASnE"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
3
3
|
import { TypeExpression } from "@typespec/emitter-framework/typescript";
|
|
4
4
|
export function getPageItemTypeName(pagingOperation) {
|
|
5
|
+
const {
|
|
6
|
+
$
|
|
7
|
+
} = useTsp();
|
|
5
8
|
const type = pagingOperation.output.pageItems.property.type;
|
|
6
9
|
// only accept array type
|
|
7
10
|
if (type.kind === "Model" && $.array.is(type)) {
|
|
@@ -13,5 +16,4 @@ export function getPageItemTypeName(pagingOperation) {
|
|
|
13
16
|
}
|
|
14
17
|
// not supported and throw exceptions
|
|
15
18
|
throw new Error("Not supported");
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=page-item.js.map
|
|
19
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginated-operation-handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/paginated-operation-handler.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"paginated-operation-handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/paginated-operation-handler.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,yBAAyB,EAAE,gBA6DvC,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, 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
|
-
import {
|
|
4
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
6
5
|
import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
|
|
7
6
|
import * as cl from "@typespec/http-client";
|
|
8
7
|
import { reportDiagnostic } from "../../../lib.js";
|
|
@@ -18,10 +17,16 @@ import { getHttpRequestDeserializeRefkey, HttpResponseDeserialize } from "../pag
|
|
|
18
17
|
import { extractPagingDetail } from "../paging/util.js";
|
|
19
18
|
export const PaginatedOperationHandler = {
|
|
20
19
|
canHandle(httpOperation) {
|
|
20
|
+
const {
|
|
21
|
+
$
|
|
22
|
+
} = useTsp();
|
|
21
23
|
const pagingMetadata = $.operation.getPagingMetadata(httpOperation.operation);
|
|
22
24
|
return pagingMetadata !== undefined;
|
|
23
25
|
},
|
|
24
26
|
handle(httpOperation) {
|
|
27
|
+
const {
|
|
28
|
+
$
|
|
29
|
+
} = useTsp();
|
|
25
30
|
const clientLibrary = cl.useClientLibrary();
|
|
26
31
|
const client = clientLibrary.getClientForOperation(httpOperation);
|
|
27
32
|
if (!client) {
|
|
@@ -166,5 +171,4 @@ function GetElements(props) {
|
|
|
166
171
|
`;
|
|
167
172
|
}
|
|
168
173
|
});
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=paginated-operation-handler.js.map
|
|
174
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import * as ay from "@alloy-js/core";
|
|
4
3
|
import { List, StatementList, code, refkey } from "@alloy-js/core";
|
|
5
4
|
import * as ts from "@alloy-js/typescript";
|
|
@@ -74,5 +73,4 @@ export function HttpRequestSend(props) {
|
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=request-send.js.map
|
|
76
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import { code, List, refkey } from "@alloy-js/core";
|
|
4
3
|
import * as ts from "@alloy-js/typescript";
|
|
5
4
|
import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
|
|
@@ -47,5 +46,4 @@ export function HttpResponseDeserialize(props) {
|
|
|
47
46
|
})];
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=response-deserialize.js.map
|
|
49
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as ay from "@alloy-js/core";
|
|
2
|
+
import { Program } from "@typespec/compiler";
|
|
2
3
|
export interface OutputProps {
|
|
3
4
|
children?: ay.Children;
|
|
5
|
+
program: Program;
|
|
4
6
|
}
|
|
5
7
|
export declare function Output(props: OutputProps): ay.Children;
|
|
6
8
|
//# sourceMappingURL=output.d.ts.map
|
|
@@ -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;AAErC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQ7C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,eAgBxC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import * as ay from "@alloy-js/core";
|
|
3
2
|
import * as ts from "@alloy-js/typescript";
|
|
4
|
-
import {
|
|
5
|
-
import { TransformNamePolicyContext } from "@typespec/emitter-framework";
|
|
3
|
+
import { Output as EFOutput, TransformNamePolicyContext } from "@typespec/emitter-framework";
|
|
6
4
|
import { ClientLibrary } from "@typespec/http-client/components";
|
|
7
5
|
import { EncodingProvider } from "./encoding-provider.js";
|
|
8
6
|
import { httpRuntimeTemplateLib } from "./external-packages/ts-http-runtime.js";
|
|
@@ -11,13 +9,16 @@ import { createTransformNamePolicy } from "./transforms/transform-name-policy.js
|
|
|
11
9
|
export function Output(props) {
|
|
12
10
|
const tsNamePolicy = ts.createTSNamePolicy();
|
|
13
11
|
const defaultTransformNamePolicy = createTransformNamePolicy();
|
|
14
|
-
return _$createComponent(
|
|
12
|
+
return _$createComponent(EFOutput, {
|
|
15
13
|
namePolicy: tsNamePolicy,
|
|
16
14
|
externals: [uriTemplateLib, httpRuntimeTemplateLib],
|
|
15
|
+
get program() {
|
|
16
|
+
return props.program;
|
|
17
|
+
},
|
|
17
18
|
get children() {
|
|
18
19
|
return _$createComponent(ClientLibrary, {
|
|
19
20
|
get program() {
|
|
20
|
-
return
|
|
21
|
+
return props.program;
|
|
21
22
|
},
|
|
22
23
|
get children() {
|
|
23
24
|
return _$createComponent(TransformNamePolicyContext.Provider, {
|
|
@@ -34,5 +35,4 @@ export function Output(props) {
|
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=output.js.map
|
|
38
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/components/serializers.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/components/serializers.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qCAuC5D"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
3
2
|
import * as ts from "@alloy-js/typescript";
|
|
4
|
-
import {
|
|
3
|
+
import { useTsp } from "@typespec/emitter-framework";
|
|
5
4
|
import { DateDeserializer, DateRfc3339Serializer, DateRfc7231Deserializer, DateRfc7231Serializer, DateUnixTimestampDeserializer, DateUnixTimestampSerializer } from "@typespec/emitter-framework/typescript";
|
|
6
5
|
import { useClientLibrary } from "@typespec/http-client";
|
|
7
6
|
import { flattenClients } from "../utils/client-discovery.js";
|
|
@@ -10,6 +9,9 @@ import { DecodeBase64, EncodeUint8Array } from "./static-helpers/bytes-encoding.
|
|
|
10
9
|
import { JsonTransformDeclaration } from "./transforms/json/json-transform.js";
|
|
11
10
|
import { TransformDeclaration } from "./transforms/operation-transform-declaration.js";
|
|
12
11
|
export function ModelSerializers(props) {
|
|
12
|
+
const {
|
|
13
|
+
$
|
|
14
|
+
} = useTsp();
|
|
13
15
|
const clientLibrary = useClientLibrary();
|
|
14
16
|
const dataTypes = clientLibrary.dataTypes;
|
|
15
17
|
const flatClients = clientLibrary.topLevel.flatMap(c => flattenClients(c));
|
|
@@ -26,7 +28,7 @@ export function ModelSerializers(props) {
|
|
|
26
28
|
operation: o
|
|
27
29
|
}))), _$memo(() => dataTypes.filter(m => m.kind === "Model" || m.kind === "Union").map(type => {
|
|
28
30
|
let bytesDefaultEncoding = "base64";
|
|
29
|
-
if (isOrExtendsFile(type)) {
|
|
31
|
+
if (isOrExtendsFile($, type)) {
|
|
30
32
|
bytesDefaultEncoding = "none";
|
|
31
33
|
}
|
|
32
34
|
return _$createComponent(EncodingProvider, {
|
|
@@ -47,13 +49,12 @@ export function ModelSerializers(props) {
|
|
|
47
49
|
}
|
|
48
50
|
});
|
|
49
51
|
}
|
|
50
|
-
function isOrExtendsFile(type) {
|
|
52
|
+
function isOrExtendsFile($, type) {
|
|
51
53
|
if (!$.model.is(type)) {
|
|
52
54
|
return false;
|
|
53
55
|
}
|
|
54
56
|
if ($.model.isHttpFile(type)) {
|
|
55
57
|
return true;
|
|
56
58
|
}
|
|
57
|
-
return type.baseModel ? isOrExtendsFile(type.baseModel) : false;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=serializers.js.map
|
|
59
|
+
return type.baseModel ? isOrExtendsFile($, type.baseModel) : false;
|
|
60
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } 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
|
export function getEncodeUint8ArrayRef() {
|
|
@@ -62,5 +61,4 @@ export function DecodeBase64() {
|
|
|
62
61
|
`;
|
|
63
62
|
}
|
|
64
63
|
});
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=bytes-encoding.js.map
|
|
64
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } 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
|
export function getFileContentsTypeReference() {
|
|
@@ -81,5 +80,4 @@ function getCreateFilePartParameters() {
|
|
|
81
80
|
refkey: ay.refkey(),
|
|
82
81
|
type: "string"
|
|
83
82
|
}];
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=multipart-helpers.js.map
|
|
83
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
1
|
+
import { memo as _$memo, createComponent as _$createComponent } 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
|
export function getPagedAsyncIterableIteratorRefkey() {
|
|
@@ -193,5 +192,4 @@ export function PagingHelpers() {
|
|
|
193
192
|
return [_$createComponent(PagedAsyncIterableIteratorInterfaceDeclaration, {}), _$createComponent(PagedResultInterfaceDeclaration, {}), _$createComponent(BuildPagedAsyncIteratorOptionsInterfaceDeclaration, {}), _$createComponent(BuildPagedAsyncIteratorInterfaceDeclaration, {})];
|
|
194
193
|
}
|
|
195
194
|
});
|
|
196
|
-
}
|
|
197
|
-
//# sourceMappingURL=paging-helper.js.map
|
|
195
|
+
}
|