grafeo-ogm 1.13.0 → 2.0.0

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +221 -0
  2. package/README.md +70 -0
  3. package/dist/cjs/compilers/fulltext.compiler.d.ts.map +1 -1
  4. package/dist/cjs/compilers/fulltext.compiler.js +30 -14
  5. package/dist/cjs/compilers/fulltext.compiler.js.map +1 -1
  6. package/dist/cjs/compilers/mutation.compiler.d.ts +54 -1
  7. package/dist/cjs/compilers/mutation.compiler.d.ts.map +1 -1
  8. package/dist/cjs/compilers/mutation.compiler.js +134 -32
  9. package/dist/cjs/compilers/mutation.compiler.js.map +1 -1
  10. package/dist/cjs/compilers/where.compiler.d.ts.map +1 -1
  11. package/dist/cjs/compilers/where.compiler.js +7 -0
  12. package/dist/cjs/compilers/where.compiler.js.map +1 -1
  13. package/dist/cjs/generator/type-emitters/fulltext-emitter.js +24 -8
  14. package/dist/cjs/generator/type-emitters/fulltext-emitter.js.map +1 -1
  15. package/dist/cjs/generator/type-emitters/sort-options-emitter.d.ts +2 -1
  16. package/dist/cjs/generator/type-emitters/sort-options-emitter.d.ts.map +1 -1
  17. package/dist/cjs/generator/type-emitters/sort-options-emitter.js +12 -5
  18. package/dist/cjs/generator/type-emitters/sort-options-emitter.js.map +1 -1
  19. package/dist/cjs/generator/type-emitters/utility-types.d.ts.map +1 -1
  20. package/dist/cjs/generator/type-emitters/utility-types.js +20 -0
  21. package/dist/cjs/generator/type-emitters/utility-types.js.map +1 -1
  22. package/dist/cjs/interface-model.d.ts.map +1 -1
  23. package/dist/cjs/interface-model.js +9 -1
  24. package/dist/cjs/interface-model.js.map +1 -1
  25. package/dist/cjs/model.d.ts.map +1 -1
  26. package/dist/cjs/model.js +12 -3
  27. package/dist/cjs/model.js.map +1 -1
  28. package/dist/cjs/ogm.d.ts.map +1 -1
  29. package/dist/cjs/ogm.js +6 -1
  30. package/dist/cjs/ogm.js.map +1 -1
  31. package/dist/cjs/utils/cypher-sort-projection.d.ts +3 -0
  32. package/dist/cjs/utils/cypher-sort-projection.d.ts.map +1 -1
  33. package/dist/cjs/utils/cypher-sort-projection.js +13 -1
  34. package/dist/cjs/utils/cypher-sort-projection.js.map +1 -1
  35. package/dist/cjs/utils/validation.d.ts +79 -0
  36. package/dist/cjs/utils/validation.d.ts.map +1 -1
  37. package/dist/cjs/utils/validation.js +554 -0
  38. package/dist/cjs/utils/validation.js.map +1 -1
  39. package/dist/esm/compilers/fulltext.compiler.d.ts.map +1 -1
  40. package/dist/esm/compilers/fulltext.compiler.js +31 -15
  41. package/dist/esm/compilers/fulltext.compiler.js.map +1 -1
  42. package/dist/esm/compilers/mutation.compiler.d.ts +54 -1
  43. package/dist/esm/compilers/mutation.compiler.d.ts.map +1 -1
  44. package/dist/esm/compilers/mutation.compiler.js +134 -32
  45. package/dist/esm/compilers/mutation.compiler.js.map +1 -1
  46. package/dist/esm/compilers/where.compiler.d.ts.map +1 -1
  47. package/dist/esm/compilers/where.compiler.js +8 -1
  48. package/dist/esm/compilers/where.compiler.js.map +1 -1
  49. package/dist/esm/generator/type-emitters/fulltext-emitter.js +24 -8
  50. package/dist/esm/generator/type-emitters/fulltext-emitter.js.map +1 -1
  51. package/dist/esm/generator/type-emitters/sort-options-emitter.d.ts +2 -1
  52. package/dist/esm/generator/type-emitters/sort-options-emitter.d.ts.map +1 -1
  53. package/dist/esm/generator/type-emitters/sort-options-emitter.js +12 -5
  54. package/dist/esm/generator/type-emitters/sort-options-emitter.js.map +1 -1
  55. package/dist/esm/generator/type-emitters/utility-types.d.ts.map +1 -1
  56. package/dist/esm/generator/type-emitters/utility-types.js +20 -0
  57. package/dist/esm/generator/type-emitters/utility-types.js.map +1 -1
  58. package/dist/esm/interface-model.d.ts.map +1 -1
  59. package/dist/esm/interface-model.js +9 -1
  60. package/dist/esm/interface-model.js.map +1 -1
  61. package/dist/esm/model.d.ts.map +1 -1
  62. package/dist/esm/model.js +12 -3
  63. package/dist/esm/model.js.map +1 -1
  64. package/dist/esm/ogm.d.ts.map +1 -1
  65. package/dist/esm/ogm.js +6 -1
  66. package/dist/esm/ogm.js.map +1 -1
  67. package/dist/esm/utils/cypher-sort-projection.d.ts +3 -0
  68. package/dist/esm/utils/cypher-sort-projection.d.ts.map +1 -1
  69. package/dist/esm/utils/cypher-sort-projection.js +14 -2
  70. package/dist/esm/utils/cypher-sort-projection.js.map +1 -1
  71. package/dist/esm/utils/validation.d.ts +79 -0
  72. package/dist/esm/utils/validation.d.ts.map +1 -1
  73. package/dist/esm/utils/validation.js +549 -0
  74. package/dist/esm/utils/validation.js.map +1 -1
  75. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cypher-sort-projection.d.ts","sourceRoot":"","sources":["../../../src/utils/cypher-sort-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAO1D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,MAAM,CAQR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAClE,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACtC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAsCnC"}
