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

@prisma/schema-files-loader

Package Overview
Dependencies
Maintainers
0
Versions
1105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prisma/schema-files-loader - npm Package Compare versions

Comparing version 6.4.0-integration-engines-6-4-0-1-fix-cockroachdb-slow-migrations-workaround-7f2ebe4987f4376912fd7d7e638148a3943dbc78.1 to 6.4.0-integration-engines-6-4-0-28-integration-sql-nested-transactions-fba3682185fb5027c810216c59359fba8e1cdbb3.1

46

dist/index.d.ts

@@ -27,2 +27,4 @@ export declare type CaseSensitivityOptions = {

export declare function ensureType(entryPath: string, expectedType: PathType): Promise<NonFatalLookupError | undefined>;
export declare interface FilesResolver {

@@ -49,2 +51,21 @@ listDirContents(path: string): Promise<string[]>;

export declare type GetSchemaResult = {
/**
* A path from which schema was loaded.
* Can be either folder or a single file
*/
schemaPath: string;
/**
* Base dir for all of the schema files.
* In-multi file mode, this is equal to `schemaPath`.
* In single-file mode, this is a parent directory of
* a file
*/
schemaRootDir: string;
/**
* All loaded schema files
*/
schemas: Array<LoadedFile>;
};
export declare class InMemoryFilesResolver implements FilesResolver {

@@ -78,6 +99,31 @@ private _tree;

export declare type LookupResult = SuccessfulLookupResult | {
ok: false;
error: NonFatalLookupError;
};
export declare type NonFatalLookupError = {
kind: 'NotFound';
expectedType?: PathType;
path: string;
} | {
kind: 'WrongType';
path: string;
expectedTypes: PathType[];
} | {
kind: 'FolderPreviewNotEnabled';
path: string;
};
export declare type PathType = 'file' | 'directory';
export declare const realFsResolver: FilesResolver;
export declare type SuccessfulLookupResult = {
ok: true;
schema: GetSchemaResult;
};
export declare function usesPrismaSchemaFolder(config: ConfigMetaFormat): boolean;
export { }

@@ -35,2 +35,3 @@ "use strict";

InMemoryFilesResolver: () => InMemoryFilesResolver,
ensureType: () => ensureType,
loadRelatedSchemaFiles: () => loadRelatedSchemaFiles,

@@ -284,2 +285,22 @@ loadSchemaFiles: () => loadSchemaFiles,

}
// src/utils/ensureType.ts
var import_promises = __toESM(require("node:fs/promises"));
async function ensureType(entryPath, expectedType) {
try {
const pathStat = await import_promises.default.stat(entryPath);
if (expectedType === "file" && pathStat.isFile()) {
return void 0;
}
if (expectedType === "directory" && pathStat.isDirectory()) {
return void 0;
}
return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
} catch (e) {
if (e.code === "ENOENT") {
return { kind: "NotFound", path: entryPath, expectedType };
}
throw e;
}
}
// Annotate the CommonJS export names for ESM import in node:

@@ -289,2 +310,3 @@ 0 && (module.exports = {

InMemoryFilesResolver,
ensureType,
loadRelatedSchemaFiles,

@@ -291,0 +313,0 @@ loadSchemaFiles,

4

package.json
{
"name": "@prisma/schema-files-loader",
"version": "6.4.0-integration-engines-6-4-0-1-fix-cockroachdb-slow-migrations-workaround-7f2ebe4987f4376912fd7d7e638148a3943dbc78.1",
"version": "6.4.0-integration-engines-6-4-0-28-integration-sql-nested-transactions-fba3682185fb5027c810216c59359fba8e1cdbb3.1",
"description": "Package for resolving and loading schema files when schema is split into multiple files",

@@ -19,3 +19,3 @@ "main": "dist/index.js",

"dependencies": {
"@prisma/prisma-schema-wasm": "6.4.0-1.fix-cockroachdb-slow-migrations-workaround-7f2ebe4987f4376912fd7d7e638148a3943dbc78",
"@prisma/prisma-schema-wasm": "6.4.0-28.integration-sql-nested-transactions-fba3682185fb5027c810216c59359fba8e1cdbb3",
"fs-extra": "11.1.1"

@@ -22,0 +22,0 @@ },

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