@sequenceholdings/orm 2.7.1 → 2.8.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 (47) hide show
  1. package/README.md +18 -4
  2. package/dist/authoring.cjs +21 -0
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +1 -1
  5. package/dist/authoring.d.ts +1 -1
  6. package/dist/authoring.js +21 -0
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.d.cts +71 -71
  9. package/dist/canonical.d.ts +71 -71
  10. package/dist/cli.cjs +3460 -3337
  11. package/dist/cli.cjs.map +1 -1
  12. package/dist/cli.d.cts +13 -1
  13. package/dist/cli.d.ts +13 -1
  14. package/dist/cli.js +3459 -3338
  15. package/dist/cli.js.map +1 -1
  16. package/dist/client.cjs +24 -6
  17. package/dist/client.cjs.map +1 -1
  18. package/dist/client.d.cts +12 -3
  19. package/dist/client.d.ts +12 -3
  20. package/dist/client.js +24 -6
  21. package/dist/client.js.map +1 -1
  22. package/dist/compiler.cjs +844 -15
  23. package/dist/compiler.cjs.map +1 -1
  24. package/dist/compiler.d.cts +12 -2
  25. package/dist/compiler.d.ts +12 -2
  26. package/dist/compiler.js +844 -17
  27. package/dist/compiler.js.map +1 -1
  28. package/dist/index.cjs +21 -0
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.d.cts +57 -57
  31. package/dist/index.d.ts +57 -57
  32. package/dist/index.js +21 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/ir.d.cts +72 -72
  35. package/dist/ir.d.ts +72 -72
  36. package/dist/sdl.cjs +3 -3
  37. package/dist/sdl.cjs.map +1 -1
  38. package/dist/sdl.d.cts +2 -0
  39. package/dist/sdl.d.ts +2 -0
  40. package/dist/sdl.js +3 -3
  41. package/dist/sdl.js.map +1 -1
  42. package/package.json +1 -1
  43. package/templates/orm-namespace/graphql/example/queries.ts +52 -5
  44. package/templates/orm-namespace/schema/tables.ts +5 -2
  45. package/templates/orm-namespace/sequence.config.ts +6 -4
  46. package/dist/{definition-DjfC7Lll.d.cts → definition-B99BsOAO.d.cts} +4 -4
  47. package/dist/{definition-DjfC7Lll.d.ts → definition-B99BsOAO.d.ts} +4 -4
package/dist/ir.d.ts CHANGED
@@ -68,9 +68,9 @@ declare const valueIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
68
68
  }, z.core.$strip>, z.ZodObject<{
69
69
  kind: z.ZodLiteral<"claim">;
70
70
  key: z.ZodEnum<{
71
- sub: "sub";
72
71
  ext_subject: "ext_subject";
73
72
  ext_email: "ext_email";
73
+ sub: "sub";
74
74
  org: "org";
75
75
  }>;
76
76
  }, z.core.$strip>], "kind">;
@@ -233,9 +233,9 @@ declare const prefetchPlanIrSchema: z.ZodObject<{
233
233
  }, z.core.$strip>, z.ZodObject<{
234
234
  kind: z.ZodLiteral<"claim">;
235
235
  key: z.ZodEnum<{
236
- sub: "sub";
237
236
  ext_subject: "ext_subject";
238
237
  ext_email: "ext_email";
238
+ sub: "sub";
239
239
  org: "org";
240
240
  }>;
241
241
  }, z.core.$strip>], "kind">;
@@ -249,9 +249,9 @@ declare const prefetchPlanIrSchema: z.ZodObject<{
249
249
  }, z.core.$strip>, z.ZodObject<{
250
250
  kind: z.ZodLiteral<"claim">;
251
251
  key: z.ZodEnum<{
252
- sub: "sub";
253
252
  ext_subject: "ext_subject";
254
253
  ext_email: "ext_email";
254
+ sub: "sub";
255
255
  org: "org";
256
256
  }>;
257
257
  }, z.core.$strip>], "kind">;
