@visulima/prisma-dmmf-transformer 2.0.28 → 2.0.30
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 +18 -0
- package/LICENSE.md +130 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -191
- package/dist/index.d.mts +3 -191
- package/dist/index.d.ts +3 -191
- package/dist/index.mjs +2 -2
- package/dist/model.d.cts +4 -0
- package/dist/model.d.mts +4 -0
- package/dist/model.d.ts +4 -0
- package/dist/packem_shared/{getJSONSchemaProperty-CCMlB6rF.mjs → getJSONSchemaProperty-DulgsLKr.mjs} +18 -18
- package/dist/packem_shared/{getJSONSchemaProperty-Ul9ZXvbT.cjs → getJSONSchemaProperty-E2OXsCgc.cjs} +18 -18
- package/dist/packem_shared/{transformDMMF-BlrIBvPS.cjs → transformDMMF-CAcG255G.cjs} +1 -1
- package/dist/packem_shared/{transformDMMF-BtZz70Wg.mjs → transformDMMF-DvU3tZ1x.mjs} +1 -1
- package/dist/properties.d.cts +4 -0
- package/dist/properties.d.mts +4 -0
- package/dist/properties.d.ts +4 -0
- package/dist/transform-dmmf.d.cts +5 -0
- package/dist/transform-dmmf.d.mts +5 -0
- package/dist/transform-dmmf.d.ts +5 -0
- package/dist/types.d.cts +20 -0
- package/dist/types.d.mts +20 -0
- package/dist/types.d.ts +20 -0
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## @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
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **prisma-dmmf-transformer:** update dependencies and ESLint configuration ([73aa16c](https://github.com/visulima/visulima/commit/73aa16c2d856a390ff72bf1f2159dffb6c8eb424))
|
|
6
|
+
* **prisma-dmmf-transformer:** update package.json and pnpm-lock.yaml for compatibility ([c12a482](https://github.com/visulima/visulima/commit/c12a4828f7b934a2faa532c380210addefc13428))
|
|
7
|
+
|
|
8
|
+
## @visulima/prisma-dmmf-transformer [2.0.29](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.28...@visulima/prisma-dmmf-transformer@2.0.29) (2025-05-30)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **prisma-dmmf-transformer:** update dependencies ([9768f55](https://github.com/visulima/visulima/commit/9768f559897983b4d6ba2c4ebb515659c7c07342))
|
|
13
|
+
* **prisma-dmmf-transformer:** update license information and add type-fest dependency ([ef59af8](https://github.com/visulima/visulima/commit/ef59af88b0d4fcbc3dc6aed7853ce5ba7f464d7c))
|
|
14
|
+
|
|
15
|
+
### Miscellaneous Chores
|
|
16
|
+
|
|
17
|
+
* updated dev dependencies ([2433ed5](https://github.com/visulima/visulima/commit/2433ed5fb662e0303c37edee8ddc21b46c21263f))
|
|
18
|
+
|
|
1
19
|
## @visulima/prisma-dmmf-transformer [2.0.28](https://github.com/visulima/visulima/compare/@visulima/prisma-dmmf-transformer@2.0.27...@visulima/prisma-dmmf-transformer@2.0.28) (2025-03-07)
|
|
2
20
|
|
|
3
21
|
### 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
|
|
30
|
+
MIT, (MIT OR CC0-1.0)
|
|
31
31
|
|
|
32
32
|
# Bundled types:
|
|
33
33
|
## @types/json-schema
|
|
@@ -57,4 +57,133 @@ 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
|
+
|
|
60
189
|
<!-- /TYPE_DEPENDENCIES -->
|
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
4
|
|
|
5
|
-
const getJSONSchemaProperty = require('./packem_shared/getJSONSchemaProperty-
|
|
6
|
-
const transformDMMF = require('./packem_shared/transformDMMF-
|
|
5
|
+
const getJSONSchemaProperty = require('./packem_shared/getJSONSchemaProperty-E2OXsCgc.cjs');
|
|
6
|
+
const transformDMMF = require('./packem_shared/transformDMMF-CAcG255G.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,191 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// JSON Schema Draft 07
|
|
5
|
-
// ==================================================================================================
|
|
6
|
-
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
7
|
-
// --------------------------------------------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Primitive type
|
|
11
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
12
|
-
*/
|
|
13
|
-
type JSONSchema7TypeName =
|
|
14
|
-
| "string" //
|
|
15
|
-
| "number"
|
|
16
|
-
| "integer"
|
|
17
|
-
| "boolean"
|
|
18
|
-
| "object"
|
|
19
|
-
| "array"
|
|
20
|
-
| "null";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Primitive type
|
|
24
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
25
|
-
*/
|
|
26
|
-
type JSONSchema7Type =
|
|
27
|
-
| string //
|
|
28
|
-
| number
|
|
29
|
-
| boolean
|
|
30
|
-
| JSONSchema7Object
|
|
31
|
-
| JSONSchema7Array
|
|
32
|
-
| null;
|
|
33
|
-
|
|
34
|
-
// Workaround for infinite type recursion
|
|
35
|
-
interface JSONSchema7Object {
|
|
36
|
-
[key: string]: JSONSchema7Type;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Workaround for infinite type recursion
|
|
40
|
-
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
41
|
-
interface JSONSchema7Array extends Array<JSONSchema7Type> {}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Meta schema
|
|
45
|
-
*
|
|
46
|
-
* Recommended values:
|
|
47
|
-
* - 'http://json-schema.org/schema#'
|
|
48
|
-
* - 'http://json-schema.org/hyper-schema#'
|
|
49
|
-
* - 'http://json-schema.org/draft-07/schema#'
|
|
50
|
-
* - 'http://json-schema.org/draft-07/hyper-schema#'
|
|
51
|
-
*
|
|
52
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
|
53
|
-
*/
|
|
54
|
-
type JSONSchema7Version = string;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* JSON Schema v7
|
|
58
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
59
|
-
*/
|
|
60
|
-
type JSONSchema7Definition = JSONSchema7 | boolean;
|
|
61
|
-
interface JSONSchema7 {
|
|
62
|
-
$id?: string | undefined;
|
|
63
|
-
$ref?: string | undefined;
|
|
64
|
-
$schema?: JSONSchema7Version | undefined;
|
|
65
|
-
$comment?: string | undefined;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
|
69
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
|
70
|
-
*/
|
|
71
|
-
$defs?: {
|
|
72
|
-
[key: string]: JSONSchema7Definition;
|
|
73
|
-
} | undefined;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
|
77
|
-
*/
|
|
78
|
-
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
|
79
|
-
enum?: JSONSchema7Type[] | undefined;
|
|
80
|
-
const?: JSONSchema7Type | undefined;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
|
84
|
-
*/
|
|
85
|
-
multipleOf?: number | undefined;
|
|
86
|
-
maximum?: number | undefined;
|
|
87
|
-
exclusiveMaximum?: number | undefined;
|
|
88
|
-
minimum?: number | undefined;
|
|
89
|
-
exclusiveMinimum?: number | undefined;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
|
93
|
-
*/
|
|
94
|
-
maxLength?: number | undefined;
|
|
95
|
-
minLength?: number | undefined;
|
|
96
|
-
pattern?: string | undefined;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
100
|
-
*/
|
|
101
|
-
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
|
|
102
|
-
additionalItems?: JSONSchema7Definition | undefined;
|
|
103
|
-
maxItems?: number | undefined;
|
|
104
|
-
minItems?: number | undefined;
|
|
105
|
-
uniqueItems?: boolean | undefined;
|
|
106
|
-
contains?: JSONSchema7Definition | undefined;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
110
|
-
*/
|
|
111
|
-
maxProperties?: number | undefined;
|
|
112
|
-
minProperties?: number | undefined;
|
|
113
|
-
required?: string[] | undefined;
|
|
114
|
-
properties?: {
|
|
115
|
-
[key: string]: JSONSchema7Definition;
|
|
116
|
-
} | undefined;
|
|
117
|
-
patternProperties?: {
|
|
118
|
-
[key: string]: JSONSchema7Definition;
|
|
119
|
-
} | undefined;
|
|
120
|
-
additionalProperties?: JSONSchema7Definition | undefined;
|
|
121
|
-
dependencies?: {
|
|
122
|
-
[key: string]: JSONSchema7Definition | string[];
|
|
123
|
-
} | undefined;
|
|
124
|
-
propertyNames?: JSONSchema7Definition | undefined;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
128
|
-
*/
|
|
129
|
-
if?: JSONSchema7Definition | undefined;
|
|
130
|
-
then?: JSONSchema7Definition | undefined;
|
|
131
|
-
else?: JSONSchema7Definition | undefined;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
135
|
-
*/
|
|
136
|
-
allOf?: JSONSchema7Definition[] | undefined;
|
|
137
|
-
anyOf?: JSONSchema7Definition[] | undefined;
|
|
138
|
-
oneOf?: JSONSchema7Definition[] | undefined;
|
|
139
|
-
not?: JSONSchema7Definition | undefined;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
143
|
-
*/
|
|
144
|
-
format?: string | undefined;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
148
|
-
*/
|
|
149
|
-
contentMediaType?: string | undefined;
|
|
150
|
-
contentEncoding?: string | undefined;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
154
|
-
*/
|
|
155
|
-
definitions?: {
|
|
156
|
-
[key: string]: JSONSchema7Definition;
|
|
157
|
-
} | undefined;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
161
|
-
*/
|
|
162
|
-
title?: string | undefined;
|
|
163
|
-
description?: string | undefined;
|
|
164
|
-
default?: JSONSchema7Type | undefined;
|
|
165
|
-
readOnly?: boolean | undefined;
|
|
166
|
-
writeOnly?: boolean | undefined;
|
|
167
|
-
examples?: JSONSchema7Type | undefined;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
interface PropertyMetaData {
|
|
171
|
-
hasDefaultValue: boolean;
|
|
172
|
-
isScalar: boolean;
|
|
173
|
-
required: boolean;
|
|
174
|
-
}
|
|
175
|
-
interface ModelMetaData {
|
|
176
|
-
enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
|
|
177
|
-
}
|
|
178
|
-
type DefinitionMap = [name: string, definition: JSONSchema7Definition];
|
|
179
|
-
type PropertyMap = [...DefinitionMap, PropertyMetaData];
|
|
180
|
-
interface TransformOptions {
|
|
181
|
-
includeRequiredFields?: "false" | "true";
|
|
182
|
-
keepRelationScalarFields?: "false" | "true";
|
|
183
|
-
persistOriginalType?: "false" | "true";
|
|
184
|
-
schemaId?: string;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
|
|
188
|
-
|
|
189
|
-
declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
|
|
190
|
-
|
|
191
|
-
export { type DefinitionMap, type ModelMetaData, type PropertyMap, type PropertyMetaData, type TransformOptions, getJSONSchemaProperty, transformDmmf as transformDMMF };
|
|
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";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,191 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// JSON Schema Draft 07
|
|
5
|
-
// ==================================================================================================
|
|
6
|
-
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
7
|
-
// --------------------------------------------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Primitive type
|
|
11
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
12
|
-
*/
|
|
13
|
-
type JSONSchema7TypeName =
|
|
14
|
-
| "string" //
|
|
15
|
-
| "number"
|
|
16
|
-
| "integer"
|
|
17
|
-
| "boolean"
|
|
18
|
-
| "object"
|
|
19
|
-
| "array"
|
|
20
|
-
| "null";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Primitive type
|
|
24
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
25
|
-
*/
|
|
26
|
-
type JSONSchema7Type =
|
|
27
|
-
| string //
|
|
28
|
-
| number
|
|
29
|
-
| boolean
|
|
30
|
-
| JSONSchema7Object
|
|
31
|
-
| JSONSchema7Array
|
|
32
|
-
| null;
|
|
33
|
-
|
|
34
|
-
// Workaround for infinite type recursion
|
|
35
|
-
interface JSONSchema7Object {
|
|
36
|
-
[key: string]: JSONSchema7Type;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Workaround for infinite type recursion
|
|
40
|
-
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
41
|
-
interface JSONSchema7Array extends Array<JSONSchema7Type> {}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Meta schema
|
|
45
|
-
*
|
|
46
|
-
* Recommended values:
|
|
47
|
-
* - 'http://json-schema.org/schema#'
|
|
48
|
-
* - 'http://json-schema.org/hyper-schema#'
|
|
49
|
-
* - 'http://json-schema.org/draft-07/schema#'
|
|
50
|
-
* - 'http://json-schema.org/draft-07/hyper-schema#'
|
|
51
|
-
*
|
|
52
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
|
53
|
-
*/
|
|
54
|
-
type JSONSchema7Version = string;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* JSON Schema v7
|
|
58
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
59
|
-
*/
|
|
60
|
-
type JSONSchema7Definition = JSONSchema7 | boolean;
|
|
61
|
-
interface JSONSchema7 {
|
|
62
|
-
$id?: string | undefined;
|
|
63
|
-
$ref?: string | undefined;
|
|
64
|
-
$schema?: JSONSchema7Version | undefined;
|
|
65
|
-
$comment?: string | undefined;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
|
69
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
|
70
|
-
*/
|
|
71
|
-
$defs?: {
|
|
72
|
-
[key: string]: JSONSchema7Definition;
|
|
73
|
-
} | undefined;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
|
77
|
-
*/
|
|
78
|
-
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
|
79
|
-
enum?: JSONSchema7Type[] | undefined;
|
|
80
|
-
const?: JSONSchema7Type | undefined;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
|
84
|
-
*/
|
|
85
|
-
multipleOf?: number | undefined;
|
|
86
|
-
maximum?: number | undefined;
|
|
87
|
-
exclusiveMaximum?: number | undefined;
|
|
88
|
-
minimum?: number | undefined;
|
|
89
|
-
exclusiveMinimum?: number | undefined;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
|
93
|
-
*/
|
|
94
|
-
maxLength?: number | undefined;
|
|
95
|
-
minLength?: number | undefined;
|
|
96
|
-
pattern?: string | undefined;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
100
|
-
*/
|
|
101
|
-
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
|
|
102
|
-
additionalItems?: JSONSchema7Definition | undefined;
|
|
103
|
-
maxItems?: number | undefined;
|
|
104
|
-
minItems?: number | undefined;
|
|
105
|
-
uniqueItems?: boolean | undefined;
|
|
106
|
-
contains?: JSONSchema7Definition | undefined;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
110
|
-
*/
|
|
111
|
-
maxProperties?: number | undefined;
|
|
112
|
-
minProperties?: number | undefined;
|
|
113
|
-
required?: string[] | undefined;
|
|
114
|
-
properties?: {
|
|
115
|
-
[key: string]: JSONSchema7Definition;
|
|
116
|
-
} | undefined;
|
|
117
|
-
patternProperties?: {
|
|
118
|
-
[key: string]: JSONSchema7Definition;
|
|
119
|
-
} | undefined;
|
|
120
|
-
additionalProperties?: JSONSchema7Definition | undefined;
|
|
121
|
-
dependencies?: {
|
|
122
|
-
[key: string]: JSONSchema7Definition | string[];
|
|
123
|
-
} | undefined;
|
|
124
|
-
propertyNames?: JSONSchema7Definition | undefined;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
128
|
-
*/
|
|
129
|
-
if?: JSONSchema7Definition | undefined;
|
|
130
|
-
then?: JSONSchema7Definition | undefined;
|
|
131
|
-
else?: JSONSchema7Definition | undefined;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
135
|
-
*/
|
|
136
|
-
allOf?: JSONSchema7Definition[] | undefined;
|
|
137
|
-
anyOf?: JSONSchema7Definition[] | undefined;
|
|
138
|
-
oneOf?: JSONSchema7Definition[] | undefined;
|
|
139
|
-
not?: JSONSchema7Definition | undefined;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
143
|
-
*/
|
|
144
|
-
format?: string | undefined;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
148
|
-
*/
|
|
149
|
-
contentMediaType?: string | undefined;
|
|
150
|
-
contentEncoding?: string | undefined;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
154
|
-
*/
|
|
155
|
-
definitions?: {
|
|
156
|
-
[key: string]: JSONSchema7Definition;
|
|
157
|
-
} | undefined;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
161
|
-
*/
|
|
162
|
-
title?: string | undefined;
|
|
163
|
-
description?: string | undefined;
|
|
164
|
-
default?: JSONSchema7Type | undefined;
|
|
165
|
-
readOnly?: boolean | undefined;
|
|
166
|
-
writeOnly?: boolean | undefined;
|
|
167
|
-
examples?: JSONSchema7Type | undefined;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
interface PropertyMetaData {
|
|
171
|
-
hasDefaultValue: boolean;
|
|
172
|
-
isScalar: boolean;
|
|
173
|
-
required: boolean;
|
|
174
|
-
}
|
|
175
|
-
interface ModelMetaData {
|
|
176
|
-
enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
|
|
177
|
-
}
|
|
178
|
-
type DefinitionMap = [name: string, definition: JSONSchema7Definition];
|
|
179
|
-
type PropertyMap = [...DefinitionMap, PropertyMetaData];
|
|
180
|
-
interface TransformOptions {
|
|
181
|
-
includeRequiredFields?: "false" | "true";
|
|
182
|
-
keepRelationScalarFields?: "false" | "true";
|
|
183
|
-
persistOriginalType?: "false" | "true";
|
|
184
|
-
schemaId?: string;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
|
|
188
|
-
|
|
189
|
-
declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
|
|
190
|
-
|
|
191
|
-
export { type DefinitionMap, type ModelMetaData, type PropertyMap, type PropertyMetaData, type TransformOptions, getJSONSchemaProperty, transformDmmf as transformDMMF };
|
|
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";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,191 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// JSON Schema Draft 07
|
|
5
|
-
// ==================================================================================================
|
|
6
|
-
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
7
|
-
// --------------------------------------------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Primitive type
|
|
11
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
12
|
-
*/
|
|
13
|
-
type JSONSchema7TypeName =
|
|
14
|
-
| "string" //
|
|
15
|
-
| "number"
|
|
16
|
-
| "integer"
|
|
17
|
-
| "boolean"
|
|
18
|
-
| "object"
|
|
19
|
-
| "array"
|
|
20
|
-
| "null";
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Primitive type
|
|
24
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
|
25
|
-
*/
|
|
26
|
-
type JSONSchema7Type =
|
|
27
|
-
| string //
|
|
28
|
-
| number
|
|
29
|
-
| boolean
|
|
30
|
-
| JSONSchema7Object
|
|
31
|
-
| JSONSchema7Array
|
|
32
|
-
| null;
|
|
33
|
-
|
|
34
|
-
// Workaround for infinite type recursion
|
|
35
|
-
interface JSONSchema7Object {
|
|
36
|
-
[key: string]: JSONSchema7Type;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Workaround for infinite type recursion
|
|
40
|
-
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
|
|
41
|
-
interface JSONSchema7Array extends Array<JSONSchema7Type> {}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Meta schema
|
|
45
|
-
*
|
|
46
|
-
* Recommended values:
|
|
47
|
-
* - 'http://json-schema.org/schema#'
|
|
48
|
-
* - 'http://json-schema.org/hyper-schema#'
|
|
49
|
-
* - 'http://json-schema.org/draft-07/schema#'
|
|
50
|
-
* - 'http://json-schema.org/draft-07/hyper-schema#'
|
|
51
|
-
*
|
|
52
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
|
53
|
-
*/
|
|
54
|
-
type JSONSchema7Version = string;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* JSON Schema v7
|
|
58
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
|
|
59
|
-
*/
|
|
60
|
-
type JSONSchema7Definition = JSONSchema7 | boolean;
|
|
61
|
-
interface JSONSchema7 {
|
|
62
|
-
$id?: string | undefined;
|
|
63
|
-
$ref?: string | undefined;
|
|
64
|
-
$schema?: JSONSchema7Version | undefined;
|
|
65
|
-
$comment?: string | undefined;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
|
|
69
|
-
* @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
|
|
70
|
-
*/
|
|
71
|
-
$defs?: {
|
|
72
|
-
[key: string]: JSONSchema7Definition;
|
|
73
|
-
} | undefined;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
|
|
77
|
-
*/
|
|
78
|
-
type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
|
|
79
|
-
enum?: JSONSchema7Type[] | undefined;
|
|
80
|
-
const?: JSONSchema7Type | undefined;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
|
|
84
|
-
*/
|
|
85
|
-
multipleOf?: number | undefined;
|
|
86
|
-
maximum?: number | undefined;
|
|
87
|
-
exclusiveMaximum?: number | undefined;
|
|
88
|
-
minimum?: number | undefined;
|
|
89
|
-
exclusiveMinimum?: number | undefined;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
|
|
93
|
-
*/
|
|
94
|
-
maxLength?: number | undefined;
|
|
95
|
-
minLength?: number | undefined;
|
|
96
|
-
pattern?: string | undefined;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
|
|
100
|
-
*/
|
|
101
|
-
items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
|
|
102
|
-
additionalItems?: JSONSchema7Definition | undefined;
|
|
103
|
-
maxItems?: number | undefined;
|
|
104
|
-
minItems?: number | undefined;
|
|
105
|
-
uniqueItems?: boolean | undefined;
|
|
106
|
-
contains?: JSONSchema7Definition | undefined;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
|
|
110
|
-
*/
|
|
111
|
-
maxProperties?: number | undefined;
|
|
112
|
-
minProperties?: number | undefined;
|
|
113
|
-
required?: string[] | undefined;
|
|
114
|
-
properties?: {
|
|
115
|
-
[key: string]: JSONSchema7Definition;
|
|
116
|
-
} | undefined;
|
|
117
|
-
patternProperties?: {
|
|
118
|
-
[key: string]: JSONSchema7Definition;
|
|
119
|
-
} | undefined;
|
|
120
|
-
additionalProperties?: JSONSchema7Definition | undefined;
|
|
121
|
-
dependencies?: {
|
|
122
|
-
[key: string]: JSONSchema7Definition | string[];
|
|
123
|
-
} | undefined;
|
|
124
|
-
propertyNames?: JSONSchema7Definition | undefined;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
|
|
128
|
-
*/
|
|
129
|
-
if?: JSONSchema7Definition | undefined;
|
|
130
|
-
then?: JSONSchema7Definition | undefined;
|
|
131
|
-
else?: JSONSchema7Definition | undefined;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
|
|
135
|
-
*/
|
|
136
|
-
allOf?: JSONSchema7Definition[] | undefined;
|
|
137
|
-
anyOf?: JSONSchema7Definition[] | undefined;
|
|
138
|
-
oneOf?: JSONSchema7Definition[] | undefined;
|
|
139
|
-
not?: JSONSchema7Definition | undefined;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
|
|
143
|
-
*/
|
|
144
|
-
format?: string | undefined;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
|
|
148
|
-
*/
|
|
149
|
-
contentMediaType?: string | undefined;
|
|
150
|
-
contentEncoding?: string | undefined;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
|
|
154
|
-
*/
|
|
155
|
-
definitions?: {
|
|
156
|
-
[key: string]: JSONSchema7Definition;
|
|
157
|
-
} | undefined;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
|
|
161
|
-
*/
|
|
162
|
-
title?: string | undefined;
|
|
163
|
-
description?: string | undefined;
|
|
164
|
-
default?: JSONSchema7Type | undefined;
|
|
165
|
-
readOnly?: boolean | undefined;
|
|
166
|
-
writeOnly?: boolean | undefined;
|
|
167
|
-
examples?: JSONSchema7Type | undefined;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
interface PropertyMetaData {
|
|
171
|
-
hasDefaultValue: boolean;
|
|
172
|
-
isScalar: boolean;
|
|
173
|
-
required: boolean;
|
|
174
|
-
}
|
|
175
|
-
interface ModelMetaData {
|
|
176
|
-
enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
|
|
177
|
-
}
|
|
178
|
-
type DefinitionMap = [name: string, definition: JSONSchema7Definition];
|
|
179
|
-
type PropertyMap = [...DefinitionMap, PropertyMetaData];
|
|
180
|
-
interface TransformOptions {
|
|
181
|
-
includeRequiredFields?: "false" | "true";
|
|
182
|
-
keepRelationScalarFields?: "false" | "true";
|
|
183
|
-
persistOriginalType?: "false" | "true";
|
|
184
|
-
schemaId?: string;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
|
|
188
|
-
|
|
189
|
-
declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
|
|
190
|
-
|
|
191
|
-
export { type DefinitionMap, type ModelMetaData, type PropertyMap, type PropertyMetaData, type TransformOptions, getJSONSchemaProperty, transformDmmf as transformDMMF };
|
|
1
|
+
export { default as getJSONSchemaProperty } from "./properties.d.ts";
|
|
2
|
+
export { default as transformDMMF } from "./transform-dmmf.d.ts";
|
|
3
|
+
export type { DefinitionMap, ModelMetaData, PropertyMap, PropertyMetaData, TransformOptions } from "./types.d.ts";
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as getJSONSchemaProperty } from './packem_shared/getJSONSchemaProperty-
|
|
2
|
-
export { default as transformDMMF } from './packem_shared/transformDMMF-
|
|
1
|
+
export { default as getJSONSchemaProperty } from './packem_shared/getJSONSchemaProperty-DulgsLKr.mjs';
|
|
2
|
+
export { default as transformDMMF } from './packem_shared/transformDMMF-DvU3tZ1x.mjs';
|
package/dist/model.d.cts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { DefinitionMap, ModelMetaData, TransformOptions } from "./types.d.cts";
|
|
3
|
+
declare const getJSONSchemaModel: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (model: DMMF.Model) => DefinitionMap;
|
|
4
|
+
export = getJSONSchemaModel;
|
package/dist/model.d.mts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { DefinitionMap, ModelMetaData, TransformOptions } from "./types.d.mts";
|
|
3
|
+
declare const getJSONSchemaModel: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (model: DMMF.Model) => DefinitionMap;
|
|
4
|
+
export default getJSONSchemaModel;
|
package/dist/model.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { DefinitionMap, ModelMetaData, TransformOptions } from "./types.d.ts";
|
|
3
|
+
declare const getJSONSchemaModel: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (model: DMMF.Model) => DefinitionMap;
|
|
4
|
+
export = getJSONSchemaModel;
|
package/dist/packem_shared/{getJSONSchemaProperty-CCMlB6rF.mjs → getJSONSchemaProperty-DulgsLKr.mjs}
RENAMED
|
@@ -5,25 +5,25 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
5
5
|
const isDefined = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null, "isDefined");
|
|
6
6
|
const getJSONSchemaScalar = /* @__PURE__ */ __name((fieldType) => {
|
|
7
7
|
switch (fieldType) {
|
|
8
|
-
case "
|
|
9
|
-
case "
|
|
8
|
+
case "BigInt":
|
|
9
|
+
case "Int": {
|
|
10
10
|
return "integer";
|
|
11
11
|
}
|
|
12
|
-
case "
|
|
12
|
+
case "Boolean": {
|
|
13
|
+
return "boolean";
|
|
14
|
+
}
|
|
13
15
|
case "Bytes":
|
|
16
|
+
case "DateTime":
|
|
14
17
|
case "String": {
|
|
15
18
|
return "string";
|
|
16
19
|
}
|
|
17
|
-
case "
|
|
18
|
-
case "
|
|
20
|
+
case "Decimal":
|
|
21
|
+
case "Float": {
|
|
19
22
|
return "number";
|
|
20
23
|
}
|
|
21
24
|
case "Json": {
|
|
22
25
|
return ["number", "string", "boolean", "object", "array", "null"];
|
|
23
26
|
}
|
|
24
|
-
case "Boolean": {
|
|
25
|
-
return "boolean";
|
|
26
|
-
}
|
|
27
27
|
default: {
|
|
28
28
|
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(fieldType)}`);
|
|
29
29
|
}
|
|
@@ -44,7 +44,7 @@ const getJSONSchemaType = /* @__PURE__ */ __name((field) => {
|
|
|
44
44
|
}
|
|
45
45
|
const isFieldUnion = Array.isArray(scalarFieldType);
|
|
46
46
|
if (isFieldUnion) {
|
|
47
|
-
return [.../* @__PURE__ */ new Set([
|
|
47
|
+
return [.../* @__PURE__ */ new Set(["null", ...scalarFieldType])];
|
|
48
48
|
}
|
|
49
49
|
return [scalarFieldType, "null"];
|
|
50
50
|
}, "getJSONSchemaType");
|
|
@@ -60,23 +60,23 @@ const getDefaultValue = /* @__PURE__ */ __name((field) => {
|
|
|
60
60
|
return null;
|
|
61
61
|
}
|
|
62
62
|
switch (field.type) {
|
|
63
|
-
case "String":
|
|
64
63
|
case "BigInt":
|
|
65
|
-
case "DateTime":
|
|
64
|
+
case "DateTime":
|
|
65
|
+
case "String": {
|
|
66
66
|
return typeof fieldDefault === "string" ? fieldDefault : null;
|
|
67
67
|
}
|
|
68
|
-
case "Int":
|
|
69
|
-
case "Float":
|
|
70
|
-
case "Decimal": {
|
|
71
|
-
return typeof fieldDefault === "number" ? fieldDefault : null;
|
|
72
|
-
}
|
|
73
68
|
case "Boolean": {
|
|
74
69
|
return typeof fieldDefault === "boolean" ? fieldDefault : null;
|
|
75
70
|
}
|
|
76
|
-
case "
|
|
77
|
-
case "
|
|
71
|
+
case "Bytes":
|
|
72
|
+
case "Json": {
|
|
78
73
|
return null;
|
|
79
74
|
}
|
|
75
|
+
case "Decimal":
|
|
76
|
+
case "Float":
|
|
77
|
+
case "Int": {
|
|
78
|
+
return typeof fieldDefault === "number" ? fieldDefault : null;
|
|
79
|
+
}
|
|
80
80
|
default: {
|
|
81
81
|
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(field.type)}`);
|
|
82
82
|
}
|
package/dist/packem_shared/{getJSONSchemaProperty-Ul9ZXvbT.cjs → getJSONSchemaProperty-E2OXsCgc.cjs}
RENAMED
|
@@ -11,25 +11,25 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
11
11
|
const isDefined = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null, "isDefined");
|
|
12
12
|
const getJSONSchemaScalar = /* @__PURE__ */ __name((fieldType) => {
|
|
13
13
|
switch (fieldType) {
|
|
14
|
-
case "
|
|
15
|
-
case "
|
|
14
|
+
case "BigInt":
|
|
15
|
+
case "Int": {
|
|
16
16
|
return "integer";
|
|
17
17
|
}
|
|
18
|
-
case "
|
|
18
|
+
case "Boolean": {
|
|
19
|
+
return "boolean";
|
|
20
|
+
}
|
|
19
21
|
case "Bytes":
|
|
22
|
+
case "DateTime":
|
|
20
23
|
case "String": {
|
|
21
24
|
return "string";
|
|
22
25
|
}
|
|
23
|
-
case "
|
|
24
|
-
case "
|
|
26
|
+
case "Decimal":
|
|
27
|
+
case "Float": {
|
|
25
28
|
return "number";
|
|
26
29
|
}
|
|
27
30
|
case "Json": {
|
|
28
31
|
return ["number", "string", "boolean", "object", "array", "null"];
|
|
29
32
|
}
|
|
30
|
-
case "Boolean": {
|
|
31
|
-
return "boolean";
|
|
32
|
-
}
|
|
33
33
|
default: {
|
|
34
34
|
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(fieldType)}`);
|
|
35
35
|
}
|
|
@@ -50,7 +50,7 @@ const getJSONSchemaType = /* @__PURE__ */ __name((field) => {
|
|
|
50
50
|
}
|
|
51
51
|
const isFieldUnion = Array.isArray(scalarFieldType);
|
|
52
52
|
if (isFieldUnion) {
|
|
53
|
-
return [.../* @__PURE__ */ new Set([
|
|
53
|
+
return [.../* @__PURE__ */ new Set(["null", ...scalarFieldType])];
|
|
54
54
|
}
|
|
55
55
|
return [scalarFieldType, "null"];
|
|
56
56
|
}, "getJSONSchemaType");
|
|
@@ -66,23 +66,23 @@ const getDefaultValue = /* @__PURE__ */ __name((field) => {
|
|
|
66
66
|
return null;
|
|
67
67
|
}
|
|
68
68
|
switch (field.type) {
|
|
69
|
-
case "String":
|
|
70
69
|
case "BigInt":
|
|
71
|
-
case "DateTime":
|
|
70
|
+
case "DateTime":
|
|
71
|
+
case "String": {
|
|
72
72
|
return typeof fieldDefault === "string" ? fieldDefault : null;
|
|
73
73
|
}
|
|
74
|
-
case "Int":
|
|
75
|
-
case "Float":
|
|
76
|
-
case "Decimal": {
|
|
77
|
-
return typeof fieldDefault === "number" ? fieldDefault : null;
|
|
78
|
-
}
|
|
79
74
|
case "Boolean": {
|
|
80
75
|
return typeof fieldDefault === "boolean" ? fieldDefault : null;
|
|
81
76
|
}
|
|
82
|
-
case "
|
|
83
|
-
case "
|
|
77
|
+
case "Bytes":
|
|
78
|
+
case "Json": {
|
|
84
79
|
return null;
|
|
85
80
|
}
|
|
81
|
+
case "Decimal":
|
|
82
|
+
case "Float":
|
|
83
|
+
case "Int": {
|
|
84
|
+
return typeof fieldDefault === "number" ? fieldDefault : null;
|
|
85
|
+
}
|
|
86
86
|
default: {
|
|
87
87
|
throw new Error(`Unhandled discriminated union member: ${JSON.stringify(field.type)}`);
|
|
88
88
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const getJSONSchemaProperty = require('./getJSONSchemaProperty-
|
|
3
|
+
const getJSONSchemaProperty = require('./getJSONSchemaProperty-E2OXsCgc.cjs');
|
|
4
4
|
|
|
5
5
|
var __defProp$1 = Object.defineProperty;
|
|
6
6
|
var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import getJSONSchemaProperty from './getJSONSchemaProperty-
|
|
1
|
+
import getJSONSchemaProperty from './getJSONSchemaProperty-DulgsLKr.mjs';
|
|
2
2
|
|
|
3
3
|
var __defProp$1 = Object.defineProperty;
|
|
4
4
|
var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { ModelMetaData, PropertyMap, TransformOptions } from "./types.d.cts";
|
|
3
|
+
declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
|
|
4
|
+
export = getJSONSchemaProperty;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { ModelMetaData, PropertyMap, TransformOptions } from "./types.d.mts";
|
|
3
|
+
declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
|
|
4
|
+
export default getJSONSchemaProperty;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { ModelMetaData, PropertyMap, TransformOptions } from "./types.d.ts";
|
|
3
|
+
declare const getJSONSchemaProperty: (modelMetaData: ModelMetaData, transformOptions: TransformOptions) => (field: DMMF.Field) => PropertyMap;
|
|
4
|
+
export = getJSONSchemaProperty;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { JSONSchema7 } from "json-schema";
|
|
3
|
+
import type { TransformOptions } from "./types.d.cts";
|
|
4
|
+
declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
|
|
5
|
+
export = transformDmmf;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { JSONSchema7 } from "json-schema";
|
|
3
|
+
import type { TransformOptions } from "./types.d.mts";
|
|
4
|
+
declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
|
|
5
|
+
export default transformDmmf;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { JSONSchema7 } from "json-schema";
|
|
3
|
+
import type { TransformOptions } from "./types.d.ts";
|
|
4
|
+
declare const transformDmmf: (dmmf: DMMF.Document, transformOptions?: TransformOptions) => JSONSchema7;
|
|
5
|
+
export = transformDmmf;
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { JSONSchema7Definition } from "json-schema";
|
|
3
|
+
import type { ReadonlyDeep } from ".//index.d.d.cts";
|
|
4
|
+
export type PrismaPrimitive = "BigInt" | "Boolean" | "Bytes" | "DateTime" | "Decimal" | "Float" | "Int" | "Json" | "String";
|
|
5
|
+
export interface PropertyMetaData {
|
|
6
|
+
hasDefaultValue: boolean;
|
|
7
|
+
isScalar: boolean;
|
|
8
|
+
required: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ModelMetaData {
|
|
11
|
+
enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
|
|
12
|
+
}
|
|
13
|
+
export type DefinitionMap = [name: string, definition: JSONSchema7Definition];
|
|
14
|
+
export type PropertyMap = [...DefinitionMap, PropertyMetaData];
|
|
15
|
+
export interface TransformOptions {
|
|
16
|
+
includeRequiredFields?: "false" | "true";
|
|
17
|
+
keepRelationScalarFields?: "false" | "true";
|
|
18
|
+
persistOriginalType?: "false" | "true";
|
|
19
|
+
schemaId?: string;
|
|
20
|
+
}
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { JSONSchema7Definition } from "json-schema";
|
|
3
|
+
import type { ReadonlyDeep } from ".//index.d.d.mts";
|
|
4
|
+
export type PrismaPrimitive = "BigInt" | "Boolean" | "Bytes" | "DateTime" | "Decimal" | "Float" | "Int" | "Json" | "String";
|
|
5
|
+
export interface PropertyMetaData {
|
|
6
|
+
hasDefaultValue: boolean;
|
|
7
|
+
isScalar: boolean;
|
|
8
|
+
required: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ModelMetaData {
|
|
11
|
+
enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
|
|
12
|
+
}
|
|
13
|
+
export type DefinitionMap = [name: string, definition: JSONSchema7Definition];
|
|
14
|
+
export type PropertyMap = [...DefinitionMap, PropertyMetaData];
|
|
15
|
+
export interface TransformOptions {
|
|
16
|
+
includeRequiredFields?: "false" | "true";
|
|
17
|
+
keepRelationScalarFields?: "false" | "true";
|
|
18
|
+
persistOriginalType?: "false" | "true";
|
|
19
|
+
schemaId?: string;
|
|
20
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DMMF } from "@prisma/generator-helper";
|
|
2
|
+
import type { JSONSchema7Definition } from "json-schema";
|
|
3
|
+
import type { ReadonlyDeep } from ".//index.d.d.ts";
|
|
4
|
+
export type PrismaPrimitive = "BigInt" | "Boolean" | "Bytes" | "DateTime" | "Decimal" | "Float" | "Int" | "Json" | "String";
|
|
5
|
+
export interface PropertyMetaData {
|
|
6
|
+
hasDefaultValue: boolean;
|
|
7
|
+
isScalar: boolean;
|
|
8
|
+
required: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ModelMetaData {
|
|
11
|
+
enums: ReadonlyDeep<DMMF.DatamodelEnum[]>;
|
|
12
|
+
}
|
|
13
|
+
export type DefinitionMap = [name: string, definition: JSONSchema7Definition];
|
|
14
|
+
export type PropertyMap = [...DefinitionMap, PropertyMetaData];
|
|
15
|
+
export interface TransformOptions {
|
|
16
|
+
includeRequiredFields?: "false" | "true";
|
|
17
|
+
keepRelationScalarFields?: "false" | "true";
|
|
18
|
+
persistOriginalType?: "false" | "true";
|
|
19
|
+
schemaId?: string;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/prisma-dmmf-transformer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.30",
|
|
4
4
|
"description": "A generator for Prisma to generate a valid JSON Schema v7.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"sideEffects": false,
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|
|
41
|
-
"require": {
|
|
42
|
-
"types": "./dist/index.d.cts",
|
|
43
|
-
"default": "./dist/index.cjs"
|
|
44
|
-
},
|
|
45
41
|
"import": {
|
|
46
42
|
"types": "./dist/index.d.mts",
|
|
47
43
|
"default": "./dist/index.mjs"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/index.d.cts",
|
|
47
|
+
"default": "./dist/index.cjs"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"./package.json": "./package.json"
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"LICENSE.md"
|
|
67
67
|
],
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@prisma/generator-helper": "6.
|
|
69
|
+
"@prisma/generator-helper": "6.15.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@prisma/client": "3.* || 4.*",
|
|
73
|
-
"prisma": "3.* || 4.*"
|
|
72
|
+
"@prisma/client": "3.* || 4.* || 5.* || 6.*",
|
|
73
|
+
"prisma": "3.* || 4.* || 5.* || 6.*"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
|
-
"node": ">=18.0.0 <=
|
|
76
|
+
"node": ">=18.0.0 <=24.x"
|
|
77
77
|
},
|
|
78
78
|
"os": [
|
|
79
79
|
"darwin",
|