@@ -934,7 +934,9 @@ import {
934
934
TestWithEmptyResponseT,
935
935
testWithEmptyResponseDefaultDecoder,
936
936
TestParamWithSchemaRefT,
937
- testParamWithSchemaRefDefaultDecoder
937
+ testParamWithSchemaRefDefaultDecoder,
938
+ TestHeaderWithSchemaRefT,
939
+ testHeaderWithSchemaRefDefaultDecoder
938
940
} from \\"./requestTypes\\";
939
941
940
942
// This is a placeholder for undefined when dealing with object keys
@@ -960,7 +962,8 @@ export type ApiOperation = TypeofApiCall<TestAuthBearerT> &
960
962
TypeofApiCall<TestSimplePatchT> &
961
963
TypeofApiCall<TestCustomTokenHeaderT> &
962
964
TypeofApiCall<TestWithEmptyResponseT> &
963
- TypeofApiCall<TestParamWithSchemaRefT>;
965
+ TypeofApiCall<TestParamWithSchemaRefT> &
966
+ TypeofApiCall<TestHeaderWithSchemaRefT>;
964
967
965
968
export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
966
969
TypeofApiParams<TestSimpleTokenT> &
@@ -979,7 +982,8 @@ export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
979
982
TypeofApiParams<TestSimplePatchT> &
980
983
TypeofApiParams<TestCustomTokenHeaderT> &
981
984
TypeofApiParams<TestWithEmptyResponseT> &
982
- TypeofApiParams<TestParamWithSchemaRefT>);
985
+ TypeofApiParams<TestParamWithSchemaRefT> &
986
+ TypeofApiParams<TestHeaderWithSchemaRefT>);
983
987
984
988
/**
985
989
* Defines an adapter for TypeofApiCall which omit one or more parameters in the signature
@@ -1020,7 +1024,8 @@ export type WithDefaultsT<
1020
1024
| TestSimplePatchT
1021
1025
| TestCustomTokenHeaderT
1022
1026
| TestWithEmptyResponseT
1023
- | TestParamWithSchemaRefT,
1027
+ | TestParamWithSchemaRefT
1028
+ | TestHeaderWithSchemaRefT,
1024
1029
K
1025
1030
>;
1026
1031
@@ -1077,6 +1082,8 @@ export type Client<
1077
1082
readonly testWithEmptyResponse: TypeofApiCall<TestWithEmptyResponseT>;
1078
1083
1079
1084
readonly testParamWithSchemaRef: TypeofApiCall<TestParamWithSchemaRefT>;
1085
+
1086
+ readonly testHeaderWithSchemaRef: TypeofApiCall<TestHeaderWithSchemaRefT>;
1080
1087
}
1081
1088
: {
1082
1089
readonly testAuthBearer: TypeofApiCall<
@@ -1204,6 +1211,13 @@ export type Client<
1204
1211
Omit<RequestParams<TestParamWithSchemaRefT>, K>
1205
1212
>
1206
1213
>;
1214
+
1215
+ readonly testHeaderWithSchemaRef: TypeofApiCall<
1216
+ ReplaceRequestParams<
1217
+ TestHeaderWithSchemaRefT,
1218
+ Omit<RequestParams<TestHeaderWithSchemaRefT>, K>
1219
+ >
1220
+ >;
1207
1221
};
1208
1222
1209
1223
/**
@@ -1253,7 +1267,7 @@ export function createClient<K extends ParamKeys>({
1253
1267
> = {
1254
1268
method: \\"get\\",
1255
1269
1256
- headers: ({ [\\"bearerToken\\"]: bearerToken }: { bearerToken: string } ) => ({
1270
+ headers: ({ [\\"bearerToken\\"]: bearerToken }) => ({
1257
1271
Authorization: \`Bearer \${bearerToken}\`
1258
1272
}),
1259
1273
response_decoder: testAuthBearerDefaultDecoder(),
@@ -1273,7 +1287,7 @@ export function createClient<K extends ParamKeys>({
1273
1287
> = {
1274
1288
method: \\"get\\",
1275
1289
1276
- headers: ({ [\\"simpleToken\\"]: simpleToken }: { simpleToken: string } ) => ({
1290
+ headers: ({ [\\"simpleToken\\"]: simpleToken }) => ({
1277
1291
\\"X-Functions-Key\\": simpleToken
1278
1292
}),
1279
1293
response_decoder: testSimpleTokenDefaultDecoder(),
@@ -1466,9 +1480,6 @@ export function createClient<K extends ParamKeys>({
1466
1480
headers: ({
1467
1481
[\\"headerInlineParam\\"]: headerInlineParam,
1468
1482
[\\"x-header-param\\"]: xHeaderParam
1469
- }: {
1470
- headerInlineParam: string;
1471
- \\"x-header-param\\": string;
1472
1483
}) => ({
1473
1484
headerInlineParam: headerInlineParam,
1474
1485
@@ -1495,9 +1506,6 @@ export function createClient<K extends ParamKeys>({
1495
1506
headers: ({
1496
1507
[\\"headerInlineParam\\"]: headerInlineParam,
1497
1508
[\\"x-header-param\\"]: xHeaderParam
1498
- }: {
1499
- headerInlineParam: string;
1500
- \\"x-header-param\\": string;
1501
1509
}) => ({
1502
1510
headerInlineParam: headerInlineParam,
1503
1511
@@ -1580,7 +1588,7 @@ export function createClient<K extends ParamKeys>({
1580
1588
> = {
1581
1589
method: \\"get\\",
1582
1590
1583
- headers: ({ [\\"customToken\\"]: customToken }: { customToken: string } ) => ({
1591
+ headers: ({ [\\"customToken\\"]: customToken }) => ({
1584
1592
\\"custom-token\\": customToken
1585
1593
}),
1586
1594
response_decoder: testCustomTokenHeaderDefaultDecoder(),
@@ -1630,6 +1638,25 @@ export function createClient<K extends ParamKeys>({
1630
1638
options
1631
1639
);
1632
1640
1641
+ const testHeaderWithSchemaRefT: ReplaceRequestParams<
1642
+ TestHeaderWithSchemaRefT,
1643
+ RequestParams<TestHeaderWithSchemaRefT>
1644
+ > = {
1645
+ method: \\"get\\",
1646
+
1647
+ headers: ({ [\\"param\\"]: param }) => ({
1648
+ param: param
1649
+ }),
1650
+ response_decoder: testHeaderWithSchemaRefDefaultDecoder(),
1651
+ url: ({}) => \`\${basePath}/test-header-with-schema-ref\`,
1652
+
1653
+ query: () => withoutUndefinedValues({})
1654
+ };
1655
+ const testHeaderWithSchemaRef: TypeofApiCall<TestHeaderWithSchemaRefT> = createFetchRequestForApi(
1656
+ testHeaderWithSchemaRefT,
1657
+ options
1658
+ );
1659
+
1633
1660
return {
1634
1661
testAuthBearer: (withDefaults || identity)(testAuthBearer),
1635
1662
testSimpleToken: (withDefaults || identity)(testSimpleToken),
@@ -1658,7 +1685,8 @@ export function createClient<K extends ParamKeys>({
1658
1685
testSimplePatch: (withDefaults || identity)(testSimplePatch),
1659
1686
testCustomTokenHeader: (withDefaults || identity)(testCustomTokenHeader),
1660
1687
testWithEmptyResponse: (withDefaults || identity)(testWithEmptyResponse),
1661
- testParamWithSchemaRef: (withDefaults || identity)(testParamWithSchemaRef)
1688
+ testParamWithSchemaRef: (withDefaults || identity)(testParamWithSchemaRef),
1689
+ testHeaderWithSchemaRef: (withDefaults || identity)(testHeaderWithSchemaRef)
1662
1690
};
1663
1691
}
1664
1692
"
@@ -2732,7 +2760,9 @@ import {
2732
2760
TestWithEmptyResponseT,
2733
2761
testWithEmptyResponseDefaultDecoder,
2734
2762
TestParamWithSchemaRefT,
2735
- testParamWithSchemaRefDefaultDecoder
2763
+ testParamWithSchemaRefDefaultDecoder,
2764
+ TestHeaderWithSchemaRefT,
2765
+ testHeaderWithSchemaRefDefaultDecoder
2736
2766
} from \\"./requestTypes\\";
2737
2767
2738
2768
// This is a placeholder for undefined when dealing with object keys
@@ -2759,7 +2789,8 @@ export type ApiOperation = TypeofApiCall<TestAuthBearerT> &
2759
2789
TypeofApiCall<TestSimplePatchT> &
2760
2790
TypeofApiCall<TestCustomTokenHeaderT> &
2761
2791
TypeofApiCall<TestWithEmptyResponseT> &
2762
- TypeofApiCall<TestParamWithSchemaRefT>;
2792
+ TypeofApiCall<TestParamWithSchemaRefT> &
2793
+ TypeofApiCall<TestHeaderWithSchemaRefT>;
2763
2794
2764
2795
export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
2765
2796
TypeofApiParams<TestAuthBearerHttpT> &
@@ -2779,7 +2810,8 @@ export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
2779
2810
TypeofApiParams<TestSimplePatchT> &
2780
2811
TypeofApiParams<TestCustomTokenHeaderT> &
2781
2812
TypeofApiParams<TestWithEmptyResponseT> &
2782
- TypeofApiParams<TestParamWithSchemaRefT>);
2813
+ TypeofApiParams<TestParamWithSchemaRefT> &
2814
+ TypeofApiParams<TestHeaderWithSchemaRefT>);
2783
2815
2784
2816
/**
2785
2817
* Defines an adapter for TypeofApiCall which omit one or more parameters in the signature
@@ -2821,7 +2853,8 @@ export type WithDefaultsT<
2821
2853
| TestSimplePatchT
2822
2854
| TestCustomTokenHeaderT
2823
2855
| TestWithEmptyResponseT
2824
- | TestParamWithSchemaRefT,
2856
+ | TestParamWithSchemaRefT
2857
+ | TestHeaderWithSchemaRefT,
2825
2858
K
2826
2859
>;
2827
2860
@@ -2880,6 +2913,8 @@ export type Client<
2880
2913
readonly testWithEmptyResponse: TypeofApiCall<TestWithEmptyResponseT>;
2881
2914
2882
2915
readonly testParamWithSchemaRef: TypeofApiCall<TestParamWithSchemaRefT>;
2916
+
2917
+ readonly testHeaderWithSchemaRef: TypeofApiCall<TestHeaderWithSchemaRefT>;
2883
2918
}
2884
2919
: {
2885
2920
readonly testAuthBearer: TypeofApiCall<
@@ -3014,6 +3049,13 @@ export type Client<
3014
3049
Omit<RequestParams<TestParamWithSchemaRefT>, K>
3015
3050
>
3016
3051
>;
3052
+
3053
+ readonly testHeaderWithSchemaRef: TypeofApiCall<
3054
+ ReplaceRequestParams<
3055
+ TestHeaderWithSchemaRefT,
3056
+ Omit<RequestParams<TestHeaderWithSchemaRefT>, K>
3057
+ >
3058
+ >;
3017
3059
};
3018
3060
3019
3061
/**
@@ -3063,7 +3105,7 @@ export function createClient<K extends ParamKeys>({
3063
3105
> = {
3064
3106
method: \\"get\\",
3065
3107
3066
- headers: ({ [\\"bearerToken\\"]: bearerToken }: { bearerToken: string } ) => ({
3108
+ headers: ({ [\\"bearerToken\\"]: bearerToken }) => ({
3067
3109
Authorization: \`Bearer \${bearerToken}\`
3068
3110
}),
3069
3111
response_decoder: testAuthBearerDefaultDecoder(),
@@ -3083,11 +3125,7 @@ export function createClient<K extends ParamKeys>({
3083
3125
> = {
3084
3126
method: \\"get\\",
3085
3127
3086
- headers: ({
3087
- [\\"bearerTokenHttp\\"]: bearerTokenHttp
3088
- }: {
3089
- bearerTokenHttp: string;
3090
- }) => ({
3128
+ headers: ({ [\\"bearerTokenHttp\\"]: bearerTokenHttp }) => ({
3091
3129
Authorization: \`Bearer \${bearerTokenHttp}\`
3092
3130
}),
3093
3131
response_decoder: testAuthBearerHttpDefaultDecoder(),
@@ -3107,7 +3145,7 @@ export function createClient<K extends ParamKeys>({
3107
3145
> = {
3108
3146
method: \\"get\\",
3109
3147
3110
- headers: ({ [\\"simpleToken\\"]: simpleToken }: { simpleToken: string } ) => ({
3148
+ headers: ({ [\\"simpleToken\\"]: simpleToken }) => ({
3111
3149
\\"X-Functions-Key\\": simpleToken
3112
3150
}),
3113
3151
response_decoder: testSimpleTokenDefaultDecoder(),
@@ -3310,9 +3348,6 @@ export function createClient<K extends ParamKeys>({
3310
3348
headers: ({
3311
3349
[\\"headerInlineParam\\"]: headerInlineParam,
3312
3350
[\\"x-header-param\\"]: xHeaderParam
3313
- }: {
3314
- headerInlineParam: string;
3315
- \\"x-header-param\\": string;
3316
3351
}) => ({
3317
3352
headerInlineParam: headerInlineParam,
3318
3353
@@ -3339,9 +3374,6 @@ export function createClient<K extends ParamKeys>({
3339
3374
headers: ({
3340
3375
[\\"headerInlineParam\\"]: headerInlineParam,
3341
3376
[\\"x-header-param\\"]: xHeaderParam
3342
- }: {
3343
- headerInlineParam: string;
3344
- \\"x-header-param\\": string;
3345
3377
}) => ({
3346
3378
headerInlineParam: headerInlineParam,
3347
3379
@@ -3424,7 +3456,7 @@ export function createClient<K extends ParamKeys>({
3424
3456
> = {
3425
3457
method: \\"get\\",
3426
3458
3427
- headers: ({ [\\"customToken\\"]: customToken }: { customToken: string } ) => ({
3459
+ headers: ({ [\\"customToken\\"]: customToken }) => ({
3428
3460
\\"custom-token\\": customToken
3429
3461
}),
3430
3462
response_decoder: testCustomTokenHeaderDefaultDecoder(),
@@ -3474,6 +3506,25 @@ export function createClient<K extends ParamKeys>({
3474
3506
options
3475
3507
);
3476
3508
3509
+ const testHeaderWithSchemaRefT: ReplaceRequestParams<
3510
+ TestHeaderWithSchemaRefT,
3511
+ RequestParams<TestHeaderWithSchemaRefT>
3512
+ > = {
3513
+ method: \\"get\\",
3514
+
3515
+ headers: ({ [\\"param\\"]: param }) => ({
3516
+ param: param
3517
+ }),
3518
+ response_decoder: testHeaderWithSchemaRefDefaultDecoder(),
3519
+ url: ({}) => \`\${basePath}/test-header-with-schema-ref\`,
3520
+
3521
+ query: () => withoutUndefinedValues({})
3522
+ };
3523
+ const testHeaderWithSchemaRef: TypeofApiCall<TestHeaderWithSchemaRefT> = createFetchRequestForApi(
3524
+ testHeaderWithSchemaRefT,
3525
+ options
3526
+ );
3527
+
3477
3528
return {
3478
3529
testAuthBearer: (withDefaults || identity)(testAuthBearer),
3479
3530
testAuthBearerHttp: (withDefaults || identity)(testAuthBearerHttp),
@@ -3503,7 +3554,8 @@ export function createClient<K extends ParamKeys>({
3503
3554
testSimplePatch: (withDefaults || identity)(testSimplePatch),
3504
3555
testCustomTokenHeader: (withDefaults || identity)(testCustomTokenHeader),
3505
3556
testWithEmptyResponse: (withDefaults || identity)(testWithEmptyResponse),
3506
- testParamWithSchemaRef: (withDefaults || identity)(testParamWithSchemaRef)
3557
+ testParamWithSchemaRef: (withDefaults || identity)(testParamWithSchemaRef),
3558
+ testHeaderWithSchemaRef: (withDefaults || identity)(testHeaderWithSchemaRef)
3507
3559
};
3508
3560
}
3509
3561
"
0 commit comments