@@ -336,9 +336,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
336
336
  }, z.core.$strip>, z.ZodObject<{
337
337
  kind: z.ZodLiteral<"claim">;
338
338
  key: z.ZodEnum<{
339
- sub: "sub";
340
339
  ext_subject: "ext_subject";
341
340
  ext_email: "ext_email";
341
+ sub: "sub";
342
342
  org: "org";
343
343
  }>;
344
344
  }, z.core.$strip>], "kind">;
@@ -352,9 +352,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
352
352
  }, z.core.$strip>, z.ZodObject<{
353
353
  kind: z.ZodLiteral<"claim">;
354
354
  key: z.ZodEnum<{
355
- sub: "sub";
356
355
  ext_subject: "ext_subject";
357
356
  ext_email: "ext_email";
357
+ sub: "sub";
358
358
  org: "org";
359
359
  }>;
360
360
  }, z.core.$strip>], "kind">;
@@ -376,9 +376,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
376
376
  }, z.core.$strip>, z.ZodObject<{
377
377
  kind: z.ZodLiteral<"claim">;
378
378
  key: z.ZodEnum<{
379
- sub: "sub";
380
379
  ext_subject: "ext_subject";
381
380
  ext_email: "ext_email";
381
+ sub: "sub";
382
382
  org: "org";
383
383
  }>;
384
384
  }, z.core.$strip>], "kind">;
@@ -401,9 +401,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
401
401
  }, z.core.$strip>, z.ZodObject<{
402
402
  kind: z.ZodLiteral<"claim">;
403
403
  key: z.ZodEnum<{
404
- sub: "sub";
405
404
  ext_subject: "ext_subject";
406
405
  ext_email: "ext_email";
406
+ sub: "sub";
407
407
  org: "org";
408
408
  }>;
409
409
  }, z.core.$strip>], "kind">;
@@ -417,9 +417,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
417
417
  }, z.core.$strip>, z.ZodObject<{
418
418
  kind: z.ZodLiteral<"claim">;
419
419
  key: z.ZodEnum<{
420
- sub: "sub";
421
420
  ext_subject: "ext_subject";
422
421
  ext_email: "ext_email";
422
+ sub: "sub";
423
423
  org: "org";
424
424
  }>;
425
425
  }, z.core.$strip>], "kind">;
@@ -485,10 +485,10 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
485
485
  kind: z.ZodLiteral<"mutation">;
486
486
  op: z.ZodEnum<{
487
487
  insert: "insert";
488
- update: "update";
489
- delete: "delete";
490
488
  insertOne: "insertOne";
489
+ update: "update";
491
490
  updateByPk: "updateByPk";
491
+ delete: "delete";
492
492
  deleteByPk: "deleteByPk";
493
493
  cowOverride: "cowOverride";
494
494
  cowRevert: "cowRevert";
@@ -497,8 +497,8 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
497
497
  resolvedAction: z.ZodOptional<z.ZodEnum<{
498
498
  insert: "insert";
499
499
  update: "update";
500
- revert: "revert";
501
500
  delete: "delete";
501
+ revert: "revert";
502
502
  }>>;
503
503
  revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
504
504
  writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -528,9 +528,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
528
528
  }, z.core.$strip>, z.ZodObject<{
529
529
  kind: z.ZodLiteral<"claim">;
530
530
  key: z.ZodEnum<{
531
- sub: "sub";
532
531
  ext_subject: "ext_subject";
533
532
  ext_email: "ext_email";
533
+ sub: "sub";
534
534
  org: "org";
535
535
  }>;
536
536
  }, z.core.$strip>], "kind">;
@@ -547,9 +547,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
547
547
  }, z.core.$strip>, z.ZodObject<{
548
548
  kind: z.ZodLiteral<"claim">;
549
549
  key: z.ZodEnum<{
550
- sub: "sub";
551
550
  ext_subject: "ext_subject";
552
551
  ext_email: "ext_email";
552
+ sub: "sub";
553
553
  org: "org";
554
554
  }>;
555
555
  }, z.core.$strip>], "kind">;
@@ -574,9 +574,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
574
574
  }, z.core.$strip>, z.ZodObject<{
575
575
  kind: z.ZodLiteral<"claim">;
576
576
  key: z.ZodEnum<{
577
- sub: "sub";
578
577
  ext_subject: "ext_subject";
579
578
  ext_email: "ext_email";
579
+ sub: "sub";
580
580
  org: "org";
581
581
  }>;
582
582
  }, z.core.$strip>], "kind">;
