You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

graphile-build-pg

Package Overview
Dependencies
Maintainers
1
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0-beta.2 to 4.0.0-beta.4

node8plus/omit.js

19

node8plus/GraphQLJSON.js

@@ -8,6 +8,2 @@ "use strict";

var _create = require("babel-runtime/core-js/object/create");
var _create2 = _interopRequireDefault(_create);
var _graphql = require("graphql");

@@ -17,4 +13,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// This file is based on

@@ -53,3 +47,3 @@ // https://github.com/taion/graphql-type-json/blob/6e45ae4ee0a60f8f3565c8c980a82c7d9b98d3f5/src/index.js

function parseLiteral(ast) {
function parseLiteral(ast, variables) {
switch (ast.kind) {

@@ -64,5 +58,5 @@ case _language.Kind.STRING:

{
const value = (0, _create2.default)(null);
const value = Object.create(null);
ast.fields.forEach(field => {
value[field.name.value] = parseLiteral(field.value);
value[field.name.value] = parseLiteral(field.value, variables);
});

@@ -73,5 +67,10 @@

case _language.Kind.LIST:
return ast.values.map(parseLiteral);
return ast.values.map(n => parseLiteral(n, variables));
case _language.Kind.NULL:
return null;
case _language.Kind.VARIABLE:
{
const name = ast.name.value;
return variables ? variables[name] : undefined;
}
default:

@@ -78,0 +77,0 @@ return undefined;

@@ -6,5 +6,5 @@ "use strict";

});
exports.constantCase = exports.camelCase = exports.upperFirst = exports.PgMutationPayloadEdgePlugin = exports.PgMutationProceduresPlugin = exports.PgMutationUpdateDeletePlugin = exports.PgMutationCreatePlugin = exports.PgConnectionTotalCount = exports.PageInfoStartEndCursor = exports.PgScalarFunctionConnectionPlugin = exports.PgNodeAliasPostGraphQL = exports.PgNodeAliasPostGraphile = exports.PgRowNode = exports.PgOrderByPrimaryKeyPlugin = exports.PgOrderAllColumnsPlugin = exports.PgQueryProceduresPlugin = exports.PgComputedColumnsPlugin = exports.PgRowByUniqueConstraint = exports.PgBackwardRelationPlugin = exports.PgForwardRelationPlugin = exports.PgColumnDeprecationPlugin = exports.PgColumnsPlugin = exports.PgAllRows = exports.PgConnectionArgCondition = exports.PgConnectionArgOrderByDefaultValue = exports.PgConnectionArgOrderBy = exports.PgConnectionArgFirstLastBeforeAfter = exports.PgTablesPlugin = exports.PgJWTPlugin = exports.PgTypesPlugin = exports.PgIntrospectionPlugin = exports.PgBasicsPlugin = exports.inflections = exports.defaultPlugins = undefined;
exports.constantCase = exports.camelCase = exports.upperFirst = exports.PgMutationPayloadEdgePlugin = exports.PgMutationProceduresPlugin = exports.PgMutationUpdateDeletePlugin = exports.PgMutationCreatePlugin = exports.PgConnectionTotalCount = exports.PageInfoStartEndCursor = exports.PgScalarFunctionConnectionPlugin = exports.PgNodeAliasPostGraphQL = exports.PgNodeAliasPostGraphile = exports.PgRowNode = exports.PgOrderByPrimaryKeyPlugin = exports.PgOrderAllColumnsPlugin = exports.PgQueryProceduresPlugin = exports.PgComputedColumnsPlugin = exports.PgRowByUniqueConstraint = exports.PgBackwardRelationPlugin = exports.PgForwardRelationPlugin = exports.PgColumnDeprecationPlugin = exports.PgColumnsPlugin = exports.PgAllRows = exports.PgConnectionArgCondition = exports.PgConnectionArgOrderByDefaultValue = exports.PgConnectionArgOrderBy = exports.PgConnectionArgFirstLastBeforeAfter = exports.PgTablesPlugin = exports.PgJWTPlugin = exports.PgTypesPlugin = exports.PgIntrospectionPlugin = exports.PgBasicsPlugin = exports.inflections = exports.defaultPlugins = exports.omit = exports.parseIdentifier = undefined;
var _utils = require("./utils");
var _graphileBuild = require("graphile-build");

@@ -14,3 +14,3 @@ Object.defineProperty(exports, "upperFirst", {

get: function () {
return _utils.upperFirst;
return _graphileBuild.upperFirst;
}

@@ -21,3 +21,3 @@ });

get: function () {
return _utils.camelCase;
return _graphileBuild.camelCase;
}

@@ -28,3 +28,3 @@ });

get: function () {
return _utils.constantCase;
return _graphileBuild.constantCase;
}

@@ -149,2 +149,10 @@ });

