@hyperjump/json-schema 1.6.7 → 1.7.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.
- package/README.md +247 -255
- package/annotations/annotated-instance.js +3 -3
- package/annotations/index.d.ts +7 -1
- package/annotations/index.js +3 -3
- package/bundle/index.d.ts +1 -5
- package/bundle/index.js +112 -156
- package/draft-04/additionalItems.js +6 -7
- package/draft-04/dependencies.js +5 -5
- package/draft-04/index.js +2 -2
- package/draft-04/items.js +5 -5
- package/draft-04/maximum.js +8 -8
- package/draft-04/minimum.js +8 -8
- package/draft-06/contains.js +2 -2
- package/draft-06/index.js +3 -2
- package/draft-07/index.js +3 -2
- package/draft-2019-09/index.js +9 -11
- package/draft-2020-12/dynamicRef.js +5 -5
- package/draft-2020-12/index.js +11 -13
- package/lib/common.d.ts +1 -1
- package/lib/common.js +44 -60
- package/lib/configuration.js +0 -6
- package/lib/core.js +32 -30
- package/lib/experimental.d.ts +75 -5
- package/lib/experimental.js +2 -2
- package/lib/index.d.ts +43 -11
- package/lib/index.js +11 -11
- package/lib/instance.d.ts +1 -17
- package/lib/instance.js +3 -3
- package/lib/keywords/additionalProperties.js +12 -13
- package/lib/keywords/allOf.js +3 -3
- package/lib/keywords/anyOf.js +3 -3
- package/lib/keywords/conditional.js +6 -7
- package/lib/keywords/const.js +2 -2
- package/lib/keywords/contains.js +14 -35
- package/lib/keywords/contentSchema.js +1 -1
- package/lib/keywords/definitions.js +2 -2
- package/lib/keywords/dependentRequired.js +4 -4
- package/lib/keywords/dependentSchemas.js +5 -5
- package/lib/keywords/dynamicRef.js +10 -5
- package/lib/keywords/else.js +5 -6
- package/lib/keywords/enum.js +4 -4
- package/lib/keywords/exclusiveMaximum.js +3 -3
- package/lib/keywords/exclusiveMinimum.js +3 -3
- package/lib/keywords/if.js +1 -1
- package/lib/keywords/itemPattern.js +17 -14
- package/lib/keywords/items.js +6 -7
- package/lib/keywords/maxItems.js +3 -3
- package/lib/keywords/maxLength.js +3 -3
- package/lib/keywords/maxProperties.js +3 -3
- package/lib/keywords/maximum.js +3 -3
- package/lib/keywords/meta-data.js +1 -1
- package/lib/keywords/minItems.js +3 -3
- package/lib/keywords/minLength.js +3 -3
- package/lib/keywords/minProperties.js +3 -3
- package/lib/keywords/minimum.js +3 -3
- package/lib/keywords/multipleOf.js +3 -3
- package/lib/keywords/not.js +1 -1
- package/lib/keywords/oneOf.js +3 -3
- package/lib/keywords/pattern.js +3 -3
- package/lib/keywords/patternProperties.js +5 -5
- package/lib/keywords/prefixItems.js +5 -5
- package/lib/keywords/properties.js +5 -5
- package/lib/keywords/propertyDependencies.js +6 -7
- package/lib/keywords/propertyNames.js +2 -2
- package/lib/keywords/ref.js +2 -7
- package/lib/keywords/requireAllExcept.js +8 -9
- package/lib/keywords/required.js +3 -3
- package/lib/keywords/then.js +5 -5
- package/lib/keywords/type.js +9 -3
- package/lib/keywords/unevaluatedItems.js +4 -4
- package/lib/keywords/unevaluatedProperties.js +4 -5
- package/lib/keywords/uniqueItems.js +3 -3
- package/lib/keywords/validation.js +11 -23
- package/lib/keywords.js +27 -14
- package/lib/openapi.js +19 -6
- package/lib/schema.js +236 -227
- package/openapi-3-0/index.js +5 -5
- package/openapi-3-0/type.js +13 -7
- package/openapi-3-1/index.js +22 -21
- package/openapi-3-1/{schema-base/2022-10-07.js → schema-base.js} +12 -2
- package/openapi-3-1/schema-draft-04.js +33 -0
- package/openapi-3-1/schema-draft-06.js +33 -0
- package/openapi-3-1/schema-draft-07.js +33 -0
- package/openapi-3-1/schema-draft-2019-09.js +33 -0
- package/openapi-3-1/schema-draft-2020-12.js +33 -0
- package/package.json +11 -11
- package/stable/index.js +10 -10
- package/annotations/validation-error.d.ts +0 -8
- package/draft-2019-09/contains.js +0 -44
- package/lib/configuration.d.ts +0 -9
- package/lib/context-uri.browser.js +0 -1
- package/lib/context-uri.js +0 -4
- package/lib/core.d.ts +0 -48
- package/lib/fetch.browser.js +0 -1
- package/lib/fetch.js +0 -20
- package/lib/invalid-schema-error.d.ts +0 -8
- package/lib/keywords.d.ts +0 -19
- package/lib/media-types.d.ts +0 -11
- package/lib/media-types.js +0 -48
- package/lib/reference.d.ts +0 -11
- package/lib/reference.js +0 -11
- package/lib/schema.d.ts +0 -60
- /package/openapi-3-0/{schema/2021-09-28.js → schema.js} +0 -0
- /package/openapi-3-1/{schema/2022-10-07.js → schema.js} +0 -0
package/lib/schema.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { JsonType } from "./common.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const add: <A extends SchemaObject | boolean>(schema: A, retrievalUri?: string, defaultSchemaVersion?: string) => string;
|
|
5
|
-
export const get: (url: string, context?: SchemaDocument) => Promise<SchemaDocument>;
|
|
6
|
-
export const markValidated: (id: string) => void;
|
|
7
|
-
export const uri: (doc: SchemaDocument) => string;
|
|
8
|
-
export const value: <A extends SchemaFragment>(doc: SchemaDocument<A>) => A;
|
|
9
|
-
export const typeOf: (
|
|
10
|
-
(doc: SchemaDocument, type: "null") => doc is SchemaDocument<null>
|
|
11
|
-
) & (
|
|
12
|
-
(doc: SchemaDocument, type: "boolean") => doc is SchemaDocument<boolean>
|
|
13
|
-
) & (
|
|
14
|
-
(doc: SchemaDocument, type: "object") => doc is SchemaDocument<SchemaObject>
|
|
15
|
-
) & (
|
|
16
|
-
(doc: SchemaDocument, type: "array") => doc is SchemaDocument<SchemaFragment[]>
|
|
17
|
-
) & (
|
|
18
|
-
(doc: SchemaDocument, type: "number" | "integer") => doc is SchemaDocument<number>
|
|
19
|
-
) & (
|
|
20
|
-
(doc: SchemaDocument, type: "string") => doc is SchemaDocument<string>
|
|
21
|
-
) & (
|
|
22
|
-
(doc: SchemaDocument, type: JsonType) => boolean
|
|
23
|
-
) & (
|
|
24
|
-
(doc: SchemaDocument) => (type: JsonType) => boolean
|
|
25
|
-
);
|
|
26
|
-
export const has: (key: string, doc: SchemaDocument) => boolean;
|
|
27
|
-
export const step: (key: string, doc: SchemaDocument) => Promise<SchemaDocument>;
|
|
28
|
-
export const iter: (doc: SchemaDocument) => AsyncGenerator<SchemaDocument>;
|
|
29
|
-
export const keys: (doc: SchemaDocument) => Generator<string>;
|
|
30
|
-
export const values: (doc: SchemaDocument) => AsyncGenerator<string>;
|
|
31
|
-
export const entries: (doc: SchemaDocument) => AsyncGenerator<[string, SchemaDocument]>;
|
|
32
|
-
export const length: (doc: SchemaDocument) => number;
|
|
33
|
-
export const toSchema: (doc: SchemaDocument, options: ToSchemaOptions) => SchemaObject;
|
|
34
|
-
|
|
35
|
-
type MapFn<A> = (element: SchemaDocument, index: number) => A;
|
|
36
|
-
|
|
37
|
-
export type ToSchemaOptions = {
|
|
38
|
-
parentId?: string;
|
|
39
|
-
parentDialect?: string;
|
|
40
|
-
includeEmbedded?: boolean;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type SchemaDocument<A extends SchemaFragment = SchemaFragment> = {
|
|
44
|
-
id: string;
|
|
45
|
-
dialectId: string;
|
|
46
|
-
pointer: string;
|
|
47
|
-
schema: SchemaObject;
|
|
48
|
-
value: A;
|
|
49
|
-
anchors: Anchors;
|
|
50
|
-
dynamicAnchors: Anchors;
|
|
51
|
-
vocabulary: Record<string, boolean>;
|
|
52
|
-
validated: boolean;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type SchemaFragment = string | number | boolean | null | SchemaObject | SchemaFragment[];
|
|
56
|
-
export type SchemaObject = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
|
|
57
|
-
[keyword: string]: SchemaFragment;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type Anchors = Record<string, string>;
|
|
File without changes
|
|
File without changes
|