@@ -596,9 +596,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
596
596
  }, z.core.$strip>, z.ZodObject<{
597
597
  kind: z.ZodLiteral<"claim">;
598
598
  key: z.ZodEnum<{
599
- sub: "sub";
600
599
  ext_subject: "ext_subject";
601
600
  ext_email: "ext_email";
601
+ sub: "sub";
602
602
  org: "org";
603
603
  }>;
604
604
  }, z.core.$strip>], "kind">;
@@ -618,9 +618,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
618
618
  }, z.core.$strip>, z.ZodObject<{
619
619
  kind: z.ZodLiteral<"claim">;
620
620
  key: z.ZodEnum<{
621
- sub: "sub";
622
621
  ext_subject: "ext_subject";
623
622
  ext_email: "ext_email";
623
+ sub: "sub";
624
624
  org: "org";
625
625
  }>;
626
626
  }, z.core.$strip>], "kind">;
@@ -638,9 +638,9 @@ declare const rootIrSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
638
638
  }, z.core.$strip>, z.ZodObject<{
639
639
  kind: z.ZodLiteral<"claim">;
640
640
  key: z.ZodEnum<{
641
- sub: "sub";
642
641
  ext_subject: "ext_subject";
643
642
  ext_email: "ext_email";
643
+ sub: "sub";
644
644
  org: "org";
645
645
  }>;
646
646
  }, z.core.$strip>], "kind">;
@@ -676,13 +676,13 @@ declare const variableIrSchema: z.ZodObject<{
676
676
  bigint: "bigint";
677
677
  boolean: "boolean";
678
678
  date: "date";
679
- text: "text";
680
- timestamptz: "timestamptz";
681
- jsonb: "jsonb";
682
679
  uuid: "uuid";
680
+ text: "text";
683
681
  integer: "integer";
684
682
  numeric: "numeric";
685
683
  double: "double";
684
+ timestamptz: "timestamptz";
685
+ jsonb: "jsonb";
686
686
  }>;
687
687
  }, z.core.$strip>, z.ZodObject<{
688
688
  kind: z.ZodLiteral<"enum">;
@@ -736,13 +736,13 @@ declare const compiledOperationSchema: z.ZodObject<{
736
736
  bigint: "bigint";
737
737
  boolean: "boolean";
738
738
  date: "date";
739
- text: "text";
740
- timestamptz: "timestamptz";
741
- jsonb: "jsonb";
742
739
  uuid: "uuid";
740
+ text: "text";
743
741
  integer: "integer";
744
742
  numeric: "numeric";
745
743
  double: "double";
744
+ timestamptz: "timestamptz";
745
+ jsonb: "jsonb";
746
746
  }>;
747
747
  nullable: z.ZodBoolean;
748
748
  }, z.core.$strip>>;
@@ -754,8 +754,8 @@ declare const compiledOperationSchema: z.ZodObject<{
754
754
  name: z.ZodString;
755
755
  opHash: z.ZodString;
756
756
  kind: z.ZodEnum<{
757
- query: "query";
758
757
  mutation: "mutation";
758
+ query: "query";
759
759
  }>;
760
760
  requires: z.ZodNullable<z.ZodObject<{
761
761
  capability: z.ZodOptional<z.ZodString>;
@@ -769,13 +769,13 @@ declare const compiledOperationSchema: z.ZodObject<{
769
769
  bigint: "bigint";
770
770
  boolean: "boolean";
771
771
  date: "date";
772
- text: "text";
773
- timestamptz: "timestamptz";
774
- jsonb: "jsonb";
775
772
  uuid: "uuid";
773
+ text: "text";
776
774
  integer: "integer";
777
775
  numeric: "numeric";
778
776
  double: "double";
777
+ timestamptz: "timestamptz";
778
+ jsonb: "jsonb";
779
779
  }>;
780
780
  }, z.core.$strip>, z.ZodObject<{
781
781
  kind: z.ZodLiteral<"enum">;
@@ -853,9 +853,9 @@ declare const compiledOperationSchema: z.ZodObject<{
853
853
  }, z.core.$strip>, z.ZodObject<{
854
854
  kind: z.ZodLiteral<"claim">;
855
855
  key: z.ZodEnum<{
856
- sub: "sub";
857
856
  ext_subject: "ext_subject";
858
857
  ext_email: "ext_email";
858
+ sub: "sub";
859
859
  org: "org";
860
860
  }>;
861
861
  }, z.core.$strip>], "kind">;
@@ -869,9 +869,9 @@ declare const compiledOperationSchema: z.ZodObject<{
869
869
  }, z.core.$strip>, z.ZodObject<{
870
870
  kind: z.ZodLiteral<"claim">;
871
871
  key: z.ZodEnum<{
872
- sub: "sub";
873
872
  ext_subject: "ext_subject";
874
873
  ext_email: "ext_email";
874
+ sub: "sub";
875
875
  org: "org";
876
876
  }>;
877
877
  }, z.core.$strip>], "kind">;