var _parseIdentifier = require("./parseIdentifier");
var _parseIdentifier2 = _interopRequireDefault(_parseIdentifier);
var _omit = require("./omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -154,2 +162,7 @@

exports.parseIdentifier = _parseIdentifier2.default;
exports.omit = _omit2.default;
// Mutations
const defaultPlugins = exports.defaultPlugins = [_PgBasicsPlugin2.default, _PgIntrospectionPlugin2.default, _PgTypesPlugin2.default, _PgJWTPlugin2.default, _PgTablesPlugin2.default, _PgConnectionArgFirstLastBeforeAfter2.default, _PgConnectionArgOrderBy2.default, _PgConnectionArgOrderByDefaultValue2.default, _PgConnectionArgCondition2.default, _PgAllRows2.default, _PgColumnsPlugin2.default, _PgColumnDeprecationPlugin2.default, _PgForwardRelationPlugin2.default, _PgBackwardRelationPlugin2.default, _PgRowByUniqueConstraint2.default, _PgComputedColumnsPlugin2.default, _PgQueryProceduresPlugin2.default, _PgOrderAllColumnsPlugin2.default, _PgOrderByPrimaryKeyPlugin2.default, _PgRowNode2.default, _PgNodeAliasPostGraphile2.default, _PgScalarFunctionConnectionPlugin2.default, // For PostGraphile compatibility

@@ -162,4 +175,2 @@ _PageInfoStartEndCursor2.default, // For PostGraphile compatibility

// Mutations
exports.inflections = inflections;

@@ -166,0 +177,0 @@ exports.PgBasicsPlugin = _PgBasicsPlugin2.default;

@@ -8,41 +8,14 @@ "use strict";

var _assign = require("babel-runtime/core-js/object/assign");
var _graphileBuild = require("graphile-build");
var _assign2 = _interopRequireDefault(_assign);
var _PgBasicsPlugin = require("./plugins/PgBasicsPlugin");
var _keys = require("babel-runtime/core-js/object/keys");
var _keys2 = _interopRequireDefault(_keys);
var _pluralize = require("pluralize");
var _pluralize2 = _interopRequireDefault(_pluralize);
var _utils = require("./utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const defaultUtils = exports.defaultUtils = {
constantCase: _utils.constantCase,
camelCase: _utils.camelCase,
upperCamelCase: _utils.upperCamelCase,
pluralize: _pluralize2.default,
singularize: _pluralize2.default.singular
constantCase: _graphileBuild.constantCase,
camelCase: _graphileBuild.camelCase,
upperCamelCase: _graphileBuild.upperCamelCase,
pluralize: _graphileBuild.pluralize,
singularize: _graphileBuild.singularize
};
function preventEmptyResult(obj) {
return (0, _keys2.default)(obj).reduce((memo, key) => {
const fn = obj[key];
memo[key] = (...args) => {
const result = fn.apply(memo, args);
if (typeof result !== "string" || result.length === 0) {
const stringifiedArgs = require("util").inspect(args);
throw new Error(`Inflector for '${key}' returned '${String(result)}'; expected non-empty string\n` + `See: https://github.com/graphile/graphile-build/blob/master/packages/graphile-build-pg/src/inflections.js\n` + `Arguments passed to ${key}:\n${stringifiedArgs}`);
}
return result;
};
return memo;
}, {});
}
const newInflector = exports.newInflector = (overrides = undefined, {

@@ -59,3 +32,3 @@ constantCase,

return preventEmptyResult((0, _assign2.default)({
return (0, _PgBasicsPlugin.preventEmptyResult)(Object.assign({
pluralize,

@@ -62,0 +35,0 @@ argument(name, index) {

@@ -7,12 +7,2 @@ "use strict";

var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
var _stringify = require("babel-runtime/core-js/json/stringify");
var _stringify2 = _interopRequireDefault(_stringify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const base64 = str => new Buffer(String(str)).toString("base64");

@@ -22,3 +12,3 @@

function cursorify(val) {
return val && val.__cursor ? base64((0, _stringify2.default)(val.__cursor)) : val;
return val && val.__cursor ? base64(JSON.stringify(val.__cursor)) : val;
}

@@ -30,3 +20,3 @@

const endCursor = cursorify(data && data[value.data.length - 1]);
return (0, _assign2.default)({}, value, {
return Object.assign({}, value, {
startCursor,

@@ -33,0 +23,0 @@ endCursor

@@ -6,11 +6,2 @@ "use strict";

});
var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
exports.default = makeProcField;

@@ -22,10 +13,2 @@

var _camelCase = require("lodash/camelCase");
var _camelCase2 = _interopRequireDefault(_camelCase);
var _pluralize = require("pluralize");
var _pluralize2 = _interopRequireDefault(_pluralize);
var _queryFromResolveData = require("../queryFromResolveData");

@@ -65,3 +48,2 @@

newWithHooks,
pgInflection: inflection,
pgStrictFunctions: strictFunctions,

@@ -80,3 +62,4 @@ pgTweakFragmentForType,

isCompositeType
}
},
inflection
}, {

@@ -87,3 +70,7 @@ fieldWithHooks,

}) {
function getResultFieldName(gqlType, type, returnsSet) {
const { pluralize, camelCase } = inflection;
function getResultFieldName(proc, gqlType, type, returnsSet) {
if (proc.tags.resultFieldName) {
return proc.tags.resultFieldName;
}
const gqlNamedType = getNamedType(gqlType);

@@ -100,5 +87,5 @@ let name;

} else {
name = (0, _camelCase2.default)(gqlNamedType.name);
name = camelCase(gqlNamedType.name);
}
return returnsSet || type.isPgArray ? (0, _pluralize2.default)(name) : name;
return returnsSet || type.isPgArray ? pluralize(name) : name;
}

@@ -162,3 +149,3 @@ if (computed && isMutation) {

if (proc.returnsSet) {
const connectionTypeName = inflection.scalarFunctionConnection(proc.name, proc.namespace.name);
const connectionTypeName = inflection.scalarFunctionConnection(proc);
const ConnectionType = getTypeByName(connectionTypeName);

@@ -250,3 +237,3 @@ if (ConnectionType) {

const parentTableAlias = queryBuilder.getTableAlias();
const functionAlias = sql.identifier((0, _symbol2.default)());
const functionAlias = sql.identifier(Symbol());
const sqlMutationQuery = makeMutationCall(parsedResolveInfoFragment, ReturnType, {

@@ -273,8 +260,8 @@ implicitArgs: [parentTableAlias]

if (isMutation) {
const resultFieldName = getResultFieldName(type, rawReturnType, proc.returnsSet);
const resultFieldName = getResultFieldName(proc, type, rawReturnType, proc.returnsSet);
const isNotVoid = String(returnType.id) !== "2278";
// If set then plural name
PayloadType = newWithHooks(GraphQLObjectType, {
name: inflection.functionPayloadType(proc.name, proc.namespace.name),
description: `The output of our \`${inflection.functionName(proc.name, proc.namespace.name)}\` mutation.`,
name: inflection.functionPayloadType(proc),
description: `The output of our \`${inflection.functionMutationName(proc)}\` mutation.`,
fields: ({ recurseDataGeneratorsForField }) => {

@@ -284,3 +271,3 @@ if (isNotVoid) {

}
return (0, _assign2.default)({}, {
return Object.assign({}, {
clientMutationId: {

@@ -299,3 +286,3 @@ type: GraphQLString

}
}, (0, _assign2.default)({}, {
}, Object.assign({}, {
isMutationPayload: true

@@ -305,5 +292,5 @@ }, payloadTypeScope));

const InputType = newWithHooks(GraphQLInputObjectType, {
name: inflection.functionInputType(proc.name, proc.namespace.name),
description: `All input for the \`${inflection.functionName(proc.name, proc.namespace.name)}\` mutation.`,
fields: (0, _assign2.default)({
name: inflection.functionInputType(proc),
description: `All input for the \`${inflection.functionMutationName(proc)}\` mutation.`,
fields: Object.assign({
clientMutationId: {

@@ -345,3 +332,3 @@ type: GraphQLString

const parsedResolveInfoFragment = parseResolveInfo(resolveInfo);
const functionAlias = sql.identifier((0, _symbol2.default)());
const functionAlias = sql.identifier(Symbol());
const sqlMutationQuery = makeMutationCall(parsedResolveInfoFragment, resolveInfo.returnType, {});

@@ -353,3 +340,3 @@

const returnType = rawReturnType;
const intermediateIdentifier = sql.identifier((0, _symbol2.default)());
const intermediateIdentifier = sql.identifier(Symbol());
const isVoid = returnType.id === "2278";

@@ -356,0 +343,0 @@ const isPgClass = !returnFirstValueAsValue || returnTypeTable || false;

@@ -19,2 +19,6 @@ "use strict";

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -24,3 +28,3 @@

exports.default = async function PgAllRows(builder, { pgInflection: inflection, pgViewUniqueKey: viewUniqueKey }) {
exports.default = async function PgAllRows(builder, { pgViewUniqueKey: viewUniqueKey }) {
builder.hook("GraphQLObjectType:fields", (fields, {

@@ -32,3 +36,4 @@ parseResolveInfo,

pgSql: sql,
pgIntrospectionResultsByKind: introspectionResultsByKind
pgIntrospectionResultsByKind: introspectionResultsByKind,
inflection
}, { fieldWithHooks, scope: { isRootQuery } }) => {

@@ -39,2 +44,5 @@ if (!isRootQuery) {

return extend(fields, introspectionResultsByKind.class.filter(table => table.isSelectable).filter(table => table.namespace).reduce((memo, table) => {
if ((0, _omit2.default)(table, "all")) {
return memo;
}
const TableType = pgGetGqlTypeByTypeId(table.type.id);

@@ -57,3 +65,3 @@ const tableTypeName = TableType.name;

if (TableType && ConnectionType) {
const fieldName = inflection.allRows(table.name, schema.name);
const fieldName = inflection.allRows(table);
memo[fieldName] = fieldWithHooks(fieldName, ({ getDataFromParsedResolveInfoFragment }) => {

@@ -60,0 +68,0 @@ return {

@@ -7,6 +7,2 @@ "use strict";

var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _debug = require("debug");

@@ -24,2 +20,6 @@

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -29,3 +29,2 @@

const OMIT = 0;

@@ -35,3 +34,3 @@ const DEPRECATED = 1;

exports.default = function PgBackwardRelationPlugin(builder, { pgInflection: inflection, pgLegacyRelations }) {
exports.default = function PgBackwardRelationPlugin(builder, { pgLegacyRelations }) {
const legacyRelationMode = {

@@ -48,3 +47,4 @@ only: ONLY,

getAliasFromResolveInfo,
graphql: { GraphQLNonNull }
graphql: { GraphQLNonNull },
inflection
}, {

@@ -63,4 +63,7 @@ scope: { isPgRowType, pgIntrospection: foreignTable },

return extend(fields, foreignKeyConstraints.reduce((memo, constraint) => {
if ((0, _omit2.default)(constraint, "read")) {
return memo;
}
const table = introspectionResultsByKind.classById[constraint.classId];
const tableTypeName = inflection.tableType(table.name, table.namespace.name);
const tableTypeName = inflection.tableType(table);
const gqlTableType = pgGetGqlTypeByTypeId(table.type.id);

@@ -72,3 +75,3 @@ if (!gqlTableType) {

const foreignTable = introspectionResultsByKind.classById[constraint.foreignClassId];
const foreignTableTypeName = inflection.tableType(foreignTable.name, foreignTable.namespace.name);
const foreignTableTypeName = inflection.tableType(foreignTable);
const gqlForeignTableType = pgGetGqlTypeByTypeId(foreignTable.type.id);

@@ -91,2 +94,8 @@ if (!gqlForeignTableType) {

}
if (keys.some(key => (0, _omit2.default)(key, "read"))) {
return memo;
}
if (foreignKeys.some(key => (0, _omit2.default)(key, "read"))) {
return memo;
}
const singleKey = keys.length === 1 ? keys[0] : null;

@@ -97,9 +106,4 @@ const isUnique = !!(singleKey && introspectionResultsByKind.constraint.find(c => c.classId === singleKey.classId && c.keyAttributeNums.length === 1 && c.keyAttributeNums[0] === singleKey.num && (c.type === "p" || c.type === "u")));

const simpleKeys = keys.map(k => ({
column: k.name,
table: k.class.name,
schema: k.class.namespace.name
}));
const manyRelationFieldName = inflection.manyRelationByKeys(simpleKeys, table.name, table.namespace.name, foreignTable.name, foreignTable.namespace.name);
const singleRelationFieldName = isUnique ? inflection.singleRelationByKeys(simpleKeys, table.name, table.namespace.name, foreignTable.name, foreignTable.namespace.name) : null;
const manyRelationFieldName = inflection.manyRelationByKeys(keys, table, foreignTable, constraint);
const singleRelationFieldName = isUnique ? inflection.singleRelationByKeys(keys, table, foreignTable, constraint) : null;

@@ -113,3 +117,3 @@ const primaryKeyConstraint = introspectionResultsByKind.constraint.filter(con => con.classId === table.id).filter(con => con.type === "p")[0];

if (shouldAddSingleRelation) {
if (shouldAddSingleRelation && !(0, _omit2.default)(table, "read")) {
memo[singleRelationFieldName] = fieldWithHooks(singleRelationFieldName, ({ getDataFromParsedResolveInfoFragment, addDataGenerator }) => {

@@ -121,3 +125,3 @@ addDataGenerator(parsedResolveInfoFragment => {

const resolveData = getDataFromParsedResolveInfoFragment(parsedResolveInfoFragment, gqlTableType);
const tableAlias = sql.identifier((0, _symbol2.default)());
const tableAlias = sql.identifier(Symbol());
const foreignTableAlias = queryBuilder.getTableAlias();

@@ -151,3 +155,3 @@ const query = (0, _queryFromResolveData2.default)(sql.identifier(schema.name, table.name), tableAlias, resolveData, {

}
if (shouldAddManyRelation) {
if (shouldAddManyRelation && !(0, _omit2.default)(table, "many")) {
memo[manyRelationFieldName] = fieldWithHooks(manyRelationFieldName, ({ getDataFromParsedResolveInfoFragment, addDataGenerator }) => {

@@ -159,3 +163,3 @@ addDataGenerator(parsedResolveInfoFragment => {

const resolveData = getDataFromParsedResolveInfoFragment(parsedResolveInfoFragment, ConnectionType);
const tableAlias = sql.identifier((0, _symbol2.default)());
const tableAlias = sql.identifier(Symbol());
const foreignTableAlias = queryBuilder.getTableAlias();

@@ -202,2 +206,3 @@ const query = (0, _queryFromResolveData2.default)(sql.identifier(schema.name, table.name), tableAlias, resolveData, {

isPgFieldConnection: true,
isPgBackwardRelationField: true,
pgFieldIntrospection: table

@@ -204,0 +209,0 @@ });

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

});
exports.preventEmptyResult = preventEmptyResult;

@@ -17,8 +18,18 @@ var _pgSql = require("pg-sql2");

const defaultPgColumnFilter = (_attr, _build, _context) => true;
function preventEmptyResult(obj) {
return Object.keys(obj).reduce((memo, key) => {
const fn = obj[key];
memo[key] = function (...args) {
const result = fn.apply(this, args);
if (typeof result !== "string" || result.length === 0) {
const stringifiedArgs = require("util").inspect(args);
throw new Error(`Inflector for '${key}' returned '${String(result)}'; expected non-empty string\n` + `See: https://github.com/graphile/graphile-build/blob/master/packages/graphile-build-pg/src/plugins/PgBasicsPlugin.js\n` + `Arguments passed to ${key}:\n${stringifiedArgs}`);
}
return result;
};
return memo;
}, {});
}
exports.default = function PgBasicsPlugin(builder, {
pgInflection,
pgStrictFunctions = false,
pgColumnFilter = defaultPgColumnFilter
}) {
exports.default = function PgBasicsPlugin(builder, { pgStrictFunctions = false, pgColumnFilter = defaultPgColumnFilter }) {
builder.hook("build", build => {

@@ -28,3 +39,2 @@ return build.extend(build, {

pgSql: _pgSql2.default,
pgInflection,
pgStrictFunctions,

@@ -34,3 +44,262 @@ pgColumnFilter

});
builder.hook("inflection", (inflection, build) => {
return build.extend(inflection, preventEmptyResult({
// These helpers are passed GraphQL type names as strings
conditionType(typeName) {
return this.upperCamelCase(`${typeName}-condition`);
},
inputType(typeName) {
return this.upperCamelCase(`${typeName}-input`);
},
rangeBoundType(typeName) {
return this.upperCamelCase(`${typeName}-range-bound`);
},
rangeType(typeName) {
return this.upperCamelCase(`${typeName}-range`);
},
patchType(typeName) {
return this.upperCamelCase(`${typeName}-patch`);
},
patchField(itemName) {
return this.camelCase(`${itemName}-patch`);
},
orderByType(typeName) {
return this.upperCamelCase(`${this.pluralize(typeName)}-order-by`);
},
edge(typeName) {
return this.upperCamelCase(`${this.pluralize(typeName)}-edge`);
},
connection(typeName) {
return this.upperCamelCase(`${this.pluralize(typeName)}-connection`);
},
// These helpers handle overrides via smart comments. They should only
// be used in other inflectors, hence the underscore prefix.
//
// IMPORTANT: do NOT do case transforms here, because detail can be
// lost, e.g.
// `constantCase(camelCase('foo_1')) !== constantCase('foo_1')`
_functionName(proc) {
return proc.tags.name || proc.name;
},
_typeName(type) {
// 'type' introspection result
return type.tags.name || type.name;
},
_tableName(table) {
return table.tags.name || table.type.tags.name || table.name;
},
_singularizedTableName(table) {
return this.singularize(this._tableName(table)).replace(/.(?:(?:[_-]i|I)nput|(?:[_-]p|P)atch)$/, "$&_record");
},
_columnName(attr, _options) {
return attr.tags.name || attr.name;
},
// From here down, functions are passed database introspection results
enumType(type) {
return this.upperCamelCase(this._typeName(type));
},
argument(name, index) {
return this.camelCase(name || `arg${index}`);
},
orderByColumnEnum(attr, ascending) {
const columnName = this._columnName(attr, {
skipRowId: true // Because we messed up 😔
});
return this.constantCase(`${columnName}_${ascending ? "asc" : "desc"}`);
},
domainType(type) {
return this.upperCamelCase(this._typeName(type));
},
enumName(inValue) {
let value = inValue;
if (value === "") {
return "_EMPTY_";
}
// Some enums use asterisks to signify wildcards - this might be for
// the whole item, or prefixes/suffixes, or even in the middle. This
// is provided on a best efforts basis, if it doesn't suit your
// purposes then please pass a custom inflector as mentioned below.
value = value.replace(/\*/g, "_ASTERISK_").replace(/^(_?)_+ASTERISK/, "$1ASTERISK").replace(/ASTERISK_(_?)_*$/, "ASTERISK$1");
// This is a best efforts replacement for common symbols that you
// might find in enums. Generally we only support enums that are
// alphanumeric, if these replacements don't work for you, you should
// pass a custom inflector that replaces this `enumName` method
// with one of your own chosing.
value = {
// SQL comparison operators
">": "GREATER_THAN",
">=": "GREATER_THAN_OR_EQUAL",
"=": "EQUAL",
"!=": "NOT_EQUAL",
"<>": "DIFFERENT",
"<=": "LESS_THAN_OR_EQUAL",
"<": "LESS_THAN",
// PostgreSQL LIKE shortcuts
"~~": "LIKE",
"~~*": "ILIKE",
"!~~": "NOT_LIKE",
"!~~*": "NOT_ILIKE",
// '~' doesn't necessarily represent regexps, but the three
// operators following it likely do, so we'll use the word TILDE
// in all for consistency.
"~": "TILDE",
"~*": "TILDE_ASTERISK",
"!~": "NOT_TILDE",
"!~*": "NOT_TILDE_ASTERISK",
// A number of other symbols where we're not sure of their
// meaning. We give them common generic names so that they're
// suitable for multiple purposes, e.g. favouring 'PLUS' over
// 'ADDITION' and 'DOT' over 'FULL_STOP'
"%": "PERCENT",
"+": "PLUS",
"-": "MINUS",
"/": "SLASH",
"\\": "BACKSLASH",
_: "UNDERSCORE",
"#": "POUND",
"£": "STERLING",
$: "DOLLAR",
"&": "AMPERSAND",
"@": "AT",
"'": "APOSTROPHE",
'"': "QUOTE",
"`": "BACKTICK",
":": "COLON",
";": "SEMICOLON",
"!": "EXCLAMATION_POINT",
"?": "QUESTION_MARK",
",": "COMMA",
".": "DOT",
"^": "CARET",
"|": "BAR",
"[": "OPEN_BRACKET",
"]": "CLOSE_BRACKET",
"(": "OPEN_PARENTHESIS",
")": "CLOSE_PARENTHESIS",
"{": "OPEN_BRACE",
"}": "CLOSE_BRACE"
}[value] || value;
return value;
},
tableNode(table) {
return this.camelCase(this._singularizedTableName(table));
},
tableFieldName(table) {
return this.camelCase(this._singularizedTableName(table));
},
allRows(table) {
return this.camelCase(`all-${this.pluralize(this._singularizedTableName(table))}`);
},
functionMutationName(proc) {
return this.camelCase(this._functionName(proc));
},
functionQueryName(proc) {
return this.camelCase(this._functionName(proc));
},
functionPayloadType(proc) {
return this.upperCamelCase(`${this._functionName(proc)}-payload`);
},
functionInputType(proc) {
return this.upperCamelCase(`${this._functionName(proc)}-input`);
},
tableType(table) {
return this.upperCamelCase(this._singularizedTableName(table));
},
column(attr) {
return this.camelCase(this._columnName(attr));
},
computedColumn(pseudoColumnName, proc, _table) {
return proc.tags.fieldName || this.camelCase(pseudoColumnName);
},
singleRelationByKeys(detailedKeys, table, _foreignTable, constraint) {
if (constraint.tags.fieldName) {
return constraint.tags.fieldName;
}
return this.camelCase(`${this._singularizedTableName(table)}-by-${detailedKeys.map(key => this.column(key)).join("-and-")}`);
},
manyRelationByKeys(detailedKeys, table, _foreignTable, constraint) {
if (constraint.tags.foreignFieldName) {
return constraint.tags.foreignFieldName;
}
return this.camelCase(`${this.pluralize(this._singularizedTableName(table))}-by-${detailedKeys.map(key => this.column(key)).join("-and-")}`);
},
rowByUniqueKeys(detailedKeys, table, constraint) {
if (constraint.tags.fieldName) {
return constraint.tags.fieldName;
}
return this.camelCase(`${this._singularizedTableName(table)}-by-${detailedKeys.map(key => this.column(key)).join("-and-")}`);
},
updateByKeys(detailedKeys, table, constraint) {
if (constraint.tags.updateFieldName) {
return constraint.tags.updateFieldName;
}
return this.camelCase(`update-${this._singularizedTableName(table)}-by-${detailedKeys.map(key => this.column(key)).join("-and-")}`);
},
deleteByKeys(detailedKeys, table, constraint) {
if (constraint.tags.deleteFieldName) {
return constraint.tags.deleteFieldName;
}
return this.camelCase(`delete-${this._singularizedTableName(table)}-by-${detailedKeys.map(key => this.column(key)).join("-and-")}`);
},
updateByKeysInputType(detailedKeys, table, constraint) {
if (constraint.tags.updateFieldName) {
return this.upperCamelCase(`${constraint.tags.updateFieldName}-input`);
}
return this.upperCamelCase(`update-${this._singularizedTableName(table)}-by-${detailedKeys.map(key => this.column(key)).join("-and-")}-input`);
},
deleteByKeysInputType(detailedKeys, table, constraint) {
if (constraint.tags.deleteFieldName) {
return this.upperCamelCase(`${constraint.tags.deleteFieldName}-input`);
}
return this.upperCamelCase(`delete-${this._singularizedTableName(table)}-by-${detailedKeys.map(key => this.column(key)).join("-and-")}-input`);
},
updateNode(table) {
return this.camelCase(`update-${this._singularizedTableName(table)}`);
},
deleteNode(table) {
return this.camelCase(`delete-${this._singularizedTableName(table)}`);
},
updateNodeInputType(table) {
return this.upperCamelCase(`update-${this._singularizedTableName(table)}-input`);
},
deleteNodeInputType(table) {
return this.upperCamelCase(`delete-${this._singularizedTableName(table)}-input`);
},
edgeField(table) {
return this.camelCase(`${this._singularizedTableName(table)}-edge`);
},
scalarFunctionConnection(proc) {
return this.upperCamelCase(`${this._functionName(proc)}-connection`);
},
scalarFunctionEdge(proc) {
return this.upperCamelCase(`${this.singularize(this._functionName(proc))}-edge`);
},
createField(table) {
return this.camelCase(`create-${this._singularizedTableName(table)}`);
},
createInputType(table) {
return this.upperCamelCase(`create-${this._singularizedTableName(table)}-input`);
},
createPayloadType(table) {
return this.upperCamelCase(`create-${this._singularizedTableName(table)}-payload`);
},
updatePayloadType(table) {
return this.upperCamelCase(`update-${this._singularizedTableName(table)}-payload`);
},
deletePayloadType(table) {
return this.upperCamelCase(`delete-${this._singularizedTableName(table)}-payload`);
}
}));
});
};
//# sourceMappingURL=PgBasicsPlugin.js.map

@@ -7,8 +7,2 @@ "use strict";

var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function PgColumnDeprecationPlugin(builder) {

@@ -27,3 +21,3 @@ builder.hook("GraphQLObjectType:fields:field", (field, build, context) => {

}
return pgFieldIntrospection.tags.deprecated ? (0, _assign2.default)({}, field, {
return pgFieldIntrospection.tags.deprecated ? Object.assign({}, field, {
deprecationReason: Array.isArray(pgFieldIntrospection.tags.deprecated) ? pgFieldIntrospection.tags.deprecated.join("\n") : pgFieldIntrospection.tags.deprecated

@@ -30,0 +24,0 @@ }) : field;

@@ -7,6 +7,2 @@ "use strict";

var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _queryFromResolveData = require("../queryFromResolveData");

@@ -16,2 +12,6 @@

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -21,3 +21,3 @@

exports.default = function PgColumnsPlugin(builder, { pgInflection: inflection }) {
exports.default = function PgColumnsPlugin(builder) {
builder.hook("GraphQLObjectType:fields", (fields, build, context) => {

@@ -33,3 +33,4 @@ const {

pgTweakFragmentForType,
pgColumnFilter
pgColumnFilter,
inflection
} = build;

@@ -45,2 +46,5 @@ const {

return extend(fields, introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).reduce((memo, attr) => {
if ((0, _omit2.default)(attr, "read")) {
return memo;
}
/*

@@ -57,3 +61,3 @@ attr =

*/
const fieldName = inflection.column(attr.name, table.name, table.namespaceName);
const fieldName = inflection.column(attr);
if (memo[fieldName]) {

@@ -70,3 +74,3 @@ throw new Error(`Two columns produce the same GraphQL field name '${fieldName}' on class '${table.namespaceName}.${table.name}'; one of them is '${attr.name}'`);

if (type.isPgArray) {
const ident = sql.identifier((0, _symbol2.default)());
const ident = sql.identifier(Symbol());
return sql.fragment`

@@ -87,3 +91,3 @@ (

const resolveData = getDataFromParsedResolveInfoFragment(parsedResolveInfoFragment, ReturnType);
const jsonBuildObject = (0, _queryFromResolveData2.default)(sql.identifier((0, _symbol2.default)()), // Ignore!
const jsonBuildObject = (0, _queryFromResolveData2.default)(sql.identifier(Symbol()), // Ignore!
sqlFullName, resolveData, { onlyJsonField: true, addNullCase: true });

@@ -118,3 +122,4 @@ return jsonBuildObject;

graphql: { GraphQLString, GraphQLNonNull },
pgColumnFilter
pgColumnFilter,
inflection
} = build;

@@ -129,2 +134,3 @@ const {

},
fieldWithHooks,
Self

@@ -136,10 +142,13 @@ } = context;

return extend(fields, introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).reduce((memo, attr) => {
const fieldName = inflection.column(attr.name, table.name, table.namespaceName);
if ((0, _omit2.default)(attr, isPgPatch ? "update" : "create")) {
return memo;
}
const fieldName = inflection.column(attr);
if (memo[fieldName]) {
throw new Error(`Two columns produce the same GraphQL field name '${fieldName}' on input class '${table.namespaceName}.${table.name}'; one of them is '${attr.name}'`);
}
memo[fieldName] = pgAddSubfield(fieldName, attr.name, attr.type, {
memo[fieldName] = fieldWithHooks(fieldName, pgAddSubfield(fieldName, attr.name, attr.type, {
description: attr.description,
type: nullableIf(GraphQLNonNull, isPgPatch || !attr.isNotNull && !attr.type.domainIsNotNull || attr.hasDefault, pgGetGqlInputTypeByTypeId(attr.typeId) || GraphQLString)
});
}), { pgFieldIntrospection: attr });
return memo;

@@ -146,0 +155,0 @@ }, {}), `Adding columns to input object '${Self.name}'`);

@@ -11,2 +11,6 @@ "use strict";

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -31,3 +35,3 @@

pgIntrospectionResultsByKind: introspectionResultsByKind,
pgInflection: inflection
inflection
} = build;

@@ -38,3 +42,3 @@ const tableType = introspectionResultsByKind.type.filter(type => type.type === "c" && type.namespaceId === table.namespaceId && type.classId === table.id)[0];

}
return extend(fields, introspectionResultsByKind.procedure.filter(proc => proc.isStable).filter(proc => proc.namespaceId === table.namespaceId).filter(proc => proc.name.startsWith(`${table.name}_`)).filter(proc => proc.argTypeIds.length > 0).filter(proc => proc.argTypeIds[0] === tableType.id).reduce((memo, proc) => {
return extend(fields, introspectionResultsByKind.procedure.filter(proc => proc.isStable).filter(proc => proc.namespaceId === table.namespaceId).filter(proc => proc.name.startsWith(`${table.name}_`)).filter(proc => proc.argTypeIds.length > 0).filter(proc => proc.argTypeIds[0] === tableType.id).filter(proc => !(0, _omit2.default)(proc, "execute")).reduce((memo, proc) => {
/*

@@ -61,3 +65,3 @@ proc =

const pseudoColumnName = proc.name.substr(table.name.length + 1);
const fieldName = inflection.column(pseudoColumnName, table.name, table.namespace.name);
const fieldName = inflection.computedColumn(pseudoColumnName, proc, table);
memo[fieldName] = (0, _makeProcField2.default)(fieldName, proc, build, {

@@ -64,0 +68,0 @@ fieldWithHooks,

@@ -7,3 +7,9 @@ "use strict";

exports.default = function PgConnectionArgCondition(builder, { pgInflection: inflection }) {
var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function PgConnectionArgCondition(builder) {
builder.hook("init", (_, build) => {

@@ -15,14 +21,15 @@ const {

graphql: { GraphQLInputObjectType, GraphQLString },
pgColumnFilter
pgColumnFilter,
inflection
} = build;
introspectionResultsByKind.class.filter(table => table.isSelectable).filter(table => !!table.namespace).forEach(table => {
const tableTypeName = inflection.tableType(table.name, table.namespace.name);
introspectionResultsByKind.class.filter(table => table.isSelectable && !(0, _omit2.default)(table, "filter")).filter(table => !!table.namespace).forEach(table => {
const tableTypeName = inflection.tableType(table);
/* const TableConditionType = */
newWithHooks(GraphQLInputObjectType, {
description: `A condition to be used against \`${tableTypeName}\` object types. All fields are tested for equality and combined with a logical ‘and.’`,
name: inflection.conditionType(inflection.tableType(table.name, table.namespace.name)),
name: inflection.conditionType(inflection.tableType(table)),
fields: context => {
const { fieldWithHooks } = context;
return introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).reduce((memo, attr) => {
const fieldName = inflection.column(attr.name, table.name, table.namespace.name);
return introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).filter(attr => !(0, _omit2.default)(attr, "filter")).reduce((memo, attr) => {
const fieldName = inflection.column(attr);
memo[fieldName] = fieldWithHooks(fieldName, {

@@ -52,3 +59,4 @@ description: `Checks for equality with the object’s \`${fieldName}\` field.`,

pgIntrospectionResultsByKind: introspectionResultsByKind,
pgColumnFilter
pgColumnFilter,
inflection
} = build;

@@ -61,3 +69,3 @@ const {

} = context;
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace) {
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace || (0, _omit2.default)(table, "filter")) {
return args;

@@ -72,4 +80,4 @@ }

if (condition != null) {
introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).forEach(attr => {
const fieldName = inflection.column(attr.name, table.name, table.namespace.name);
introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).filter(attr => !(0, _omit2.default)(attr, "filter")).forEach(attr => {
const fieldName = inflection.column(attr);
const val = condition[fieldName];

@@ -76,0 +84,0 @@ if (val != null) {

@@ -11,12 +11,17 @@ "use strict";

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function PgConnectionArgOrderBy(builder, { pgInflection: inflection }) {
exports.default = function PgConnectionArgOrderBy(builder) {
builder.hook("init", (_, {
newWithHooks,
pgIntrospectionResultsByKind: introspectionResultsByKind,
graphql: { GraphQLEnumType }
graphql: { GraphQLEnumType },
inflection
}) => {
introspectionResultsByKind.class.filter(table => table.isSelectable).filter(table => !!table.namespace).forEach(table => {
const tableTypeName = inflection.tableType(table.name, table.namespace.name);
introspectionResultsByKind.class.filter(table => table.isSelectable && !(0, _omit2.default)(table, "order")).filter(table => !!table.namespace).forEach(table => {
const tableTypeName = inflection.tableType(table);
/* const TableOrderByType = */

@@ -46,3 +51,4 @@ newWithHooks(GraphQLEnumType, {

pgSql: sql,
graphql: { GraphQLList, GraphQLNonNull }
graphql: { GraphQLList, GraphQLNonNull },
inflection
}, {

@@ -54,3 +60,3 @@ scope: { isPgFieldConnection, pgFieldIntrospection: table },

}) => {
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace || !table.isSelectable) {
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace || !table.isSelectable || (0, _omit2.default)(table, "order")) {
return args;

@@ -57,0 +63,0 @@ }

@@ -7,10 +7,4 @@ "use strict";

var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function PgConnectionArgOrderByDefaultValue(builder, { pgInflection: inflection }) {
builder.hook("GraphQLObjectType:fields:field:args", (args, { extend, getTypeByName, pgGetGqlTypeByTypeId }, {
exports.default = function PgConnectionArgOrderByDefaultValue(builder) {
builder.hook("GraphQLObjectType:fields:field:args", (args, { extend, getTypeByName, pgGetGqlTypeByTypeId, inflection }, {
scope: { isPgFieldConnection, pgFieldIntrospection: table },

@@ -20,3 +14,3 @@ Self,

}) => {
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace || !table.isSelectable) {
if (!isPgFieldConnection || !table || table.kind !== "class" || !table.namespace || !table.isSelectable || !args.orderBy) {
return args;

@@ -27,6 +21,9 @@ }

const TableOrderByType = getTypeByName(inflection.orderByType(tableTypeName));
if (!TableOrderByType) {
return args;
}
const defaultValueEnum = TableOrderByType.getValues().find(v => v.name === "PRIMARY_KEY_ASC") || TableOrderByType.getValues()[0];
return (0, _assign2.default)({}, args, {
return extend(args, {
orderBy: extend(args.orderBy, {

@@ -33,0 +30,0 @@ defaultValue: defaultValueEnum && [defaultValueEnum.value]

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

exports.default = function PgConnectionTotalCount(builder) {
builder.hook("GraphQLObjectType:fields", (fields, { extend, pgInflection: inflection, graphql: { GraphQLInt } }, {
builder.hook("GraphQLObjectType:fields", (fields, { extend, inflection, graphql: { GraphQLInt } }, {
scope: { isPgRowConnectionType, pgIntrospection: table },

@@ -17,3 +17,3 @@ fieldWithHooks,

}
const tableTypeName = inflection.tableType(table.name, table.namespace.name);
const tableTypeName = inflection.tableType(table);
return extend(fields, {

@@ -20,0 +20,0 @@ totalCount: fieldWithHooks("totalCount", ({ addDataGenerator }) => {

@@ -7,6 +7,2 @@ "use strict";

var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _debug = require("debug");

@@ -20,2 +16,6 @@

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -25,3 +25,3 @@

exports.default = function PgForwardRelationPlugin(builder, { pgInflection: inflection }) {
exports.default = function PgForwardRelationPlugin(builder) {
builder.hook("GraphQLObjectType:fields", (fields, {

@@ -32,3 +32,4 @@ extend,

pgIntrospectionResultsByKind: introspectionResultsByKind,
pgSql: sql
pgSql: sql,
inflection
}, {

@@ -54,2 +55,5 @@ scope: {

return extend(fields, foreignKeyConstraints.reduce((memo, constraint) => {
if ((0, _omit2.default)(constraint, "read")) {
return memo;
}
const gqlTableType = pgGetGqlTypeByTypeId(table.type.id);

@@ -71,2 +75,5 @@ const tableTypeName = gqlTableType.name;

}
if ((0, _omit2.default)(foreignTable, "read")) {
return memo;
}
const foreignSchema = introspectionResultsByKind.namespace.filter(n => n.id === foreignTable.namespaceId)[0];

@@ -80,9 +87,10 @@ const foreignAttributes = introspectionResultsByKind.attribute.filter(attr => attr.classId === constraint.foreignClassId).sort((a, b) => a.num - b.num);

}
if (keys.some(key => (0, _omit2.default)(key, "read"))) {
return memo;
}
if (foreignKeys.some(key => (0, _omit2.default)(key, "read"))) {
return memo;
}
const simpleKeys = keys.map(k => ({
column: k.name,
table: k.class.name,
schema: k.class.namespace.name
}));
const fieldName = inflection.singleRelationByKeys(simpleKeys, foreignTable.name, foreignTable.namespace.name);
const fieldName = inflection.singleRelationByKeys(keys, foreignTable, table, constraint);

@@ -95,3 +103,3 @@ memo[fieldName] = fieldWithHooks(fieldName, ({ getDataFromParsedResolveInfoFragment, addDataGenerator }) => {

const resolveData = getDataFromParsedResolveInfoFragment(parsedResolveInfoFragment, gqlForeignTableType);
const foreignTableAlias = sql.identifier((0, _symbol2.default)());
const foreignTableAlias = sql.identifier(Symbol());
const query = (0, _queryFromResolveData2.default)(sql.identifier(foreignSchema.name, foreignTable.name), foreignTableAlias, resolveData, { asJson: true }, innerQueryBuilder => {

@@ -117,3 +125,4 @@ keys.forEach((key, i) => {

}, {
pgFieldIntrospection: constraint
pgFieldIntrospection: constraint,
isPgForwardRelationField: true
});

@@ -120,0 +129,0 @@ return memo;

@@ -7,22 +7,2 @@ "use strict";

var _stringify = require("babel-runtime/core-js/json/stringify");
var _stringify2 = _interopRequireDefault(_stringify);
var _freeze = require("babel-runtime/core-js/object/freeze");
var _freeze2 = _interopRequireDefault(_freeze);
var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
var _keys = require("babel-runtime/core-js/object/keys");
var _keys2 = _interopRequireDefault(_keys);
var _promise = require("babel-runtime/core-js/promise");
var _promise2 = _interopRequireDefault(_promise);
var _withPgClient = require("../withPgClient");

@@ -48,2 +28,6 @@

var _throttle = require("lodash/throttle");
var _throttle2 = _interopRequireDefault(_throttle);
var _package = require("../../package.json");

@@ -54,3 +38,2 @@

const debug = (0, _debug2.default)("graphile-build-pg");
const INTROSPECTION_PATH = `${__dirname}/../../res/introspection-query.sql`;

@@ -62,3 +45,3 @@ const WATCH_FIXTURES_PATH = `${__dirname}/../../res/watch-fixtures.sql`;

function readFile(filename, encoding) {
return new _promise2.default((resolve, reject) => {
return new Promise((resolve, reject) => {
(0, _fs.readFile)(filename, encoding, (err, res) => {

@@ -84,4 +67,4 @@ if (err) reject(err);else resolve(res);

const cloneResults = obj => {
const result = (0, _keys2.default)(obj).reduce((memo, k) => {
memo[k] = obj[k].map(v => (0, _assign2.default)({}, v));
const result = Object.keys(obj).reduce((memo, k) => {
memo[k] = obj[k].map(v => Object.assign({}, v));
return memo;

@@ -108,3 +91,3 @@ }, {});

// Parse tags from comments
["namespace", "class", "attribute", "type", "procedure"].forEach(kind => {
["namespace", "class", "attribute", "type", "constraint", "procedure"].forEach(kind => {
result[kind].forEach(object => {

@@ -122,5 +105,5 @@ if (pgEnableTags && object.description) {

for (const k in result) {
result[k].map(_freeze2.default);
result[k].map(Object.freeze);
}
return (0, _freeze2.default)(result);
return Object.freeze(result);
}))));

@@ -161,3 +144,3 @@

}
throw new Error(`Could not look up '${newAttr}' by '${lookupAttr}' on '${(0, _stringify2.default)(entry)}'`);
throw new Error(`Could not look up '${newAttr}' by '${lookupAttr}' on '${JSON.stringify(entry)}'`);
}

@@ -220,6 +203,6 @@ entry[newAttr] = result;

});
releasePgClient = () => new _promise2.default((resolve, reject) => {
releasePgClient = () => new Promise((resolve, reject) => {
if (pgClient) pgClient.end(err => err ? reject(err) : resolve());else resolve();
});
await new _promise2.default((resolve, reject) => {
await new Promise((resolve, reject) => {
if (pgClient) {

@@ -252,3 +235,3 @@ pgClient.connect(err => err ? reject(err) : resolve());

const handleChange = async () => {
const handleChange = (0, _throttle2.default)(async () => {
debug(`Schema change detected: re-inspecting schema...`);

@@ -258,3 +241,6 @@ introspectionResultsByKind = await introspect();

triggerRebuild();
};
}, 750, {
leading: true,
trailing: true
});

@@ -261,0 +247,0 @@ listener = async notification => {

@@ -7,15 +7,11 @@ "use strict";

var _keys = require("babel-runtime/core-js/object/keys");
var _jsonwebtoken = require("jsonwebtoken");
var _keys2 = _interopRequireDefault(_keys);
var _parseIdentifier = require("../parseIdentifier");
var _assign = require("babel-runtime/core-js/object/assign");
var _parseIdentifier2 = _interopRequireDefault(_parseIdentifier);
var _assign2 = _interopRequireDefault(_assign);
var _jsonwebtoken = require("jsonwebtoken");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function PgJWTPlugin(builder, { pgInflection: inflection, pgJwtTypeIdentifier, pgJwtSecret }) {
exports.default = function PgJWTPlugin(builder, { pgJwtTypeIdentifier, pgJwtSecret }) {
builder.hook("init", (_, {

@@ -28,3 +24,4 @@ newWithHooks,

pgTweaksByTypeId,
graphql: { GraphQLScalarType }
graphql: { GraphQLScalarType },
inflection
}) => {

@@ -37,3 +34,3 @@ if (!pgJwtTypeIdentifier) {

}
const { namespaceName, typeName } = parseTypeIdentifier(pgJwtTypeIdentifier);
const { namespaceName, entityName: typeName } = (0, _parseIdentifier2.default)(pgJwtTypeIdentifier);

@@ -55,3 +52,3 @@ const compositeClass = introspectionResultsByKind.class.find(table => !table.isSelectable && !table.isInsertable && !table.isUpdatable && !table.isDeletable && table.name === typeName && table.namespaceName === namespaceName);

const compositeTypeName = inflection.tableType(compositeClass.name, compositeClass.namespaceName);
const compositeTypeName = inflection.tableType(compositeClass);

@@ -68,3 +65,3 @@ // NOTE: we deliberately do not create an input type

}, {});
return (0, _jsonwebtoken.sign)(token, pgJwtSecret, (0, _assign2.default)({}, token.aud ? null : {
return (0, _jsonwebtoken.sign)(token, pgJwtSecret, Object.assign({}, token.aud ? null : {
audience: "postgraphile"

@@ -85,3 +82,3 @@ }, token.iss ? null : {

if (!value) return null;
const values = (0, _keys2.default)(value).map(k => value[k]);
const values = Object.keys(value).map(k => value[k]);
if (values.every(v => v == null)) {

@@ -102,13 +99,2 @@ return null;

};
function parseTypeIdentifier(typeIdentifier) {
const match = typeIdentifier.match(/^(?:([a-zA-Z0-9_]+)|"([^"]*)")\.(?:([a-zA-Z0-9_]+)|"([^"]*)")$/);
if (!match) throw new Error(`Type identifier '${typeIdentifier}' is of the incorrect form.`);
return {
namespaceName: match[1] || match[2],
typeName: match[3] || match[4]
};
}
//# sourceMappingURL=PgJWTPlugin.js.map

@@ -7,6 +7,2 @@ "use strict";

var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _queryFromResolveData = require("../queryFromResolveData");

@@ -24,2 +20,6 @@

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -29,3 +29,3 @@

exports.default = function PgMutationCreatePlugin(builder, { pgInflection: inflection, pgDisableDefaultMutations }) {
exports.default = function PgMutationCreatePlugin(builder, { pgDisableDefaultMutations }) {
if (pgDisableDefaultMutations) {

@@ -50,3 +50,4 @@ return;

},
pgColumnFilter
pgColumnFilter,
inflection
} = build;

@@ -57,3 +58,3 @@ if (!isRootMutation) {

return extend(fields, pgIntrospectionResultsByKind.class.filter(table => !!table.namespace).filter(table => table.isSelectable).filter(table => table.isInsertable).reduce((memo, table) => {
return extend(fields, pgIntrospectionResultsByKind.class.filter(table => !!table.namespace).filter(table => table.isSelectable).filter(table => table.isInsertable && !(0, _omit2.default)(table, "create")).reduce((memo, table) => {
const Table = pgGetGqlTypeByTypeId(table.type.id);

@@ -69,5 +70,5 @@ if (!Table) {

}
const tableTypeName = inflection.tableType(table.name, table.namespace.name);
const tableTypeName = inflection.tableType(table);
const InputType = newWithHooks(GraphQLInputObjectType, {
name: inflection.createInputType(table.name, table.namespace.name),
name: inflection.createInputType(table),
description: `All input for the create \`${tableTypeName}\` mutation.`,

@@ -79,3 +80,3 @@ fields: {

},
[inflection.tableName(table.name, table.namespace.name)]: {
[inflection.tableFieldName(table)]: {
description: `The \`${tableTypeName}\` to be created by this mutation.`,

@@ -90,6 +91,6 @@ type: new GraphQLNonNull(TableInput)

const PayloadType = newWithHooks(GraphQLObjectType, {
name: inflection.createPayloadType(table.name, table.namespace.name),
name: inflection.createPayloadType(table),
description: `The output of our create \`${tableTypeName}\` mutation.`,
fields: ({ recurseDataGeneratorsForField }) => {
const tableName = inflection.tableName(table.name, table.namespace.name);
const tableName = inflection.tableFieldName(table);
recurseDataGeneratorsForField(tableName);

@@ -115,3 +116,3 @@ return {

});
const fieldName = inflection.createField(table.name, table.namespace.name);
const fieldName = inflection.createField(table);
memo[fieldName] = fieldWithHooks(fieldName, context => {

@@ -130,9 +131,9 @@ const { getDataFromParsedResolveInfoFragment } = context;

const resolveData = getDataFromParsedResolveInfoFragment(parsedResolveInfoFragment, PayloadType);
const insertedRowAlias = sql.identifier((0, _symbol2.default)());
const insertedRowAlias = sql.identifier(Symbol());
const query = (0, _queryFromResolveData2.default)(insertedRowAlias, insertedRowAlias, resolveData, {});
const sqlColumns = [];
const sqlValues = [];
const inputData = input[inflection.tableName(table.name, table.namespace.name)];
pgIntrospectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).forEach(attr => {
const fieldName = inflection.column(attr.name, table.name, table.namespace.name);
const inputData = input[inflection.tableFieldName(table)];
pgIntrospectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).filter(attr => !(0, _omit2.default)(attr, "create")).forEach(attr => {
const fieldName = inflection.column(attr);
const val = inputData[fieldName];

@@ -139,0 +140,0 @@ if (Object.prototype.hasOwnProperty.call(inputData, fieldName)) {

@@ -7,6 +7,2 @@ "use strict";

var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
var _isString = require("lodash/isString");

@@ -16,5 +12,9 @@

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function PgMutationPayloadEdgePlugin(builder, { pgInflection: inflection }) {
exports.default = function PgMutationPayloadEdgePlugin(builder) {
builder.hook("GraphQLObjectType:fields", (fields, {

@@ -26,3 +26,4 @@ extend,

graphql: { GraphQLList, GraphQLNonNull },
pgIntrospectionResultsByKind: introspectionResultsByKind
pgIntrospectionResultsByKind: introspectionResultsByKind,
inflection
}, {

@@ -35,3 +36,3 @@ scope: { isMutationPayload, pgIntrospection, pgIntrospectionTable },

const table = pgIntrospectionTable || pgIntrospection;
if (!isMutationPayload || !table || table.kind !== "class" || !table.namespace || !table.isSelectable) {
if (!isMutationPayload || !table || table.kind !== "class" || !table.namespace || !table.isSelectable || (0, _omit2.default)(table, "all") && (0, _omit2.default)(table, "many")) {
return fields;

@@ -50,4 +51,5 @@ }

const primaryKeys = primaryKeyConstraint && primaryKeyConstraint.keyAttributeNums.map(num => attributes.filter(attr => attr.num === num)[0]);
const canOrderBy = !(0, _omit2.default)(table, "order");
const fieldName = inflection.edgeField(table.name, table.namespace.name);
const fieldName = inflection.edgeField(table);
recurseDataGeneratorsForField(fieldName);

@@ -59,3 +61,3 @@ return extend(fields, {

}) {
const orderBy = rawOrderBy ? Array.isArray(rawOrderBy) ? rawOrderBy : [rawOrderBy] : null;
const orderBy = canOrderBy && rawOrderBy ? Array.isArray(rawOrderBy) ? rawOrderBy : [rawOrderBy] : null;
return {

@@ -95,7 +97,7 @@ pgQuery: queryBuilder => {

const defaultValueEnum = TableOrderByType.getValues().find(v => v.name === "PRIMARY_KEY_ASC") || TableOrderByType.getValues()[0];
const defaultValueEnum = canOrderBy && (TableOrderByType.getValues().find(v => v.name === "PRIMARY_KEY_ASC") || TableOrderByType.getValues()[0]);
return {
description: `An edge for our \`${tableTypeName}\`. May be used by Relay 1.`,
type: TableEdgeType,
args: {
args: canOrderBy ? {
orderBy: {

@@ -106,5 +108,5 @@ description: `The method to use when ordering \`${tableTypeName}\`.`,

}
},
} : {},
resolve(data, { orderBy: rawOrderBy }) {
const orderBy = rawOrderBy ? Array.isArray(rawOrderBy) ? rawOrderBy : [rawOrderBy] : null;
const orderBy = canOrderBy && rawOrderBy ? Array.isArray(rawOrderBy) ? rawOrderBy : [rawOrderBy] : null;
const order = orderBy && orderBy.some(item => item.alias) ? orderBy.filter(item => item.alias) : null;

@@ -114,3 +116,3 @@

if (data.data.__identifiers) {
return (0, _assign2.default)({}, data.data, {
return Object.assign({}, data.data, {
__cursor: ["primary_key_asc", data.data.__identifiers]

@@ -122,3 +124,3 @@ });

}
return (0, _assign2.default)({}, data.data, {
return Object.assign({}, data.data, {
__cursor: data.data[`__order_${order.map(item => item.alias).join("__")}`]

@@ -125,0 +127,0 @@ });

@@ -11,2 +11,6 @@ "use strict";

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -22,5 +26,5 @@

pgIntrospectionResultsByKind: introspectionResultsByKind,
pgInflection: inflection
inflection
} = build;
return extend(fields, introspectionResultsByKind.procedure.filter(proc => !proc.isStable).filter(proc => !!proc.namespace).reduce((memo, proc) => {
return extend(fields, introspectionResultsByKind.procedure.filter(proc => !proc.isStable).filter(proc => !!proc.namespace).filter(proc => !(0, _omit2.default)(proc, "execute")).reduce((memo, proc) => {
/*

@@ -41,3 +45,3 @@ proc =

const fieldName = inflection.functionName(proc.name, proc.namespace.name);
const fieldName = inflection.functionMutationName(proc);
memo[fieldName] = (0, _makeProcField2.default)(fieldName, proc, build, {

@@ -44,0 +48,0 @@ fieldWithHooks,

@@ -7,10 +7,2 @@ "use strict";

var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _queryFromResolveData = require("../queryFromResolveData");

@@ -24,20 +16,17 @@

var _camelCase = require("lodash/camelCase");
var _viaTemporaryTable = require("./viaTemporaryTable");
var _camelCase2 = _interopRequireDefault(_camelCase);
var _viaTemporaryTable2 = _interopRequireDefault(_viaTemporaryTable);
var _pluralize = require("pluralize");
var _omit = require("../omit");
var _pluralize2 = _interopRequireDefault(_pluralize);
var _omit2 = _interopRequireDefault(_omit);
var _viaTemporaryTable = require("./viaTemporaryTable");
var _viaTemporaryTable2 = _interopRequireDefault(_viaTemporaryTable);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const debug = (0, _debug2.default)("graphile-build-pg");
const base64Decode = str => new Buffer(String(str), "base64").toString("utf8");
exports.default = async function PgMutationUpdateDeletePlugin(builder, { pgInflection: inflection, pgDisableDefaultMutations }) {
exports.default = async function PgMutationUpdateDeletePlugin(builder, { pgDisableDefaultMutations }) {
if (pgDisableDefaultMutations) {

@@ -68,8 +57,10 @@ return;

},
pgColumnFilter
pgColumnFilter,
inflection
} = build;
const { pluralize, singularize, camelCase } = inflection;
if (!isRootMutation) {
return fields;
}
return extend(fields, ["update", "delete"].reduce((outerMemo, mode) => introspectionResultsByKind.class.filter(table => !!table.namespace).filter(table => mode === "update" && table.isUpdatable || mode === "delete" && table.isDeletable).reduce((memo, table) => {
return extend(fields, ["update", "delete"].reduce((outerMemo, mode) => introspectionResultsByKind.class.filter(table => !!table.namespace).filter(table => mode === "update" && table.isUpdatable && !(0, _omit2.default)(table, "update") || mode === "delete" && table.isDeletable && !(0, _omit2.default)(table, "delete")).reduce((memo, table) => {
const TableType = pgGetGqlTypeByTypeId(table.type.id);

@@ -86,5 +77,5 @@ async function commonCodeRenameMe(pgClient, resolveInfo, getDataFromParsedResolveInfoFragment, PayloadType, input, condition, context) {

const sqlValues = [];
const inputData = input[inflection.patchField(inflection.tableName(table.name, table.namespace.name))];
const inputData = input[inflection.patchField(inflection.tableFieldName(table))];
introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).forEach(attr => {
const fieldName = inflection.column(attr.name, table.name, table.namespace.name);
const fieldName = inflection.column(attr);
if (fieldName in inputData /* Because we care about null! */

@@ -111,3 +102,3 @@ ) {

const modifiedRowAlias = sql.identifier((0, _symbol2.default)());
const modifiedRowAlias = sql.identifier(Symbol());
const query = (0, _queryFromResolveData2.default)(modifiedRowAlias, modifiedRowAlias, resolveData, {});

@@ -125,3 +116,3 @@ let row;

if (!row) {
throw new Error(`No values were ${mode}d in collection '${(0, _pluralize2.default)(table.name)}' because no values were found.`);
throw new Error(`No values were ${mode}d in collection '${pluralize(table.name)}' because no values were found.`);
}

@@ -140,3 +131,3 @@ return {

const PayloadType = newWithHooks(GraphQLObjectType, {
name: inflection[mode === "delete" ? "deletePayloadType" : "updatePayloadType"](table.name, table.namespace.name),
name: inflection[mode === "delete" ? "deletePayloadType" : "updatePayloadType"](table),
description: `The output of our ${mode} \`${tableTypeName}\` mutation.`,

@@ -147,7 +138,7 @@ fields: ({

}) => {
const tableName = inflection.tableName(table.name, table.namespace.name);
const tableName = inflection.tableFieldName(table);
recurseDataGeneratorsForField(tableName);
// This should really be `-node-id` but for compatibility with PostGraphQL v3 we haven't made that change.
const deletedNodeIdFieldName = (0, _camelCase2.default)(`deleted-${_pluralize2.default.singular(table.name)}-id`);
return (0, _assign2.default)({
const deletedNodeIdFieldName = camelCase(`deleted-${singularize(table.name)}-id`);
return Object.assign({
clientMutationId: {

@@ -197,7 +188,7 @@ description: "The exact same `clientMutationId` that was provided in the mutation input, unchanged and unused. May be used by a client to track mutations.",

const primaryKeys = primaryKeyConstraint && primaryKeyConstraint.keyAttributeNums.map(num => attributes.filter(attr => attr.num === num)[0]);
const fieldName = inflection[mode === "update" ? "updateNode" : "deleteNode"](table.name, table.namespace.name);
const fieldName = inflection[mode === "update" ? "updateNode" : "deleteNode"](table);
const InputType = newWithHooks(GraphQLInputObjectType, {
description: `All input for the \`${fieldName}\` mutation.`,
name: inflection[mode === "update" ? "updateNodeInputType" : "deleteNodeInputType"](table.name, table.namespace.name),
fields: (0, _assign2.default)({
name: inflection[mode === "update" ? "updateNodeInputType" : "deleteNodeInputType"](table),
fields: Object.assign({
clientMutationId: {

@@ -212,3 +203,3 @@ description: "An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client.",

}, mode === "update" ? {
[inflection.patchField(inflection.tableName(table.name, table.namespace.name))]: {
[inflection.patchField(inflection.tableFieldName(table))]: {
description: `An object where the defined keys will be set on the \`${tableTypeName}\` being ${mode}d.`,

@@ -267,2 +258,5 @@ type: new GraphQLNonNull(TablePatch)

uniqueConstraints.forEach(constraint => {
if ((0, _omit2.default)(constraint, mode)) {
return;
}
const keys = constraint.keyAttributeNums.map(num => attributes.filter(attr => attr.num === num)[0]);

@@ -272,12 +266,10 @@ if (!keys.every(_ => _)) {

}
const simpleKeys = keys.map(k => ({
column: k.name,
table: k.class.name,
schema: k.class.namespace.name
}));
const fieldName = inflection[mode === "update" ? "updateByKeys" : "deleteByKeys"](simpleKeys, table.name, table.namespace.name);
if (keys.some(key => (0, _omit2.default)(key, "read"))) {
return;
}
const fieldName = inflection[mode === "update" ? "updateByKeys" : "deleteByKeys"](keys, table, constraint);
const InputType = newWithHooks(GraphQLInputObjectType, {
description: `All input for the \`${fieldName}\` mutation.`,
name: inflection[mode === "update" ? "updateByKeysInputType" : "deleteByKeysInputType"](simpleKeys, table.name, table.namespace.name),
fields: (0, _assign2.default)({
name: inflection[mode === "update" ? "updateByKeysInputType" : "deleteByKeysInputType"](keys, table, constraint),
fields: Object.assign({
clientMutationId: {

@@ -287,3 +279,3 @@ type: GraphQLString

}, mode === "update" ? {
[inflection.patchField(inflection.tableName(table.name, table.namespace.name))]: {
[inflection.patchField(inflection.tableFieldName(table))]: {
description: `An object where the defined keys will be set on the \`${tableTypeName}\` being ${mode}d.`,

@@ -293,3 +285,3 @@ type: new GraphQLNonNull(TablePatch)

} : null, keys.reduce((memo, key) => {
memo[inflection.column(key.name, key.class.name, key.class.namespace.name)] = {
memo[inflection.column(key)] = {
description: key.description,

@@ -323,3 +315,3 @@ type: new GraphQLNonNull(pgGetGqlInputTypeByTypeId(key.typeId))

async resolve(parent, { input }, { pgClient }, resolveInfo) {
return commonCodeRenameMe(pgClient, resolveInfo, getDataFromParsedResolveInfoFragment, PayloadType, input, sql.fragment`(${sql.join(keys.map(key => sql.fragment`${sql.identifier(key.name)} = ${gql2pg(input[inflection.column(key.name, key.class.name, key.class.namespace.name)], key.type)}`), ") and (")})`, context);
return commonCodeRenameMe(pgClient, resolveInfo, getDataFromParsedResolveInfoFragment, PayloadType, input, sql.fragment`(${sql.join(keys.map(key => sql.fragment`${sql.identifier(key.name)} = ${gql2pg(input[inflection.column(key)], key.type)}`), ") and (")})`, context);
}

@@ -326,0 +318,0 @@ };

@@ -7,12 +7,6 @@ "use strict";

var _pluralize = require("pluralize");
var _pluralize2 = _interopRequireDefault(_pluralize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = async function PgNodeAliasPostGraphile(builder) {
builder.hook("GraphQLObjectType", (object, { setNodeAlias }, { scope: { isPgRowType, isPgCompoundType, pgIntrospection: table } }) => {
builder.hook("GraphQLObjectType", (object, { setNodeAlias, inflection: { pluralize } }, { scope: { isPgRowType, isPgCompoundType, pgIntrospection: table } }) => {
if (isPgRowType || isPgCompoundType) {
setNodeAlias(object.name, (0, _pluralize2.default)(table.name));
setNodeAlias(object.name, pluralize(table.name));
}

@@ -19,0 +13,0 @@ return object;

@@ -7,3 +7,9 @@ "use strict";

exports.default = function PgOrderAllColumnsPlugin(builder, { pgInflection: inflection }) {
var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = function PgOrderAllColumnsPlugin(builder) {
builder.hook("GraphQLEnumType:values", (values, build, context) => {

@@ -13,3 +19,4 @@ const {

pgIntrospectionResultsByKind: introspectionResultsByKind,
pgColumnFilter
pgColumnFilter,
inflection
} = build;

@@ -21,4 +28,7 @@ const { scope: { isPgRowSortEnum, pgIntrospection: table } } = context;

return extend(values, introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).filter(attr => pgColumnFilter(attr, build, context)).reduce((memo, attr) => {
const ascFieldName = inflection.orderByEnum(attr.name, true, table.name, table.namespaceName);
const descFieldName = inflection.orderByEnum(attr.name, false, table.name, table.namespaceName);
if ((0, _omit2.default)(attr, "order")) {
return memo;
}
const ascFieldName = inflection.orderByColumnEnum(attr, true);
const descFieldName = inflection.orderByColumnEnum(attr, false);
memo[ascFieldName] = {

@@ -25,0 +35,0 @@ value: {

@@ -19,2 +19,6 @@ "use strict";

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -31,6 +35,6 @@

extend,
pgInflection: inflection,
inflection,
pgIntrospectionResultsByKind: introspectionResultsByKind
} = build;
return extend(fields, introspectionResultsByKind.procedure.filter(proc => proc.isStable).filter(proc => !!proc.namespace).reduce((memo, proc) => {
return extend(fields, introspectionResultsByKind.procedure.filter(proc => proc.isStable).filter(proc => !!proc.namespace).filter(proc => !(0, _omit2.default)(proc, "execute")).reduce((memo, proc) => {
/*

@@ -61,3 +65,3 @@ proc =

const fieldName = inflection.functionName(proc.name, proc.namespace.name);
const fieldName = inflection.functionQueryName(proc);
try {

@@ -64,0 +68,0 @@ memo[fieldName] = (0, _makeProcField2.default)(fieldName, proc, build, {

@@ -15,2 +15,6 @@ "use strict";

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -20,3 +24,3 @@

exports.default = async function PgRowByUniqueConstraint(builder, { pgInflection: inflection }) {
exports.default = async function PgRowByUniqueConstraint(builder) {
builder.hook("GraphQLObjectType:fields", (fields, {

@@ -30,3 +34,4 @@ extend,

pgSql: sql,
graphql: { GraphQLNonNull }
graphql: { GraphQLNonNull },
inflection
}, { scope: { isRootQuery }, fieldWithHooks }) => {

@@ -36,3 +41,3 @@ if (!isRootQuery) {

}
return extend(fields, introspectionResultsByKind.class.filter(table => !!table.namespace).reduce((memo, table) => {
return extend(fields, introspectionResultsByKind.class.filter(table => !!table.namespace).filter(table => !(0, _omit2.default)(table, "read")).reduce((memo, table) => {
const TableType = pgGetGqlTypeByTypeId(table.type.id);

@@ -44,12 +49,13 @@ const sqlFullTableName = sql.identifier(table.namespace.name, table.name);

uniqueConstraints.forEach(constraint => {
if ((0, _omit2.default)(constraint, "read")) {
return;
}
const keys = constraint.keyAttributeNums.map(num => attributes.filter(attr => attr.num === num)[0]);
if (keys.some(key => (0, _omit2.default)(key, "read"))) {
return;
}
if (!keys.every(_ => _)) {
throw new Error("Consistency error: could not find an attribute!");
}
const simpleKeys = keys.map(k => ({
column: k.name,
table: k.class.name,
schema: k.class.namespace.name
}));
const fieldName = inflection.rowByUniqueKeys(simpleKeys, table.name, table.namespace.name);
const fieldName = inflection.rowByUniqueKeys(keys, table, constraint);
memo[fieldName] = fieldWithHooks(fieldName, ({ getDataFromParsedResolveInfoFragment }) => {

@@ -63,3 +69,3 @@ return {

}
memo[inflection.column(key.name, key.class.name, key.class.namespace.name)] = {
memo[inflection.column(key)] = {
type: new GraphQLNonNull(InputType)

@@ -74,3 +80,3 @@ };

keys.forEach(key => {
builder.where(sql.fragment`${builder.getTableAlias()}.${sql.identifier(key.name)} = ${gql2pg(args[inflection.column(key.name, key.class.name, key.class.namespace.name)], key.type)}`);
builder.where(sql.fragment`${builder.getTableAlias()}.${sql.identifier(key.name)} = ${gql2pg(args[inflection.column(key)], key.type)}`);
});

@@ -77,0 +83,0 @@ });

@@ -15,9 +15,12 @@ "use strict";

var _omit = require("../omit");
var _omit2 = _interopRequireDefault(_omit);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const base64Decode = str => new Buffer(String(str), "base64").toString("utf8");
const debugSql = (0, _debug2.default)("graphile-build-pg:sql");
exports.default = async function PgRowByUniqueConstraint(builder, { pgInflection: inflection }) {
exports.default = async function PgRowByUniqueConstraint(builder) {
builder.hook("GraphQLObjectType", (object, {

@@ -29,3 +32,3 @@ addNodeFetcherForTypeName,

}, { scope: { isPgRowType, pgIntrospection: table } }) => {
if (!isPgRowType || !table.namespace) {
if (!isPgRowType || !table.namespace || (0, _omit2.default)(table, "read")) {
return object;

@@ -66,3 +69,4 @@ }

getNodeType,
graphql: { GraphQLNonNull, GraphQLID }
graphql: { GraphQLNonNull, GraphQLID },
inflection
}, { scope: { isRootQuery }, fieldWithHooks }) => {

@@ -72,3 +76,3 @@ if (!isRootQuery || !nodeIdFieldName) {

}
return extend(fields, introspectionResultsByKind.class.filter(table => !!table.namespace).reduce((memo, table) => {
return extend(fields, introspectionResultsByKind.class.filter(table => !!table.namespace).filter(table => !(0, _omit2.default)(table, "read")).reduce((memo, table) => {
const TableType = pgGetGqlTypeByTypeId(table.type.id);

@@ -83,3 +87,3 @@ const sqlFullTableName = sql.identifier(table.namespace.name, table.name);

const primaryKeys = primaryKeyConstraint && primaryKeyConstraint.keyAttributeNums.map(num => attributes.filter(attr => attr.num === num)[0]);
const fieldName = inflection.tableNode(table.name, table.namespace.name);
const fieldName = inflection.tableNode(table);
memo[fieldName] = fieldWithHooks(fieldName, ({ getDataFromParsedResolveInfoFragment }) => {

@@ -86,0 +90,0 @@ return {

@@ -7,5 +7,5 @@ "use strict";

var _stringify = require("babel-runtime/core-js/json/stringify");
var _omit = require("../omit");
var _stringify2 = _interopRequireDefault(_stringify);
var _omit2 = _interopRequireDefault(_omit);

@@ -16,3 +16,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = function PgTablesPlugin(builder, { pgInflection: inflection, pgForbidSetofFunctionsToReturnNull = false }) {
exports.default = function PgScalarFunctionConnectionPlugin(builder, { pgForbidSetofFunctionsToReturnNull = false }) {
builder.hook("init", (_, {

@@ -28,7 +28,8 @@ newWithHooks,

GraphQLString
}
},
inflection
}) => {
const nullableIf = (condition, Type) => condition ? Type : new GraphQLNonNull(Type);
const Cursor = getTypeByName("Cursor");
introspectionResultsByKind.procedure.filter(proc => proc.returnsSet).filter(proc => !!proc.namespace).forEach(proc => {
introspectionResultsByKind.procedure.filter(proc => proc.returnsSet).filter(proc => !!proc.namespace).filter(proc => !(0, _omit2.default)(proc, "execute")).forEach(proc => {
const returnType = introspectionResultsByKind.typeById[proc.returnTypeId];

@@ -42,3 +43,3 @@ const returnTypeTable = introspectionResultsByKind.classById[returnType.classId];

const EdgeType = newWithHooks(GraphQLObjectType, {
name: inflection.scalarFunctionEdge(proc.name, proc.namespace.name),
name: inflection.scalarFunctionEdge(proc),
description: `A \`${NodeType.name}\` edge in the connection.`,

@@ -55,3 +56,3 @@ fields: ({ fieldWithHooks }) => {

resolve(data) {
return base64((0, _stringify2.default)(data.__cursor));
return base64(JSON.stringify(data.__cursor));
}

@@ -78,3 +79,3 @@ };

newWithHooks(GraphQLObjectType, {
name: inflection.scalarFunctionConnection(proc.name, proc.namespace.name),
name: inflection.scalarFunctionConnection(proc),
description: `A connection to a list of \`${NodeType.name}\` values.`,

@@ -81,0 +82,0 @@ fields: ({ recurseDataGeneratorsForField }) => {

@@ -7,17 +7,7 @@ "use strict";

var _stringify = require("babel-runtime/core-js/json/stringify");
var _stringify2 = _interopRequireDefault(_stringify);
var _keys = require("babel-runtime/core-js/object/keys");
var _keys2 = _interopRequireDefault(_keys);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const base64 = str => new Buffer(String(str)).toString("base64");
exports.default = function PgTablesPlugin(builder, { pgInflection: inflection, pgForbidSetofFunctionsToReturnNull = false }) {
exports.default = function PgTablesPlugin(builder, { pgForbidSetofFunctionsToReturnNull = false }) {
const handleNullRow = pgForbidSetofFunctionsToReturnNull ? row => row : row => {
if ((0, _keys2.default)(row).filter(str => !str.startsWith("__")).some(key => row[key] !== null)) {
if (Object.keys(row).filter(str => !str.startsWith("__")).some(key => row[key] !== null) || Array.isArray(row.__identifiers) && row.__identifiers.every(i => i != null)) {
return row;

@@ -50,3 +40,4 @@ } else {

},
pgColumnFilter
pgColumnFilter,
inflection
} = build;

@@ -77,3 +68,3 @@ const nullableIf = (condition, Type) => condition ? Type : new GraphQLNonNull(Type);

const attributes = introspectionResultsByKind.attribute.filter(attr => attr.classId === table.id).sort((a1, a2) => a1.num - a2.num);
const tableTypeName = inflection.tableType(table.name, table.namespaceName);
const tableTypeName = inflection.tableType(table);
const shouldHaveNodeId = nodeIdFieldName && table.isSelectable && table.namespace && primaryKeys && primaryKeys.length ? true : false;

@@ -134,3 +125,3 @@ pgRegisterGqlTypeByTypeId(tablePgType.id, cb => {

}
const fieldName = inflection.column(attr.name, table.name, table.namespaceName);
const fieldName = inflection.column(attr);
const pgInputField = pgInputFields[fieldName];

@@ -193,3 +184,3 @@ const v = obj[fieldName];

resolve(data) {
return data.__cursor && base64((0, _stringify2.default)(data.__cursor));
return data.__cursor && base64(JSON.stringify(data.__cursor));
}

@@ -196,0 +187,0 @@ };

@@ -7,18 +7,2 @@ "use strict";

var _create = require("babel-runtime/core-js/object/create");
var _create2 = _interopRequireDefault(_create);
var _stringify = require("babel-runtime/core-js/json/stringify");
var _stringify2 = _interopRequireDefault(_stringify);
var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
var _freeze = require("babel-runtime/core-js/object/freeze");
var _freeze2 = _interopRequireDefault(_freeze);
var _graphql = require("graphql");

@@ -72,3 +56,3 @@

result = (0, _postgresInterval2.default)(str);
(0, _freeze2.default)(result);
Object.freeze(result);
parseCache.set(str, result);

@@ -108,3 +92,3 @@ }

exports.default = function PgTypesPlugin(builder, { pgExtendedTypes = true, pgInflection: inflection, pgLegacyJsonUuid = false }) {
exports.default = function PgTypesPlugin(builder, { pgExtendedTypes = true, pgLegacyJsonUuid = false }) {
// XXX: most of this should be in an "init" hook, not a "build" hook

@@ -116,3 +100,4 @@ builder.hook("build", build => {

addType,
pgSql: sql
pgSql: sql,
inflection
} = build;

@@ -122,4 +107,4 @@

const gqlInputTypeByTypeIdGenerator = {};
const gqlTypeByTypeId = (0, _assign2.default)({}, build.pgGqlTypeByTypeId);
const gqlInputTypeByTypeId = (0, _assign2.default)({}, build.pgGqlInputTypeByTypeId);
const gqlTypeByTypeId = Object.assign({}, build.pgGqlTypeByTypeId);
const gqlInputTypeByTypeId = Object.assign({}, build.pgGqlInputTypeByTypeId);
const pg2GqlMapper = {};

@@ -239,3 +224,3 @@ const pg2gql = (val, type) => {

const tweakToText = fragment => sql.fragment`(${fragment})::text`;
const pgTweaksByTypeId = (0, _assign2.default)(
const pgTweaksByTypeId = Object.assign(
// ::text rawTypes

@@ -371,3 +356,3 @@ rawTypes.reduce((memo, typeId) => {

const identity = _ => _;
const jsonStringify = o => (0, _stringify2.default)(o);
const jsonStringify = o => JSON.stringify(o);
if (pgExtendedTypes) {

@@ -467,3 +452,3 @@ pg2GqlMapper[114] = {

gqlTypeByTypeId[type.id] = new _graphql.GraphQLEnumType({
name: inflection.enumType(type.name),
name: inflection.enumType(type),
description: type.description,

@@ -586,8 +571,8 @@ values: type.enumVariants.reduce((memo, value) => {

// Hack stolen from: https://github.com/graphile/postgraphile/blob/ade728ed8f8e3ecdc5fdad7d770c67aa573578eb/src/graphql/schema/type/aliasGqlType.ts#L16
gqlTypeByTypeId[type.id] = (0, _assign2.default)((0, _create2.default)(baseType), {
name: inflection.domainType(type.name),
gqlTypeByTypeId[type.id] = Object.assign(Object.create(baseType), {
name: inflection.domainType(type),
description: type.description
});
if (baseInputType && baseInputType !== baseType) {
gqlInputTypeByTypeId[type.id] = (0, _assign2.default)((0, _create2.default)(baseInputType), {
gqlInputTypeByTypeId[type.id] = Object.assign(Object.create(baseInputType), {
name: inflection.inputType(gqlTypeByTypeId[type.id]),

@@ -594,0 +579,0 @@ description: type.description

@@ -7,6 +7,2 @@ "use strict";

var _keys = require("babel-runtime/core-js/object/keys");
var _keys2 = _interopRequireDefault(_keys);
var _pgSql = require("pg-sql2");

@@ -91,3 +87,3 @@

// `row[0]`. PR welcome!
const firstKey = firstRow && (0, _keys2.default)(firstRow)[0];
const firstKey = firstRow && Object.keys(firstRow)[0];
const values = rows.map(row => row[firstKey]);

@@ -94,0 +90,0 @@ const convertFieldBack = isPgClassLike ? _pgSql2.default.query`(str::${sqlTypeIdentifier}).*` : _pgSql2.default.query`str::${sqlTypeIdentifier} as ${sqlResultSourceAlias}`;

@@ -7,6 +7,2 @@ "use strict";

var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _pgSql = require("pg-sql2");

@@ -20,6 +16,6 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const isDev = ["test", "development"].indexOf(process.env.NODE_ENV) >= 0;

@@ -158,3 +154,3 @@

}
from(expr, alias = sql.identifier((0, _symbol2.default)())) {
from(expr, alias = sql.identifier(Symbol())) {
this.checkLock("from");

@@ -379,3 +375,3 @@ if (!expr) {

if (flip) {
const flipAlias = (0, _symbol2.default)();
const flipAlias = Symbol();
fragment = sql.fragment`

@@ -391,3 +387,3 @@ with ${sql.identifier(flipAlias)} as (

if (asJsonAggregate) {
const aggAlias = (0, _symbol2.default)();
const aggAlias = Symbol();
fragment = sql.fragment`select json_agg(${sql.identifier(aggAlias, "object")}) from (${fragment}) as ${sql.identifier(aggAlias)}`;

@@ -394,0 +390,0 @@ fragment = sql.fragment`select coalesce((${fragment}), '[]'::json)`;

@@ -7,6 +7,2 @@ "use strict";

var _symbol = require("babel-runtime/core-js/symbol");
var _symbol2 = _interopRequireDefault(_symbol);
var _QueryBuilder = require("./QueryBuilder");

@@ -153,4 +149,4 @@

const haveFields = queryBuilder.getSelectFieldsCount() > 0;
const sqlQueryAlias = _pgSql2.default.identifier((0, _symbol2.default)());
const sqlSummaryAlias = _pgSql2.default.identifier((0, _symbol2.default)());
const sqlQueryAlias = _pgSql2.default.identifier(Symbol());
const sqlSummaryAlias = _pgSql2.default.identifier(Symbol());
//

@@ -157,0 +153,0 @@ // Tables should ALWAYS push their PK onto the order stack, if this isn't

@@ -6,39 +6,6 @@ "use strict";

});
exports.parseTags = exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = undefined;
var _assign = require("babel-runtime/core-js/object/assign");
var _assign2 = _interopRequireDefault(_assign);
var _upperFirst = require("lodash/upperFirst");
var _upperFirst2 = _interopRequireDefault(_upperFirst);
var _camelCase = require("lodash/camelCase");
var _camelCase2 = _interopRequireDefault(_camelCase);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const constantCaseAll = exports.constantCaseAll = str => str.replace(/[^a-zA-Z0-9_]+/g, "_").replace(/[A-Z]+/g, "_$&").replace(/__+/g, "_").replace(/^[^a-zA-Z0-9]+/, "").replace(/^[0-9]/, "_$&") // GraphQL enums must not start with a number
.toUpperCase();
const formatInsideUnderscores = exports.formatInsideUnderscores = fn => str => {
const matches = str.match(/^(_*)([\s\S]*?)(_*)$/);
if (!matches) {
throw new Error("Impossible?"); // Satiate Flow
}
const [, start, middle, end] = matches;
return `${start}${fn(middle)}${end}`;
};
const upperFirst = exports.upperFirst = formatInsideUnderscores(_upperFirst2.default);
const camelCase = exports.camelCase = formatInsideUnderscores(_camelCase2.default);
const constantCase = exports.constantCase = formatInsideUnderscores(constantCaseAll);
const upperCamelCase = exports.upperCamelCase = str => upperFirst(camelCase(str));
const parseTags = exports.parseTags = str => {
return str.split(`\n`).reduce((prev, curr) => {
if (prev.text !== "") {
return (0, _assign2.default)({}, prev, {
return Object.assign({}, prev, {
text: `${prev.text}\n${curr}`

@@ -49,3 +16,3 @@ });

if (!match) {
return (0, _assign2.default)({}, prev, {
return Object.assign({}, prev, {
text: curr

@@ -56,4 +23,4 @@ });

const value = match[0] === curr ? true : curr.replace(match[0], "");
return (0, _assign2.default)({}, prev, {
tags: (0, _assign2.default)({}, prev.tags, {
return Object.assign({}, prev, {
tags: Object.assign({}, prev.tags, {
[key]: !prev.tags.hasOwnProperty(key) ? value : Array.isArray(prev.tags[key]) ? [...prev.tags[key], value] : [prev.tags[key], value]

@@ -60,0 +27,0 @@ })

@@ -6,7 +6,2 @@ "use strict";

});
var _promise = require("babel-runtime/core-js/promise");
var _promise2 = _interopRequireDefault(_promise);
exports.quacksLikePgPool = quacksLikePgPool;

@@ -79,4 +74,4 @@

});
releasePgClient = () => new _promise2.default((resolve, reject) => pgClient.end(err => err ? reject(err) : resolve()));
await new _promise2.default((resolve, reject) => pgClient.connect(err => err ? reject(err) : resolve()));
releasePgClient = () => new Promise((resolve, reject) => pgClient.end(err => err ? reject(err) : resolve()));
await new Promise((resolve, reject) => pgClient.connect(err => err ? reject(err) : resolve()));
} else {

@@ -83,0 +78,0 @@ throw new Error("You must provide a valid PG client configuration");

{
"name": "graphile-build-pg",
"version": "4.0.0-beta.2",
"version": "4.0.0-beta.4",
"description": "Build a GraphQL schema by reflection over a PostgreSQL schema. Easy to customize since it's built with plugins on graphile-build",

@@ -8,3 +8,3 @@ "main": "node8plus/index.js",

"test": "jest",
"prepublish": "mkdir -p node8plus && babel -s true --out-dir node8plus src && ../../node_modules/.bin/flow-copy-source src node8plus",
"prepublish": "mkdir -p node8plus && babel -s true --out-dir node8plus src && flow-copy-source src node8plus",
"watch": "mkdir -p node8plus && babel -s true --watch --out-dir node8plus src"

@@ -38,6 +38,5 @@ },

"dependencies": {
"babel-runtime": ">=6 <7",
"chalk": "^2.1.0",
"debug": ">=2 <3",
"graphile-build": "4.0.0-beta.2",
"graphile-build": "4.0.0-beta.4",
"graphql-iso-date": "^3.2.0",

@@ -47,8 +46,7 @@ "jsonwebtoken": "^8.1.1",

"lru-cache": "4.1.1",
"pg-range-parser": "^1.0.0",
"pg-sql2": "2.0.0",
"pluralize": "^5.0.0",
"postgres-interval": "1.1.1"
},
"peerDependencies": {
"graphql": ">=0.9 <0.14",
"pg": ">=6.1.0 <8"

@@ -59,3 +57,3 @@ },

"flow-copy-source": "^1.2.0",
"jest": "20.0.4"
"jest": "^20.0.4"
},

@@ -62,0 +60,0 @@ "jest": {

@@ -35,2 +35,7 @@ // @flow

import parseIdentifier from "./parseIdentifier";
import omit from "./omit";
export { parseIdentifier, omit };
export const defaultPlugins = [

@@ -103,2 +108,2 @@ PgBasicsPlugin,

export { upperFirst, camelCase, constantCase } from "./utils";
export { upperFirst, camelCase, constantCase } from "graphile-build";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc