yedra 0.12.2 → 0.12.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/lib.d.ts CHANGED
@@ -14,10 +14,8 @@ export { record } from './validation/record.js';
14
14
  export { Schema } from './validation/schema.js';
15
15
  export { BodyType, type Typeof } from './validation/body.js';
16
16
  export { raw } from './validation/raw.js';
17
- export { none } from './validation/none.js';
18
17
  export { either } from './validation/either.js';
19
18
  export { string } from './validation/string.js';
20
- export { _undefined as undefined } from './validation/undefined.js';
21
19
  export { union } from './validation/union.js';
22
20
  export { unknown } from './validation/unknown.js';
23
21
  export { uuid } from './validation/uuid.js';
package/dist/lib.js CHANGED
@@ -19,10 +19,8 @@ export { record } from './validation/record.js';
19
19
  export { Schema } from './validation/schema.js';
20
20
  export { BodyType } from './validation/body.js';
21
21
  export { raw } from './validation/raw.js';
22
- export { none } from './validation/none.js';
23
22
  export { either } from './validation/either.js';
24
23
  export { string } from './validation/string.js';
25
- export { _undefined as undefined } from './validation/undefined.js';
26
24
  export { union } from './validation/union.js';
27
25
  export { unknown } from './validation/unknown.js';
28
26
  export { uuid } from './validation/uuid.js';
@@ -63,10 +63,12 @@ class RestEndpoint {
63
63
  summary: this.options.summary,
64
64
  description: this.options.description,
65
65
  parameters,
66
- requestBody: {
67
- required: this.options.req instanceof NoneBody,
68
- content: this.options.req.bodyDocs(),
69
- },
66
+ requestBody: this.options.req instanceof NoneBody
67
+ ? undefined
68
+ : {
69
+ required: true,
70
+ content: this.options.req.bodyDocs(),
71
+ },
70
72
  responses: {
71
73
  '200': {
72
74
  description: 'Success',
@@ -4,9 +4,7 @@ class UnknownSchema extends ModifiableSchema {
4
4
  return obj;
5
5
  }
6
6
  documentation() {
7
- return {
8
- type: 'object',
9
- };
7
+ return {};
10
8
  }
11
9
  }
12
10
  /**
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "yedra",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "repository": "github:0codekit/yedra",
5
5
  "main": "dist/index.js",
6
6
  "devDependencies": {
7
7
  "@biomejs/biome": "^1.9.2",
8
8
  "@types/bun": "^1.1.10",
9
- "@types/node": "^22.5.5",
9
+ "@types/node": "^22.6.1",
10
10
  "@types/uuid": "^10.0.0",
11
11
  "typescript": "^5.6.2"
12
12
  },
@@ -1,9 +0,0 @@
1
- import { Schema } from './schema.js';
2
- export declare class UndefinedSchema extends Schema<undefined> {
3
- parse(obj: unknown): undefined;
4
- documentation(): object;
5
- }
6
- /**
7
- * A schema that matches only undefined.
8
- */
9
- export declare const _undefined: () => UndefinedSchema;
@@ -1,21 +0,0 @@
1
- import { Issue, ValidationError } from './error.js';
2
- import { Schema } from './schema.js';
3
- export class UndefinedSchema extends Schema {
4
- parse(obj) {
5
- if (obj === undefined || obj === null) {
6
- return undefined;
7
- }
8
- throw new ValidationError([
9
- new Issue('invalidType', [], 'undefined', typeof obj),
10
- ]);
11
- }
12
- documentation() {
13
- return {
14
- type: 'null',
15
- };
16
- }
17
- }
18
- /**
19
- * A schema that matches only undefined.
20
- */
21
- export const _undefined = () => new UndefinedSchema();