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

@neo4j/cypher-builder

Package Overview
Dependencies
Maintainers
7
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j/cypher-builder - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

2

dist/clauses/Call.d.ts

@@ -17,3 +17,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/call-subquery/)
* @group Clauses
* @category Clauses
*/

@@ -20,0 +20,0 @@ export declare class Call extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/call-subquery/)
* @group Clauses
* @category Clauses
*/

@@ -49,0 +49,0 @@ let Call = class Call extends Clause_1.Clause {

@@ -16,3 +16,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/create/)
* @group Clauses
* @category Clauses
*/

@@ -19,0 +19,0 @@ export declare class Create extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/create/)
* @group Clauses
* @category Clauses
*/

@@ -46,0 +46,0 @@ let Create = Create_1 = class Create extends Clause_1.Clause {

@@ -22,3 +22,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/foreach/)
* @group Clauses
* @category Clauses
*/

@@ -25,0 +25,0 @@ export declare class Foreach extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/foreach/)
* @group Clauses
* @category Clauses
*/

@@ -44,0 +44,0 @@ let Foreach = class Foreach extends Clause_1.Clause {

@@ -19,3 +19,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/match/)
* @group Clauses
* @category Clauses
*/

@@ -52,3 +52,3 @@ export declare class Match extends Clause {

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/optional-match/)
* @group Clauses
* @category Clauses
*/

@@ -55,0 +55,0 @@ export declare class OptionalMatch extends Match {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/match/)
* @group Clauses
* @category Clauses
*/

@@ -110,3 +110,3 @@ let Match = Match_1 = class Match extends Clause_1.Clause {

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/optional-match/)
* @group Clauses
* @category Clauses
*/

@@ -113,0 +113,0 @@ class OptionalMatch extends Match {

@@ -17,3 +17,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/merge/)
* @group Clauses
* @category Clauses
*/

@@ -20,0 +20,0 @@ export declare class Merge extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/merge/)
* @group Clauses
* @category Clauses
*/

@@ -47,0 +47,0 @@ let Merge = Merge_1 = class Merge extends Clause_1.Clause {

@@ -0,5 +1,5 @@

import type { CypherEnvironment } from "../Environment";
import { Clause } from "./Clause";
import { WithOrder } from "./mixins/sub-clauses/WithOrder";
import type { ProjectionColumn } from "./sub-clauses/Projection";
import type { CypherEnvironment } from "../Environment";
import { Clause } from "./Clause";
export interface Return extends WithOrder {

@@ -9,3 +9,3 @@ }

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/return/)
* @group Clauses
* @category Clauses
*/

@@ -12,0 +12,0 @@ export declare class Return extends Clause {

@@ -28,10 +28,10 @@ "use strict";

exports.Return = void 0;
const compile_cypher_if_exists_1 = require("../utils/compile-cypher-if-exists");
const Clause_1 = require("./Clause");
const WithOrder_1 = require("./mixins/sub-clauses/WithOrder");
const Projection_1 = require("./sub-clauses/Projection");
const mixin_1 = require("./utils/mixin");
const Projection_1 = require("./sub-clauses/Projection");
const Clause_1 = require("./Clause");
const compile_cypher_if_exists_1 = require("../utils/compile-cypher-if-exists");
/**
* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/return/)
* @group Clauses
* @category Clauses
*/

@@ -38,0 +38,0 @@ let Return = class Return extends Clause_1.Clause {

@@ -6,3 +6,2 @@ import { CypherASTNode } from "../../CypherASTNode";

private wherePredicate;
protected whereClause: string;
constructor(parent: CypherASTNode | undefined, whereInput: Predicate);

@@ -9,0 +8,0 @@ and(op: Predicate): void;

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

super(parent);
this.whereClause = "WHERE";
this.wherePredicate = whereInput;

@@ -30,0 +29,0 @@ this.addChildren(this.wherePredicate);

@@ -5,3 +5,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/union/)
* @group Clauses
* @category Clauses
*/

@@ -8,0 +8,0 @@ export declare class Union extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/union/)
* @group Clauses
* @category Clauses
*/

@@ -28,0 +28,0 @@ class Union extends Clause_1.Clause {

@@ -16,3 +16,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/unwind/)
* @group Clauses
* @category Clauses
*/

@@ -19,0 +19,0 @@ export declare class Unwind extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/unwind/)
* @group Clauses
* @category Clauses
*/

@@ -46,0 +46,0 @@ let Unwind = Unwind_1 = class Unwind extends Clause_1.Clause {

@@ -5,3 +5,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/5/clauses/use/)
* @group Clauses
* @category Clauses
*/

@@ -8,0 +8,0 @@ export declare class Use extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/5/clauses/use/)
* @group Clauses
* @category Clauses
*/

