New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@prisma/cli-policy

Package Overview
Dependencies
Maintainers
0
Versions
316
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma/cli-policy - npm Package Compare versions

Comparing version 0.0.0-dev.202502142240 to 0.0.0-dev.202502142317

31

dist/template.js
// @ts-check
export async function resolvePrismaClient(/** @type {string} */ url, /** @type {Record<string, string>} */ env) {
/** @type {any} **/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore this is injected by the runtime
let { prisma } = await import("./policy-path-to-prisma-client.mjs");
try {
/** @type {any} **/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore this is injected by the runtime
let { prisma } = await import("./policy-path-to-prisma-client.mjs");
const dbURL = new URL(env.DATABASE_URL ?? "MISSING_DATABASE_URL");
const apiKey = dbURL.searchParams.get("api_key") ?? "MISSING_API_KEY";
const itx = new URL(url).searchParams.get("itx");
const dbURL = new URL(env.DATABASE_URL ?? "MISSING_DATABASE_URL");
const apiKey = dbURL.searchParams.get("api_key") ?? "MISSING_API_KEY";
const itx = new URL(url).searchParams.get("itx");
const engine = prisma._originalClient._engine;
const dsName = Object.keys(engine.inlineDatasources ?? {})[0] ?? "db";
engine.config.overrideDatasources = { [dsName]: { url: dbURL.toString() } };
const engine = prisma._originalClient._engine;
const dsName = Object.keys(engine.inlineDatasources ?? {})[0] ?? "db";
engine.config.overrideDatasources = { [dsName]: { url: dbURL.toString() } };
prisma = prisma.$withPlatformExtensions({ pulse: [{ apiKey }], accelerate: [] });
prisma = prisma.$withPlatformExtensions({ pulse: [{ apiKey }], accelerate: [] });
prisma = itx ? await getItxPrismaClient(prisma, JSON.parse(itx)) : prisma;
if (itx) return await getItxPrismaClient(prisma, JSON.parse(itx));
return prisma;
return [null, prisma];
} catch (error) {
return [error, null];
}
}

@@ -23,0 +26,0 @@

{
"name": "@prisma/cli-policy",
"version": "0.0.0-dev.202502142240",
"version": "0.0.0-dev.202502142317",
"sideEffects": false,

@@ -35,4 +35,4 @@ "description": "Policy CLI for Prisma",

"common-cli-utils": "^0.0.0",
"policy-deployer": "^0.0.0-dev.202502142240",
"policy-playground": "^0.0.0-dev.202502142240"
"policy-deployer": "^0.0.0-dev.202502142317",
"policy-playground": "^0.0.0-dev.202502142317"
},

@@ -39,0 +39,0 @@ "peerDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc