zod-contract-test 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.MD ADDED
@@ -0,0 +1 @@
1
+ # Ну контракт
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./product"), exports);
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "zod-contract-test",
3
+ "version": "1.0.0",
4
+ "description": "Shared contracts and types for the project",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "src",
9
+ "README.md"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc && cp -r src/generated dist",
13
+ "prepublishOnly": "npm run build",
14
+ "publish": "npm publish"
15
+ },
16
+ "keywords": [
17
+ "zod",
18
+ "cotracts",
19
+ "validation"
20
+ ],
21
+ "author": {
22
+ "name": "skvil_shell"
23
+ },
24
+ "license": "MIT",
25
+ "dependencies": {
26
+ "zod": "^4.3.5"
27
+ },
28
+ "peerDependencies": {
29
+ "zod": "^4.3.5"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ }
34
+ }
@@ -0,0 +1 @@
1
+ export * from "./index"
@@ -0,0 +1,5 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ module.exports = { ...require('.') }
@@ -0,0 +1 @@
1
+ export * from "./index"
@@ -0,0 +1,5 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+ module.exports = { ...require('#main-entry-point') }
@@ -0,0 +1 @@
1
+ export * from "./default"
@@ -0,0 +1,187 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+
8
+ const {
9
+ PrismaClientKnownRequestError,
10
+ PrismaClientUnknownRequestError,
11
+ PrismaClientRustPanicError,
12
+ PrismaClientInitializationError,
13
+ PrismaClientValidationError,
14
+ getPrismaClient,
15
+ sqltag,
16
+ empty,
17
+ join,
18
+ raw,
19
+ skip,
20
+ Decimal,
21
+ Debug,
22
+ DbNull,
23
+ JsonNull,
24
+ AnyNull,
25
+ NullTypes,
26
+ makeStrictEnum,
27
+ Extensions,
28
+ warnOnce,
29
+ defineDmmfProperty,
30
+ Public,
31
+ getRuntime,
32
+ createParam,
33
+ } = require('./runtime/wasm-compiler-edge.js')
34
+
35
+
36
+ const Prisma = {}
37
+
38
+ exports.Prisma = Prisma
39
+ exports.$Enums = {}
40
+
41
+ /**
42
+ * Prisma Client JS version: 7.2.0
43
+ * Query Engine version: 0c8ef2ce45c83248ab3df073180d5eda9e8be7a3
44
+ */
45
+ Prisma.prismaVersion = {
46
+ client: "7.2.0",
47
+ engine: "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3"
48
+ }
49
+
50
+ Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
51
+ Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
52
+ Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
53
+ Prisma.PrismaClientInitializationError = PrismaClientInitializationError
54
+ Prisma.PrismaClientValidationError = PrismaClientValidationError
55
+ Prisma.Decimal = Decimal
56
+
57
+ /**
58
+ * Re-export of sql-template-tag
59
+ */
60
+ Prisma.sql = sqltag
61
+ Prisma.empty = empty
62
+ Prisma.join = join
63
+ Prisma.raw = raw
64
+ Prisma.validator = Public.validator
65
+
66
+ /**
67
+ * Extensions
68
+ */
69
+ Prisma.getExtensionContext = Extensions.getExtensionContext
70
+ Prisma.defineExtension = Extensions.defineExtension
71
+
72
+ /**
73
+ * Shorthand utilities for JSON filtering
74
+ */
75
+ Prisma.DbNull = DbNull
76
+ Prisma.JsonNull = JsonNull
77
+ Prisma.AnyNull = AnyNull
78
+
79
+ Prisma.NullTypes = NullTypes
80
+
81
+
82
+
83
+
84
+
85
+ /**
86
+ * Enums
87
+ */
88
+ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
89
+ ReadUncommitted: 'ReadUncommitted',
90
+ ReadCommitted: 'ReadCommitted',
91
+ RepeatableRead: 'RepeatableRead',
92
+ Serializable: 'Serializable'
93
+ });
94
+
95
+ exports.Prisma.CategoryScalarFieldEnum = {
96
+ category: 'category',
97
+ title: 'title'
98
+ };
99
+
100
+ exports.Prisma.ProductScalarFieldEnum = {
101
+ id: 'id',
102
+ title: 'title',
103
+ colors: 'colors',
104
+ sizes: 'sizes',
105
+ category: 'category'
106
+ };
107
+
108
+ exports.Prisma.CustomerScalarFieldEnum = {
109
+ id: 'id',
110
+ firstName: 'firstName',
111
+ secondName: 'secondName',
112
+ colors: 'colors'
113
+ };
114
+
115
+ exports.Prisma.WarehouseScalarFieldEnum = {
116
+ productId: 'productId',
117
+ color: 'color',
118
+ size: 'size',
119
+ rest: 'rest'
120
+ };
121
+
122
+ exports.Prisma.SortOrder = {
123
+ asc: 'asc',
124
+ desc: 'desc'
125
+ };
126
+
127
+ exports.Prisma.QueryMode = {
128
+ default: 'default',
129
+ insensitive: 'insensitive'
130
+ };
131
+ exports.CategoryTitle = exports.$Enums.CategoryTitle = {
132
+ tShirt: 'tShirt',
133
+ tShirtPolo: 'tShirtPolo',
134
+ cap: 'cap'
135
+ };
136
+
137
+ exports.Color = exports.$Enums.Color = {
138
+ pink: 'pink',
139
+ white: 'white',
140
+ black: 'black'
141
+ };
142
+
143
+ exports.Size = exports.$Enums.Size = {
144
+ XXS: 'XXS',
145
+ XS: 'XS',
146
+ S: 'S',
147
+ M: 'M',
148
+ L: 'L',
149
+ XL: 'XL',
150
+ XXL: 'XXL',
151
+ XXXL: 'XXXL'
152
+ };
153
+
154
+ exports.Prisma.ModelName = {
155
+ Category: 'Category',
156
+ Product: 'Product',
157
+ Customer: 'Customer',
158
+ Warehouse: 'Warehouse'
159
+ };
160
+ /**
161
+ * Create the Client
162
+ */
163
+ const config = {
164
+ "previewFeatures": [],
165
+ "clientVersion": "7.2.0",
166
+ "engineVersion": "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3",
167
+ "activeProvider": "postgresql",
168
+ "inlineSchema": "model Category {\n category CategoryTitle @id\n title String @db.VarChar(100)\n\n Product Product[]\n\n @@map(\"category\")\n}\n\nenum CategoryTitle {\n tShirt\n tShirtPolo\n cap\n}\n\nenum Color {\n pink\n white\n black\n}\n\nmodel Product {\n id String @id @default(uuid()) @db.Uuid\n title String\n colors Color[]\n sizes Size[]\n Category Category @relation(fields: [category], references: [category])\n category CategoryTitle\n warehouse Warehouse?\n\n @@map(\"product\")\n}\n\n// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client-js\"\n output = \"../../packages/contracts/generated/prisma\"\n // previewFeatures = [\"prismaSchemaFolder\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nenum Size {\n XXS\n XS\n S\n M\n L\n XL\n XXL\n XXXL\n}\n\nmodel Customer {\n id String @id() @default(uuid())\n firstName String\n secondName String\n colors Color[]\n\n @@map(\"customer\")\n}\n\nmodel Warehouse {\n Product Product @relation(fields: [productId], references: [id])\n productId String @unique\n color Color\n size Size\n rest Int @db.Integer\n\n @@id([productId, color, size])\n @@map(\"warehouse\")\n}\n"
169
+ }
170
+
171
+ config.runtimeDataModel = JSON.parse("{\"models\":{\"Category\":{\"fields\":[{\"name\":\"category\",\"kind\":\"enum\",\"type\":\"CategoryTitle\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"Product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"CategoryToProduct\"}],\"dbName\":\"category\"},\"Product\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"colors\",\"kind\":\"enum\",\"type\":\"Color\"},{\"name\":\"sizes\",\"kind\":\"enum\",\"type\":\"Size\"},{\"name\":\"Category\",\"kind\":\"object\",\"type\":\"Category\",\"relationName\":\"CategoryToProduct\"},{\"name\":\"category\",\"kind\":\"enum\",\"type\":\"CategoryTitle\"},{\"name\":\"warehouse\",\"kind\":\"object\",\"type\":\"Warehouse\",\"relationName\":\"ProductToWarehouse\"}],\"dbName\":\"product\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"secondName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"colors\",\"kind\":\"enum\",\"type\":\"Color\"}],\"dbName\":\"customer\"},\"Warehouse\":{\"fields\":[{\"name\":\"Product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"ProductToWarehouse\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"color\",\"kind\":\"enum\",\"type\":\"Color\"},{\"name\":\"size\",\"kind\":\"enum\",\"type\":\"Size\"},{\"name\":\"rest\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"warehouse\"}},\"enums\":{},\"types\":{}}")
172
+ defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
173
+ config.compilerWasm = {
174
+ getRuntime: async () => require('./query_compiler_bg.js'),
175
+ getQueryCompilerWasmModule: async () => {
176
+ const loader = (await import('#wasm-compiler-loader')).default
177
+ const compiler = (await loader).default
178
+ return compiler
179
+ }
180
+ }
181
+ if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || (typeof process !== 'undefined' && process.env && process.env.DEBUG) || undefined) {
182
+ Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || (typeof process !== 'undefined' && process.env && process.env.DEBUG) || undefined)
183
+ }
184
+
185
+ const PrismaClient = getPrismaClient(config)
186
+ exports.PrismaClient = PrismaClient
187
+ Object.assign(exports, Prisma)
@@ -0,0 +1,218 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+ // biome-ignore-all lint: generated file
5
+
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+
8
+ const {
9
+ Decimal,
10
+ DbNull,
11
+ JsonNull,
12
+ AnyNull,
13
+ NullTypes,
14
+ makeStrictEnum,
15
+ Public,
16
+ getRuntime,
17
+ skip
18
+ } = require('./runtime/index-browser.js')
19
+
20
+
21
+ const Prisma = {}
22
+
23
+ exports.Prisma = Prisma
24
+ exports.$Enums = {}
25
+
26
+ /**
27
+ * Prisma Client JS version: 7.2.0
28
+ * Query Engine version: 0c8ef2ce45c83248ab3df073180d5eda9e8be7a3
29
+ */
30
+ Prisma.prismaVersion = {
31
+ client: "7.2.0",
32
+ engine: "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3"
33
+ }
34
+
35
+ Prisma.PrismaClientKnownRequestError = () => {
36
+ const runtimeName = getRuntime().prettyName;
37
+ throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
38
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
39
+ )};
40
+ Prisma.PrismaClientUnknownRequestError = () => {
41
+ const runtimeName = getRuntime().prettyName;
42
+ throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
43
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
44
+ )}
45
+ Prisma.PrismaClientRustPanicError = () => {
46
+ const runtimeName = getRuntime().prettyName;
47
+ throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
48
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
49
+ )}
50
+ Prisma.PrismaClientInitializationError = () => {
51
+ const runtimeName = getRuntime().prettyName;
52
+ throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
53
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
54
+ )}
55
+ Prisma.PrismaClientValidationError = () => {
56
+ const runtimeName = getRuntime().prettyName;
57
+ throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
58
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
59
+ )}
60
+ Prisma.Decimal = Decimal
61
+
62
+ /**
63
+ * Re-export of sql-template-tag
64
+ */
65
+ Prisma.sql = () => {
66
+ const runtimeName = getRuntime().prettyName;
67
+ throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
68
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
69
+ )}
70
+ Prisma.empty = () => {
71
+ const runtimeName = getRuntime().prettyName;
72
+ throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
73
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
74
+ )}
75
+ Prisma.join = () => {
76
+ const runtimeName = getRuntime().prettyName;
77
+ throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
78
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
79
+ )}
80
+ Prisma.raw = () => {
81
+ const runtimeName = getRuntime().prettyName;
82
+ throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
83
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
84
+ )}
85
+ Prisma.validator = Public.validator
86
+
87
+ /**
88
+ * Extensions
89
+ */
90
+ Prisma.getExtensionContext = () => {
91
+ const runtimeName = getRuntime().prettyName;
92
+ throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
93
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
94
+ )}
95
+ Prisma.defineExtension = () => {
96
+ const runtimeName = getRuntime().prettyName;
97
+ throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
98
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
99
+ )}
100
+
101
+ /**
102
+ * Shorthand utilities for JSON filtering
103
+ */
104
+ Prisma.DbNull = DbNull
105
+ Prisma.JsonNull = JsonNull
106
+ Prisma.AnyNull = AnyNull
107
+
108
+ Prisma.NullTypes = NullTypes
109
+
110
+
111
+
112
+ /**
113
+ * Enums
114
+ */
115
+
116
+ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
117
+ ReadUncommitted: 'ReadUncommitted',
118
+ ReadCommitted: 'ReadCommitted',
119
+ RepeatableRead: 'RepeatableRead',
120
+ Serializable: 'Serializable'
121
+ });
122
+
123
+ exports.Prisma.CategoryScalarFieldEnum = {
124
+ category: 'category',
125
+ title: 'title'
126
+ };
127
+
128
+ exports.Prisma.ProductScalarFieldEnum = {
129
+ id: 'id',
130
+ title: 'title',
131
+ colors: 'colors',
132
+ sizes: 'sizes',
133
+ category: 'category'
134
+ };
135
+
136
+ exports.Prisma.CustomerScalarFieldEnum = {
137
+ id: 'id',
138
+ firstName: 'firstName',
139
+ secondName: 'secondName',
140
+ colors: 'colors'
141
+ };
142
+
143
+ exports.Prisma.WarehouseScalarFieldEnum = {
144
+ productId: 'productId',
145
+ color: 'color',
146
+ size: 'size',
147
+ rest: 'rest'
148
+ };
149
+
150
+ exports.Prisma.SortOrder = {
151
+ asc: 'asc',
152
+ desc: 'desc'
153
+ };
154
+
155
+ exports.Prisma.QueryMode = {
156
+ default: 'default',
157
+ insensitive: 'insensitive'
158
+ };
159
+ exports.CategoryTitle = exports.$Enums.CategoryTitle = {
160
+ tShirt: 'tShirt',
161
+ tShirtPolo: 'tShirtPolo',
162
+ cap: 'cap'
163
+ };
164
+
165
+ exports.Color = exports.$Enums.Color = {
166
+ pink: 'pink',
167
+ white: 'white',
168
+ black: 'black'
169
+ };
170
+
171
+ exports.Size = exports.$Enums.Size = {
172
+ XXS: 'XXS',
173
+ XS: 'XS',
174
+ S: 'S',
175
+ M: 'M',
176
+ L: 'L',
177
+ XL: 'XL',
178
+ XXL: 'XXL',
179
+ XXXL: 'XXXL'
180
+ };
181
+
182
+ exports.Prisma.ModelName = {
183
+ Category: 'Category',
184
+ Product: 'Product',
185
+ Customer: 'Customer',
186
+ Warehouse: 'Warehouse'
187
+ };
188
+
189
+ /**
190
+ * This is a stub Prisma Client that will error at runtime if called.
191
+ */
192
+ class PrismaClient {
193
+ constructor() {
194
+ return new Proxy(this, {
195
+ get(target, prop) {
196
+ let message
197
+ const runtime = getRuntime()
198
+ if (runtime.isEdge) {
199
+ message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
200
+ - Use Prisma Accelerate: https://pris.ly/d/accelerate
201
+ - Use Driver Adapters: https://pris.ly/d/driver-adapters
202
+ `;
203
+ } else {
204
+ message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
205
+ }
206
+
207
+ message += `
208
+ If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
209
+
210
+ throw new Error(message)
211
+ }
212
+ })
213
+ }
214
+ }
215
+
216
+ exports.PrismaClient = PrismaClient
217
+
218
+ Object.assign(exports, Prisma)