@typespec/http-client-js 0.1.0 → 0.2.0-dev.10
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/.github/copilot-instructions.md +193 -0
- package/README.md +31 -15
- 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 +21 -14
- 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 +23 -13
- 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/unpack-model-property.d.ts.map +1 -1
- package/dist/src/components/utils/unpack-model-property.js +11 -2
- package/dist/src/components/utils/unpack-model-property.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/lib.d.ts.map +1 -1
- package/dist/src/lib.js +2 -1
- package/dist/src/lib.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/eng/scripts/emit-e2e.js +1 -1
- package/package.json +14 -13
- 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 +21 -9
- 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 +16 -13
- package/src/components/transforms/operation-transform-declaration.tsx +24 -7
- package/src/components/transforms/operation-transform-expression.tsx +12 -5
- package/src/components/utils/unpack-model-property.ts +13 -2
- package/src/components/utils/url-template.tsx +10 -6
- package/src/emitter.tsx +4 -3
- package/src/lib.ts +6 -1
- package/src/utils/operations.ts +96 -1
- package/src/utils/parameters.tsx +5 -1
- package/test/e2e/http/payload/multipart/main.test.ts +20 -24
- 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 +2 -11
- package/test/scenarios/multipart/file.md +0 -12
- package/test/scenarios/multipart/file_content_type.md +15 -5
- package/test/scenarios/multipart/non-string-float.md +50 -0
- 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/property_references_property.md +72 -0
- 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
|
@@ -22,7 +22,5 @@ export function ContentTypeEncodingProvider(props: ContentTypeEncodingProviderPr
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
return <EncodingProvider defaults={defaults}>
|
|
26
|
-
{props.children}
|
|
27
|
-
</EncodingProvider>;
|
|
25
|
+
return <EncodingProvider defaults={defaults}>{props.children}</EncodingProvider>;
|
|
28
26
|
}
|
|
@@ -26,7 +26,7 @@ export function JsonArrayTransform(props: JsonArrayTransformProps) {
|
|
|
26
26
|
const _transformedArray = [];
|
|
27
27
|
|
|
28
28
|
for (const item of ${props.itemRef} ?? []) {
|
|
29
|
-
const transformedItem = ${<JsonTransform type={elementType} target={props.target} itemRef="item as any" />};
|
|
29
|
+
const transformedItem = ${(<JsonTransform type={elementType} target={props.target} itemRef="item as any" />)};
|
|
30
30
|
_transformedArray.push(transformedItem);
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -61,7 +61,7 @@ export function JsonArrayTransformDeclaration(props: JsonArrayTransformDeclarati
|
|
|
61
61
|
"function",
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
-
const itemType = ay.code`Array<${<ef.TypeExpression type={elementType} />}>`;
|
|
64
|
+
const itemType = ay.code`Array<${(<ef.TypeExpression type={elementType} />)}>`;
|
|
65
65
|
const returnType = props.target === "transport" ? "any" : itemType;
|
|
66
66
|
const inputType = props.target === "transport" ? <>{itemType} | null</> : "any";
|
|
67
67
|
const inputRef = ay.refkey();
|
|
@@ -71,7 +71,8 @@ export function JsonArrayTransformDeclaration(props: JsonArrayTransformDeclarati
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
const declarationRefkey = getJsonArrayTransformRefkey(props.type, props.target);
|
|
74
|
-
return
|
|
74
|
+
return (
|
|
75
|
+
<ts.FunctionDeclaration
|
|
75
76
|
name={transformName}
|
|
76
77
|
export
|
|
77
78
|
returnType={returnType}
|
|
@@ -79,5 +80,6 @@ export function JsonArrayTransformDeclaration(props: JsonArrayTransformDeclarati
|
|
|
79
80
|
refkey={declarationRefkey}
|
|
80
81
|
>
|
|
81
82
|
<JsonArrayTransform {...props} itemRef={inputRef} />
|
|
82
|
-
</ts.FunctionDeclaration
|
|
83
|
+
</ts.FunctionDeclaration>
|
|
84
|
+
);
|
|
83
85
|
}
|
|
@@ -19,10 +19,14 @@ export function JsonAdditionalPropertiesTransform(props: JsonAdditionalPropertie
|
|
|
19
19
|
|
|
20
20
|
if (props.target === "application") {
|
|
21
21
|
const properties = $.model.getProperties(props.type, { includeExtended: true });
|
|
22
|
-
const destructuredProperties = ay.mapJoin(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const destructuredProperties = ay.mapJoin(
|
|
23
|
+
() => properties,
|
|
24
|
+
(name) => name,
|
|
25
|
+
{
|
|
26
|
+
joiner: ",",
|
|
27
|
+
ender: ",",
|
|
28
|
+
},
|
|
29
|
+
);
|
|
26
30
|
|
|
27
31
|
// Inline destructuring that extracts the properties and passes the rest to jsonRecordUnknownToApplicationTransform_2
|
|
28
32
|
const inlineDestructure = ay.code`
|
|
@@ -31,17 +35,18 @@ export function JsonAdditionalPropertiesTransform(props: JsonAdditionalPropertie
|
|
|
31
35
|
),
|
|
32
36
|
`;
|
|
33
37
|
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
{inlineDestructure}
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<ts.ObjectProperty name="additionalProperties">{inlineDestructure}</ts.ObjectProperty>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
const itemRef = ay.code`${props.itemRef}.additionalProperties`;
|
|
42
46
|
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
...({getJsonRecordTransformRefkey(additionalProperties, props.target)}({itemRef}) ),
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
47
52
|
}
|
|
@@ -15,5 +15,10 @@ export function JsonModelBaseTransform(props: JsonModelBaseTransformProps) {
|
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
...
|
|
21
|
+
<JsonTransform {...props} type={baseModel} />,
|
|
22
|
+
</>
|
|
23
|
+
);
|
|
19
24
|
}
|
|
@@ -13,7 +13,7 @@ export interface JsonModelPropertyTransformProps {
|
|
|
13
13
|
target: "transport" | "application";
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export function JsonModelPropertyTransform(props: JsonModelPropertyTransformProps)
|
|
16
|
+
export function JsonModelPropertyTransform(props: JsonModelPropertyTransformProps) {
|
|
17
17
|
const transformNamer = useTransformNamePolicy();
|
|
18
18
|
const propertyValueType = unpackProperty(props.type);
|
|
19
19
|
|
|
@@ -26,15 +26,13 @@ export function JsonModelPropertyTransform(props: JsonModelPropertyTransformProp
|
|
|
26
26
|
let propertyValue: ay.Children;
|
|
27
27
|
|
|
28
28
|
if ($.scalar.is(propertyValueType)) {
|
|
29
|
-
propertyValue =
|
|
30
|
-
<ScalarDataTransform
|
|
31
|
-
|
|
32
|
-
target={props.target}
|
|
33
|
-
itemRef={propertyValueRef}
|
|
34
|
-
/>;
|
|
29
|
+
propertyValue = (
|
|
30
|
+
<ScalarDataTransform type={props.type} target={props.target} itemRef={propertyValueRef} />
|
|
31
|
+
);
|
|
35
32
|
} else {
|
|
36
|
-
propertyValue =
|
|
37
|
-
<JsonTransform type={propertyValueType} target={props.target} itemRef={propertyValueRef}
|
|
33
|
+
propertyValue = (
|
|
34
|
+
<JsonTransform type={propertyValueType} target={props.target} itemRef={propertyValueRef} />
|
|
35
|
+
);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
return <ts.ObjectProperty name={JSON.stringify(targetName)} value={propertyValue} />;
|
|
@@ -27,13 +27,31 @@ export function JsonModelTransform(props: JsonModelTransformProps) {
|
|
|
27
27
|
|
|
28
28
|
const discriminate = getJsonTransformDiscriminatorRefkey(props.type, props.target);
|
|
29
29
|
|
|
30
|
-
return
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
return (
|
|
31
|
+
<ts.ObjectExpression>
|
|
32
|
+
<JsonAdditionalPropertiesTransform
|
|
33
|
+
itemRef={props.itemRef}
|
|
34
|
+
target={props.target}
|
|
35
|
+
type={props.type}
|
|
36
|
+
/>
|
|
37
|
+
{discriminator ? (
|
|
38
|
+
<>
|
|
39
|
+
...{discriminate}({props.itemRef}),
|
|
40
|
+
</>
|
|
41
|
+
) : null}
|
|
42
|
+
<ay.For each={properties} joiner="," line>
|
|
43
|
+
{(property) => {
|
|
44
|
+
return (
|
|
45
|
+
<JsonModelPropertyTransform
|
|
46
|
+
itemRef={props.itemRef}
|
|
47
|
+
type={property}
|
|
48
|
+
target={props.target}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}}
|
|
52
|
+
</ay.For>
|
|
53
|
+
</ts.ObjectExpression>
|
|
54
|
+
);
|
|
37
55
|
}
|
|
38
56
|
|
|
39
57
|
export function getJsonModelTransformRefkey(
|
|
@@ -70,18 +88,28 @@ export function JsonModelTransformDeclaration(
|
|
|
70
88
|
const hasAdditionalProperties = spread && $.model.is(spread) && $.record.is(spread);
|
|
71
89
|
|
|
72
90
|
const declarationRefkey = getJsonModelTransformRefkey(props.type, props.target);
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{
|
|
91
|
+
return (
|
|
92
|
+
<>
|
|
93
|
+
{hasAdditionalProperties ? (
|
|
94
|
+
<JsonRecordTransformDeclaration target={props.target} type={spread} />
|
|
95
|
+
) : null}
|
|
96
|
+
<JsonTransformDiscriminatorDeclaration type={props.type} target={props.target} />
|
|
97
|
+
<ts.FunctionDeclaration
|
|
98
|
+
name={transformName}
|
|
99
|
+
export
|
|
100
|
+
returnType={returnType}
|
|
101
|
+
parameters={parameters}
|
|
102
|
+
refkey={declarationRefkey}
|
|
103
|
+
>
|
|
104
|
+
{ay.code`
|
|
79
105
|
if(!${inputRef}) {
|
|
80
106
|
return ${inputRef} as any;
|
|
81
107
|
}
|
|
82
108
|
|
|
83
109
|
`}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
110
|
+
return <JsonModelTransform {...props} itemRef={inputRef} />
|
|
111
|
+
!;
|
|
112
|
+
</ts.FunctionDeclaration>
|
|
113
|
+
</>
|
|
114
|
+
);
|
|
87
115
|
}
|
|
@@ -27,7 +27,7 @@ export function JsonRecordTransform(props: JsonRecordTransformProps) {
|
|
|
27
27
|
const _transformedRecord: any = {};
|
|
28
28
|
|
|
29
29
|
for (const [key, value] of Object.entries(${props.itemRef} ?? {})) {
|
|
30
|
-
const transformedItem = ${<JsonTransform type={elementType} target={props.target} itemRef="value as any" />};
|
|
30
|
+
const transformedItem = ${(<JsonTransform type={elementType} target={props.target} itemRef="value as any" />)};
|
|
31
31
|
_transformedRecord[key] = transformedItem;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -72,7 +72,8 @@ export function JsonRecordTransformDeclaration(props: JsonRecordTransformDeclara
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
const declarationRefkey = getJsonRecordTransformRefkey(props.type, props.target);
|
|
75
|
-
return
|
|
75
|
+
return (
|
|
76
|
+
<ts.FunctionDeclaration
|
|
76
77
|
name={transformName}
|
|
77
78
|
export
|
|
78
79
|
returnType={returnType}
|
|
@@ -80,5 +81,6 @@ export function JsonRecordTransformDeclaration(props: JsonRecordTransformDeclara
|
|
|
80
81
|
refkey={declarationRefkey}
|
|
81
82
|
>
|
|
82
83
|
<JsonRecordTransform {...props} itemRef={inputRef} />
|
|
83
|
-
</ts.FunctionDeclaration
|
|
84
|
+
</ts.FunctionDeclaration>
|
|
85
|
+
);
|
|
84
86
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import * as ay from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
|
-
import {
|
|
4
|
-
DiscriminatedUnion,
|
|
5
|
-
DiscriminatedUnionLegacy,
|
|
6
|
-
Discriminator,
|
|
7
|
-
getDiscriminatedUnion,
|
|
8
|
-
ignoreDiagnostics,
|
|
9
|
-
Model,
|
|
10
|
-
Union,
|
|
11
|
-
} from "@typespec/compiler";
|
|
3
|
+
import { Discriminator, Model, Union } from "@typespec/compiler";
|
|
12
4
|
import { $ } from "@typespec/compiler/experimental/typekit";
|
|
13
5
|
import { JsonTransform } from "./json-transform.jsx";
|
|
14
6
|
|
|
@@ -20,17 +12,11 @@ export interface JsonTransformDiscriminatorProps {
|
|
|
20
12
|
}
|
|
21
13
|
|
|
22
14
|
export function JsonTransformDiscriminator(props: JsonTransformDiscriminatorProps) {
|
|
23
|
-
|
|
24
|
-
props.type
|
|
25
|
-
|
|
26
|
-
? $.type.getDiscriminatedUnion(props.type)
|
|
27
|
-
: undefined;
|
|
15
|
+
const discriminatedUnion = $.model.is(props.type)
|
|
16
|
+
? $.model.getDiscriminatedUnion(props.type)
|
|
17
|
+
: $.union.getDiscriminatedUnion(props.type);
|
|
28
18
|
|
|
29
|
-
|
|
30
|
-
if (!discriminatedUnion && props.discriminator) {
|
|
31
|
-
discriminatedUnion = ignoreDiagnostics(getDiscriminatedUnion(props.type, props.discriminator));
|
|
32
|
-
propertyName = props.discriminator.propertyName;
|
|
33
|
-
}
|
|
19
|
+
const propertyName = props.discriminator.propertyName;
|
|
34
20
|
|
|
35
21
|
if (!discriminatedUnion || !propertyName) {
|
|
36
22
|
return ay.code`${props.itemRef}`;
|
|
@@ -42,24 +28,23 @@ export function JsonTransformDiscriminator(props: JsonTransformDiscriminatorProp
|
|
|
42
28
|
// type in the discriminator are compatible.
|
|
43
29
|
const itemRef = ay.code`${props.itemRef} as any`;
|
|
44
30
|
const discriminatingCases = ay.mapJoin(
|
|
45
|
-
discriminatedUnion.variants,
|
|
31
|
+
() => discriminatedUnion.variants,
|
|
46
32
|
(name, variant) => {
|
|
47
33
|
return ay.code`
|
|
48
34
|
if( discriminatorValue === ${JSON.stringify(name)}) {
|
|
49
|
-
return ${<JsonTransform type={variant} target={props.target} itemRef={itemRef} />}!
|
|
35
|
+
return ${(<JsonTransform type={variant} target={props.target} itemRef={itemRef} />)}!
|
|
50
36
|
}
|
|
51
37
|
`;
|
|
52
38
|
},
|
|
53
39
|
{ joiner: "\n\n" },
|
|
54
40
|
);
|
|
55
41
|
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
{discriminatingCases}
|
|
59
|
-
<>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</>;
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
const discriminatorValue = {discriminatorRef};{discriminatingCases}
|
|
45
|
+
<>console.warn(`Received unknown kind: ` + discriminatorValue); return {itemRef}</>
|
|
46
|
+
</>
|
|
47
|
+
);
|
|
63
48
|
}
|
|
64
49
|
|
|
65
50
|
export function getJsonTransformDiscriminatorRefkey(
|
|
@@ -97,7 +82,8 @@ export function JsonTransformDiscriminatorDeclaration(
|
|
|
97
82
|
input_: { type: inputType, refkey: inputRef, optional: true },
|
|
98
83
|
};
|
|
99
84
|
|
|
100
|
-
return
|
|
85
|
+
return (
|
|
86
|
+
<ts.FunctionDeclaration
|
|
101
87
|
name={transformName}
|
|
102
88
|
export
|
|
103
89
|
returnType={returnType}
|
|
@@ -110,5 +96,6 @@ export function JsonTransformDiscriminatorDeclaration(
|
|
|
110
96
|
}
|
|
111
97
|
`}
|
|
112
98
|
<JsonTransformDiscriminator {...props} itemRef={inputRef} discriminator={discriminator} />
|
|
113
|
-
</ts.FunctionDeclaration
|
|
99
|
+
</ts.FunctionDeclaration>
|
|
100
|
+
);
|
|
114
101
|
}
|
|
@@ -53,10 +53,12 @@ export function JsonTransform(props: JsonTransformProps) {
|
|
|
53
53
|
case "Union":
|
|
54
54
|
return <JsonUnionTransform type={type} itemRef={props.itemRef} target={props.target} />;
|
|
55
55
|
case "ModelProperty": {
|
|
56
|
-
return
|
|
56
|
+
return (
|
|
57
|
+
<JsonModelPropertyTransform type={type} itemRef={props.itemRef} target={props.target} />
|
|
58
|
+
);
|
|
57
59
|
}
|
|
58
60
|
case "Scalar": {
|
|
59
|
-
return <ScalarDataTransform type={type} itemRef={props.itemRef} target={props.target}/>;
|
|
61
|
+
return <ScalarDataTransform type={type} itemRef={props.itemRef} target={props.target} />;
|
|
60
62
|
}
|
|
61
63
|
default:
|
|
62
64
|
return props.itemRef;
|
|
@@ -79,7 +81,7 @@ export function JsonTransformDeclaration(props: JsonTransformDeclarationProps) {
|
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
if ($.record.is(props.type)) {
|
|
82
|
-
return <JsonRecordTransformDeclaration target={props.target} type={props.type}
|
|
84
|
+
return <JsonRecordTransformDeclaration target={props.target} type={props.type} />;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
return <JsonModelTransformDeclaration type={props.type} target={props.target} />;
|
|
@@ -18,7 +18,11 @@ export function JsonUnionTransform(props: JsonUnionTransformProps) {
|
|
|
18
18
|
const discriminator = $.type.getDiscriminator(props.type);
|
|
19
19
|
if (discriminator) {
|
|
20
20
|
// return <JsonTransformDiscriminator {...props} discriminator={discriminator}/>;
|
|
21
|
-
return
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
{getJsonTransformDiscriminatorRefkey(props.type, props.target)}({props.itemRef})
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
const variantType = props.type.variants.values().next().value!.type;
|
|
@@ -59,15 +63,23 @@ export function JsonUnionTransformDeclaration(props: JsonUnionTransformDeclarati
|
|
|
59
63
|
};
|
|
60
64
|
|
|
61
65
|
const declarationRefkey = getJsonUnionTransformRefkey(props.type, props.target);
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
return (
|
|
67
|
+
<>
|
|
68
|
+
<JsonTransformDiscriminatorDeclaration target={props.target} type={props.type} />
|
|
69
|
+
<ts.FunctionDeclaration
|
|
70
|
+
name={transformName}
|
|
71
|
+
export
|
|
72
|
+
returnType={returnType}
|
|
73
|
+
parameters={parameters}
|
|
74
|
+
refkey={declarationRefkey}
|
|
75
|
+
>
|
|
76
|
+
{ay.code`
|
|
66
77
|
if(!${inputRef}) {
|
|
67
78
|
return ${inputRef} as any;
|
|
68
79
|
}
|
|
69
80
|
`}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
return <JsonUnionTransform {...props} itemRef={inputRef} />
|
|
82
|
+
</ts.FunctionDeclaration>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
73
85
|
}
|
|
@@ -26,9 +26,12 @@ export function ArrayPartTransform(props: ArrayPartTransformProps) {
|
|
|
26
26
|
name: partElementName,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
{inputExpression}.map({mapCallbackSignature}{" "}
|
|
32
|
+
{ay.code`=> (${(<HttpPartTransform itemRef={null} part={partElement} />)})`} )
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
function getPartRef(itemRef: ay.Children, partName: string) {
|
|
@@ -17,7 +17,7 @@ export function FilePartTransform(props: FilePartTransformProps) {
|
|
|
17
17
|
if (defaultContentType) {
|
|
18
18
|
args.push(ts.ValueExpression({ jsValue: defaultContentType }));
|
|
19
19
|
}
|
|
20
|
-
return <ts.FunctionCallExpression
|
|
20
|
+
return <ts.FunctionCallExpression target={getCreateFilePartDescriptorReference()} args={args} />;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function getContentType(part: HttpOperationPart) {
|
|
@@ -20,12 +20,10 @@ export function MultipartTransform(props: MultipartTransformProps) {
|
|
|
20
20
|
|
|
21
21
|
const itemRef = transportNamer.getApplicationName(props.body.property);
|
|
22
22
|
|
|
23
|
-
const partTransform =
|
|
24
|
-
httpParts
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
joiner: ",\n",
|
|
28
|
-
},
|
|
23
|
+
const partTransform = (
|
|
24
|
+
<ay.For each={httpParts} comma line>
|
|
25
|
+
{(part) => <HttpPartTransform part={part} itemRef={itemRef} />}
|
|
26
|
+
</ay.For>
|
|
29
27
|
);
|
|
30
28
|
|
|
31
29
|
return <>[{partTransform}]</>;
|
|
@@ -11,7 +11,7 @@ export interface HttpPartTransformProps {
|
|
|
11
11
|
|
|
12
12
|
export function HttpPartTransform(props: HttpPartTransformProps) {
|
|
13
13
|
if (props.part.multi) {
|
|
14
|
-
return <ArrayPartTransform part={props.part} itemRef={props.itemRef}/>;
|
|
14
|
+
return <ArrayPartTransform part={props.part} itemRef={props.itemRef} />;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
if (props.part.filename) {
|
|
@@ -16,6 +16,11 @@ export function SimplePartTransform(props: SimplePartTransformProps) {
|
|
|
16
16
|
const partName = ts.ValueExpression({ jsValue: props.part.name });
|
|
17
17
|
const partContentType = props.part.body.contentTypes[0] ?? "application/json";
|
|
18
18
|
const partRef = getPartRef(props.itemRef, applicationName);
|
|
19
|
+
let bodyRef = ay.code`${partRef}`;
|
|
20
|
+
|
|
21
|
+
if (props.part.body.property) {
|
|
22
|
+
bodyRef = ay.code`${partRef}.${props.part.body.property.name}`;
|
|
23
|
+
}
|
|
19
24
|
|
|
20
25
|
if (!partContentType.startsWith("application/json")) {
|
|
21
26
|
reportDiagnostic($.program, {
|
|
@@ -25,19 +30,17 @@ export function SimplePartTransform(props: SimplePartTransformProps) {
|
|
|
25
30
|
});
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
name="
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/>,
|
|
40
|
-
</ts.ObjectExpression>;
|
|
33
|
+
return (
|
|
34
|
+
<ts.ObjectExpression>
|
|
35
|
+
<ay.List comma line>
|
|
36
|
+
<ts.ObjectProperty name="name" jsValue={partName} />
|
|
37
|
+
<ts.ObjectProperty
|
|
38
|
+
name="body"
|
|
39
|
+
value={<JsonTransform itemRef={bodyRef} target="transport" type={props.part.body.type} />}
|
|
40
|
+
/>
|
|
41
|
+
</ay.List>
|
|
42
|
+
</ts.ObjectExpression>
|
|
43
|
+
);
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
function getPartRef(itemRef: ay.Children, partName: string) {
|
|
@@ -18,9 +18,11 @@ export function getTransformDeclarationRef(operaion: ClientOperation) {
|
|
|
18
18
|
|
|
19
19
|
export function TransformDeclaration(props: TransformDeclarationProps) {
|
|
20
20
|
const refkey = props.refkey ?? getTransformDeclarationRef(props.operation);
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<TransformToTransportDeclaration operation={props.operation} refkey={refkey} />
|
|
24
|
+
</>
|
|
25
|
+
);
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
export interface SingleBodyTransformDeclarationProps {
|
|
@@ -37,9 +39,17 @@ export function SingleBodyTransformDeclaration(props: SingleBodyTransformDeclara
|
|
|
37
39
|
refkey: inputRef,
|
|
38
40
|
};
|
|
39
41
|
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
return (
|
|
43
|
+
<ts.FunctionDeclaration
|
|
44
|
+
export
|
|
45
|
+
name={props.name}
|
|
46
|
+
parameters={{ payload: payloadParameter }}
|
|
47
|
+
refkey={props.refkey}
|
|
48
|
+
>
|
|
49
|
+
return <JsonTransform itemRef={inputRef} target="transport" type={props.payload.type} />
|
|
50
|
+
!;
|
|
51
|
+
</ts.FunctionDeclaration>
|
|
52
|
+
);
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
interface TransformToTransportDeclarationProps {
|
|
@@ -60,5 +70,12 @@ function TransformToTransportDeclaration(props: TransformToTransportDeclarationP
|
|
|
60
70
|
return null;
|
|
61
71
|
}
|
|
62
72
|
|
|
63
|
-
return
|
|
73
|
+
return (
|
|
74
|
+
<SingleBodyTransformDeclaration
|
|
75
|
+
operation={props.operation}
|
|
76
|
+
payload={requestPayload}
|
|
77
|
+
refkey={props.refkey}
|
|
78
|
+
name={name}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
64
81
|
}
|
|
@@ -30,11 +30,18 @@ export function OperationTransformExpression(props: OperationTransformToTranspor
|
|
|
30
30
|
// And multiple content types
|
|
31
31
|
const contentType = body.contentTypes[0];
|
|
32
32
|
const payloadType = body.type;
|
|
33
|
-
return
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
return (
|
|
34
|
+
<ContentTypeEncodingProvider contentType={contentType}>
|
|
35
|
+
<TransformNamePolicyContext.Provider
|
|
36
|
+
value={{
|
|
37
|
+
getTransportName: defaultTransportNameGetter,
|
|
38
|
+
getApplicationName: payloadApplicationNameGetter,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<JsonTransform itemRef={itemRef} target="transport" type={payloadType} />
|
|
42
|
+
</TransformNamePolicyContext.Provider>
|
|
43
|
+
</ContentTypeEncodingProvider>
|
|
44
|
+
);
|
|
38
45
|
}
|
|
39
46
|
|
|
40
47
|
function payloadApplicationNameGetter(type: HasName<Type>) {
|
|
@@ -18,11 +18,22 @@ export function unpackProperty(modelProperty: ModelProperty): Type {
|
|
|
18
18
|
const nullVariant = variants.find((v) => isNullType(v.type));
|
|
19
19
|
if (variants.length === 2 && nullVariant) {
|
|
20
20
|
// When the union has only null and another variant unpack the non-null type
|
|
21
|
-
|
|
21
|
+
const nonNullVariant = variants.find((v) => v !== nullVariant)!.type;
|
|
22
|
+
// Recursively unpack if the non-null variant is a ModelProperty
|
|
23
|
+
return $.modelProperty.is(nonNullVariant) ? unpackProperty(nonNullVariant) : nonNullVariant;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
if (variants.length > 2 && nullVariant) {
|
|
25
|
-
const nonNullVariants = variants
|
|
27
|
+
const nonNullVariants = variants
|
|
28
|
+
.filter((v) => v !== nullVariant)
|
|
29
|
+
.map((v) => {
|
|
30
|
+
// Recursively unpack each variant if it's a ModelProperty
|
|
31
|
+
const variantType = v.type;
|
|
32
|
+
return {
|
|
33
|
+
...v,
|
|
34
|
+
type: $.modelProperty.is(variantType) ? unpackProperty(variantType) : variantType,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
26
37
|
return $.union.create({ name: type.name, variants: nonNullVariants });
|
|
27
38
|
}
|
|
28
39
|
}
|
|
@@ -11,11 +11,15 @@ export interface UrlTemplateProps {
|
|
|
11
11
|
export function UrlTemplate(props: UrlTemplateProps) {
|
|
12
12
|
const namer = useTransformNamePolicy();
|
|
13
13
|
const params = props.parameters.map((p) => {
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
return (
|
|
15
|
+
<ts.ObjectExpression>
|
|
16
|
+
"{namer.getTransportName(p)}": {namer.getApplicationName(p)}
|
|
17
|
+
</ts.ObjectExpression>
|
|
18
|
+
);
|
|
17
19
|
});
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
return (
|
|
21
|
+
<ts.VarDeclaration name="url" type="string">
|
|
22
|
+
{uriTemplateLib.parse}({JSON.stringify(props.template)}).expand({params})
|
|
23
|
+
</ts.VarDeclaration>
|
|
24
|
+
);
|
|
21
25
|
}
|
package/src/emitter.tsx
CHANGED
|
@@ -18,13 +18,13 @@ import { JsClientEmitterOptions } from "./lib.js";
|
|
|
18
18
|
*/
|
|
19
19
|
export async function $onEmit(context: EmitContext<JsClientEmitterOptions>) {
|
|
20
20
|
const packageName = context.options["package-name"] ?? "test-package";
|
|
21
|
-
const output =
|
|
21
|
+
const output = (
|
|
22
22
|
<Output>
|
|
23
23
|
<ts.PackageDirectory
|
|
24
24
|
name={packageName}
|
|
25
25
|
version="1.0.0"
|
|
26
26
|
path="."
|
|
27
|
-
scripts={{
|
|
27
|
+
scripts={{ build: "tsc" }}
|
|
28
28
|
devDependencies={{ "@types/node": "~18.19.75" }}
|
|
29
29
|
>
|
|
30
30
|
<ay.SourceDirectory path="src">
|
|
@@ -47,7 +47,8 @@ export async function $onEmit(context: EmitContext<JsClientEmitterOptions>) {
|
|
|
47
47
|
</ay.SourceDirectory>
|
|
48
48
|
</ay.SourceDirectory>
|
|
49
49
|
</ts.PackageDirectory>
|
|
50
|
-
</Output
|
|
50
|
+
</Output>
|
|
51
|
+
);
|
|
51
52
|
|
|
52
53
|
await writeOutput(output, context.emitterOutputDir);
|
|
53
54
|
}
|