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.
@@ -4,16 +4,16 @@ import {
4
4
  } from "../chunk-7NDS6XB6.js";
5
5
  import {
6
6
  generate
7
- } from "../chunk-ZP6ZWEPI.js";
7
+ } from "../chunk-HDAQOD6F.js";
8
8
  import {
9
9
  generate as generate2
10
- } from "../chunk-4AJOYIJC.js";
10
+ } from "../chunk-XVH7TUYP.js";
11
11
  import {
12
12
  generate as generate3
13
- } from "../chunk-NQPUJJ3O.js";
13
+ } from "../chunk-6T7CXXXA.js";
14
14
  import {
15
15
  writeFiles
16
- } from "../chunk-QGKZLUZR.js";
16
+ } from "../chunk-KUY3DEBX.js";
17
17
  import "../chunk-MWFEILAW.js";
18
18
 
19
19
  // src/cli.ts
@@ -3,7 +3,7 @@ import {
3
3
  buildSchemas,
4
4
  buildScopeIndex,
5
5
  resolveGenerateOptions
6
- } from "./chunk-QGKZLUZR.js";
6
+ } from "./chunk-KUY3DEBX.js";
7
7
 
8
8
  // src/zod/generate.ts
9
9
  function generate(schema, options = {}) {
@@ -7,7 +7,7 @@ import {
7
7
  resolveDomainIdentifier,
8
8
  resolveEndpointIdentifier,
9
9
  resolveGenerateOptions
10
- } from "./chunk-QGKZLUZR.js";
10
+ } from "./chunk-KUY3DEBX.js";
11
11
  import {
12
12
  camelCase
13
13
  } from "./chunk-MWFEILAW.js";
@@ -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;
@@ -3,7 +3,7 @@ import {
3
3
  buildSchemas,
4
4
  buildScopeIndex,
5
5
  resolveGenerateOptions
6
- } from "./chunk-QGKZLUZR.js";
6
+ } from "./chunk-KUY3DEBX.js";
7
7
 
8
8
  // src/typescript/generate.ts
9
9
  function generate(schema, options = {}) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generate
3
- } from "../chunk-ZP6ZWEPI.js";
4
- import "../chunk-QGKZLUZR.js";
3
+ } from "../chunk-HDAQOD6F.js";
4
+ import "../chunk-KUY3DEBX.js";
5
5
  import "../chunk-MWFEILAW.js";
6
6
  export {
7
7
  generate
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generate
3
- } from "../chunk-4AJOYIJC.js";
4
- import "../chunk-QGKZLUZR.js";
3
+ } from "../chunk-XVH7TUYP.js";
4
+ import "../chunk-KUY3DEBX.js";
5
5
  import "../chunk-MWFEILAW.js";
6
6
  export {
7
7
  generate
package/dist/zod/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generate
3
- } from "../chunk-NQPUJJ3O.js";
4
- import "../chunk-QGKZLUZR.js";
3
+ } from "../chunk-6T7CXXXA.js";
4
+ import "../chunk-KUY3DEBX.js";
5
5
  import "../chunk-MWFEILAW.js";
6
6
  export {
7
7
  generate
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.3"
60
+ "version": "0.0.4"
60
61
  }