@prisma/client-generator-ts 6.15.0-integration-fix-prisma-client-dirname-aws-lambda.3 → 6.15.0-integration-query-plan-caching.1
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/generateClient.d.ts +2 -2
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +34 -33
- package/dist/index.mjs +34 -33
- package/dist/runtime-targets.d.ts +11 -4
- package/dist/utils/wasm.d.ts +5 -5
- package/package.json +10 -10
package/dist/generateClient.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { EnvPaths } from '@prisma/internals';
|
|
|
6
6
|
import type { O } from 'ts-toolbelt';
|
|
7
7
|
import { GeneratedFileExtension, ImportFileExtension } from './file-extensions';
|
|
8
8
|
import { ModuleFormat } from './module-format';
|
|
9
|
-
import {
|
|
9
|
+
import type { RuntimeTargetInternal } from './runtime-targets';
|
|
10
10
|
export declare class DenylistError extends Error {
|
|
11
11
|
constructor(message: string);
|
|
12
12
|
}
|
|
@@ -29,7 +29,7 @@ export interface GenerateClientOptions {
|
|
|
29
29
|
/** False when --no-engine is passed via CLI */
|
|
30
30
|
copyEngine?: boolean;
|
|
31
31
|
typedSql?: SqlQueryOutput[];
|
|
32
|
-
target:
|
|
32
|
+
target: RuntimeTargetInternal;
|
|
33
33
|
generatedFileExtension: GeneratedFileExtension;
|
|
34
34
|
importFileExtension: ImportFileExtension;
|
|
35
35
|
moduleFormat: ModuleFormat;
|
package/dist/index.d.mts
CHANGED
|
@@ -43,7 +43,7 @@ export declare interface GenerateClientOptions {
|
|
|
43
43
|
/** False when --no-engine is passed via CLI */
|
|
44
44
|
copyEngine?: boolean;
|
|
45
45
|
typedSql?: SqlQueryOutput[];
|
|
46
|
-
target:
|
|
46
|
+
target: RuntimeTargetInternal;
|
|
47
47
|
generatedFileExtension: GeneratedFileExtension;
|
|
48
48
|
importFileExtension: ImportFileExtension;
|
|
49
49
|
moduleFormat: ModuleFormat;
|
|
@@ -67,8 +67,11 @@ export declare class PrismaClientTsGenerator implements Generator_2 {
|
|
|
67
67
|
generate(options: GeneratorOptions): Promise<void>;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
|
+
* The internal representation of the `runtime` attribute for the `prisma-client` generator.
|
|
72
|
+
*/
|
|
73
|
+
declare type RuntimeTargetInternal = (typeof supportedInternalRuntimes)[number];
|
|
71
74
|
|
|
72
|
-
declare const
|
|
75
|
+
declare const supportedInternalRuntimes: readonly ["nodejs", "workerd", "vercel-edge", "react-native"];
|
|
73
76
|
|
|
74
77
|
export { }
|
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare interface GenerateClientOptions {
|
|
|
43
43
|
/** False when --no-engine is passed via CLI */
|
|
44
44
|
copyEngine?: boolean;
|
|
45
45
|
typedSql?: SqlQueryOutput[];
|
|
46
|
-
target:
|
|
46
|
+
target: RuntimeTargetInternal;
|
|
47
47
|
generatedFileExtension: GeneratedFileExtension;
|
|
48
48
|
importFileExtension: ImportFileExtension;
|
|
49
49
|
moduleFormat: ModuleFormat;
|
|
@@ -67,8 +67,11 @@ export declare class PrismaClientTsGenerator implements Generator_2 {
|
|
|
67
67
|
generate(options: GeneratorOptions): Promise<void>;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
|
+
* The internal representation of the `runtime` attribute for the `prisma-client` generator.
|
|
72
|
+
*/
|
|
73
|
+
declare type RuntimeTargetInternal = (typeof supportedInternalRuntimes)[number];
|
|
71
74
|
|
|
72
|
-
declare const
|
|
75
|
+
declare const supportedInternalRuntimes: readonly ["nodejs", "workerd", "vercel-edge", "react-native"];
|
|
73
76
|
|
|
74
77
|
export { }
|
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) {
|
|
@@ -3454,7 +3454,6 @@ function buildGetWasmModule({
|
|
|
3454
3454
|
component,
|
|
3455
3455
|
runtimeName,
|
|
3456
3456
|
runtimeBase,
|
|
3457
|
-
target,
|
|
3458
3457
|
activeProvider,
|
|
3459
3458
|
moduleFormat
|
|
3460
3459
|
}) {
|
|
@@ -3480,8 +3479,7 @@ function buildGetWasmModule({
|
|
|
3480
3479
|
return `
|
|
3481
3480
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
3482
3481
|
const { Buffer } = await import('node:buffer')
|
|
3483
|
-
const
|
|
3484
|
-
const wasmArray = new Uint8Array(Buffer.from(base64Data, 'base64'))
|
|
3482
|
+
const wasmArray = Buffer.from(wasmBase64, 'base64')
|
|
3485
3483
|
return new WebAssembly.Module(wasmArray)
|
|
3486
3484
|
}
|
|
3487
3485
|
|
|
@@ -3495,12 +3493,11 @@ config.${component}Wasm = {
|
|
|
3495
3493
|
}`;
|
|
3496
3494
|
}
|
|
3497
3495
|
if (buildEdgeLoader) {
|
|
3498
|
-
const fullWasmModulePath = target === "edge-light" ? `${wasmModulePath}?module` : wasmModulePath;
|
|
3499
3496
|
return `config.${component}Wasm = {
|
|
3500
3497
|
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3501
3498
|
|
|
3502
3499
|
getQuery${capitalizedComponent}WasmModule: async () => {
|
|
3503
|
-
const { default: module } = await import(${JSON.stringify(
|
|
3500
|
+
const { default: module } = await import(${JSON.stringify(`${wasmModulePath}?module`)})
|
|
3504
3501
|
return module
|
|
3505
3502
|
}
|
|
3506
3503
|
}`;
|
|
@@ -3509,7 +3506,7 @@ config.${component}Wasm = {
|
|
|
3509
3506
|
}
|
|
3510
3507
|
function readSourceFile(sourceFile) {
|
|
3511
3508
|
const bundledLocation = import_node_path.default.join(__dirname, sourceFile);
|
|
3512
|
-
const sourceLocation = import_node_path.default.join(__dirname, "..", "..", "..", "
|
|
3509
|
+
const sourceLocation = import_node_path.default.join(__dirname, "..", "..", "..", "cli", "build", sourceFile);
|
|
3513
3510
|
if (import_node_fs.default.existsSync(bundledLocation)) {
|
|
3514
3511
|
debug("We are in the bundled Prisma CLI");
|
|
3515
3512
|
return import_node_fs.default.readFileSync(bundledLocation);
|
|
@@ -3777,8 +3774,8 @@ var PrismaClientClass = class {
|
|
|
3777
3774
|
export interface PrismaClientConstructor {
|
|
3778
3775
|
${(0, import_indent_string3.default)(this.jsDoc, TAB_SIZE)}
|
|
3779
3776
|
new <
|
|
3780
|
-
Options extends Prisma.PrismaClientOptions,
|
|
3781
|
-
LogOpts extends LogOptions<Options>,
|
|
3777
|
+
Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
|
|
3778
|
+
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
3782
3779
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
3783
3780
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
3784
3781
|
>(options?: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
@@ -3849,7 +3846,7 @@ get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`;
|
|
|
3849
3846
|
};
|
|
3850
3847
|
|
|
3851
3848
|
// src/TSClient/file-generators/ClassFile.ts
|
|
3852
|
-
var jsDocHeader =
|
|
3849
|
+
var jsDocHeader = `/*
|
|
3853
3850
|
* WARNING: This is an internal file that is subject to change!
|
|
3854
3851
|
*
|
|
3855
3852
|
* \u{1F6D1} Under no circumstances should you import this file directly! \u{1F6D1}
|
|
@@ -3970,7 +3967,7 @@ path.join(process.cwd(), ${JSON.stringify((0, import_internals4.pathToPosix)(rel
|
|
|
3970
3967
|
}
|
|
3971
3968
|
|
|
3972
3969
|
// src/TSClient/file-generators/ClientFile.ts
|
|
3973
|
-
var jsDocHeader2 =
|
|
3970
|
+
var jsDocHeader2 = `/*
|
|
3974
3971
|
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
|
|
3975
3972
|
*
|
|
3976
3973
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -4057,7 +4054,7 @@ globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
|
|
|
4057
4054
|
|
|
4058
4055
|
// src/TSClient/file-generators/CommonInputTypesFile.ts
|
|
4059
4056
|
var ts7 = __toESM(require("@prisma/ts-builders"));
|
|
4060
|
-
var jsDocHeader3 =
|
|
4057
|
+
var jsDocHeader3 = `/*
|
|
4061
4058
|
* This file exports various common sort, input & filter types that are not directly linked to a particular model.
|
|
4062
4059
|
*
|
|
4063
4060
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -4069,7 +4066,7 @@ function createCommonInputTypeFiles(context) {
|
|
|
4069
4066
|
ts7.moduleImport(context.importFileName(`./enums`)).asNamespace("$Enums"),
|
|
4070
4067
|
ts7.moduleImport(context.importFileName(`./internal/prismaNamespace`)).asNamespace("Prisma").typeOnly()
|
|
4071
4068
|
].map((i) => ts7.stringify(i));
|
|
4072
|
-
const genericInputTypes = context.dmmf.inputObjectTypes.prisma
|
|
4069
|
+
const genericInputTypes = context.dmmf.inputObjectTypes.prisma?.filter((i) => !i.meta?.grouping)?.map((inputType) => new InputType(inputType, context).toTS()) ?? [];
|
|
4073
4070
|
return `${jsDocHeader3}
|
|
4074
4071
|
${imports.join("\n")}
|
|
4075
4072
|
|
|
@@ -4081,11 +4078,12 @@ ${context.dmmf.inputObjectTypes.model?.map((inputType) => new InputType(inputTyp
|
|
|
4081
4078
|
|
|
4082
4079
|
// src/TSClient/file-generators/EnumsFile.ts
|
|
4083
4080
|
var import_dmmf = require("@prisma/dmmf");
|
|
4084
|
-
var jsDocHeader4 =
|
|
4081
|
+
var jsDocHeader4 = `/*
|
|
4085
4082
|
* This file exports all enum related types from the schema.
|
|
4086
4083
|
*
|
|
4087
4084
|
* \u{1F7E2} You can import this file directly.
|
|
4088
4085
|
*/
|
|
4086
|
+
|
|
4089
4087
|
`;
|
|
4090
4088
|
function createEnumsFile(context) {
|
|
4091
4089
|
const modelEnums = [];
|
|
@@ -5105,7 +5103,7 @@ function fluentWrapperName(modelName) {
|
|
|
5105
5103
|
|
|
5106
5104
|
// src/TSClient/file-generators/ModelFile.ts
|
|
5107
5105
|
function createModelFile(context, modelName) {
|
|
5108
|
-
const jsDocHeader7 =
|
|
5106
|
+
const jsDocHeader7 = `/*
|
|
5109
5107
|
* This file exports the \`${modelName}\` model and its related types.
|
|
5110
5108
|
*
|
|
5111
5109
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -5122,7 +5120,7 @@ function createModelFile(context, modelName) {
|
|
|
5122
5120
|
}
|
|
5123
5121
|
|
|
5124
5122
|
// src/TSClient/file-generators/ModelsFile.ts
|
|
5125
|
-
var jsDocHeader5 =
|
|
5123
|
+
var jsDocHeader5 = `/*
|
|
5126
5124
|
* This is a barrel export file for all models and their related types.
|
|
5127
5125
|
*
|
|
5128
5126
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -5685,7 +5683,7 @@ function payloadToResult(modelName) {
|
|
|
5685
5683
|
}
|
|
5686
5684
|
|
|
5687
5685
|
// src/TSClient/file-generators/PrismaNamespaceFile.ts
|
|
5688
|
-
var jsDocHeader6 =
|
|
5686
|
+
var jsDocHeader6 = `/*
|
|
5689
5687
|
* WARNING: This is an internal file that is subject to change!
|
|
5690
5688
|
*
|
|
5691
5689
|
* \u{1F6D1} Under no circumstances should you import this file directly! \u{1F6D1}
|
|
@@ -6493,11 +6491,9 @@ async function getGenerationDirs({ runtimeBase, outputDir }) {
|
|
|
6493
6491
|
function getRuntimeNameForTarget(target, engineType, previewFeatures) {
|
|
6494
6492
|
switch (target) {
|
|
6495
6493
|
case "nodejs":
|
|
6496
|
-
case "deno":
|
|
6497
|
-
case "bun":
|
|
6498
6494
|
return getNodeRuntimeName(engineType);
|
|
6499
6495
|
case "workerd":
|
|
6500
|
-
case "edge
|
|
6496
|
+
case "vercel-edge":
|
|
6501
6497
|
if (previewFeatures.includes("driverAdapters")) {
|
|
6502
6498
|
return engineType === import_internals9.ClientEngineType.Client ? "wasm-compiler-edge" : "wasm-engine-edge";
|
|
6503
6499
|
} else {
|
|
@@ -6562,7 +6558,7 @@ var import_get_tsconfig = require("get-tsconfig");
|
|
|
6562
6558
|
var import_ts_pattern2 = require("ts-pattern");
|
|
6563
6559
|
|
|
6564
6560
|
// package.json
|
|
6565
|
-
var version = "6.15.0-integration-
|
|
6561
|
+
var version = "6.15.0-integration-query-plan-caching.1";
|
|
6566
6562
|
|
|
6567
6563
|
// src/module-format.ts
|
|
6568
6564
|
function parseModuleFormat(format) {
|
|
@@ -6605,28 +6601,33 @@ function fromTsConfigModule(module2) {
|
|
|
6605
6601
|
}
|
|
6606
6602
|
|
|
6607
6603
|
// src/runtime-targets.ts
|
|
6608
|
-
var
|
|
6604
|
+
var supportedPublicRuntimes = [
|
|
6605
|
+
"nodejs",
|
|
6606
|
+
"deno",
|
|
6607
|
+
"bun",
|
|
6608
|
+
"workerd",
|
|
6609
|
+
"cloudflare",
|
|
6610
|
+
"vercel-edge",
|
|
6611
|
+
"edge-light",
|
|
6612
|
+
"react-native"
|
|
6613
|
+
];
|
|
6609
6614
|
function parseRuntimeTarget(target) {
|
|
6610
6615
|
switch (target.toLowerCase()) {
|
|
6611
|
-
case "node":
|
|
6612
|
-
case "nodejs":
|
|
6613
|
-
return "nodejs";
|
|
6614
|
-
case "deno":
|
|
6615
|
-
case "deno-deploy":
|
|
6616
|
-
return "deno";
|
|
6617
|
-
case "bun":
|
|
6618
|
-
return "bun";
|
|
6619
6616
|
case "workerd":
|
|
6620
6617
|
case "cloudflare":
|
|
6621
6618
|
return "workerd";
|
|
6622
6619
|
case "edge-light":
|
|
6623
|
-
case "vercel":
|
|
6624
|
-
return "edge
|
|
6620
|
+
case "vercel-edge":
|
|
6621
|
+
return "vercel-edge";
|
|
6622
|
+
case "nodejs":
|
|
6623
|
+
case "deno":
|
|
6624
|
+
case "bun":
|
|
6625
|
+
return "nodejs";
|
|
6625
6626
|
case "react-native":
|
|
6626
6627
|
return "react-native";
|
|
6627
6628
|
default:
|
|
6628
6629
|
throw new Error(
|
|
6629
|
-
`Unknown target runtime: "${target}". The available options are: ${
|
|
6630
|
+
`Unknown target runtime: "${target}". The available options are: ${supportedPublicRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
|
|
6630
6631
|
);
|
|
6631
6632
|
}
|
|
6632
6633
|
}
|
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) {
|
|
@@ -3453,7 +3453,6 @@ function buildGetWasmModule({
|
|
|
3453
3453
|
component,
|
|
3454
3454
|
runtimeName,
|
|
3455
3455
|
runtimeBase,
|
|
3456
|
-
target,
|
|
3457
3456
|
activeProvider,
|
|
3458
3457
|
moduleFormat
|
|
3459
3458
|
}) {
|
|
@@ -3479,8 +3478,7 @@ function buildGetWasmModule({
|
|
|
3479
3478
|
return `
|
|
3480
3479
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
3481
3480
|
const { Buffer } = await import('node:buffer')
|
|
3482
|
-
const
|
|
3483
|
-
const wasmArray = new Uint8Array(Buffer.from(base64Data, 'base64'))
|
|
3481
|
+
const wasmArray = Buffer.from(wasmBase64, 'base64')
|
|
3484
3482
|
return new WebAssembly.Module(wasmArray)
|
|
3485
3483
|
}
|
|
3486
3484
|
|
|
@@ -3494,12 +3492,11 @@ config.${component}Wasm = {
|
|
|
3494
3492
|
}`;
|
|
3495
3493
|
}
|
|
3496
3494
|
if (buildEdgeLoader) {
|
|
3497
|
-
const fullWasmModulePath = target === "edge-light" ? `${wasmModulePath}?module` : wasmModulePath;
|
|
3498
3495
|
return `config.${component}Wasm = {
|
|
3499
3496
|
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3500
3497
|
|
|
3501
3498
|
getQuery${capitalizedComponent}WasmModule: async () => {
|
|
3502
|
-
const { default: module } = await import(${JSON.stringify(
|
|
3499
|
+
const { default: module } = await import(${JSON.stringify(`${wasmModulePath}?module`)})
|
|
3503
3500
|
return module
|
|
3504
3501
|
}
|
|
3505
3502
|
}`;
|
|
@@ -3508,7 +3505,7 @@ config.${component}Wasm = {
|
|
|
3508
3505
|
}
|
|
3509
3506
|
function readSourceFile(sourceFile) {
|
|
3510
3507
|
const bundledLocation = path.join(__dirname, sourceFile);
|
|
3511
|
-
const sourceLocation = path.join(__dirname, "..", "..", "..", "
|
|
3508
|
+
const sourceLocation = path.join(__dirname, "..", "..", "..", "cli", "build", sourceFile);
|
|
3512
3509
|
if (fs.existsSync(bundledLocation)) {
|
|
3513
3510
|
debug("We are in the bundled Prisma CLI");
|
|
3514
3511
|
return fs.readFileSync(bundledLocation);
|
|
@@ -3776,8 +3773,8 @@ var PrismaClientClass = class {
|
|
|
3776
3773
|
export interface PrismaClientConstructor {
|
|
3777
3774
|
${indent3(this.jsDoc, TAB_SIZE)}
|
|
3778
3775
|
new <
|
|
3779
|
-
Options extends Prisma.PrismaClientOptions,
|
|
3780
|
-
LogOpts extends LogOptions<Options>,
|
|
3776
|
+
Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
|
|
3777
|
+
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
3781
3778
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
3782
3779
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
3783
3780
|
>(options?: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
@@ -3848,7 +3845,7 @@ get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`;
|
|
|
3848
3845
|
};
|
|
3849
3846
|
|
|
3850
3847
|
// src/TSClient/file-generators/ClassFile.ts
|
|
3851
|
-
var jsDocHeader =
|
|
3848
|
+
var jsDocHeader = `/*
|
|
3852
3849
|
* WARNING: This is an internal file that is subject to change!
|
|
3853
3850
|
*
|
|
3854
3851
|
* \u{1F6D1} Under no circumstances should you import this file directly! \u{1F6D1}
|
|
@@ -3969,7 +3966,7 @@ path.join(process.cwd(), ${JSON.stringify(pathToPosix2(relativeFilePath))})`;
|
|
|
3969
3966
|
}
|
|
3970
3967
|
|
|
3971
3968
|
// src/TSClient/file-generators/ClientFile.ts
|
|
3972
|
-
var jsDocHeader2 =
|
|
3969
|
+
var jsDocHeader2 = `/*
|
|
3973
3970
|
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
|
|
3974
3971
|
*
|
|
3975
3972
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -4056,7 +4053,7 @@ globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
|
|
|
4056
4053
|
|
|
4057
4054
|
// src/TSClient/file-generators/CommonInputTypesFile.ts
|
|
4058
4055
|
import * as ts7 from "@prisma/ts-builders";
|
|
4059
|
-
var jsDocHeader3 =
|
|
4056
|
+
var jsDocHeader3 = `/*
|
|
4060
4057
|
* This file exports various common sort, input & filter types that are not directly linked to a particular model.
|
|
4061
4058
|
*
|
|
4062
4059
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -4068,7 +4065,7 @@ function createCommonInputTypeFiles(context) {
|
|
|
4068
4065
|
ts7.moduleImport(context.importFileName(`./enums`)).asNamespace("$Enums"),
|
|
4069
4066
|
ts7.moduleImport(context.importFileName(`./internal/prismaNamespace`)).asNamespace("Prisma").typeOnly()
|
|
4070
4067
|
].map((i) => ts7.stringify(i));
|
|
4071
|
-
const genericInputTypes = context.dmmf.inputObjectTypes.prisma
|
|
4068
|
+
const genericInputTypes = context.dmmf.inputObjectTypes.prisma?.filter((i) => !i.meta?.grouping)?.map((inputType) => new InputType(inputType, context).toTS()) ?? [];
|
|
4072
4069
|
return `${jsDocHeader3}
|
|
4073
4070
|
${imports.join("\n")}
|
|
4074
4071
|
|
|
@@ -4080,11 +4077,12 @@ ${context.dmmf.inputObjectTypes.model?.map((inputType) => new InputType(inputTyp
|
|
|
4080
4077
|
|
|
4081
4078
|
// src/TSClient/file-generators/EnumsFile.ts
|
|
4082
4079
|
import { datamodelEnumToSchemaEnum } from "@prisma/dmmf";
|
|
4083
|
-
var jsDocHeader4 =
|
|
4080
|
+
var jsDocHeader4 = `/*
|
|
4084
4081
|
* This file exports all enum related types from the schema.
|
|
4085
4082
|
*
|
|
4086
4083
|
* \u{1F7E2} You can import this file directly.
|
|
4087
4084
|
*/
|
|
4085
|
+
|
|
4088
4086
|
`;
|
|
4089
4087
|
function createEnumsFile(context) {
|
|
4090
4088
|
const modelEnums = [];
|
|
@@ -5104,7 +5102,7 @@ function fluentWrapperName(modelName) {
|
|
|
5104
5102
|
|
|
5105
5103
|
// src/TSClient/file-generators/ModelFile.ts
|
|
5106
5104
|
function createModelFile(context, modelName) {
|
|
5107
|
-
const jsDocHeader7 =
|
|
5105
|
+
const jsDocHeader7 = `/*
|
|
5108
5106
|
* This file exports the \`${modelName}\` model and its related types.
|
|
5109
5107
|
*
|
|
5110
5108
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -5121,7 +5119,7 @@ function createModelFile(context, modelName) {
|
|
|
5121
5119
|
}
|
|
5122
5120
|
|
|
5123
5121
|
// src/TSClient/file-generators/ModelsFile.ts
|
|
5124
|
-
var jsDocHeader5 =
|
|
5122
|
+
var jsDocHeader5 = `/*
|
|
5125
5123
|
* This is a barrel export file for all models and their related types.
|
|
5126
5124
|
*
|
|
5127
5125
|
* \u{1F7E2} You can import this file directly.
|
|
@@ -5684,7 +5682,7 @@ function payloadToResult(modelName) {
|
|
|
5684
5682
|
}
|
|
5685
5683
|
|
|
5686
5684
|
// src/TSClient/file-generators/PrismaNamespaceFile.ts
|
|
5687
|
-
var jsDocHeader6 =
|
|
5685
|
+
var jsDocHeader6 = `/*
|
|
5688
5686
|
* WARNING: This is an internal file that is subject to change!
|
|
5689
5687
|
*
|
|
5690
5688
|
* \u{1F6D1} Under no circumstances should you import this file directly! \u{1F6D1}
|
|
@@ -6492,11 +6490,9 @@ async function getGenerationDirs({ runtimeBase, outputDir }) {
|
|
|
6492
6490
|
function getRuntimeNameForTarget(target, engineType, previewFeatures) {
|
|
6493
6491
|
switch (target) {
|
|
6494
6492
|
case "nodejs":
|
|
6495
|
-
case "deno":
|
|
6496
|
-
case "bun":
|
|
6497
6493
|
return getNodeRuntimeName(engineType);
|
|
6498
6494
|
case "workerd":
|
|
6499
|
-
case "edge
|
|
6495
|
+
case "vercel-edge":
|
|
6500
6496
|
if (previewFeatures.includes("driverAdapters")) {
|
|
6501
6497
|
return engineType === ClientEngineType3.Client ? "wasm-compiler-edge" : "wasm-engine-edge";
|
|
6502
6498
|
} else {
|
|
@@ -6561,7 +6557,7 @@ import { getTsconfig } from "get-tsconfig";
|
|
|
6561
6557
|
import { match as match2 } from "ts-pattern";
|
|
6562
6558
|
|
|
6563
6559
|
// package.json
|
|
6564
|
-
var version = "6.15.0-integration-
|
|
6560
|
+
var version = "6.15.0-integration-query-plan-caching.1";
|
|
6565
6561
|
|
|
6566
6562
|
// src/module-format.ts
|
|
6567
6563
|
function parseModuleFormat(format) {
|
|
@@ -6604,28 +6600,33 @@ function fromTsConfigModule(module) {
|
|
|
6604
6600
|
}
|
|
6605
6601
|
|
|
6606
6602
|
// src/runtime-targets.ts
|
|
6607
|
-
var
|
|
6603
|
+
var supportedPublicRuntimes = [
|
|
6604
|
+
"nodejs",
|
|
6605
|
+
"deno",
|
|
6606
|
+
"bun",
|
|
6607
|
+
"workerd",
|
|
6608
|
+
"cloudflare",
|
|
6609
|
+
"vercel-edge",
|
|
6610
|
+
"edge-light",
|
|
6611
|
+
"react-native"
|
|
6612
|
+
];
|
|
6608
6613
|
function parseRuntimeTarget(target) {
|
|
6609
6614
|
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
6615
|
case "workerd":
|
|
6619
6616
|
case "cloudflare":
|
|
6620
6617
|
return "workerd";
|
|
6621
6618
|
case "edge-light":
|
|
6622
|
-
case "vercel":
|
|
6623
|
-
return "edge
|
|
6619
|
+
case "vercel-edge":
|
|
6620
|
+
return "vercel-edge";
|
|
6621
|
+
case "nodejs":
|
|
6622
|
+
case "deno":
|
|
6623
|
+
case "bun":
|
|
6624
|
+
return "nodejs";
|
|
6624
6625
|
case "react-native":
|
|
6625
6626
|
return "react-native";
|
|
6626
6627
|
default:
|
|
6627
6628
|
throw new Error(
|
|
6628
|
-
`Unknown target runtime: "${target}". The available options are: ${
|
|
6629
|
+
`Unknown target runtime: "${target}". The available options are: ${supportedPublicRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
|
|
6629
6630
|
);
|
|
6630
6631
|
}
|
|
6631
6632
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare const supportedInternalRuntimes: readonly ["nodejs", "workerd", "vercel-edge", "react-native"];
|
|
2
|
+
declare const supportedPublicRuntimes: readonly ["nodejs", "deno", "bun", "workerd", "cloudflare", "vercel-edge", "edge-light", "react-native"];
|
|
3
|
+
/**
|
|
4
|
+
* The user-facing `runtime` attribute for the `prisma-client` generator.
|
|
5
|
+
*/
|
|
6
|
+
export type RuntimeTarget = (typeof supportedPublicRuntimes)[number];
|
|
7
|
+
/**
|
|
8
|
+
* The internal representation of the `runtime` attribute for the `prisma-client` generator.
|
|
9
|
+
*/
|
|
10
|
+
export type RuntimeTargetInternal = (typeof supportedInternalRuntimes)[number];
|
|
11
|
+
export declare function parseRuntimeTargetFromUnknown(target: unknown): "nodejs" | "workerd" | "vercel-edge" | "react-native";
|
|
5
12
|
export {};
|
package/dist/utils/wasm.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { ActiveConnectorType } from '@prisma/generator';
|
|
2
2
|
import type { FileMap } from '../generateClient';
|
|
3
|
-
import { ModuleFormat } from '../module-format';
|
|
4
|
-
import {
|
|
5
|
-
import { RuntimeName } from '../TSClient/TSClient';
|
|
3
|
+
import type { ModuleFormat } from '../module-format';
|
|
4
|
+
import type { RuntimeTargetInternal } from '../runtime-targets';
|
|
5
|
+
import type { RuntimeName } from '../TSClient/TSClient';
|
|
6
6
|
export type BuildWasmModuleOptions = {
|
|
7
7
|
component: 'engine' | 'compiler';
|
|
8
8
|
runtimeName: RuntimeName;
|
|
9
9
|
runtimeBase: string;
|
|
10
|
-
target:
|
|
10
|
+
target: RuntimeTargetInternal;
|
|
11
11
|
activeProvider: ActiveConnectorType;
|
|
12
12
|
moduleFormat: ModuleFormat;
|
|
13
13
|
};
|
|
14
|
-
export declare function buildGetWasmModule({ component, runtimeName, runtimeBase,
|
|
14
|
+
export declare function buildGetWasmModule({ component, runtimeName, runtimeBase, activeProvider, moduleFormat, }: BuildWasmModuleOptions): string;
|
|
15
15
|
export type BuildWasmFileMapOptions = {
|
|
16
16
|
activeProvider: ActiveConnectorType;
|
|
17
17
|
runtimeName: RuntimeName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-generator-ts",
|
|
3
|
-
"version": "6.15.0-integration-
|
|
3
|
+
"version": "6.15.0-integration-query-plan-caching.1",
|
|
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.15.0-
|
|
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/
|
|
38
|
-
"@prisma/
|
|
39
|
-
"@prisma/
|
|
40
|
-
"@prisma/dmmf": "6.15.0-integration-
|
|
41
|
-
"@prisma/
|
|
42
|
-
"@prisma/
|
|
43
|
-
"@prisma/ts-builders": "6.15.0-integration-
|
|
44
|
-
"@prisma/
|
|
37
|
+
"@prisma/debug": "6.15.0-integration-query-plan-caching.1",
|
|
38
|
+
"@prisma/client-common": "6.15.0-integration-query-plan-caching.1",
|
|
39
|
+
"@prisma/fetch-engine": "6.15.0-integration-query-plan-caching.1",
|
|
40
|
+
"@prisma/dmmf": "6.15.0-integration-query-plan-caching.1",
|
|
41
|
+
"@prisma/generator": "6.15.0-integration-query-plan-caching.1",
|
|
42
|
+
"@prisma/internals": "6.15.0-integration-query-plan-caching.1",
|
|
43
|
+
"@prisma/ts-builders": "6.15.0-integration-query-plan-caching.1",
|
|
44
|
+
"@prisma/get-platform": "6.15.0-integration-query-plan-caching.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/pluralize": "0.0.33",
|