@sequenceholdings/orm 2.6.1 → 2.6.2

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 CHANGED
@@ -131,7 +131,7 @@ Execute uses the `/_data/v2` endpoint by default. Set
131
131
  `SEQUENCE_ORM_ATLAS_EXECUTE_V2=1` to opt into Atlas's `/api/data/v2` endpoint.
132
132
  This client rollout switch does not bypass server feature flags or authorization.
133
133
 
134
- ## Default read-only SQL (planned 2.6.0)
134
+ ## Default read-only SQL (introduced in 2.6.0)
135
135
 
136
136
  With the matching SDK and Atlas rollout, every active v2 namespace supports
137
137
  runtime-supplied SQL without an authored operation or Function:
@@ -154,6 +154,37 @@ Separate protected execution targets cannot be joined. Existing registered
154
154
  operations remain supported; supply a manifest when executing them by name.
155
155
  Source versions alone do not prove package publication or server availability.
156
156
 
157
+ ## Source-publication read receipts (planned 2.6.2)
158
+
159
+ The upcoming `@sequenceholdings/orm/client` factories add
160
+ `executeWithReadReceipt()` for reads enrolled in a host publication guard.
161
+ Confirm package publication and the matching host rollout before using it.
162
+ The method accepts only queries classified by the supplied manifest or the
163
+ built-in SQL read. Known mutations, conflicting classifications and unclassified
164
+ raw or typed selectors fail locally with `OrmClientError` before dispatch.
165
+
166
+ ```ts
167
+ const first = await db.executeWithReadReceipt('ReadSourcePage', { after: null })
168
+ const next = await db.executeWithReadReceipt('ReadSourcePage', { after: cursor }, {
169
+ expectedSourceGeneration: first.sourceGeneration,
170
+ })
171
+ ```
172
+
173
+ The result is `{ data, sourceGeneration }`. Treat the lowercase 64-character
174
+ hexadecimal receipt as opaque. The host binds it to the authenticated actor,
175
+ database and validated publication, and checks continuation inside the same
176
+ locked read-only repeatable-read transaction as the query. Current permissions
177
+ and row policies are checked again on every request. A receipt can cross
178
+ admitted operations for the same publication, but it does not preserve a row
179
+ snapshot: mutable data can change between reads without a new publication.
180
+
181
+ Missing, malformed or mismatched acknowledgements fail with
182
+ `OrmOperationError` / `OBJECT_UNAVAILABLE`. Unsupported scopes, explain and
183
+ mutations cannot use continuation. Do not retry without the expectation when
184
+ that would combine different source publications. Plain `execute()` still
185
+ returns only data; supplying `expectedSourceGeneration` also requires a valid
186
+ matching acknowledgement. Existing calls without that option are unchanged.
187
+
157
188
  ## Public exports
158
189
 
159
190
  - `@sequenceholdings/orm/authoring` — namespace, table, policy, and view DSL
@@ -3,7 +3,7 @@ import { b as CellPart } from './constants-Dou1RkTo.cjs';
3
3
  import { ColumnsSelection } from 'drizzle-orm';
4
4
  import { TypedQueryBuilder } from 'drizzle-orm/query-builders/query-builder';
5
5
  import { QueryBuilder, PgView, PgTable, AnyPgColumn } from 'drizzle-orm/pg-core';
6
- export { S as SqlOperationDefinition, d as defineOperation } from './definition-B99BsOAO.cjs';
6
+ export { S as SqlOperationDefinition, d as defineOperation } from './definition-DjfC7Lll.cjs';
7
7
  import 'zod';
8
8
  import './policy-1iZbGnZZ.cjs';
9
9
 
@@ -3,7 +3,7 @@ import { b as CellPart } from './constants-Dou1RkTo.js';
3
3
  import { ColumnsSelection } from 'drizzle-orm';
4
4
  import { TypedQueryBuilder } from 'drizzle-orm/query-builders/query-builder';
5
5
  import { QueryBuilder, PgView, PgTable, AnyPgColumn } from 'drizzle-orm/pg-core';
