eslint-plugin-package-json 0.88.2 → 0.89.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +16 -10
  3. package/lib/createRule.d.mts +9 -5
  4. package/lib/index.d.mts +2 -2
  5. package/lib/node_modules/.pnpm/@types_estree@1.0.8/node_modules/@types/estree/index.d.mts +438 -0
  6. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.mts +7 -0
  7. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/fromSchemaOptions.d.mts +20 -0
  8. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.mts +60 -0
  9. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.d.mts +11 -0
  10. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-options.d.mts +16 -0
  11. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/allOf.d.mts +13 -0
  12. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/anyOf.d.mts +14 -0
  13. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/array.d.mts +58 -0
  14. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/const.d.mts +14 -0
  15. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/deserialize.d.mts +13 -0
  16. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/enum.d.mts +14 -0
  17. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/ifThenElse.d.mts +20 -0
  18. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/index.d.mts +34 -0
  19. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/multipleTypes.d.mts +14 -0
  20. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/not.d.mts +20 -0
  21. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/nullable.d.mts +14 -0
  22. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/object.d.mts +34 -0
  23. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/oneOf.d.mts +14 -0
  24. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/external.d.mts +22 -0
  25. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/index.d.mts +13 -0
  26. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/internal.d.mts +8 -0
  27. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/utils.d.mts +12 -0
  28. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/singleType.d.mts +24 -0
  29. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/utils.d.mts +20 -0
  30. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/and.d.mts +4 -0
  31. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/extends.d.mts +4 -0
  32. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/get.d.mts +4 -0
  33. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/join.d.mts +4 -0
  34. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/not.d.mts +4 -0
  35. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/pop.d.mts +4 -0
  36. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/split.d.mts +7 -0
  37. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/tail.d.mts +4 -0
  38. package/lib/node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/writable.d.mts +4 -0
  39. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.d.mts +20 -0
  40. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.d.mts +28 -0
  41. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.d.mts +25 -0
  42. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.d.mts +25 -0
  43. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/any.d.mts +16 -0
  44. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/array.d.mts +20 -0
  45. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/const.d.mts +28 -0
  46. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/enum.d.mts +23 -0
  47. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.d.mts +24 -0
  48. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/object.d.mts +44 -0
  49. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/primitive.d.mts +16 -0
  50. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/tuple.d.mts +43 -0
  51. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/union.d.mts +13 -0
  52. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/utils.d.mts +35 -0
  53. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/any.d.mts +23 -0
  54. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/array.d.mts +24 -0
  55. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/const.d.mts +34 -0
  56. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/enum.d.mts +26 -0
  57. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.d.mts +24 -0
  58. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/object.d.mts +25 -0
  59. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/primitive.d.mts +23 -0
  60. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/tuple.d.mts +26 -0
  61. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/union.d.mts +17 -0
  62. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/utils.d.mts +10 -0
  63. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.d.mts +9 -0
  64. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.d.mts +49 -0
  65. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.d.mts +26 -0
  66. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.d.mts +22 -0
  67. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.d.mts +36 -0
  68. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/type.d.mts +18 -0
  69. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.d.mts +23 -0
  70. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/utils.d.mts +7 -0
  71. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/and.d.mts +4 -0
  72. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/extends.d.mts +7 -0
  73. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/if.d.mts +4 -0
  74. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/intersectUnion.d.mts +4 -0
  75. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/isNever.d.mts +4 -0
  76. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/merge.d.mts +6 -0
  77. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/not.d.mts +4 -0
  78. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/or.d.mts +4 -0
  79. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/prettify.d.mts +6 -0
  80. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/tail.d.mts +4 -0
  81. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionLast.d.mts +6 -0
  82. package/lib/node_modules/.pnpm/ts-algebra@2.0.0/node_modules/ts-algebra/lib/utils/unionPop.d.mts +6 -0
  83. package/lib/plugin.d.mts +3 -4
  84. package/lib/plugin.mjs +3 -3
  85. package/lib/rules/no-empty-fields.mjs +2 -2
  86. package/lib/rules/repository-shorthand.mjs +3 -3
  87. package/lib/rules/require-attribution.d.mts +5 -0
  88. package/lib/rules/require-attribution.mjs +23 -7
  89. package/lib/rules/require-properties.mjs +14 -5
  90. package/lib/rules/restrict-private-properties.mjs +2 -2
  91. package/package.json +15 -15
