@typespec/http-client-js 0.16.1-dev.0 → 0.16.1-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -5
- package/dist/src/components/client-context/client-context-declaration.d.ts +1 -1
- package/dist/src/components/client-context/client-context-declaration.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-factory.d.ts +2 -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.map +1 -1
- package/dist/src/components/client-context/client-context-options.d.ts +2 -2
- package/dist/src/components/client-context/client-context-options.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-options.js.map +1 -1
- package/dist/src/components/client-context/client-context.d.ts +1 -1
- package/dist/src/components/client-context/client-context.d.ts.map +1 -1
- package/dist/src/components/client-context/parametrized-endpoint.d.ts +2 -2
- package/dist/src/components/client-context/parametrized-endpoint.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/src/components/client-operation.d.ts +2 -2
- package/dist/src/components/client-operation.d.ts.map +1 -1
- package/dist/src/components/client-operation.js.map +1 -1
- package/dist/src/components/client.d.ts +2 -2
- package/dist/src/components/client.d.ts.map +1 -1
- package/dist/src/components/client.js.map +1 -1
- package/dist/src/components/encoding-provider.d.ts +1 -1
- package/dist/src/components/encoding-provider.d.ts.map +1 -1
- package/dist/src/components/http-request-options.d.ts +2 -2
- package/dist/src/components/http-request-options.d.ts.map +1 -1
- package/dist/src/components/http-request-options.js.map +1 -1
- package/dist/src/components/http-request-parameters-expression.d.ts +2 -2
- package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -1
- package/dist/src/components/http-request-parameters-expression.js.map +1 -1
- package/dist/src/components/http-request.d.ts +2 -2
- package/dist/src/components/http-request.d.ts.map +1 -1
- package/dist/src/components/http-request.js.map +1 -1
- package/dist/src/components/http-response.d.ts +2 -2
- package/dist/src/components/http-response.d.ts.map +1 -1
- package/dist/src/components/http-response.js.map +1 -1
- package/dist/src/components/operation-handlers/index.d.ts +1 -1
- package/dist/src/components/operation-handlers/index.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/index.js +0 -1
- package/dist/src/components/operation-handlers/index.js.map +1 -1
- package/dist/src/components/operation-handlers/operation-pipeline.d.ts +2 -2
- package/dist/src/components/operation-handlers/operation-pipeline.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/page-item.d.ts +1 -1
- package/dist/src/components/operation-handlers/paging/page-item.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/page-response.d.ts +2 -2
- package/dist/src/components/operation-handlers/paging/page-response.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/page-settings.d.ts +2 -2
- package/dist/src/components/operation-handlers/paging/page-settings.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/paginated-operation-handler.d.ts +1 -1
- 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.map +1 -1
- package/dist/src/components/operation-handlers/paging/request-send.d.ts +2 -2
- package/dist/src/components/operation-handlers/paging/request-send.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/request-send.js.map +1 -1
- package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts +3 -3
- package/dist/src/components/operation-handlers/paging/response-deserialize.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/response-deserialize.js.map +1 -1
- package/dist/src/components/operation-handlers/paging/util.d.ts +2 -2
- package/dist/src/components/operation-handlers/paging/util.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/types.d.ts +1 -1
- package/dist/src/components/operation-handlers/types.d.ts.map +1 -1
- package/dist/src/components/operation-options.d.ts +2 -2
- package/dist/src/components/operation-options.d.ts.map +1 -1
- package/dist/src/components/operation-parameters.d.ts +3 -3
- package/dist/src/components/operation-parameters.d.ts.map +1 -1
- package/dist/src/components/operation-parameters.js.map +1 -1
- package/dist/src/components/output.d.ts +2 -2
- package/dist/src/components/output.d.ts.map +1 -1
- package/dist/src/components/static-helpers/bytes-encoding.d.ts +2 -2
- package/dist/src/components/static-helpers/bytes-encoding.d.ts.map +1 -1
- package/dist/src/components/static-helpers/bytes-encoding.js.map +1 -1
- package/dist/src/components/testing/client-options.d.ts +1 -1
- package/dist/src/components/testing/client-options.d.ts.map +1 -1
- package/dist/src/components/testing/client-options.js.map +1 -1
- package/dist/src/components/transforms/data-transform.d.ts +2 -2
- package/dist/src/components/transforms/data-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts +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.map +1 -1
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts +2 -2
- 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-transform-discriminator.d.ts +1 -1
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-transform.d.ts +2 -2
- 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 +1 -1
- package/dist/src/components/transforms/json/union-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/union-transform.js.map +1 -1
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts +2 -2
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts +2 -2
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts.map +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 +1 -1
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/part-transform.d.ts +1 -1
- package/dist/src/components/transforms/multipart/part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts +2 -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.map +1 -1
- package/dist/src/components/transforms/operation-transform-declaration.d.ts +3 -3
- package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -1
- package/dist/src/components/transforms/operation-transform-declaration.js.map +1 -1
- package/dist/src/components/transforms/operation-transform-expression.d.ts +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/transforms/scalar-transform.d.ts +2 -2
- package/dist/src/components/transforms/scalar-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/scalar-transform.js.map +1 -1
- package/dist/src/components/utils/unpack-model-property.d.ts +1 -1
- package/dist/src/components/utils/unpack-model-property.d.ts.map +1 -1
- package/dist/src/components/utils/unpack-model-property.js.map +1 -1
- package/dist/src/components/utils/url-template.d.ts +1 -1
- package/dist/src/components/utils/url-template.d.ts.map +1 -1
- package/dist/src/context/encoding/encoding-context.d.ts +2 -2
- package/dist/src/context/encoding/encoding-context.d.ts.map +1 -1
- package/dist/src/context/encoding/encoding-context.js.map +1 -1
- package/dist/src/emitter.d.ts +3 -3
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/testing/index.d.ts +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -0
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/utils/client-discovery.d.ts +1 -1
- package/dist/src/utils/client-discovery.d.ts.map +1 -1
- package/dist/src/utils/operations.d.ts +2 -2
- package/dist/src/utils/operations.d.ts.map +1 -1
- package/dist/src/utils/operations.js.map +1 -1
- package/dist/src/utils/parameters.d.ts +5 -5
- package/dist/src/utils/parameters.d.ts.map +1 -1
- package/dist/src/utils/parameters.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eng/scripts/{calculate-coverage.js → calculate-coverage.ts} +5 -8
- package/eng/scripts/{emit-e2e.js → emit-e2e.ts} +2 -6
- package/eng/scripts/{run-e2e-tests.js → run-e2e-tests.ts} +16 -12
- package/eng/scripts/{upload-spector-results.js → upload-spector-results.ts} +28 -9
- package/package.json +15 -15
- package/src/components/client-context/client-context-declaration.tsx +1 -1
- package/src/components/client-context/client-context-factory.tsx +5 -3
- package/src/components/client-context/client-context-options.tsx +3 -2
- package/src/components/client-context/client-context.tsx +1 -1
- package/src/components/client-context/parametrized-endpoint.tsx +3 -2
- package/src/components/client-directory.tsx +3 -2
- package/src/components/client-operation.tsx +3 -2
- package/src/components/client.tsx +3 -2
- package/src/components/encoding-provider.tsx +1 -1
- package/src/components/http-request-options.tsx +3 -2
- package/src/components/http-request-parameters-expression.tsx +3 -2
- package/src/components/http-request.tsx +3 -2
- package/src/components/http-response.tsx +3 -2
- package/src/components/operation-handlers/index.tsx +1 -1
- package/src/components/operation-handlers/operation-pipeline.tsx +2 -2
- package/src/components/operation-handlers/paging/page-item.tsx +1 -1
- package/src/components/operation-handlers/paging/page-response.tsx +2 -2
- package/src/components/operation-handlers/paging/page-settings.tsx +2 -2
- package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +6 -4
- package/src/components/operation-handlers/paging/request-send.tsx +3 -2
- package/src/components/operation-handlers/paging/response-deserialize.tsx +5 -3
- package/src/components/operation-handlers/paging/util.ts +2 -2
- package/src/components/operation-handlers/types.tsx +1 -1
- package/src/components/operation-options.tsx +2 -2
- package/src/components/operation-parameters.tsx +4 -3
- package/src/components/output.tsx +2 -2
- package/src/components/static-helpers/bytes-encoding.tsx +3 -2
- package/src/components/testing/client-options.tsx +2 -1
- package/src/components/transforms/content-type-encoding-provider.tsx +1 -1
- package/src/components/transforms/data-transform.tsx +2 -2
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +2 -1
- package/src/components/transforms/json/json-model-property-transform.tsx +3 -2
- package/src/components/transforms/json/json-transform-discriminator.tsx +1 -1
- package/src/components/transforms/json/json-transform.tsx +3 -2
- package/src/components/transforms/json/union-transform.tsx +2 -1
- package/src/components/transforms/multipart/array-part-transform.tsx +2 -2
- package/src/components/transforms/multipart/file-part-transform.tsx +3 -2
- package/src/components/transforms/multipart/multipart-transform.tsx +1 -1
- package/src/components/transforms/multipart/part-transform.tsx +1 -1
- package/src/components/transforms/multipart/simple-part-transform.tsx +3 -2
- package/src/components/transforms/operation-transform-declaration.tsx +4 -3
- package/src/components/transforms/operation-transform-expression.tsx +3 -2
- package/src/components/transforms/scalar-transform.tsx +4 -2
- package/src/components/utils/unpack-model-property.ts +2 -1
- package/src/components/utils/url-template.tsx +1 -1
- package/src/context/encoding/encoding-context.tsx +3 -2
- package/src/emitter.tsx +4 -3
- package/src/lib.ts +2 -1
- package/src/testing/index.ts +3 -1
- package/src/utils/client-discovery.ts +1 -1
- package/src/utils/operations.ts +5 -3
- package/src/utils/parameters.tsx +6 -5
- package/test/e2e/http/payload/multipart/main.test.ts +1 -3
- package/test/e2e/http/payload/pageable/main.test.ts +2 -4
- package/test/e2e/http/type/model/inheritance/single-discriminator/main.test.ts +2 -4
- package/test/e2e/http/type/property/additional-properties/main.test.ts +1 -1
- package/test/e2e/http/type/property/additional-properties/spreads.test.ts +5 -3
- package/test/e2e/http/versioning/added/main.test.ts +1 -2
- package/test/e2e/http/versioning/removed/main.test.ts +1 -1
- package/test/test-host.ts +2 -1
- package/tsconfig.json +1 -0
- package/tsconfig.test.json +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Children, Refkey } from "@alloy-js/core";
|
|
2
|
-
import { EncodeData, ModelProperty, Scalar } from "@typespec/compiler";
|
|
1
|
+
import type { Children, Refkey } from "@alloy-js/core";
|
|
2
|
+
import type { EncodeData, ModelProperty, Scalar } from "@typespec/compiler";
|
|
3
3
|
import { useTsp } from "@typespec/emitter-framework";
|
|
4
4
|
import { reportDiagnostic } from "../../lib.js";
|
|
5
5
|
import { unpackProperty } from "../utils/unpack-model-property.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Children
|
|
1
|
+
import type { Children } from "@alloy-js/core";
|
|
2
|
+
import { code, mapJoin } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
4
|
import type { Model } from "@typespec/compiler";
|
|
4
5
|
import { useTsp } from "@typespec/emitter-framework";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Children,
|
|
1
|
+
import type { Children, Refkey } from "@alloy-js/core";
|
|
2
|
+
import { code, NamePolicyContext } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { ModelProperty } from "@typespec/compiler";
|
|
4
|
+
import type { ModelProperty } from "@typespec/compiler";
|
|
4
5
|
import { useTsp } from "@typespec/emitter-framework";
|
|
5
6
|
import { unpackProperty } from "../../utils/unpack-model-property.js";
|
|
6
7
|
import { ScalarDataTransform } from "../data-transform.jsx";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code, mapJoin, refkey, useNamePolicy, type Children, type Refkey } from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { Discriminator, Model, Union } from "@typespec/compiler";
|
|
3
|
+
import type { Discriminator, Model, Union } from "@typespec/compiler";
|
|
4
4
|
import { useTsp } from "@typespec/emitter-framework";
|
|
5
5
|
import { JsonTransform } from "./json-transform.jsx";
|
|
6
6
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Refkey } from "@alloy-js/core";
|
|
2
|
+
import { code } from "@alloy-js/core";
|
|
3
|
+
import type { Children } from "@alloy-js/core/jsx-runtime";
|
|
3
4
|
import type { Type } from "@typespec/compiler";
|
|
4
5
|
import { useTsp } from "@typespec/emitter-framework";
|
|
5
6
|
import { ScalarDataTransform } from "../data-transform.jsx";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Children,
|
|
1
|
+
import type { Children, Refkey } from "@alloy-js/core";
|
|
2
|
+
import { code, refkey } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
4
|
import type { Union } from "@typespec/compiler";
|
|
4
5
|
import { useTsp } from "@typespec/emitter-framework";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { code } from "@alloy-js/core";
|
|
2
|
-
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import type { Children } from "@alloy-js/core/jsx-runtime";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
|
-
import { HttpOperationPart } from "@typespec/http";
|
|
4
|
+
import type { HttpOperationPart } from "@typespec/http";
|
|
5
5
|
import { HttpPartTransform } from "./part-transform.jsx";
|
|
6
6
|
|
|
7
7
|
export interface ArrayPartTransformProps {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Children
|
|
1
|
+
import type { Children } from "@alloy-js/core";
|
|
2
|
+
import { code } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { HttpOperationPart } from "@typespec/http";
|
|
4
|
+
import type { HttpOperationPart } from "@typespec/http";
|
|
4
5
|
import { getCreateFilePartDescriptorReference } from "../../static-helpers/multipart-helpers.jsx";
|
|
5
6
|
|
|
6
7
|
export interface FilePartTransformProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { For } from "@alloy-js/core";
|
|
2
2
|
import { useTransformNamePolicy, useTsp } from "@typespec/emitter-framework";
|
|
3
|
-
import { HttpOperationMultipartBody } from "@typespec/http";
|
|
3
|
+
import type { HttpOperationMultipartBody } from "@typespec/http";
|
|
4
4
|
import { reportDiagnostic } from "../../../lib.js";
|
|
5
5
|
import { HttpPartTransform } from "./part-transform.jsx";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Children } from "@alloy-js/core";
|
|
2
|
-
import { HttpOperationPart } from "@typespec/http";
|
|
2
|
+
import type { HttpOperationPart } from "@typespec/http";
|
|
3
3
|
import { ArrayPartTransform } from "./array-part-transform.jsx";
|
|
4
4
|
import { FilePartTransform } from "./file-part-transform.jsx";
|
|
5
5
|
import { SimplePartTransform } from "./simple-part-transform.jsx";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Children
|
|
1
|
+
import type { Children } from "@alloy-js/core";
|
|
2
|
+
import { code, List } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { HttpOperationPart } from "@typespec/http";
|
|
4
|
+
import type { HttpOperationPart } from "@typespec/http";
|
|
4
5
|
import { JsonTransform } from "../json/json-transform.jsx";
|
|
5
6
|
|
|
6
7
|
export interface SimplePartTransformProps {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Refkey
|
|
1
|
+
import type { Refkey } from "@alloy-js/core";
|
|
2
|
+
import { refkey } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
4
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
4
|
-
import { HttpOperationBody } from "@typespec/http";
|
|
5
|
-
import { ClientOperation } from "@typespec/http-client";
|
|
5
|
+
import type { HttpOperationBody } from "@typespec/http";
|
|
6
|
+
import type { ClientOperation } from "@typespec/http-client";
|
|
6
7
|
import { JsonTransform } from "./json/json-transform.jsx";
|
|
7
8
|
|
|
8
9
|
export interface TransformDeclarationProps {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as ts from "@alloy-js/typescript";
|
|
2
2
|
import type { Type } from "@typespec/compiler";
|
|
3
|
-
import { HasName
|
|
4
|
-
import {
|
|
3
|
+
import type { HasName } from "@typespec/emitter-framework";
|
|
4
|
+
import { TransformNamePolicyContext, useTsp } from "@typespec/emitter-framework";
|
|
5
|
+
import type { HttpOperation } from "@typespec/http";
|
|
5
6
|
import { reportDiagnostic } from "../../lib.js";
|
|
6
7
|
import { ContentTypeEncodingProvider } from "./content-type-encoding-provider.jsx";
|
|
7
8
|
import { JsonTransform } from "./json/json-transform.jsx";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Children,
|
|
2
|
-
import {
|
|
1
|
+
import type { Children, Refkey } from "@alloy-js/core";
|
|
2
|
+
import { code } from "@alloy-js/core";
|
|
3
|
+
import type { BytesKnownEncoding, EncodeData, Scalar } from "@typespec/compiler";
|
|
4
|
+
import { NoTarget } from "@typespec/compiler";
|
|
3
5
|
import { useTsp } from "@typespec/emitter-framework";
|
|
4
6
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
5
7
|
import { useDefaultEncoding } from "../../context/encoding/encoding-context.jsx";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "@alloy-js/typescript";
|
|
2
|
-
import { ModelProperty } from "@typespec/compiler";
|
|
2
|
+
import type { ModelProperty } from "@typespec/compiler";
|
|
3
3
|
import { useTransformNamePolicy } from "@typespec/emitter-framework";
|
|
4
4
|
import { uriTemplateLib } from "../external-packages/uri-template.js";
|
|
5
5
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ComponentContext
|
|
1
|
+
import type { ComponentContext } from "@alloy-js/core";
|
|
2
|
+
import { createNamedContext, useContext } from "@alloy-js/core";
|
|
2
3
|
import { NoTarget } from "@typespec/compiler";
|
|
3
4
|
import { useTsp } from "@typespec/emitter-framework";
|
|
4
5
|
import { reportDiagnostic } from "../../lib.js";
|
|
5
|
-
import { EncodingDefaults } from "./types.js";
|
|
6
|
+
import type { EncodingDefaults } from "./types.js";
|
|
6
7
|
|
|
7
8
|
export const EncodingContext: ComponentContext<EncodingDefaults> =
|
|
8
9
|
createNamedContext<EncodingDefaults>("Encoding");
|
package/src/emitter.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Children
|
|
1
|
+
import type { Children } from "@alloy-js/core";
|
|
2
|
+
import { SourceDirectory } from "@alloy-js/core";
|
|
2
3
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import { EmitContext } from "@typespec/compiler";
|
|
4
|
+
import type { EmitContext } from "@typespec/compiler";
|
|
4
5
|
import {
|
|
5
6
|
Experimental_ComponentOverrides,
|
|
6
7
|
Experimental_ComponentOverridesConfig,
|
|
@@ -17,7 +18,7 @@ import { Interfaces } from "./components/static-helpers/interfaces.jsx";
|
|
|
17
18
|
import { MultipartHelpers } from "./components/static-helpers/multipart-helpers.jsx";
|
|
18
19
|
import { PagingHelpers } from "./components/static-helpers/paging-helper.jsx";
|
|
19
20
|
import { RestError } from "./components/static-helpers/rest-error.jsx";
|
|
20
|
-
import { JsClientEmitterOptions } from "./lib.js";
|
|
21
|
+
import type { JsClientEmitterOptions } from "./lib.js";
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Main function to handle the emission process.
|
package/src/lib.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { JSONSchemaType } from "@typespec/compiler";
|
|
2
|
+
import { createTypeSpecLibrary } from "@typespec/compiler";
|
|
2
3
|
|
|
3
4
|
export interface JsClientEmitterOptions {
|
|
4
5
|
"package-name"?: string;
|
package/src/testing/index.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { resolvePath } from "@typespec/compiler";
|
|
2
|
-
import {
|
|
2
|
+
import type { TypeSpecTestLibrary } from "@typespec/compiler/testing";
|
|
3
|
+
import { createTestLibrary } from "@typespec/compiler/testing";
|
|
3
4
|
import { fileURLToPath } from "url";
|
|
4
5
|
|
|
5
6
|
/** @deprecated Use `createTester` from `@typespec/compiler/testing` instead */
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
6
8
|
export const HttpClientJavascriptEmitterTestLibrary: TypeSpecTestLibrary = createTestLibrary({
|
|
7
9
|
name: "@typespec/http-client-js",
|
|
8
10
|
packageRoot: resolvePath(fileURLToPath(import.meta.url), "../../../"),
|
package/src/utils/operations.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Model, ModelProperty, Operation, Union } from "@typespec/compiler";
|
|
1
|
+
import type { Model, ModelProperty, Operation, Union } from "@typespec/compiler";
|
|
2
|
+
import type {
|
|
3
|
+
unsafe_Mutator as Mutator,
|
|
4
|
+
unsafe_MutatorRecord,
|
|
5
|
+
} from "@typespec/compiler/experimental";
|
|
2
6
|
import {
|
|
3
7
|
unsafe_mutateSubgraph as mutateSubgraph,
|
|
4
|
-
unsafe_Mutator as Mutator,
|
|
5
8
|
unsafe_MutatorFlow as MutatorFlow,
|
|
6
|
-
unsafe_MutatorRecord,
|
|
7
9
|
} from "@typespec/compiler/experimental";
|
|
8
10
|
import { $, type Typekit } from "@typespec/compiler/typekit";
|
|
9
11
|
|
package/src/utils/parameters.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import type { Refkey } from "@alloy-js/core";
|
|
2
|
+
import { code, mapJoin, refkey } from "@alloy-js/core";
|
|
3
|
+
import type * as ts from "@alloy-js/typescript";
|
|
4
|
+
import type { ModelProperty, Value } from "@typespec/compiler";
|
|
4
5
|
import { useTsp } from "@typespec/emitter-framework";
|
|
5
6
|
import { buildParameterDescriptor } from "@typespec/emitter-framework/typescript";
|
|
6
|
-
import { HttpAuth, HttpProperty, OAuth2FlowType } from "@typespec/http";
|
|
7
|
-
import * as cl from "@typespec/http-client";
|
|
7
|
+
import type { HttpAuth, HttpProperty, OAuth2FlowType } from "@typespec/http";
|
|
8
|
+
import type * as cl from "@typespec/http-client";
|
|
8
9
|
import { getClientContextOptionsRef } from "../components/client-context/client-context-options.jsx";
|
|
9
10
|
import { httpRuntimeTemplateLib } from "../components/external-packages/ts-http-runtime.js";
|
|
10
11
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
ServerDrivenPaginationClient,
|
|
5
|
-
} from "../../../generated/payload/pageable/src/index.js";
|
|
2
|
+
import type { Pet } from "../../../generated/payload/pageable/src/index.js";
|
|
3
|
+
import { ServerDrivenPaginationClient } from "../../../generated/payload/pageable/src/index.js";
|
|
6
4
|
|
|
7
5
|
describe("Payload.Pageable", () => {
|
|
8
6
|
describe("list", () => {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
SingleDiscriminatorClient,
|
|
5
|
-
} from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
|
|
2
|
+
import type { Eagle } from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
|
|
3
|
+
import { SingleDiscriminatorClient } from "../../../../../generated/type/model/inheritance/single-discriminator/src/index.js";
|
|
6
4
|
|
|
7
5
|
describe("Type.Model.Inheritance.SingleDiscriminator", () => {
|
|
8
6
|
const client = new SingleDiscriminatorClient({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type { ExtendsUnknownAdditionalPropertiesDiscriminatedDerived } from "../../../../generated/type/property/additional-properties/src/index.js";
|
|
2
3
|
import {
|
|
3
|
-
ExtendsUnknownAdditionalPropertiesDiscriminatedDerived,
|
|
4
4
|
ExtendsUnknownClient,
|
|
5
5
|
ExtendsUnknownDerivedClient,
|
|
6
6
|
ExtendsUnknownDiscriminatedClient,
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type {
|
|
3
|
+
SpreadRecordForNonDiscriminatedUnion,
|
|
4
|
+
SpreadRecordForNonDiscriminatedUnion2,
|
|
5
|
+
SpreadRecordForNonDiscriminatedUnion3,
|
|
6
|
+
} from "../../../../generated/type/property/additional-properties/src/index.js";
|
|
2
7
|
import {
|
|
3
8
|
ExtendsDifferentSpreadFloatClient,
|
|
4
9
|
ExtendsDifferentSpreadModelArrayClient,
|
|
@@ -20,9 +25,6 @@ import {
|
|
|
20
25
|
SpreadFloatClient,
|
|
21
26
|
SpreadModelArrayClient,
|
|
22
27
|
SpreadModelClient,
|
|
23
|
-
SpreadRecordForNonDiscriminatedUnion,
|
|
24
|
-
SpreadRecordForNonDiscriminatedUnion2,
|
|
25
|
-
SpreadRecordForNonDiscriminatedUnion3,
|
|
26
28
|
SpreadRecordNonDiscriminatedUnion2Client,
|
|
27
29
|
SpreadRecordNonDiscriminatedUnion3Client,
|
|
28
30
|
SpreadRecordNonDiscriminatedUnionClient,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type { ModelV1, ModelV2 } from "../../../generated/versioning/added/src/index.js";
|
|
2
3
|
import {
|
|
3
4
|
AddedClient,
|
|
4
5
|
EnumV1,
|
|
5
6
|
EnumV2,
|
|
6
7
|
InterfaceV2Client,
|
|
7
|
-
ModelV1,
|
|
8
|
-
ModelV2,
|
|
9
8
|
Versions,
|
|
10
9
|
} from "../../../generated/versioning/added/src/index.js";
|
|
11
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type { ModelV3 } from "../../../generated/versioning/removed/src/index.js";
|
|
2
3
|
import {
|
|
3
4
|
EnumV2,
|
|
4
5
|
EnumV3,
|
|
5
|
-
ModelV3,
|
|
6
6
|
RemovedClient,
|
|
7
7
|
Versions,
|
|
8
8
|
} from "../../../generated/versioning/removed/src/index.js";
|
package/test/test-host.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Diagnostic
|
|
1
|
+
import type { Diagnostic } from "@typespec/compiler";
|
|
2
|
+
import { resolvePath } from "@typespec/compiler";
|
|
2
3
|
import { createTester, expectDiagnosticEmpty } from "@typespec/compiler/testing";
|
|
3
4
|
|
|
4
5
|
const ApiTester = createTester(resolvePath(import.meta.dirname, ".."), {
|
package/tsconfig.json
CHANGED