6
- export { S as SqlOperationDefinition, d as defineOperation } from './definition-B99BsOAO.js';
6
+ export { S as SqlOperationDefinition, d as defineOperation } from './definition-DjfC7Lll.js';
7
7
  import 'zod';
8
8
  import './policy-1iZbGnZZ.js';
9
9
 
@@ -102,8 +102,8 @@ type CanonicalFetchShape = z.infer<typeof canonicalFetchShapeSchema>;
102
102
  declare const canonicalResolvedSourceSchema: z.ZodObject<{
103
103
  name: z.ZodString;
104
104
  kind: z.ZodEnum<{
105
- prefetch: "prefetch";
106
105
  manual: "manual";
106
+ prefetch: "prefetch";
107
107
  etl: "etl";
108
108
  }>;
109
109
  table: z.ZodString;
@@ -160,8 +160,8 @@ declare const canonicalResolvedSchema: z.ZodObject<{
160
160
  sources: z.ZodArray<z.ZodObject<{
161
161
  name: z.ZodString;
162
162
  kind: z.ZodEnum<{
163
- prefetch: "prefetch";
164
163
  manual: "manual";
164
+ prefetch: "prefetch";
165
165
  etl: "etl";
166
166
  }>;
167
167
  table: z.ZodString;
@@ -325,13 +325,13 @@ declare const canonicalColumnSchema: z.ZodObject<{
325
325
  bigint: "bigint";
326
326
  boolean: "boolean";
327
327
  date: "date";
328
- uuid: "uuid";
329
328
  text: "text";
329
+ timestamptz: "timestamptz";
330
+ jsonb: "jsonb";
331
+ uuid: "uuid";
330
332
  integer: "integer";
331
333
  numeric: "numeric";
332
334
  double: "double";
333
- timestamptz: "timestamptz";
334
- jsonb: "jsonb";
335
335
  }>, z.ZodObject<{
336
336
  enum: z.ZodString;
337
337
  }, z.core.$strip>]>;
@@ -353,10 +353,10 @@ declare const canonicalColumnSchema: z.ZodObject<{
353
353
  of: z.ZodString;
354
354
  part: z.ZodEnum<{
355
355
  at: "at";
356
- source: "source";
357
356
  by: "by";
358
- conflicts: "conflicts";
359
357
  rev: "rev";
358
+ source: "source";
359
+ conflicts: "conflicts";
360
360
  }>;
361
361
  }, z.core.$strict>>;
362
362
  }, z.core.$strip>;
@@ -460,21 +460,21 @@ declare const canonicalActionSchema: z.ZodObject<{
460
460
  bigint: "bigint";
461
461
  boolean: "boolean";
462
462
  date: "date";
463
- uuid: "uuid";
464
463
  text: "text";
464
+ timestamptz: "timestamptz";
465
+ jsonb: "jsonb";
466
+ uuid: "uuid";
465
467
  integer: "integer";
466
468
  numeric: "numeric";
467
469
  double: "double";
468
- timestamptz: "timestamptz";
469
- jsonb: "jsonb";
470
470
  }>;
471
471
  nullable: z.ZodDefault<z.ZodBoolean>;
472
472
  }, z.core.$strip>>>;
473
473
  executes: z.ZodString;
474
474
  returns: z.ZodDefault<z.ZodEnum<{
475
475
  rows: "rows";
476
- scalar: "scalar";
477
476
  rowsAffected: "rowsAffected";
477
+ scalar: "scalar";
478
478
  }>>;
479
479
  audit: z.ZodOptional<z.ZodObject<{
480
480
  action: z.ZodString;
@@ -540,13 +540,13 @@ declare const canonicalTableSchema: z.ZodObject<{
540
540
  bigint: "bigint";
541
541
  boolean: "boolean";
542
542
  date: "date";
543
- uuid: "uuid";
544
543
  text: "text";
544
+ timestamptz: "timestamptz";
545
+ jsonb: "jsonb";
546
+ uuid: "uuid";
545
547
  integer: "integer";
546
548
  numeric: "numeric";
547
549
  double: "double";
548
- timestamptz: "timestamptz";
549
- jsonb: "jsonb";
550
550
  }>, z.ZodObject<{
551
551
  enum: z.ZodString;
552
552
  }, z.core.$strip>]>;