@@ -0,0 +1,7 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/deserializationPattern.d.ts
2
+ type DeserializationPattern = Readonly<{
3
+ pattern: unknown;
4
+ output: unknown;
5
+ }>;
6
+ //#endregion
7
+ export { DeserializationPattern };
@@ -0,0 +1,20 @@
1
+ import { DeserializationPattern } from "./deserializationPattern.mjs";
2
+ import { JSONSchemaReference } from "./jsonSchema.mjs";
3
+
4
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/fromSchemaOptions.d.ts
5
+ type FromSchemaOptions = {
6
+ parseNotKeyword?: boolean;
7
+ parseIfThenElseKeywords?: boolean;
8
+ keepDefaultedPropertiesOptional?: boolean;
9
+ references?: JSONSchemaReference[] | false;
10
+ deserialize?: DeserializationPattern[] | false;
11
+ };
12
+ type FromSchemaDefaultOptions = {
13
+ parseNotKeyword: false;
14
+ parseIfThenElseKeywords: false;
15
+ keepDefaultedPropertiesOptional: false;
16
+ references: false;
17
+ deserialize: false;
18
+ };
19
+ //#endregion
20
+ export { FromSchemaDefaultOptions, FromSchemaOptions };
@@ -0,0 +1,60 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/definitions/jsonSchema.d.ts
2
+ declare const $JSONSchema: unique symbol;
3
+ type $JSONSchema = typeof $JSONSchema;
4
+ type JSONSchemaType = "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
5
+ type JSONSchema = boolean | Readonly<{
6
+ [$JSONSchema]?: $JSONSchema;
7
+ $id?: string | undefined;
8
+ $ref?: string | undefined;
9
+ $schema?: string | undefined;
10
+ $comment?: string | undefined;
11
+ type?: JSONSchemaType | readonly JSONSchemaType[];
12
+ const?: unknown;
13
+ enum?: unknown;
14
+ multipleOf?: number | undefined;
15
+ maximum?: number | undefined;
16
+ exclusiveMaximum?: number | undefined;
17
+ minimum?: number | undefined;
18
+ exclusiveMinimum?: number | undefined;
19
+ maxLength?: number | undefined;
20
+ minLength?: number | undefined;
21
+ pattern?: string | undefined;
22
+ items?: JSONSchema | readonly JSONSchema[];
23
+ additionalItems?: JSONSchema;
24
+ contains?: JSONSchema;
25
+ maxItems?: number | undefined;
26
+ minItems?: number | undefined;
27
+ uniqueItems?: boolean | undefined;
28
+ maxProperties?: number | undefined;
29
+ minProperties?: number | undefined;
30
+ required?: readonly string[];
31
+ properties?: Readonly<Record<string, JSONSchema>>;
32
+ patternProperties?: Readonly<Record<string, JSONSchema>>;
33
+ additionalProperties?: JSONSchema;
34
+ unevaluatedProperties?: JSONSchema;
35
+ dependencies?: Readonly<Record<string, JSONSchema | readonly string[]>>;
36
+ propertyNames?: JSONSchema;
37
+ if?: JSONSchema;
38
+ then?: JSONSchema;
39
+ else?: JSONSchema;
40
+ allOf?: readonly JSONSchema[];
41
+ anyOf?: readonly JSONSchema[];
42
+ oneOf?: readonly JSONSchema[];
43
+ not?: JSONSchema;
44
+ format?: string | undefined;
45
+ contentMediaType?: string | undefined;
46
+ contentEncoding?: string | undefined;
47
+ definitions?: Readonly<Record<string, JSONSchema>>;
48
+ title?: string | undefined;
49
+ description?: string | undefined;
50
+ default?: unknown;
51
+ readOnly?: boolean | undefined;
52
+ writeOnly?: boolean | undefined;
53
+ examples?: readonly unknown[];
54
+ nullable?: boolean;
55
+ }>;
56
+ type JSONSchemaReference = JSONSchema & Readonly<{
57
+ $id: string;
58
+ }>;
59
+ //#endregion
60
+ export { JSONSchema, JSONSchemaReference, JSONSchemaType };
@@ -0,0 +1,11 @@
1
+ import { $Resolve } from "../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/resolve.mjs";
2
+ import { DeserializationPattern } from "./definitions/deserializationPattern.mjs";
3
+ import { JSONSchema } from "./definitions/jsonSchema.mjs";
4
+ import { FromSchemaDefaultOptions, FromSchemaOptions } from "./definitions/fromSchemaOptions.mjs";
5
+ import { ParseOptions } from "./parse-options.mjs";
6
+ import { ParseSchema } from "./parse-schema/index.mjs";
7
+
8
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/index.d.ts
9
+ type FromSchema<SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions = FromSchemaDefaultOptions> = $Resolve<ParseSchema<SCHEMA, ParseOptions<SCHEMA, OPTIONS>>>;
10
+ //#endregion
11
+ export { FromSchema };
@@ -0,0 +1,16 @@
1
+ import { DeserializationPattern } from "./definitions/deserializationPattern.mjs";
2
+ import { JSONSchema, JSONSchemaReference } from "./definitions/jsonSchema.mjs";
3
+ import { FromSchemaDefaultOptions, FromSchemaOptions } from "./definitions/fromSchemaOptions.mjs";
4
+
5
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-options.d.ts
6
+ type IndexReferencesById<SCHEMA_REFERENCES extends readonly JSONSchemaReference[]> = { [REF_SCHEMA in SCHEMA_REFERENCES[number] as REF_SCHEMA["$id"]]: REF_SCHEMA };
7
+ type ParseOptions<ROOT_SCHEMA extends JSONSchema, OPTIONS extends FromSchemaOptions> = {
8
+ parseNotKeyword: OPTIONS["parseNotKeyword"] extends boolean ? OPTIONS["parseNotKeyword"] : FromSchemaDefaultOptions["parseNotKeyword"];
9
+ parseIfThenElseKeywords: OPTIONS["parseIfThenElseKeywords"] extends boolean ? OPTIONS["parseIfThenElseKeywords"] : FromSchemaDefaultOptions["parseIfThenElseKeywords"];
10
+ keepDefaultedPropertiesOptional: OPTIONS["keepDefaultedPropertiesOptional"] extends boolean ? OPTIONS["keepDefaultedPropertiesOptional"] : FromSchemaDefaultOptions["keepDefaultedPropertiesOptional"];
11
+ rootSchema: ROOT_SCHEMA;
12
+ references: OPTIONS["references"] extends JSONSchemaReference[] ? IndexReferencesById<OPTIONS["references"]> : {};
13
+ deserialize: OPTIONS["deserialize"] extends DeserializationPattern[] | false ? OPTIONS["deserialize"] : FromSchemaDefaultOptions["deserialize"];
14
+ };
15
+ //#endregion
16
+ export { ParseOptions };
@@ -0,0 +1,13 @@
1
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
2
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
3
+ import { MergeSubSchema } from "./utils.mjs";
4
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
5
+
6
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/allOf.d.ts
7
+ type AllOfSchema = JSONSchema & Readonly<{
8
+ allOf: readonly JSONSchema[];
9
+ }>;
10
+ type ParseAllOfSchema<ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions> = RecurseOnAllOfSchema<ALL_OF_SCHEMA["allOf"], ALL_OF_SCHEMA, OPTIONS, ParseSchema<Omit<ALL_OF_SCHEMA, "allOf">, OPTIONS>>;
11
+ type RecurseOnAllOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ALL_OF_SCHEMA extends AllOfSchema, OPTIONS extends ParseSchemaOptions, PARSED_ROOT_ALL_OF_SCHEMA> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAllOfSchema<SUB_SCHEMAS_TAIL, ROOT_ALL_OF_SCHEMA, OPTIONS, $Intersect<ParseSchema<MergeSubSchema<Omit<ROOT_ALL_OF_SCHEMA, "allOf">, SUB_SCHEMAS_HEAD>, OPTIONS>, PARSED_ROOT_ALL_OF_SCHEMA>> : never : never : PARSED_ROOT_ALL_OF_SCHEMA;
12
+ //#endregion
13
+ export { AllOfSchema, ParseAllOfSchema };
@@ -0,0 +1,14 @@
1
+ import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
+ import { MergeSubSchema } from "./utils.mjs";
5
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
+
7
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/anyOf.d.ts
8
+ type AnyOfSchema = JSONSchema & Readonly<{
9
+ anyOf: readonly JSONSchema[];
10
+ }>;
11
+ type ParseAnyOfSchema<ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnAnyOfSchema<ANY_OF_SCHEMA["anyOf"], ANY_OF_SCHEMA, OPTIONS>>;
12
+ type RecurseOnAnyOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ANY_OF_SCHEMA extends AnyOfSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnAnyOfSchema<SUB_SCHEMAS_TAIL, ROOT_ANY_OF_SCHEMA, OPTIONS, RESULT | $Intersect<ParseSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, OPTIONS>, ParseSchema<MergeSubSchema<Omit<ROOT_ANY_OF_SCHEMA, "anyOf">, SUB_SCHEMAS_HEAD>, OPTIONS>>> : never : never : RESULT;
13
+ //#endregion
14
+ export { AnyOfSchema, ParseAnyOfSchema };
@@ -0,0 +1,58 @@
1
+ import { Never } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.mjs";
2
+ import { $Tuple } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/tuple.mjs";
3
+ import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
4
+ import { _$Array } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.mjs";
5
+ import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
6
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
7
+ import { And } from "../type-utils/and.mjs";
8
+ import { DoesExtend } from "../type-utils/extends.mjs";
9
+ import { Not } from "../type-utils/not.mjs";
10
+ import { Tail } from "../type-utils/tail.mjs";
11
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
12
+
13
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/array.d.ts
14
+ type ArrayOrTupleSchema = JSONSchema & Readonly<{
15
+ type: "array";
16
+ }>;
17
+ type ArraySchema = Omit<JSONSchema, "items"> & Readonly<{
18
+ type: "array";
19
+ items: JSONSchema;
20
+ }>;
21
+ type TupleSchema = JSONSchema & Readonly<{
22
+ type: "array";
23
+ items: readonly JSONSchema[];
24
+ }>;
25
+ type ParseArrayOrTupleSchema<ARRAY_OR_TUPLE_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ARRAY_OR_TUPLE_SCHEMA extends ArraySchema ? _$Array<ParseSchema<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>> : ARRAY_OR_TUPLE_SCHEMA extends TupleSchema ? $Union<ApplyMinMaxAndAdditionalItems<ParseTupleItems<ARRAY_OR_TUPLE_SCHEMA["items"], OPTIONS>, ARRAY_OR_TUPLE_SCHEMA, OPTIONS>> : _$Array;
26
+ type ParseTupleItems<ITEM_SCHEMAS extends readonly JSONSchema[], OPTIONS extends ParseSchemaOptions> = ITEM_SCHEMAS extends readonly [infer ITEM_SCHEMAS_HEAD, ...infer ITEM_SCHEMAS_TAIL] ? ITEM_SCHEMAS_HEAD extends JSONSchema ? ITEM_SCHEMAS_TAIL extends readonly JSONSchema[] ? [ParseSchema<ITEM_SCHEMAS_HEAD, OPTIONS>, ...ParseTupleItems<ITEM_SCHEMAS_TAIL, OPTIONS>] : never : never : [];
27
+ type ApplyMinMaxAndAdditionalItems<PARSED_ITEM_SCHEMAS extends any[], ROOT_SCHEMA extends ArrayOrTupleSchema, OPTIONS extends ParseSchemaOptions> = ApplyAdditionalItems<ApplyMinMax<PARSED_ITEM_SCHEMAS, ROOT_SCHEMA extends Readonly<{
28
+ minItems: number;
29
+ }> ? ROOT_SCHEMA["minItems"] : 0, ROOT_SCHEMA extends Readonly<{
30
+ maxItems: number;
31
+ }> ? ROOT_SCHEMA["maxItems"] : undefined>, ROOT_SCHEMA extends Readonly<{
32
+ additionalItems: JSONSchema;
33
+ }> ? ROOT_SCHEMA["additionalItems"] : true, OPTIONS>;
34
+ type ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS extends any[], MIN extends number, MAX extends number | undefined, RESULT = never, HAS_ENCOUNTERED_MIN extends boolean = false, HAS_ENCOUNTERED_MAX extends boolean = false, INITIAL_PARSED_ITEM_SCHEMAS extends any[] = RECURSED_PARSED_ITEM_SCHEMAS> = And<Not<DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>>, DoesExtend<RECURSED_PARSED_ITEM_SCHEMAS, [any, ...any[]]>> extends true ? RECURSED_PARSED_ITEM_SCHEMAS extends [...infer RECURSED_PARSED_ITEM_SCHEMAS_BODY, unknown] ? ApplyMinMax<RECURSED_PARSED_ITEM_SCHEMAS_BODY, MIN, MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"] extends MAX ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>, HAS_ENCOUNTERED_MIN extends true ? true : DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, HAS_ENCOUNTERED_MAX extends true ? true : DoesExtend<MAX, RECURSED_PARSED_ITEM_SCHEMAS["length"]>, INITIAL_PARSED_ITEM_SCHEMAS> : never : {
35
+ result: MAX extends undefined ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : HAS_ENCOUNTERED_MAX extends true ? RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? $Tuple<RECURSED_PARSED_ITEM_SCHEMAS> : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX> extends true ? never : RESULT | $Tuple<RECURSED_PARSED_ITEM_SCHEMAS>;
36
+ hasEncounteredMin: DoesExtend<MIN, RECURSED_PARSED_ITEM_SCHEMAS["length"]>;
37
+ hasEncounteredMax: HAS_ENCOUNTERED_MAX extends true ? true : MAX extends RECURSED_PARSED_ITEM_SCHEMAS["length"] ? true : IsLongerThan<Tail<RECURSED_PARSED_ITEM_SCHEMAS>, MAX>;
38
+ completeTuple: INITIAL_PARSED_ITEM_SCHEMAS;
39
+ };
40
+ type IsLongerThan<TUPLE extends any[], LENGTH extends number | undefined, RESULT extends boolean = false> = LENGTH extends undefined ? false : TUPLE["length"] extends LENGTH ? true : TUPLE extends [any, ...infer TUPLE_TAIL] ? IsLongerThan<TUPLE_TAIL, LENGTH> : RESULT;
41
+ type ApplyAdditionalItems<APPLY_MIN_MAX_RESULT extends {
42
+ result: any;
43
+ hasEncounteredMin: boolean;
44
+ hasEncounteredMax: boolean;
45
+ completeTuple: any[];
46
+ }, ADDITIONAL_ITEMS_SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions> = APPLY_MIN_MAX_RESULT extends {
47
+ hasEncounteredMax: true;
48
+ } ? APPLY_MIN_MAX_RESULT extends {
49
+ hasEncounteredMin: true;
50
+ } ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends false ? APPLY_MIN_MAX_RESULT extends {
51
+ hasEncounteredMin: true;
52
+ } ? APPLY_MIN_MAX_RESULT["result"] : Never : ADDITIONAL_ITEMS_SCHEMA extends true ? APPLY_MIN_MAX_RESULT extends {
53
+ hasEncounteredMin: true;
54
+ } ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], Any> : APPLY_MIN_MAX_RESULT extends {
55
+ hasEncounteredMin: true;
56
+ } ? APPLY_MIN_MAX_RESULT["result"] | $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>> : $Tuple<APPLY_MIN_MAX_RESULT["completeTuple"], ParseSchema<ADDITIONAL_ITEMS_SCHEMA, OPTIONS>>;
57
+ //#endregion
58
+ export { ArrayOrTupleSchema, ParseArrayOrTupleSchema };
@@ -0,0 +1,14 @@
1
+ import { Const } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/const.mjs";
2
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
+ import { Writable } from "../type-utils/writable.mjs";
5
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
+
7
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/const.d.ts
8
+ type ConstSchema = JSONSchema & Readonly<{
9
+ const: unknown;
10
+ }>;
11
+ type ParseConstSchema<CONST_SCHEMA extends ConstSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseConst<CONST_SCHEMA>, ParseSchema<Omit<CONST_SCHEMA, "const">, OPTIONS>>;
12
+ type ParseConst<CONST_SCHEMA extends ConstSchema> = Const<Writable<CONST_SCHEMA["const"]>>;
13
+ //#endregion
14
+ export { ConstSchema, ParseConstSchema };
@@ -0,0 +1,13 @@
1
+ import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
2
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
+ import { DeserializationPattern } from "../definitions/deserializationPattern.mjs";
4
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
5
+ import { ParseSchemaOptions } from "./index.mjs";
6
+
7
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/deserialize.d.ts
8
+ type DeserializeSchema<SCHEMA extends JSONSchema, OPTIONS extends Omit<ParseSchemaOptions, "deserialize"> & {
9
+ deserialize: DeserializationPattern[];
10
+ }> = RecurseOnDeserializationPatterns<SCHEMA, OPTIONS["deserialize"]>;
11
+ type RecurseOnDeserializationPatterns<SCHEMA extends JSONSchema, DESERIALIZATION_PATTERNS extends DeserializationPattern[], RESULT = Any> = DESERIALIZATION_PATTERNS extends [infer DESERIALIZATION_PATTERNS_HEAD, ...infer DESERIALIZATION_PATTERNS_TAIL] ? DESERIALIZATION_PATTERNS_HEAD extends DeserializationPattern ? DESERIALIZATION_PATTERNS_TAIL extends DeserializationPattern[] ? RecurseOnDeserializationPatterns<SCHEMA, DESERIALIZATION_PATTERNS_TAIL, SCHEMA extends DESERIALIZATION_PATTERNS_HEAD["pattern"] ? $Intersect<Any<true, DESERIALIZATION_PATTERNS_HEAD["output"]>, RESULT> : RESULT> : never : never : RESULT;
12
+ //#endregion
13
+ export { DeserializeSchema };
@@ -0,0 +1,14 @@
1
+ import { Enum } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/enum.mjs";
2
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
+ import { Writable } from "../type-utils/writable.mjs";
5
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
+
7
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/enum.d.ts
8
+ type EnumSchema = JSONSchema & Readonly<{
9
+ enum: readonly unknown[];
10
+ }>;
11
+ type ParseEnumSchema<ENUM_SCHEMA extends EnumSchema, OPTIONS extends ParseSchemaOptions> = $Intersect<ParseEnum<ENUM_SCHEMA>, ParseSchema<Omit<ENUM_SCHEMA, "enum">, OPTIONS>>;
12
+ type ParseEnum<ENUM_SCHEMA extends EnumSchema> = Enum<Writable<ENUM_SCHEMA["enum"][number]>>;
13
+ //#endregion
14
+ export { EnumSchema, ParseEnumSchema };
@@ -0,0 +1,20 @@
1
+ import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
+ import { _$Exclude } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.mjs";
4
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
5
+ import { MergeSubSchema } from "./utils.mjs";
6
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
7
+
8
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/ifThenElse.d.ts
9
+ type IfThenElseSchema = JSONSchema & {
10
+ if: JSONSchema;
11
+ then?: JSONSchema;
12
+ else?: JSONSchema;
13
+ };
14
+ type ParseIfThenElseSchema<IF_THEN_ELSE_SCHEMA extends IfThenElseSchema, OPTIONS extends ParseSchemaOptions, REST_SCHEMA extends JSONSchema = Omit<IF_THEN_ELSE_SCHEMA, "if" | "then" | "else">, IF_SCHEMA extends JSONSchema = MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["if"]>, PARSED_THEN_SCHEMA = (IF_THEN_ELSE_SCHEMA extends {
15
+ then: JSONSchema;
16
+ } ? $Intersect<ParseSchema<IF_SCHEMA, OPTIONS>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["then"]>, OPTIONS>> : ParseSchema<IF_SCHEMA, OPTIONS>), PARSED_ELSE_SCHEMA = (IF_THEN_ELSE_SCHEMA extends {
17
+ else: JSONSchema;
18
+ } ? $Intersect<_$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>, ParseSchema<MergeSubSchema<REST_SCHEMA, IF_THEN_ELSE_SCHEMA["else"]>, OPTIONS>> : _$Exclude<ParseSchema<REST_SCHEMA, OPTIONS>, ParseSchema<IF_SCHEMA, OPTIONS>>)> = $Intersect<$Union<PARSED_THEN_SCHEMA | PARSED_ELSE_SCHEMA>, ParseSchema<REST_SCHEMA, OPTIONS>>;
19
+ //#endregion
20
+ export { IfThenElseSchema, ParseIfThenElseSchema };
@@ -0,0 +1,34 @@
1
+ import { Never } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.mjs";
2
+ import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
3
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
4
+ import { DeserializationPattern } from "../definitions/deserializationPattern.mjs";
5
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
6
+ import { And } from "../type-utils/and.mjs";
7
+ import { DoesExtend } from "../type-utils/extends.mjs";
8
+ import { AllOfSchema, ParseAllOfSchema } from "./allOf.mjs";
9
+ import { AnyOfSchema, ParseAnyOfSchema } from "./anyOf.mjs";
10
+ import { ConstSchema, ParseConstSchema } from "./const.mjs";
11
+ import { DeserializeSchema } from "./deserialize.mjs";
12
+ import { EnumSchema, ParseEnumSchema } from "./enum.mjs";
13
+ import { IfThenElseSchema, ParseIfThenElseSchema } from "./ifThenElse.mjs";
14
+ import { MultipleTypesSchema, ParseMultipleTypesSchema } from "./multipleTypes.mjs";
15
+ import { NotSchema, ParseNotSchema } from "./not.mjs";
16
+ import { NullableSchema, ParseNullableSchema } from "./nullable.mjs";
17
+ import { OneOfSchema, ParseOneOfSchema } from "./oneOf.mjs";
18
+ import { ParseReferenceSchema, ReferencingSchema } from "./references/index.mjs";
19
+ import { ParseSingleTypeSchema, SingleTypeSchema } from "./singleType.mjs";
20
+
21
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/index.d.ts
22
+ type ParseSchemaOptions = {
23
+ parseNotKeyword: boolean;
24
+ parseIfThenElseKeywords: boolean;
25
+ keepDefaultedPropertiesOptional: boolean;
26
+ rootSchema: JSONSchema;
27
+ references: Record<string, JSONSchema>;
28
+ deserialize: DeserializationPattern[] | false;
29
+ };
30
+ type ParseSchema<SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions, RESULT = (JSONSchema extends SCHEMA ? Any : SCHEMA extends true | string ? Any : SCHEMA extends false ? Never : SCHEMA extends NullableSchema ? ParseNullableSchema<SCHEMA, OPTIONS> : SCHEMA extends ReferencingSchema ? ParseReferenceSchema<SCHEMA, OPTIONS> : And<DoesExtend<OPTIONS["parseIfThenElseKeywords"], true>, DoesExtend<SCHEMA, IfThenElseSchema>> extends true ? SCHEMA extends IfThenElseSchema ? ParseIfThenElseSchema<SCHEMA, OPTIONS> : never : And<DoesExtend<OPTIONS["parseNotKeyword"], true>, DoesExtend<SCHEMA, NotSchema>> extends true ? SCHEMA extends NotSchema ? ParseNotSchema<SCHEMA, OPTIONS> : never : SCHEMA extends AllOfSchema ? ParseAllOfSchema<SCHEMA, OPTIONS> : SCHEMA extends OneOfSchema ? ParseOneOfSchema<SCHEMA, OPTIONS> : SCHEMA extends AnyOfSchema ? ParseAnyOfSchema<SCHEMA, OPTIONS> : SCHEMA extends EnumSchema ? ParseEnumSchema<SCHEMA, OPTIONS> : SCHEMA extends ConstSchema ? ParseConstSchema<SCHEMA, OPTIONS> : SCHEMA extends MultipleTypesSchema ? ParseMultipleTypesSchema<SCHEMA, OPTIONS> : SCHEMA extends SingleTypeSchema ? ParseSingleTypeSchema<SCHEMA, OPTIONS> : Any)> = OPTIONS extends {
31
+ deserialize: DeserializationPattern[];
32
+ } ? $Intersect<DeserializeSchema<SCHEMA, OPTIONS>, RESULT> : RESULT;
33
+ //#endregion
34
+ export { ParseSchema, ParseSchemaOptions };
@@ -0,0 +1,14 @@
1
+ import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
+ import { JSONSchema, JSONSchemaType } from "../definitions/jsonSchema.mjs";
3
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
4
+
5
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/multipleTypes.d.ts
6
+ type MultipleTypesSchema = JSONSchema & Readonly<{
7
+ type: readonly JSONSchemaType[];
8
+ }>;
9
+ type ParseMultipleTypesSchema<MULTI_TYPE_SCHEMA extends MultipleTypesSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnMixedSchema<MULTI_TYPE_SCHEMA["type"], MULTI_TYPE_SCHEMA, OPTIONS>>;
10
+ type RecurseOnMixedSchema<TYPES extends readonly JSONSchemaType[], ROOT_MULTI_TYPE_SCHEMA extends MultipleTypesSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = TYPES extends readonly [infer TYPES_HEAD, ...infer TYPES_TAIL] ? TYPES_HEAD extends JSONSchemaType ? TYPES_TAIL extends readonly JSONSchemaType[] ? RecurseOnMixedSchema<TYPES_TAIL, ROOT_MULTI_TYPE_SCHEMA, OPTIONS, RESULT | ParseSchema<Omit<ROOT_MULTI_TYPE_SCHEMA, "type"> & {
11
+ type: TYPES_HEAD;
12
+ }, OPTIONS>> : never : never : RESULT;
13
+ //#endregion
14
+ export { MultipleTypesSchema, ParseMultipleTypesSchema };
@@ -0,0 +1,20 @@
1
+ import { Never } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.mjs";
2
+ import { _Object } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.mjs";
3
+ import { Primitive } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.mjs";
4
+ import { Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
5
+ import { _Array } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/array.mjs";
6
+ import { Any, AnyType } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
7
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
8
+ import { _$Exclude } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/exclusion/index.mjs";
9
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
10
+ import { MergeSubSchema } from "./utils.mjs";
11
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
12
+
13
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/not.d.ts
14
+ type NotSchema = JSONSchema & Readonly<{
15
+ not: JSONSchema;
16
+ }>;
17
+ type AllTypes = Union<Primitive<null> | Primitive<boolean> | Primitive<number> | Primitive<string> | _Array | _Object<{}, never, Any>>;
18
+ type ParseNotSchema<NOT_SCHEMA extends NotSchema, OPTIONS extends ParseSchemaOptions, PARSED_REST_SCHEMA = ParseSchema<Omit<NOT_SCHEMA, "not">, OPTIONS>, EXCLUSION = _$Exclude<PARSED_REST_SCHEMA extends AnyType ? $Intersect<AllTypes, PARSED_REST_SCHEMA> : PARSED_REST_SCHEMA, ParseSchema<MergeSubSchema<Omit<NOT_SCHEMA, "not">, NOT_SCHEMA["not"]>, OPTIONS>>> = EXCLUSION extends Never ? PARSED_REST_SCHEMA : EXCLUSION;
19
+ //#endregion
20
+ export { NotSchema, ParseNotSchema };
@@ -0,0 +1,14 @@
1
+ import { Primitive } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.mjs";
2
+ import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
3
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
5
+
6
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/nullable.d.ts
7
+ type NullableSchema = JSONSchema & Readonly<{
8
+ nullable: boolean;
9
+ }>;
10
+ type ParseNullableSchema<NULLABLE_SCHEMA extends NullableSchema, OPTIONS extends ParseSchemaOptions, PARSED_REST_SCHEMA = ParseSchema<Omit<NULLABLE_SCHEMA, "nullable">, OPTIONS>> = NULLABLE_SCHEMA extends Readonly<{
11
+ nullable: true;
12
+ }> ? $Union<Primitive<null> | PARSED_REST_SCHEMA> : PARSED_REST_SCHEMA;
13
+ //#endregion
14
+ export { NullableSchema, ParseNullableSchema };
@@ -0,0 +1,34 @@
1
+ import { _$Object } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/object.mjs";
2
+ import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
3
+ import { Any } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/any.mjs";
4
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
5
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
+
7
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/object.d.ts
8
+ type ObjectSchema = JSONSchema & Readonly<{
9
+ type: "object";
10
+ }>;
11
+ type ParseObjectSchema<OBJECT_SCHEMA extends ObjectSchema, OPTIONS extends ParseSchemaOptions> = OBJECT_SCHEMA extends Readonly<{
12
+ properties: Readonly<Record<string, JSONSchema>>;
13
+ }> ? _$Object<{ [KEY in keyof OBJECT_SCHEMA["properties"]]: ParseSchema<OBJECT_SCHEMA["properties"][KEY], OPTIONS> }, GetRequired<OBJECT_SCHEMA, OPTIONS>, GetOpenProps<OBJECT_SCHEMA, OPTIONS>, GetClosedOnResolve<OBJECT_SCHEMA>> : _$Object<{}, GetRequired<OBJECT_SCHEMA, OPTIONS>, GetOpenProps<OBJECT_SCHEMA, OPTIONS>, GetClosedOnResolve<OBJECT_SCHEMA>>;
14
+ type GetRequired<OBJECT_SCHEMA extends ObjectSchema, OPTIONS extends ParseSchemaOptions> = (OBJECT_SCHEMA extends Readonly<{
15
+ required: ReadonlyArray<string>;
16
+ }> ? OBJECT_SCHEMA["required"][number] : never) | (OPTIONS["keepDefaultedPropertiesOptional"] extends true ? never : OBJECT_SCHEMA extends Readonly<{
17
+ properties: Readonly<Record<string, JSONSchema>>;
18
+ }> ? { [KEY in keyof OBJECT_SCHEMA["properties"] & string]: OBJECT_SCHEMA["properties"][KEY] extends Readonly<{
19
+ default: unknown;
20
+ }> ? KEY : never }[keyof OBJECT_SCHEMA["properties"] & string] : never);
21
+ type GetOpenProps<OBJECT_SCHEMA extends ObjectSchema, OPTIONS extends ParseSchemaOptions> = OBJECT_SCHEMA extends Readonly<{
22
+ additionalProperties: JSONSchema;
23
+ }> ? OBJECT_SCHEMA extends Readonly<{
24
+ patternProperties: Record<string, JSONSchema>;
25
+ }> ? AdditionalAndPatternProps<OBJECT_SCHEMA["additionalProperties"], OBJECT_SCHEMA["patternProperties"], OPTIONS> : ParseSchema<OBJECT_SCHEMA["additionalProperties"], OPTIONS> : OBJECT_SCHEMA extends Readonly<{
26
+ patternProperties: Record<string, JSONSchema>;
27
+ }> ? PatternProps<OBJECT_SCHEMA["patternProperties"], OPTIONS> : Any;
28
+ type GetClosedOnResolve<OBJECT_SCHEMA extends ObjectSchema> = OBJECT_SCHEMA extends Readonly<{
29
+ unevaluatedProperties: false;
30
+ }> ? true : false;
31
+ type PatternProps<PATTERN_PROPERTY_SCHEMAS extends Readonly<Record<string, JSONSchema>>, OPTIONS extends ParseSchemaOptions> = $Union<{ [KEY in keyof PATTERN_PROPERTY_SCHEMAS]: ParseSchema<PATTERN_PROPERTY_SCHEMAS[KEY], OPTIONS> }[keyof PATTERN_PROPERTY_SCHEMAS]>;
32
+ type AdditionalAndPatternProps<ADDITIONAL_PROPERTIES_SCHEMA extends JSONSchema, PATTERN_PROPERTY_SCHEMAS extends Readonly<Record<string, JSONSchema>>, OPTIONS extends ParseSchemaOptions> = ADDITIONAL_PROPERTIES_SCHEMA extends boolean ? PatternProps<PATTERN_PROPERTY_SCHEMAS, OPTIONS> : $Union<ParseSchema<ADDITIONAL_PROPERTIES_SCHEMA, OPTIONS> | { [KEY in keyof PATTERN_PROPERTY_SCHEMAS]: ParseSchema<PATTERN_PROPERTY_SCHEMAS[KEY], OPTIONS> }[keyof PATTERN_PROPERTY_SCHEMAS]>;
33
+ //#endregion
34
+ export { ObjectSchema, ParseObjectSchema };
@@ -0,0 +1,14 @@
1
+ import { $Union } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/union.mjs";
2
+ import { $Intersect } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
3
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
4
+ import { MergeSubSchema } from "./utils.mjs";
5
+ import { ParseSchema, ParseSchemaOptions } from "./index.mjs";
6
+
7
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/oneOf.d.ts
8
+ type OneOfSchema = JSONSchema & Readonly<{
9
+ oneOf: readonly JSONSchema[];
10
+ }>;
11
+ type ParseOneOfSchema<ONE_OF_SCHEMA extends OneOfSchema, OPTIONS extends ParseSchemaOptions> = $Union<RecurseOnOneOfSchema<ONE_OF_SCHEMA["oneOf"], ONE_OF_SCHEMA, OPTIONS>>;
12
+ type RecurseOnOneOfSchema<SUB_SCHEMAS extends readonly JSONSchema[], ROOT_ONE_OF_SCHEMA extends OneOfSchema, OPTIONS extends ParseSchemaOptions, RESULT = never> = SUB_SCHEMAS extends readonly [infer SUB_SCHEMAS_HEAD, ...infer SUB_SCHEMAS_TAIL] ? SUB_SCHEMAS_HEAD extends JSONSchema ? SUB_SCHEMAS_TAIL extends readonly JSONSchema[] ? RecurseOnOneOfSchema<SUB_SCHEMAS_TAIL, ROOT_ONE_OF_SCHEMA, OPTIONS, RESULT | $Intersect<ParseSchema<Omit<ROOT_ONE_OF_SCHEMA, "oneOf">, OPTIONS>, ParseSchema<MergeSubSchema<Omit<ROOT_ONE_OF_SCHEMA, "oneOf">, SUB_SCHEMAS_HEAD>, OPTIONS>>> : never : never : RESULT;
13
+ //#endregion
14
+ export { OneOfSchema, ParseOneOfSchema };
@@ -0,0 +1,22 @@
1
+ import { Never } from "../../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.mjs";
2
+ import { JSONSchema } from "../../definitions/jsonSchema.mjs";
3
+ import { Join } from "../../type-utils/join.mjs";
4
+ import { Pop } from "../../type-utils/pop.mjs";
5
+ import { Split } from "../../type-utils/split.mjs";
6
+ import { ParseReference } from "./utils.mjs";
7
+ import { ReferencingSchema } from "./index.mjs";
8
+ import { ParseSchemaOptions } from "../index.mjs";
9
+
10
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/external.d.ts
11
+ type ParseExternalReferenceSchema<REF_SCHEMA extends ReferencingSchema, OPTIONS extends ParseSchemaOptions, EXTERNAL_REFERENCE_ID extends string, SUB_PATH extends string | undefined> = OPTIONS["references"] extends { [KEY in EXTERNAL_REFERENCE_ID]: JSONSchema } ? ParseReference<Omit<REF_SCHEMA, "$ref">, OPTIONS, OPTIONS["references"][EXTERNAL_REFERENCE_ID], SUB_PATH> : OPTIONS extends {
12
+ rootSchema: IdSchema;
13
+ } ? ParseExternalReferenceWithoutDirectorySchema<Omit<REF_SCHEMA, "$ref">, OPTIONS, EXTERNAL_REFERENCE_ID, SUB_PATH> : Never;
14
+ type ParseDirectory<REFERENCE extends string> = Join<Pop<Split<REFERENCE, "/">>, "/">;
15
+ type IdSchema = JSONSchema & {
16
+ $id: string;
17
+ };
18
+ type ParseExternalReferenceWithoutDirectorySchema<SUB_SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions & {
19
+ rootSchema: IdSchema;
20
+ }, EXTERNAL_REFERENCE_ID extends string, SUB_PATH extends string | undefined, DIRECTORY extends string = ParseDirectory<OPTIONS["rootSchema"]["$id"]>, COMPLETE_REFERENCE extends string = Join<[DIRECTORY, EXTERNAL_REFERENCE_ID], "/">> = COMPLETE_REFERENCE extends keyof OPTIONS["references"] ? ParseReference<SUB_SCHEMA, OPTIONS, OPTIONS["references"][COMPLETE_REFERENCE], SUB_PATH> : Never;
21
+ //#endregion
22
+ export { ParseExternalReferenceSchema };
@@ -0,0 +1,13 @@
1
+ import { JSONSchema } from "../../definitions/jsonSchema.mjs";
2
+ import { Split } from "../../type-utils/split.mjs";
3
+ import { ParseExternalReferenceSchema } from "./external.mjs";
4
+ import { ParseInternalReferenceSchema } from "./internal.mjs";
5
+ import { ParseSchemaOptions } from "../index.mjs";
6
+
7
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/index.d.ts
8
+ type ReferencingSchema = JSONSchema & {
9
+ $ref: string;
10
+ };
11
+ type ParseReferenceSchema<REFERENCING_SCHEMA extends ReferencingSchema, OPTIONS extends ParseSchemaOptions, REFERENCE_ID_AND_PATH extends string[] = Split<REFERENCING_SCHEMA["$ref"], "#">> = REFERENCE_ID_AND_PATH[0] extends "" ? ParseInternalReferenceSchema<REFERENCING_SCHEMA, OPTIONS, REFERENCE_ID_AND_PATH[1]> : ParseExternalReferenceSchema<REFERENCING_SCHEMA, OPTIONS, REFERENCE_ID_AND_PATH[0], REFERENCE_ID_AND_PATH[1]>;
12
+ //#endregion
13
+ export { ParseReferenceSchema, ReferencingSchema };
@@ -0,0 +1,8 @@
1
+ import { ParseReference } from "./utils.mjs";
2
+ import { ReferencingSchema } from "./index.mjs";
3
+ import { ParseSchemaOptions } from "../index.mjs";
4
+
5
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/internal.d.ts
6
+ type ParseInternalReferenceSchema<REFERENCING_SCHEMA extends ReferencingSchema, OPTIONS extends ParseSchemaOptions, PATH extends string> = ParseReference<Omit<REFERENCING_SCHEMA, "$ref">, OPTIONS, OPTIONS["rootSchema"], PATH>;
7
+ //#endregion
8
+ export { ParseInternalReferenceSchema };
@@ -0,0 +1,12 @@
1
+ import { $Intersect } from "../../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/intersection/index.mjs";
2
+ import { JSONSchema } from "../../definitions/jsonSchema.mjs";
3
+ import { DeepGet } from "../../type-utils/get.mjs";
4
+ import { Split } from "../../type-utils/split.mjs";
5
+ import { Tail } from "../../type-utils/tail.mjs";
6
+ import { MergeSubSchema } from "../utils.mjs";
7
+ import { ParseSchema, ParseSchemaOptions } from "../index.mjs";
8
+
9
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/references/utils.d.ts
10
+ type ParseReference<SCHEMA extends JSONSchema, OPTIONS extends ParseSchemaOptions, REFERENCE_SOURCE extends JSONSchema, PATH_IN_SOURCE extends string | undefined, MATCHING_REFERENCE extends JSONSchema = (PATH_IN_SOURCE extends string ? DeepGet<REFERENCE_SOURCE, Tail<Split<PATH_IN_SOURCE, "/">>, false> : REFERENCE_SOURCE)> = $Intersect<ParseSchema<MATCHING_REFERENCE, OPTIONS>, ParseSchema<MergeSubSchema<MATCHING_REFERENCE, SCHEMA>, OPTIONS>>;
11
+ //#endregion
12
+ export { ParseReference };
@@ -0,0 +1,24 @@
1
+ import { Never } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/never.mjs";
2
+ import { Primitive } from "../../../../../../ts-algebra@2.0.0/node_modules/ts-algebra/lib/meta-types/primitive.mjs";
3
+ import { JSONSchema, JSONSchemaType } from "../definitions/jsonSchema.mjs";
4
+ import { ArrayOrTupleSchema, ParseArrayOrTupleSchema } from "./array.mjs";
5
+ import { ObjectSchema, ParseObjectSchema } from "./object.mjs";
6
+ import { ParseSchemaOptions } from "./index.mjs";
7
+
8
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/singleType.d.ts
9
+ type SingleTypeSchema = JSONSchema & Readonly<{
10
+ type: JSONSchemaType;
11
+ }>;
12
+ type ParseSingleTypeSchema<SINGLE_TYPE_SCHEMA extends SingleTypeSchema, OPTIONS extends ParseSchemaOptions> = SINGLE_TYPE_SCHEMA extends Readonly<{
13
+ type: "null";
14
+ }> ? Primitive<null> : SINGLE_TYPE_SCHEMA extends Readonly<{
15
+ type: "boolean";
16
+ }> ? Primitive<boolean> : SINGLE_TYPE_SCHEMA extends Readonly<{
17
+ type: "integer";
18
+ }> ? Primitive<number> : SINGLE_TYPE_SCHEMA extends Readonly<{
19
+ type: "number";
20
+ }> ? Primitive<number> : SINGLE_TYPE_SCHEMA extends Readonly<{
21
+ type: "string";
22
+ }> ? Primitive<string> : SINGLE_TYPE_SCHEMA extends ArrayOrTupleSchema ? ParseArrayOrTupleSchema<SINGLE_TYPE_SCHEMA, OPTIONS> : SINGLE_TYPE_SCHEMA extends ObjectSchema ? ParseObjectSchema<SINGLE_TYPE_SCHEMA, OPTIONS> : Never;
23
+ //#endregion
24
+ export { ParseSingleTypeSchema, SingleTypeSchema };
@@ -0,0 +1,20 @@
1
+ import { JSONSchema } from "../definitions/jsonSchema.mjs";
2
+
3
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/parse-schema/utils.d.ts
4
+ type RemoveInvalidAdditionalItems<SCHEMA extends JSONSchema> = SCHEMA extends Readonly<{
5
+ items: JSONSchema | readonly JSONSchema[];
6
+ }> ? SCHEMA extends Readonly<{
7
+ additionalItems: JSONSchema;
8
+ }> ? SCHEMA : SCHEMA & Readonly<{
9
+ additionalItems: true;
10
+ }> : SCHEMA extends boolean ? SCHEMA : Omit<SCHEMA, "additionalItems">;
11
+ type RemoveInvalidAdditionalProperties<SCHEMA extends JSONSchema> = SCHEMA extends Readonly<{
12
+ additionalProperties: JSONSchema;
13
+ }> ? SCHEMA extends Readonly<{
14
+ properties: Readonly<Record<string, JSONSchema>>;
15
+ }> ? SCHEMA : SCHEMA & Readonly<{
16
+ properties: {};
17
+ }> : SCHEMA extends boolean ? SCHEMA : Omit<SCHEMA, "additionalProperties">;
18
+ type MergeSubSchema<PARENT_SCHEMA extends JSONSchema, SUB_SCHEMA extends JSONSchema, CLEANED_SUB_SCHEMA extends JSONSchema = RemoveInvalidAdditionalProperties<RemoveInvalidAdditionalItems<SUB_SCHEMA>>> = Omit<PARENT_SCHEMA, keyof CLEANED_SUB_SCHEMA | "additionalProperties" | "patternProperties" | "unevaluatedProperties" | "required" | "additionalItems"> & CLEANED_SUB_SCHEMA;
19
+ //#endregion
20
+ export { MergeSubSchema };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/and.d.ts
2
+ type And<CONDITION_A, CONDITION_B> = CONDITION_A extends true ? CONDITION_B extends true ? true : false : false;
3
+ //#endregion
4
+ export { And };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/extends.d.ts
2
+ type DoesExtend<TYPE_A, TYPE_B> = [TYPE_A] extends [TYPE_B] ? true : false;
3
+ //#endregion
4
+ export { DoesExtend };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/get.d.ts
2
+ type DeepGet<OBJECT, PATH extends string[], DEFAULT = undefined> = PATH extends [infer PATH_HEAD, ...infer PATH_TAIL] ? PATH_HEAD extends string ? PATH_TAIL extends string[] ? PATH_HEAD extends keyof OBJECT ? DeepGet<OBJECT[PATH_HEAD], PATH_TAIL, DEFAULT> : DEFAULT : never : never : OBJECT;
3
+ //#endregion
4
+ export { DeepGet };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/join.d.ts
2
+ type Join<STRINGS extends string[], SEPARATOR extends string = ","> = STRINGS extends [] ? "" : STRINGS extends [string] ? `${STRINGS[0]}` : STRINGS extends [string, ...infer STRINGS_TAIL] ? STRINGS_TAIL extends string[] ? `${STRINGS[0]}${SEPARATOR}${Join<STRINGS_TAIL, SEPARATOR>}` : never : string;
3
+ //#endregion
4
+ export { Join };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/not.d.ts
2
+ type Not<BOOL> = BOOL extends false ? true : BOOL extends true ? false : never;
3
+ //#endregion
4
+ export { Not };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/pop.d.ts
2
+ type Pop<ARRAY extends unknown[]> = ARRAY extends readonly [...infer ARRAY_BODY, unknown] | readonly [...infer ARRAY_BODY, unknown?] ? ARRAY_BODY : ARRAY;
3
+ //#endregion
4
+ export { Pop };
@@ -0,0 +1,7 @@
1
+ import { Pop } from "./pop.mjs";
2
+
3
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/split.d.ts
4
+ type RecursiveSplit<STRING extends string, SEPARATOR extends string = ""> = STRING extends `${infer BEFORE}${SEPARATOR}${infer AFTER}` ? [BEFORE, ...RecursiveSplit<AFTER, SEPARATOR>] : [STRING];
5
+ type Split<STRING extends string, SEPARATOR extends string = "", RESULT extends string[] = RecursiveSplit<STRING, SEPARATOR>> = SEPARATOR extends "" ? Pop<RESULT> : RESULT;
6
+ //#endregion
7
+ export { Split };
@@ -0,0 +1,4 @@
1
+ //#region node_modules/.pnpm/json-schema-to-ts@3.1.1/node_modules/json-schema-to-ts/lib/types/type-utils/tail.d.ts
2
+ type Tail<ARRAY extends unknown[]> = ARRAY extends readonly [] ? ARRAY : ARRAY extends readonly [unknown?, ...infer ARRAY_TAIL] ? ARRAY_TAIL : ARRAY;
3
+ //#endregion
4
+ export { Tail };