@loopstack/contracts 0.16.1 → 0.18.0-rc.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.
@@ -1,2 +1,43 @@
1
1
  import { z } from 'zod';
2
- export declare const JSONSchemaType: z.ZodType<any>;
2
+ export interface JSONSchemaDefinition {
3
+ type?: 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null' | 'any' | Array<'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object' | 'null'>;
4
+ $id?: string;
5
+ $schema?: string;
6
+ title?: string;
7
+ description?: string;
8
+ default?: unknown;
9
+ minLength?: number;
10
+ maxLength?: number;
11
+ pattern?: string;
12
+ format?: string;
13
+ multipleOf?: number;
14
+ minimum?: number;
15
+ maximum?: number;
16
+ exclusiveMinimum?: boolean | number;
17
+ exclusiveMaximum?: boolean | number;
18
+ items?: JSONSchemaDefinition | JSONSchemaDefinition[];
19
+ additionalItems?: boolean | JSONSchemaDefinition;
20
+ minItems?: number;
21
+ maxItems?: number;
22
+ uniqueItems?: boolean;
23
+ contains?: JSONSchemaDefinition;
24
+ properties?: Record<string, JSONSchemaDefinition>;
25
+ patternProperties?: Record<string, JSONSchemaDefinition>;
26
+ additionalProperties?: boolean | JSONSchemaDefinition;
27
+ required?: string[];
28
+ propertyNames?: JSONSchemaDefinition;
29
+ minProperties?: number;
30
+ maxProperties?: number;
31
+ allOf?: JSONSchemaDefinition[];
32
+ anyOf?: JSONSchemaDefinition[];
33
+ oneOf?: JSONSchemaDefinition[];
34
+ not?: JSONSchemaDefinition;
35
+ if?: JSONSchemaDefinition;
36
+ then?: JSONSchemaDefinition;
37
+ else?: JSONSchemaDefinition;
38
+ enum?: unknown[];
39
+ const?: unknown;
40
+ definitions?: Record<string, JSONSchemaDefinition>;
41
+ $ref?: string;
42
+ }
43
+ export declare const JSONSchemaType: z.ZodType<JSONSchemaDefinition>;
@@ -15,7 +15,7 @@ exports.JSONSchemaType = zod_1.z.lazy(() => zod_1.z.object({
15
15
  $schema: zod_1.z.string().optional(),
16
16
  title: zod_1.z.string().optional(),
17
17
  description: zod_1.z.string().optional(),
18
- default: zod_1.z.any().optional(),
18
+ default: zod_1.z.unknown().optional(),
19
19
  // String validators
20
20
  minLength: zod_1.z.number().int().optional(),
21
21
  maxLength: zod_1.z.number().int().optional(),
@@ -35,8 +35,8 @@ exports.JSONSchemaType = zod_1.z.lazy(() => zod_1.z.object({
35
35
  uniqueItems: zod_1.z.boolean().optional(),
36
36
  contains: exports.JSONSchemaType.optional(),
37
37
  // Object validators
38
- properties: zod_1.z.record(exports.JSONSchemaType).optional(),
39
- patternProperties: zod_1.z.record(exports.JSONSchemaType).optional(),
38
+ properties: zod_1.z.record(zod_1.z.string(), exports.JSONSchemaType).optional(),
39
+ patternProperties: zod_1.z.record(zod_1.z.string(), exports.JSONSchemaType).optional(),
40
40
  additionalProperties: zod_1.z.union([zod_1.z.boolean(), exports.JSONSchemaType]).optional(),
41
41
  required: zod_1.z.array(zod_1.z.string()).optional(),
42
42
  propertyNames: exports.JSONSchemaType.optional(),
@@ -52,9 +52,9 @@ exports.JSONSchemaType = zod_1.z.lazy(() => zod_1.z.object({
52
52
  then: exports.JSONSchemaType.optional(),
53
53
  else: exports.JSONSchemaType.optional(),
54
54
  // Other validators
55
- enum: zod_1.z.array(zod_1.z.any()).optional(),
56
- const: zod_1.z.any().optional(),
55
+ enum: zod_1.z.array(zod_1.z.unknown()).optional(),
56
+ const: zod_1.z.unknown().optional(),
57
57
  // Schema composition
58
- definitions: zod_1.z.record(exports.JSONSchemaType).optional(),
58
+ definitions: zod_1.z.record(zod_1.z.string(), exports.JSONSchemaType).optional(),
59
59
  $ref: zod_1.z.string().optional(),
60
60
  }));