1
+ {"version":3,"file":"cypher-sort-projection.d.ts","sourceRoot":"","sources":["../../../src/utils/cypher-sort-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAS1D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,MAAM,CAQR;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAClE,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACtC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAgDnC"}
@@ -1,4 +1,4 @@
1
- import { assertSafeIdentifier, assertSortDirection, escapeIdentifier, } from './validation';
1
+ import { assertPlainObject, assertSafeIdentifier, assertSingleSortKey, assertSortDirection, escapeIdentifier, } from './validation';
2
2
  /**
3
3
  * Builds the `CALL { ... }` subquery used to project an `@cypher` field
4
4
  * for `ORDER BY`. The user's statement is embedded verbatim with `this`
@@ -39,6 +39,9 @@ export function buildCypherSortProjection(statement, nodeVar) {
39
39
  *
40
40
  * The returned `pre` string is intended to be appended BEFORE the `RETURN`,
41
41
  * and `orderBy` to be appended AFTER it.
42
+ *
43
+ * Each entry must carry exactly ONE ordering key — precedence comes from the
44
+ * entry's position in the array. Multi-key entries throw (`assertSingleSortKey`).
42
45
  */
43
46
  export function compileSortClause(args) {
44
47
  const { sort, nodeVar, propertyLookup, preserveVars = [] } = args;
@@ -46,11 +49,20 @@ export function compileSortClause(args) {
46
49
  const sortItems = [];
47
50
  const carriedAliases = [];
48
51
  for (const sortObj of sort) {
52
+ // `Object.entries(null)` is a bare TypeError from inside the compiler;
53
+ // callers expect OGMError for every malformed input on this path.
54
+ assertPlainObject(sortObj, 'Sort entry');
49
55
  const entries = Object.entries(sortObj);
56
+ // A zero-key entry contributes no ordering (rather than a wrong one), so
57
+ // it stays a silent skip. A multi-key entry is always a mistake.
50
58
  if (entries.length === 0)
51
59
  continue;
60
+ // Validate every key, not just the surviving one, so `assertSingleSortKey`
61
+ // only ever interpolates identifier-shaped strings into its message.
62
+ for (const [key] of entries)
63
+ assertSafeIdentifier(key, 'sort field');
64
+ assertSingleSortKey(entries);
52
65
  const [field, direction] = entries[0];
53
- assertSafeIdentifier(field, 'sort field');
54
66
  const validDirection = assertSortDirection(direction);
55
67
  const propDef = propertyLookup(field);
56
68
  if (propDef?.isCypher && propDef.cypherStatement) {
@@ -1 +1 @@
1
- {"version":3,"file":"cypher-sort-projection.js","sourceRoot":"","sources":["../../../src/utils/cypher-sort-projection.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAAiB,EACjB,OAAe;IAEf,OAAO;QACL,QAAQ;QACR,UAAU,OAAO,EAAE;QACnB,UAAU,OAAO,UAAU;QAC3B,KAAK,SAAS,EAAE;QAChB,GAAG;KACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAKjC;IACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;IAClE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAiC,CAAC,CAAC;QA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QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QACxB,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KACpE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"cypher-sort-projection.js","sourceRoot":"","sources":["../../../src/utils/cypher-sort-projection.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAAiB,EACjB,OAAe;IAEf,OAAO;QACL,QAAQ;QACR,UAAU,OAAO,EAAE;QACnB,UAAU,OAAO,UAAU;QAC3B,KAAK,SAAS,EAAE;QAChB,GAAG;KACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAKjC;IACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;IAClE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE,CAAC;QAC3B,uEAAuE;QACvE,kEAAkE;QAClE,iBAAiB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QAEzC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAiC,CAAC,CAAC;QAClE,yEAAyE;QACzE,iEAAiE;QACjE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnC,2EAA2E;QAC3E,qEAAqE;QACrE,KAAK,MAAM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;QACL,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QACxB,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;KACpE,CAAC;AACJ,CAAC"}
@@ -44,11 +44,83 @@ export declare function assertSafeLabel(label: string): string;
44
44
  * Validate sort direction is strictly ASC or DESC.
45
45
  */
46
46
  export declare function assertSortDirection(direction: string): 'ASC' | 'DESC';
47
+ /**
48
+ * Assert that a single `sort` array entry carries exactly one ordering key.
49
+ *
50
+ * v2.0.0 — pre-2.0.0 `compileSortClause` read only `Object.entries(entry)[0]`
51
+ * and silently discarded the rest, so `[{ a: 'ASC', b: 'DESC' }]` compiled to
52
+ * `ORDER BY n.a ASC` with no error and no log: a successful query answering a
53
+ * different question. Which key survived depended purely on source insertion
54
+ * order.
55
+ *
56
+ * Ordering precedence must be carried by ARRAY POSITION, never by object key
57
+ * order. Honoring every key would only move the bug: graphql-js
58
+ * `coerceInputValue` rebuilds input objects by iterating the schema's field
59
+ * definitions, so the key order a client wrote is already gone by the time the
60
+ * object reaches the OGM.
61
+ *
62
+ * Callers must validate each key with `assertSafeIdentifier` BEFORE calling
63
+ * this, so the keys interpolated into the message are known-safe.
64
+ */
65
+ export declare function assertSingleSortKey(entries: ReadonlyArray<[string, unknown]>): void;
66
+ /**
67
+ * Assert that a fulltext input object references exactly one index.
68
+ *
69
+ * v2.0.0 — the same silent-truncation defect fixed for `sort` (see
70
+ * `assertSingleSortKey`) also lived in `FulltextCompiler`, at three sites that
71
+ * each guarded the empty case and then read `Object.keys(input)[0]`. A leaf
72
+ * naming two indexes searched only the first and dropped the second with no
73
+ * error, so the query returned a strictly WIDER result set than asked for — a
74
+ * filter that silently stops filtering.
75
+ *
76
+ * Multiple indexes are expressed with the existing `AND` / `OR` combinators,
77
+ * which compile to correlated subqueries and `UNION` respectively.
78
+ *
79
+ * Phrase values are never echoed: they are user data and may carry control
80
+ * characters or sensitive content. Callers must validate each key with
81
+ * `assertSafeIdentifier` BEFORE calling this.
82
+ */
83
+ export declare function assertSingleFulltextKey(entries: ReadonlyArray<[string, unknown]>, subject: string): void;
84
+ /**
85
+ * Assert that a fulltext input carrying `OR` / `AND` / `NOT` carries nothing
86
+ * else alongside it.
87
+ *
88
+ * v2.0.0 — the dispatch in `FulltextCompiler.compileNode` tests the operators
89
+ * in order (`OR`, then `AND`, then `NOT`) and returns on the first hit, so any
90
+ * remaining top-level key was silently discarded:
91
+ *
92
+ * - `{ OR: [...], AND: [...] }` compiled the OR branch only.
93
+ * - `{ OR: [...], SomeIndex: {...} }` compiled the OR branch only.
94
+ * - `{ NOT: {...}, AND: [...] }` compiled the AND branch only — an exclusion
95
+ * filter vanished entirely, which inverts the caller's intent rather than
96
+ * merely widening the result set.
97
+ *
98
+ * Operators nest instead of stacking: `{ AND: [{ OR: [...] }, { ... }] }`.
99
+ *
100
+ * Only the recognised operator names — fixed literals — are interpolated into
101
+ * the message. Sibling keys are counted, never echoed, because they have not
102
+ * been identifier-validated at this point in the pipeline.
103
+ */
104
+ export declare function assertSingleFulltextOperator(keys: readonly string[]): void;
47
105
  /**
48
106
  * Type guard that narrows an unknown value to a plain object.
49
107
  * Returns false for null, arrays, and non-object primitives.
50
108
  */
51
109
  export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
110
+ /**
111
+ * Assert that a value the compilers are about to enumerate — with
112
+ * `Object.entries`, `Object.keys`, or the `in` operator — is a plain object.
113
+ *
114
+ * v2.0.0 — without this, `sort: [null]` surfaced as a bare
115
+ * `TypeError: Cannot convert undefined or null to object` thrown from deep
116
+ * inside the compiler, and fulltext inputs failed similarly on `'OR' in input`.
117
+ * Both escaped `catch (e) { if (e instanceof OGMError) … }`, even though every
118
+ * other malformed input on those paths is an `OGMError`.
119
+ *
120
+ * Only the value's KIND is reported, never the value itself — the caller may
121
+ * have handed us anything.
122
+ */
123
+ export declare function assertPlainObject(value: unknown, subject: string): void;
52
124
  /**
53
125
  * Merge parameter records into the target. Skips merge if `source` is empty
54
126
  * or undefined. Returns the target for chaining.
@@ -57,4 +129,11 @@ export declare function isPlainObject(value: unknown): value is Record<string, u
57
129
  * declarative and centralize parameter accumulation logic.
58
130
  */
59
131
  export declare function mergeParams(target: Record<string, unknown>, source: Record<string, unknown> | undefined): Record<string, unknown>;
132
+ /**
133
+ * Assert that a `_MATCHES` regex pattern is provably free of catastrophic
134
+ * backtracking. Throws `OGMError` on anything it cannot prove linear. Only
135
+ * string values reach here; the value is already parameterized, so this is a
136
+ * semantic guard on the operator, never string interpolation.
137
+ */
138
+ export declare function assertSafeRegexPattern(pattern: string, context: string): void;
60
139
  //# sourceMappingURL=validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAKhE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAG1E;AAKD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAKzE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAI3D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAMrE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAA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