@@ -568,10 +568,10 @@ declare const canonicalTableSchema: z.ZodObject<{
568
568
  of: z.ZodString;
569
569
  part: z.ZodEnum<{
570
570
  at: "at";
571
- source: "source";
572
571
  by: "by";
573
- conflicts: "conflicts";
574
572
  rev: "rev";
573
+ source: "source";
574
+ conflicts: "conflicts";
575
575
  }>;
576
576
  }, z.core.$strict>>;
577
577
  }, z.core.$strip>>>;
@@ -655,21 +655,21 @@ declare const canonicalTableSchema: z.ZodObject<{
655
655
  bigint: "bigint";
656
656
  boolean: "boolean";
657
657
  date: "date";
658
- uuid: "uuid";
659
658
  text: "text";
659
+ timestamptz: "timestamptz";
660
+ jsonb: "jsonb";
661
+ uuid: "uuid";
660
662
  integer: "integer";
661
663
  numeric: "numeric";
662
664
  double: "double";
663
- timestamptz: "timestamptz";
664
- jsonb: "jsonb";
665
665
  }>;
666
666
  nullable: z.ZodDefault<z.ZodBoolean>;
667
667
  }, z.core.$strip>>>;
668
668
  executes: z.ZodString;
669
669
  returns: z.ZodDefault<z.ZodEnum<{
670
670
  rows: "rows";
671
- scalar: "scalar";
672
671
  rowsAffected: "rowsAffected";
672
+ scalar: "scalar";
673
673
  }>>;
674
674
  audit: z.ZodOptional<z.ZodObject<{
675
675
  action: z.ZodString;
@@ -726,13 +726,13 @@ declare const canonicalViewSchema: z.ZodObject<{
726
726
  bigint: "bigint";
727
727
  boolean: "boolean";
728
728
  date: "date";
729
- uuid: "uuid";
730
729
  text: "text";
730
+ timestamptz: "timestamptz";
731
+ jsonb: "jsonb";
732
+ uuid: "uuid";
731
733
  integer: "integer";
732
734
  numeric: "numeric";
733
735
  double: "double";
734
- timestamptz: "timestamptz";
735
- jsonb: "jsonb";
736
736
  }>, z.ZodObject<{
737
737
  enum: z.ZodString;
738
738
  }, z.core.$strip>]>;
@@ -754,10 +754,10 @@ declare const canonicalViewSchema: z.ZodObject<{
754
754
  of: z.ZodString;
755
755
  part: z.ZodEnum<{
756
756
  at: "at";
757
- source: "source";
758
757
  by: "by";
759
- conflicts: "conflicts";
760
758
  rev: "rev";
759
+ source: "source";
760
+ conflicts: "conflicts";
761
761
  }>;
762
762
  }, z.core.$strict>>;
763
763
  }, z.core.$strip>>;
