@sequenceholdings/orm 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.
- package/README.md +94 -2
- package/dist/authoring.cjs +1474 -54
- package/dist/authoring.cjs.map +1 -1
- package/dist/authoring.d.cts +242 -4
- package/dist/authoring.d.ts +242 -4
- package/dist/authoring.js +1465 -56
- package/dist/authoring.js.map +1 -1
- package/dist/canonical.cjs +740 -42
- package/dist/canonical.cjs.map +1 -1
- package/dist/canonical.d.cts +742 -53
- package/dist/canonical.d.ts +742 -53
- package/dist/canonical.js +724 -43
- package/dist/canonical.js.map +1 -1
- package/dist/cli.cjs +2478 -328
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2480 -330
- 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 +1755 -329
- package/dist/compiler.cjs.map +1 -1
- package/dist/compiler.d.cts +56 -3
- package/dist/compiler.d.ts +56 -3
- package/dist/compiler.js +1756 -330
- 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 +1973 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +474 -100
- package/dist/index.d.ts +474 -100
- package/dist/index.js +1940 -167
- package/dist/index.js.map +1 -1
- package/dist/ir.cjs +869 -46
- package/dist/ir.cjs.map +1 -1
- package/dist/ir.d.cts +699 -25
- package/dist/ir.d.ts +699 -25
- package/dist/ir.js +861 -47
- package/dist/ir.js.map +1 -1
- package/dist/{naming-CTvWSRTf.d.ts → naming-CPfx7EfF.d.ts} +28 -1
- package/dist/{naming-DRyinU4u.d.cts → naming-CU9ThP_E.d.cts} +28 -1
- package/dist/policy-1iZbGnZZ.d.cts +24 -0
- package/dist/policy-1iZbGnZZ.d.ts +24 -0
- package/dist/predicate-v2.cjs +852 -49
- 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 +852 -49
- package/dist/predicate-v2.js.map +1 -1
- package/dist/sdl.cjs +1309 -58
- 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 +1305 -59
- package/dist/sdl.js.map +1 -1
- package/package.json +11 -6
- 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
|
@@ -43,6 +43,15 @@ declare const ORDER_BY_ENUM = "OrderBy";
|
|
|
43
43
|
declare const ORDER_BY_ENUM_VALUES: readonly ["ASC", "ASC_NULLS_FIRST", "ASC_NULLS_LAST", "DESC", "DESC_NULLS_FIRST", "DESC_NULLS_LAST"];
|
|
44
44
|
/** The built-in read-only platform users entity (plan §4b). */
|
|
45
45
|
declare const PLATFORM_USER_TYPENAME = "PlatformUser";
|
|
46
|
+
/**
|
|
47
|
+
* The shared date-bucket enum for grouped aggregates. Declared once per
|
|
48
|
+
* schema (not per table) because the unit set is table-independent; its
|
|
49
|
+
* members mirror `DATE_BUCKETS` in src/ir/index.ts, which is the contract the
|
|
50
|
+
* executor reads.
|
|
51
|
+
*/
|
|
52
|
+
declare const DATE_BUCKET_ENUM = "DateBucket";
|
|
53
|
+
/** Column types that may carry a `bucket:` in a group key. */
|
|
54
|
+
declare const BUCKETABLE_COLUMN_TYPES: readonly ColumnType[];
|
|
46
55
|
/** Every generated GraphQL name derived from one table name. */
|
|
47
56
|
interface TableNames {
|
|
48
57
|
typename: string;
|
|
@@ -55,6 +64,8 @@ interface TableNames {
|
|
|
55
64
|
updateByPkRoot: string;
|
|
56
65
|
deleteRoot: string;
|
|
57
66
|
deleteByPkRoot: string;
|
|
67
|
+
/** Resolved tables only: drop manual edits so other sources win again. */
|
|
68
|
+
revertByPkRoot: string;
|
|
58
69
|
boolExp: string;
|
|
59
70
|
orderBy: string;
|
|
60
71
|
selectColumn: string;
|
|
@@ -73,7 +84,23 @@ interface TableNames {
|
|
|
73
84
|
avgFields: string;
|
|
74
85
|
aggregateBoolExp: string;
|
|
75
86
|
aggregateBoolExpCount: string;
|
|
87
|
+
aggregateGroupsRoot: string;
|
|
88
|
+
groupByColumnEnum: string;
|
|
89
|
+
groupByInput: string;
|
|
90
|
+
groupKey: string;
|
|
91
|
+
aggregateGroup: string;
|
|
76
92
|
}
|
|
77
93
|
declare function tableNames(table: string): TableNames;
|
|
94
|
+
/** Shared object types behind the typed `cells` field. */
|
|
95
|
+
declare const CELL_TYPENAMES: {
|
|
96
|
+
/** A plain table's cell: when and by whom it was last written. */
|
|
97
|
+
readonly stamp: "CellStamp";
|
|
98
|
+
/** A resolved table's cell: which source won, when, by whom, and newer losers. */
|
|
99
|
+
readonly resolved: "ResolvedCell";
|
|
100
|
+
/** A newer candidate that lost to the column's rule. */
|
|
101
|
+
readonly conflict: "CellConflict";
|
|
102
|
+
};
|
|
103
|
+
/** `Loan` → `LoanCells`: the per-table object carrying one cell per tracked column. */
|
|
104
|
+
declare function cellsTypename(typename: string): string;
|
|
78
105
|
|
|
79
|
-
export {
|
|
106
|
+
export { BUCKETABLE_COLUMN_TYPES as B, CELL_TYPENAMES as C, DATE_BUCKET_ENUM as D, NUMERICISH_COLUMN_TYPES as N, ORDER_BY_ENUM as O, PLATFORM_USER_TYPENAME as P, type TableNames as T, VARIABLE_SCALAR_NAMES as V, CUSTOM_SCALARS as a, ORDER_BY_ENUM_VALUES as b, camelCase as c, cellsTypename as d, columnTypeForScalar as e, comparisonExpName as f, enumTypeName as g, fieldName as h, graphqlScalarFor as i, typeName as j, pascalCase as p, tableNames as t };
|
|
@@ -43,6 +43,15 @@ declare const ORDER_BY_ENUM = "OrderBy";
|
|
|
43
43
|
declare const ORDER_BY_ENUM_VALUES: readonly ["ASC", "ASC_NULLS_FIRST", "ASC_NULLS_LAST", "DESC", "DESC_NULLS_FIRST", "DESC_NULLS_LAST"];
|
|
44
44
|
/** The built-in read-only platform users entity (plan §4b). */
|
|
45
45
|
declare const PLATFORM_USER_TYPENAME = "PlatformUser";
|
|
46
|
+
/**
|
|
47
|
+
* The shared date-bucket enum for grouped aggregates. Declared once per
|
|
48
|
+
* schema (not per table) because the unit set is table-independent; its
|
|
49
|
+
* members mirror `DATE_BUCKETS` in src/ir/index.ts, which is the contract the
|
|
50
|
+
* executor reads.
|
|
51
|
+
*/
|
|
52
|
+
declare const DATE_BUCKET_ENUM = "DateBucket";
|
|
53
|
+
/** Column types that may carry a `bucket:` in a group key. */
|
|
54
|
+
declare const BUCKETABLE_COLUMN_TYPES: readonly ColumnType[];
|
|
46
55
|
/** Every generated GraphQL name derived from one table name. */
|
|
47
56
|
interface TableNames {
|
|
48
57
|
typename: string;
|
|
@@ -55,6 +64,8 @@ interface TableNames {
|
|
|
55
64
|
updateByPkRoot: string;
|
|
56
65
|
deleteRoot: string;
|
|
57
66
|
deleteByPkRoot: string;
|
|
67
|
+
/** Resolved tables only: drop manual edits so other sources win again. */
|
|
68
|
+
revertByPkRoot: string;
|
|
58
69
|
boolExp: string;
|
|
59
70
|
orderBy: string;
|
|
60
71
|
selectColumn: string;
|
|
@@ -73,7 +84,23 @@ interface TableNames {
|
|
|
73
84
|
avgFields: string;
|
|
74
85
|
aggregateBoolExp: string;
|
|
75
86
|
aggregateBoolExpCount: string;
|
|
87
|
+
aggregateGroupsRoot: string;
|
|
88
|
+
groupByColumnEnum: string;
|
|
89
|
+
groupByInput: string;
|
|
90
|
+
groupKey: string;
|
|
91
|
+
aggregateGroup: string;
|
|
76
92
|
}
|
|
77
93
|
declare function tableNames(table: string): TableNames;
|
|
94
|
+
/** Shared object types behind the typed `cells` field. */
|
|
95
|
+
declare const CELL_TYPENAMES: {
|
|
96
|
+
/** A plain table's cell: when and by whom it was last written. */
|
|
97
|
+
readonly stamp: "CellStamp";
|
|
98
|
+
/** A resolved table's cell: which source won, when, by whom, and newer losers. */
|
|
99
|
+
readonly resolved: "ResolvedCell";
|
|
100
|
+
/** A newer candidate that lost to the column's rule. */
|
|
101
|
+
readonly conflict: "CellConflict";
|
|
102
|
+
};
|
|
103
|
+
/** `Loan` → `LoanCells`: the per-table object carrying one cell per tracked column. */
|
|
104
|
+
declare function cellsTypename(typename: string): string;
|
|
78
105
|
|
|
79
|
-
export {
|
|
106
|
+
export { BUCKETABLE_COLUMN_TYPES as B, CELL_TYPENAMES as C, DATE_BUCKET_ENUM as D, NUMERICISH_COLUMN_TYPES as N, ORDER_BY_ENUM as O, PLATFORM_USER_TYPENAME as P, type TableNames as T, VARIABLE_SCALAR_NAMES as V, CUSTOM_SCALARS as a, ORDER_BY_ENUM_VALUES as b, camelCase as c, cellsTypename as d, columnTypeForScalar as e, comparisonExpName as f, enumTypeName as g, fieldName as h, graphqlScalarFor as i, typeName as j, pascalCase as p, tableNames as t };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Policy expression grammar shared by tables, views and resolved tables. The
|
|
5
|
+
* DSL strings are parsed and claim-checked by predicate-v2 in both the CLI
|
|
6
|
+
* and the server; variants follow §4c permissive-union semantics.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
declare const policyVariantSchema: z.ZodObject<{
|
|
10
|
+
when: z.ZodString;
|
|
11
|
+
allow: z.ZodOptional<z.ZodLiteral<true>>;
|
|
12
|
+
policy: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
declare const policyExpressionSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
15
|
+
default: z.ZodString;
|
|
16
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
17
|
+
when: z.ZodString;
|
|
18
|
+
allow: z.ZodOptional<z.ZodLiteral<true>>;
|
|
19
|
+
policy: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>>;
|
|
21
|
+
}, z.core.$strip>]>;
|
|
22
|
+
type PolicyExpression = z.infer<typeof policyExpressionSchema>;
|
|
23
|
+
|
|
24
|
+
export { type PolicyExpression as P, policyVariantSchema as a, policyExpressionSchema as p };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Policy expression grammar shared by tables, views and resolved tables. The
|
|
5
|
+
* DSL strings are parsed and claim-checked by predicate-v2 in both the CLI
|
|
6
|
+
* and the server; variants follow §4c permissive-union semantics.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
declare const policyVariantSchema: z.ZodObject<{
|
|
10
|
+
when: z.ZodString;
|
|
11
|
+
allow: z.ZodOptional<z.ZodLiteral<true>>;
|
|
12
|
+
policy: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
declare const policyExpressionSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
15
|
+
default: z.ZodString;
|
|
16
|
+
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
17
|
+
when: z.ZodString;
|
|
18
|
+
allow: z.ZodOptional<z.ZodLiteral<true>>;
|
|
19
|
+
policy: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>>>;
|
|
21
|
+
}, z.core.$strip>]>;
|
|
22
|
+
type PolicyExpression = z.infer<typeof policyExpressionSchema>;
|
|
23
|
+
|
|
24
|
+
export { type PolicyExpression as P, policyVariantSchema as a, policyExpressionSchema as p };
|