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

@paljs/nexus

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paljs/nexus - npm Package Compare versions

Comparing version 2.9.1 to 2.10.0

2

dist/admin.d.ts

@@ -1,2 +0,2 @@

import { NexusAcceptedTypeDef } from '@nexus/schema/dist/builder';
import { NexusAcceptedTypeDef } from 'nexus/dist/builder';
export declare function adminNexusSchemaSettings(path?: string): NexusAcceptedTypeDef[];
import { Settings } from './settings';
export { Settings };
export declare const paljs: (settings?: Settings | undefined) => import("@nexus/schema/dist/plugin").NexusPlugin;
export declare const paljs: (settings?: Settings | undefined) => import("nexus/dist/plugin").NexusPlugin;

@@ -8,3 +8,3 @@ 'use strict';

var plugins = require('@paljs/plugins');
var schema = require('@nexus/schema');
var nexus = require('nexus');
var client = require('@prisma/client');

@@ -24,7 +24,7 @@ var low = _interopDefault(require('lowdb'));

var db = low(adapter);
var nexusSchemaInputs = [schema.extendType({
var nexusSchemaInputs = [nexus.extendType({
type: 'Query',
definition: function definition(t) {
t.field('getSchema', {
type: schema.nonNull('Schema'),
type: nexus.nonNull('Schema'),
resolve: function () {

@@ -39,11 +39,11 @@ try {

}
}), schema.extendType({
}), nexus.extendType({
type: 'Mutation',
definition: function definition(t) {
t.field('updateField', {
type: schema.nonNull('Field'),
type: nexus.nonNull('Field'),
args: {
id: schema.nonNull(schema.stringArg()),
modelId: schema.nonNull(schema.stringArg()),
data: schema.nonNull('UpdateFieldInput')
id: nexus.nonNull(nexus.stringArg()),
modelId: nexus.nonNull(nexus.stringArg()),
data: nexus.nonNull('UpdateFieldInput')
},

@@ -67,6 +67,6 @@ resolve: function (_, _ref) {

t.field('updateModel', {
type: schema.nonNull('Model'),
type: nexus.nonNull('Model'),
args: {
id: schema.nonNull(schema.stringArg()),
data: schema.nonNull('UpdateModelInput')
id: nexus.nonNull(nexus.stringArg()),
data: nexus.nonNull('UpdateModelInput')
},

@@ -87,3 +87,3 @@ resolve: function (_, _ref2) {

}
}), schema.objectType({
}), nexus.objectType({
nonNullDefaults: {

@@ -97,3 +97,3 @@ output: true

}
}), schema.objectType({
}), nexus.objectType({
nonNullDefaults: {

@@ -111,3 +111,3 @@ output: true

}
}), schema.objectType({
}), nexus.objectType({
nonNullDefaults: {

@@ -129,3 +129,3 @@ output: true

}
}), schema.objectType({
}), nexus.objectType({
nonNullDefaults: {

@@ -157,6 +157,6 @@ output: true

}
}), schema.enumType({
}), nexus.enumType({
name: 'KindEnum',
members: ['object', 'enum', 'scalar']
}), schema.inputObjectType({
}), nexus.inputObjectType({
nonNullDefaults: {

@@ -177,3 +177,3 @@ input: false

}
}), schema.inputObjectType({
}), nexus.inputObjectType({
nonNullDefaults: {

@@ -213,3 +213,3 @@ input: false

var paljs = function paljs(settings) {
return schema.plugin({
return nexus.plugin({
name: 'paljs',

@@ -221,3 +221,3 @@ description: 'paljs plugin to add Prisma select to your resolver and prisma admin queries and mutations and all models input types',

var data = (settings === null || settings === void 0 ? void 0 : (_settings$dmmf = settings.dmmf) === null || _settings$dmmf === void 0 ? void 0 : _settings$dmmf.schema) || (client.dmmf === null || client.dmmf === void 0 ? void 0 : client.dmmf.schema);
var nexusSchemaInputs = [schema.objectType({
var nexusSchemaInputs = [nexus.objectType({
name: 'BatchPayload',

@@ -227,3 +227,3 @@ definition: function definition(t) {

}
}), schema.scalarType({
}), nexus.scalarType({
name: 'Json',

@@ -236,3 +236,3 @@ asNexusMethod: 'json',

})];
nexusSchemaInputs.push(schema.scalarType({
nexusSchemaInputs.push(nexus.scalarType({
name: 'DateTime',

@@ -256,3 +256,3 @@ asNexusMethod: 'date',

enums.forEach(function (item) {
nexusSchemaInputs.push(schema.enumType({
nexusSchemaInputs.push(nexus.enumType({
name: item.name,

@@ -266,3 +266,3 @@ members: item.values

if (input.fields.length > 0) {
nexusSchemaInputs.push(schema.inputObjectType({
nexusSchemaInputs.push(nexus.inputObjectType({
nonNullDefaults: {

@@ -298,3 +298,3 @@ input: false

}).forEach(function (type) {
nexusSchemaInputs.push(schema.objectType({
nexusSchemaInputs.push(nexus.objectType({
nonNullDefaults: {

@@ -301,0 +301,0 @@ output: true

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("@paljs/plugins"),t=require("@nexus/schema"),i=require("@prisma/client"),l=e(require("lowdb")),o=e(require("lowdb/adapters/FileSync")),a=require("fs"),u=require("path");exports.paljs=function(e){return t.plugin({name:"paljs",description:"paljs plugin to add Prisma select to your resolver and prisma admin queries and mutations and all models input types",onInstall:function(r){var s,d=(null==e||null===(s=e.dmmf)||void 0===s?void 0:s.schema)||(null==i.dmmf?void 0:i.dmmf.schema),p=[t.objectType({name:"BatchPayload",definition:function(e){e.nonNull.int("count")}}),t.scalarType({name:"Json",asNexusMethod:"json",description:"Json custom scalar type",serialize:function(e){return e}})];if(p.push(t.scalarType({name:"DateTime",asNexusMethod:"date",description:"Date custom scalar type",parseValue:function(e){return e?new Date(e):null},serialize:function(e){return e?new Date(e):null},parseLiteral:function(e){return e.value?new Date(e.value):null}})),d){var c=[].concat(d.enumTypes.prisma);d.enumTypes.model&&c.push.apply(c,d.enumTypes.model),c.forEach((function(e){p.push(t.enumType({name:e.name,members:e.values}))}));var f=[].concat(d.inputObjectTypes.prisma);d.inputObjectTypes.model&&f.push.apply(f,d.inputObjectTypes.model),f.forEach((function(i){i.fields.length>0&&p.push(t.inputObjectType({nonNullDefaults:{input:!1},name:i.name,definition:function(t){i.fields.forEach((function(i){var l=n.getInputType(i,e);if("inputObjectTypes"!==l.location||!n.hasEmptyTypeFields(l.type)){var o={type:l.type};i.isRequired?t.nonNull.field(i.name,o):l.isList?t.list.field(i.name,o):t.field(i.name,o)}}))}}))})),d.outputObjectTypes.prisma.filter((function(e){return e.name.includes("Aggregate")})).forEach((function(e){p.push(t.objectType({nonNullDefaults:{output:!0},name:e.name,definition:function(n){e.fields.forEach((function(e){var t={type:e.outputType.type};e.isRequired?e.outputType.isList?n.list.field(e.name,t):n.field(e.name,t):n.nullable.field(e.name,t)}))}}))}))}(null==e?void 0:e.includeAdmin)&&p.push.apply(p,function(e){if(void 0===e&&(e="adminSettings.json"),a.existsSync(u.join(process.cwd(),e))){var n=new o(e),i=l(n);return[t.extendType({type:"Query",definition:function(e){e.field("getSchema",{type:t.nonNull("Schema"),resolve:function(){try{return Promise.resolve(i.value())}catch(e){return Promise.reject(e)}}})}}),t.extendType({type:"Mutation",definition:function(e){e.field("updateField",{type:t.nonNull("Field"),args:{id:t.nonNull(t.stringArg()),modelId:t.nonNull(t.stringArg()),data:t.nonNull("UpdateFieldInput")},resolve:function(e,n){var t=n.id,l=n.modelId,o=n.data;try{return Promise.resolve(i.get("models").find({id:l}).get("fields").find({id:t}).assign(o).write())}catch(e){return Promise.reject(e)}}}),e.field("updateModel",{type:t.nonNull("Model"),args:{id:t.nonNull(t.stringArg()),data:t.nonNull("UpdateModelInput")},resolve:function(e,n){var t=n.id,l=n.data;try{return Promise.resolve(i.get("models").find({id:t}).assign(l).write())}catch(e){return Promise.reject(e)}}})}}),t.objectType({nonNullDefaults:{output:!0},name:"Enum",definition:function(e){e.string("name"),e.list.string("fields")}}),t.objectType({nonNullDefaults:{output:!0},name:"Schema",definition:function(e){e.list.field("models",{type:"Model"}),e.list.field("enums",{type:"Enum"})}}),t.objectType({nonNullDefaults:{output:!0},name:"Model",definition:function(e){e.string("id"),e.string("name"),e.string("idField"),e.list.string("displayFields"),e.boolean("create"),e.boolean("update"),e.boolean("delete"),e.list.field("fields",{type:"Field"})}}),t.objectType({nonNullDefaults:{output:!0},name:"Field",definition:function(e){e.string("id"),e.string("name"),e.string("title"),e.string("type"),e.boolean("list"),e.boolean("required"),e.boolean("isId"),e.boolean("unique"),e.boolean("create"),e.boolean("update"),e.boolean("read"),e.boolean("filter"),e.boolean("sort"),e.boolean("editor"),e.boolean("upload"),e.nullable.boolean("relationField"),e.int("order"),e.field("kind",{type:"KindEnum"})}}),t.enumType({name:"KindEnum",members:["object","enum","scalar"]}),t.inputObjectType({nonNullDefaults:{input:!1},name:"UpdateModelInput",definition:function(e){e.string("name"),e.string("idField"),e.list.string("displayFields"),e.boolean("create"),e.boolean("update"),e.boolean("delete"),e.list.field("fields",{type:"UpdateFieldInput"})}}),t.inputObjectType({nonNullDefaults:{input:!1},name:"UpdateFieldInput",definition:function(e){e.string("id"),e.string("name"),e.string("title"),e.string("type"),e.boolean("list"),e.boolean("required"),e.boolean("isId"),e.boolean("unique"),e.boolean("create"),e.boolean("update"),e.boolean("read"),e.boolean("filter"),e.boolean("sort"),e.boolean("editor"),e.boolean("upload"),e.nullable.boolean("relationField"),e.int("order"),e.field("kind",{type:"KindEnum"})}})]}return[]}(null==e?void 0:e.adminSchemaPath));for(var m=0,y=p;m<y.length;m++)r.addType(y[m])},onCreateFieldResolver:function(){return function(t,i,l,o,a){try{return l.select=new n.PrismaSelect(o,null==e?void 0:e.prismaSelectOptions).value,Promise.resolve(a(t,i,l,o))}catch(e){return Promise.reject(e)}}}})};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("@paljs/plugins"),t=require("nexus"),i=require("@prisma/client"),l=e(require("lowdb")),o=e(require("lowdb/adapters/FileSync")),a=require("fs"),u=require("path");exports.paljs=function(e){return t.plugin({name:"paljs",description:"paljs plugin to add Prisma select to your resolver and prisma admin queries and mutations and all models input types",onInstall:function(r){var s,d=(null==e||null===(s=e.dmmf)||void 0===s?void 0:s.schema)||(null==i.dmmf?void 0:i.dmmf.schema),p=[t.objectType({name:"BatchPayload",definition:function(e){e.nonNull.int("count")}}),t.scalarType({name:"Json",asNexusMethod:"json",description:"Json custom scalar type",serialize:function(e){return e}})];if(p.push(t.scalarType({name:"DateTime",asNexusMethod:"date",description:"Date custom scalar type",parseValue:function(e){return e?new Date(e):null},serialize:function(e){return e?new Date(e):null},parseLiteral:function(e){return e.value?new Date(e.value):null}})),d){var c=[].concat(d.enumTypes.prisma);d.enumTypes.model&&c.push.apply(c,d.enumTypes.model),c.forEach((function(e){p.push(t.enumType({name:e.name,members:e.values}))}));var f=[].concat(d.inputObjectTypes.prisma);d.inputObjectTypes.model&&f.push.apply(f,d.inputObjectTypes.model),f.forEach((function(i){i.fields.length>0&&p.push(t.inputObjectType({nonNullDefaults:{input:!1},name:i.name,definition:function(t){i.fields.forEach((function(i){var l=n.getInputType(i,e);if("inputObjectTypes"!==l.location||!n.hasEmptyTypeFields(l.type)){var o={type:l.type};i.isRequired?t.nonNull.field(i.name,o):l.isList?t.list.field(i.name,o):t.field(i.name,o)}}))}}))})),d.outputObjectTypes.prisma.filter((function(e){return e.name.includes("Aggregate")})).forEach((function(e){p.push(t.objectType({nonNullDefaults:{output:!0},name:e.name,definition:function(n){e.fields.forEach((function(e){var t={type:e.outputType.type};e.isRequired?e.outputType.isList?n.list.field(e.name,t):n.field(e.name,t):n.nullable.field(e.name,t)}))}}))}))}(null==e?void 0:e.includeAdmin)&&p.push.apply(p,function(e){if(void 0===e&&(e="adminSettings.json"),a.existsSync(u.join(process.cwd(),e))){var n=new o(e),i=l(n);return[t.extendType({type:"Query",definition:function(e){e.field("getSchema",{type:t.nonNull("Schema"),resolve:function(){try{return Promise.resolve(i.value())}catch(e){return Promise.reject(e)}}})}}),t.extendType({type:"Mutation",definition:function(e){e.field("updateField",{type:t.nonNull("Field"),args:{id:t.nonNull(t.stringArg()),modelId:t.nonNull(t.stringArg()),data:t.nonNull("UpdateFieldInput")},resolve:function(e,n){var t=n.id,l=n.modelId,o=n.data;try{return Promise.resolve(i.get("models").find({id:l}).get("fields").find({id:t}).assign(o).write())}catch(e){return Promise.reject(e)}}}),e.field("updateModel",{type:t.nonNull("Model"),args:{id:t.nonNull(t.stringArg()),data:t.nonNull("UpdateModelInput")},resolve:function(e,n){var t=n.id,l=n.data;try{return Promise.resolve(i.get("models").find({id:t}).assign(l).write())}catch(e){return Promise.reject(e)}}})}}),t.objectType({nonNullDefaults:{output:!0},name:"Enum",definition:function(e){e.string("name"),e.list.string("fields")}}),t.objectType({nonNullDefaults:{output:!0},name:"Schema",definition:function(e){e.list.field("models",{type:"Model"}),e.list.field("enums",{type:"Enum"})}}),t.objectType({nonNullDefaults:{output:!0},name:"Model",definition:function(e){e.string("id"),e.string("name"),e.string("idField"),e.list.string("displayFields"),e.boolean("create"),e.boolean("update"),e.boolean("delete"),e.list.field("fields",{type:"Field"})}}),t.objectType({nonNullDefaults:{output:!0},name:"Field",definition:function(e){e.string("id"),e.string("name"),e.string("title"),e.string("type"),e.boolean("list"),e.boolean("required"),e.boolean("isId"),e.boolean("unique"),e.boolean("create"),e.boolean("update"),e.boolean("read"),e.boolean("filter"),e.boolean("sort"),e.boolean("editor"),e.boolean("upload"),e.nullable.boolean("relationField"),e.int("order"),e.field("kind",{type:"KindEnum"})}}),t.enumType({name:"KindEnum",members:["object","enum","scalar"]}),t.inputObjectType({nonNullDefaults:{input:!1},name:"UpdateModelInput",definition:function(e){e.string("name"),e.string("idField"),e.list.string("displayFields"),e.boolean("create"),e.boolean("update"),e.boolean("delete"),e.list.field("fields",{type:"UpdateFieldInput"})}}),t.inputObjectType({nonNullDefaults:{input:!1},name:"UpdateFieldInput",definition:function(e){e.string("id"),e.string("name"),e.string("title"),e.string("type"),e.boolean("list"),e.boolean("required"),e.boolean("isId"),e.boolean("unique"),e.boolean("create"),e.boolean("update"),e.boolean("read"),e.boolean("filter"),e.boolean("sort"),e.boolean("editor"),e.boolean("upload"),e.nullable.boolean("relationField"),e.int("order"),e.field("kind",{type:"KindEnum"})}})]}return[]}(null==e?void 0:e.adminSchemaPath));for(var m=0,y=p;m<y.length;m++)r.addType(y[m])},onCreateFieldResolver:function(){return function(t,i,l,o,a){try{return l.select=new n.PrismaSelect(o,null==e?void 0:e.prismaSelectOptions).value,Promise.resolve(a(t,i,l,o))}catch(e){return Promise.reject(e)}}}})};
//# sourceMappingURL=nexus.cjs.production.min.js.map
import { getInputType, hasEmptyTypeFields, PrismaSelect } from '@paljs/plugins';
import { extendType, nonNull, stringArg, objectType, enumType, inputObjectType, plugin, scalarType } from '@nexus/schema';
import { extendType, nonNull, stringArg, objectType, enumType, inputObjectType, plugin, scalarType } from 'nexus';
import { dmmf } from '@prisma/client';

@@ -4,0 +4,0 @@ import low from 'lowdb';

{
"name": "@paljs/nexus",
"version": "2.9.1",
"version": "2.10.0",
"main": "dist/index.js",

@@ -32,5 +32,5 @@ "module": "dist/nexus.esm.js",

"devDependencies": {
"@nexus/schema": "0.19.2",
"@prisma/client": "2.13.0",
"@types/lowdb": "1.0.9",
"nexus": "1.0.0",
"typescript": "4.1.2"

@@ -41,3 +41,3 @@ },

],
"gitHead": "f6065f8bf727559e74504c480fe779228b5c3e3a"
"gitHead": "061e8b6a765b11f23a2f36a2db3c9db4743a5e69"
}

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