@@ -893,9 +893,9 @@ declare const compiledOperationSchema: z.ZodObject<{
893
893
  }, z.core.$strip>, z.ZodObject<{
894
894
  kind: z.ZodLiteral<"claim">;
895
895
  key: z.ZodEnum<{
896
- sub: "sub";
897
896
  ext_subject: "ext_subject";
898
897
  ext_email: "ext_email";
898
+ sub: "sub";
899
899
  org: "org";
900
900
  }>;
901
901
  }, z.core.$strip>], "kind">;
@@ -918,9 +918,9 @@ declare const compiledOperationSchema: z.ZodObject<{
918
918
  }, z.core.$strip>, z.ZodObject<{
919
919
  kind: z.ZodLiteral<"claim">;
920
920
  key: z.ZodEnum<{
921
- sub: "sub";
922
921
  ext_subject: "ext_subject";
923
922
  ext_email: "ext_email";
923
+ sub: "sub";
924
924
  org: "org";
925
925
  }>;
926
926
  }, z.core.$strip>], "kind">;
@@ -934,9 +934,9 @@ declare const compiledOperationSchema: z.ZodObject<{
934
934
  }, z.core.$strip>, z.ZodObject<{
935
935
  kind: z.ZodLiteral<"claim">;
936
936
  key: z.ZodEnum<{
937
- sub: "sub";
938
937
  ext_subject: "ext_subject";
939
938
  ext_email: "ext_email";
939
+ sub: "sub";
940
940
  org: "org";
941
941
  }>;
942
942
  }, z.core.$strip>], "kind">;
@@ -1002,10 +1002,10 @@ declare const compiledOperationSchema: z.ZodObject<{
1002
1002
  kind: z.ZodLiteral<"mutation">;
1003
1003
  op: z.ZodEnum<{
1004
1004
  insert: "insert";
1005
- update: "update";
1006
- delete: "delete";
1007
1005
  insertOne: "insertOne";
1006
+ update: "update";
1008
1007
  updateByPk: "updateByPk";
1008
+ delete: "delete";
1009
1009
  deleteByPk: "deleteByPk";
1010
1010
  cowOverride: "cowOverride";
1011
1011
  cowRevert: "cowRevert";
@@ -1014,8 +1014,8 @@ declare const compiledOperationSchema: z.ZodObject<{
1014
1014
  resolvedAction: z.ZodOptional<z.ZodEnum<{
1015
1015
  insert: "insert";
1016
1016
  update: "update";
1017
- revert: "revert";
1018
1017
  delete: "delete";
1018
+ revert: "revert";
1019
1019
  }>>;
1020
1020
  revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1021
1021
  writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1045,9 +1045,9 @@ declare const compiledOperationSchema: z.ZodObject<{
1045
1045
  }, z.core.$strip>, z.ZodObject<{
1046
1046
  kind: z.ZodLiteral<"claim">;
1047
1047
  key: z.ZodEnum<{
1048
- sub: "sub";
1049
1048
  ext_subject: "ext_subject";
1050
1049
  ext_email: "ext_email";
1050
+ sub: "sub";
1051
1051
  org: "org";
1052
1052
  }>;
1053
1053
  }, z.core.$strip>], "kind">;
@@ -1064,9 +1064,9 @@ declare const compiledOperationSchema: z.ZodObject<{
1064
1064
  }, z.core.$strip>, z.ZodObject<{
1065
1065
  kind: z.ZodLiteral<"claim">;
1066
1066
  key: z.ZodEnum<{
1067
- sub: "sub";
1068
1067
  ext_subject: "ext_subject";
1069
1068
  ext_email: "ext_email";
1069
+ sub: "sub";
1070
1070
  org: "org";
1071
1071
  }>;
1072
1072
  }, z.core.$strip>], "kind">;
@@ -1091,9 +1091,9 @@ declare const compiledOperationSchema: z.ZodObject<{
1091
1091
  }, z.core.$strip>, z.ZodObject<{
1092
1092
  kind: z.ZodLiteral<"claim">;
1093
1093
  key: z.ZodEnum<{
1094
- sub: "sub";
1095
1094
  ext_subject: "ext_subject";
1096
1095
  ext_email: "ext_email";
1096
+ sub: "sub";
1097
1097
  org: "org";
1098
1098
  }>;
1099
1099
  }, z.core.$strip>], "kind">;