@@ -806,8 +806,8 @@ declare const canonicalViewSchema: z.ZodObject<{
806
806
  sources: z.ZodArray<z.ZodObject<{
807
807
  name: z.ZodString;
808
808
  kind: z.ZodEnum<{
809
- prefetch: "prefetch";
810
809
  manual: "manual";
810
+ prefetch: "prefetch";
811
811
  etl: "etl";
812
812
  }>;
813
813
  table: z.ZodString;
@@ -947,13 +947,13 @@ declare const localDefinitionSchema: z.ZodObject<{
947
947
  bigint: "bigint";
948
948
  boolean: "boolean";
949
949
  date: "date";
950
- uuid: "uuid";
951
950
  text: "text";
951
+ timestamptz: "timestamptz";
952
+ jsonb: "jsonb";
953
+ uuid: "uuid";
952
954
  integer: "integer";
953
955
  numeric: "numeric";
954
956
  double: "double";
955
- timestamptz: "timestamptz";
956
- jsonb: "jsonb";
957
957
  }>, z.ZodObject<{
958
958
  enum: z.ZodString;
959
959
  }, z.core.$strip>]>;
@@ -975,10 +975,10 @@ declare const localDefinitionSchema: z.ZodObject<{
975
975
  of: z.ZodString;
976
976
  part: z.ZodEnum<{
977
977
  at: "at";
978
- source: "source";
979
978
  by: "by";
980
- conflicts: "conflicts";
981
979
  rev: "rev";
980
+ source: "source";
981
+ conflicts: "conflicts";
982
982
  }>;
983
983
  }, z.core.$strict>>;
984
984
  }, z.core.$strip>>>;
@@ -1062,21 +1062,21 @@ declare const localDefinitionSchema: z.ZodObject<{
1062
1062
  bigint: "bigint";
1063
1063
  boolean: "boolean";
1064
1064
  date: "date";
1065
- uuid: "uuid";
1066
1065
  text: "text";
1066
+ timestamptz: "timestamptz";
1067
+ jsonb: "jsonb";
1068
+ uuid: "uuid";
1067
1069
  integer: "integer";
1068
1070
  numeric: "numeric";
1069
1071
  double: "double";
1070
- timestamptz: "timestamptz";
1071
- jsonb: "jsonb";
1072
1072
  }>;
1073
1073
  nullable: z.ZodDefault<z.ZodBoolean>;
1074
1074
  }, z.core.$strip>>>;
1075
1075
  executes: z.ZodString;
1076
1076
  returns: z.ZodDefault<z.ZodEnum<{
1077
1077
  rows: "rows";
1078
- scalar: "scalar";
1079
1078
  rowsAffected: "rowsAffected";
1079
+ scalar: "scalar";
1080
1080
  }>>;
1081
1081
  audit: z.ZodOptional<z.ZodObject<{
1082
1082
  action: z.ZodString;
@@ -1132,13 +1132,13 @@ declare const localDefinitionSchema: z.ZodObject<{
1132
1132
  bigint: "bigint";
1133
1133
  boolean: "boolean";
1134
1134
  date: "date";
1135
- uuid: "uuid";
1136
1135
  text: "text";
1136
+ timestamptz: "timestamptz";
1137
+ jsonb: "jsonb";
1138
+ uuid: "uuid";
1137
1139
  integer: "integer";
1138
1140
  numeric: "numeric";
1139
1141
  double: "double";
1140
- timestamptz: "timestamptz";
1141
- jsonb: "jsonb";
1142
1142
  }>, z.ZodObject<{
1143
1143
  enum: z.ZodString;
1144
1144
  }, z.core.$strip>]>;
@@ -1160,10 +1160,10 @@ declare const localDefinitionSchema: z.ZodObject<{
1160
1160
  of: z.ZodString;
1161
1161
  part: z.ZodEnum<{
1162
1162
  at: "at";
1163
- source: "source";
1164
1163
  by: "by";
1165
- conflicts: "conflicts";
1166
1164
  rev: "rev";
1165
+ source: "source";
1166
+ conflicts: "conflicts";
1167
1167
  }>;
1168
1168
  }, z.core.$strict>>;
1169
1169
  }, z.core.$strip>>;
