orchid-orm-schema-to-zod 0.2.22 → 0.2.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchid-orm-schema-to-zod",
3
- "version": "0.2.22",
3
+ "version": "0.2.24",
4
4
  "description": "Orchid-ORM columns schema to Zod converter",
5
5
  "homepage": "https://orchid-orm.netlify.app/guide/columns-validation-methods.html",
6
6
  "repository": {
@@ -17,14 +17,18 @@
17
17
  "types": "./dist/index.d.ts"
18
18
  }
19
19
  },
20
+ "files": [
21
+ "dist"
22
+ ],
20
23
  "jest": {
24
+ "rootDir": "src",
21
25
  "setupFiles": [
22
26
  "dotenv/config"
23
27
  ],
24
- "globalSetup": "../../jest-global-setup.ts",
28
+ "globalSetup": "../../../jest-global-setup.ts",
25
29
  "setupFilesAfterEnv": [
26
- "../../jest-setup.ts",
27
- "./jest-setup.ts"
30
+ "../../../jest-setup.ts",
31
+ "../jest-setup.ts"
28
32
  ],
29
33
  "transform": {
30
34
  "^.+\\.ts$": "@swc/jest"
@@ -39,25 +43,13 @@
39
43
  "author": "Roman Kushyn",
40
44
  "license": "ISC",
41
45
  "dependencies": {
42
- "pqb": "0.9.16",
46
+ "pqb": "0.9.18",
43
47
  "zod": "^3.19.1"
44
48
  },
45
- "devDependencies": {
46
- "rollup": "^2.79.0",
47
- "rollup-plugin-dts": "^4.2.2",
48
- "rollup-plugin-esbuild": "^4.10.1",
49
- "@swc/core": "^1.2.210",
50
- "@swc/jest": "^0.2.21",
51
- "@types/jest": "^28.1.2",
52
- "@types/node": "^18.0.1",
53
- "jest": "^28.1.2",
54
- "rimraf": "^3.0.2",
55
- "tslib": "^2.4.0",
56
- "typescript": "^4.7.4"
57
- },
58
49
  "scripts": {
59
50
  "test": "jest --watch --verbose false",
60
51
  "check": "jest",
52
+ "types": "tsc",
61
53
  "test:ci": "jest --coverage --coverageReporters json-summary",
62
54
  "build": "rimraf ./dist/ && rollup -c --rollup.config"
63
55
  }
@@ -1,192 +0,0 @@
1
-
2
- > orchid-orm-schema-to-zod@0.2.18 test /home/romeo/dev/my/orchid-orm/packages/schema-to-zod
3
- > jest "--coverage" "--coverageReporters" "json-summary"
4
-
5
- PASS src/index.test.ts (10.492 s)
6
- table to zod
7
- ✓ should convert a table to a zod validation schema (207 ms)
8
- instance to zod
9
- ✓ should convert object with shape to a zod validation schema (2 ms)
10
- schema to zod
11
- transform
12
- ✓ should transform column value (1 ms)
13
- ✓ should transform json value (31 ms)
14
- to
15
- ✓ should transform column value to a type
16
- ✓ should transform json value to a type (1 ms)
17
- refine
18
- ✓ should add a refine check for column type (1 ms)
19
- ✓ should add a refine check for json type (2 ms)
20
- superRefine
21
- ✓ should add a superRefine check for column type (17 ms)
22
- ✓ should add a superRefine check for json type (2 ms)
23
- validationDefault
24
- ✓ should set default value for column (1 ms)
25
- ✓ should set default value for json type (1 ms)
26
- nullable
27
- ✓ should parse nullable
28
- smallint
29
- ✓ should convert to number (146 ms)
30
- integer
31
- ✓ should convert to number (35 ms)
32
- real
33
- ✓ should convert to number (31 ms)
34
- smallSerial
35
- ✓ should convert to number (31 ms)
36
- serial
37
- ✓ should convert to number (28 ms)
38
- money
39
- ✓ should convert to number (66 ms)
40
- bigint
41
- ✓ should validate bigint and parse to a string (1 ms)
42
- numeric
43
- ✓ should validate bigint and parse to a string (1 ms)
44
- decimal
45
- ✓ should validate bigint and parse to a string (1 ms)
46
- doublePrecision
47
- ✓ should validate bigint and parse to a string (1 ms)
48
- bigSerial
49
- ✓ should validate bigint and parse to a string (1 ms)
50
- varchar
51
- ✓ should convert to string (39 ms)
52
- ✓ should convert to string with limit (2 ms)
53
- char
54
- ✓ should convert to string (54 ms)
55
- ✓ should convert to string with limit (1 ms)
56
- text
57
- ✓ should convert to string (36 ms)
58
- string
59
- ✓ should convert to string (112 ms)
60
- bytea
61
- ✓ should check Buffer (2 ms)
62
- date
63
- ✓ should parse from string to a Date (1 ms)
64
- ✓ should parse from Date to a Date (3 ms)
65
- timestamp
66
- ✓ should parse from string to a Date (1 ms)
67
- ✓ should parse from Date to a Date (2 ms)
68
- timestampWithTimeZone
69
- ✓ should parse from string to a Date (27 ms)
70
- ✓ should parse from Date to a Date (1 ms)
71
- time
72
- ✓ should validate and parse to a string (1 ms)
73
- timeWithTimeZone
74
- ✓ should validate and parse to a string (1 ms)
75
- interval
76
- ✓ should validate and parse time interval (1 ms)
77
- boolean
78
- ✓ should validate and parse a boolean (1 ms)
79
- enum
80
- ✓ should validate and parse enum (1 ms)
81
- point
82
- ✓ should parse to a string without validation (1 ms)
83
- line
84
- ✓ should parse to a string without validation (1 ms)
85
- lseg
86
- ✓ should parse to a string without validation (1 ms)
87
- box
88
- ✓ should parse to a string without validation (1 ms)
89
- path
90
- ✓ should parse to a string without validation (1 ms)
91
- polygon
92
- ✓ should parse to a string without validation (21 ms)
93
- circle
94
- ✓ should parse to a string without validation (1 ms)
95
- cidr
96
- ✓ should parse to a string without validation (1 ms)
97
- inet
98
- ✓ should parse to a string without validation (1 ms)
99
- macaddr
100
- ✓ should parse to a string without validation
101
- macaddr8
102
- ✓ should parse to a string without validation
103
- bit
104
- ✓ should validate a string to contain only 1 or 0 and parse to a string (1 ms)
105
- bitVarying
106
- ✓ should validate a string to contain only 1 or 0 and parse to a string (5 ms)
107
- tsvector
108
- ✓ should parse to a string without validation
109
- tsquery
110
- ✓ should parse to a string without validation
111
- xml
112
- ✓ should parse to a string without validation (1 ms)
113
- jsonText
114
- ✓ should parse to a string without validation (1 ms)
115
- uuid
116
- ✓ should validate uuid and parse to a string (1 ms)
117
- array
118
- ✓ should validate and parse array (6 ms)
119
- json
120
- any
121
- ✓ should parse to any (31 ms)
122
- bigint
123
- ✓ should validate bigint and parse to string (1 ms)
124
- boolean
125
- ✓ should parse boolean (1 ms)
126
- date
127
- ✓ should parse a Date (2 ms)
128
- nan
129
- ✓ should parse a NaN (1 ms)
130
- never
131
- ✓ should parse a never (1 ms)
132
- null
133
- ✓ should parse a null (1 ms)
134
- number
135
- ✓ should parse a number (35 ms)
136
- string
137
- ✓ should parse a string (7 ms)
138
- undefined
139
- ✓ should parse a undefined (1 ms)
140
- unknown
141
- ✓ should parse unknown
142
- void
143
- ✓ should parse void (1 ms)
144
- array
145
- ✓ should validate and parse array (17 ms)
146
- enum
147
- ✓ should parse enum (1 ms)
148
- instanceOf
149
- ✓ should parse instance of (1 ms)
150
- literal
151
- ✓ should parse literal (1 ms)
152
- map
153
- ✓ should parse map (2 ms)
154
- set
155
- ✓ should parse set (5 ms)
156
- nativeEnum
157
- ✓ should parse native enum (1 ms)
158
- tuple
159
- ✓ should parse tuple (78 ms)
160
- ✓ should parse rest elements (2 ms)
161
- nullable
162
- ✓ should parse nullable
163
- nullish
164
- ✓ should parse nullish
165
- optional
166
- ✓ should parse optional (1 ms)
167
- object
168
- ✓ should parse object (1 ms)
169
- ✓ should parse object with passing through unknown keys (1 ms)
170
- ✓ should parse object with strict unknown keys (1 ms)
171
- ✓ should parse object with catch all option (2 ms)
172
- record
173
- ✓ should parse record (1 ms)
174
- intersection
175
- ✓ should parse intersection (2 ms)
176
- union
177
- ✓ should parse union (2 ms)
178
- discriminatedUnion
179
- ✓ should parse discriminated union (3 ms)
180
- lazy
181
- ✓ should parse lazy type (2 ms)
182
- as
183
- ✓ should convert one type to the same schema as another type (1 ms)
184
- virtual
185
- ✓ should skip virtual column in instanceToZod (1 ms)
186
- ✓ should return ZodNever from columnToZod
187
-
188
- Test Suites: 1 passed, 1 total
189
- Tests: 97 passed, 97 total
190
- Snapshots: 0 total
191
- Time: 10.742 s
192
- Ran all test suites.
@@ -1,192 +0,0 @@
1
-
2
- > orchid-orm-schema-to-zod@0.2.19 test:ci /home/romeo/dev/my/orchid-orm/packages/schema-to-zod
3
- > jest --coverage --coverageReporters json-summary
4
-
5
- PASS src/index.test.ts (5.062 s)
6
- table to zod
7
- ✓ should convert a table to a zod validation schema (73 ms)
8
- instance to zod
9
- ✓ should convert object with shape to a zod validation schema (2 ms)
10
- schema to zod
11
- transform
12
- ✓ should transform column value (1 ms)
13
- ✓ should transform json value (1 ms)
14
- to
15
- ✓ should transform column value to a type (1 ms)
16
- ✓ should transform json value to a type (1 ms)
17
- refine
18
- ✓ should add a refine check for column type (3 ms)
19
- ✓ should add a refine check for json type (1 ms)
20
- superRefine
21
- ✓ should add a superRefine check for column type (1 ms)
22
- ✓ should add a superRefine check for json type (1 ms)
23
- validationDefault
24
- ✓ should set default value for column (1 ms)
25
- ✓ should set default value for json type (1 ms)
26
- nullable
27
- ✓ should parse nullable (1 ms)
28
- smallint
29
- ✓ should convert to number (12 ms)
30
- integer
31
- ✓ should convert to number (26 ms)
32
- real
33
- ✓ should convert to number (9 ms)
34
- smallSerial
35
- ✓ should convert to number (7 ms)
36
- serial
37
- ✓ should convert to number (8 ms)
38
- money
39
- ✓ should convert to number (7 ms)
40
- bigint
41
- ✓ should validate bigint and parse to a string (1 ms)
42
- numeric
43
- ✓ should validate bigint and parse to a string (23 ms)
44
- decimal
45
- ✓ should validate bigint and parse to a string (1 ms)
46
- doublePrecision
47
- ✓ should validate bigint and parse to a string (1 ms)
48
- bigSerial
49
- ✓ should validate bigint and parse to a string (1 ms)
50
- varchar
51
- ✓ should convert to string (7 ms)
52
- ✓ should convert to string with limit (1 ms)
53
- char
54
- ✓ should convert to string (6 ms)
55
- ✓ should convert to string with limit (2 ms)
56
- text
57
- ✓ should convert to string (6 ms)
58
- string
59
- ✓ should convert to string (8 ms)
60
- bytea
61
- ✓ should check Buffer (2 ms)
62
- date
63
- ✓ should parse from string to a Date (1 ms)
64
- ✓ should parse from Date to a Date (21 ms)
65
- timestamp
66
- ✓ should parse from string to a Date (1 ms)
67
- ✓ should parse from Date to a Date (1 ms)
68
- timestampWithTimeZone
69
- ✓ should parse from string to a Date
70
- ✓ should parse from Date to a Date (1 ms)
71
- time
72
- ✓ should validate and parse to a string (1 ms)
73
- timeWithTimeZone
74
- ✓ should validate and parse to a string (1 ms)
75
- interval
76
- ✓ should validate and parse time interval (1 ms)
77
- boolean
78
- ✓ should validate and parse a boolean (1 ms)
79
- enum
80
- ✓ should validate and parse enum (1 ms)
81
- point
82
- ✓ should parse to a string without validation (1 ms)
83
- line
84
- ✓ should parse to a string without validation (1 ms)
85
- lseg
86
- ✓ should parse to a string without validation
87
- box
88
- ✓ should parse to a string without validation
89
- path
90
- ✓ should parse to a string without validation (1 ms)
91
- polygon
92
- ✓ should parse to a string without validation (1 ms)
93
- circle
94
- ✓ should parse to a string without validation (1 ms)
95
- cidr
96
- ✓ should parse to a string without validation (1 ms)
97
- inet
98
- ✓ should parse to a string without validation
99
- macaddr
100
- ✓ should parse to a string without validation
101
- macaddr8
102
- ✓ should parse to a string without validation (1 ms)
103
- bit
104
- ✓ should validate a string to contain only 1 or 0 and parse to a string (1 ms)
105
- bitVarying
106
- ✓ should validate a string to contain only 1 or 0 and parse to a string (5 ms)
107
- tsvector
108
- ✓ should parse to a string without validation
109
- tsquery
110
- ✓ should parse to a string without validation
111
- xml
112
- ✓ should parse to a string without validation (1 ms)
113
- jsonText
114
- ✓ should parse to a string without validation (1 ms)
115
- uuid
116
- ✓ should validate uuid and parse to a string (1 ms)
117
- array
118
- ✓ should validate and parse array (5 ms)
119
- json
120
- any
121
- ✓ should parse to any (1 ms)
122
- bigint
123
- ✓ should validate bigint and parse to string (1 ms)
124
- boolean
125
- ✓ should parse boolean (1 ms)
126
- date
127
- ✓ should parse a Date (19 ms)
128
- nan
129
- ✓ should parse a NaN (1 ms)
130
- never
131
- ✓ should parse a never (1 ms)
132
- null
133
- ✓ should parse a null (1 ms)
134
- number
135
- ✓ should parse a number (8 ms)
136
- string
137
- ✓ should parse a string (6 ms)
138
- undefined
139
- ✓ should parse a undefined (1 ms)
140
- unknown
141
- ✓ should parse unknown
142
- void
143
- ✓ should parse void (1 ms)
144
- array
145
- ✓ should validate and parse array (4 ms)
146
- enum
147
- ✓ should parse enum (1 ms)
148
- instanceOf
149
- ✓ should parse instance of (1 ms)
150
- literal
151
- ✓ should parse literal (1 ms)
152
- map
153
- ✓ should parse map (2 ms)
154
- set
155
- ✓ should parse set (4 ms)
156
- nativeEnum
157
- ✓ should parse native enum (1 ms)
158
- tuple
159
- ✓ should parse tuple (2 ms)
160
- ✓ should parse rest elements (1 ms)
161
- nullable
162
- ✓ should parse nullable
163
- nullish
164
- ✓ should parse nullish
165
- optional
166
- ✓ should parse optional (1 ms)
167
- object
168
- ✓ should parse object (1 ms)
169
- ✓ should parse object with passing through unknown keys (1 ms)
170
- ✓ should parse object with strict unknown keys (16 ms)
171
- ✓ should parse object with catch all option (1 ms)
172
- record
173
- ✓ should parse record (2 ms)
174
- intersection
175
- ✓ should parse intersection (2 ms)
176
- union
177
- ✓ should parse union (2 ms)
178
- discriminatedUnion
179
- ✓ should parse discriminated union (2 ms)
180
- lazy
181
- ✓ should parse lazy type (9 ms)
182
- as
183
- ✓ should convert one type to the same schema as another type (1 ms)
184
- virtual
185
- ✓ should skip virtual column in instanceToZod (1 ms)
186
- ✓ should return ZodNever from columnToZod (1 ms)
187
-
188
- Test Suites: 1 passed, 1 total
189
- Tests: 97 passed, 97 total
190
- Snapshots: 0 total
191
- Time: 5.314 s
192
- Ran all test suites.
package/CHANGELOG.md DELETED
@@ -1,276 +0,0 @@
1
- # orchid-orm-schema-to-zod
2
-
3
- ## 0.2.22
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies
8
- - pqb@0.9.16
9
-
10
- ## 0.2.21
11
-
12
- ### Patch Changes
13
-
14
- - Updated dependencies
15
- - pqb@0.9.15
16
-
17
- ## 0.2.20
18
-
19
- ### Patch Changes
20
-
21
- - Updated dependencies
22
- - pqb@0.9.14
23
-
24
- ## 0.2.19
25
-
26
- ### Patch Changes
27
-
28
- - Updated dependencies
29
- - pqb@0.9.13
30
-
31
- ## 0.2.18
32
-
33
- ### Patch Changes
34
-
35
- - Updated dependencies
36
- - pqb@0.9.12
37
-
38
- ## 0.2.17
39
-
40
- ### Patch Changes
41
-
42
- - Updated dependencies
43
- - pqb@0.9.11
44
-
45
- ## 0.2.16
46
-
47
- ### Patch Changes
48
-
49
- - Updated dependencies
50
- - pqb@0.9.10
51
-
52
- ## 0.2.15
53
-
54
- ### Patch Changes
55
-
56
- - Updated dependencies
57
- - pqb@0.9.9
58
-
59
- ## 0.2.14
60
-
61
- ### Patch Changes
62
-
63
- - Updated dependencies [ee1961e]
64
- - pqb@0.9.8
65
-
66
- ## 0.2.13
67
-
68
- ### Patch Changes
69
-
70
- - Updated dependencies
71
- - pqb@0.9.7
72
-
73
- ## 0.2.12
74
-
75
- ### Patch Changes
76
-
77
- - Updated dependencies
78
- - pqb@0.9.6
79
-
80
- ## 0.2.11
81
-
82
- ### Patch Changes
83
-
84
- - Updated dependencies
85
- - pqb@0.9.5
86
-
87
- ## 0.2.10
88
-
89
- ### Patch Changes
90
-
91
- - Updated dependencies
92
- - pqb@0.9.4
93
-
94
- ## 0.2.9
95
-
96
- ### Patch Changes
97
-
98
- - Change package.json exports for esm support
99
- - Updated dependencies
100
- - pqb@0.9.3
101
-
102
- ## 0.2.8
103
-
104
- ### Patch Changes
105
-
106
- - Updated dependencies
107
- - pqb@0.9.2
108
-
109
- ## 0.2.7
110
-
111
- ### Patch Changes
112
-
113
- - Updated dependencies
114
- - pqb@0.9.1
115
-
116
- ## 0.2.6
117
-
118
- ### Patch Changes
119
-
120
- - Updated dependencies
121
- - Updated dependencies [f1cd5db]
122
- - pqb@0.9.0
123
-
124
- ## 0.2.5
125
-
126
- ### Patch Changes
127
-
128
- - Change inner aspects of columns
129
- - Updated dependencies
130
- - pqb@0.8.5
131
-
132
- ## 0.2.4
133
-
134
- ### Patch Changes
135
-
136
- - Updated dependencies
137
- - Updated dependencies
138
- - pqb@0.8.4
139
-
140
- ## 0.2.3
141
-
142
- ### Patch Changes
143
-
144
- - Updated dependencies
145
- - pqb@0.8.3
146
-
147
- ## 0.2.2
148
-
149
- ### Patch Changes
150
-
151
- - Add code generator to change project files after migrations
152
- - Updated dependencies
153
- - pqb@0.8.2
154
-
155
- ## 0.2.1
156
-
157
- ### Patch Changes
158
-
159
- - Add ability to convert columns to code
160
- - Updated dependencies
161
- - pqb@0.8.1
162
-
163
- ## 0.2.0
164
-
165
- ### Minor Changes
166
-
167
- - 3f25b4d: Rename all model words to table words, because all models here are not models in OOP meaning
168
-
169
- ### Patch Changes
170
-
171
- - Updated dependencies [3f25b4d]
172
- - pqb@0.8.0
173
-
174
- ## 0.1.13
175
-
176
- ### Patch Changes
177
-
178
- - Refactor create and update of relations
179
- - Updated dependencies
180
- - pqb@0.7.13
181
-
182
- ## 0.1.12
183
-
184
- ### Patch Changes
185
-
186
- - Updated dependencies
187
- - pqb@0.7.12
188
-
189
- ## 0.1.11
190
-
191
- ### Patch Changes
192
-
193
- - Updated dependencies
194
- - pqb@0.7.11
195
-
196
- ## 0.1.10
197
-
198
- ### Patch Changes
199
-
200
- - Updated dependencies
201
- - pqb@0.7.10
202
-
203
- ## 0.1.9
204
-
205
- ### Patch Changes
206
-
207
- - Updated dependencies
208
- - pqb@0.7.9
209
-
210
- ## 0.1.8
211
-
212
- ### Patch Changes
213
-
214
- - Updated dependencies
215
- - pqb@0.7.8
216
-
217
- ## 0.1.7
218
-
219
- ### Patch Changes
220
-
221
- - Updated dependencies
222
- - pqb@0.7.7
223
-
224
- ## 0.1.6
225
-
226
- ### Patch Changes
227
-
228
- - Updated dependencies
229
- - pqb@0.7.6
230
-
231
- ## 0.1.5
232
-
233
- ### Patch Changes
234
-
235
- - Updated dependencies
236
- - pqb@0.7.5
237
-
238
- ## 0.1.4
239
-
240
- ### Patch Changes
241
-
242
- - Update homepage link in package.json
243
- - Updated dependencies
244
- - pqb@0.7.4
245
-
246
- ## 0.1.3
247
-
248
- ### Patch Changes
249
-
250
- - Updated dependencies
251
- - pqb@0.7.3
252
-
253
- ## 0.1.2
254
-
255
- ### Patch Changes
256
-
257
- - Updated dependencies [9b8b3d5]
258
- - pqb@0.7.2
259
-
260
- ## 0.1.1
261
-
262
- ### Patch Changes
263
-
264
- - Updated dependencies
265
- - pqb@0.7.1
266
-
267
- ## 0.1.0
268
-
269
- ### Minor Changes
270
-
271
- - 883c3e4: Add changeset
272
-
273
- ### Patch Changes
274
-
275
- - Updated dependencies [883c3e4]
276
- - pqb@0.7.0
@@ -1,3 +0,0 @@
1
- {"total": {"lines":{"total":184,"covered":183,"skipped":0,"pct":99.45},"statements":{"total":189,"covered":187,"skipped":0,"pct":98.94},"functions":{"total":54,"covered":54,"skipped":0,"pct":100},"branches":{"total":52,"covered":51,"skipped":0,"pct":98.07},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}}
2
- ,"/home/romeo/dev/my/orchid-orm/packages/schema-to-zod/src/index.ts": {"lines":{"total":184,"covered":183,"skipped":0,"pct":99.45},"functions":{"total":54,"covered":54,"skipped":0,"pct":100},"statements":{"total":189,"covered":187,"skipped":0,"pct":98.94},"branches":{"total":52,"covered":51,"skipped":0,"pct":98.07}}
3
- }