@@ -1113,9 +1113,9 @@ declare const compiledOperationSchema: z.ZodObject<{
1113
1113
  }, z.core.$strip>, z.ZodObject<{
1114
1114
  kind: z.ZodLiteral<"claim">;
1115
1115
  key: z.ZodEnum<{
1116
- sub: "sub";
1117
1116
  ext_subject: "ext_subject";
1118
1117
  ext_email: "ext_email";
1118
+ sub: "sub";
1119
1119
  org: "org";
1120
1120
  }>;
1121
1121
  }, z.core.$strip>], "kind">;
@@ -1135,9 +1135,9 @@ declare const compiledOperationSchema: z.ZodObject<{
1135
1135
  }, z.core.$strip>, z.ZodObject<{
1136
1136
  kind: z.ZodLiteral<"claim">;
1137
1137
  key: z.ZodEnum<{
1138
- sub: "sub";
1139
1138
  ext_subject: "ext_subject";
1140
1139
  ext_email: "ext_email";
1140
+ sub: "sub";
1141
1141
  org: "org";
1142
1142
  }>;
1143
1143
  }, z.core.$strip>], "kind">;
@@ -1155,9 +1155,9 @@ declare const compiledOperationSchema: z.ZodObject<{
1155
1155
  }, z.core.$strip>, z.ZodObject<{
1156
1156
  kind: z.ZodLiteral<"claim">;
1157
1157
  key: z.ZodEnum<{
1158
- sub: "sub";
1159
1158
  ext_subject: "ext_subject";
1160
1159
  ext_email: "ext_email";
1160
+ sub: "sub";
1161
1161
  org: "org";
1162
1162
  }>;
1163
1163
  }, z.core.$strip>], "kind">;
