@visulima/prisma-dmmf-transformer 2.0.30 → 2.0.32

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/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## @visulima/prisma-dmmf-transformer [2.0.32](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.31...@visulima/prisma-dmmf-transformer@2.0.32) (2025-10-15)
2
+
3
+ ### Bug Fixes
4
+
5
+ * update dependencies in prisma-dmmf-transformer ([b36bcae](https://github.com/visulima/visulima/commit/b36bcae3f7afe7bbfad8c573e70f9d97c3b7ae35))
6
+
7
+ ## @visulima/prisma-dmmf-transformer [2.0.31](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.30...@visulima/prisma-dmmf-transformer@2.0.31) (2025-10-15)
8
+
9
+ ### Bug Fixes
10
+
11
+ * update @visulima/packem to 2.0.0-alpha.30 across multiple packages for improved compatibility ([27b346e](https://github.com/visulima/visulima/commit/27b346eaa1c0fb0e420d9a9824482028307f4249))
12
+ * update dependencies and improve code structure for JSON schema transformation ([88947c4](https://github.com/visulima/visulima/commit/88947c47b1bb7d55a7b2650a9e6c1ac99882b66e))
13
+
14
+ ### Miscellaneous Chores
15
+
16
+ * **deps:** update build scripts and remove cross-env dependency ([7510e82](https://github.com/visulima/visulima/commit/7510e826b9235a0013fe61c82a7eb333bc4cbb78))
17
+ * update dependencies and fix linting issues ([0e802fe](https://github.com/visulima/visulima/commit/0e802fe02bb9ed791659cb5f3c77605ae5b42ec8))
18
+ * update package dependencies across multiple packages for improved compatibility and performance ([9567591](https://github.com/visulima/visulima/commit/9567591c415da3002f3a4fe08f8caf7ce01ca5f7))
19
+ * update package.json and pnpm-lock.yaml to include publint@0.3.12 and adjust build/test commands to exclude shared-utils ([1f7b3c0](https://github.com/visulima/visulima/commit/1f7b3c0381d77edfeec80ea1bf57b3469e929414))
20
+ * update package.json scripts and vitest configuration ([6006ddf](https://github.com/visulima/visulima/commit/6006ddf468a500abb3f13223ea6e3a9876c0c31b))
21
+
1
22
  ## @visulima/prisma-dmmf-transformer [2.0.30](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.29...@visulima/prisma-dmmf-transformer@2.0.30) (2025-09-10)
2
23
 
3
24
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -27,7 +27,7 @@ SOFTWARE.
27
27
 
28
28
  # Licenses of bundled types
29
29
  The published @visulima/prisma-dmmf-transformer artifact additionally contains code with the following licenses:
30
- MIT, (MIT OR CC0-1.0)
30
+ MIT
31
31
 
32
32
  # Bundled types:
33
33
  ## @types/json-schema
@@ -57,133 +57,4 @@ Repository: https://github.com/DefinitelyTyped/DefinitelyTyped.git
57
57
  > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
58
58
  > SOFTWARE
59
59
 
60
- ---------------------------------------
61
-
62
- ## type-fest
63
- License: (MIT OR CC0-1.0)
64
- By: Sindre Sorhus
65
- Repository: sindresorhus/type-fest
66
-
67
- > Creative Commons Legal Code
68
- >
69
- > CC0 1.0 Universal
70
- >
71
- > CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
72
- > LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
73
- > ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
74
- > INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
75
- > REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
76
- > PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
77
- > THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
78
- > HEREUNDER.
79
- >
80
- > Statement of Purpose
81
- >
82
- > The laws of most jurisdictions throughout the world automatically confer
83
- > exclusive Copyright and Related Rights (defined below) upon the creator
84
- > and subsequent owner(s) (each and all, an "owner") of an original work of
85
- > authorship and/or a database (each, a "Work").
86
- >
87
- > Certain owners wish to permanently relinquish those rights to a Work for
88
- > the purpose of contributing to a commons of creative, cultural and
89
- > scientific works ("Commons") that the public can reliably and without fear
90
- > of later claims of infringement build upon, modify, incorporate in other
91
- > works, reuse and redistribute as freely as possible in any form whatsoever
92
- > and for any purposes, including without limitation commercial purposes.
93
- > These owners may contribute to the Commons to promote the ideal of a free
94
- > culture and the further production of creative, cultural and scientific
95
- > works, or to gain reputation or greater distribution for their Work in
96
- > part through the use and efforts of others.
97
- >
98
- > For these and/or other purposes and motivations, and without any
99
- > expectation of additional consideration or compensation, the person
100
- > associating CC0 with a Work (the "Affirmer"), to the extent that he or she
101
- > is an owner of Copyright and Related Rights in the Work, voluntarily
102
- > elects to apply CC0 to the Work and publicly distribute the Work under its
103
- > terms, with knowledge of his or her Copyright and Related Rights in the
104
- > Work and the meaning and intended legal effect of CC0 on those rights.
105
- >
106
- > 1. Copyright and Related Rights. A Work made available under CC0 may be
107
- > protected by copyright and related or neighboring rights ("Copyright and
108
- > Related Rights"). Copyright and Related Rights include, but are not
109
- > limited to, the following:
110
- >
111
- > i. the right to reproduce, adapt, distribute, perform, display,
112
- > communicate, and translate a Work;
113
- > ii. moral rights retained by the original author(s) and/or performer(s);
114
- > iii. publicity and privacy rights pertaining to a person's image or
115
- > likeness depicted in a Work;
116
- > iv. rights protecting against unfair competition in regards to a Work,
117
- > subject to the limitations in paragraph 4(a), below;
118
- > v. rights protecting the extraction, dissemination, use and reuse of data
119
- > in a Work;
120
- > vi. database rights (such as those arising under Directive 96/9/EC of the
121
- > European Parliament and of the Council of 11 March 1996 on the legal
122
- > protection of databases, and under any national implementation
123
- > thereof, including any amended or successor version of such
124
- > directive); and
125
- > vii. other similar, equivalent or corresponding rights throughout the
126
- > world based on applicable law or treaty, and any national
127
- > implementations thereof.
128
- >
129
- > 2. Waiver. To the greatest extent permitted by, but not in contravention
130
- > of, applicable law, Affirmer hereby overtly, fully, permanently,
131
- > irrevocably and unconditionally waives, abandons, and surrenders all of
132
- > Affirmer's Copyright and Related Rights and associated claims and causes
133
- > of action, whether now known or unknown (including existing as well as
134
- > future claims and causes of action), in the Work (i) in all territories
135
- > worldwide, (ii) for the maximum duration provided by applicable law or
136
- > treaty (including future time extensions), (iii) in any current or future
137
- > medium and for any number of copies, and (iv) for any purpose whatsoever,
138
- > including without limitation commercial, advertising or promotional
139
- > purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
140
- > member of the public at large and to the detriment of Affirmer's heirs and
141
- > successors, fully intending that such Waiver shall not be subject to
142
- > revocation, rescission, cancellation, termination, or any other legal or
143
- > equitable action to disrupt the quiet enjoyment of the Work by the public
144
- > as contemplated by Affirmer's express Statement of Purpose.
145
- >
146
- > 3. Public License Fallback. Should any part of the Waiver for any reason
147
- > be judged legally invalid or ineffective under applicable law, then the
148
- > Waiver shall be preserved to the maximum extent permitted taking into
149
- > account Affirmer's express Statement of Purpose. In addition, to the
150
- > extent the Waiver is so judged Affirmer hereby grants to each affected
151
- > person a royalty-free, non transferable, non sublicensable, non exclusive,
152
- > irrevocable and unconditional license to exercise Affirmer's Copyright and
153
- > Related Rights in the Work (i) in all territories worldwide, (ii) for the
154
- > maximum duration provided by applicable law or treaty (including future
155
- > time extensions), (iii) in any current or future medium and for any number
156
- > of copies, and (iv) for any purpose whatsoever, including without
157
- > limitation commercial, advertising or promotional purposes (the
158
- > "License"). The License shall be deemed effective as of the date CC0 was
159
- > applied by Affirmer to the Work. Should any part of the License for any
160
- > reason be judged legally invalid or ineffective under applicable law, such
161
- > partial invalidity or ineffectiveness shall not invalidate the remainder
162
- > of the License, and in such case Affirmer hereby affirms that he or she
163
- > will not (i) exercise any of his or her remaining Copyright and Related
164
- > Rights in the Work or (ii) assert any associated claims and causes of
165
- > action with respect to the Work, in either case contrary to Affirmer's
166
- > express Statement of Purpose.
167
- >
168
- > 4. Limitations and Disclaimers.
169
- >
170
- > a. No trademark or patent rights held by Affirmer are waived, abandoned,
171
- > surrendered, licensed or otherwise affected by this document.
172
- > b. Affirmer offers the Work as-is and makes no representations or
173
- > warranties of any kind concerning the Work, express, implied,
174
- > statutory or otherwise, including without limitation warranties of
175
- > title, merchantability, fitness for a particular purpose, non
176
- > infringement, or the absence of latent or other defects, accuracy, or
177
- > the present or absence of errors, whether or not discoverable, all to
178
- > the greatest extent permissible under applicable law.
179
- > c. Affirmer disclaims responsibility for clearing rights of other persons
180
- > that may apply to the Work or any use thereof, including without
181
- > limitation any person's Copyright and Related Rights in the Work.
182
- > Further, Affirmer disclaims responsibility for obtaining any necessary
183
- > consents, permissions or other rights required for any use of the
184
- > Work.
185
- > d. Affirmer understands and acknowledges that Creative Commons is not a
186
- > party to this document and has no duty or obligation with respect to
187
- > this CC0 or use of the Work.
188
-
189
60
  <!-- /TYPE_DEPENDENCIES -->
package/dist/index.cjs CHANGED
@@ -1,11 +1 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const getJSONSchemaProperty = require('./packem_shared/getJSONSchemaProperty-E2OXsCgc.cjs');
6
- const transformDMMF = require('./packem_shared/transformDMMF-CAcG255G.cjs');
7
-
8
-
9
-
10
- exports.getJSONSchemaProperty = getJSONSchemaProperty;
11
- exports.transformDMMF = transformDMMF;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./packem_shared/getJSONSchemaProperty-DRt6R_Y4.cjs"),r=require("./packem_shared/transformDMMF-CNWOKGfH.cjs");exports.getJSONSchemaProperty=e;exports.transformDMMF=r;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,193 @@
1
- export { default as getJSONSchemaProperty } from "./properties.d.cts";
2
- export { default as transformDMMF } from "./transform-dmmf.d.cts";
3
- export type { DefinitionMap, ModelMetaData, PropertyMap, PropertyMetaData, TransformOptions } from "./types.d.cts";
1
+ import { DMMF } from '@prisma/generator-helper';
2
+ import { ReadonlyDeep } from 'type-fest';
3
+
4
+ // ==================================================================================================
5
+ // JSON Schema Draft 07
6
+ // ==================================================================================================
7
+ // https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
8
+ // --------------------------------------------------------------------------------------------------
9
+
10
+ /**
11
+ * Primitive type
12
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
13
+ */
14
+ type JSONSchema7TypeName =
15
+ | "string" //
16
+ | "number"
17
+ | "integer"
18
+ | "boolean"
19
+ | "object"
20
+ | "array"
21
+ | "null";
22
+
23
+ /**
24
+ * Primitive type
25
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
26
+ */
27
+ type JSONSchema7Type =
28
+ | string //
29
+ | number
30
+ | boolean
31
+ | JSONSchema7Object
32
+ | JSONSchema7Array
33
+ | null;
34
+
35
+ // Workaround for infinite type recursion
36
+ interface JSONSchema7Object {
37
+ [key: string]: JSONSchema7Type;
38
+ }
39
+
40
+ // Workaround for infinite type recursion
41
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
42
+ interface JSONSchema7Array extends Array<JSONSchema7Type> {}
43
+
44
+ /**
45
+ * Meta schema
46
+ *
47
+ * Recommended values:
48
+ * - 'http://json-schema.org/schema#'
49
+ * - 'http://json-schema.org/hyper-schema#'
50
+ * - 'http://json-schema.org/draft-07/schema#'
51
+ * - 'http://json-schema.org/draft-07/hyper-schema#'
52
+ *
53
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
54
+ */
55
+ type JSONSchema7Version = string;
56
+
57
+ /**
58
+ * JSON Schema v7
59
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
60
+ */
61
+ type JSONSchema7Definition = JSONSchema7 | boolean;
62
+ interface JSONSchema7 {
63
+ $id?: string | undefined;
64
+ $ref?: string | undefined;
65
+ $schema?: JSONSchema7Version | undefined;
66
+ $comment?: string | undefined;
67
+
68
+ /**
69
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
70
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
71
+ */
72
+ $defs?: {
73
+ [key: string]: JSONSchema7Definition;
74
+ } | undefined;
75
+
76
+ /**
77
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
78
+ */
79
+ type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
80
+ enum?: JSONSchema7Type[] | undefined;
81
+ const?: JSONSchema7Type | undefined;
82
+
83
+ /**
84
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
85
+ */
86
+ multipleOf?: number | undefined;
87
+ maximum?: number | undefined;
88
+ exclusiveMaximum?: number | undefined;
89
+ minimum?: number | undefined;
90
+ exclusiveMinimum?: number | undefined;
91
+
92
+ /**
93
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
94
+ */
95
+ maxLength?: number | undefined;
96
+ minLength?: number | undefined;
97
+ pattern?: string | undefined;
98
+
99
+ /**
100
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
101
+ */
102
+ items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
103
+ additionalItems?: JSONSchema7Definition | undefined;
104
+ maxItems?: number | undefined;
105
+ minItems?: number | undefined;
106
+ uniqueItems?: boolean | undefined;
107
+ contains?: JSONSchema7Definition | undefined;
108
+
109
+ /**
110
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
111
+ */
112
+ maxProperties?: number | undefined;
113
+ minProperties?: number | undefined;
114
+ required?: string[] | undefined;
115
+ properties?: {
116
+ [key: string]: JSONSchema7Definition;
117
+ } | undefined;
118
+ patternProperties?: {
119
+ [key: string]: JSONSchema7Definition;
120
+ } | undefined;
121
+ additionalProperties?: JSONSchema7Definition | undefined;
122
+ dependencies?: {
123
+ [key: string]: JSONSchema7Definition | string[];
124
+ } | undefined;
125
+ propertyNames?: JSONSchema7Definition | undefined;
126
+
127
+ /**
128
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
129
+ */
130
+ if?: JSONSchema7Definition | undefined;
131
+ then?: JSONSchema7Definition | undefined;
132
+ else?: JSONSchema7Definition | undefined;
133
+
134
+ /**
135
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
136
+ */
137
+ allOf?: JSONSchema7Definition[] | undefined;
138
+ anyOf?: JSONSchema7Definition[] | undefined;
139
+ oneOf?: JSONSchema7Definition[] | undefined;
140
+ not?: JSONSchema7Definition | undefined;
141
+
142
+ /**
143
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
144
+ */
145
+ format?: string | undefined;
146
+
147
+ /**
148
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
149
+ */
150
+ contentMediaType?: string | undefined;
151
+ contentEncoding?: string | undefined;
152
+
153
+ /**
154
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
155
+ */
156
+ definitions?: {
157
+ [key: string]: JSONSchema7Definition;
158
+ } | undefined;
159
+
160
+ /**
161
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
162
+ */
163
+ title?: string | undefined;
164
+ description?: string | undefined;
165
+ default?: JSONSchema7Type | undefined;
166
+ readOnly?: boolean | undefined;
167
+ writeOnly?: boolean | undefined;
168
+ examples?: JSONSchema7Type | undefined;
169
+ }
170
+
171
+ interface PropertyMetaData {
172
+ hasDefaultValue: boolean;
173
+ isScalar: boolean;
174
+ required: boolean;
175
+ }
176
+ interface ModelMetaData {
177
+ enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
178
+ }
179
+ type DefinitionMap = [name: string, definition: JSONSchema7Definition];
180
+ type PropertyMap = [...DefinitionMap, PropertyMetaData];
181
+ interface TransformOptions {
182
+ includeRequiredFields?: "false" | "true";
183
+ keepRelationScalarFields?: "false" | "true";
184
+ persistOriginalType?: "false" | "true";
185
+ schemaId?: string;
186
+ }
187
+
188
+ declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
189
+
190
+ declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
191
+
192
+ export { getJSONSchemaProperty, transformDmmf as transformDMMF };
193
+ export type { DefinitionMap, ModelMetaData, PropertyMap, PropertyMetaData, TransformOptions };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,193 @@
1
- export { default as getJSONSchemaProperty } from "./properties.d.mts";
2
- export { default as transformDMMF } from "./transform-dmmf.d.mts";
3
- export type { DefinitionMap, ModelMetaData, PropertyMap, PropertyMetaData, TransformOptions } from "./types.d.mts";
1
+ import { DMMF } from '@prisma/generator-helper';
2
+ import { ReadonlyDeep } from 'type-fest';
3
+
4
+ // ==================================================================================================
5
+ // JSON Schema Draft 07
6
+ // ==================================================================================================
7
+ // https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
8
+ // --------------------------------------------------------------------------------------------------
9
+
10
+ /**
11
+ * Primitive type
12
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
13
+ */
14
+ type JSONSchema7TypeName =
15
+ | "string" //
16
+ | "number"
17
+ | "integer"
18
+ | "boolean"
19
+ | "object"
20
+ | "array"
21
+ | "null";
22
+
23
+ /**
24
+ * Primitive type
25
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
26
+ */
27
+ type JSONSchema7Type =
28
+ | string //
29
+ | number
30
+ | boolean
31
+ | JSONSchema7Object
32
+ | JSONSchema7Array
33
+ | null;
34
+
35
+ // Workaround for infinite type recursion
36
+ interface JSONSchema7Object {
37
+ [key: string]: JSONSchema7Type;
38
+ }
39
+
40
+ // Workaround for infinite type recursion
41
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
42
+ interface JSONSchema7Array extends Array<JSONSchema7Type> {}
43
+
44
+ /**
45
+ * Meta schema
46
+ *
47
+ * Recommended values:
48
+ * - 'http://json-schema.org/schema#'
49
+ * - 'http://json-schema.org/hyper-schema#'
50
+ * - 'http://json-schema.org/draft-07/schema#'
51
+ * - 'http://json-schema.org/draft-07/hyper-schema#'
52
+ *
53
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
54
+ */
55
+ type JSONSchema7Version = string;
56
+
57
+ /**
58
+ * JSON Schema v7
59
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
60
+ */
61
+ type JSONSchema7Definition = JSONSchema7 | boolean;
62
+ interface JSONSchema7 {
63
+ $id?: string | undefined;
64
+ $ref?: string | undefined;
65
+ $schema?: JSONSchema7Version | undefined;
66
+ $comment?: string | undefined;
67
+
68
+ /**
69
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
70
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
71
+ */
72
+ $defs?: {
73
+ [key: string]: JSONSchema7Definition;
74
+ } | undefined;
75
+
76
+ /**
77
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
78
+ */
79
+ type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
80
+ enum?: JSONSchema7Type[] | undefined;
81
+ const?: JSONSchema7Type | undefined;
82
+
83
+ /**
84
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
85
+ */
86
+ multipleOf?: number | undefined;
87
+ maximum?: number | undefined;
88
+ exclusiveMaximum?: number | undefined;
89
+ minimum?: number | undefined;
90
+ exclusiveMinimum?: number | undefined;
91
+
92
+ /**
93
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
94
+ */
95
+ maxLength?: number | undefined;
96
+ minLength?: number | undefined;
97
+ pattern?: string | undefined;
98
+
99
+ /**
100
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
101
+ */
102
+ items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
103
+ additionalItems?: JSONSchema7Definition | undefined;
104
+ maxItems?: number | undefined;
105
+ minItems?: number | undefined;
106
+ uniqueItems?: boolean | undefined;
107
+ contains?: JSONSchema7Definition | undefined;
108
+
109
+ /**
110
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
111
+ */
112
+ maxProperties?: number | undefined;
113
+ minProperties?: number | undefined;
114
+ required?: string[] | undefined;
115
+ properties?: {
116
+ [key: string]: JSONSchema7Definition;
117
+ } | undefined;
118
+ patternProperties?: {
119
+ [key: string]: JSONSchema7Definition;
120
+ } | undefined;
121
+ additionalProperties?: JSONSchema7Definition | undefined;
122
+ dependencies?: {
123
+ [key: string]: JSONSchema7Definition | string[];
124
+ } | undefined;
125
+ propertyNames?: JSONSchema7Definition | undefined;
126
+
127
+ /**
128
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
129
+ */
130
+ if?: JSONSchema7Definition | undefined;
131
+ then?: JSONSchema7Definition | undefined;
132
+ else?: JSONSchema7Definition | undefined;
133
+
134
+ /**
135
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
136
+ */
137
+ allOf?: JSONSchema7Definition[] | undefined;
138
+ anyOf?: JSONSchema7Definition[] | undefined;
139
+ oneOf?: JSONSchema7Definition[] | undefined;
140
+ not?: JSONSchema7Definition | undefined;
141
+
142
+ /**
143
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
144
+ */
145
+ format?: string | undefined;
146
+
147
+ /**
148
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
149
+ */
150
+ contentMediaType?: string | undefined;
151
+ contentEncoding?: string | undefined;
152
+
153
+ /**
154
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
155
+ */
156
+ definitions?: {
157
+ [key: string]: JSONSchema7Definition;
158
+ } | undefined;
159
+
160
+ /**
161
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
162
+ */
163
+ title?: string | undefined;
164
+ description?: string | undefined;
165
+ default?: JSONSchema7Type | undefined;
166
+ readOnly?: boolean | undefined;
167
+ writeOnly?: boolean | undefined;
168
+ examples?: JSONSchema7Type | undefined;
169
+ }
170
+
171
+ interface PropertyMetaData {
172
+ hasDefaultValue: boolean;
173
+ isScalar: boolean;
174
+ required: boolean;
175
+ }
176
+ interface ModelMetaData {
177
+ enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
178
+ }
179
+ type DefinitionMap = [name: string, definition: JSONSchema7Definition];
180
+ type PropertyMap = [...DefinitionMap, PropertyMetaData];
181
+ interface TransformOptions {
182
+ includeRequiredFields?: "false" | "true";
183
+ keepRelationScalarFields?: "false" | "true";
184
+ persistOriginalType?: "false" | "true";
185
+ schemaId?: string;
186
+ }
187
+
188
+ declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
189
+
190
+ declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
191
+
192
+ export { getJSONSchemaProperty, transformDmmf as transformDMMF };
193
+ export type { DefinitionMap, ModelMetaData, PropertyMap, PropertyMetaData, TransformOptions };