@sequenceholdings/orm 2.1.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.
Files changed (69) hide show
  1. package/README.md +38 -1
  2. package/dist/authoring.cjs +1358 -45
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +223 -2
  5. package/dist/authoring.d.ts +223 -2
  6. package/dist/authoring.js +1349 -47
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.cjs +662 -38
  9. package/dist/canonical.cjs.map +1 -1
  10. package/dist/canonical.d.cts +696 -53
  11. package/dist/canonical.d.ts +696 -53
  12. package/dist/canonical.js +647 -39
  13. package/dist/canonical.js.map +1 -1
  14. package/dist/cli.cjs +1808 -247
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +1809 -248
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.cjs +90 -25
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +39 -22
  21. package/dist/client.d.ts +39 -22
  22. package/dist/client.js +87 -26
  23. package/dist/client.js.map +1 -1
  24. package/dist/compiler.cjs +1325 -285
  25. package/dist/compiler.cjs.map +1 -1
  26. package/dist/compiler.d.cts +23 -2
  27. package/dist/compiler.d.ts +23 -2
  28. package/dist/compiler.js +1325 -285
  29. package/dist/compiler.js.map +1 -1
  30. package/dist/constants-YoFGjIBM.d.cts +99 -0
  31. package/dist/constants-YoFGjIBM.d.ts +99 -0
  32. package/dist/dynamic-input.d.cts +1 -0
  33. package/dist/dynamic-input.d.ts +1 -0
  34. package/dist/index.cjs +1605 -140
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +230 -113
  37. package/dist/index.d.ts +230 -113
  38. package/dist/index.js +1583 -142
  39. package/dist/index.js.map +1 -1
  40. package/dist/ir.cjs +727 -38
  41. package/dist/ir.cjs.map +1 -1
  42. package/dist/ir.d.cts +539 -21
  43. package/dist/ir.d.ts +539 -21
  44. package/dist/ir.js +722 -39
  45. package/dist/ir.js.map +1 -1
  46. package/dist/{naming-DCn94LJ4.d.ts → naming-CPfx7EfF.d.ts} +14 -1
  47. package/dist/{naming-DPglwzkB.d.cts → naming-CU9ThP_E.d.cts} +14 -1
  48. package/dist/policy-1iZbGnZZ.d.cts +24 -0
  49. package/dist/policy-1iZbGnZZ.d.ts +24 -0
  50. package/dist/predicate-v2.cjs +726 -42
  51. package/dist/predicate-v2.cjs.map +1 -1
  52. package/dist/predicate-v2.d.cts +2 -1
  53. package/dist/predicate-v2.d.ts +2 -1
  54. package/dist/predicate-v2.js +726 -42
  55. package/dist/predicate-v2.js.map +1 -1
  56. package/dist/sdl.cjs +858 -54
  57. package/dist/sdl.cjs.map +1 -1
  58. package/dist/sdl.d.cts +7 -3
  59. package/dist/sdl.d.ts +7 -3
  60. package/dist/sdl.js +856 -55
  61. package/dist/sdl.js.map +1 -1
  62. package/package.json +9 -4
  63. package/templates/orm-namespace/CLAUDE.md +6 -4
  64. package/templates/orm-namespace/codegen.preset.d.cts +7 -0
  65. package/templates/orm-namespace/codegen.ts +2 -1
  66. package/templates/orm-namespace/graphql/example/queries.ts +4 -3
  67. package/templates/orm-namespace/package.json +2 -1
  68. package/templates/orm-namespace/schema/tables.ts +3 -2
  69. package/templates/orm-namespace/sequence.config.ts +7 -11
