apiwork 0.0.3 → 0.0.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/dist/bin/apiwork.js +4 -4
- package/dist/{chunk-NQPUJJ3O.js → chunk-6T7CXXXA.js} +1 -1
- package/dist/{chunk-ZP6ZWEPI.js → chunk-HDAQOD6F.js} +1 -1
- package/dist/{chunk-QGKZLUZR.js → chunk-KUY3DEBX.js} +3 -3
- package/dist/{chunk-4AJOYIJC.js → chunk-XVH7TUYP.js} +1 -1
- package/dist/sorbus/index.js +2 -2
- package/dist/typescript/index.js +2 -2
- package/dist/zod/index.js +2 -2
- package/package.json +2 -1
package/dist/bin/apiwork.js
CHANGED
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
} from "../chunk-7NDS6XB6.js";
|
|
5
5
|
import {
|
|
6
6
|
generate
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-HDAQOD6F.js";
|
|
8
8
|
import {
|
|
9
9
|
generate as generate2
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-XVH7TUYP.js";
|
|
11
11
|
import {
|
|
12
12
|
generate as generate3
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-6T7CXXXA.js";
|
|
14
14
|
import {
|
|
15
15
|
writeFiles
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-KUY3DEBX.js";
|
|
17
17
|
import "../chunk-MWFEILAW.js";
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
@@ -63,7 +63,7 @@ var TYPE_MAP = {
|
|
|
63
63
|
boolean: "z.boolean()",
|
|
64
64
|
date: "z.iso.date()",
|
|
65
65
|
datetime: "z.iso.datetime()",
|
|
66
|
-
decimal: "z.number()",
|
|
66
|
+
decimal: "z.coerce.number()",
|
|
67
67
|
integer: "z.number().int()",
|
|
68
68
|
number: "z.number()",
|
|
69
69
|
string: "z.string()",
|
|
@@ -288,7 +288,7 @@ function serializeDefault(param) {
|
|
|
288
288
|
return "''";
|
|
289
289
|
}
|
|
290
290
|
if (typeof value === "string") {
|
|
291
|
-
return `'${value}'`;
|
|
291
|
+
return param.type === "decimal" ? value : `'${value}'`;
|
|
292
292
|
}
|
|
293
293
|
if (typeof value === "boolean" || typeof value === "number") {
|
|
294
294
|
return String(value);
|
|
@@ -660,7 +660,7 @@ function generateDefinitionType(parts) {
|
|
|
660
660
|
if (parts.errorCodes.length > 0) {
|
|
661
661
|
fields.push(`errors: ${typeName}Errors`);
|
|
662
662
|
}
|
|
663
|
-
return `export interface ${typeName} { ${fields.join("; ")} }`;
|
|
663
|
+
return `export interface ${typeName} { ${fields.join("; ")}; }`;
|
|
664
664
|
}
|
|
665
665
|
function generateActionSchemas(parts, lines, references, context) {
|
|
666
666
|
const { typeName } = parts;
|
package/dist/sorbus/index.js
CHANGED
package/dist/typescript/index.js
CHANGED
package/dist/zod/index.js
CHANGED
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"@biomejs/biome": "2.4.12",
|
|
12
12
|
"@skiftle/biome-config": "0.0.7",
|
|
13
13
|
"@types/node": "25.6.0",
|
|
14
|
+
"lefthook": "2.1.2",
|
|
14
15
|
"tsup": "8.5.1",
|
|
15
16
|
"typescript": "6.0.2",
|
|
16
17
|
"vitest": "4.1.4"
|
|
@@ -56,5 +57,5 @@
|
|
|
56
57
|
"typecheck": "tsc --noEmit"
|
|
57
58
|
},
|
|
58
59
|
"type": "module",
|
|
59
|
-
"version": "0.0.
|
|
60
|
+
"version": "0.0.4"
|
|
60
61
|
}
|