@@ -1176,8 +1176,8 @@ type CompiledOperation = z.infer<typeof compiledOperationSchema>;
1176
1176
  declare const resolvedSourceIrSchema: z.ZodObject<{
1177
1177
  name: z.ZodString;
1178
1178
  kind: z.ZodEnum<{
1179
- manual: "manual";
1180
1179
  prefetch: "prefetch";
1180
+ manual: "manual";
1181
1181
  etl: "etl";
1182
1182
  }>;
1183
1183
  table: z.ZodString;
@@ -1221,8 +1221,8 @@ declare const resolvedMetaIrSchema: z.ZodObject<{
1221
1221
  sources: z.ZodArray<z.ZodObject<{
1222
1222
  name: z.ZodString;
1223
1223
  kind: z.ZodEnum<{
1224
- manual: "manual";
1225
1224
  prefetch: "prefetch";
1225
+ manual: "manual";
1226
1226
  etl: "etl";
1227
1227
  }>;
1228
1228
  table: z.ZodString;
@@ -1300,13 +1300,13 @@ declare const tableMetaIrSchema: z.ZodObject<{
1300
1300
  bigint: "bigint";
1301
1301
  boolean: "boolean";
1302
1302
  date: "date";
1303
- text: "text";
1304
- timestamptz: "timestamptz";
1305
- jsonb: "jsonb";
1306
1303
  uuid: "uuid";
1304
+ text: "text";
1307
1305
  integer: "integer";
1308
1306
  numeric: "numeric";
1309
1307
  double: "double";
1308
+ timestamptz: "timestamptz";
1309
+ jsonb: "jsonb";
1310
1310
  }>, z.ZodObject<{
1311
1311
  enum: z.ZodString;
1312
1312
  values: z.ZodArray<z.ZodString>;
@@ -1344,8 +1344,8 @@ declare const tableMetaIrSchema: z.ZodObject<{
1344
1344
  sources: z.ZodArray<z.ZodObject<{
1345
1345
  name: z.ZodString;
1346
1346
  kind: z.ZodEnum<{
1347
- manual: "manual";
1348
1347
  prefetch: "prefetch";
1348
+ manual: "manual";
1349
1349
  etl: "etl";
1350
1350
  }>;
1351
1351
  table: z.ZodString;
@@ -1434,13 +1434,13 @@ declare const compiledArtifactSchema: z.ZodObject<{
1434
1434
  bigint: "bigint";
1435
1435
  boolean: "boolean";
1436
1436
  date: "date";
1437
- text: "text";
1438
- timestamptz: "timestamptz";
1439
- jsonb: "jsonb";
1440
1437
  uuid: "uuid";
1438
+ text: "text";
1441
1439
  integer: "integer";
1442
1440
  numeric: "numeric";
1443
1441
  double: "double";
1442
+ timestamptz: "timestamptz";
1443
+ jsonb: "jsonb";
1444
1444
  }>, z.ZodObject<{
1445
1445
  enum: z.ZodString;
1446
1446
  values: z.ZodArray<z.ZodString>;
@@ -1478,8 +1478,8 @@ declare const compiledArtifactSchema: z.ZodObject<{
1478
1478
  sources: z.ZodArray<z.ZodObject<{
1479
1479
  name: z.ZodString;
1480
1480
  kind: z.ZodEnum<{
1481
- manual: "manual";
1482
1481
  prefetch: "prefetch";
1482
+ manual: "manual";
1483
1483
  etl: "etl";
1484
1484
  }>;
1485
1485
  table: z.ZodString;
@@ -1557,13 +1557,13 @@ declare const compiledArtifactSchema: z.ZodObject<{
1557
1557
  bigint: "bigint";
1558
1558
  boolean: "boolean";
1559
1559
  date: "date";
1560
- text: "text";
1561
- timestamptz: "timestamptz";
1562
- jsonb: "jsonb";
1563
1560
  uuid: "uuid";
1561
+ text: "text";
1564
1562
  integer: "integer";
1565
1563
  numeric: "numeric";
1566
1564
  double: "double";
1565
+ timestamptz: "timestamptz";
1566
+ jsonb: "jsonb";
1567
1567
  }>;
1568
1568
  nullable: z.ZodBoolean;
1569
1569
  }, z.core.$strip>>;
@@ -1575,8 +1575,8 @@ declare const compiledArtifactSchema: z.ZodObject<{
1575
1575
  name: z.ZodString;
1576
1576
  opHash: z.ZodString;
1577
1577
  kind: z.ZodEnum<{
1578
- query: "query";
1579
1578
  mutation: "mutation";
1579
+ query: "query";
1580
1580
  }>;
1581
1581
  requires: z.ZodNullable<z.ZodObject<{
1582
1582
  capability: z.ZodOptional<z.ZodString>;
@@ -1590,13 +1590,13 @@ declare const compiledArtifactSchema: z.ZodObject<{
1590
1590
  bigint: "bigint";
1591
1591
  boolean: "boolean";
1592
1592
  date: "date";
1593
- text: "text";
1594
- timestamptz: "timestamptz";
1595
- jsonb: "jsonb";
1596
1593
  uuid: "uuid";
1594
+ text: "text";
1597
1595
  integer: "integer";
1598
1596
  numeric: "numeric";
1599
1597
  double: "double";
1598
+ timestamptz: "timestamptz";
1599
+ jsonb: "jsonb";
1600
1600
  }>;
1601
1601
  }, z.core.$strip>, z.ZodObject<{
1602
1602
  kind: z.ZodLiteral<"enum">;
@@ -1674,9 +1674,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1674
1674
  }, z.core.$strip>, z.ZodObject<{
1675
1675
  kind: z.ZodLiteral<"claim">;
1676
1676
  key: z.ZodEnum<{
1677
- sub: "sub";
1678
1677
  ext_subject: "ext_subject";
1679
1678
  ext_email: "ext_email";
1679
+ sub: "sub";
1680
1680
  org: "org";
1681
1681
  }>;
1682
1682
  }, z.core.$strip>], "kind">;
@@ -1690,9 +1690,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1690
1690
  }, z.core.$strip>, z.ZodObject<{
1691
1691
  kind: z.ZodLiteral<"claim">;
1692
1692
  key: z.ZodEnum<{
1693
- sub: "sub";
1694
1693
  ext_subject: "ext_subject";
1695
1694
  ext_email: "ext_email";
1695
+ sub: "sub";
1696
1696
  org: "org";
1697
1697
  }>;
1698
1698
  }, z.core.$strip>], "kind">;
@@ -1714,9 +1714,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1714
1714
  }, z.core.$strip>, z.ZodObject<{
1715
1715
  kind: z.ZodLiteral<"claim">;
1716
1716
  key: z.ZodEnum<{
1717
- sub: "sub";
1718
1717
  ext_subject: "ext_subject";
1719
1718
  ext_email: "ext_email";
1719
+ sub: "sub";
1720
1720
  org: "org";
1721
1721
  }>;
1722
1722
  }, z.core.$strip>], "kind">;
@@ -1739,9 +1739,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1739
1739
  }, z.core.$strip>, z.ZodObject<{
1740
1740
  kind: z.ZodLiteral<"claim">;
1741
1741
  key: z.ZodEnum<{
1742
- sub: "sub";
1743
1742
  ext_subject: "ext_subject";
1744
1743
  ext_email: "ext_email";
1744
+ sub: "sub";
1745
1745
  org: "org";
1746
1746
  }>;
1747
1747
  }, z.core.$strip>], "kind">;
@@ -1755,9 +1755,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1755
1755
  }, z.core.$strip>, z.ZodObject<{
1756
1756
  kind: z.ZodLiteral<"claim">;
1757
1757
  key: z.ZodEnum<{
1758
- sub: "sub";
1759
1758
  ext_subject: "ext_subject";
1760
1759
  ext_email: "ext_email";
1760
+ sub: "sub";
1761
1761
  org: "org";
1762
1762
  }>;
1763
1763
  }, z.core.$strip>], "kind">;
