@prisma/client-generator-ts 6.15.0-dev.2 → 6.15.0-dev.21
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/index.js +44 -81
- package/dist/index.mjs +44 -81
- package/dist/runtime-targets.d.ts +0 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -2803,7 +2803,7 @@ var DMMFHelper = class {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
buildInputTypesMap() {
|
|
2805
2805
|
const result = /* @__PURE__ */ new Map();
|
|
2806
|
-
for (const type of this.inputObjectTypes.prisma) {
|
|
2806
|
+
for (const type of this.inputObjectTypes.prisma ?? []) {
|
|
2807
2807
|
result.set(fullyQualifiedName(type.name, "prisma"), type);
|
|
2808
2808
|
}
|
|
2809
2809
|
if (!this.inputObjectTypes.model) {
|
|
@@ -3446,51 +3446,7 @@ var import_node_path = __toESM(require("node:path"));
|
|
|
3446
3446
|
var import_client_common11 = require("@prisma/client-common");
|
|
3447
3447
|
var import_debug = require("@prisma/debug");
|
|
3448
3448
|
var import_ts_pattern = require("ts-pattern");
|
|
3449
|
-
|
|
3450
|
-
// src/runtime-targets.ts
|
|
3451
|
-
var supportedRuntimes = ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
|
|
3452
|
-
function parseRuntimeTarget(target) {
|
|
3453
|
-
switch (target.toLowerCase()) {
|
|
3454
|
-
case "node":
|
|
3455
|
-
case "nodejs":
|
|
3456
|
-
return "nodejs";
|
|
3457
|
-
case "deno":
|
|
3458
|
-
case "deno-deploy":
|
|
3459
|
-
return "deno";
|
|
3460
|
-
case "bun":
|
|
3461
|
-
return "bun";
|
|
3462
|
-
case "workerd":
|
|
3463
|
-
case "cloudflare":
|
|
3464
|
-
return "workerd";
|
|
3465
|
-
case "edge-light":
|
|
3466
|
-
case "vercel":
|
|
3467
|
-
return "edge-light";
|
|
3468
|
-
case "react-native":
|
|
3469
|
-
return "react-native";
|
|
3470
|
-
default:
|
|
3471
|
-
throw new Error(
|
|
3472
|
-
`Unknown target runtime: "${target}". The available options are: ${supportedRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
|
|
3473
|
-
);
|
|
3474
|
-
}
|
|
3475
|
-
}
|
|
3476
|
-
function parseRuntimeTargetFromUnknown(target) {
|
|
3477
|
-
if (typeof target !== "string") {
|
|
3478
|
-
throw new Error(`Invalid target runtime: ${JSON.stringify(target)}. Expected a string.`);
|
|
3479
|
-
}
|
|
3480
|
-
return parseRuntimeTarget(target);
|
|
3481
|
-
}
|
|
3482
|
-
function isNodeJsLike(target) {
|
|
3483
|
-
return target === "nodejs" || target === "bun" || target === "deno";
|
|
3484
|
-
}
|
|
3485
|
-
|
|
3486
|
-
// src/utils/wasm.ts
|
|
3487
3449
|
var debug = (0, import_debug.Debug)("prisma:client-generator-ts:wasm");
|
|
3488
|
-
function buildDynamicRequireFn() {
|
|
3489
|
-
return `const dynamicRequireFn = async <const T extends string>(name: T) =>
|
|
3490
|
-
typeof globalThis.__non_webpack_require__ === 'function'
|
|
3491
|
-
? Promise.resolve(globalThis.__non_webpack_require__(name))
|
|
3492
|
-
: await import(/* webpackIgnore: true */ /* @vite-ignore */ name)`;
|
|
3493
|
-
}
|
|
3494
3450
|
function usesEdgeWasmRuntime(component, runtimeName) {
|
|
3495
3451
|
return runtimeName === "wasm-engine-edge" && component === "engine" || runtimeName === "wasm-compiler-edge" && component === "compiler";
|
|
3496
3452
|
}
|
|
@@ -3505,7 +3461,6 @@ function buildGetWasmModule({
|
|
|
3505
3461
|
const capitalizedComponent = (0, import_client_common11.capitalize)(component);
|
|
3506
3462
|
const extension = (0, import_ts_pattern.match)(moduleFormat).with("esm", () => "mjs").with("cjs", () => "js").exhaustive();
|
|
3507
3463
|
const buildNonEdgeLoader = (0, import_ts_pattern.match)(runtimeName).with("library", () => component === "engine" && !!process.env.PRISMA_CLIENT_FORCE_WASM).with("client", () => component === "compiler").otherwise(() => false);
|
|
3508
|
-
const buildNodeJsLoader = buildNonEdgeLoader && isNodeJsLike(target);
|
|
3509
3464
|
const buildEdgeLoader = usesEdgeWasmRuntime(component, runtimeName);
|
|
3510
3465
|
let wasmPathBase;
|
|
3511
3466
|
let wasmBindingsPath;
|
|
@@ -3519,14 +3474,13 @@ function buildGetWasmModule({
|
|
|
3519
3474
|
wasmBindingsPath = `${wasmPathBase}.mjs`;
|
|
3520
3475
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3521
3476
|
}
|
|
3522
|
-
if (
|
|
3477
|
+
if (buildNonEdgeLoader) {
|
|
3523
3478
|
wasmBindingsPath = `${wasmPathBase}.${extension}`;
|
|
3524
3479
|
wasmModulePath = `${wasmPathBase}.wasm-base64.${extension}`;
|
|
3525
3480
|
return `
|
|
3526
3481
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
3527
3482
|
const { Buffer } = await import('node:buffer')
|
|
3528
|
-
const
|
|
3529
|
-
const wasmArray = new Uint8Array(Buffer.from(base64Data, 'base64'))
|
|
3483
|
+
const wasmArray = Buffer.from(wasmBase64, 'base64')
|
|
3530
3484
|
return new WebAssembly.Module(wasmArray)
|
|
3531
3485
|
}
|
|
3532
3486
|
|
|
@@ -3537,23 +3491,6 @@ config.${component}Wasm = {
|
|
|
3537
3491
|
const { wasm } = await import(${JSON.stringify(wasmModulePath)})
|
|
3538
3492
|
return await decodeBase64AsWasm(wasm)
|
|
3539
3493
|
}
|
|
3540
|
-
}`;
|
|
3541
|
-
}
|
|
3542
|
-
if (buildNonEdgeLoader) {
|
|
3543
|
-
return `config.${component}Wasm = {
|
|
3544
|
-
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3545
|
-
|
|
3546
|
-
getQuery${capitalizedComponent}WasmModule: async () => {
|
|
3547
|
-
${buildDynamicRequireFn()}
|
|
3548
|
-
|
|
3549
|
-
// Note: we must use dynamic imports here to avoid bundling errors like \`Module parse failed: Unexpected character '' (1:0)\`.
|
|
3550
|
-
const { readFile } = await dynamicRequireFn('node:fs/promises')
|
|
3551
|
-
${buildRequire(moduleFormat)}
|
|
3552
|
-
const wasmModulePath = _require.resolve(${JSON.stringify(wasmModulePath)})
|
|
3553
|
-
const wasmModuleBytes = await readFile(wasmModulePath)
|
|
3554
|
-
|
|
3555
|
-
return new globalThis.WebAssembly.Module(wasmModuleBytes)
|
|
3556
|
-
}
|
|
3557
3494
|
}`;
|
|
3558
3495
|
}
|
|
3559
3496
|
if (buildEdgeLoader) {
|
|
@@ -3569,17 +3506,9 @@ config.${component}Wasm = {
|
|
|
3569
3506
|
}
|
|
3570
3507
|
return `config.${component}Wasm = undefined`;
|
|
3571
3508
|
}
|
|
3572
|
-
function buildRequire(moduleFormat) {
|
|
3573
|
-
if (moduleFormat === "cjs") {
|
|
3574
|
-
return "const _require = require\n";
|
|
3575
|
-
}
|
|
3576
|
-
return `const { createRequire } = await dynamicRequireFn('node:module')
|
|
3577
|
-
const _require = createRequire(import.meta.url)
|
|
3578
|
-
`;
|
|
3579
|
-
}
|
|
3580
3509
|
function readSourceFile(sourceFile) {
|
|
3581
3510
|
const bundledLocation = import_node_path.default.join(__dirname, sourceFile);
|
|
3582
|
-
const sourceLocation = import_node_path.default.join(__dirname, "..", "..", "..", "
|
|
3511
|
+
const sourceLocation = import_node_path.default.join(__dirname, "..", "..", "..", "cli", "build", sourceFile);
|
|
3583
3512
|
if (import_node_fs.default.existsSync(bundledLocation)) {
|
|
3584
3513
|
debug("We are in the bundled Prisma CLI");
|
|
3585
3514
|
return import_node_fs.default.readFileSync(bundledLocation);
|
|
@@ -3847,8 +3776,8 @@ var PrismaClientClass = class {
|
|
|
3847
3776
|
export interface PrismaClientConstructor {
|
|
3848
3777
|
${(0, import_indent_string3.default)(this.jsDoc, TAB_SIZE)}
|
|
3849
3778
|
new <
|
|
3850
|
-
Options extends Prisma.PrismaClientOptions,
|
|
3851
|
-
LogOpts extends LogOptions<Options>,
|
|
3779
|
+
Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
|
|
3780
|
+
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
3852
3781
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
3853
3782
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
3854
3783
|
>(options?: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
@@ -4111,7 +4040,7 @@ ${modelEnumsAliases.length > 0 ? `${modelEnumsAliases.join("\n\n")}` : ""}
|
|
|
4111
4040
|
}
|
|
4112
4041
|
function buildPreamble(edge, moduleFormat) {
|
|
4113
4042
|
if (edge) {
|
|
4114
|
-
return `
|
|
4043
|
+
return `globalThis['__dirname'] = '/'
|
|
4115
4044
|
`;
|
|
4116
4045
|
}
|
|
4117
4046
|
let preamble = `import * as process from 'node:process'
|
|
@@ -4119,7 +4048,7 @@ import * as path from 'node:path'
|
|
|
4119
4048
|
`;
|
|
4120
4049
|
if (moduleFormat === "esm") {
|
|
4121
4050
|
preamble += `import { fileURLToPath } from 'node:url'
|
|
4122
|
-
|
|
4051
|
+
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
|
|
4123
4052
|
`;
|
|
4124
4053
|
}
|
|
4125
4054
|
return preamble;
|
|
@@ -4139,7 +4068,7 @@ function createCommonInputTypeFiles(context) {
|
|
|
4139
4068
|
ts7.moduleImport(context.importFileName(`./enums`)).asNamespace("$Enums"),
|
|
4140
4069
|
ts7.moduleImport(context.importFileName(`./internal/prismaNamespace`)).asNamespace("Prisma").typeOnly()
|
|
4141
4070
|
].map((i) => ts7.stringify(i));
|
|
4142
|
-
const genericInputTypes = context.dmmf.inputObjectTypes.prisma
|
|
4071
|
+
const genericInputTypes = context.dmmf.inputObjectTypes.prisma?.filter((i) => !i.meta?.grouping)?.map((inputType) => new InputType(inputType, context).toTS()) ?? [];
|
|
4143
4072
|
return `${jsDocHeader3}
|
|
4144
4073
|
${imports.join("\n")}
|
|
4145
4074
|
|
|
@@ -6606,6 +6535,7 @@ async function deleteOutputDir(outputDir) {
|
|
|
6606
6535
|
(await (0, import_fast_glob.glob)(
|
|
6607
6536
|
[
|
|
6608
6537
|
`${outputDir}/**/*.{js,ts,mts,cts,d.ts}`,
|
|
6538
|
+
`${outputDir}/**/*.wasm`,
|
|
6609
6539
|
`${outputDir}/*.node`,
|
|
6610
6540
|
`${outputDir}/{query,schema}-engine-*`,
|
|
6611
6541
|
`${outputDir}/package.json`,
|
|
@@ -6631,7 +6561,7 @@ var import_get_tsconfig = require("get-tsconfig");
|
|
|
6631
6561
|
var import_ts_pattern2 = require("ts-pattern");
|
|
6632
6562
|
|
|
6633
6563
|
// package.json
|
|
6634
|
-
var version = "6.15.0-dev.
|
|
6564
|
+
var version = "6.15.0-dev.21";
|
|
6635
6565
|
|
|
6636
6566
|
// src/module-format.ts
|
|
6637
6567
|
function parseModuleFormat(format) {
|
|
@@ -6673,6 +6603,39 @@ function fromTsConfigModule(module2) {
|
|
|
6673
6603
|
return "esm";
|
|
6674
6604
|
}
|
|
6675
6605
|
|
|
6606
|
+
// src/runtime-targets.ts
|
|
6607
|
+
var supportedRuntimes = ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
|
|
6608
|
+
function parseRuntimeTarget(target) {
|
|
6609
|
+
switch (target.toLowerCase()) {
|
|
6610
|
+
case "node":
|
|
6611
|
+
case "nodejs":
|
|
6612
|
+
return "nodejs";
|
|
6613
|
+
case "deno":
|
|
6614
|
+
case "deno-deploy":
|
|
6615
|
+
return "deno";
|
|
6616
|
+
case "bun":
|
|
6617
|
+
return "bun";
|
|
6618
|
+
case "workerd":
|
|
6619
|
+
case "cloudflare":
|
|
6620
|
+
return "workerd";
|
|
6621
|
+
case "edge-light":
|
|
6622
|
+
case "vercel":
|
|
6623
|
+
return "edge-light";
|
|
6624
|
+
case "react-native":
|
|
6625
|
+
return "react-native";
|
|
6626
|
+
default:
|
|
6627
|
+
throw new Error(
|
|
6628
|
+
`Unknown target runtime: "${target}". The available options are: ${supportedRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
|
|
6629
|
+
);
|
|
6630
|
+
}
|
|
6631
|
+
}
|
|
6632
|
+
function parseRuntimeTargetFromUnknown(target) {
|
|
6633
|
+
if (typeof target !== "string") {
|
|
6634
|
+
throw new Error(`Invalid target runtime: ${JSON.stringify(target)}. Expected a string.`);
|
|
6635
|
+
}
|
|
6636
|
+
return parseRuntimeTarget(target);
|
|
6637
|
+
}
|
|
6638
|
+
|
|
6676
6639
|
// src/generator.ts
|
|
6677
6640
|
var debug2 = (0, import_debug2.Debug)("prisma:client:generator");
|
|
6678
6641
|
var missingOutputErrorMessage = `An output path is required for the \`prisma-client\` generator. Please provide an output path in your schema file:
|
package/dist/index.mjs
CHANGED
|
@@ -2799,7 +2799,7 @@ var DMMFHelper = class {
|
|
|
2799
2799
|
}
|
|
2800
2800
|
buildInputTypesMap() {
|
|
2801
2801
|
const result = /* @__PURE__ */ new Map();
|
|
2802
|
-
for (const type of this.inputObjectTypes.prisma) {
|
|
2802
|
+
for (const type of this.inputObjectTypes.prisma ?? []) {
|
|
2803
2803
|
result.set(fullyQualifiedName(type.name, "prisma"), type);
|
|
2804
2804
|
}
|
|
2805
2805
|
if (!this.inputObjectTypes.model) {
|
|
@@ -3445,51 +3445,7 @@ import path from "node:path";
|
|
|
3445
3445
|
import { capitalize as capitalize6 } from "@prisma/client-common";
|
|
3446
3446
|
import { Debug } from "@prisma/debug";
|
|
3447
3447
|
import { match } from "ts-pattern";
|
|
3448
|
-
|
|
3449
|
-
// src/runtime-targets.ts
|
|
3450
|
-
var supportedRuntimes = ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
|
|
3451
|
-
function parseRuntimeTarget(target) {
|
|
3452
|
-
switch (target.toLowerCase()) {
|
|
3453
|
-
case "node":
|
|
3454
|
-
case "nodejs":
|
|
3455
|
-
return "nodejs";
|
|
3456
|
-
case "deno":
|
|
3457
|
-
case "deno-deploy":
|
|
3458
|
-
return "deno";
|
|
3459
|
-
case "bun":
|
|
3460
|
-
return "bun";
|
|
3461
|
-
case "workerd":
|
|
3462
|
-
case "cloudflare":
|
|
3463
|
-
return "workerd";
|
|
3464
|
-
case "edge-light":
|
|
3465
|
-
case "vercel":
|
|
3466
|
-
return "edge-light";
|
|
3467
|
-
case "react-native":
|
|
3468
|
-
return "react-native";
|
|
3469
|
-
default:
|
|
3470
|
-
throw new Error(
|
|
3471
|
-
`Unknown target runtime: "${target}". The available options are: ${supportedRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
|
|
3472
|
-
);
|
|
3473
|
-
}
|
|
3474
|
-
}
|
|
3475
|
-
function parseRuntimeTargetFromUnknown(target) {
|
|
3476
|
-
if (typeof target !== "string") {
|
|
3477
|
-
throw new Error(`Invalid target runtime: ${JSON.stringify(target)}. Expected a string.`);
|
|
3478
|
-
}
|
|
3479
|
-
return parseRuntimeTarget(target);
|
|
3480
|
-
}
|
|
3481
|
-
function isNodeJsLike(target) {
|
|
3482
|
-
return target === "nodejs" || target === "bun" || target === "deno";
|
|
3483
|
-
}
|
|
3484
|
-
|
|
3485
|
-
// src/utils/wasm.ts
|
|
3486
3448
|
var debug = Debug("prisma:client-generator-ts:wasm");
|
|
3487
|
-
function buildDynamicRequireFn() {
|
|
3488
|
-
return `const dynamicRequireFn = async <const T extends string>(name: T) =>
|
|
3489
|
-
typeof globalThis.__non_webpack_require__ === 'function'
|
|
3490
|
-
? Promise.resolve(globalThis.__non_webpack_require__(name))
|
|
3491
|
-
: await import(/* webpackIgnore: true */ /* @vite-ignore */ name)`;
|
|
3492
|
-
}
|
|
3493
3449
|
function usesEdgeWasmRuntime(component, runtimeName) {
|
|
3494
3450
|
return runtimeName === "wasm-engine-edge" && component === "engine" || runtimeName === "wasm-compiler-edge" && component === "compiler";
|
|
3495
3451
|
}
|
|
@@ -3504,7 +3460,6 @@ function buildGetWasmModule({
|
|
|
3504
3460
|
const capitalizedComponent = capitalize6(component);
|
|
3505
3461
|
const extension = match(moduleFormat).with("esm", () => "mjs").with("cjs", () => "js").exhaustive();
|
|
3506
3462
|
const buildNonEdgeLoader = match(runtimeName).with("library", () => component === "engine" && !!process.env.PRISMA_CLIENT_FORCE_WASM).with("client", () => component === "compiler").otherwise(() => false);
|
|
3507
|
-
const buildNodeJsLoader = buildNonEdgeLoader && isNodeJsLike(target);
|
|
3508
3463
|
const buildEdgeLoader = usesEdgeWasmRuntime(component, runtimeName);
|
|
3509
3464
|
let wasmPathBase;
|
|
3510
3465
|
let wasmBindingsPath;
|
|
@@ -3518,14 +3473,13 @@ function buildGetWasmModule({
|
|
|
3518
3473
|
wasmBindingsPath = `${wasmPathBase}.mjs`;
|
|
3519
3474
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3520
3475
|
}
|
|
3521
|
-
if (
|
|
3476
|
+
if (buildNonEdgeLoader) {
|
|
3522
3477
|
wasmBindingsPath = `${wasmPathBase}.${extension}`;
|
|
3523
3478
|
wasmModulePath = `${wasmPathBase}.wasm-base64.${extension}`;
|
|
3524
3479
|
return `
|
|
3525
3480
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
3526
3481
|
const { Buffer } = await import('node:buffer')
|
|
3527
|
-
const
|
|
3528
|
-
const wasmArray = new Uint8Array(Buffer.from(base64Data, 'base64'))
|
|
3482
|
+
const wasmArray = Buffer.from(wasmBase64, 'base64')
|
|
3529
3483
|
return new WebAssembly.Module(wasmArray)
|
|
3530
3484
|
}
|
|
3531
3485
|
|
|
@@ -3536,23 +3490,6 @@ config.${component}Wasm = {
|
|
|
3536
3490
|
const { wasm } = await import(${JSON.stringify(wasmModulePath)})
|
|
3537
3491
|
return await decodeBase64AsWasm(wasm)
|
|
3538
3492
|
}
|
|
3539
|
-
}`;
|
|
3540
|
-
}
|
|
3541
|
-
if (buildNonEdgeLoader) {
|
|
3542
|
-
return `config.${component}Wasm = {
|
|
3543
|
-
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3544
|
-
|
|
3545
|
-
getQuery${capitalizedComponent}WasmModule: async () => {
|
|
3546
|
-
${buildDynamicRequireFn()}
|
|
3547
|
-
|
|
3548
|
-
// Note: we must use dynamic imports here to avoid bundling errors like \`Module parse failed: Unexpected character '' (1:0)\`.
|
|
3549
|
-
const { readFile } = await dynamicRequireFn('node:fs/promises')
|
|
3550
|
-
${buildRequire(moduleFormat)}
|
|
3551
|
-
const wasmModulePath = _require.resolve(${JSON.stringify(wasmModulePath)})
|
|
3552
|
-
const wasmModuleBytes = await readFile(wasmModulePath)
|
|
3553
|
-
|
|
3554
|
-
return new globalThis.WebAssembly.Module(wasmModuleBytes)
|
|
3555
|
-
}
|
|
3556
3493
|
}`;
|
|
3557
3494
|
}
|
|
3558
3495
|
if (buildEdgeLoader) {
|
|
@@ -3568,17 +3505,9 @@ config.${component}Wasm = {
|
|
|
3568
3505
|
}
|
|
3569
3506
|
return `config.${component}Wasm = undefined`;
|
|
3570
3507
|
}
|
|
3571
|
-
function buildRequire(moduleFormat) {
|
|
3572
|
-
if (moduleFormat === "cjs") {
|
|
3573
|
-
return "const _require = require\n";
|
|
3574
|
-
}
|
|
3575
|
-
return `const { createRequire } = await dynamicRequireFn('node:module')
|
|
3576
|
-
const _require = createRequire(import.meta.url)
|
|
3577
|
-
`;
|
|
3578
|
-
}
|
|
3579
3508
|
function readSourceFile(sourceFile) {
|
|
3580
3509
|
const bundledLocation = path.join(__dirname, sourceFile);
|
|
3581
|
-
const sourceLocation = path.join(__dirname, "..", "..", "..", "
|
|
3510
|
+
const sourceLocation = path.join(__dirname, "..", "..", "..", "cli", "build", sourceFile);
|
|
3582
3511
|
if (fs.existsSync(bundledLocation)) {
|
|
3583
3512
|
debug("We are in the bundled Prisma CLI");
|
|
3584
3513
|
return fs.readFileSync(bundledLocation);
|
|
@@ -3846,8 +3775,8 @@ var PrismaClientClass = class {
|
|
|
3846
3775
|
export interface PrismaClientConstructor {
|
|
3847
3776
|
${indent3(this.jsDoc, TAB_SIZE)}
|
|
3848
3777
|
new <
|
|
3849
|
-
Options extends Prisma.PrismaClientOptions,
|
|
3850
|
-
LogOpts extends LogOptions<Options>,
|
|
3778
|
+
Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
|
|
3779
|
+
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
3851
3780
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
3852
3781
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
3853
3782
|
>(options?: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
@@ -4110,7 +4039,7 @@ ${modelEnumsAliases.length > 0 ? `${modelEnumsAliases.join("\n\n")}` : ""}
|
|
|
4110
4039
|
}
|
|
4111
4040
|
function buildPreamble(edge, moduleFormat) {
|
|
4112
4041
|
if (edge) {
|
|
4113
|
-
return `
|
|
4042
|
+
return `globalThis['__dirname'] = '/'
|
|
4114
4043
|
`;
|
|
4115
4044
|
}
|
|
4116
4045
|
let preamble = `import * as process from 'node:process'
|
|
@@ -4118,7 +4047,7 @@ import * as path from 'node:path'
|
|
|
4118
4047
|
`;
|
|
4119
4048
|
if (moduleFormat === "esm") {
|
|
4120
4049
|
preamble += `import { fileURLToPath } from 'node:url'
|
|
4121
|
-
|
|
4050
|
+
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
|
|
4122
4051
|
`;
|
|
4123
4052
|
}
|
|
4124
4053
|
return preamble;
|
|
@@ -4138,7 +4067,7 @@ function createCommonInputTypeFiles(context) {
|
|
|
4138
4067
|
ts7.moduleImport(context.importFileName(`./enums`)).asNamespace("$Enums"),
|
|
4139
4068
|
ts7.moduleImport(context.importFileName(`./internal/prismaNamespace`)).asNamespace("Prisma").typeOnly()
|
|
4140
4069
|
].map((i) => ts7.stringify(i));
|
|
4141
|
-
const genericInputTypes = context.dmmf.inputObjectTypes.prisma
|
|
4070
|
+
const genericInputTypes = context.dmmf.inputObjectTypes.prisma?.filter((i) => !i.meta?.grouping)?.map((inputType) => new InputType(inputType, context).toTS()) ?? [];
|
|
4142
4071
|
return `${jsDocHeader3}
|
|
4143
4072
|
${imports.join("\n")}
|
|
4144
4073
|
|
|
@@ -6605,6 +6534,7 @@ async function deleteOutputDir(outputDir) {
|
|
|
6605
6534
|
(await glob(
|
|
6606
6535
|
[
|
|
6607
6536
|
`${outputDir}/**/*.{js,ts,mts,cts,d.ts}`,
|
|
6537
|
+
`${outputDir}/**/*.wasm`,
|
|
6608
6538
|
`${outputDir}/*.node`,
|
|
6609
6539
|
`${outputDir}/{query,schema}-engine-*`,
|
|
6610
6540
|
`${outputDir}/package.json`,
|
|
@@ -6630,7 +6560,7 @@ import { getTsconfig } from "get-tsconfig";
|
|
|
6630
6560
|
import { match as match2 } from "ts-pattern";
|
|
6631
6561
|
|
|
6632
6562
|
// package.json
|
|
6633
|
-
var version = "6.15.0-dev.
|
|
6563
|
+
var version = "6.15.0-dev.21";
|
|
6634
6564
|
|
|
6635
6565
|
// src/module-format.ts
|
|
6636
6566
|
function parseModuleFormat(format) {
|
|
@@ -6672,6 +6602,39 @@ function fromTsConfigModule(module) {
|
|
|
6672
6602
|
return "esm";
|
|
6673
6603
|
}
|
|
6674
6604
|
|
|
6605
|
+
// src/runtime-targets.ts
|
|
6606
|
+
var supportedRuntimes = ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
|
|
6607
|
+
function parseRuntimeTarget(target) {
|
|
6608
|
+
switch (target.toLowerCase()) {
|
|
6609
|
+
case "node":
|
|
6610
|
+
case "nodejs":
|
|
6611
|
+
return "nodejs";
|
|
6612
|
+
case "deno":
|
|
6613
|
+
case "deno-deploy":
|
|
6614
|
+
return "deno";
|
|
6615
|
+
case "bun":
|
|
6616
|
+
return "bun";
|
|
6617
|
+
case "workerd":
|
|
6618
|
+
case "cloudflare":
|
|
6619
|
+
return "workerd";
|
|
6620
|
+
case "edge-light":
|
|
6621
|
+
case "vercel":
|
|
6622
|
+
return "edge-light";
|
|
6623
|
+
case "react-native":
|
|
6624
|
+
return "react-native";
|
|
6625
|
+
default:
|
|
6626
|
+
throw new Error(
|
|
6627
|
+
`Unknown target runtime: "${target}". The available options are: ${supportedRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
|
|
6628
|
+
);
|
|
6629
|
+
}
|
|
6630
|
+
}
|
|
6631
|
+
function parseRuntimeTargetFromUnknown(target) {
|
|
6632
|
+
if (typeof target !== "string") {
|
|
6633
|
+
throw new Error(`Invalid target runtime: ${JSON.stringify(target)}. Expected a string.`);
|
|
6634
|
+
}
|
|
6635
|
+
return parseRuntimeTarget(target);
|
|
6636
|
+
}
|
|
6637
|
+
|
|
6675
6638
|
// src/generator.ts
|
|
6676
6639
|
var debug2 = Debug2("prisma:client:generator");
|
|
6677
6640
|
var missingOutputErrorMessage = `An output path is required for the \`prisma-client\` generator. Please provide an output path in your schema file:
|
|
@@ -2,5 +2,4 @@ declare const supportedRuntimes: readonly ["nodejs", "deno", "bun", "workerd", "
|
|
|
2
2
|
export type RuntimeTarget = (typeof supportedRuntimes)[number];
|
|
3
3
|
export declare function parseRuntimeTarget(target: string): RuntimeTarget;
|
|
4
4
|
export declare function parseRuntimeTargetFromUnknown(target: unknown): RuntimeTarget;
|
|
5
|
-
export declare function isNodeJsLike(target: RuntimeTarget): boolean;
|
|
6
5
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-generator-ts",
|
|
3
|
-
"version": "6.15.0-dev.
|
|
3
|
+
"version": "6.15.0-dev.21",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@antfu/ni": "0.21.12",
|
|
28
|
-
"@prisma/engines-version": "6.
|
|
28
|
+
"@prisma/engines-version": "6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb",
|
|
29
29
|
"ci-info": "4.2.0",
|
|
30
30
|
"fast-glob": "3.3.3",
|
|
31
31
|
"get-tsconfig": "4.10.0",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"pkg-up": "3.1.0",
|
|
35
35
|
"pluralize": "8.0.0",
|
|
36
36
|
"ts-pattern": "5.6.2",
|
|
37
|
-
"@prisma/client-common": "6.15.0-dev.
|
|
38
|
-
"@prisma/debug": "6.15.0-dev.
|
|
39
|
-
"@prisma/
|
|
40
|
-
"@prisma/generator": "6.15.0-dev.
|
|
41
|
-
"@prisma/
|
|
42
|
-
"@prisma/
|
|
43
|
-
"@prisma/internals": "6.15.0-dev.
|
|
44
|
-
"@prisma/ts-builders": "6.15.0-dev.
|
|
37
|
+
"@prisma/client-common": "6.15.0-dev.21",
|
|
38
|
+
"@prisma/debug": "6.15.0-dev.21",
|
|
39
|
+
"@prisma/dmmf": "6.15.0-dev.21",
|
|
40
|
+
"@prisma/generator": "6.15.0-dev.21",
|
|
41
|
+
"@prisma/get-platform": "6.15.0-dev.21",
|
|
42
|
+
"@prisma/fetch-engine": "6.15.0-dev.21",
|
|
43
|
+
"@prisma/internals": "6.15.0-dev.21",
|
|
44
|
+
"@prisma/ts-builders": "6.15.0-dev.21"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/pluralize": "0.0.33",
|