@typespec/http-client-js 0.7.0-dev.2 → 0.7.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.testignore +4 -0
- package/dist/src/components/client-context/client-context-declaration.d.ts +2 -3
- package/dist/src/components/client-context/client-context-declaration.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-declaration.js +2 -2
- package/dist/src/components/client-context/client-context-factory.d.ts +3 -3
- package/dist/src/components/client-context/client-context-factory.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-factory.js +10 -10
- package/dist/src/components/client-context/client-context-options.d.ts +3 -3
- package/dist/src/components/client-context/client-context-options.d.ts.map +1 -1
- package/dist/src/components/client-context/client-context-options.js +3 -3
- package/dist/src/components/client-context/client-context.d.ts +3 -3
- package/dist/src/components/client-context/client-context.d.ts.map +1 -1
- package/dist/src/components/client-context/parametrized-endpoint.d.ts +3 -3
- package/dist/src/components/client-context/parametrized-endpoint.d.ts.map +1 -1
- package/dist/src/components/client-context/parametrized-endpoint.js +5 -5
- package/dist/src/components/client-directory.d.ts +4 -4
- package/dist/src/components/client-directory.d.ts.map +1 -1
- package/dist/src/components/client-directory.js +5 -5
- package/dist/src/components/client-operation.d.ts +4 -4
- 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.d.ts +5 -5
- package/dist/src/components/client.d.ts.map +1 -1
- package/dist/src/components/client.js +14 -14
- 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-parameters-expression.d.ts +4 -4
- package/dist/src/components/http-request-parameters-expression.d.ts.map +1 -1
- package/dist/src/components/http-request-parameters-expression.js +10 -10
- package/dist/src/components/models.d.ts +1 -2
- package/dist/src/components/models.d.ts.map +1 -1
- package/dist/src/components/models.js +2 -3
- package/dist/src/components/operation-handlers/operation-pipeline.d.ts +1 -2
- package/dist/src/components/operation-handlers/operation-pipeline.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/operation-pipeline.js +2 -2
- package/dist/src/components/operation-handlers/paging/page-response.d.ts +2 -3
- package/dist/src/components/operation-handlers/paging/page-response.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/page-response.js +3 -3
- package/dist/src/components/operation-handlers/paging/page-settings.d.ts +2 -3
- package/dist/src/components/operation-handlers/paging/page-settings.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/page-settings.js +3 -3
- 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 +16 -16
- package/dist/src/components/operation-handlers/paging/request-send.d.ts +2 -3
- package/dist/src/components/operation-handlers/paging/request-send.d.ts.map +1 -1
- package/dist/src/components/operation-handlers/paging/request-send.js +1 -2
- 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 -3
- package/dist/src/components/operation-options.d.ts.map +1 -1
- package/dist/src/components/operation-options.js +3 -3
- package/dist/src/components/operation-parameters.d.ts +2 -2
- package/dist/src/components/operation-parameters.d.ts.map +1 -1
- package/dist/src/components/operation-parameters.js +2 -2
- package/dist/src/components/output.d.ts +3 -3
- package/dist/src/components/output.d.ts.map +1 -1
- package/dist/src/components/static-helpers/bytes-encoding.d.ts +6 -5
- package/dist/src/components/static-helpers/bytes-encoding.d.ts.map +1 -1
- package/dist/src/components/static-helpers/bytes-encoding.js +15 -19
- package/dist/src/components/static-helpers/interfaces.d.ts +3 -4
- package/dist/src/components/static-helpers/interfaces.d.ts.map +1 -1
- package/dist/src/components/static-helpers/interfaces.js +3 -3
- package/dist/src/components/static-helpers/multipart-helpers.d.ts +4 -5
- package/dist/src/components/static-helpers/multipart-helpers.d.ts.map +1 -1
- package/dist/src/components/static-helpers/multipart-helpers.js +8 -10
- package/dist/src/components/static-helpers/paging-helper.d.ts +3 -4
- package/dist/src/components/static-helpers/paging-helper.d.ts.map +1 -1
- package/dist/src/components/static-helpers/paging-helper.js +17 -23
- package/dist/src/components/static-helpers/rest-error.d.ts +3 -4
- package/dist/src/components/static-helpers/rest-error.d.ts.map +1 -1
- package/dist/src/components/static-helpers/rest-error.js +19 -25
- package/dist/src/components/testing/client-options.d.ts +3 -3
- package/dist/src/components/testing/client-options.d.ts.map +1 -1
- package/dist/src/components/testing/client-options.js +2 -2
- package/dist/src/components/transforms/content-type-encoding-provider.d.ts +1 -1
- package/dist/src/components/transforms/content-type-encoding-provider.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-array-transform.d.ts +6 -6
- package/dist/src/components/transforms/json/json-array-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-array-transform.js +5 -5
- package/dist/src/components/transforms/json/json-model-additional-properties-transform.d.ts +4 -4
- 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-base-transform.d.ts +4 -4
- package/dist/src/components/transforms/json/json-model-base-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-property-transform.d.ts +3 -3
- 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 +3 -3
- package/dist/src/components/transforms/json/json-model-transform.d.ts +6 -6
- package/dist/src/components/transforms/json/json-model-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-model-transform.js +8 -8
- package/dist/src/components/transforms/json/json-record-transform.d.ts +6 -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 +5 -5
- package/dist/src/components/transforms/json/json-transform-discriminator.d.ts +5 -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 +13 -13
- package/dist/src/components/transforms/json/json-transform.d.ts +6 -5
- package/dist/src/components/transforms/json/json-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/json/json-transform.js +2 -2
- package/dist/src/components/transforms/json/union-transform.d.ts +6 -6
- 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 +1 -1
- package/dist/src/components/transforms/json/utils/transport-namer.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts +3 -3
- package/dist/src/components/transforms/multipart/array-part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/array-part-transform.js +5 -5
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts +3 -3
- package/dist/src/components/transforms/multipart/file-part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/file-part-transform.js +2 -2
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts +1 -2
- package/dist/src/components/transforms/multipart/multipart-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/multipart-transform.js +2 -2
- package/dist/src/components/transforms/multipart/part-transform.d.ts +3 -3
- package/dist/src/components/transforms/multipart/part-transform.d.ts.map +1 -1
- package/dist/src/components/transforms/multipart/simple-part-transform.d.ts +3 -3
- 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 -5
- package/dist/src/components/transforms/operation-transform-declaration.d.ts +6 -6
- package/dist/src/components/transforms/operation-transform-declaration.d.ts.map +1 -1
- package/dist/src/components/transforms/operation-transform-declaration.js +3 -3
- package/dist/src/components/transforms/transform-name-policy.d.ts +1 -1
- package/dist/src/components/transforms/transform-name-policy.d.ts.map +1 -1
- package/dist/src/emitter.js +6 -6
- package/dist/src/utils/multipart.d.ts +1 -1
- package/dist/src/utils/multipart.d.ts.map +1 -1
- package/dist/src/utils/parameters.d.ts +2 -2
- package/dist/src/utils/parameters.d.ts.map +1 -1
- package/dist/src/utils/parameters.js +6 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/client-context/client-context-declaration.tsx +2 -2
- package/src/components/client-context/client-context-factory.tsx +19 -19
- package/src/components/client-context/client-context-options.tsx +5 -5
- package/src/components/client-context/client-context.tsx +2 -2
- package/src/components/client-context/parametrized-endpoint.tsx +8 -8
- package/src/components/client-directory.tsx +10 -10
- package/src/components/client-operation.tsx +11 -11
- package/src/components/client.tsx +21 -21
- package/src/components/encoding-provider.tsx +1 -1
- package/src/components/http-request-parameters-expression.tsx +19 -19
- package/src/components/models.tsx +2 -3
- package/src/components/operation-handlers/operation-pipeline.tsx +2 -2
- package/src/components/operation-handlers/paging/page-response.tsx +4 -4
- package/src/components/operation-handlers/paging/page-settings.tsx +4 -4
- package/src/components/operation-handlers/paging/paginated-operation-handler.tsx +18 -19
- package/src/components/operation-handlers/paging/request-send.tsx +1 -2
- package/src/components/operation-handlers/types.tsx +1 -1
- package/src/components/operation-options.tsx +4 -4
- package/src/components/operation-parameters.tsx +3 -3
- package/src/components/output.tsx +2 -2
- package/src/components/serializers.tsx +1 -1
- package/src/components/static-helpers/bytes-encoding.tsx +17 -16
- package/src/components/static-helpers/interfaces.tsx +3 -3
- package/src/components/static-helpers/multipart-helpers.tsx +7 -7
- package/src/components/static-helpers/paging-helper.tsx +17 -20
- package/src/components/static-helpers/rest-error.tsx +17 -17
- package/src/components/testing/client-options.tsx +3 -3
- package/src/components/transforms/content-type-encoding-provider.tsx +1 -1
- package/src/components/transforms/json/json-array-transform.tsx +8 -8
- package/src/components/transforms/json/json-model-additional-properties-transform.tsx +6 -6
- package/src/components/transforms/json/json-model-base-transform.tsx +3 -3
- package/src/components/transforms/json/json-model-property-transform.tsx +6 -6
- package/src/components/transforms/json/json-model-transform.tsx +12 -14
- package/src/components/transforms/json/json-record-transform.tsx +8 -8
- package/src/components/transforms/json/json-transform-discriminator.tsx +12 -12
- package/src/components/transforms/json/json-transform.tsx +6 -5
- package/src/components/transforms/json/union-transform.tsx +8 -8
- package/src/components/transforms/json/utils/transport-namer.ts +1 -1
- package/src/components/transforms/multipart/array-part-transform.tsx +6 -5
- package/src/components/transforms/multipart/file-part-transform.tsx +5 -5
- package/src/components/transforms/multipart/multipart-transform.tsx +3 -3
- package/src/components/transforms/multipart/part-transform.tsx +2 -2
- package/src/components/transforms/multipart/simple-part-transform.tsx +8 -8
- package/src/components/transforms/operation-transform-declaration.tsx +7 -6
- package/src/components/transforms/operation-transform-expression.tsx +1 -1
- package/src/components/transforms/transform-name-policy.ts +1 -1
- package/src/emitter.tsx +11 -11
- package/src/utils/multipart.ts +1 -1
- package/src/utils/parameters.tsx +9 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { code, For, List, NamePolicyContext, useNamePolicy } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import { useTransformNamePolicy } from "@typespec/emitter-framework";
|
|
5
5
|
import { getDefaultValue, hasDefaultValue } from "../utils/parameters.js";
|
|
@@ -18,7 +18,7 @@ export function HttpRequestParametersExpression(props) {
|
|
|
18
18
|
return _$createComponent(ts.ObjectExpression, {});
|
|
19
19
|
}
|
|
20
20
|
const optionsParamRef = props.optionsParameter ?? "options";
|
|
21
|
-
const members = _$createComponent(
|
|
21
|
+
const members = _$createComponent(For, {
|
|
22
22
|
get each() {
|
|
23
23
|
return props.parameters;
|
|
24
24
|
},
|
|
@@ -30,7 +30,7 @@ export function HttpRequestParametersExpression(props) {
|
|
|
30
30
|
const transportParamName = transformNamer.getTransportName(httpProperty.property);
|
|
31
31
|
if (defaultValue) {
|
|
32
32
|
const paramValue = [_$memo(() => propertyExpression.fullExpression), ` ?? ${defaultValue}`];
|
|
33
|
-
return _$createComponent(
|
|
33
|
+
return _$createComponent(NamePolicyContext.Provider, {
|
|
34
34
|
value: {
|
|
35
35
|
getName: n => n
|
|
36
36
|
},
|
|
@@ -43,7 +43,7 @@ export function HttpRequestParametersExpression(props) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
if (propertyExpression.isNullish) {
|
|
46
|
-
return
|
|
46
|
+
return code`
|
|
47
47
|
...(${propertyExpression.fullExpression} && {${_$createComponent(JsonTransform, {
|
|
48
48
|
get itemRef() {
|
|
49
49
|
return propertyExpression.leadingExpression;
|
|
@@ -93,7 +93,7 @@ export function HttpRequestParametersExpression(props) {
|
|
|
93
93
|
function buildMemberChainExpression(httpOperation, httpProperty, optionsParamRef) {
|
|
94
94
|
const segments = [];
|
|
95
95
|
let isNullish = httpProperty.property.optional === true;
|
|
96
|
-
const namePolicy =
|
|
96
|
+
const namePolicy = useNamePolicy();
|
|
97
97
|
const propertyApplicationName = namePolicy.getName(httpProperty.property.name, "property");
|
|
98
98
|
|
|
99
99
|
// If the property is at the top level, return early
|
|
@@ -102,8 +102,8 @@ function buildMemberChainExpression(httpOperation, httpProperty, optionsParamRef
|
|
|
102
102
|
return {
|
|
103
103
|
propertyName: propertyApplicationName,
|
|
104
104
|
isNullish,
|
|
105
|
-
fullExpression:
|
|
106
|
-
leadingExpression:
|
|
105
|
+
fullExpression: code`${optionsParamRef}?.${propertyApplicationName}`,
|
|
106
|
+
leadingExpression: code`${optionsParamRef}`
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
return {
|
|
@@ -133,7 +133,7 @@ function buildMemberChainExpression(httpOperation, httpProperty, optionsParamRef
|
|
|
133
133
|
|
|
134
134
|
// Use direct property access if possible.
|
|
135
135
|
if (isValidIdentifier(parentName)) {
|
|
136
|
-
segments.unshift(
|
|
136
|
+
segments.unshift(code`${parentName}`);
|
|
137
137
|
} else {
|
|
138
138
|
// For non-valid identifiers, use bracket notation.
|
|
139
139
|
segments.unshift(`[${JSON.stringify(parentName)}]`);
|
|
@@ -142,10 +142,10 @@ function buildMemberChainExpression(httpOperation, httpProperty, optionsParamRef
|
|
|
142
142
|
// Remove the last element to move one level up.
|
|
143
143
|
currentPath = currentPath.slice(0, -1);
|
|
144
144
|
}
|
|
145
|
-
const fullExpression = [_$createComponent(
|
|
145
|
+
const fullExpression = [_$createComponent(List, {
|
|
146
146
|
children: segments
|
|
147
147
|
}), propertyApplicationName];
|
|
148
|
-
const leadingExpression = _$createComponent(
|
|
148
|
+
const leadingExpression = _$createComponent(List, {
|
|
149
149
|
get children() {
|
|
150
150
|
return segments.slice(0, -1);
|
|
151
151
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as ay from "@alloy-js/core";
|
|
2
1
|
export interface ModelsProps {
|
|
3
2
|
path?: string;
|
|
4
3
|
}
|
|
5
|
-
export declare function Models(props: ModelsProps):
|
|
4
|
+
export declare function Models(props: ModelsProps): import("@alloy-js/core").Children;
|
|
6
5
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/models.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/models.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,qCAexC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { memo as _$memo, createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { For } from "@alloy-js/core";
|
|
2
|
+
import { For, refkey } from "@alloy-js/core";
|
|
4
3
|
import * as ts from "@alloy-js/typescript";
|
|
5
4
|
import { useTsp } from "@typespec/emitter-framework";
|
|
6
5
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
@@ -24,7 +23,7 @@ export function Models(props) {
|
|
|
24
23
|
"export": true,
|
|
25
24
|
type: type,
|
|
26
25
|
get refkey() {
|
|
27
|
-
return
|
|
26
|
+
return refkey(type);
|
|
28
27
|
}
|
|
29
28
|
});
|
|
30
29
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as ay from "@alloy-js/core";
|
|
2
1
|
import { HttpOperation } from "@typespec/http";
|
|
3
2
|
import { OperationHandlerPipeline } from "./types.jsx";
|
|
4
3
|
export interface OperationPipelineProps {
|
|
@@ -11,5 +10,5 @@ export interface OperationPipelineProps {
|
|
|
11
10
|
* It will try each handler in order until it finds one that can handle the operation.
|
|
12
11
|
* If no handler is found, it will use the default ClientOperation component.
|
|
13
12
|
*/
|
|
14
|
-
export declare function OperationPipeline({ httpOperation, pipeline, internal }: OperationPipelineProps):
|
|
13
|
+
export declare function OperationPipeline({ httpOperation, pipeline, internal }: OperationPipelineProps): import("@alloy-js/core").Children;
|
|
15
14
|
//# sourceMappingURL=operation-pipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-pipeline.d.ts","sourceRoot":"","sources":["../../../../src/components/operation-handlers/operation-pipeline.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operation-pipeline.d.ts","sourceRoot":"","sources":["../../../../src/components/operation-handlers/operation-pipeline.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,wBAAwB,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,sBAAsB,qCAgB9F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { refkey } from "@alloy-js/core";
|
|
3
3
|
import { ClientOperation as DefaultOperationComponent } from "../client-operation.js";
|
|
4
4
|
/**
|
|
5
5
|
* Component that manages the operation handler pipeline.
|
|
@@ -18,7 +18,7 @@ export function OperationPipeline({
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
// Default to standard client operation if no handler matched
|
|
21
|
-
const defaultOperationRefkey =
|
|
21
|
+
const defaultOperationRefkey = refkey(httpOperation.operation);
|
|
22
22
|
return _$createComponent(DefaultOperationComponent, {
|
|
23
23
|
httpOperation: httpOperation,
|
|
24
24
|
internal: internal,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as ay from "@alloy-js/core";
|
|
2
1
|
import { PagingOperation } from "@typespec/compiler";
|
|
3
2
|
import { HttpOperation } from "@typespec/http";
|
|
4
3
|
export interface PageResponseProps {
|
|
5
4
|
operation: HttpOperation;
|
|
6
5
|
pagingOperation: PagingOperation;
|
|
7
6
|
}
|
|
8
|
-
export declare function getPageResponseTypeRefkey(operation: HttpOperation):
|
|
9
|
-
export declare function PageResponseDeclaration(props: PageResponseProps):
|
|
7
|
+
export declare function getPageResponseTypeRefkey(operation: HttpOperation): import("@alloy-js/core").Refkey;
|
|
8
|
+
export declare function PageResponseDeclaration(props: PageResponseProps): import("@alloy-js/core").Children;
|
|
10
9
|
//# sourceMappingURL=page-response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-response.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-response.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-response.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-response.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAkB,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,aAAa,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,aAAa,mCAEjE;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,qCAyC/D"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { For, refkey } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
5
5
|
export function getPageResponseTypeRefkey(operation) {
|
|
6
|
-
return
|
|
6
|
+
return refkey(operation, "page-response");
|
|
7
7
|
}
|
|
8
8
|
export function PageResponseDeclaration(props) {
|
|
9
9
|
const namePolicy = ts.useTSNamePolicy();
|
|
@@ -25,7 +25,7 @@ export function PageResponseDeclaration(props) {
|
|
|
25
25
|
return getPageResponseTypeRefkey(props.operation);
|
|
26
26
|
},
|
|
27
27
|
get children() {
|
|
28
|
-
return _$createComponent(
|
|
28
|
+
return _$createComponent(For, {
|
|
29
29
|
each: responseProperties,
|
|
30
30
|
line: true,
|
|
31
31
|
children: parameter => _$createComponent(ts.InterfaceMember, {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import * as ay from "@alloy-js/core";
|
|
2
1
|
import { PagingOperation, PagingProperty } from "@typespec/compiler";
|
|
3
2
|
import { HttpOperation } from "@typespec/http";
|
|
4
3
|
export interface PageSettingsProps {
|
|
5
4
|
operation: HttpOperation;
|
|
6
5
|
pagingOperation: PagingOperation;
|
|
7
6
|
}
|
|
8
|
-
export declare function getPageSettingsTypeRefkey(operation: HttpOperation):
|
|
7
|
+
export declare function getPageSettingsTypeRefkey(operation: HttpOperation): import("@alloy-js/core").Refkey;
|
|
9
8
|
export declare function getPageSettingProperties(pagingOperation: PagingOperation): PagingProperty[];
|
|
10
|
-
export declare function PageSettingsDeclaration(props: PageSettingsProps):
|
|
9
|
+
export declare function PageSettingsDeclaration(props: PageSettingsProps): import("@alloy-js/core").Children;
|
|
11
10
|
//# sourceMappingURL=page-settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-settings.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page-settings.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/page-settings.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,aAAa,CAAC;IACzB,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,aAAa,mCAEjE;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,eAAe,oBAYxE;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,qCAwB/D"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { For, refkey } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
5
5
|
export function getPageSettingsTypeRefkey(operation) {
|
|
6
|
-
return
|
|
6
|
+
return refkey(operation, "page-settings");
|
|
7
7
|
}
|
|
8
8
|
export function getPageSettingProperties(pagingOperation) {
|
|
9
9
|
const definedSettings = pagingOperation.input;
|
|
@@ -29,7 +29,7 @@ export function PageSettingsDeclaration(props) {
|
|
|
29
29
|
return getPageSettingsTypeRefkey(props.operation);
|
|
30
30
|
},
|
|
31
31
|
get children() {
|
|
32
|
-
return _$createComponent(
|
|
32
|
+
return _$createComponent(For, {
|
|
33
33
|
each: settingProperties,
|
|
34
34
|
line: true,
|
|
35
35
|
children: parameter => _$createComponent(ts.InterfaceMember, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginated-operation-handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/paginated-operation-handler.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paginated-operation-handler.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/paginated-operation-handler.tsx"],"names":[],"mappings":"AA2BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,eAAO,MAAM,yBAAyB,EAAE,gBAkEvC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { code, List, refkey } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import { useTsp } from "@typespec/emitter-framework";
|
|
5
5
|
import { FunctionDeclaration } from "@typespec/emitter-framework/typescript";
|
|
@@ -37,20 +37,20 @@ export const PaginatedOperationHandler = {
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
const pagingOperation = $.operation.getPagingMetadata(httpOperation.operation);
|
|
40
|
-
const responseRefkey =
|
|
41
|
-
const operationRefkey =
|
|
42
|
-
const returnType =
|
|
40
|
+
const responseRefkey = refkey(httpOperation, "http-response");
|
|
41
|
+
const operationRefkey = refkey(httpOperation.operation);
|
|
42
|
+
const returnType = code`${getPagedAsyncIterableIteratorRefkey()}<${getPageItemTypeName(pagingOperation)},${getPageResponseTypeRefkey(httpOperation)},${getPageSettingsTypeRefkey(httpOperation)}>`;
|
|
43
43
|
const clientContextInterfaceRef = getClientcontextDeclarationRef(client);
|
|
44
|
-
const optionsRefkey =
|
|
44
|
+
const optionsRefkey = refkey();
|
|
45
45
|
const signatureParams = [{
|
|
46
46
|
name: "client",
|
|
47
47
|
type: clientContextInterfaceRef,
|
|
48
|
-
refkey:
|
|
48
|
+
refkey: refkey(client, "paging-operation-client-param")
|
|
49
49
|
}, ...getOperationParameters(httpOperation, optionsRefkey)];
|
|
50
50
|
const pagingDetail = extractPagingDetail(httpOperation, pagingOperation);
|
|
51
51
|
// Exclude from operation options and include them into PageSettings
|
|
52
52
|
const excludes = getPageSettingProperties(pagingOperation).map(p => p.property);
|
|
53
|
-
return _$createComponent(
|
|
53
|
+
return _$createComponent(List, {
|
|
54
54
|
get children() {
|
|
55
55
|
return [_$createComponent(OperationOptionsDeclaration, {
|
|
56
56
|
operation: httpOperation,
|
|
@@ -77,7 +77,7 @@ export const PaginatedOperationHandler = {
|
|
|
77
77
|
parametersMode: "replace",
|
|
78
78
|
parameters: signatureParams,
|
|
79
79
|
get children() {
|
|
80
|
-
return _$createComponent(
|
|
80
|
+
return _$createComponent(List, {
|
|
81
81
|
get children() {
|
|
82
82
|
return [_$createComponent(GetElements, {
|
|
83
83
|
httpOperation: httpOperation,
|
|
@@ -86,7 +86,7 @@ export const PaginatedOperationHandler = {
|
|
|
86
86
|
httpOperation: httpOperation,
|
|
87
87
|
pageDetail: pagingDetail,
|
|
88
88
|
operationParams: signatureParams
|
|
89
|
-
}), [_$memo(() =>
|
|
89
|
+
}), [_$memo(() => code`
|
|
90
90
|
return ${getBuildPagedAsyncIteratorRefkey}<${getPageItemTypeName(pagingOperation)}, ${getPageResponseTypeRefkey(httpOperation)}, ${getPageSettingsTypeRefkey(httpOperation)}>({${getElementsRefkey(httpOperation)}, ${getPagedResponseFunctionRefkey(httpOperation)}});`)]];
|
|
91
91
|
}
|
|
92
92
|
});
|
|
@@ -97,7 +97,7 @@ export const PaginatedOperationHandler = {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
function getPagedResponseFunctionRefkey(httpOperation) {
|
|
100
|
-
return
|
|
100
|
+
return refkey(httpOperation, "get-paged-response");
|
|
101
101
|
}
|
|
102
102
|
function GetPagedResponse(props) {
|
|
103
103
|
const pagingDetail = props.pageDetail;
|
|
@@ -106,12 +106,12 @@ function GetPagedResponse(props) {
|
|
|
106
106
|
name: "nextToken",
|
|
107
107
|
type: "string",
|
|
108
108
|
optional: true,
|
|
109
|
-
refkey:
|
|
109
|
+
refkey: refkey()
|
|
110
110
|
}, {
|
|
111
111
|
name: "settings",
|
|
112
112
|
type: getPageSettingsTypeRefkey(httpOperation),
|
|
113
113
|
optional: true,
|
|
114
|
-
refkey:
|
|
114
|
+
refkey: refkey()
|
|
115
115
|
}];
|
|
116
116
|
// TODO: template can't resolve the ref key so fallback to useTSNamePolicy
|
|
117
117
|
const namePolicy = ts.useTSNamePolicy();
|
|
@@ -125,7 +125,7 @@ function GetPagedResponse(props) {
|
|
|
125
125
|
},
|
|
126
126
|
parameters: params,
|
|
127
127
|
get children() {
|
|
128
|
-
return
|
|
128
|
+
return code`
|
|
129
129
|
${props.pageDetail.pattern === "nextLink" ? `
|
|
130
130
|
let response: PathUncheckedResponse;
|
|
131
131
|
if (nextToken) {
|
|
@@ -150,7 +150,7 @@ function GetPagedResponse(props) {
|
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function getElementsRefkey(httpOperation) {
|
|
153
|
-
return
|
|
153
|
+
return refkey(httpOperation, "get-elements");
|
|
154
154
|
}
|
|
155
155
|
function GetElements(props) {
|
|
156
156
|
const pagingDetail = props.pageDetail;
|
|
@@ -158,7 +158,7 @@ function GetElements(props) {
|
|
|
158
158
|
const params = [{
|
|
159
159
|
name: "response",
|
|
160
160
|
type: getPageResponseTypeRefkey(httpOperation),
|
|
161
|
-
refkey:
|
|
161
|
+
refkey: refkey()
|
|
162
162
|
}];
|
|
163
163
|
return _$createComponent(FunctionDeclaration, {
|
|
164
164
|
name: "getElements",
|
|
@@ -167,7 +167,7 @@ function GetElements(props) {
|
|
|
167
167
|
},
|
|
168
168
|
parameters: params,
|
|
169
169
|
get children() {
|
|
170
|
-
return
|
|
170
|
+
return code`
|
|
171
171
|
return response.${pagingDetail.output.items};
|
|
172
172
|
`;
|
|
173
173
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as ay from "@alloy-js/core";
|
|
2
1
|
import { Refkey } from "@alloy-js/core";
|
|
3
2
|
import * as ts from "@alloy-js/typescript";
|
|
4
3
|
import { HttpOperation } from "@typespec/http";
|
|
@@ -6,7 +5,7 @@ export interface HttpRequestSendProps {
|
|
|
6
5
|
httpOperation: HttpOperation;
|
|
7
6
|
responseRefkey?: Refkey;
|
|
8
7
|
}
|
|
9
|
-
export declare function getHttpRequestSendRefkey(httpOperation: HttpOperation):
|
|
8
|
+
export declare function getHttpRequestSendRefkey(httpOperation: HttpOperation): Refkey;
|
|
10
9
|
export declare function getHttpRequestSendParams(httpOperation: HttpOperation): ts.ParameterDescriptor[];
|
|
11
|
-
export declare function HttpRequestSend(props: HttpRequestSendProps):
|
|
10
|
+
export declare function HttpRequestSend(props: HttpRequestSendProps): import("@alloy-js/core").Children;
|
|
12
11
|
//# sourceMappingURL=request-send.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-send.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/request-send.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"request-send.d.ts","sourceRoot":"","sources":["../../../../../src/components/operation-handlers/paging/request-send.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAA+B,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,aAAa,UAEpE;AAMD,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,aAAa,4BAsBpE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qCAmC1D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import * as ay from "@alloy-js/core";
|
|
3
2
|
import { List, StatementList, code, refkey } from "@alloy-js/core";
|
|
4
3
|
import * as ts from "@alloy-js/typescript";
|
|
5
4
|
import { Reference } from "@alloy-js/typescript";
|
|
@@ -23,7 +22,7 @@ export function getHttpRequestSendParams(httpOperation) {
|
|
|
23
22
|
const signatureParams = [{
|
|
24
23
|
name: "client",
|
|
25
24
|
type: clientContextInterfaceRef,
|
|
26
|
-
refkey:
|
|
25
|
+
refkey: refkey(client, "send-client-param")
|
|
27
26
|
}, ...getOperationParameters(httpOperation, optionsRefkey)];
|
|
28
27
|
const parameters = [...signatureParams];
|
|
29
28
|
// re-correct the `options` parameter to Record<string, any> to accept both paging and non-paging options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/operation-handlers/types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/operation-handlers/types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC;IAE7C;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,aAAa,GAAG,QAAQ,CAAC;CAC5C;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as ay from "@alloy-js/core";
|
|
2
1
|
import { ModelProperty } from "@typespec/compiler";
|
|
3
2
|
import { HttpOperation } from "@typespec/http";
|
|
4
3
|
export interface OperationOptionsProps {
|
|
5
4
|
operation: HttpOperation;
|
|
6
5
|
excludes?: ModelProperty[];
|
|
7
6
|
}
|
|
8
|
-
export declare function getOperationOptionsTypeRefkey(operation: HttpOperation):
|
|
9
|
-
export declare function OperationOptionsDeclaration(props: OperationOptionsProps):
|
|
7
|
+
export declare function getOperationOptionsTypeRefkey(operation: HttpOperation): import("@alloy-js/core").Refkey;
|
|
8
|
+
export declare function OperationOptionsDeclaration(props: OperationOptionsProps): import("@alloy-js/core").Children;
|
|
10
9
|
//# sourceMappingURL=operation-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-options.d.ts","sourceRoot":"","sources":["../../../src/components/operation-options.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operation-options.d.ts","sourceRoot":"","sources":["../../../src/components/operation-options.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,aAAa,mCAErE;AACD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,qBAAqB,qCA0BvE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { For, refkey } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
5
5
|
import { hasDefaultValue } from "../utils/parameters.js";
|
|
6
6
|
import { getOperationOptionsInterfaceRefkey } from "./static-helpers/interfaces.js";
|
|
7
7
|
export function getOperationOptionsTypeRefkey(operation) {
|
|
8
|
-
return
|
|
8
|
+
return refkey(operation, "operation-options");
|
|
9
9
|
}
|
|
10
10
|
export function OperationOptionsDeclaration(props) {
|
|
11
11
|
const namePolicy = ts.useTSNamePolicy();
|
|
@@ -22,7 +22,7 @@ export function OperationOptionsDeclaration(props) {
|
|
|
22
22
|
return getOperationOptionsTypeRefkey(props.operation);
|
|
23
23
|
},
|
|
24
24
|
get children() {
|
|
25
|
-
return _$createComponent(
|
|
25
|
+
return _$createComponent(For, {
|
|
26
26
|
each: optionalParameters,
|
|
27
27
|
line: true,
|
|
28
28
|
children: parameter => _$createComponent(ts.InterfaceMember, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Refkey } from "@alloy-js/core";
|
|
2
2
|
import * as ts from "@alloy-js/typescript";
|
|
3
3
|
import { HttpOperation } from "@typespec/http";
|
|
4
4
|
export interface OperationParametersProps {
|
|
5
5
|
operation: HttpOperation;
|
|
6
6
|
}
|
|
7
|
-
export declare function getOperationParameters(operation: HttpOperation, optionsRefkey:
|
|
7
|
+
export declare function getOperationParameters(operation: HttpOperation, optionsRefkey: Refkey): ts.ParameterDescriptor[];
|
|
8
8
|
//# sourceMappingURL=operation-parameters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-parameters.d.ts","sourceRoot":"","sources":["../../../src/components/operation-parameters.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"operation-parameters.d.ts","sourceRoot":"","sources":["../../../src/components/operation-parameters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,aAAa,EACxB,aAAa,EAAE,MAAM,GACpB,EAAE,CAAC,mBAAmB,EAAE,CA2B1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { refkey } from "@alloy-js/core";
|
|
3
3
|
import { useTransformNamePolicy } from "@typespec/emitter-framework";
|
|
4
4
|
import * as ef from "@typespec/emitter-framework/typescript";
|
|
5
5
|
import { hasDefaultValue } from "../utils/parameters.js";
|
|
@@ -12,7 +12,7 @@ export function getOperationParameters(operation, optionsRefkey) {
|
|
|
12
12
|
const name = transformNamer.getApplicationName(parameter.property);
|
|
13
13
|
const parameterDescriptor = {
|
|
14
14
|
name,
|
|
15
|
-
refkey:
|
|
15
|
+
refkey: refkey(),
|
|
16
16
|
type: _$createComponent(ef.TypeExpression, {
|
|
17
17
|
get type() {
|
|
18
18
|
return parameter.property.type;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
2
2
|
import { Program } from "@typespec/compiler";
|
|
3
3
|
export interface OutputProps {
|
|
4
|
-
children?:
|
|
4
|
+
children?: Children;
|
|
5
5
|
program: Program;
|
|
6
6
|
}
|
|
7
|
-
export declare function Output(props: OutputProps):
|
|
7
|
+
export declare function Output(props: OutputProps): Children;
|
|
8
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,
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/components/output.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAQ7C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,YAgBxC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
1
|
+
import { Refkey } from "@alloy-js/core";
|
|
2
|
+
import { Children } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
export declare function getEncodeUint8ArrayRef(): Refkey;
|
|
4
|
+
export declare function EncodeUint8Array(): Children;
|
|
5
|
+
export declare function getDecodeUint8ArrayRef(): Refkey;
|
|
6
|
+
export declare function DecodeBase64(): Children;
|
|
6
7
|
//# sourceMappingURL=bytes-encoding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytes-encoding.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/bytes-encoding.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"bytes-encoding.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/bytes-encoding.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAU,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAGtD,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,wBAAgB,gBAAgB,IAAI,QAAQ,CAuB3C;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AACD,wBAAgB,YAAY,IAAI,QAAQ,CAuBvC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { code, refkey } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
export function getEncodeUint8ArrayRef() {
|
|
5
|
-
return
|
|
5
|
+
return refkey("encodeUint8Array");
|
|
6
6
|
}
|
|
7
7
|
export function EncodeUint8Array() {
|
|
8
|
-
const valueRef =
|
|
9
|
-
const encodingRef =
|
|
10
|
-
const
|
|
8
|
+
const valueRef = refkey();
|
|
9
|
+
const encodingRef = refkey();
|
|
10
|
+
const key = getEncodeUint8ArrayRef();
|
|
11
11
|
return _$createComponent(ts.FunctionDeclaration, {
|
|
12
12
|
"export": true,
|
|
13
|
-
refkey:
|
|
13
|
+
refkey: key,
|
|
14
14
|
name: "encodeUint8Array",
|
|
15
15
|
parameters: [{
|
|
16
16
|
name: "value",
|
|
@@ -22,22 +22,20 @@ export function EncodeUint8Array() {
|
|
|
22
22
|
refkey: encodingRef
|
|
23
23
|
}],
|
|
24
24
|
returnType: "string | undefined",
|
|
25
|
-
|
|
26
|
-
return ay.code`
|
|
25
|
+
children: code`
|
|
27
26
|
if (!${valueRef}) {
|
|
28
27
|
return ${valueRef} as any;
|
|
29
28
|
}
|
|
30
29
|
return Buffer.from(${valueRef}).toString(${encodingRef});
|
|
31
|
-
|
|
32
|
-
}
|
|
30
|
+
`
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
33
|
export function getDecodeUint8ArrayRef() {
|
|
36
|
-
return
|
|
34
|
+
return refkey("decodeUint8Array");
|
|
37
35
|
}
|
|
38
36
|
export function DecodeBase64() {
|
|
39
|
-
const
|
|
40
|
-
const valueRef =
|
|
37
|
+
const key = getDecodeUint8ArrayRef();
|
|
38
|
+
const valueRef = refkey();
|
|
41
39
|
return _$createComponent(ts.FunctionDeclaration, {
|
|
42
40
|
"export": true,
|
|
43
41
|
name: "decodeBase64",
|
|
@@ -47,9 +45,8 @@ export function DecodeBase64() {
|
|
|
47
45
|
refkey: valueRef
|
|
48
46
|
}],
|
|
49
47
|
returnType: "Uint8Array | undefined",
|
|
50
|
-
refkey:
|
|
51
|
-
|
|
52
|
-
return ay.code`
|
|
48
|
+
refkey: key,
|
|
49
|
+
children: code`
|
|
53
50
|
if(!${valueRef}) {
|
|
54
51
|
return ${valueRef} as any;
|
|
55
52
|
}
|
|
@@ -58,7 +55,6 @@ export function DecodeBase64() {
|
|
|
58
55
|
.padEnd(${valueRef}.length + (4 - (${valueRef}.length % 4)) % 4, '=');
|
|
59
56
|
|
|
60
57
|
return new Uint8Array(Buffer.from(base64, 'base64'));
|
|
61
|
-
|
|
62
|
-
}
|
|
58
|
+
`
|
|
63
59
|
});
|
|
64
60
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function Interfaces(): ay.Children;
|
|
1
|
+
export declare function getOperationOptionsInterfaceRefkey(): import("@alloy-js/core").Refkey;
|
|
2
|
+
export declare function OperationOptionsInterfaceDeclaration(): import("@alloy-js/core").Children;
|
|
3
|
+
export declare function Interfaces(): import("@alloy-js/core").Children;
|
|
5
4
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/interfaces.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/components/static-helpers/interfaces.tsx"],"names":[],"mappings":"AAIA,wBAAgB,kCAAkC,oCAEjD;AAED,wBAAgB,oCAAoC,sCAcnD;AAED,wBAAgB,UAAU,sCAMzB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { code, refkey } from "@alloy-js/core";
|
|
3
3
|
import * as ts from "@alloy-js/typescript";
|
|
4
4
|
import { httpRuntimeTemplateLib } from "../external-packages/ts-http-runtime.js";
|
|
5
5
|
export function getOperationOptionsInterfaceRefkey() {
|
|
6
|
-
return
|
|
6
|
+
return refkey("OperationOptions", "interface");
|
|
7
7
|
}
|
|
8
8
|
export function OperationOptionsInterfaceDeclaration() {
|
|
9
9
|
const declarationRefkey = getOperationOptionsInterfaceRefkey();
|
|
10
|
-
const onResponseCallback =
|
|
10
|
+
const onResponseCallback = code`(rawResponse: ${httpRuntimeTemplateLib.PathUncheckedResponse}) => void`;
|
|
11
11
|
const operationOptions = _$createComponent(ts.InterfaceExpression, {
|
|
12
12
|
get children() {
|
|
13
13
|
return _$createComponent(ts.InterfaceMember, {
|