@@ -1823,10 +1823,10 @@ declare const compiledArtifactSchema: z.ZodObject<{
1823
1823
  kind: z.ZodLiteral<"mutation">;
1824
1824
  op: z.ZodEnum<{
1825
1825
  insert: "insert";
1826
- update: "update";
1827
- delete: "delete";
1828
1826
  insertOne: "insertOne";
1827
+ update: "update";
1829
1828
  updateByPk: "updateByPk";
1829
+ delete: "delete";
1830
1830
  deleteByPk: "deleteByPk";
1831
1831
  cowOverride: "cowOverride";
1832
1832
  cowRevert: "cowRevert";
@@ -1835,8 +1835,8 @@ declare const compiledArtifactSchema: z.ZodObject<{
1835
1835
  resolvedAction: z.ZodOptional<z.ZodEnum<{
1836
1836
  insert: "insert";
1837
1837
  update: "update";
1838
- revert: "revert";
1839
1838
  delete: "delete";
1839
+ revert: "revert";
1840
1840
  }>>;
1841
1841
  revertColumns: z.ZodOptional<z.ZodArray<z.ZodString>>;
1842
1842
  writeback: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1866,9 +1866,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1866
1866
  }, z.core.$strip>, z.ZodObject<{
1867
1867
  kind: z.ZodLiteral<"claim">;
1868
1868
  key: z.ZodEnum<{
1869
- sub: "sub";
1870
1869
  ext_subject: "ext_subject";
1871
1870
  ext_email: "ext_email";
1871
+ sub: "sub";
1872
1872
  org: "org";
1873
1873
  }>;
1874
1874
  }, z.core.$strip>], "kind">;
@@ -1885,9 +1885,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1885
1885
  }, z.core.$strip>, z.ZodObject<{
1886
1886
  kind: z.ZodLiteral<"claim">;
1887
1887
  key: z.ZodEnum<{
1888
- sub: "sub";
1889
1888
  ext_subject: "ext_subject";
1890
1889
  ext_email: "ext_email";
1890
+ sub: "sub";
1891
1891
  org: "org";
1892
1892
  }>;
1893
1893
  }, z.core.$strip>], "kind">;
