@sequenceholdings/orm 2.1.0 → 2.2.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 (77) hide show
  1. package/README.md +40 -1
  2. package/dist/authoring.cjs +1619 -121
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +252 -8
  5. package/dist/authoring.d.ts +252 -8
  6. package/dist/authoring.js +1607 -123
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.cjs +713 -41
  9. package/dist/canonical.cjs.map +1 -1
  10. package/dist/canonical.d.cts +1520 -51
  11. package/dist/canonical.d.ts +1520 -51
  12. package/dist/canonical.js +693 -42
  13. package/dist/canonical.js.map +1 -1
  14. package/dist/cli.cjs +7103 -3901
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +7104 -3902
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.cjs +122 -40
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +85 -25
  21. package/dist/client.d.ts +85 -25
  22. package/dist/client.js +119 -41
  23. package/dist/client.js.map +1 -1
  24. package/dist/compiler.cjs +2464 -450
  25. package/dist/compiler.cjs.map +1 -1
  26. package/dist/compiler.d.cts +79 -4
  27. package/dist/compiler.d.ts +79 -4
  28. package/dist/compiler.js +2457 -451
  29. package/dist/compiler.js.map +1 -1
  30. package/dist/constants-C6EG6Wq7.d.cts +99 -0
  31. package/dist/constants-C6EG6Wq7.d.ts +99 -0
  32. package/dist/definition-DjfC7Lll.d.cts +91 -0
  33. package/dist/definition-DjfC7Lll.d.ts +91 -0
  34. package/dist/dynamic-input.cjs +2 -1
  35. package/dist/dynamic-input.cjs.map +1 -1
  36. package/dist/dynamic-input.d.cts +9 -1
  37. package/dist/dynamic-input.d.ts +9 -1
  38. package/dist/dynamic-input.js +2 -1
  39. package/dist/dynamic-input.js.map +1 -1
  40. package/dist/index.cjs +2656 -418
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +693 -116
  43. package/dist/index.d.ts +693 -116
  44. package/dist/index.js +2622 -420
  45. package/dist/index.js.map +1 -1
  46. package/dist/ir.cjs +811 -48
  47. package/dist/ir.cjs.map +1 -1
  48. package/dist/ir.d.cts +670 -27
  49. package/dist/ir.d.ts +670 -27
  50. package/dist/ir.js +802 -49
  51. package/dist/ir.js.map +1 -1
  52. package/dist/{naming-DCn94LJ4.d.ts → naming-CPfx7EfF.d.ts} +14 -1
  53. package/dist/{naming-DPglwzkB.d.cts → naming-CU9ThP_E.d.cts} +14 -1
  54. package/dist/policy-1iZbGnZZ.d.cts +24 -0
  55. package/dist/policy-1iZbGnZZ.d.ts +24 -0
  56. package/dist/predicate-v2.cjs +804 -51
  57. package/dist/predicate-v2.cjs.map +1 -1
  58. package/dist/predicate-v2.d.cts +2 -1
  59. package/dist/predicate-v2.d.ts +2 -1
  60. package/dist/predicate-v2.js +804 -51
  61. package/dist/predicate-v2.js.map +1 -1
  62. package/dist/sdl.cjs +1014 -75
  63. package/dist/sdl.cjs.map +1 -1
  64. package/dist/sdl.d.cts +14 -3
  65. package/dist/sdl.d.ts +14 -3
  66. package/dist/sdl.js +1012 -76
  67. package/dist/sdl.js.map +1 -1
  68. package/package.json +13 -7
  69. package/src/codegen-gql/server-fns.cjs +2 -2
  70. package/templates/orm-namespace/AGENTS.md +10 -0
  71. package/templates/orm-namespace/CLAUDE.md +1 -82
  72. package/templates/orm-namespace/codegen.preset.d.cts +7 -0
  73. package/templates/orm-namespace/codegen.ts +2 -1
  74. package/templates/orm-namespace/graphql/example/queries.ts +4 -3
  75. package/templates/orm-namespace/package.json +2 -1
  76. package/templates/orm-namespace/schema/tables.ts +3 -2
  77. package/templates/orm-namespace/sequence.config.ts +7 -11
@@ -64,6 +64,8 @@ interface TableNames {
64
64
  updateByPkRoot: string;
65
65
  deleteRoot: string;
66
66
  deleteByPkRoot: string;
67
+ /** Resolved tables only: drop manual edits so other sources win again. */
68
+ revertByPkRoot: string;
67
69
  boolExp: string;
68
70
  orderBy: string;
69
71
  selectColumn: string;
@@ -89,5 +91,16 @@ interface TableNames {
89
91
  aggregateGroup: string;
90
92
  }
91
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;
92
105
 
93
- export { BUCKETABLE_COLUMN_TYPES as B, CUSTOM_SCALARS 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, ORDER_BY_ENUM_VALUES as a, columnTypeForScalar as b, camelCase as c, comparisonExpName as d, enumTypeName as e, fieldName as f, graphqlScalarFor as g, typeName as h, pascalCase as p, tableNames as t };
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 };
@@ -64,6 +64,8 @@ interface TableNames {
64
64
  updateByPkRoot: string;
65
65
  deleteRoot: string;
66
66
  deleteByPkRoot: string;
67
+ /** Resolved tables only: drop manual edits so other sources win again. */
68
+ revertByPkRoot: string;
67
69
  boolExp: string;
68
70
  orderBy: string;
69
71
  selectColumn: string;
@@ -89,5 +91,16 @@ interface TableNames {
89
91
  aggregateGroup: string;
90
92
  }
91
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;
92
105
 
93
- export { BUCKETABLE_COLUMN_TYPES as B, CUSTOM_SCALARS 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, ORDER_BY_ENUM_VALUES as a, columnTypeForScalar as b, camelCase as c, comparisonExpName as d, enumTypeName as e, fieldName as f, graphqlScalarFor as g, typeName as h, pascalCase as p, tableNames as t };
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 };