@navios/core 0.1.6 → 0.1.7
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.
|
@@ -406,7 +406,7 @@ export { ControllerOptions as ControllerOptions_alias_2 }
|
|
|
406
406
|
|
|
407
407
|
declare function Endpoint<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
|
|
408
408
|
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
409
|
-
}): (target: (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => z.input<ResponseSchema
|
|
409
|
+
}): (target: (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>, context: ClassMethodDecoratorContext) => (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>;
|
|
410
410
|
export { Endpoint }
|
|
411
411
|
export { Endpoint as Endpoint_alias_1 }
|
|
412
412
|
export { Endpoint as Endpoint_alias_2 }
|
|
@@ -406,7 +406,7 @@ export { ControllerOptions as ControllerOptions_alias_2 }
|
|
|
406
406
|
|
|
407
407
|
declare function Endpoint<Method extends HttpMethod = HttpMethod, Url extends string = string, QuerySchema = undefined, ResponseSchema extends ZodType = ZodType, RequestSchema = ZodType>(endpoint: {
|
|
408
408
|
config: BaseEndpointConfig<Method, Url, QuerySchema, ResponseSchema, RequestSchema>;
|
|
409
|
-
}): (target: (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => z.input<ResponseSchema
|
|
409
|
+
}): (target: (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>, context: ClassMethodDecoratorContext) => (params: QuerySchema extends AnyZodObject ? RequestSchema extends ZodType ? EndpointFunctionArgs<Url, QuerySchema, RequestSchema> : EndpointFunctionArgs<Url, QuerySchema, undefined> : RequestSchema extends ZodType ? EndpointFunctionArgs<Url, undefined, RequestSchema> : EndpointFunctionArgs<Url, undefined, undefined>) => Promise<z.input<ResponseSchema>>;
|
|
410
410
|
export { Endpoint }
|
|
411
411
|
export { Endpoint as Endpoint_alias_1 }
|
|
412
412
|
export { Endpoint as Endpoint_alias_2 }
|
package/package.json
CHANGED
|
@@ -36,14 +36,14 @@ describe('Controller decorator', () => {
|
|
|
36
36
|
@Controller()
|
|
37
37
|
class Test {
|
|
38
38
|
@Endpoint(endpoint)
|
|
39
|
-
getBar(params: EndpointParams<typeof endpoint>) {
|
|
39
|
+
async getBar(params: EndpointParams<typeof endpoint>) {
|
|
40
40
|
return {
|
|
41
41
|
foo: 'bar',
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
@Endpoint(endpoint2)
|
|
46
|
-
postBar(params: EndpointParams<typeof endpoint2>) {
|
|
46
|
+
async postBar(params: EndpointParams<typeof endpoint2>) {
|
|
47
47
|
return {
|
|
48
48
|
foo: params.data.test,
|
|
49
49
|
}
|
|
@@ -53,7 +53,7 @@ export function Endpoint<
|
|
|
53
53
|
: RequestSchema extends ZodType
|
|
54
54
|
? EndpointFunctionArgs<Url, undefined, RequestSchema>
|
|
55
55
|
: EndpointFunctionArgs<Url, undefined, undefined>,
|
|
56
|
-
) => z.input<ResponseSchema
|
|
56
|
+
) => Promise<z.input<ResponseSchema>>,
|
|
57
57
|
context: ClassMethodDecoratorContext,
|
|
58
58
|
) => {
|
|
59
59
|
if (typeof target !== 'function') {
|