@@ -3,8 +3,10 @@ import { ClaimKey, PredIr, RootIr, InputRefKind, TableMetaIr, CompiledOperation,
3
3
  import { DocumentNode, OperationDefinitionNode, FragmentDefinitionNode, GraphQLSchema, ValueNode, SelectionSetNode } from 'graphql';
4
4
  export { DynamicInputIssue, DynamicInputResult, NormalizedBoolExp, NormalizedOnConflict, NormalizedOrderBy, NormalizedRow, ORDER_BY_DIRECTIONS, ScalarKind, allowedBoolExpOperators, allowedOps, validateAppendInput, validateBoolExpInput, validateInsertInput, validateOnConflictInput, validateOrderByInput, validateSelectColumns, validateSetInput } from './dynamic-input.cjs';
5
5
  export { CompilePolicyInput, CompilePredicateInput, POLICY_COMPARE_OPS, POLICY_MAX_LINK_DEPTH, ParsedPolicy, PolicyColumnInfo, PolicyCompareOp, PolicyCompileError, PolicyCompileErrorCode, PolicyLinkInfo, PolicyNode, PolicyOperand, PolicyParseError, PolicyResolver, PolicyTableInfo, assertClaimsOnlyWhen, compilePolicy, compilePredicateV2, parsePolicy, walkPolicy } from './predicate-v2.cjs';
6
- export { P as PLATFORM_USER_TYPENAME, c as camelCase, e as enumTypeName, p as pascalCase } from './naming-DPglwzkB.cjs';
6
+ export { P as PLATFORM_USER_TYPENAME, c as camelCase, g as enumTypeName, p as pascalCase } from './naming-CU9ThP_E.cjs';
7
7
  import 'zod';
8
+ import './constants-YoFGjIBM.cjs';
9
+ import './policy-1iZbGnZZ.cjs';
8
10
 
9
11
  type DiagnosticSeverity = 'error' | 'warning';
10
12
  interface CompilerDiagnostic {
@@ -157,7 +159,13 @@ interface CowMutationRootInfo {
157
159
  /** Override: properties copied INSERT…SELECT from synced (pk included). */
158
160
  copyColumns: readonly string[];
159
161
  }
160
- type MutationRootInfo = CrudMutationRootInfo | CowMutationRootInfo;
162
+ /** A resolved-table write root (the table is the resolved view). */
163
+ interface ResolvedMutationRootInfo {
164
+ op: 'resolvedWrite';
165
+ action: 'insert' | 'update' | 'delete' | 'revert';
166
+ table: string;
167
+ }
168
+ type MutationRootInfo = CrudMutationRootInfo | CowMutationRootInfo | ResolvedMutationRootInfo;
161
169
  interface CompileContext {
162
170
  namespace: string;
163
171
  tables: Record<string, TableMetaIr>;
@@ -329,6 +337,7 @@ declare class OperationLowerer {
329
337
  private readonly variables;
330
338
  constructor(ctx: CompileContext, restricted: RestrictedOperation);
331
339
  private meta;
340
+ /** A data column — cell-metadata columns are reachable only through `cells { … }`. */
332
341
  private column;
333
342
  private link;
334
343
  private fieldCandidates;
@@ -347,6 +356,12 @@ declare class OperationLowerer {
347
356
  private lowerLimit;
348
357
  private lowerOffset;
349
358
  lowerSelection(selectionSet: SelectionSetNode, table: string): SelectionIr;
359
+ /**
360
+ * `cells { <column> { at by … } }` — typed per-cell metadata. Plain tables
361
+ * offer `at`/`by`; resolved tables add the winning `source` and newer
362
+ * `conflicts { source at value }`.
363
+ */
364
+ private lowerCells;
350
365
  /** The `{ aggregate { count sum {…} avg {…} } nodes {…} }` block shared by roots and relations. */
351
366
  private lowerAggregateSelection;
352
367
  /**
@@ -394,6 +409,12 @@ declare class OperationLowerer {
394
409
  * the structured fields, never from authored statements.
395
410
  */
396
411
  private lowerCowRoot;
412
+ /**
413
+ * Resolved-table roots: insertOne(object), updateByPk(pkColumns, _set),
414
+ * deleteByPk(pk…), revertByPk(pkColumns, columns). The executor writes only
415
+ * the touched cells into the manual source; `returning` reads the view.
416
+ */
417
+ private lowerResolvedRoot;
397
418
  private lowerMutationResponse;
398
419
  private lowerInsertObjects;
399
420
  private lowerInsertRow;
@@ -3,8 +3,10 @@ import { ClaimKey, PredIr, RootIr, InputRefKind, TableMetaIr, CompiledOperation,
3
3
  import { DocumentNode, OperationDefinitionNode, FragmentDefinitionNode, GraphQLSchema, ValueNode, SelectionSetNode } from 'graphql';
4
4
  export { DynamicInputIssue, DynamicInputResult, NormalizedBoolExp, NormalizedOnConflict, NormalizedOrderBy, NormalizedRow, ORDER_BY_DIRECTIONS, ScalarKind, allowedBoolExpOperators, allowedOps, validateAppendInput, validateBoolExpInput, validateInsertInput, validateOnConflictInput, validateOrderByInput, validateSelectColumns, validateSetInput } from './dynamic-input.js';
5
5
  export { CompilePolicyInput, CompilePredicateInput, POLICY_COMPARE_OPS, POLICY_MAX_LINK_DEPTH, ParsedPolicy, PolicyColumnInfo, PolicyCompareOp, PolicyCompileError, PolicyCompileErrorCode, PolicyLinkInfo, PolicyNode, PolicyOperand, PolicyParseError, PolicyResolver, PolicyTableInfo, assertClaimsOnlyWhen, compilePolicy, compilePredicateV2, parsePolicy, walkPolicy } from './predicate-v2.js';
6
- export { P as PLATFORM_USER_TYPENAME, c as camelCase, e as enumTypeName, p as pascalCase } from './naming-DCn94LJ4.js';
6
+ export { P as PLATFORM_USER_TYPENAME, c as camelCase, g as enumTypeName, p as pascalCase } from './naming-CPfx7EfF.js';
7
7
  import 'zod';
8
+ import './constants-YoFGjIBM.js';
9
+ import './policy-1iZbGnZZ.js';
8
10
 
9
11
  type DiagnosticSeverity = 'error' | 'warning';
10
12
  interface CompilerDiagnostic {
@@ -157,7 +159,13 @@ interface CowMutationRootInfo {
157
159
  /** Override: properties copied INSERT…SELECT from synced (pk included). */
158
160
  copyColumns: readonly string[];
159
161
  }
160
- type MutationRootInfo = CrudMutationRootInfo | CowMutationRootInfo;
162
+ /** A resolved-table write root (the table is the resolved view). */
163
+ interface ResolvedMutationRootInfo {
164
+ op: 'resolvedWrite';
165
+ action: 'insert' | 'update' | 'delete' | 'revert';
166
+ table: string;
167
+ }
168
+ type MutationRootInfo = CrudMutationRootInfo | CowMutationRootInfo | ResolvedMutationRootInfo;
161
169
  interface CompileContext {
162
170
  namespace: string;
163
171
  tables: Record<string, TableMetaIr>;
@@ -329,6 +337,7 @@ declare class OperationLowerer {
329
337
  private readonly variables;
330
338
  constructor(ctx: CompileContext, restricted: RestrictedOperation);
331
339
  private meta;
340
+ /** A data column — cell-metadata columns are reachable only through `cells { … }`. */
332
341
  private column;
333
342
  private link;
334
343
  private fieldCandidates;
@@ -347,6 +356,12 @@ declare class OperationLowerer {
347
356
  private lowerLimit;
348
357
  private lowerOffset;
349
358
  lowerSelection(selectionSet: SelectionSetNode, table: string): SelectionIr;
359
+ /**
360
+ * `cells { <column> { at by … } }` — typed per-cell metadata. Plain tables
361
+ * offer `at`/`by`; resolved tables add the winning `source` and newer
362
+ * `conflicts { source at value }`.
363
+ */
364
+ private lowerCells;
350
365
  /** The `{ aggregate { count sum {…} avg {…} } nodes {…} }` block shared by roots and relations. */
351
366
  private lowerAggregateSelection;
352
367
  /**
@@ -394,6 +409,12 @@ declare class OperationLowerer {
394
409
  * the structured fields, never from authored statements.
395
410
  */
396
411
  private lowerCowRoot;
412
+ /**
413
+ * Resolved-table roots: insertOne(object), updateByPk(pkColumns, _set),
414
+ * deleteByPk(pk…), revertByPk(pkColumns, columns). The executor writes only
415
+ * the touched cells into the manual source; `returning` reads the view.
416
+ */
417
+ private lowerResolvedRoot;
397
418
  private lowerMutationResponse;
398
419
  private lowerInsertObjects;
399
420
  private lowerInsertRow;