@@ -1912,9 +1912,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1912
1912
  }, z.core.$strip>, z.ZodObject<{
1913
1913
  kind: z.ZodLiteral<"claim">;
1914
1914
  key: z.ZodEnum<{
1915
- sub: "sub";
1916
1915
  ext_subject: "ext_subject";
1917
1916
  ext_email: "ext_email";
1917
+ sub: "sub";
1918
1918
  org: "org";
1919
1919
  }>;
1920
1920
  }, z.core.$strip>], "kind">;
@@ -1934,9 +1934,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1934
1934
  }, z.core.$strip>, z.ZodObject<{
1935
1935
  kind: z.ZodLiteral<"claim">;
1936
1936
  key: z.ZodEnum<{
1937
- sub: "sub";
1938
1937
  ext_subject: "ext_subject";
1939
1938
  ext_email: "ext_email";
1939
+ sub: "sub";
1940
1940
  org: "org";
1941
1941
  }>;
1942
1942
  }, z.core.$strip>], "kind">;
@@ -1956,9 +1956,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1956
1956
  }, z.core.$strip>, z.ZodObject<{
1957
1957
  kind: z.ZodLiteral<"claim">;
1958
1958
  key: z.ZodEnum<{
1959
- sub: "sub";
1960
1959
  ext_subject: "ext_subject";
1961
1960
  ext_email: "ext_email";
1961
+ sub: "sub";
1962
1962
  org: "org";
1963
1963
  }>;
1964
1964
  }, z.core.$strip>], "kind">;
@@ -1976,9 +1976,9 @@ declare const compiledArtifactSchema: z.ZodObject<{
1976
1976
  }, z.core.$strip>, z.ZodObject<{
1977
1977
  kind: z.ZodLiteral<"claim">;
1978
1978
  key: z.ZodEnum<{
1979
- sub: "sub";
1980
1979
  ext_subject: "ext_subject";
1981
1980
  ext_email: "ext_email";
1981
+ sub: "sub";
1982
1982
  org: "org";
1983
1983
  }>;
1984
1984
  }, z.core.$strip>], "kind">;
package/dist/sdl.cjs CHANGED
@@ -1802,7 +1802,7 @@ var PLATFORM_USER_FIELDS = [
1802
1802
  ];
1803
1803
  function generateSdl(canonical, options = {}) {
1804
1804
  const def = composeNamespace(normalizeCanonical(canonicalDefinitionSchema.parse(canonical))).definition;
1805
- const exposed = canonicalRelations(def).filter((table) => table.source === void 0 && table.internal !== true);
1805
+ const exposed = canonicalRelations(def).filter((table) => table.internal !== true && (table.source === void 0 || options.includeSyncedReads === true && (table.primaryKey?.length ?? 0) > 0));
1806
1806
  const cellsByTable = new Map(exposed.map((table) => [table.table, trackedCells(table)]));
1807
1807
  const tables = exposed.map((table) => ({ ...table, columns: table.columns.filter((column) => column.cell === void 0) }));
1808
1808
  if (tables.length === 0) {
@@ -2112,10 +2112,10 @@ function renderResolvedMutationFields(table, names) {
2112
2112
  return lines;
2113
2113
  }
2114
2114
  function allowsInsert(table) {
2115
- return table.policies.write !== void 0 || table.policies.insert !== void 0;
2115
+ return table.source === void 0 && (table.policies.write !== void 0 || table.policies.insert !== void 0);
2116
2116
  }
2117
2117
  function allowsUpdate(table) {
2118
- return table.policies.write !== void 0 || table.policies.update !== void 0;
2118
+ return table.source === void 0 && (table.policies.write !== void 0 || table.policies.update !== void 0);
2119
2119
  }
2120
2120
  function allowsOnConflict(table) {
2121
2121
  if (!allowsInsert(table) || !allowsUpdate(table)) return false;