@prisma/client-generator-ts 6.14.0-dev.12 → 6.14.0-dev.14
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 +57 -52
- package/dist/index.mjs +57 -52
- package/dist/utils/wasm.d.ts +2 -2
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -494,11 +494,11 @@ var require_graceful_fs = __commonJS({
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
var
|
|
497
|
+
var debug3 = noop;
|
|
498
498
|
if (util.debuglog)
|
|
499
|
-
|
|
499
|
+
debug3 = util.debuglog("gfs4");
|
|
500
500
|
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
501
|
-
|
|
501
|
+
debug3 = function() {
|
|
502
502
|
var m = util.format.apply(util, arguments);
|
|
503
503
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
504
504
|
console.error(m);
|
|
@@ -533,7 +533,7 @@ var require_graceful_fs = __commonJS({
|
|
|
533
533
|
}(fs3.closeSync);
|
|
534
534
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
535
535
|
process.on("exit", function() {
|
|
536
|
-
|
|
536
|
+
debug3(fs3[gracefulQueue]);
|
|
537
537
|
require("assert").equal(fs3[gracefulQueue].length, 0);
|
|
538
538
|
});
|
|
539
539
|
}
|
|
@@ -786,7 +786,7 @@ var require_graceful_fs = __commonJS({
|
|
|
786
786
|
return fs4;
|
|
787
787
|
}
|
|
788
788
|
function enqueue(elem) {
|
|
789
|
-
|
|
789
|
+
debug3("ENQUEUE", elem[0].name, elem[1]);
|
|
790
790
|
fs3[gracefulQueue].push(elem);
|
|
791
791
|
retry();
|
|
792
792
|
}
|
|
@@ -813,10 +813,10 @@ var require_graceful_fs = __commonJS({
|
|
|
813
813
|
var startTime = elem[3];
|
|
814
814
|
var lastTime = elem[4];
|
|
815
815
|
if (startTime === void 0) {
|
|
816
|
-
|
|
816
|
+
debug3("RETRY", fn.name, args);
|
|
817
817
|
fn.apply(null, args);
|
|
818
818
|
} else if (Date.now() - startTime >= 6e4) {
|
|
819
|
-
|
|
819
|
+
debug3("TIMEOUT", fn.name, args);
|
|
820
820
|
var cb = args.pop();
|
|
821
821
|
if (typeof cb === "function")
|
|
822
822
|
cb.call(null, err);
|
|
@@ -825,7 +825,7 @@ var require_graceful_fs = __commonJS({
|
|
|
825
825
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
826
826
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
827
827
|
if (sinceAttempt >= desiredDelay) {
|
|
828
|
-
|
|
828
|
+
debug3("RETRY", fn.name, args);
|
|
829
829
|
fn.apply(null, args.concat([startTime]));
|
|
830
830
|
} else {
|
|
831
831
|
fs3[gracefulQueue].push(elem);
|
|
@@ -3444,7 +3444,9 @@ function buildInlineDatasource(ds) {
|
|
|
3444
3444
|
var import_node_fs = __toESM(require("node:fs"));
|
|
3445
3445
|
var import_node_path = __toESM(require("node:path"));
|
|
3446
3446
|
var import_client_common11 = require("@prisma/client-common");
|
|
3447
|
+
var import_debug = require("@prisma/debug");
|
|
3447
3448
|
var import_ts_pattern = require("ts-pattern");
|
|
3449
|
+
var debug = (0, import_debug.Debug)("prisma:client-generator-ts:wasm");
|
|
3448
3450
|
function buildDynamicRequireFn() {
|
|
3449
3451
|
return `const dynamicRequireFn = async <const T extends string>(name: T) =>
|
|
3450
3452
|
typeof globalThis.__non_webpack_require__ === 'function'
|
|
@@ -3463,20 +3465,42 @@ function buildGetWasmModule({
|
|
|
3463
3465
|
moduleFormat
|
|
3464
3466
|
}) {
|
|
3465
3467
|
const capitalizedComponent = (0, import_client_common11.capitalize)(component);
|
|
3468
|
+
const buildNonEdgeLoader = (0, import_ts_pattern.match)(runtimeName).with("library", () => component === "engine" && !!process.env.PRISMA_CLIENT_FORCE_WASM).with("client", () => component === "compiler").otherwise(() => false);
|
|
3469
|
+
const buildNodeJsLoader = (0, import_ts_pattern.match)({ runtimeName, target }).with({ target: "nodejs" }, () => buildNonEdgeLoader).otherwise(() => false);
|
|
3466
3470
|
const buildEdgeLoader = usesEdgeWasmRuntime(component, runtimeName);
|
|
3471
|
+
let wasmPathBase;
|
|
3467
3472
|
let wasmBindingsPath;
|
|
3468
3473
|
let wasmModulePath;
|
|
3469
3474
|
if (buildEdgeLoader) {
|
|
3470
|
-
|
|
3475
|
+
wasmPathBase = `./query_${component}_bg`;
|
|
3471
3476
|
wasmBindingsPath = `${wasmPathBase}.js`;
|
|
3472
3477
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3473
3478
|
} else {
|
|
3474
|
-
|
|
3479
|
+
wasmPathBase = `${runtimeBase}/query_${component}_bg.${activeProvider}`;
|
|
3475
3480
|
wasmBindingsPath = `${wasmPathBase}.mjs`;
|
|
3476
3481
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3477
3482
|
}
|
|
3478
|
-
|
|
3479
|
-
|
|
3483
|
+
if (buildNodeJsLoader) {
|
|
3484
|
+
const extension = (0, import_ts_pattern.match)(moduleFormat).with("esm", () => "mjs").with("cjs", () => "cjs").exhaustive();
|
|
3485
|
+
wasmModulePath = `${wasmPathBase}.wasm-base64.${extension}`;
|
|
3486
|
+
return `
|
|
3487
|
+
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
3488
|
+
const { Buffer } = await import('node:buffer')
|
|
3489
|
+
const base64Data = wasmBase64.replace('data:application/wasm;base64,', '')
|
|
3490
|
+
const wasmArray = new Uint8Array(Buffer.from(base64Data, 'base64'))
|
|
3491
|
+
return new WebAssembly.Module(wasmArray)
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
config.${component}Wasm = {
|
|
3495
|
+
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3496
|
+
|
|
3497
|
+
getQuery${capitalizedComponent}WasmModule: async () => {
|
|
3498
|
+
const { wasm } = await import(${JSON.stringify(wasmModulePath)})
|
|
3499
|
+
return await decodeBase64AsWasm(wasm)
|
|
3500
|
+
}
|
|
3501
|
+
}`;
|
|
3502
|
+
}
|
|
3503
|
+
if (buildNonEdgeLoader) {
|
|
3480
3504
|
return `config.${component}Wasm = {
|
|
3481
3505
|
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3482
3506
|
|
|
@@ -3514,10 +3538,25 @@ function buildRequire(moduleFormat) {
|
|
|
3514
3538
|
const _require = createRequire(import.meta.url)
|
|
3515
3539
|
`;
|
|
3516
3540
|
}
|
|
3517
|
-
function
|
|
3541
|
+
function readSourceFile(sourceFile) {
|
|
3542
|
+
const bundledLocation = import_node_path.default.join(__dirname, sourceFile);
|
|
3543
|
+
const sourceLocation = import_node_path.default.join(__dirname, "..", "..", "..", "client", "runtime", sourceFile);
|
|
3544
|
+
if (import_node_fs.default.existsSync(bundledLocation)) {
|
|
3545
|
+
debug("We are in the bundled Prisma CLI");
|
|
3546
|
+
return import_node_fs.default.readFileSync(bundledLocation);
|
|
3547
|
+
} else if (import_node_fs.default.existsSync(sourceLocation)) {
|
|
3548
|
+
debug("We are in a dev/test environment");
|
|
3549
|
+
return import_node_fs.default.readFileSync(sourceLocation);
|
|
3550
|
+
} else {
|
|
3551
|
+
throw new Error(`Could not find ${sourceFile} in ${bundledLocation} or ${sourceLocation}`);
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
function buildWasmFileMap({ activeProvider, runtimeName }) {
|
|
3518
3555
|
const fileMap = {};
|
|
3556
|
+
debug("buildWasmFileMap with", { runtimeName });
|
|
3519
3557
|
for (const component of ["engine", "compiler"]) {
|
|
3520
3558
|
if (!usesEdgeWasmRuntime(component, runtimeName)) {
|
|
3559
|
+
debug("Skipping component", component, "for runtime", runtimeName);
|
|
3521
3560
|
continue;
|
|
3522
3561
|
}
|
|
3523
3562
|
const fileNameBase = `query_${component}_bg.${activeProvider}`;
|
|
@@ -3526,15 +3565,7 @@ function buildWasmFileMap({ runtimeName, activeProvider }) {
|
|
|
3526
3565
|
[`query_${component}_bg.js`]: `${fileNameBase}.mjs`
|
|
3527
3566
|
};
|
|
3528
3567
|
for (const [targetFile, sourceFile] of Object.entries(files)) {
|
|
3529
|
-
|
|
3530
|
-
const sourceLocation = import_node_path.default.join(__dirname, "..", "..", "..", "client", "runtime", sourceFile);
|
|
3531
|
-
if (import_node_fs.default.existsSync(bundledLocation)) {
|
|
3532
|
-
fileMap[targetFile] = import_node_fs.default.readFileSync(bundledLocation);
|
|
3533
|
-
} else if (import_node_fs.default.existsSync(sourceLocation)) {
|
|
3534
|
-
fileMap[targetFile] = import_node_fs.default.readFileSync(sourceLocation);
|
|
3535
|
-
} else {
|
|
3536
|
-
throw new Error(`Could not find ${sourceFile} in ${bundledLocation} or ${sourceLocation}`);
|
|
3537
|
-
}
|
|
3568
|
+
fileMap[targetFile] = readSourceFile(sourceFile);
|
|
3538
3569
|
}
|
|
3539
3570
|
}
|
|
3540
3571
|
return fileMap;
|
|
@@ -3803,13 +3834,6 @@ export interface PrismaClient<
|
|
|
3803
3834
|
*/
|
|
3804
3835
|
$disconnect(): runtime.Types.Utils.JsPromise<void>;
|
|
3805
3836
|
|
|
3806
|
-
/**
|
|
3807
|
-
* Add a middleware
|
|
3808
|
-
* @deprecated since 4.16.0. For new code, prefer client extensions instead.
|
|
3809
|
-
* @see https://pris.ly/d/extensions
|
|
3810
|
-
*/
|
|
3811
|
-
$use(cb: Prisma.Middleware): void
|
|
3812
|
-
|
|
3813
3837
|
${[
|
|
3814
3838
|
executeRawDefinition(this.context),
|
|
3815
3839
|
queryRawDefinition(this.context),
|
|
@@ -5810,25 +5834,6 @@ export type PrismaAction =
|
|
|
5810
5834
|
| 'findRaw'
|
|
5811
5835
|
| 'groupBy'
|
|
5812
5836
|
|
|
5813
|
-
/**
|
|
5814
|
-
* These options are being passed into the middleware as "params"
|
|
5815
|
-
*/
|
|
5816
|
-
export type MiddlewareParams = {
|
|
5817
|
-
model?: ModelName
|
|
5818
|
-
action: PrismaAction
|
|
5819
|
-
args: any
|
|
5820
|
-
dataPath: string[]
|
|
5821
|
-
runInTransaction: boolean
|
|
5822
|
-
}
|
|
5823
|
-
|
|
5824
|
-
/**
|
|
5825
|
-
* The \`T\` type makes sure, that the \`return proceed\` is not forgotten in the middleware implementation
|
|
5826
|
-
*/
|
|
5827
|
-
export type Middleware<T = any> = (
|
|
5828
|
-
params: MiddlewareParams,
|
|
5829
|
-
next: (params: MiddlewareParams) => runtime.Types.Utils.JsPromise<T>,
|
|
5830
|
-
) => runtime.Types.Utils.JsPromise<T>
|
|
5831
|
-
|
|
5832
5837
|
/**
|
|
5833
5838
|
* \`PrismaClient\` proxy available in interactive transactions.
|
|
5834
5839
|
*/
|
|
@@ -6580,14 +6585,14 @@ async function deleteOutputDir(outputDir) {
|
|
|
6580
6585
|
}
|
|
6581
6586
|
|
|
6582
6587
|
// src/generator.ts
|
|
6583
|
-
var
|
|
6588
|
+
var import_debug2 = require("@prisma/debug");
|
|
6584
6589
|
var import_engines_version = require("@prisma/engines-version");
|
|
6585
6590
|
var import_internals10 = require("@prisma/internals");
|
|
6586
6591
|
var import_get_tsconfig = require("get-tsconfig");
|
|
6587
6592
|
var import_ts_pattern2 = require("ts-pattern");
|
|
6588
6593
|
|
|
6589
6594
|
// package.json
|
|
6590
|
-
var version = "6.14.0-dev.
|
|
6595
|
+
var version = "6.14.0-dev.14";
|
|
6591
6596
|
|
|
6592
6597
|
// src/module-format.ts
|
|
6593
6598
|
function parseModuleFormat(format) {
|
|
@@ -6664,7 +6669,7 @@ function parseRuntimeTargetFromUnknown(target) {
|
|
|
6664
6669
|
}
|
|
6665
6670
|
|
|
6666
6671
|
// src/generator.ts
|
|
6667
|
-
var
|
|
6672
|
+
var debug2 = (0, import_debug2.Debug)("prisma:client:generator");
|
|
6668
6673
|
var missingOutputErrorMessage = `An output path is required for the \`prisma-client\` generator. Please provide an output path in your schema file:
|
|
6669
6674
|
|
|
6670
6675
|
${dim(`generator client {
|
|
@@ -6684,7 +6689,7 @@ var PrismaClientTsGenerator = class {
|
|
|
6684
6689
|
name = "prisma-client-ts";
|
|
6685
6690
|
getManifest(config) {
|
|
6686
6691
|
const requiresEngines = (0, import_ts_pattern2.match)((0, import_internals10.getClientEngineType)(config)).with(import_internals10.ClientEngineType.Library, () => ["libqueryEngine"]).with(import_internals10.ClientEngineType.Binary, () => ["queryEngine"]).with(import_internals10.ClientEngineType.Client, () => []).exhaustive();
|
|
6687
|
-
|
|
6692
|
+
debug2("requiresEngines", requiresEngines);
|
|
6688
6693
|
return Promise.resolve({
|
|
6689
6694
|
defaultOutput: getOutputPath(config),
|
|
6690
6695
|
prettyName: "Prisma Client",
|
package/dist/index.mjs
CHANGED
|
@@ -494,11 +494,11 @@ var require_graceful_fs = __commonJS({
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
var
|
|
497
|
+
var debug3 = noop;
|
|
498
498
|
if (util.debuglog)
|
|
499
|
-
|
|
499
|
+
debug3 = util.debuglog("gfs4");
|
|
500
500
|
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
501
|
-
|
|
501
|
+
debug3 = function() {
|
|
502
502
|
var m = util.format.apply(util, arguments);
|
|
503
503
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
504
504
|
console.error(m);
|
|
@@ -533,7 +533,7 @@ var require_graceful_fs = __commonJS({
|
|
|
533
533
|
}(fs3.closeSync);
|
|
534
534
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
535
535
|
process.on("exit", function() {
|
|
536
|
-
|
|
536
|
+
debug3(fs3[gracefulQueue]);
|
|
537
537
|
__require("assert").equal(fs3[gracefulQueue].length, 0);
|
|
538
538
|
});
|
|
539
539
|
}
|
|
@@ -786,7 +786,7 @@ var require_graceful_fs = __commonJS({
|
|
|
786
786
|
return fs4;
|
|
787
787
|
}
|
|
788
788
|
function enqueue(elem) {
|
|
789
|
-
|
|
789
|
+
debug3("ENQUEUE", elem[0].name, elem[1]);
|
|
790
790
|
fs3[gracefulQueue].push(elem);
|
|
791
791
|
retry();
|
|
792
792
|
}
|
|
@@ -813,10 +813,10 @@ var require_graceful_fs = __commonJS({
|
|
|
813
813
|
var startTime = elem[3];
|
|
814
814
|
var lastTime = elem[4];
|
|
815
815
|
if (startTime === void 0) {
|
|
816
|
-
|
|
816
|
+
debug3("RETRY", fn.name, args);
|
|
817
817
|
fn.apply(null, args);
|
|
818
818
|
} else if (Date.now() - startTime >= 6e4) {
|
|
819
|
-
|
|
819
|
+
debug3("TIMEOUT", fn.name, args);
|
|
820
820
|
var cb = args.pop();
|
|
821
821
|
if (typeof cb === "function")
|
|
822
822
|
cb.call(null, err);
|
|
@@ -825,7 +825,7 @@ var require_graceful_fs = __commonJS({
|
|
|
825
825
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
826
826
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
827
827
|
if (sinceAttempt >= desiredDelay) {
|
|
828
|
-
|
|
828
|
+
debug3("RETRY", fn.name, args);
|
|
829
829
|
fn.apply(null, args.concat([startTime]));
|
|
830
830
|
} else {
|
|
831
831
|
fs3[gracefulQueue].push(elem);
|
|
@@ -3443,7 +3443,9 @@ function buildInlineDatasource(ds) {
|
|
|
3443
3443
|
import fs from "node:fs";
|
|
3444
3444
|
import path from "node:path";
|
|
3445
3445
|
import { capitalize as capitalize6 } from "@prisma/client-common";
|
|
3446
|
+
import { Debug } from "@prisma/debug";
|
|
3446
3447
|
import { match } from "ts-pattern";
|
|
3448
|
+
var debug = Debug("prisma:client-generator-ts:wasm");
|
|
3447
3449
|
function buildDynamicRequireFn() {
|
|
3448
3450
|
return `const dynamicRequireFn = async <const T extends string>(name: T) =>
|
|
3449
3451
|
typeof globalThis.__non_webpack_require__ === 'function'
|
|
@@ -3462,20 +3464,42 @@ function buildGetWasmModule({
|
|
|
3462
3464
|
moduleFormat
|
|
3463
3465
|
}) {
|
|
3464
3466
|
const capitalizedComponent = capitalize6(component);
|
|
3467
|
+
const buildNonEdgeLoader = match(runtimeName).with("library", () => component === "engine" && !!process.env.PRISMA_CLIENT_FORCE_WASM).with("client", () => component === "compiler").otherwise(() => false);
|
|
3468
|
+
const buildNodeJsLoader = match({ runtimeName, target }).with({ target: "nodejs" }, () => buildNonEdgeLoader).otherwise(() => false);
|
|
3465
3469
|
const buildEdgeLoader = usesEdgeWasmRuntime(component, runtimeName);
|
|
3470
|
+
let wasmPathBase;
|
|
3466
3471
|
let wasmBindingsPath;
|
|
3467
3472
|
let wasmModulePath;
|
|
3468
3473
|
if (buildEdgeLoader) {
|
|
3469
|
-
|
|
3474
|
+
wasmPathBase = `./query_${component}_bg`;
|
|
3470
3475
|
wasmBindingsPath = `${wasmPathBase}.js`;
|
|
3471
3476
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3472
3477
|
} else {
|
|
3473
|
-
|
|
3478
|
+
wasmPathBase = `${runtimeBase}/query_${component}_bg.${activeProvider}`;
|
|
3474
3479
|
wasmBindingsPath = `${wasmPathBase}.mjs`;
|
|
3475
3480
|
wasmModulePath = `${wasmPathBase}.wasm`;
|
|
3476
3481
|
}
|
|
3477
|
-
|
|
3478
|
-
|
|
3482
|
+
if (buildNodeJsLoader) {
|
|
3483
|
+
const extension = match(moduleFormat).with("esm", () => "mjs").with("cjs", () => "cjs").exhaustive();
|
|
3484
|
+
wasmModulePath = `${wasmPathBase}.wasm-base64.${extension}`;
|
|
3485
|
+
return `
|
|
3486
|
+
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
3487
|
+
const { Buffer } = await import('node:buffer')
|
|
3488
|
+
const base64Data = wasmBase64.replace('data:application/wasm;base64,', '')
|
|
3489
|
+
const wasmArray = new Uint8Array(Buffer.from(base64Data, 'base64'))
|
|
3490
|
+
return new WebAssembly.Module(wasmArray)
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
config.${component}Wasm = {
|
|
3494
|
+
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3495
|
+
|
|
3496
|
+
getQuery${capitalizedComponent}WasmModule: async () => {
|
|
3497
|
+
const { wasm } = await import(${JSON.stringify(wasmModulePath)})
|
|
3498
|
+
return await decodeBase64AsWasm(wasm)
|
|
3499
|
+
}
|
|
3500
|
+
}`;
|
|
3501
|
+
}
|
|
3502
|
+
if (buildNonEdgeLoader) {
|
|
3479
3503
|
return `config.${component}Wasm = {
|
|
3480
3504
|
getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
|
|
3481
3505
|
|
|
@@ -3513,10 +3537,25 @@ function buildRequire(moduleFormat) {
|
|
|
3513
3537
|
const _require = createRequire(import.meta.url)
|
|
3514
3538
|
`;
|
|
3515
3539
|
}
|
|
3516
|
-
function
|
|
3540
|
+
function readSourceFile(sourceFile) {
|
|
3541
|
+
const bundledLocation = path.join(__dirname, sourceFile);
|
|
3542
|
+
const sourceLocation = path.join(__dirname, "..", "..", "..", "client", "runtime", sourceFile);
|
|
3543
|
+
if (fs.existsSync(bundledLocation)) {
|
|
3544
|
+
debug("We are in the bundled Prisma CLI");
|
|
3545
|
+
return fs.readFileSync(bundledLocation);
|
|
3546
|
+
} else if (fs.existsSync(sourceLocation)) {
|
|
3547
|
+
debug("We are in a dev/test environment");
|
|
3548
|
+
return fs.readFileSync(sourceLocation);
|
|
3549
|
+
} else {
|
|
3550
|
+
throw new Error(`Could not find ${sourceFile} in ${bundledLocation} or ${sourceLocation}`);
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
function buildWasmFileMap({ activeProvider, runtimeName }) {
|
|
3517
3554
|
const fileMap = {};
|
|
3555
|
+
debug("buildWasmFileMap with", { runtimeName });
|
|
3518
3556
|
for (const component of ["engine", "compiler"]) {
|
|
3519
3557
|
if (!usesEdgeWasmRuntime(component, runtimeName)) {
|
|
3558
|
+
debug("Skipping component", component, "for runtime", runtimeName);
|
|
3520
3559
|
continue;
|
|
3521
3560
|
}
|
|
3522
3561
|
const fileNameBase = `query_${component}_bg.${activeProvider}`;
|
|
@@ -3525,15 +3564,7 @@ function buildWasmFileMap({ runtimeName, activeProvider }) {
|
|
|
3525
3564
|
[`query_${component}_bg.js`]: `${fileNameBase}.mjs`
|
|
3526
3565
|
};
|
|
3527
3566
|
for (const [targetFile, sourceFile] of Object.entries(files)) {
|
|
3528
|
-
|
|
3529
|
-
const sourceLocation = path.join(__dirname, "..", "..", "..", "client", "runtime", sourceFile);
|
|
3530
|
-
if (fs.existsSync(bundledLocation)) {
|
|
3531
|
-
fileMap[targetFile] = fs.readFileSync(bundledLocation);
|
|
3532
|
-
} else if (fs.existsSync(sourceLocation)) {
|
|
3533
|
-
fileMap[targetFile] = fs.readFileSync(sourceLocation);
|
|
3534
|
-
} else {
|
|
3535
|
-
throw new Error(`Could not find ${sourceFile} in ${bundledLocation} or ${sourceLocation}`);
|
|
3536
|
-
}
|
|
3567
|
+
fileMap[targetFile] = readSourceFile(sourceFile);
|
|
3537
3568
|
}
|
|
3538
3569
|
}
|
|
3539
3570
|
return fileMap;
|
|
@@ -3802,13 +3833,6 @@ export interface PrismaClient<
|
|
|
3802
3833
|
*/
|
|
3803
3834
|
$disconnect(): runtime.Types.Utils.JsPromise<void>;
|
|
3804
3835
|
|
|
3805
|
-
/**
|
|
3806
|
-
* Add a middleware
|
|
3807
|
-
* @deprecated since 4.16.0. For new code, prefer client extensions instead.
|
|
3808
|
-
* @see https://pris.ly/d/extensions
|
|
3809
|
-
*/
|
|
3810
|
-
$use(cb: Prisma.Middleware): void
|
|
3811
|
-
|
|
3812
3836
|
${[
|
|
3813
3837
|
executeRawDefinition(this.context),
|
|
3814
3838
|
queryRawDefinition(this.context),
|
|
@@ -5809,25 +5833,6 @@ export type PrismaAction =
|
|
|
5809
5833
|
| 'findRaw'
|
|
5810
5834
|
| 'groupBy'
|
|
5811
5835
|
|
|
5812
|
-
/**
|
|
5813
|
-
* These options are being passed into the middleware as "params"
|
|
5814
|
-
*/
|
|
5815
|
-
export type MiddlewareParams = {
|
|
5816
|
-
model?: ModelName
|
|
5817
|
-
action: PrismaAction
|
|
5818
|
-
args: any
|
|
5819
|
-
dataPath: string[]
|
|
5820
|
-
runInTransaction: boolean
|
|
5821
|
-
}
|
|
5822
|
-
|
|
5823
|
-
/**
|
|
5824
|
-
* The \`T\` type makes sure, that the \`return proceed\` is not forgotten in the middleware implementation
|
|
5825
|
-
*/
|
|
5826
|
-
export type Middleware<T = any> = (
|
|
5827
|
-
params: MiddlewareParams,
|
|
5828
|
-
next: (params: MiddlewareParams) => runtime.Types.Utils.JsPromise<T>,
|
|
5829
|
-
) => runtime.Types.Utils.JsPromise<T>
|
|
5830
|
-
|
|
5831
5836
|
/**
|
|
5832
5837
|
* \`PrismaClient\` proxy available in interactive transactions.
|
|
5833
5838
|
*/
|
|
@@ -6579,14 +6584,14 @@ async function deleteOutputDir(outputDir) {
|
|
|
6579
6584
|
}
|
|
6580
6585
|
|
|
6581
6586
|
// src/generator.ts
|
|
6582
|
-
import { Debug } from "@prisma/debug";
|
|
6587
|
+
import { Debug as Debug2 } from "@prisma/debug";
|
|
6583
6588
|
import { enginesVersion } from "@prisma/engines-version";
|
|
6584
6589
|
import { ClientEngineType as ClientEngineType4, getClientEngineType as getClientEngineType4, parseEnvValue } from "@prisma/internals";
|
|
6585
6590
|
import { getTsconfig } from "get-tsconfig";
|
|
6586
6591
|
import { match as match2 } from "ts-pattern";
|
|
6587
6592
|
|
|
6588
6593
|
// package.json
|
|
6589
|
-
var version = "6.14.0-dev.
|
|
6594
|
+
var version = "6.14.0-dev.14";
|
|
6590
6595
|
|
|
6591
6596
|
// src/module-format.ts
|
|
6592
6597
|
function parseModuleFormat(format) {
|
|
@@ -6663,7 +6668,7 @@ function parseRuntimeTargetFromUnknown(target) {
|
|
|
6663
6668
|
}
|
|
6664
6669
|
|
|
6665
6670
|
// src/generator.ts
|
|
6666
|
-
var
|
|
6671
|
+
var debug2 = Debug2("prisma:client:generator");
|
|
6667
6672
|
var missingOutputErrorMessage = `An output path is required for the \`prisma-client\` generator. Please provide an output path in your schema file:
|
|
6668
6673
|
|
|
6669
6674
|
${dim(`generator client {
|
|
@@ -6683,7 +6688,7 @@ var PrismaClientTsGenerator = class {
|
|
|
6683
6688
|
name = "prisma-client-ts";
|
|
6684
6689
|
getManifest(config) {
|
|
6685
6690
|
const requiresEngines = match2(getClientEngineType4(config)).with(ClientEngineType4.Library, () => ["libqueryEngine"]).with(ClientEngineType4.Binary, () => ["queryEngine"]).with(ClientEngineType4.Client, () => []).exhaustive();
|
|
6686
|
-
|
|
6691
|
+
debug2("requiresEngines", requiresEngines);
|
|
6687
6692
|
return Promise.resolve({
|
|
6688
6693
|
defaultOutput: getOutputPath(config),
|
|
6689
6694
|
prettyName: "Prisma Client",
|
package/dist/utils/wasm.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type BuildWasmModuleOptions = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare function buildGetWasmModule({ component, runtimeName, runtimeBase, target, activeProvider, moduleFormat, }: BuildWasmModuleOptions): string;
|
|
15
15
|
export type BuildWasmFileMapOptions = {
|
|
16
|
-
runtimeName: RuntimeName;
|
|
17
16
|
activeProvider: ActiveConnectorType;
|
|
17
|
+
runtimeName: RuntimeName;
|
|
18
18
|
};
|
|
19
|
-
export declare function buildWasmFileMap({
|
|
19
|
+
export declare function buildWasmFileMap({ activeProvider, runtimeName }: BuildWasmFileMapOptions): FileMap;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-generator-ts",
|
|
3
|
-
"version": "6.14.0-dev.
|
|
3
|
+
"version": "6.14.0-dev.14",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -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.14.0-dev.
|
|
38
|
-
"@prisma/
|
|
39
|
-
"@prisma/
|
|
40
|
-
"@prisma/
|
|
41
|
-
"@prisma/get-platform": "6.14.0-dev.
|
|
42
|
-
"@prisma/
|
|
43
|
-
"@prisma/internals": "6.14.0-dev.
|
|
44
|
-
"@prisma/ts-builders": "6.14.0-dev.
|
|
37
|
+
"@prisma/client-common": "6.14.0-dev.14",
|
|
38
|
+
"@prisma/debug": "6.14.0-dev.14",
|
|
39
|
+
"@prisma/dmmf": "6.14.0-dev.14",
|
|
40
|
+
"@prisma/fetch-engine": "6.14.0-dev.14",
|
|
41
|
+
"@prisma/get-platform": "6.14.0-dev.14",
|
|
42
|
+
"@prisma/generator": "6.14.0-dev.14",
|
|
43
|
+
"@prisma/internals": "6.14.0-dev.14",
|
|
44
|
+
"@prisma/ts-builders": "6.14.0-dev.14"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/pluralize": "0.0.33",
|