grafeo-ogm 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,276 @@
1
+ import { int, isInt, isPoint } from 'neo4j-driver';
2
+ import { OGMError } from '../errors';
3
+ /**
4
+ * GraphQL scalar types whose Neo4j storage type is INTEGER (Long).
5
+ */
6
+ const INTEGER_SCALAR_TYPES = new Set(['Int', 'BigInt']);
7
+ /**
8
+ * Temporal scalar types → the Cypher constructor that parses their ISO
9
+ * string form into the native Neo4j temporal type. Writes wrap the
10
+ * *parameter* in the constructor instead of converting the value in JS,
11
+ * because Neo4j's own parsers handle everything JS `Date` cannot:
12
+ * nanosecond precision, bracket timezone names
13
+ * (`2024-01-15T10:30:00[America/New_York]`), and ISO-8601 durations.
14
+ */
15
+ const TEMPORAL_CONSTRUCTORS = {
16
+ DateTime: 'datetime',
17
+ LocalDateTime: 'localdatetime',
18
+ Date: 'date',
19
+ Time: 'time',
20
+ LocalTime: 'localtime',
21
+ Duration: 'duration',
22
+ };
23
+ /**
24
+ * Spatial scalar types → Cypher's `point()` constructor. Reads flatten a
25
+ * native Point into a plain `{ x, y[, z], srid }` object (ResultMapper),
26
+ * and `point()` accepts exactly that map back — `srid` key included — so
27
+ * wrapping makes the read → write round-trip exact. Without the wrapper
28
+ * the plain object is bound as a map property value, which Neo4j rejects
29
+ * at runtime ("Property values can only be of primitive types...").
30
+ */
31
+ const POINT_SCALAR_TYPES = new Set(['Point', 'CartesianPoint']);
32
+ /**
33
+ * Where-operator suffixes whose parameter is compared against the field
34
+ * value (`''` = plain equality) and therefore needs the same constructor
35
+ * treatment as writes. String operators (`_CONTAINS`, `_STARTS_WITH`,
36
+ * `_MATCHES`, ...) are excluded — their params are strings by definition.
37
+ */
38
+ const COMPARABLE_SUFFIXES = new Set([
39
+ '',
40
+ '_NOT',
41
+ '_GT',
42
+ '_GTE',
43
+ '_LT',
44
+ '_LTE',
45
+ '_IN',
46
+ '_NOT_IN',
47
+ ]);
48
+ function isTemporalStringInput(value) {
49
+ return typeof value === 'string';
50
+ }
51
+ /**
52
+ * A plain object shaped like `point()` input: cartesian (`x`/`y`) or
53
+ * geographic (`longitude`/`latitude`), optionally with `z`/`height` and
54
+ * `srid`/`crs`. Driver Point instances are NOT inputs — they pack
55
+ * natively and `point()` would reject them.
56
+ */
57
+ function isPointWriteInput(value) {
58
+ if (typeof value !== 'object' || value === null || Array.isArray(value))
59
+ return false;
60
+ if (isPoint(value) || isInt(value))
61
+ return false;
62
+ const candidate = value;
63
+ const cartesian = typeof candidate.x === 'number' && typeof candidate.y === 'number';
64
+ const geographic = typeof candidate.longitude === 'number' &&
65
+ typeof candidate.latitude === 'number';
66
+ return cartesian || geographic;
67
+ }
68
+ function resolveWriteConstructor(propDef) {
69
+ const temporal = TEMPORAL_CONSTRUCTORS[propDef.type];
70
+ if (temporal !== undefined)
71
+ return { fn: temporal, wraps: isTemporalStringInput, arrayMode: 'any' };
72
+ if (POINT_SCALAR_TYPES.has(propDef.type))
73
+ return { fn: 'point', wraps: isPointWriteInput, arrayMode: 'all' };
74
+ return undefined;
75
+ }
76
+ /**
77
+ * Decide whether a list of element values should be wrapped element-wise.
78
+ * `'any'` mode wraps as soon as one element is constructor input; `'all'`
79
+ * mode requires uniformity and throws on a mix, because the constructor
80
+ * cannot be applied to the already-native elements.
81
+ */
82
+ function decideElementsWrap(elements, ctor, propDef) {
83
+ const defined = elements.filter((el) => el !== null && el !== undefined);
84
+ if (defined.length === 0)
85
+ return false;
86
+ const matches = defined.filter((el) => ctor.wraps(el)).length;
87
+ if (matches === 0)
88
+ return false;
89
+ if (ctor.arrayMode === 'any')
90
+ return true;
91
+ if (matches !== defined.length)
92
+ throw new OGMError(`Mixed input representations for ${propDef.type} field "${propDef.name}": ` +
93
+ `some values are plain ${ctor.fn}() inputs, others are driver-native values. ` +
94
+ `${ctor.fn}() cannot be applied to an already-native value, so every value ` +
95
+ `must use the same representation.`);
96
+ return true;
97
+ }
98
+ /**
99
+ * Coerce a JS write value bound for an `Int`/`BigInt`-typed schema field
100
+ * into a Neo4j Integer so the stored property is a Long, not a Double.
101
+ *
102
+ * The driver packs EVERY JS `number` as a Bolt FLOAT64 (packstream:
103
+ * `typeof x === 'number'` → `packFloat`) — `disableLosslessIntegers`
104
+ * only affects the read direction. Reads convert Integer → number
105
+ * (ResultMapper), so without write-side coercion the round-trip is
106
+ * asymmetric: every OGM-written Int property lands as a Double. Once a
107
+ * field holds a mixed Long/Double population, Long-typed consumers break
108
+ * (e.g. `apoc.coll.sortMulti` throws `java.lang.Double cannot be cast to
109
+ * class java.lang.Long`).
110
+ *
111
+ * Non-integral numbers and non-integer strings for Int/BigInt fields
112
+ * throw instead of truncating or storing a String property, matching the
113
+ * v1.14 contract of rejecting inputs that would be silently corrupted.
114
+ * Values the coercion doesn't own — null/undefined, driver Integer
115
+ * instances, fields of any other scalar type, or fields absent from the
116
+ * schema — pass through untouched.
117
+ */
118
+ export function coerceWriteValue(value, propDef) {
119
+ if (propDef === undefined || value === null || value === undefined)
120
+ return value;
121
+ if (!INTEGER_SCALAR_TYPES.has(propDef.type))
122
+ return value;
123
+ if (propDef.isArray) {
124
+ if (!Array.isArray(value))
125
+ return value;
126
+ return value.map((element) => coerceIntegerElement(element, propDef));
127
+ }
128
+ return coerceIntegerElement(value, propDef);
129
+ }
130
+ function coerceIntegerElement(value, propDef) {
131
+ if (value === null || value === undefined)
132
+ return value;
133
+ // `int()` accepts strings in every driver major — `toString()` keeps
134
+ // bigint inputs working regardless of the installed driver's overloads.
135
+ if (typeof value === 'bigint')
136
+ return int(value.toString());
137
+ if (typeof value === 'number') {
138
+ if (!Number.isInteger(value))
139
+ throw new OGMError(`Expected an integer for ${propDef.type} field "${propDef.name}" but got ${value}. ` +
140
+ `Storing it would corrupt the property's integer type; pass a whole number ` +
141
+ `(or declare the field as Float).`);
142
+ return int(value);
143
+ }
144
+ if (typeof value === 'string') {
145
+ // The generated BigInt scalar declares `input: string` (64-bit values
146
+ // don't fit a JS number), so integer strings are the CANONICAL input
147
+ // shape for BigInt fields — binding them raw would store a String
148
+ // property. Same reject-don't-corrupt rule as numbers for anything
149
+ // that isn't a plain base-10 integer literal.
150
+ if (!/^-?\d+$/.test(value))
151
+ throw new OGMError(`Expected an integer for ${propDef.type} field "${propDef.name}" but got the string "${value}". ` +
152
+ `Pass a base-10 integer literal string, a whole number, or a bigint.`);
153
+ return int(value);
154
+ }
155
+ // Already a driver Integer — pass through unchanged.
156
+ if (isInt(value))
157
+ return value;
158
+ return value;
159
+ }
160
+ /**
161
+ * Wrap a write RHS expression (`$param`, or an UNWIND item reference) in
162
+ * the field's Cypher constructor — temporal (`datetime()`, ...) for
163
+ * ISO-string inputs, `point()` for plain point maps — so the stored
164
+ * property is the native type the schema declares. Reads convert native
165
+ * values to plain JS (ResultMapper); this is the write half of the same
166
+ * round-trip symmetry issue #5 fixed for integers.
167
+ *
168
+ * Driver-native values (temporal instances, Point instances) bind raw.
169
+ * List fields wrap element-wise via a list comprehension, following the
170
+ * constructor's element rule (see WriteConstructor.arrayMode).
171
+ */
172
+ export function wrapWriteExpr(expr, value, propDef) {
173
+ if (propDef === undefined)
174
+ return expr;
175
+ const ctor = resolveWriteConstructor(propDef);
176
+ if (ctor === undefined)
177
+ return expr;
178
+ if (propDef.isArray) {
179
+ if (!Array.isArray(value))
180
+ return expr;
181
+ if (!decideElementsWrap(value, ctor, propDef))
182
+ return expr;
183
+ return `[wc_t IN ${expr} | ${ctor.fn}(wc_t)]`;
184
+ }
185
+ if (!ctor.wraps(value))
186
+ return expr;
187
+ return `${ctor.fn}(${expr})`;
188
+ }
189
+ /**
190
+ * Constructor wrapping for UNWIND item references (`item.prop`,
191
+ * `connItem.edge.prop`), where ONE Cypher expression serves EVERY item in
192
+ * the batch: the wrap decision must hold for all items' values for the
193
+ * key. A column mixing constructor inputs with driver-native values
194
+ * throws — a single expression cannot be correct for both.
195
+ */
196
+ export function wrapListItemExpr(expr, values, propDef) {
197
+ if (propDef === undefined)
198
+ return expr;
199
+ const ctor = resolveWriteConstructor(propDef);
200
+ if (ctor === undefined)
201
+ return expr;
202
+ if (propDef.isArray) {
203
+ const flattened = values
204
+ .filter((v) => Array.isArray(v))
205
+ .flat();
206
+ if (flattened.length === 0)
207
+ return expr;
208
+ if (!decideElementsWrap(flattened, ctor, propDef))
209
+ return expr;
210
+ return `[wc_t IN ${expr} | ${ctor.fn}(wc_t)]`;
211
+ }
212
+ const defined = values.filter((v) => v !== null && v !== undefined);
213
+ if (defined.length === 0)
214
+ return expr;
215
+ const matches = defined.filter((v) => ctor.wraps(v)).length;
216
+ if (matches === 0)
217
+ return expr;
218
+ if (matches !== defined.length)
219
+ throw new OGMError(`Mixed input types for ${propDef.type} field "${propDef.name}": some items pass ` +
220
+ `plain ${ctor.fn}() inputs, others pass driver-native values. Batched writes ` +
221
+ `share one Cypher expression per field, so every item must use the same ` +
222
+ `representation.`);
223
+ return `${ctor.fn}(${expr})`;
224
+ }
225
+ /**
226
+ * Wrap a WHERE parameter reference for a constructor-typed field. With
227
+ * properties stored natively, comparing them to a raw string/map param is
228
+ * a cross-type comparison — Neo4j evaluates it to NULL and silently
229
+ * drops the row. `suffix` is the operator suffix (`''` for plain
230
+ * equality); only comparison-shaped operators wrap, and `_IN`/`_NOT_IN`
231
+ * wrap their list param element-wise.
232
+ */
233
+ export function wrapWhereParam(paramRef, value, propDef, suffix) {
234
+ if (propDef === undefined)
235
+ return paramRef;
236
+ const ctor = resolveWriteConstructor(propDef);
237
+ if (ctor === undefined)
238
+ return paramRef;
239
+ if (!COMPARABLE_SUFFIXES.has(suffix))
240
+ return paramRef;
241
+ if (suffix === '_IN' || suffix === '_NOT_IN') {
242
+ if (!Array.isArray(value))
243
+ return paramRef;
244
+ if (!decideElementsWrap(value, ctor, propDef))
245
+ return paramRef;
246
+ return `[wc_t IN ${paramRef} | ${ctor.fn}(wc_t)]`;
247
+ }
248
+ if (!ctor.wraps(value))
249
+ return paramRef;
250
+ return `${ctor.fn}(${paramRef})`;
251
+ }
252
+ /**
253
+ * Materialize a parsed `@default` into a driver-ready bound value. The
254
+ * parser stores every default as a string (`'true'`, `'5'`, `'WELCOME'`);
255
+ * conversion is by declared scalar type, and Int/BigInt defaults route
256
+ * through the same Integer coercion as user input. Temporal defaults stay
257
+ * ISO strings here — they get their constructor wrapper at the binding
258
+ * site like any other temporal write.
259
+ */
260
+ export function resolveDefaultWriteValue(propDef) {
261
+ const raw = propDef.defaultValue;
262
+ if (raw === undefined)
263
+ return undefined;
264
+ switch (propDef.type) {
265
+ case 'Boolean':
266
+ return raw === 'true';
267
+ case 'Float':
268
+ return Number(raw);
269
+ case 'Int':
270
+ case 'BigInt':
271
+ return coerceWriteValue(raw, propDef);
272
+ default:
273
+ return raw;
274
+ }
275
+ }
276
+ //# sourceMappingURL=write-coercion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-coercion.js","sourceRoot":"","sources":["../../../src/utils/write-coercion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC;;GAEG;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAA2B;IACpD,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,eAAe;IAC9B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC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C3C,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC;YAAE,OAAO,QAAQ,CAAC;QAC/D,OAAO,YAAY,QAAQ,MAAM,IAAI,CAAC,EAAE,SAAS,CAAC;IACpD,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,QAAQ,GAAG,CAAC;AACnC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAA2B;IAClE,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,GAAG,KAAK,MAAM,CAAC;QACxB,KAAK,OAAO;YACV,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,KAAK,KAAK,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACxC;YACE,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grafeo-ogm",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "Type-safe Neo4j ORM / OGM for TypeScript. Define your graph in GraphQL SDL, get fully typed Prisma-like CRUD, optimized Cypher, and zero-config code generation. Community successor to @neo4j/graphql-ogm.",
5
5
  "license": "MIT",
6
6
  "author": "Alejandro Guzman",