@rexeus/typeweaver-types 0.10.5 → 0.12.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.
@@ -6,18 +6,18 @@
6
6
  * @generated by @rexeus/typeweaver
7
7
  */
8
8
 
9
- import { spec } from "<%= specPath %>";
10
- import {
9
+ <% if (hasRequestSchema) { %>import { spec } from "<%= specPath %>";
10
+ <% } %>import {
11
11
  type IHttpRequest,
12
12
  type SafeRequestValidationResult,
13
13
  RequestValidationError
14
14
  } from "@rexeus/typeweaver-core";
15
- import { getOperationDefinition, RequestValidator } from "../lib/types/index.js";
15
+ import { <%= hasRequestSchema ? "getOperationDefinition, " : "" %>RequestValidator } from "../lib/types/index.js";
16
16
  import type { I<%= pascalCaseOperationId %>Request } from "<%= requestFile %>";
17
17
 
18
- const definition = getOperationDefinition(spec, "<%= resourceName %>", "<%= operationId %>");
18
+ <% if (hasRequestSchema) { %>const definition = getOperationDefinition(spec, "<%= resourceName %>", "<%= operationId %>");
19
19
 
20
- export class <%= pascalCaseOperationId %>RequestValidator extends RequestValidator {
20
+ <% } %>export class <%= pascalCaseOperationId %>RequestValidator extends RequestValidator {
21
21
  public safeValidate(request: IHttpRequest): SafeRequestValidationResult<I<%= pascalCaseOperationId %>Request> {
22
22
  const error = new RequestValidationError();
23
23
  const validatedRequest: IHttpRequest = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rexeus/typeweaver-types",
3
- "version": "0.10.5",
3
+ "version": "0.12.0",
4
4
  "description": "Generates request and response types plus validators aligned with your API contract. Powered by Typeweaver 🧵✨",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -47,17 +47,17 @@
47
47
  },
48
48
  "homepage": "https://github.com/rexeus/typeweaver#readme",
49
49
  "peerDependencies": {
50
- "@rexeus/typeweaver-core": "^0.10.5",
51
- "@rexeus/typeweaver-gen": "^0.10.5"
50
+ "@rexeus/typeweaver-core": "^0.12.0",
51
+ "@rexeus/typeweaver-gen": "^0.12.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "test-utils": "file:../test-utils",
55
- "@rexeus/typeweaver-core": "^0.10.5",
56
- "@rexeus/typeweaver-gen": "^0.10.5"
55
+ "@rexeus/typeweaver-gen": "^0.12.0",
56
+ "@rexeus/typeweaver-core": "^0.12.0"
57
57
  },
58
58
  "dependencies": {
59
59
  "polycase": "^1.1.0",
60
- "@rexeus/typeweaver-zod-to-ts": "^0.10.5"
60
+ "@rexeus/typeweaver-zod-to-ts": "^0.12.0"
61
61
  },
62
62
  "scripts": {
63
63
  "typecheck": "tsc --noEmit -p tsconfig.typecheck.json",