@rexeus/typeweaver 0.1.1 → 0.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.
@@ -17,7 +17,7 @@ import { format, inspect } from 'util';
17
17
  import { HttpMethod, HttpStatusCode, HttpResponseDefinition, HttpOperationDefinition, HttpStatusCodeNameMap } from '@rexeus/typeweaver-core';
18
18
  import { z } from 'zod';
19
19
 
20
- var version = "0.1.1";
20
+ var version = "0.2.0";
21
21
  var packageJson = {
22
22
  version: version};
23
23
 
@@ -20084,8 +20084,17 @@ class DefinitionValidator {
20084
20084
  }
20085
20085
  return;
20086
20086
  }
20087
- if (!(schema instanceof z.ZodObject)) {
20088
- throw new InvalidSchemaError(
20087
+ if (schemaType === "query" || schemaType === "header") {
20088
+ if (!(schema instanceof z.ZodObject) && !(schema instanceof z.ZodOptional && schema.unwrap() instanceof z.ZodObject)) {
20089
+ throw new InvalidSchemaError(
20090
+ schemaType,
20091
+ definitionName,
20092
+ context,
20093
+ sourceFile
20094
+ );
20095
+ }
20096
+ this.validateHeaderOrQueryShape(
20097
+ schema,
20089
20098
  schemaType,
20090
20099
  definitionName,
20091
20100
  context,
@@ -20093,15 +20102,15 @@ class DefinitionValidator {
20093
20102
  );
20094
20103
  }
20095
20104
  if (schemaType === "param") {
20105
+ if (!(schema instanceof z.ZodObject)) {
20106
+ throw new InvalidSchemaError(
20107
+ schemaType,
20108
+ definitionName,
20109
+ context,
20110
+ sourceFile
20111
+ );
20112
+ }
20096
20113
  this.validateParamShape(schema, definitionName, sourceFile);
20097
- } else {
20098
- this.validateHeaderOrQueryShape(
20099
- schema,
20100
- schemaType,
20101
- definitionName,
20102
- context,
20103
- sourceFile
20104
- );
20105
20114
  }
20106
20115
  }
20107
20116
  validatePathParameters(operation, sourceFile) {
@@ -20154,7 +20163,7 @@ class DefinitionValidator {
20154
20163
  }
20155
20164
  }
20156
20165
  validateHeaderOrQueryShape(schema, schemaType, definitionName, context, sourceFile) {
20157
- const shape = schema.shape;
20166
+ const shape = schema instanceof z.ZodObject ? schema.shape : schema.unwrap().shape;
20158
20167
  for (const [propName, propSchema] of Object.entries(shape)) {
20159
20168
  if (!this.isValidHeaderOrQueryValue(propSchema)) {
20160
20169
  const typeName = this.getZodTypeName(propSchema);
@@ -20170,7 +20179,7 @@ class DefinitionValidator {
20170
20179
  }
20171
20180
  }
20172
20181
  validateParamShape(schema, operationId, sourceFile) {
20173
- const shape = schema.shape;
20182
+ const shape = schema instanceof z.ZodObject ? schema.shape : schema.unwrap().shape;
20174
20183
  for (const [propName, propSchema] of Object.entries(shape)) {
20175
20184
  if (!this.isValidParamValue(propSchema)) {
20176
20185
  const typeName = this.getZodTypeName(propSchema);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './cli-CaJhPgaT.js';
1
+ import './cli-Nz3HYFYF.js';
2
2
  import 'path';
3
3
  import 'url';
4
4
  import 'commander';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import 'tsx';
3
- import './cli-CaJhPgaT.js';
3
+ import './cli-Nz3HYFYF.js';
4
4
  import 'path';
5
5
  import 'url';
6
6
  import 'commander';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rexeus/typeweaver",
3
- "version": "0.1.1",
4
- "description": "Command-line interface for the typeweaver API framework",
3
+ "version": "0.2.0",
4
+ "description": "🧵✨ Typeweaver CLI. Entry point into the Typeweaver framework to scaffold, validate, and generate API assets.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -44,31 +44,31 @@
44
44
  "devDependencies": {
45
45
  "axios": "^1.12.2",
46
46
  "case": "^1.6.3",
47
- "hono": "^4.9.7",
48
- "zod": "^4.1.5",
49
- "@rexeus/typeweaver-aws-cdk": "^0.1.1",
50
- "@rexeus/typeweaver-clients": "^0.1.1",
51
- "@rexeus/typeweaver-gen": "^0.1.1",
52
- "@rexeus/typeweaver-hono": "^0.1.1",
53
- "@rexeus/typeweaver-types": "^0.1.1",
54
- "@rexeus/typeweaver-core": "^0.1.1"
47
+ "hono": "^4.9.9",
48
+ "zod": "^4.1.11",
49
+ "@rexeus/typeweaver-aws-cdk": "^0.2.0",
50
+ "@rexeus/typeweaver-clients": "^0.2.0",
51
+ "@rexeus/typeweaver-core": "^0.2.0",
52
+ "@rexeus/typeweaver-gen": "^0.2.0",
53
+ "@rexeus/typeweaver-types": "^0.2.0",
54
+ "@rexeus/typeweaver-hono": "^0.2.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "axios": "^1.12.2",
58
58
  "case": "^1.6.3",
59
59
  "hono": "^4.9.7",
60
- "zod": "^4.1.5",
61
- "@rexeus/typeweaver-aws-cdk": "^0.1.1",
62
- "@rexeus/typeweaver-clients": "^0.1.1",
63
- "@rexeus/typeweaver-gen": "^0.1.1",
64
- "@rexeus/typeweaver-core": "^0.1.1",
65
- "@rexeus/typeweaver-hono": "^0.1.1",
66
- "@rexeus/typeweaver-types": "^0.1.1"
60
+ "zod": "^4.1.11",
61
+ "@rexeus/typeweaver-aws-cdk": "^0.2.0",
62
+ "@rexeus/typeweaver-clients": "^0.2.0",
63
+ "@rexeus/typeweaver-core": "^0.2.0",
64
+ "@rexeus/typeweaver-hono": "^0.2.0",
65
+ "@rexeus/typeweaver-gen": "^0.2.0",
66
+ "@rexeus/typeweaver-types": "^0.2.0"
67
67
  },
68
68
  "dependencies": {
69
69
  "commander": "^14.0.1",
70
70
  "ejs": "^3.1.10",
71
- "tsx": "^4.20.5"
71
+ "tsx": "^4.20.6"
72
72
  },
73
73
  "scripts": {
74
74
  "cli": "tsx src/cli.ts",