prisma 6.6.0-dev.5 → 6.6.0-dev.52
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/build/index.js +1069 -1175
- package/build/prisma_schema_build_bg.wasm +0 -0
- package/build/public/assets/index.js +1 -1
- package/package.json +19 -17
- package/preinstall/index.js +4 -4
- package/prisma-client/generator-build/index.js +231 -229
- package/prisma-client/package.json +13 -11
- package/prisma-client/runtime/binary.js +120 -120
- package/prisma-client/runtime/client.d.ts +353 -273
- package/prisma-client/runtime/client.js +38 -38
- package/prisma-client/runtime/edge-esm.js +18 -18
- package/prisma-client/runtime/edge.js +18 -18
- package/prisma-client/runtime/library.d.ts +353 -273
- package/prisma-client/runtime/library.js +56 -56
- package/prisma-client/runtime/query_engine_bg.mysql.js +2 -2
- package/prisma-client/runtime/query_engine_bg.postgresql.js +2 -2
- package/prisma-client/runtime/query_engine_bg.sqlite.js +2 -2
- package/prisma-client/runtime/react-native.d.ts +353 -273
- package/prisma-client/runtime/react-native.js +23 -23
- package/prisma-client/scripts/default-index.js +3 -3
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
9
8
|
var __esm = (fn, res) => function __init() {
|
10
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
11
10
|
};
|
@@ -33,20 +32,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
33
32
|
mod
|
34
33
|
));
|
35
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
36
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
37
35
|
|
38
|
-
// ../../node_modules/.pnpm/@prisma+engines-version@6.6.0-
|
36
|
+
// ../../node_modules/.pnpm/@prisma+engines-version@6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04/node_modules/@prisma/engines-version/package.json
|
39
37
|
var require_package = __commonJS({
|
40
|
-
"../../node_modules/.pnpm/@prisma+engines-version@6.6.0-
|
38
|
+
"../../node_modules/.pnpm/@prisma+engines-version@6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04/node_modules/@prisma/engines-version/package.json"(exports2, module2) {
|
41
39
|
module2.exports = {
|
42
40
|
name: "@prisma/engines-version",
|
43
|
-
version: "6.6.0-
|
41
|
+
version: "6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",
|
44
42
|
main: "index.js",
|
45
43
|
types: "index.d.ts",
|
46
44
|
license: "Apache-2.0",
|
47
45
|
author: "Tim Suchanek <suchanek@prisma.io>",
|
48
46
|
prisma: {
|
49
|
-
enginesVersion: "
|
47
|
+
enginesVersion: "0302bd9e49a13a657a302c060e529d54b08fad04"
|
50
48
|
},
|
51
49
|
repository: {
|
52
50
|
type: "git",
|
@@ -68,9 +66,9 @@ var require_package = __commonJS({
|
|
68
66
|
}
|
69
67
|
});
|
70
68
|
|
71
|
-
// ../../node_modules/.pnpm/@prisma+engines-version@6.6.0-
|
69
|
+
// ../../node_modules/.pnpm/@prisma+engines-version@6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04/node_modules/@prisma/engines-version/index.js
|
72
70
|
var require_engines_version = __commonJS({
|
73
|
-
"../../node_modules/.pnpm/@prisma+engines-version@6.6.0-
|
71
|
+
"../../node_modules/.pnpm/@prisma+engines-version@6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04/node_modules/@prisma/engines-version/index.js"(exports2) {
|
74
72
|
"use strict";
|
75
73
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
76
74
|
exports2.enginesVersion = void 0;
|
@@ -3060,7 +3058,7 @@ var require_package2 = __commonJS({
|
|
3060
3058
|
"package.json"(exports2, module2) {
|
3061
3059
|
module2.exports = {
|
3062
3060
|
name: "@prisma/client",
|
3063
|
-
version: "6.6.0-dev.
|
3061
|
+
version: "6.6.0-dev.52",
|
3064
3062
|
description: "Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.",
|
3065
3063
|
keywords: [
|
3066
3064
|
"ORM",
|
@@ -3244,7 +3242,7 @@ var require_package2 = __commonJS({
|
|
3244
3242
|
devDependencies: {
|
3245
3243
|
"@cloudflare/workers-types": "4.20250214.0",
|
3246
3244
|
"@codspeed/benchmark.js-plugin": "4.0.0",
|
3247
|
-
"@faker-js/faker": "9.
|
3245
|
+
"@faker-js/faker": "9.6.0",
|
3248
3246
|
"@fast-check/jest": "2.0.3",
|
3249
3247
|
"@inquirer/prompts": "7.3.3",
|
3250
3248
|
"@jest/create-cache-key-function": "29.7.0",
|
@@ -3253,7 +3251,7 @@ var require_package2 = __commonJS({
|
|
3253
3251
|
"@libsql/client": "0.8.0",
|
3254
3252
|
"@neondatabase/serverless": "0.10.2",
|
3255
3253
|
"@opentelemetry/api": "1.9.0",
|
3256
|
-
"@opentelemetry/context-async-hooks": "
|
3254
|
+
"@opentelemetry/context-async-hooks": "2.0.0",
|
3257
3255
|
"@opentelemetry/instrumentation": "0.57.2",
|
3258
3256
|
"@opentelemetry/resources": "1.30.1",
|
3259
3257
|
"@opentelemetry/sdk-trace-base": "1.30.1",
|
@@ -3268,10 +3266,12 @@ var require_package2 = __commonJS({
|
|
3268
3266
|
"@prisma/client-engine-runtime": "workspace:*",
|
3269
3267
|
"@prisma/config": "workspace:*",
|
3270
3268
|
"@prisma/debug": "workspace:*",
|
3269
|
+
"@prisma/dmmf": "workspace:*",
|
3271
3270
|
"@prisma/driver-adapter-utils": "workspace:*",
|
3272
3271
|
"@prisma/engines": "workspace:*",
|
3273
|
-
"@prisma/engines-version": "6.6.0-
|
3272
|
+
"@prisma/engines-version": "6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",
|
3274
3273
|
"@prisma/fetch-engine": "workspace:*",
|
3274
|
+
"@prisma/generator": "workspace:*",
|
3275
3275
|
"@prisma/generator-helper": "workspace:*",
|
3276
3276
|
"@prisma/get-platform": "workspace:*",
|
3277
3277
|
"@prisma/instrumentation": "workspace:*",
|
@@ -3279,8 +3279,8 @@ var require_package2 = __commonJS({
|
|
3279
3279
|
"@prisma/migrate": "workspace:*",
|
3280
3280
|
"@prisma/mini-proxy": "0.9.5",
|
3281
3281
|
"@prisma/pg-worker": "workspace:*",
|
3282
|
-
"@prisma/query-compiler-wasm": "6.6.0-
|
3283
|
-
"@prisma/query-engine-wasm": "6.6.0-
|
3282
|
+
"@prisma/query-compiler-wasm": "6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",
|
3283
|
+
"@prisma/query-engine-wasm": "6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",
|
3284
3284
|
"@snaplet/copycat": "6.0.0",
|
3285
3285
|
"@swc-node/register": "1.10.9",
|
3286
3286
|
"@swc/core": "1.11.5",
|
@@ -3295,7 +3295,7 @@ var require_package2 = __commonJS({
|
|
3295
3295
|
"@types/pg": "8.11.11",
|
3296
3296
|
arg: "5.0.2",
|
3297
3297
|
benchmark: "2.1.4",
|
3298
|
-
"ci-info": "4.
|
3298
|
+
"ci-info": "4.2.0",
|
3299
3299
|
"decimal.js": "10.5.0",
|
3300
3300
|
"env-paths": "2.2.1",
|
3301
3301
|
esbuild: "0.24.2",
|
@@ -3320,25 +3320,25 @@ var require_package2 = __commonJS({
|
|
3320
3320
|
"new-github-issue-url": "0.2.1",
|
3321
3321
|
"node-fetch": "3.3.2",
|
3322
3322
|
"p-retry": "4.6.2",
|
3323
|
-
pg: "8.
|
3323
|
+
pg: "8.14.1",
|
3324
3324
|
"pkg-up": "3.1.0",
|
3325
3325
|
pluralize: "8.0.0",
|
3326
3326
|
resolve: "1.22.10",
|
3327
3327
|
rimraf: "6.0.1",
|
3328
3328
|
"simple-statistics": "7.8.7",
|
3329
|
-
"sort-keys": "
|
3329
|
+
"sort-keys": "5.1.0",
|
3330
3330
|
"source-map-support": "0.5.21",
|
3331
3331
|
"sql-template-tag": "5.2.1",
|
3332
3332
|
"stacktrace-parser": "0.1.11",
|
3333
3333
|
"strip-ansi": "6.0.1",
|
3334
|
-
"strip-indent": "
|
3334
|
+
"strip-indent": "4.0.0",
|
3335
3335
|
"ts-node": "10.9.2",
|
3336
3336
|
"ts-pattern": "5.6.2",
|
3337
3337
|
tsd: "0.31.2",
|
3338
3338
|
typescript: "5.4.5",
|
3339
3339
|
undici: "7.4.0",
|
3340
3340
|
wrangler: "3.111.0",
|
3341
|
-
zx: "
|
3341
|
+
zx: "8.4.1"
|
3342
3342
|
},
|
3343
3343
|
peerDependencies: {
|
3344
3344
|
prisma: "*",
|
@@ -3532,13 +3532,11 @@ var init_TypeBuilder = __esm({
|
|
3532
3532
|
"src/generation/ts-builders/TypeBuilder.ts"() {
|
3533
3533
|
"use strict";
|
3534
3534
|
TypeBuilder = class {
|
3535
|
-
|
3536
|
-
|
3537
|
-
|
3538
|
-
|
3539
|
-
|
3540
|
-
__publicField(this, "needsParenthesisInUnion", false);
|
3541
|
-
}
|
3535
|
+
// TODO(@SevInf): this should be replaced with precedence system that would
|
3536
|
+
// automatically add parenthesis where they are needed
|
3537
|
+
needsParenthesisWhenIndexed = false;
|
3538
|
+
needsParenthesisInKeyof = false;
|
3539
|
+
needsParenthesisInUnion = false;
|
3542
3540
|
subKey(key) {
|
3543
3541
|
const { KeyType: KeyType2 } = (init_KeyType(), __toCommonJS(KeyType_exports));
|
3544
3542
|
return new KeyType2(this, key);
|
@@ -3556,9 +3554,9 @@ var init_TypeBuilder = __esm({
|
|
3556
3554
|
}
|
3557
3555
|
});
|
3558
3556
|
|
3559
|
-
// ../../node_modules/.pnpm/ci-info@4.
|
3557
|
+
// ../../node_modules/.pnpm/ci-info@4.2.0/node_modules/ci-info/vendors.json
|
3560
3558
|
var require_vendors = __commonJS({
|
3561
|
-
"../../node_modules/.pnpm/ci-info@4.
|
3559
|
+
"../../node_modules/.pnpm/ci-info@4.2.0/node_modules/ci-info/vendors.json"(exports2, module2) {
|
3562
3560
|
module2.exports = [
|
3563
3561
|
{
|
3564
3562
|
name: "Agola CI",
|
@@ -3646,6 +3644,11 @@ var require_vendors = __commonJS({
|
|
3646
3644
|
env: "CIRRUS_CI",
|
3647
3645
|
pr: "CIRRUS_PR"
|
3648
3646
|
},
|
3647
|
+
{
|
3648
|
+
name: "Cloudflare Pages",
|
3649
|
+
constant: "CLOUDFLARE_PAGES",
|
3650
|
+
env: "CF_PAGES"
|
3651
|
+
},
|
3649
3652
|
{
|
3650
3653
|
name: "Codefresh",
|
3651
3654
|
constant: "CODEFRESH",
|
@@ -3910,9 +3913,9 @@ var require_vendors = __commonJS({
|
|
3910
3913
|
}
|
3911
3914
|
});
|
3912
3915
|
|
3913
|
-
// ../../node_modules/.pnpm/ci-info@4.
|
3916
|
+
// ../../node_modules/.pnpm/ci-info@4.2.0/node_modules/ci-info/index.js
|
3914
3917
|
var require_ci_info = __commonJS({
|
3915
|
-
"../../node_modules/.pnpm/ci-info@4.
|
3918
|
+
"../../node_modules/.pnpm/ci-info@4.2.0/node_modules/ci-info/index.js"(exports2) {
|
3916
3919
|
"use strict";
|
3917
3920
|
var vendors = require_vendors();
|
3918
3921
|
var env2 = process.env;
|
@@ -3940,7 +3943,7 @@ var require_ci_info = __commonJS({
|
|
3940
3943
|
exports2.isCI = !!(env2.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
3941
3944
|
(env2.BUILD_ID || // Jenkins, Cloudbees
|
3942
3945
|
env2.BUILD_NUMBER || // Jenkins, TeamCity
|
3943
|
-
env2.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
|
3946
|
+
env2.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages
|
3944
3947
|
env2.CI_APP_ID || // Appflow
|
3945
3948
|
env2.CI_BUILD_ID || // Appflow
|
3946
3949
|
env2.CI_BUILD_NUMBER || // Appflow
|
@@ -4184,39 +4187,6 @@ var src_default = Debug;
|
|
4184
4187
|
// src/generation/generator.ts
|
4185
4188
|
var import_engines_version = __toESM(require_engines_version());
|
4186
4189
|
|
4187
|
-
// ../generator-helper/src/dmmf.ts
|
4188
|
-
function datamodelEnumToSchemaEnum(datamodelEnum) {
|
4189
|
-
return {
|
4190
|
-
name: datamodelEnum.name,
|
4191
|
-
values: datamodelEnum.values.map((v) => v.name)
|
4192
|
-
};
|
4193
|
-
}
|
4194
|
-
var DMMF;
|
4195
|
-
((DMMF2) => {
|
4196
|
-
let ModelAction;
|
4197
|
-
((ModelAction2) => {
|
4198
|
-
ModelAction2["findUnique"] = "findUnique";
|
4199
|
-
ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
|
4200
|
-
ModelAction2["findFirst"] = "findFirst";
|
4201
|
-
ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
|
4202
|
-
ModelAction2["findMany"] = "findMany";
|
4203
|
-
ModelAction2["create"] = "create";
|
4204
|
-
ModelAction2["createMany"] = "createMany";
|
4205
|
-
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
4206
|
-
ModelAction2["update"] = "update";
|
4207
|
-
ModelAction2["updateMany"] = "updateMany";
|
4208
|
-
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
4209
|
-
ModelAction2["upsert"] = "upsert";
|
4210
|
-
ModelAction2["delete"] = "delete";
|
4211
|
-
ModelAction2["deleteMany"] = "deleteMany";
|
4212
|
-
ModelAction2["groupBy"] = "groupBy";
|
4213
|
-
ModelAction2["count"] = "count";
|
4214
|
-
ModelAction2["aggregate"] = "aggregate";
|
4215
|
-
ModelAction2["findRaw"] = "findRaw";
|
4216
|
-
ModelAction2["aggregateRaw"] = "aggregateRaw";
|
4217
|
-
})(ModelAction = DMMF2.ModelAction || (DMMF2.ModelAction = {}));
|
4218
|
-
})(DMMF || (DMMF = {}));
|
4219
|
-
|
4220
4190
|
// ../generator-helper/src/byline.ts
|
4221
4191
|
var import_stream = __toESM(require("stream"));
|
4222
4192
|
var import_util = __toESM(require("util"));
|
@@ -4390,40 +4360,6 @@ function getNodeAPIName(binaryTarget, type) {
|
|
4390
4360
|
}
|
4391
4361
|
}
|
4392
4362
|
|
4393
|
-
// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js
|
4394
|
-
var import_node_process = __toESM(require("node:process"), 1);
|
4395
|
-
var import_common_path_prefix = __toESM(require_common_path_prefix(), 1);
|
4396
|
-
|
4397
|
-
// ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
|
4398
|
-
var findUpStop = Symbol("findUpStop");
|
4399
|
-
|
4400
|
-
// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js
|
4401
|
-
var { env, cwd } = import_node_process.default;
|
4402
|
-
|
4403
|
-
// ../fetch-engine/src/utils.ts
|
4404
|
-
var import_fs = __toESM(require("fs"));
|
4405
|
-
var import_os = __toESM(require("os"));
|
4406
|
-
var debug = src_default("prisma:fetch-engine:cache-dir");
|
4407
|
-
async function overwriteFile(sourcePath, targetPath) {
|
4408
|
-
if (import_os.default.platform() === "darwin") {
|
4409
|
-
await removeFileIfExists(targetPath);
|
4410
|
-
await import_fs.default.promises.copyFile(sourcePath, targetPath);
|
4411
|
-
} else {
|
4412
|
-
const tempPath = `${targetPath}.tmp${process.pid}`;
|
4413
|
-
await import_fs.default.promises.copyFile(sourcePath, tempPath);
|
4414
|
-
await import_fs.default.promises.rename(tempPath, targetPath);
|
4415
|
-
}
|
4416
|
-
}
|
4417
|
-
async function removeFileIfExists(filePath) {
|
4418
|
-
try {
|
4419
|
-
await import_fs.default.promises.unlink(filePath);
|
4420
|
-
} catch (e) {
|
4421
|
-
if (e.code !== "ENOENT") {
|
4422
|
-
throw e;
|
4423
|
-
}
|
4424
|
-
}
|
4425
|
-
}
|
4426
|
-
|
4427
4363
|
// ../internals/src/client/getClientEngineType.ts
|
4428
4364
|
var DEFAULT_CLIENT_ENGINE_TYPE = "library" /* Library */;
|
4429
4365
|
function getClientEngineType(generatorConfig) {
|
@@ -4468,6 +4404,40 @@ function parseEnvValue(object) {
|
|
4468
4404
|
return object.value;
|
4469
4405
|
}
|
4470
4406
|
|
4407
|
+
// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js
|
4408
|
+
var import_node_process = __toESM(require("node:process"), 1);
|
4409
|
+
var import_common_path_prefix = __toESM(require_common_path_prefix(), 1);
|
4410
|
+
|
4411
|
+
// ../../node_modules/.pnpm/find-up@6.3.0/node_modules/find-up/index.js
|
4412
|
+
var findUpStop = Symbol("findUpStop");
|
4413
|
+
|
4414
|
+
// ../../node_modules/.pnpm/find-cache-dir@5.0.0/node_modules/find-cache-dir/index.js
|
4415
|
+
var { env, cwd } = import_node_process.default;
|
4416
|
+
|
4417
|
+
// ../fetch-engine/src/utils.ts
|
4418
|
+
var import_fs = __toESM(require("fs"));
|
4419
|
+
var import_os = __toESM(require("os"));
|
4420
|
+
var debug = src_default("prisma:fetch-engine:cache-dir");
|
4421
|
+
async function overwriteFile(sourcePath, targetPath) {
|
4422
|
+
if (import_os.default.platform() === "darwin") {
|
4423
|
+
await removeFileIfExists(targetPath);
|
4424
|
+
await import_fs.default.promises.copyFile(sourcePath, targetPath);
|
4425
|
+
} else {
|
4426
|
+
const tempPath = `${targetPath}.tmp${process.pid}`;
|
4427
|
+
await import_fs.default.promises.copyFile(sourcePath, tempPath);
|
4428
|
+
await import_fs.default.promises.rename(tempPath, targetPath);
|
4429
|
+
}
|
4430
|
+
}
|
4431
|
+
async function removeFileIfExists(filePath) {
|
4432
|
+
try {
|
4433
|
+
await import_fs.default.promises.unlink(filePath);
|
4434
|
+
} catch (e) {
|
4435
|
+
if (e.code !== "ENOENT") {
|
4436
|
+
throw e;
|
4437
|
+
}
|
4438
|
+
}
|
4439
|
+
}
|
4440
|
+
|
4471
4441
|
// ../internals/src/utils/path.ts
|
4472
4442
|
var import_path = __toESM(require("path"));
|
4473
4443
|
function pathToPosix(filePath) {
|
@@ -4786,8 +4756,8 @@ var ConstDeclaration = class {
|
|
4786
4756
|
constructor(name, type) {
|
4787
4757
|
this.name = name;
|
4788
4758
|
this.type = type;
|
4789
|
-
__publicField(this, "docComment");
|
4790
4759
|
}
|
4760
|
+
docComment;
|
4791
4761
|
setDocComment(docComment2) {
|
4792
4762
|
this.docComment = docComment2;
|
4793
4763
|
return this;
|
@@ -4805,8 +4775,8 @@ function constDeclaration(name, type) {
|
|
4805
4775
|
|
4806
4776
|
// src/generation/ts-builders/DocComment.ts
|
4807
4777
|
var DocComment = class {
|
4778
|
+
lines = [];
|
4808
4779
|
constructor(startingText) {
|
4809
|
-
__publicField(this, "lines", []);
|
4810
4780
|
if (startingText) {
|
4811
4781
|
this.addText(startingText);
|
4812
4782
|
}
|
@@ -4881,8 +4851,8 @@ function getIndent(line) {
|
|
4881
4851
|
var Export = class {
|
4882
4852
|
constructor(declaration) {
|
4883
4853
|
this.declaration = declaration;
|
4884
|
-
__publicField(this, "docComment");
|
4885
4854
|
}
|
4855
|
+
docComment;
|
4886
4856
|
setDocComment(docComment2) {
|
4887
4857
|
this.docComment = docComment2;
|
4888
4858
|
return this;
|
@@ -4911,8 +4881,8 @@ var NamespaceExport = class {
|
|
4911
4881
|
var BindingsExport = class {
|
4912
4882
|
constructor(from) {
|
4913
4883
|
this.from = from;
|
4914
|
-
__publicField(this, "namedExports", []);
|
4915
4884
|
}
|
4885
|
+
namedExports = [];
|
4916
4886
|
named(namedExport) {
|
4917
4887
|
if (typeof namedExport === "string") {
|
4918
4888
|
namedExport = new NamedExport(namedExport);
|
@@ -4927,8 +4897,8 @@ var BindingsExport = class {
|
|
4927
4897
|
var NamedExport = class {
|
4928
4898
|
constructor(name) {
|
4929
4899
|
this.name = name;
|
4930
|
-
__publicField(this, "alias");
|
4931
4900
|
}
|
4901
|
+
alias;
|
4932
4902
|
as(alias) {
|
4933
4903
|
this.alias = alias;
|
4934
4904
|
return this;
|
@@ -4960,10 +4930,8 @@ function moduleExportFrom(from) {
|
|
4960
4930
|
|
4961
4931
|
// src/generation/ts-builders/File.ts
|
4962
4932
|
var File = class {
|
4963
|
-
|
4964
|
-
|
4965
|
-
__publicField(this, "declarations", []);
|
4966
|
-
}
|
4933
|
+
imports = [];
|
4934
|
+
declarations = [];
|
4967
4935
|
addImport(moduleImport2) {
|
4968
4936
|
this.imports.push(moduleImport2);
|
4969
4937
|
return this;
|
@@ -5016,15 +4984,12 @@ var neverType = new PrimitiveType("never");
|
|
5016
4984
|
// src/generation/ts-builders/FunctionType.ts
|
5017
4985
|
init_TypeBuilder();
|
5018
4986
|
var FunctionType = class extends TypeBuilder {
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5024
|
-
|
5025
|
-
__publicField(this, "parameters", []);
|
5026
|
-
__publicField(this, "genericParameters", []);
|
5027
|
-
}
|
4987
|
+
needsParenthesisWhenIndexed = true;
|
4988
|
+
needsParenthesisInKeyof = true;
|
4989
|
+
needsParenthesisInUnion = true;
|
4990
|
+
returnType = voidType;
|
4991
|
+
parameters = [];
|
4992
|
+
genericParameters = [];
|
5028
4993
|
setReturnType(returnType) {
|
5029
4994
|
this.returnType = returnType;
|
5030
4995
|
return this;
|
@@ -5054,8 +5019,8 @@ var NamedType = class extends TypeBuilder {
|
|
5054
5019
|
constructor(name) {
|
5055
5020
|
super();
|
5056
5021
|
this.name = name;
|
5057
|
-
__publicField(this, "genericArguments", []);
|
5058
5022
|
}
|
5023
|
+
genericArguments = [];
|
5059
5024
|
addGenericArgument(type) {
|
5060
5025
|
this.genericArguments.push(type);
|
5061
5026
|
return this;
|
@@ -5075,9 +5040,9 @@ function namedType(name) {
|
|
5075
5040
|
var GenericParameter = class {
|
5076
5041
|
constructor(name) {
|
5077
5042
|
this.name = name;
|
5078
|
-
__publicField(this, "extendedType");
|
5079
|
-
__publicField(this, "defaultType");
|
5080
5043
|
}
|
5044
|
+
extendedType;
|
5045
|
+
defaultType;
|
5081
5046
|
extends(type) {
|
5082
5047
|
this.extendedType = type;
|
5083
5048
|
return this;
|
@@ -5130,9 +5095,9 @@ var NamespaceImport = class {
|
|
5130
5095
|
var BindingsImport = class {
|
5131
5096
|
constructor(from) {
|
5132
5097
|
this.from = from;
|
5133
|
-
__publicField(this, "defaultImport");
|
5134
|
-
__publicField(this, "namedImports", []);
|
5135
5098
|
}
|
5099
|
+
defaultImport;
|
5100
|
+
namedImports = [];
|
5136
5101
|
default(name) {
|
5137
5102
|
this.defaultImport = name;
|
5138
5103
|
return this;
|
@@ -5164,8 +5129,8 @@ var BindingsImport = class {
|
|
5164
5129
|
var NamedImport = class {
|
5165
5130
|
constructor(name) {
|
5166
5131
|
this.name = name;
|
5167
|
-
__publicField(this, "alias");
|
5168
5132
|
}
|
5133
|
+
alias;
|
5169
5134
|
as(alias) {
|
5170
5135
|
this.alias = alias;
|
5171
5136
|
return this;
|
@@ -5204,11 +5169,11 @@ var InterfaceDeclaration = class extends TypeBuilder {
|
|
5204
5169
|
constructor(name) {
|
5205
5170
|
super();
|
5206
5171
|
this.name = name;
|
5207
|
-
__publicField(this, "needsParenthesisWhenIndexed", true);
|
5208
|
-
__publicField(this, "items", []);
|
5209
|
-
__publicField(this, "genericParameters", []);
|
5210
|
-
__publicField(this, "extendedTypes", []);
|
5211
5172
|
}
|
5173
|
+
needsParenthesisWhenIndexed = true;
|
5174
|
+
items = [];
|
5175
|
+
genericParameters = [];
|
5176
|
+
extendedTypes = [];
|
5212
5177
|
add(item) {
|
5213
5178
|
this.items.push(item);
|
5214
5179
|
return this;
|
@@ -5254,11 +5219,11 @@ function interfaceDeclaration(name) {
|
|
5254
5219
|
var Method = class {
|
5255
5220
|
constructor(name) {
|
5256
5221
|
this.name = name;
|
5257
|
-
__publicField(this, "docComment");
|
5258
|
-
__publicField(this, "returnType", voidType);
|
5259
|
-
__publicField(this, "parameters", []);
|
5260
|
-
__publicField(this, "genericParameters", []);
|
5261
5222
|
}
|
5223
|
+
docComment;
|
5224
|
+
returnType = voidType;
|
5225
|
+
parameters = [];
|
5226
|
+
genericParameters = [];
|
5262
5227
|
setDocComment(docComment2) {
|
5263
5228
|
this.docComment = docComment2;
|
5264
5229
|
return this;
|
@@ -5301,8 +5266,8 @@ function method(name) {
|
|
5301
5266
|
var NamespaceDeclaration = class {
|
5302
5267
|
constructor(name) {
|
5303
5268
|
this.name = name;
|
5304
|
-
__publicField(this, "items", []);
|
5305
5269
|
}
|
5270
|
+
items = [];
|
5306
5271
|
add(declaration) {
|
5307
5272
|
this.items.push(declaration);
|
5308
5273
|
}
|
@@ -5321,12 +5286,9 @@ function namespace(name) {
|
|
5321
5286
|
// src/generation/ts-builders/ObjectType.ts
|
5322
5287
|
init_TypeBuilder();
|
5323
5288
|
var ObjectType = class extends TypeBuilder {
|
5324
|
-
|
5325
|
-
|
5326
|
-
|
5327
|
-
__publicField(this, "items", []);
|
5328
|
-
__publicField(this, "inline", false);
|
5329
|
-
}
|
5289
|
+
needsParenthesisWhenIndexed = true;
|
5290
|
+
items = [];
|
5291
|
+
inline = false;
|
5330
5292
|
add(item) {
|
5331
5293
|
this.items.push(item);
|
5332
5294
|
return this;
|
@@ -5370,8 +5332,8 @@ var Parameter = class {
|
|
5370
5332
|
constructor(name, type) {
|
5371
5333
|
this.name = name;
|
5372
5334
|
this.type = type;
|
5373
|
-
__publicField(this, "isOptional", false);
|
5374
5335
|
}
|
5336
|
+
isOptional = false;
|
5375
5337
|
optional() {
|
5376
5338
|
this.isOptional = true;
|
5377
5339
|
return this;
|
@@ -5393,10 +5355,10 @@ var Property = class {
|
|
5393
5355
|
constructor(name, type) {
|
5394
5356
|
this.name = name;
|
5395
5357
|
this.type = type;
|
5396
|
-
__publicField(this, "isOptional", false);
|
5397
|
-
__publicField(this, "isReadonly", false);
|
5398
|
-
__publicField(this, "docComment");
|
5399
5358
|
}
|
5359
|
+
isOptional = false;
|
5360
|
+
isReadonly = false;
|
5361
|
+
docComment;
|
5400
5362
|
optional() {
|
5401
5363
|
this.isOptional = true;
|
5402
5364
|
return this;
|
@@ -5440,13 +5402,13 @@ var INDENT_SIZE = 2;
|
|
5440
5402
|
var Writer = class {
|
5441
5403
|
constructor(startingIndent = 0, context) {
|
5442
5404
|
this.context = context;
|
5443
|
-
__publicField(this, "lines", []);
|
5444
|
-
__publicField(this, "currentLine", "");
|
5445
|
-
__publicField(this, "currentIndent", 0);
|
5446
|
-
__publicField(this, "marginSymbol");
|
5447
|
-
__publicField(this, "afterNextNewLineCallback");
|
5448
5405
|
this.currentIndent = startingIndent;
|
5449
5406
|
}
|
5407
|
+
lines = [];
|
5408
|
+
currentLine = "";
|
5409
|
+
currentIndent = 0;
|
5410
|
+
marginSymbol;
|
5411
|
+
afterNextNewLineCallback;
|
5450
5412
|
/**
|
5451
5413
|
* Adds provided value to the current line. Does not end the line.
|
5452
5414
|
*
|
@@ -5620,8 +5582,8 @@ init_TypeBuilder();
|
|
5620
5582
|
var TupleItem = class {
|
5621
5583
|
constructor(type) {
|
5622
5584
|
this.type = type;
|
5623
|
-
__publicField(this, "name");
|
5624
5585
|
}
|
5586
|
+
name;
|
5625
5587
|
setName(name) {
|
5626
5588
|
this.name = name;
|
5627
5589
|
return this;
|
@@ -5634,10 +5596,7 @@ var TupleItem = class {
|
|
5634
5596
|
}
|
5635
5597
|
};
|
5636
5598
|
var TupleType = class extends TypeBuilder {
|
5637
|
-
|
5638
|
-
super(...arguments);
|
5639
|
-
__publicField(this, "items", []);
|
5640
|
-
}
|
5599
|
+
items = [];
|
5641
5600
|
add(item) {
|
5642
5601
|
if (item instanceof TypeBuilder) {
|
5643
5602
|
item = new TupleItem(item);
|
@@ -5661,9 +5620,9 @@ var TypeDeclaration = class {
|
|
5661
5620
|
constructor(name, type) {
|
5662
5621
|
this.name = name;
|
5663
5622
|
this.type = type;
|
5664
|
-
__publicField(this, "genericParameters", []);
|
5665
|
-
__publicField(this, "docComment");
|
5666
5623
|
}
|
5624
|
+
genericParameters = [];
|
5625
|
+
docComment;
|
5667
5626
|
addGenericParameter(param) {
|
5668
5627
|
this.genericParameters.push(param);
|
5669
5628
|
return this;
|
@@ -5694,11 +5653,11 @@ function typeDeclaration(name, type) {
|
|
5694
5653
|
// src/generation/ts-builders/UnionType.ts
|
5695
5654
|
init_TypeBuilder();
|
5696
5655
|
var UnionType = class extends TypeBuilder {
|
5656
|
+
needsParenthesisWhenIndexed = true;
|
5657
|
+
needsParenthesisInKeyof = true;
|
5658
|
+
variants;
|
5697
5659
|
constructor(firstType) {
|
5698
5660
|
super();
|
5699
|
-
__publicField(this, "needsParenthesisWhenIndexed", true);
|
5700
|
-
__publicField(this, "needsParenthesisInKeyof", true);
|
5701
|
-
__publicField(this, "variants");
|
5702
5661
|
this.variants = [firstType];
|
5703
5662
|
}
|
5704
5663
|
addVariant(variant) {
|
@@ -5752,6 +5711,45 @@ function wellKnownSymbol(name) {
|
|
5752
5711
|
}
|
5753
5712
|
var toStringTag = wellKnownSymbol("toStringTag");
|
5754
5713
|
|
5714
|
+
// ../dmmf/src/index.ts
|
5715
|
+
var src_exports = {};
|
5716
|
+
__export(src_exports, {
|
5717
|
+
ModelAction: () => ModelAction,
|
5718
|
+
datamodelEnumToSchemaEnum: () => datamodelEnumToSchemaEnum
|
5719
|
+
});
|
5720
|
+
|
5721
|
+
// ../dmmf/src/convert.ts
|
5722
|
+
function datamodelEnumToSchemaEnum(datamodelEnum) {
|
5723
|
+
return {
|
5724
|
+
name: datamodelEnum.name,
|
5725
|
+
values: datamodelEnum.values.map((v) => v.name)
|
5726
|
+
};
|
5727
|
+
}
|
5728
|
+
|
5729
|
+
// ../dmmf/src/dmmf.ts
|
5730
|
+
var ModelAction = /* @__PURE__ */ ((ModelAction2) => {
|
5731
|
+
ModelAction2["findUnique"] = "findUnique";
|
5732
|
+
ModelAction2["findUniqueOrThrow"] = "findUniqueOrThrow";
|
5733
|
+
ModelAction2["findFirst"] = "findFirst";
|
5734
|
+
ModelAction2["findFirstOrThrow"] = "findFirstOrThrow";
|
5735
|
+
ModelAction2["findMany"] = "findMany";
|
5736
|
+
ModelAction2["create"] = "create";
|
5737
|
+
ModelAction2["createMany"] = "createMany";
|
5738
|
+
ModelAction2["createManyAndReturn"] = "createManyAndReturn";
|
5739
|
+
ModelAction2["update"] = "update";
|
5740
|
+
ModelAction2["updateMany"] = "updateMany";
|
5741
|
+
ModelAction2["updateManyAndReturn"] = "updateManyAndReturn";
|
5742
|
+
ModelAction2["upsert"] = "upsert";
|
5743
|
+
ModelAction2["delete"] = "delete";
|
5744
|
+
ModelAction2["deleteMany"] = "deleteMany";
|
5745
|
+
ModelAction2["groupBy"] = "groupBy";
|
5746
|
+
ModelAction2["count"] = "count";
|
5747
|
+
ModelAction2["aggregate"] = "aggregate";
|
5748
|
+
ModelAction2["findRaw"] = "findRaw";
|
5749
|
+
ModelAction2["aggregateRaw"] = "aggregateRaw";
|
5750
|
+
return ModelAction2;
|
5751
|
+
})(ModelAction || {});
|
5752
|
+
|
5755
5753
|
// src/generation/utils.ts
|
5756
5754
|
function getSelectName(modelName) {
|
5757
5755
|
return `${modelName}Select`;
|
@@ -5833,43 +5831,43 @@ function getModelArgName(modelName, action) {
|
|
5833
5831
|
return `${modelName}DefaultArgs`;
|
5834
5832
|
}
|
5835
5833
|
switch (action) {
|
5836
|
-
case
|
5834
|
+
case src_exports.ModelAction.findMany:
|
5837
5835
|
return `${modelName}FindManyArgs`;
|
5838
|
-
case
|
5836
|
+
case src_exports.ModelAction.findUnique:
|
5839
5837
|
return `${modelName}FindUniqueArgs`;
|
5840
|
-
case
|
5838
|
+
case src_exports.ModelAction.findUniqueOrThrow:
|
5841
5839
|
return `${modelName}FindUniqueOrThrowArgs`;
|
5842
|
-
case
|
5840
|
+
case src_exports.ModelAction.findFirst:
|
5843
5841
|
return `${modelName}FindFirstArgs`;
|
5844
|
-
case
|
5842
|
+
case src_exports.ModelAction.findFirstOrThrow:
|
5845
5843
|
return `${modelName}FindFirstOrThrowArgs`;
|
5846
|
-
case
|
5844
|
+
case src_exports.ModelAction.upsert:
|
5847
5845
|
return `${modelName}UpsertArgs`;
|
5848
|
-
case
|
5846
|
+
case src_exports.ModelAction.update:
|
5849
5847
|
return `${modelName}UpdateArgs`;
|
5850
|
-
case
|
5848
|
+
case src_exports.ModelAction.updateMany:
|
5851
5849
|
return `${modelName}UpdateManyArgs`;
|
5852
|
-
case
|
5850
|
+
case src_exports.ModelAction.updateManyAndReturn:
|
5853
5851
|
return `${modelName}UpdateManyAndReturnArgs`;
|
5854
|
-
case
|
5852
|
+
case src_exports.ModelAction.delete:
|
5855
5853
|
return `${modelName}DeleteArgs`;
|
5856
|
-
case
|
5854
|
+
case src_exports.ModelAction.create:
|
5857
5855
|
return `${modelName}CreateArgs`;
|
5858
|
-
case
|
5856
|
+
case src_exports.ModelAction.createMany:
|
5859
5857
|
return `${modelName}CreateManyArgs`;
|
5860
|
-
case
|
5858
|
+
case src_exports.ModelAction.createManyAndReturn:
|
5861
5859
|
return `${modelName}CreateManyAndReturnArgs`;
|
5862
|
-
case
|
5860
|
+
case src_exports.ModelAction.deleteMany:
|
5863
5861
|
return `${modelName}DeleteManyArgs`;
|
5864
|
-
case
|
5862
|
+
case src_exports.ModelAction.groupBy:
|
5865
5863
|
return getGroupByArgsName(modelName);
|
5866
|
-
case
|
5864
|
+
case src_exports.ModelAction.aggregate:
|
5867
5865
|
return getAggregateArgsName(modelName);
|
5868
|
-
case
|
5866
|
+
case src_exports.ModelAction.count:
|
5869
5867
|
return `${modelName}CountArgs`;
|
5870
|
-
case
|
5868
|
+
case src_exports.ModelAction.findRaw:
|
5871
5869
|
return `${modelName}FindRawArgs`;
|
5872
|
-
case
|
5870
|
+
case src_exports.ModelAction.aggregateRaw:
|
5873
5871
|
return `${modelName}AggregateRawArgs`;
|
5874
5872
|
default:
|
5875
5873
|
assertNever(action, `Unknown action: ${action}`);
|
@@ -5983,9 +5981,9 @@ var InputType = class {
|
|
5983
5981
|
constructor(type, context) {
|
5984
5982
|
this.type = type;
|
5985
5983
|
this.context = context;
|
5986
|
-
__publicField(this, "generatedName");
|
5987
5984
|
this.generatedName = type.name;
|
5988
5985
|
}
|
5986
|
+
generatedName;
|
5989
5987
|
toTS() {
|
5990
5988
|
const { type } = this;
|
5991
5989
|
const source = type.meta?.source;
|
@@ -6557,12 +6555,12 @@ var ArgsTypeBuilder = class {
|
|
6557
6555
|
this.type = type;
|
6558
6556
|
this.context = context;
|
6559
6557
|
this.action = action;
|
6560
|
-
__publicField(this, "moduleExport");
|
6561
|
-
__publicField(this, "hasDefaultName", true);
|
6562
6558
|
this.moduleExport = moduleExport(
|
6563
6559
|
typeDeclaration(getModelArgName(type.name, action), objectType()).addGenericParameter(extArgsParam)
|
6564
6560
|
).setDocComment(docComment(`${type.name} ${action ?? "without action"}`));
|
6565
6561
|
}
|
6562
|
+
moduleExport;
|
6563
|
+
hasDefaultName = true;
|
6566
6564
|
addProperty(prop) {
|
6567
6565
|
this.moduleExport.declaration.type.add(prop);
|
6568
6566
|
}
|
@@ -6828,20 +6826,20 @@ var Model = class {
|
|
6828
6826
|
constructor(model, context) {
|
6829
6827
|
this.model = model;
|
6830
6828
|
this.context = context;
|
6831
|
-
__publicField(this, "type");
|
6832
|
-
__publicField(this, "createManyAndReturnType");
|
6833
|
-
__publicField(this, "updateManyAndReturnType");
|
6834
|
-
__publicField(this, "mapping");
|
6835
|
-
__publicField(this, "dmmf");
|
6836
6829
|
this.dmmf = context.dmmf;
|
6837
6830
|
this.type = this.context.dmmf.outputTypeMap.model[model.name];
|
6838
6831
|
this.createManyAndReturnType = this.context.dmmf.outputTypeMap.model[getCreateManyAndReturnOutputType(model.name)];
|
6839
6832
|
this.updateManyAndReturnType = this.context.dmmf.outputTypeMap.model[getUpdateManyAndReturnOutputType(model.name)];
|
6840
6833
|
this.mapping = this.context.dmmf.mappings.modelOperations.find((m) => m.model === model.name);
|
6841
6834
|
}
|
6835
|
+
type;
|
6836
|
+
createManyAndReturnType;
|
6837
|
+
updateManyAndReturnType;
|
6838
|
+
mapping;
|
6839
|
+
dmmf;
|
6842
6840
|
get argsTypes() {
|
6843
6841
|
const argsTypes = [];
|
6844
|
-
for (const action of Object.keys(
|
6842
|
+
for (const action of Object.keys(src_exports.ModelAction)) {
|
6845
6843
|
const fieldName = this.rootFieldNameForAction(action);
|
6846
6844
|
if (!fieldName) {
|
6847
6845
|
continue;
|
@@ -6915,7 +6913,7 @@ var Model = class {
|
|
6915
6913
|
export type ${groupByArgsName}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
|
6916
6914
|
${(0, import_indent_string3.default)(
|
6917
6915
|
groupByRootField.args.map((arg) => {
|
6918
|
-
const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type,
|
6916
|
+
const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, src_exports.ModelAction.groupBy, arg) };
|
6919
6917
|
return new InputField(updatedArg, this.context).toTS();
|
6920
6918
|
}).concat(
|
6921
6919
|
groupByType.fields.filter((f) => f.outputType.location === "outputObjectTypes").map((f) => {
|
@@ -7008,12 +7006,12 @@ ${aggregateTypes.length > 1 ? aggregateTypes.slice(1).map((type) => {
|
|
7008
7006
|
export type ${aggregateArgsName}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {
|
7009
7007
|
${(0, import_indent_string3.default)(
|
7010
7008
|
aggregateRootField.args.map((arg) => {
|
7011
|
-
const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type,
|
7009
|
+
const updatedArg = { ...arg, comment: getArgFieldJSDoc(this.type, src_exports.ModelAction.aggregate, arg) };
|
7012
7010
|
return new InputField(updatedArg, this.context).toTS();
|
7013
7011
|
}).concat(
|
7014
7012
|
aggregateType.fields.map((f) => {
|
7015
7013
|
let data = "";
|
7016
|
-
const comment = getArgFieldJSDoc(this.type,
|
7014
|
+
const comment = getArgFieldJSDoc(this.type, src_exports.ModelAction.aggregate, f.name);
|
7017
7015
|
data += comment ? wrapComment(comment) + "\n" : "";
|
7018
7016
|
if (f.name === "_count" || f.name === "count") {
|
7019
7017
|
data += `${f.name}?: true | ${getCountAggregateInputName(model.name)}`;
|
@@ -7149,7 +7147,7 @@ var ModelDelegate = class {
|
|
7149
7147
|
*/
|
7150
7148
|
getNonAggregateActions(availableActions) {
|
7151
7149
|
const actions = availableActions.filter(
|
7152
|
-
(key) => key !==
|
7150
|
+
(key) => key !== src_exports.ModelAction.aggregate && key !== src_exports.ModelAction.groupBy && key !== src_exports.ModelAction.count
|
7153
7151
|
);
|
7154
7152
|
return actions;
|
7155
7153
|
}
|
@@ -7161,15 +7159,15 @@ var ModelDelegate = class {
|
|
7161
7159
|
const availableActions = getModelActions(dmmf, name);
|
7162
7160
|
const nonAggregateActions = this.getNonAggregateActions(availableActions);
|
7163
7161
|
const groupByArgsName = getGroupByArgsName(name);
|
7164
|
-
const countArgsName = getModelArgName(name,
|
7162
|
+
const countArgsName = getModelArgName(name, src_exports.ModelAction.count);
|
7165
7163
|
const genericDelegateParams = [extArgsParam, genericParameter("GlobalOmitOptions").default(objectType())];
|
7166
7164
|
const excludedArgsForCount = ["select", "include", "distinct", "omit"];
|
7167
7165
|
if (this.context.isPreviewFeatureOn("relationJoins")) {
|
7168
7166
|
excludedArgsForCount.push("relationLoadStrategy");
|
7169
7167
|
}
|
7170
7168
|
const excludedArgsForCountType = excludedArgsForCount.map((name2) => `'${name2}'`).join(" | ");
|
7171
|
-
return `${availableActions.includes(
|
7172
|
-
Omit<${getModelArgName(name,
|
7169
|
+
return `${availableActions.includes(src_exports.ModelAction.aggregate) ? `type ${countArgsName}<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> =
|
7170
|
+
Omit<${getModelArgName(name, src_exports.ModelAction.findMany)}, ${excludedArgsForCountType}> & {
|
7173
7171
|
select?: ${getCountAggregateInputName(name)} | true
|
7174
7172
|
}
|
7175
7173
|
` : ""}
|
@@ -7180,7 +7178,7 @@ ${nonAggregateActions.map((action) => {
|
|
7180
7178
|
return stringify(method2, { indentLevel: 1, newLine: "trailing" });
|
7181
7179
|
}).join("\n")}
|
7182
7180
|
|
7183
|
-
${availableActions.includes(
|
7181
|
+
${availableActions.includes(src_exports.ModelAction.aggregate) ? `${(0, import_indent_string3.default)(getMethodJSDoc(src_exports.ModelAction.count, mapping, modelOrType), TAB_SIZE)}
|
7184
7182
|
count<T extends ${countArgsName}>(
|
7185
7183
|
args?: Subset<T, ${countArgsName}>,
|
7186
7184
|
): Prisma.PrismaPromise<
|
@@ -7191,12 +7189,12 @@ ${availableActions.includes(DMMF.ModelAction.aggregate) ? `${(0, import_indent_s
|
|
7191
7189
|
: number
|
7192
7190
|
>
|
7193
7191
|
` : ""}
|
7194
|
-
${availableActions.includes(
|
7192
|
+
${availableActions.includes(src_exports.ModelAction.aggregate) ? `${(0, import_indent_string3.default)(getMethodJSDoc(src_exports.ModelAction.aggregate, mapping, modelOrType), TAB_SIZE)}
|
7195
7193
|
aggregate<T extends ${getAggregateArgsName(name)}>(args: Subset<T, ${getAggregateArgsName(
|
7196
7194
|
name
|
7197
7195
|
)}>): Prisma.PrismaPromise<${getAggregateGetName(name)}<T>>
|
7198
7196
|
` : ""}
|
7199
|
-
${availableActions.includes(
|
7197
|
+
${availableActions.includes(src_exports.ModelAction.groupBy) ? `${(0, import_indent_string3.default)(getMethodJSDoc(src_exports.ModelAction.groupBy, mapping, modelOrType), TAB_SIZE)}
|
7200
7198
|
groupBy<
|
7201
7199
|
T extends ${groupByArgsName},
|
7202
7200
|
HasSelectOrTake extends Or<
|
@@ -7279,31 +7277,31 @@ function buildModelDelegateMethod(modelName, actionName, context) {
|
|
7279
7277
|
}
|
7280
7278
|
function getNonAggregateMethodArgs(modelName, actionName) {
|
7281
7279
|
const makeParameter = (type2) => parameter("args", type2);
|
7282
|
-
if (actionName ===
|
7280
|
+
if (actionName === src_exports.ModelAction.count) {
|
7283
7281
|
const type2 = omit(
|
7284
|
-
namedType(getModelArgName(modelName,
|
7282
|
+
namedType(getModelArgName(modelName, src_exports.ModelAction.findMany)),
|
7285
7283
|
unionType(stringLiteral("select")).addVariant(stringLiteral("include")).addVariant(stringLiteral("distinct"))
|
7286
7284
|
);
|
7287
7285
|
return makeParameter(type2).optional();
|
7288
7286
|
}
|
7289
|
-
if (actionName ===
|
7287
|
+
if (actionName === src_exports.ModelAction.findRaw || actionName === src_exports.ModelAction.aggregateRaw) {
|
7290
7288
|
return makeParameter(namedType(getModelArgName(modelName, actionName))).optional();
|
7291
7289
|
}
|
7292
7290
|
const type = namedType("SelectSubset").addGenericArgument(namedType("T")).addGenericArgument(
|
7293
7291
|
namedType(getModelArgName(modelName, actionName)).addGenericArgument(extArgsParam.toArgument())
|
7294
7292
|
);
|
7295
7293
|
const param = makeParameter(type);
|
7296
|
-
if (actionName ===
|
7294
|
+
if (actionName === src_exports.ModelAction.findMany || actionName === src_exports.ModelAction.findFirst || actionName === src_exports.ModelAction.deleteMany || actionName === src_exports.ModelAction.createMany || actionName === src_exports.ModelAction.createManyAndReturn || actionName === src_exports.ModelAction.findFirstOrThrow) {
|
7297
7295
|
param.optional();
|
7298
7296
|
}
|
7299
7297
|
return param;
|
7300
7298
|
}
|
7301
7299
|
function getNonAggregateMethodGenericParam(modelName, actionName) {
|
7302
|
-
if (actionName ===
|
7300
|
+
if (actionName === src_exports.ModelAction.count || actionName === src_exports.ModelAction.findRaw || actionName === src_exports.ModelAction.aggregateRaw) {
|
7303
7301
|
return null;
|
7304
7302
|
}
|
7305
7303
|
const arg = genericParameter("T");
|
7306
|
-
if (actionName ===
|
7304
|
+
if (actionName === src_exports.ModelAction.aggregate) {
|
7307
7305
|
return arg.extends(namedType(getAggregateArgsName(modelName)));
|
7308
7306
|
}
|
7309
7307
|
return arg.extends(namedType(getModelArgName(modelName, actionName)));
|
@@ -7314,19 +7312,19 @@ function getReturnType({
|
|
7314
7312
|
isChaining = false,
|
7315
7313
|
isNullable = false
|
7316
7314
|
}) {
|
7317
|
-
if (actionName ===
|
7315
|
+
if (actionName === src_exports.ModelAction.count) {
|
7318
7316
|
return promise(numberType);
|
7319
7317
|
}
|
7320
|
-
if (actionName ===
|
7318
|
+
if (actionName === src_exports.ModelAction.aggregate) {
|
7321
7319
|
return promise(namedType(getAggregateGetName(modelName)).addGenericArgument(namedType("T")));
|
7322
7320
|
}
|
7323
|
-
if (actionName ===
|
7321
|
+
if (actionName === src_exports.ModelAction.findRaw || actionName === src_exports.ModelAction.aggregateRaw) {
|
7324
7322
|
return prismaPromise(namedType("JsonObject"));
|
7325
7323
|
}
|
7326
|
-
if (actionName ===
|
7324
|
+
if (actionName === src_exports.ModelAction.deleteMany || actionName === src_exports.ModelAction.updateMany || actionName === src_exports.ModelAction.createMany) {
|
7327
7325
|
return prismaPromise(namedType("BatchPayload"));
|
7328
7326
|
}
|
7329
|
-
const isList = actionName ===
|
7327
|
+
const isList = actionName === src_exports.ModelAction.findMany || actionName === src_exports.ModelAction.createManyAndReturn || actionName === src_exports.ModelAction.updateManyAndReturn;
|
7330
7328
|
if (isList) {
|
7331
7329
|
let result = getResultType(modelName, actionName);
|
7332
7330
|
if (isChaining) {
|
@@ -7334,12 +7332,12 @@ function getReturnType({
|
|
7334
7332
|
}
|
7335
7333
|
return prismaPromise(result);
|
7336
7334
|
}
|
7337
|
-
if (isChaining && actionName ===
|
7335
|
+
if (isChaining && actionName === src_exports.ModelAction.findUniqueOrThrow) {
|
7338
7336
|
const nullType2 = isNullable ? nullType : namedType("Null");
|
7339
7337
|
const result = unionType(getResultType(modelName, actionName)).addVariant(nullType2);
|
7340
7338
|
return getFluentWrapper(modelName, result, nullType2);
|
7341
7339
|
}
|
7342
|
-
if (actionName ===
|
7340
|
+
if (actionName === src_exports.ModelAction.findFirst || actionName === src_exports.ModelAction.findUnique) {
|
7343
7341
|
const result = unionType(getResultType(modelName, actionName)).addVariant(nullType);
|
7344
7342
|
return getFluentWrapper(modelName, result, nullType);
|
7345
7343
|
}
|
@@ -7364,7 +7362,7 @@ function buildFluentWrapperDefinition(modelName, outputType, context) {
|
|
7364
7362
|
return method(field.name).addGenericParameter(argsParam).addParameter(parameter("args", subset(argsParam.toArgument(), fieldArgType)).optional()).setReturnType(
|
7365
7363
|
getReturnType({
|
7366
7364
|
modelName: field.outputType.type,
|
7367
|
-
actionName: field.outputType.isList ?
|
7365
|
+
actionName: field.outputType.isList ? src_exports.ModelAction.findMany : src_exports.ModelAction.findUniqueOrThrow,
|
7368
7366
|
isChaining: true,
|
7369
7367
|
isNullable: field.isNullable
|
7370
7368
|
})
|
@@ -7439,13 +7437,13 @@ var import_path4 = __toESM(require("path"));
|
|
7439
7437
|
var DMMFHelper = class {
|
7440
7438
|
constructor(document) {
|
7441
7439
|
this.document = document;
|
7442
|
-
__publicField(this, "_compositeNames");
|
7443
|
-
__publicField(this, "_inputTypesByName");
|
7444
|
-
__publicField(this, "_typeAndModelMap");
|
7445
|
-
__publicField(this, "_mappingsMap");
|
7446
|
-
__publicField(this, "_outputTypeMap");
|
7447
|
-
__publicField(this, "_rootFieldMap");
|
7448
7440
|
}
|
7441
|
+
_compositeNames;
|
7442
|
+
_inputTypesByName;
|
7443
|
+
_typeAndModelMap;
|
7444
|
+
_mappingsMap;
|
7445
|
+
_outputTypeMap;
|
7446
|
+
_rootFieldMap;
|
7449
7447
|
get compositeNames() {
|
7450
7448
|
return this._compositeNames ??= new Set(this.datamodel.types.map((t) => t.name));
|
7451
7449
|
}
|
@@ -7553,9 +7551,7 @@ function fullyQualifiedName(typeName, namespace2) {
|
|
7553
7551
|
|
7554
7552
|
// src/generation/Cache.ts
|
7555
7553
|
var Cache = class {
|
7556
|
-
|
7557
|
-
__publicField(this, "_map", /* @__PURE__ */ new Map());
|
7558
|
-
}
|
7554
|
+
_map = /* @__PURE__ */ new Map();
|
7559
7555
|
get(key) {
|
7560
7556
|
return this._map.get(key)?.value;
|
7561
7557
|
}
|
@@ -7577,8 +7573,8 @@ var Cache = class {
|
|
7577
7573
|
var GenericArgsInfo = class {
|
7578
7574
|
constructor(_dmmf) {
|
7579
7575
|
this._dmmf = _dmmf;
|
7580
|
-
__publicField(this, "_cache", new Cache());
|
7581
7576
|
}
|
7577
|
+
_cache = new Cache();
|
7582
7578
|
/**
|
7583
7579
|
* Determines if arg types need generic <$PrismaModel> argument added.
|
7584
7580
|
* Essentially, performs breadth-first search for any fieldRefTypes that
|
@@ -8562,10 +8558,10 @@ export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${
|
|
8562
8558
|
|
8563
8559
|
// src/generation/TSClient/GenerateContext.ts
|
8564
8560
|
var GenerateContext = class {
|
8561
|
+
dmmf;
|
8562
|
+
genericArgsInfo;
|
8563
|
+
generator;
|
8565
8564
|
constructor({ dmmf, genericArgsInfo, generator }) {
|
8566
|
-
__publicField(this, "dmmf");
|
8567
|
-
__publicField(this, "genericArgsInfo");
|
8568
|
-
__publicField(this, "generator");
|
8569
8565
|
this.dmmf = dmmf;
|
8570
8566
|
this.genericArgsInfo = genericArgsInfo;
|
8571
8567
|
this.generator = generator;
|
@@ -9126,7 +9122,7 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
9126
9122
|
);
|
9127
9123
|
if (["library.js", "client.js"].includes(this.runtimeNameTs) && this.context.isPreviewFeatureOn("driverAdapters")) {
|
9128
9124
|
clientOptions.add(
|
9129
|
-
property("adapter", unionType([namedType("runtime.
|
9125
|
+
property("adapter", unionType([namedType("runtime.SqlDriverAdapterFactory"), namedType("null")])).optional().setDocComment(
|
9130
9126
|
docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`")
|
9131
9127
|
)
|
9132
9128
|
);
|
@@ -9155,11 +9151,11 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
9155
9151
|
var TSClient = class {
|
9156
9152
|
constructor(options) {
|
9157
9153
|
this.options = options;
|
9158
|
-
__publicField(this, "dmmf");
|
9159
|
-
__publicField(this, "genericsInfo");
|
9160
9154
|
this.dmmf = new DMMFHelper(options.dmmf);
|
9161
9155
|
this.genericsInfo = new GenericArgsInfo(this.dmmf);
|
9162
9156
|
}
|
9157
|
+
dmmf;
|
9158
|
+
genericsInfo;
|
9163
9159
|
toJS() {
|
9164
9160
|
const {
|
9165
9161
|
edge,
|
@@ -9335,7 +9331,7 @@ ${modelAndTypes.map((model) => model.toTS()).join("\n")}
|
|
9335
9331
|
${prismaEnums?.join("\n\n")}
|
9336
9332
|
${fieldRefs.length > 0 ? `
|
9337
9333
|
/**
|
9338
|
-
* Field references
|
9334
|
+
* Field references
|
9339
9335
|
*/
|
9340
9336
|
|
9341
9337
|
${fieldRefs.join("\n\n")}` : ""}
|
@@ -9349,7 +9345,7 @@ ${this.dmmf.inputObjectTypes.prisma?.reduce((acc, inputType) => {
|
|
9349
9345
|
const innerName = needsGeneric ? `${inputType.name}Base<$PrismaModel>` : `${inputType.name}Base`;
|
9350
9346
|
const typeName = needsGeneric ? `${inputType.name}<$PrismaModel = never>` : inputType.name;
|
9351
9347
|
const baseName = `Required<${innerName}>`;
|
9352
|
-
acc.push(`export type ${typeName} =
|
9348
|
+
acc.push(`export type ${typeName} =
|
9353
9349
|
| PatchUndefined<
|
9354
9350
|
Either<${baseName}, Exclude<keyof ${baseName}, 'path'>>,
|
9355
9351
|
${baseName}
|
@@ -9419,7 +9415,7 @@ class PrismaClient {
|
|
9419
9415
|
} else {
|
9420
9416
|
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in \`' + runtime.prettyName + '\`).'
|
9421
9417
|
}
|
9422
|
-
|
9418
|
+
|
9423
9419
|
message += \`
|
9424
9420
|
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report\`
|
9425
9421
|
|
@@ -9439,8 +9435,8 @@ Object.assign(exports, Prisma)
|
|
9439
9435
|
|
9440
9436
|
// src/generation/typedSql/buildDbEnums.ts
|
9441
9437
|
var DbEnumsList = class {
|
9438
|
+
enums;
|
9442
9439
|
constructor(enums) {
|
9443
|
-
__publicField(this, "enums");
|
9444
9440
|
this.enums = enums.map((dmmfEnum) => ({
|
9445
9441
|
name: dmmfEnum.dbName ?? dmmfEnum.name,
|
9446
9442
|
values: dmmfEnum.values.map((dmmfValue) => dmmfValue.dbName ?? dmmfValue.name)
|
@@ -9799,10 +9795,14 @@ async function buildClient({
|
|
9799
9795
|
main: "index.js",
|
9800
9796
|
types: "index.d.ts",
|
9801
9797
|
browser: "index-browser.js",
|
9798
|
+
// The order of exports is important:
|
9799
|
+
// * `./client` before `...clientPkg.exports` allows it to have a higher priority than the `./*` export in `clientPkg.exports`
|
9800
|
+
// * `.` after `...clientPkg.exports` makes it override the `.` export in `clientPkgs.exports`
|
9802
9801
|
exports: {
|
9802
|
+
"./client": exportsMapDefault,
|
9803
9803
|
...import_package.default.exports,
|
9804
9804
|
// TODO: remove on DA ga
|
9805
|
-
|
9805
|
+
".": exportsMapDefault
|
9806
9806
|
},
|
9807
9807
|
version: clientVersion2,
|
9808
9808
|
sideEffects: false
|
@@ -9815,6 +9815,8 @@ async function buildClient({
|
|
9815
9815
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
9816
9816
|
fileMap["edge.js"] = JS(edgeClient);
|
9817
9817
|
fileMap["edge.d.ts"] = TS(edgeClient);
|
9818
|
+
fileMap["client.js"] = JS(defaultClient);
|
9819
|
+
fileMap["client.d.ts"] = TS(defaultClient);
|
9818
9820
|
if (generator.previewFeatures.includes("reactNative")) {
|
9819
9821
|
fileMap["react-native.js"] = JS(rnTsClient);
|
9820
9822
|
fileMap["react-native.d.ts"] = TS(rnTsClient);
|