@prisma/orm-toolchain 8.0.0-rc.23-dev.1 → 8.0.0-rc.23-dev.2
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/dist/cli.mjs +16 -16
- package/dist/cli.mjs.map +1 -1
- package/package.json +12 -12
package/dist/cli.mjs
CHANGED
|
@@ -43,8 +43,8 @@ import stringWidth from "string-width";
|
|
|
43
43
|
import { bold, createColors, cyan, cyanBright, dim, green, yellow } from "colorette";
|
|
44
44
|
import { isCI } from "ci-info";
|
|
45
45
|
import { build } from "esbuild";
|
|
46
|
-
//#region ../../../1-framework/3-tooling/cli/dist/cli-
|
|
47
|
-
var version = "8.0.0-rc.23-dev.
|
|
46
|
+
//#region ../../../1-framework/3-tooling/cli/dist/cli-Cp7LfP3b.mjs
|
|
47
|
+
var version = "8.0.0-rc.23-dev.2";
|
|
48
48
|
const ESCAPES = {
|
|
49
49
|
"\\": "\\\\",
|
|
50
50
|
" ": "\\t",
|
|
@@ -4244,15 +4244,15 @@ import { defineContract } from '${builder}';
|
|
|
4244
4244
|
|
|
4245
4245
|
export const contract = defineContract(
|
|
4246
4246
|
{},
|
|
4247
|
-
({ field, model }) => ({
|
|
4247
|
+
({ field, model, type }) => ({
|
|
4248
4248
|
models: {
|
|
4249
4249
|
User: model('User', {
|
|
4250
4250
|
collection: 'users',
|
|
4251
4251
|
fields: {
|
|
4252
|
-
id: field.
|
|
4253
|
-
email: field.
|
|
4254
|
-
username: field.
|
|
4255
|
-
name: field.
|
|
4252
|
+
id: field.scalar(type.ObjectId()).mongo({ field: '_id' }),
|
|
4253
|
+
email: field.scalar(type.String()),
|
|
4254
|
+
username: field.scalar(type.String()).optional(),
|
|
4255
|
+
name: field.scalar(type.String()).optional(),
|
|
4256
4256
|
},
|
|
4257
4257
|
}),
|
|
4258
4258
|
},
|
|
@@ -4350,15 +4350,15 @@ function starterSchemaTsMongo(builder) {
|
|
|
4350
4350
|
|
|
4351
4351
|
export const contract = defineContract(
|
|
4352
4352
|
{},
|
|
4353
|
-
({ field, model, rel }) => ({
|
|
4353
|
+
({ field, model, rel, type }) => ({
|
|
4354
4354
|
models: {
|
|
4355
4355
|
User: model('User', {
|
|
4356
4356
|
collection: 'users',
|
|
4357
4357
|
fields: {
|
|
4358
|
-
id: field.
|
|
4359
|
-
email: field.
|
|
4360
|
-
username: field.
|
|
4361
|
-
name: field.
|
|
4358
|
+
id: field.scalar(type.ObjectId()).mongo({ field: '_id' }),
|
|
4359
|
+
email: field.scalar(type.String()),
|
|
4360
|
+
username: field.scalar(type.String()).optional(),
|
|
4361
|
+
name: field.scalar(type.String()).optional(),
|
|
4362
4362
|
},
|
|
4363
4363
|
relations: {
|
|
4364
4364
|
posts: rel.hasMany('Post', { from: 'id', to: 'authorId' }),
|
|
@@ -4368,10 +4368,10 @@ export const contract = defineContract(
|
|
|
4368
4368
|
Post: model('Post', {
|
|
4369
4369
|
collection: 'posts',
|
|
4370
4370
|
fields: {
|
|
4371
|
-
id: field.
|
|
4372
|
-
title: field.
|
|
4373
|
-
content: field.
|
|
4374
|
-
authorId: field.
|
|
4371
|
+
id: field.scalar(type.ObjectId()).mongo({ field: '_id' }),
|
|
4372
|
+
title: field.scalar(type.String()),
|
|
4373
|
+
content: field.scalar(type.String()).optional(),
|
|
4374
|
+
authorId: field.scalar(type.ObjectId()),
|
|
4375
4375
|
},
|
|
4376
4376
|
relations: {
|
|
4377
4377
|
author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),
|