@@ -1212,8 +1212,8 @@ declare const localDefinitionSchema: z.ZodObject<{
1212
1212
  sources: z.ZodArray<z.ZodObject<{
1213
1213
  name: z.ZodString;
1214
1214
  kind: z.ZodEnum<{
1215
- prefetch: "prefetch";
1216
1215
  manual: "manual";
1216
+ prefetch: "prefetch";
1217
1217
  etl: "etl";
1218
1218
  }>;
1219
1219
  table: z.ZodString;
@@ -1336,13 +1336,13 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1336
1336
  bigint: "bigint";
1337
1337
  boolean: "boolean";
1338
1338
  date: "date";
1339
- uuid: "uuid";
1340
1339
  text: "text";
1340
+ timestamptz: "timestamptz";
1341
+ jsonb: "jsonb";
1342
+ uuid: "uuid";
1341
1343
  integer: "integer";
1342
1344
  numeric: "numeric";
1343
1345
  double: "double";
1344
- timestamptz: "timestamptz";
1345
- jsonb: "jsonb";
1346
1346
  }>, z.ZodObject<{
1347
1347
  enum: z.ZodString;
1348
1348
  }, z.core.$strip>]>;
@@ -1364,10 +1364,10 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1364
1364
  of: z.ZodString;
1365
1365
  part: z.ZodEnum<{
1366
1366
  at: "at";
1367
- source: "source";
1368
1367
  by: "by";
1369
- conflicts: "conflicts";
1370
1368
  rev: "rev";
1369
+ source: "source";
1370
+ conflicts: "conflicts";
1371
1371
  }>;
1372
1372
  }, z.core.$strict>>;
1373
1373
  }, z.core.$strip>>>;
@@ -1451,21 +1451,21 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1451
1451
  bigint: "bigint";
1452
1452
  boolean: "boolean";
1453
1453
  date: "date";
1454
- uuid: "uuid";
1455
1454
  text: "text";
1455
+ timestamptz: "timestamptz";
1456
+ jsonb: "jsonb";
1457
+ uuid: "uuid";
1456
1458
  integer: "integer";
1457
1459
  numeric: "numeric";
1458
1460
  double: "double";
1459
- timestamptz: "timestamptz";
1460
- jsonb: "jsonb";
1461
1461
  }>;
1462
1462
  nullable: z.ZodDefault<z.ZodBoolean>;
1463
1463
  }, z.core.$strip>>>;
1464
1464
  executes: z.ZodString;
1465
1465
  returns: z.ZodDefault<z.ZodEnum<{
1466
1466
  rows: "rows";
1467
- scalar: "scalar";
1468
1467
  rowsAffected: "rowsAffected";
1468
+ scalar: "scalar";
1469
1469
  }>>;
1470
1470
  audit: z.ZodOptional<z.ZodObject<{
1471
1471
  action: z.ZodString;
@@ -1521,13 +1521,13 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1521
1521
  bigint: "bigint";
1522
1522
  boolean: "boolean";
1523
1523
  date: "date";
1524
- uuid: "uuid";
1525
1524
  text: "text";
1525
+ timestamptz: "timestamptz";
1526
+ jsonb: "jsonb";
1527
+ uuid: "uuid";
1526
1528
  integer: "integer";
1527
1529
  numeric: "numeric";
1528
1530
  double: "double";
1529
- timestamptz: "timestamptz";
1530
- jsonb: "jsonb";
1531
1531
  }>, z.ZodObject<{
1532
1532
  enum: z.ZodString;
1533
1533
  }, z.core.$strip>]>;
@@ -1549,10 +1549,10 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1549
1549
  of: z.ZodString;
1550
1550
  part: z.ZodEnum<{
1551
1551
  at: "at";
1552
- source: "source";
1553
1552
  by: "by";
1554
- conflicts: "conflicts";
1555
1553
  rev: "rev";
1554
+ source: "source";
1555
+ conflicts: "conflicts";
1556
1556
  }>;
1557
1557
  }, z.core.$strict>>;
1558
1558
  }, z.core.$strip>>;
