@rexeus/typeweaver 0.1.0 → 0.1.2
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/{cli-Cin8VieP.js → cli-BZCmysZl.js} +22 -13
- package/dist/index.js +1 -1
- package/dist/run-cli-with-tsx.js +1 -1
- package/package.json +16 -16
|
@@ -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.
|
|
20
|
+
var version = "0.1.2";
|
|
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 (
|
|
20088
|
-
|
|
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
package/dist/run-cli-with-tsx.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rexeus/typeweaver",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Command-line interface for the typeweaver API framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -42,31 +42,31 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/rexeus/typeweaver#readme",
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"axios": "^1.
|
|
45
|
+
"axios": "^1.12.2",
|
|
46
46
|
"case": "^1.6.3",
|
|
47
47
|
"hono": "^4.9.7",
|
|
48
48
|
"zod": "^4.1.5",
|
|
49
|
-
"@rexeus/typeweaver-aws-cdk": "^0.1.
|
|
50
|
-
"@rexeus/typeweaver-
|
|
51
|
-
"@rexeus/typeweaver-gen": "^0.1.
|
|
52
|
-
"@rexeus/typeweaver-
|
|
53
|
-
"@rexeus/typeweaver-
|
|
54
|
-
"@rexeus/typeweaver-
|
|
49
|
+
"@rexeus/typeweaver-aws-cdk": "^0.1.2",
|
|
50
|
+
"@rexeus/typeweaver-core": "^0.1.2",
|
|
51
|
+
"@rexeus/typeweaver-gen": "^0.1.2",
|
|
52
|
+
"@rexeus/typeweaver-hono": "^0.1.2",
|
|
53
|
+
"@rexeus/typeweaver-types": "^0.1.2",
|
|
54
|
+
"@rexeus/typeweaver-clients": "^0.1.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"axios": "^1.
|
|
57
|
+
"axios": "^1.12.2",
|
|
58
58
|
"case": "^1.6.3",
|
|
59
59
|
"hono": "^4.9.7",
|
|
60
60
|
"zod": "^4.1.5",
|
|
61
|
-
"@rexeus/typeweaver-aws-cdk": "^0.1.
|
|
62
|
-
"@rexeus/typeweaver-
|
|
63
|
-
"@rexeus/typeweaver-
|
|
64
|
-
"@rexeus/typeweaver-
|
|
65
|
-
"@rexeus/typeweaver-
|
|
66
|
-
"@rexeus/typeweaver-
|
|
61
|
+
"@rexeus/typeweaver-aws-cdk": "^0.1.2",
|
|
62
|
+
"@rexeus/typeweaver-gen": "^0.1.2",
|
|
63
|
+
"@rexeus/typeweaver-core": "^0.1.2",
|
|
64
|
+
"@rexeus/typeweaver-hono": "^0.1.2",
|
|
65
|
+
"@rexeus/typeweaver-types": "^0.1.2",
|
|
66
|
+
"@rexeus/typeweaver-clients": "^0.1.2"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"commander": "^14.0.
|
|
69
|
+
"commander": "^14.0.1",
|
|
70
70
|
"ejs": "^3.1.10",
|
|
71
71
|
"tsx": "^4.20.5"
|
|
72
72
|
},
|