milkio 0.0.19 → 0.0.21
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/package.json +1 -1
- package/scripts/gen-significant.ts +2 -2
- package/templates/api.ts +1 -1
package/package.json
CHANGED
|
@@ -90,14 +90,14 @@ export default async () => {
|
|
|
90
90
|
importPath = importPath + "src/apps"
|
|
91
91
|
const template = `
|
|
92
92
|
import typia from "typia";
|
|
93
|
-
import { _validate, type ExecuteResultSuccess } from "milkio";
|
|
93
|
+
import { _validate, type ExecuteResultFail, type ExecuteResultSuccess } from "milkio";
|
|
94
94
|
import { type TSONEncode } from "@southern-aurora/tson";
|
|
95
95
|
import type * as <%= utils.camel(path.slice(0, -3).replaceAll('/', '$')) %> from '${importPath}/<%= path.slice(0, -3) %>';
|
|
96
96
|
|
|
97
97
|
type ParamsT = Parameters<typeof <%= utils.camel(path.replaceAll('/', '$').slice(0, -${3})) %>['api']['action']>[0];
|
|
98
98
|
export const validateParams = async (params: any) => typia.misc.validatePrune<ParamsT>(params);
|
|
99
99
|
type ResultsT = Awaited<ReturnType<typeof <%= utils.camel(path.replaceAll('/', '$').slice(0, -${3})) %>['api']['action']>>;
|
|
100
|
-
export const validateResults = async (results: any) => { _validate(typia.validate<TSONEncode<ExecuteResultSuccess<ResultsT
|
|
100
|
+
export const validateResults = async (results: any) => { _validate(typia.validate<TSONEncode<ExecuteResultSuccess<ResultsT> | ExecuteResultFail>>(results)); return typia.json.stringify<TSONEncode<ExecuteResultSuccess<ResultsT> | ExecuteResultFail>>(results); };
|
|
101
101
|
export const randParams = async () => typia.random<ParamsT>();
|
|
102
102
|
`.trim()
|
|
103
103
|
// export const paramsSchema = typia.json.application<[{ data: ParamsT }], "swagger">();
|