@@ -1601,8 +1601,8 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1601
1601
  sources: z.ZodArray<z.ZodObject<{
1602
1602
  name: z.ZodString;
1603
1603
  kind: z.ZodEnum<{
1604
- prefetch: "prefetch";
1605
1604
  manual: "manual";
1605
+ prefetch: "prefetch";
1606
1606
  etl: "etl";
1607
1607
  }>;
1608
1608
  table: z.ZodString;
@@ -1724,13 +1724,13 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1724
1724
  bigint: "bigint";
1725
1725
  boolean: "boolean";
1726
1726
  date: "date";
1727
- uuid: "uuid";
1728
1727
  text: "text";
1728
+ timestamptz: "timestamptz";
1729
+ jsonb: "jsonb";
1730
+ uuid: "uuid";
1729
1731
  integer: "integer";
1730
1732
  numeric: "numeric";
1731
1733
  double: "double";
1732
- timestamptz: "timestamptz";
1733
- jsonb: "jsonb";
1734
1734
  }>, z.ZodObject<{
1735
1735
  enum: z.ZodString;
1736
1736
  }, z.core.$strip>]>;
@@ -1752,10 +1752,10 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1752
1752
  of: z.ZodString;
1753
1753
  part: z.ZodEnum<{
1754
1754
  at: "at";
1755
- source: "source";
1756
1755
  by: "by";
1757
- conflicts: "conflicts";
1758
1756
  rev: "rev";
1757
+ source: "source";
1758
+ conflicts: "conflicts";
1759
1759
  }>;
1760
1760
  }, z.core.$strict>>;
1761
1761
  }, z.core.$strip>>>;
@@ -1839,21 +1839,21 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1839
1839
  bigint: "bigint";
1840
1840
  boolean: "boolean";
1841
1841
  date: "date";
1842
- uuid: "uuid";
1843
1842
  text: "text";
1843
+ timestamptz: "timestamptz";
1844
+ jsonb: "jsonb";
1845
+ uuid: "uuid";
1844
1846
  integer: "integer";
1845
1847
  numeric: "numeric";
1846
1848
  double: "double";
1847
- timestamptz: "timestamptz";
1848
- jsonb: "jsonb";
1849
1849
  }>;
1850
1850
  nullable: z.ZodDefault<z.ZodBoolean>;
1851
1851
  }, z.core.$strip>>>;
1852
1852
  executes: z.ZodString;
1853
1853
  returns: z.ZodDefault<z.ZodEnum<{
1854
1854
  rows: "rows";
1855
- scalar: "scalar";
1856
1855
  rowsAffected: "rowsAffected";
1856
+ scalar: "scalar";
1857
1857
  }>>;
1858
1858
  audit: z.ZodOptional<z.ZodObject<{
1859
1859
  action: z.ZodString;
@@ -1909,13 +1909,13 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1909
1909
  bigint: "bigint";
1910
1910
  boolean: "boolean";
1911
1911
  date: "date";
1912
- uuid: "uuid";
1913
1912
  text: "text";
1913
+ timestamptz: "timestamptz";
1914
+ jsonb: "jsonb";
1915
+ uuid: "uuid";
1914
1916
  integer: "integer";
1915
1917
  numeric: "numeric";
1916
1918
  double: "double";
1917
- timestamptz: "timestamptz";
1918
- jsonb: "jsonb";
1919
1919
  }>, z.ZodObject<{
1920
1920
  enum: z.ZodString;
1921
1921
  }, z.core.$strip>]>;
@@ -1937,10 +1937,10 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1937
1937
  of: z.ZodString;
1938
1938
  part: z.ZodEnum<{
1939
1939
  at: "at";
1940
- source: "source";
1941
1940
  by: "by";
1942
- conflicts: "conflicts";
1943
1941
  rev: "rev";
1942
+ source: "source";
1943
+ conflicts: "conflicts";
1944
1944
  }>;
1945
1945
  }, z.core.$strict>>;
1946
1946
  }, z.core.$strip>>;
@@ -1989,8 +1989,8 @@ declare const canonicalDefinitionSchema: z.ZodObject<{
1989
1989
  sources: z.ZodArray<z.ZodObject<{
1990
1990
  name: z.ZodString;
1991
1991
  kind: z.ZodEnum<{
1992
- prefetch: "prefetch";
1993
1992
  manual: "manual";
1993
+ prefetch: "prefetch";
1994
1994
  etl: "etl";
1995
1995
  }>;
1996
1996
  table: z.ZodString;