@@ -28,0 +28,0 @@ class Use extends Clause_1.Clause {

@@ -5,3 +5,3 @@ import type { CypherASTNode } from "../../CypherASTNode";

/** The result of multiple clauses concatenated with {@link concat}
* @group Clauses
* @category Clauses
*/

@@ -25,4 +25,4 @@ export declare class CompositeClause extends Clause {

/** Concatenates multiple {@link Clause | clauses} into a single clause
* @group Clauses
* @category Clauses
*/
export declare function concat(...clauses: Array<Clause | undefined>): CompositeClause;

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

/** The result of multiple clauses concatenated with {@link concat}
* @group Clauses
* @category Clauses
*/

@@ -88,3 +88,3 @@ class CompositeClause extends Clause_1.Clause {

/** Concatenates multiple {@link Clause | clauses} into a single clause
* @group Clauses
* @category Clauses
*/

@@ -91,0 +91,0 @@ function concat(...clauses) {

@@ -19,3 +19,3 @@ import type { CypherEnvironment } from "../Environment";

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/with/)
* @group Clauses
* @category Clauses
*/

@@ -22,0 +22,0 @@ export declare class With extends Clause {

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

* @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/clauses/with/)
* @group Clauses
* @category Clauses
*/

@@ -46,0 +46,0 @@ let With = With_1 = class With extends Clause_1.Clause {

import type { Variable } from "..";
import type { CypherEnvironment } from "../Environment";
import { WithWhere } from "../clauses/mixins/sub-clauses/WithWhere";
import { NodeRef } from "../references/NodeRef";

@@ -7,2 +8,4 @@ import type { RelationshipProperties, RelationshipRef } from "../references/RelationshipRef";

import { PatternElement } from "./PatternElement";
export interface PartialPattern extends WithWhere {
}
type LengthOption = number | "*" | {

@@ -9,0 +12,0 @@ min: number;

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

*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PartialPattern = void 0;
const WithWhere_1 = require("../clauses/mixins/sub-clauses/WithWhere");
const mixin_1 = require("../clauses/utils/mixin");
const label_expressions_1 = require("../expressions/labels/label-expressions");
const NodeRef_1 = require("../references/NodeRef");
const compile_cypher_if_exists_1 = require("../utils/compile-cypher-if-exists");
const escape_1 = require("../utils/escape");

@@ -31,3 +40,3 @@ const Pattern_1 = require("./Pattern");

*/
class PartialPattern extends PatternElement_1.PatternElement {
let PartialPattern = class PartialPattern extends PatternElement_1.PatternElement {
constructor(rel, previous) {

@@ -78,6 +87,7 @@ super(rel);

const propertiesStr = this.properties ? this.serializeParameters(this.properties, env) : "";
const whereStr = (0, compile_cypher_if_exists_1.compileCypherIfExists)(this.whereSubClause, env, { prefix: " " });
const lengthStr = this.generateLengthStr();
const leftArrow = this.direction === "left" ? "<-" : "-";
const rightArrow = this.direction === "right" ? "->" : "-";
return `${prevStr}${leftArrow}[${relStr}${typeStr}${lengthStr}${propertiesStr}]${rightArrow}`;
return `${prevStr}${leftArrow}[${relStr}${typeStr}${lengthStr}${whereStr}${propertiesStr}]${rightArrow}`;
}

@@ -109,3 +119,6 @@ generateLengthStr() {

}
}
};
exports.PartialPattern = PartialPattern;
exports.PartialPattern = PartialPattern = __decorate([
(0, mixin_1.mixin)(WithWhere_1.WithWhere)
], PartialPattern);
import type { Expr } from "..";
import type { CypherEnvironment } from "../Environment";
import { WithWhere } from "../clauses/mixins/sub-clauses/WithWhere";
import type { NodeRef } from "../references/NodeRef";

@@ -8,2 +9,4 @@ import { RelationshipRef } from "../references/RelationshipRef";

import { PatternElement } from "./PatternElement";
export interface Pattern extends WithWhere {
}
/** Represents a pattern of a single node or n-relationships to be used in clauses.

@@ -10,0 +13,0 @@ * @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/syntax/patterns/)

@@ -20,7 +20,16 @@ "use strict";

*/
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pattern = void 0;
const WithWhere_1 = require("../clauses/mixins/sub-clauses/WithWhere");
const mixin_1 = require("../clauses/utils/mixin");
const label_expressions_1 = require("../expressions/labels/label-expressions");
const RelationshipRef_1 = require("../references/RelationshipRef");
const add_label_token_1 = require("../utils/add-label-token");
const compile_cypher_if_exists_1 = require("../utils/compile-cypher-if-exists");
const escape_1 = require("../utils/escape");

@@ -33,3 +42,3 @@ const PartialPattern_1 = require("./PartialPattern");

*/
class Pattern extends PatternElement_1.PatternElement {
let Pattern = class Pattern extends PatternElement_1.PatternElement {
constructor(node, previous) {

@@ -71,3 +80,4 @@ super(node);

const nodeLabelStr = this.withLabels ? this.getNodeLabelsString(this.element, env) : "";
return `${prevStr}(${nodeRefId}${nodeLabelStr}${propertiesStr})`;
const whereStr = (0, compile_cypher_if_exists_1.compileCypherIfExists)(this.whereSubClause, env, { prefix: " " });
return `${prevStr}(${nodeRefId}${nodeLabelStr}${propertiesStr}${whereStr})`;
}

@@ -91,3 +101,6 @@ getNodeLabelsString(node, env) {

}
}
};
exports.Pattern = Pattern;
exports.Pattern = Pattern = __decorate([
(0, mixin_1.mixin)(WithWhere_1.WithWhere)
], Pattern);
{
"name": "@neo4j/cypher-builder",
"version": "1.11.0",
"version": "1.12.0",
"description": "A programmatic API for building Cypher queries for Neo4j",

@@ -50,4 +50,4 @@ "exports": "./dist/index.js",

"@types/node": "^20.8.9",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"eslint": "^8.43.0",

@@ -58,3 +58,3 @@ "eslint-config-prettier": "^9.0.0",

"neo4j-driver": "^5.9.2",
"prettier": "^3.0.3",
"prettier": "^3.2.5",
"ts-jest": "^29.1.1",

@@ -61,0 +61,0 @@ "typedoc": "^0.25.2",

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