Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prisma-generator-accel-record

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prisma-generator-accel-record - npm Package Compare versions

Comparing version 1.10.1 to 1.11.0

34

dist/generators/type.js

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

export interface ${model.persistedModel} extends ${model.baseModel} {${columnForPersist(model)}};
type ${model.associationKey} = ${associationKey(model)};
type ${model.collection}<T extends ${model.baseModel}> = Collection<T, ${model.meta}> | Collection<${model.persistedModel}, ${model.meta}>;

@@ -65,3 +66,4 @@ type ${model.meta} = {

Persisted: ${model.persistedModel};
AssociationKey: ${associationKey(model)};
AssociationKey: ${model.associationKey};
JoinInput: ${model.associationKey} | ${model.associationKey}[]${joinInputs(model)};
Column: {${columnMeta(model)}};

@@ -186,19 +188,25 @@ CreateInput: {${createInputs(model)}}${associationColumns};

const whereInputs = (model) => model.fields
.filter((field) => {
var _a, _b;
return field.relationName == undefined ||
((_b = (_a = field.relationFromFields) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
})
.filter((field) => field.type != "Json")
.map((field) => {
const type = field.typeName;
const filter = getFilterType(type);
if (field.relationName) {
if (field.name == "posts")
console.log(field);
return `\n ${field.name}?: ${field.type} | ${field.type}[];`;
var _a, _b;
if (!field.relationName) {
const type = field.typeName;
const filter = getFilterType(type);
return `\n ${field.name}?: ${type} | ${type}[] | ${filter} | null;`;
}
return `\n ${field.name}?: ${type} | ${type}[] | ${filter} | null;`;
if (((_b = (_a = field.relationFromFields) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) == 0) {
return `\n ${field.name}?: ${field.model.meta}['WhereInput'];`;
}
return `\n ${field.name}?: ${field.type} | ${field.type}[] | ${field.model.meta}['WhereInput'];`;
})
.join("") + "\n ";
const joinInputs = (model) => {
const fields = model.fields.filter((field) => field.relationName);
if (fields.length == 0)
return "";
const types = fields
.map((f) => `\n ${f.name}?: Meta<${f.model.persistedModel}>['JoinInput'];`)
.join("");
return ` | {${types}\n }`;
};
//# sourceMappingURL=type.js.map

@@ -74,2 +74,5 @@ "use strict";

}
get associationKey() {
return `${this.model.name}AssociationKey`;
}
get fileName() {

@@ -76,0 +79,0 @@ return (0, _1.toCamelCase)(this.model.name);

{
"name": "prisma-generator-accel-record",
"version": "1.10.1",
"version": "1.11.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/generator.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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