@tuyau/core 1.1.0 → 1.2.0
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.
|
@@ -53,8 +53,11 @@ var RegistryGenerator = class {
|
|
|
53
53
|
* the TS type string and tuple representation.
|
|
54
54
|
*/
|
|
55
55
|
#generateRouteParams(route) {
|
|
56
|
-
const dynamicParams = route.tokens.filter((token) => token.type === 1);
|
|
57
|
-
const paramsType = dynamicParams.map((token) =>
|
|
56
|
+
const dynamicParams = route.tokens.filter((token) => token.type === 1 || token.type === 2);
|
|
57
|
+
const paramsType = dynamicParams.map((token) => {
|
|
58
|
+
if (token.type === 2) return "'*': ParamValue[]";
|
|
59
|
+
return `${token.val}: ParamValue`;
|
|
60
|
+
}).join("; ");
|
|
58
61
|
const paramsTuple = dynamicParams.map(() => "ParamValue").join(", ");
|
|
59
62
|
return { paramsType, paramsTuple };
|
|
60
63
|
}
|
package/build/client/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UrlFor } from '@adonisjs/http-server/client/url_builder';
|
|
2
|
-
import { T as TuyauRegistry, a as TuyauConfiguration, A as AdonisEndpoint, I as InferRoutes, b as TransformApiDefinition, c as InferTree, R as RegistryGroupedByMethod, P as PatternsByMethod, d as RequestArgs, E as EndpointByMethodPattern, e as TuyauPromise, f as ErrorResponseOf, S as StrKeys, M as Method, C as CurrentRouteOptions } from '../index-
|
|
3
|
-
export { g as TuyauError, h as TuyauHTTPError, i as TuyauNetworkError } from '../index-
|
|
2
|
+
import { T as TuyauRegistry, a as TuyauConfiguration, A as AdonisEndpoint, I as InferRoutes, b as TransformApiDefinition, c as InferTree, R as RegistryGroupedByMethod, P as PatternsByMethod, d as RequestArgs, E as EndpointByMethodPattern, e as TuyauPromise, f as ErrorResponseOf, S as StrKeys, M as Method, C as CurrentRouteOptions } from '../index-SVztBh2W.js';
|
|
3
|
+
export { g as TuyauError, h as TuyauHTTPError, i as TuyauNetworkError } from '../index-SVztBh2W.js';
|
|
4
4
|
import 'ky';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AdonisEndpoint, q as AdonisRegistry, B as BaseRequestOptions, C as CurrentRouteOptions, E as EndpointByMethodPattern, s as EndpointByName, x as EndpointFn, j as EndpointTypes, r as Endpoints, y as EndpointsByMethod, f as ErrorResponseOf, n as ExtractBody, p as ExtractErrorResponse, l as ExtractQuery, m as ExtractQueryForGet, o as ExtractResponse, I as InferRoutes, c as InferTree, N as KnownStatuses, F as MaybeArray, M as Method, K as Path, H as PathWithRegistry, P as PatternsByMethod, Q as QueryParameters, v as RawRequestArgs, z as RegValues, R as RegistryGroupedByMethod, d as RequestArgs, w as ResponseOf, t as ResponseType, L as Route, J as RouteWithRegistry, k as SchemaEndpoint, S as StrKeys, b as TransformApiDefinition, a as TuyauConfiguration, D as TuyauPlugin, T as TuyauRegistry, u as TuyauRequestOptions, U as UnionToIntersection, G as UserRegistry, V as ValueOf } from '../../index-
|
|
1
|
+
export { A as AdonisEndpoint, q as AdonisRegistry, B as BaseRequestOptions, C as CurrentRouteOptions, E as EndpointByMethodPattern, s as EndpointByName, x as EndpointFn, j as EndpointTypes, r as Endpoints, y as EndpointsByMethod, f as ErrorResponseOf, n as ExtractBody, p as ExtractErrorResponse, l as ExtractQuery, m as ExtractQueryForGet, o as ExtractResponse, I as InferRoutes, c as InferTree, N as KnownStatuses, F as MaybeArray, M as Method, K as Path, H as PathWithRegistry, P as PatternsByMethod, Q as QueryParameters, v as RawRequestArgs, z as RegValues, R as RegistryGroupedByMethod, d as RequestArgs, w as ResponseOf, t as ResponseType, L as Route, J as RouteWithRegistry, k as SchemaEndpoint, S as StrKeys, b as TransformApiDefinition, a as TuyauConfiguration, D as TuyauPlugin, T as TuyauRegistry, u as TuyauRequestOptions, U as UnionToIntersection, G as UserRegistry, V as ValueOf } from '../../index-SVztBh2W.js';
|
|
2
2
|
import 'ky';
|
|
3
3
|
import '@adonisjs/http-server/client/url_builder';
|
|
@@ -17,7 +17,7 @@ interface CurrentRouteOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
interface EndpointTypes {
|
|
19
19
|
paramsTuple: [...any[]];
|
|
20
|
-
params: Record<string, string | number | boolean | bigint>;
|
|
20
|
+
params: Record<string, string | number | boolean | bigint | (string | number | boolean | bigint)[]>;
|
|
21
21
|
query: Record<string, any>;
|
|
22
22
|
body: unknown;
|
|
23
23
|
response: unknown;
|