@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.
- package/README.md +38 -1
- package/dist/authoring.cjs +1358 -45
- package/dist/authoring.cjs.map +1 -1
- package/dist/authoring.d.cts +223 -2
- package/dist/authoring.d.ts +223 -2
- package/dist/authoring.js +1349 -47
- package/dist/authoring.js.map +1 -1
- package/dist/canonical.cjs +662 -38
- package/dist/canonical.cjs.map +1 -1
- package/dist/canonical.d.cts +696 -53
- package/dist/canonical.d.ts +696 -53
- package/dist/canonical.js +647 -39
- package/dist/canonical.js.map +1 -1
- package/dist/cli.cjs +1808 -247
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1809 -248
- package/dist/cli.js.map +1 -1
- package/dist/client.cjs +90 -25
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +39 -22
- package/dist/client.d.ts +39 -22
- package/dist/client.js +87 -26
- package/dist/client.js.map +1 -1
- package/dist/compiler.cjs +1325 -285
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +23 -2
- package/dist/compiler.d.ts +23 -2
- package/dist/compiler.js +1325 -285
- package/dist/compiler.js.map +1 -1
- package/dist/constants-YoFGjIBM.d.cts +99 -0
- package/dist/constants-YoFGjIBM.d.ts +99 -0
- package/dist/dynamic-input.d.cts +1 -0
- package/dist/dynamic-input.d.ts +1 -0
- package/dist/index.cjs +1605 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +230 -113
- package/dist/index.d.ts +230 -113
- package/dist/index.js +1583 -142
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs +727 -38
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.d.cts +539 -21
- package/dist/ir.d.ts +539 -21
- package/dist/ir.js +722 -39
- package/dist/ir.js.map +1 -1
- package/dist/{naming-DCn94LJ4.d.ts → naming-CPfx7EfF.d.ts} +14 -1
- package/dist/{naming-DPglwzkB.d.cts → naming-CU9ThP_E.d.cts} +14 -1
- package/dist/policy-1iZbGnZZ.d.cts +24 -0
- package/dist/policy-1iZbGnZZ.d.ts +24 -0
- package/dist/predicate-v2.cjs +726 -42
- package/dist/predicate-v2.cjs.map +1 -1
- package/dist/predicate-v2.d.cts +2 -1
- package/dist/predicate-v2.d.ts +2 -1
- package/dist/predicate-v2.js +726 -42
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +858 -54
- package/dist/sdl.cjs.map +1 -1
- package/dist/sdl.d.cts +7 -3
- package/dist/sdl.d.ts +7 -3
- package/dist/sdl.js +856 -55
- package/dist/sdl.js.map +1 -1
- package/package.json +9 -4
- package/templates/orm-namespace/CLAUDE.md +6 -4
- package/templates/orm-namespace/codegen.preset.d.cts +7 -0
- package/templates/orm-namespace/codegen.ts +2 -1
- package/templates/orm-namespace/graphql/example/queries.ts +4 -3
- package/templates/orm-namespace/package.json +2 -1
- package/templates/orm-namespace/schema/tables.ts +3 -2
- package/templates/orm-namespace/sequence.config.ts +7 -11
package/dist/compiler.d.cts
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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;
|
package/dist/compiler.d.ts
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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;
|