simetra 0.1.0 → 0.3.0-next.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 (36) hide show
  1. package/README.md +1 -0
  2. package/dist/channel-grant-BATD6oQu.js +15 -0
  3. package/dist/compiler/index.d.ts +1470 -227
  4. package/dist/compiler/index.js +39407 -14041
  5. package/dist/data/centrifugo/index.d.ts +24 -0
  6. package/dist/data/centrifugo/index.js +173 -0
  7. package/dist/data/index.d.ts +27 -0
  8. package/dist/data/index.js +9779 -0
  9. package/dist/data/react/index.d.ts +103 -0
  10. package/dist/data/react/index.js +214 -0
  11. package/dist/grant-Zg0hmqK7.d.ts +11 -0
  12. package/dist/handle-C6PFsnUX.js +44 -0
  13. package/dist/holder-CkR-qRYU.d.ts +585 -0
  14. package/dist/model/index.d.ts +5240 -276
  15. package/dist/model/index.js +5030 -276
  16. package/dist/schema/index.d.ts +1812 -660
  17. package/dist/schema/index.js +12649 -6849
  18. package/dist/server/index.d.ts +747 -0
  19. package/dist/server/index.js +5356 -0
  20. package/dist/server/signals/index.d.ts +92 -0
  21. package/dist/server/signals/index.js +140 -0
  22. package/dist/shell/index.d.ts +100 -0
  23. package/dist/shell/index.js +148 -0
  24. package/dist/ui/index.d.ts +213 -0
  25. package/dist/ui/index.js +1075 -0
  26. package/package.json +87 -10
  27. package/schemas/accumulation-registers.schema.json +46 -5
  28. package/schemas/catalogs.schema.json +114 -7
  29. package/schemas/constants.schema.json +31 -5
  30. package/schemas/custom-tables.schema.json +77 -2
  31. package/schemas/documents.schema.json +83 -5
  32. package/schemas/functions.schema.json +129 -0
  33. package/schemas/information-registers.schema.json +47 -5
  34. package/schemas/project.schema.json +266 -4
  35. package/schemas/rights-sets.schema.json +3 -1
  36. package/schemas/roles.schema.json +6 -2
@@ -0,0 +1,129 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "$schema": {
6
+ "description": "Editor hint: path to the JSON Schema of this file.",
7
+ "type": "string"
8
+ },
9
+ "functions": {
10
+ "type": "array",
11
+ "items": {
12
+ "type": "object",
13
+ "properties": {
14
+ "id": {
15
+ "type": "string",
16
+ "format": "uuid",
17
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
18
+ "description": "Stable lowercase UUID v4 identity of the element. Assigned by tooling at creation and never reused; a rename keeps it."
19
+ },
20
+ "function": {
21
+ "type": "object",
22
+ "properties": {
23
+ "schema": {
24
+ "description": "PostgreSQL schema of the function; defaultSchema when absent.",
25
+ "type": "string",
26
+ "minLength": 1
27
+ },
28
+ "name": {
29
+ "type": "string",
30
+ "minLength": 1,
31
+ "description": "Name of the function in its CREATE FUNCTION statement."
32
+ }
33
+ },
34
+ "required": [
35
+ "name"
36
+ ],
37
+ "additionalProperties": false,
38
+ "description": "SQL function of the sibling .sql file."
39
+ },
40
+ "callers": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "string",
44
+ "enum": [
45
+ "user",
46
+ "anonymous",
47
+ "service",
48
+ "command"
49
+ ]
50
+ },
51
+ "description": "Role purposes that get EXECUTE on the function; empty — no application role, only other functions of the owner call it."
52
+ },
53
+ "check": {
54
+ "type": "object",
55
+ "properties": {
56
+ "action": {
57
+ "type": "string",
58
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
59
+ "description": "A word of the action vocabulary or the name of a custom action of the object."
60
+ },
61
+ "object": {
62
+ "type": "object",
63
+ "properties": {
64
+ "kind": {
65
+ "type": "string",
66
+ "enum": [
67
+ "Catalog",
68
+ "Document",
69
+ "Enumeration",
70
+ "InformationRegister",
71
+ "AccumulationRegister",
72
+ "Constant",
73
+ "CustomTable",
74
+ "PgEnum",
75
+ "EventSubscription",
76
+ "RightsSet",
77
+ "Role"
78
+ ],
79
+ "description": "Kind of the referenced metadata object."
80
+ },
81
+ "name": {
82
+ "type": "string",
83
+ "pattern": "^[A-Z][A-Za-z0-9]*$",
84
+ "description": "Logical name of the referenced object."
85
+ }
86
+ },
87
+ "required": [
88
+ "kind",
89
+ "name"
90
+ ],
91
+ "additionalProperties": false,
92
+ "description": "Metadata object whose rights contract is checked."
93
+ },
94
+ "row": {
95
+ "description": "Name of the uuid IN parameter that holds the primary key of the checked row.",
96
+ "type": "string",
97
+ "minLength": 1
98
+ },
99
+ "scope": {
100
+ "description": "Name of the uuid IN parameter that holds the scope value of the check.",
101
+ "type": "string",
102
+ "minLength": 1
103
+ }
104
+ },
105
+ "required": [
106
+ "action",
107
+ "object"
108
+ ],
109
+ "additionalProperties": false,
110
+ "description": "Rights check the function applies before it acts on behalf of the caller."
111
+ }
112
+ },
113
+ "required": [
114
+ "function",
115
+ "callers"
116
+ ],
117
+ "additionalProperties": false,
118
+ "description": "Declaration of one function of the sibling .sql file."
119
+ },
120
+ "description": "Declarations of functions of the sibling .sql file, sorted by function (entries without schema first, then by schema and name) and without duplicates."
121
+ }
122
+ },
123
+ "required": [
124
+ "functions"
125
+ ],
126
+ "additionalProperties": false,
127
+ "description": "Declarations of SQL functions: who may execute them and which rights check they apply.",
128
+ "$id": "functions.schema.json"
129
+ }
@@ -130,11 +130,36 @@
130
130
  }
131
131
  },
132
132
  "publicRead": {
133
- "description": "API role that may read every row of the object: authenticated users or anonymous visitors. Absent means no public read.",
134
- "type": "string",
135
- "enum": [
136
- "authenticated",
137
- "anon"
133
+ "description": "API role that may read the object: authenticated users or anonymous visitors. A string opens every row; an object { role, published: true } opens only rows marked published. Absent means no public read.",
134
+ "anyOf": [
135
+ {
136
+ "type": "string",
137
+ "enum": [
138
+ "authenticated",
139
+ "anon"
140
+ ]
141
+ },
142
+ {
143
+ "type": "object",
144
+ "properties": {
145
+ "role": {
146
+ "type": "string",
147
+ "enum": [
148
+ "authenticated",
149
+ "anon"
150
+ ]
151
+ },
152
+ "published": {
153
+ "type": "boolean",
154
+ "const": true
155
+ }
156
+ },
157
+ "required": [
158
+ "role",
159
+ "published"
160
+ ],
161
+ "additionalProperties": false
162
+ }
138
163
  ]
139
164
  },
140
165
  "customActions": {
@@ -376,6 +401,7 @@
376
401
  "DateTime",
377
402
  "Bytes",
378
403
  "Json",
404
+ "RichText",
379
405
  "Ref"
380
406
  ],
381
407
  "description": "Logical value type."
@@ -669,6 +695,7 @@
669
695
  "DateTime",
670
696
  "Bytes",
671
697
  "Json",
698
+ "RichText",
672
699
  "Ref"
673
700
  ],
674
701
  "description": "Logical value type."
@@ -962,6 +989,7 @@
962
989
  "DateTime",
963
990
  "Bytes",
964
991
  "Json",
992
+ "RichText",
965
993
  "Ref"
966
994
  ],
967
995
  "description": "Logical value type."
@@ -1183,6 +1211,20 @@
1183
1211
  "description": "Marks the attribute as personal data: anonymization sets its columns to NULL, so it cannot be required.",
1184
1212
  "type": "boolean",
1185
1213
  "const": true
1214
+ },
1215
+ "load": {
1216
+ "description": "Whether list reads omit the attribute (\"lazy\"; a card read returns it); default lazy for Bytes and RichText of the header, eager otherwise. Not allowed on a polymorphic Ref, a tabular section attribute, a register attribute or a rights carrier.",
1217
+ "type": "string",
1218
+ "enum": [
1219
+ "eager",
1220
+ "lazy"
1221
+ ]
1222
+ },
1223
+ "maxBytes": {
1224
+ "description": "Most UTF-8 bytes of the JSON wire value a command may write; Text, Json, RichText, Bytes or an array only (the whole array counts). Default 1 MiB for Json, RichText and Bytes, 64 KiB for Text and arrays. Not allowed on a register attribute.",
1225
+ "type": "integer",
1226
+ "exclusiveMinimum": 0,
1227
+ "maximum": 9007199254740991
1186
1228
  }
1187
1229
  },
1188
1230
  "required": [
@@ -34,6 +34,11 @@
34
34
  "en"
35
35
  ]
36
36
  },
37
+ "primaryDataLanguage": {
38
+ "description": "Primary data language: code of the primary row of the languages catalog. Assigned once.",
39
+ "type": "string",
40
+ "pattern": "^[a-z]{2,3}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$"
41
+ },
37
42
  "defaultSchema": {
38
43
  "default": "public",
39
44
  "description": "PostgreSQL schema for objects that declare none.",
@@ -45,7 +50,8 @@
45
50
  "provider": {
46
51
  "type": "string",
47
52
  "enum": [
48
- "supabase"
53
+ "supabase",
54
+ "postgres"
49
55
  ],
50
56
  "description": "Database provider preset that defines the management boundary."
51
57
  }
@@ -81,6 +87,10 @@
81
87
  "type": "string",
82
88
  "minLength": 1
83
89
  },
90
+ "selfSignUp": {
91
+ "description": "Whether users may register themselves; enables the self sign-up warning and host start check.",
92
+ "type": "boolean"
93
+ },
84
94
  "scopeKinds": {
85
95
  "default": [],
86
96
  "description": "Scope kinds of the application; leave empty for a single-tenant application.",
@@ -490,6 +500,66 @@
490
500
  ],
491
501
  "additionalProperties": false,
492
502
  "description": "Logical names of the table columns."
503
+ },
504
+ "where": {
505
+ "default": [],
506
+ "description": "Conditions every row of the source must meet (a conjunction); rows that fail them are not part of the source.",
507
+ "type": "array",
508
+ "items": {
509
+ "anyOf": [
510
+ {
511
+ "type": "object",
512
+ "properties": {
513
+ "column": {
514
+ "type": "string",
515
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
516
+ "description": "Logical name of a column of the table."
517
+ },
518
+ "equals": {
519
+ "anyOf": [
520
+ {
521
+ "type": "string"
522
+ },
523
+ {
524
+ "type": "boolean"
525
+ },
526
+ {
527
+ "type": "integer",
528
+ "minimum": -9007199254740991,
529
+ "maximum": 9007199254740991
530
+ }
531
+ ],
532
+ "description": "Literal the column must equal: a string for a text or uuid column, a boolean, or an integer."
533
+ }
534
+ },
535
+ "required": [
536
+ "column",
537
+ "equals"
538
+ ],
539
+ "additionalProperties": false
540
+ },
541
+ {
542
+ "type": "object",
543
+ "properties": {
544
+ "column": {
545
+ "type": "string",
546
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
547
+ "description": "Logical name of a column of the table."
548
+ },
549
+ "isNull": {
550
+ "type": "boolean",
551
+ "description": "true: the column must be NULL; false: must not be NULL."
552
+ }
553
+ },
554
+ "required": [
555
+ "column",
556
+ "isNull"
557
+ ],
558
+ "additionalProperties": false
559
+ }
560
+ ],
561
+ "description": "Condition on a row of the table: a column equals a literal or is (not) NULL."
562
+ }
493
563
  }
494
564
  },
495
565
  "required": [
@@ -626,9 +696,141 @@
626
696
  "description": "Column with the member (a user for the global level)."
627
697
  },
628
698
  "role": {
629
- "type": "string",
630
- "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
631
- "description": "Column with the role key declared by a role in sourceKeys."
699
+ "anyOf": [
700
+ {
701
+ "type": "string",
702
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
703
+ "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
704
+ },
705
+ {
706
+ "type": "object",
707
+ "properties": {
708
+ "column": {
709
+ "type": "string",
710
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
711
+ "description": "Column of the source table with the uuid reference to the role table."
712
+ },
713
+ "references": {
714
+ "type": "object",
715
+ "properties": {
716
+ "kind": {
717
+ "type": "string",
718
+ "enum": [
719
+ "Catalog",
720
+ "Document",
721
+ "Enumeration",
722
+ "InformationRegister",
723
+ "AccumulationRegister",
724
+ "Constant",
725
+ "CustomTable",
726
+ "PgEnum",
727
+ "EventSubscription",
728
+ "RightsSet",
729
+ "Role"
730
+ ],
731
+ "description": "Kind of the referenced metadata object."
732
+ },
733
+ "name": {
734
+ "type": "string",
735
+ "pattern": "^[A-Z][A-Za-z0-9]*$",
736
+ "description": "Logical name of the referenced object."
737
+ }
738
+ },
739
+ "required": [
740
+ "kind",
741
+ "name"
742
+ ],
743
+ "additionalProperties": false,
744
+ "description": "Adopted role table (CustomTable) with a single-column uuid key."
745
+ },
746
+ "key": {
747
+ "type": "string",
748
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
749
+ "description": "Column of the role table with the role key declared by a role in sourceKeys."
750
+ },
751
+ "where": {
752
+ "default": [],
753
+ "description": "Conditions every row of the role table must meet (a conjunction); required unless the key column is unique on its own.",
754
+ "type": "array",
755
+ "items": {
756
+ "anyOf": [
757
+ {
758
+ "type": "object",
759
+ "properties": {
760
+ "column": {
761
+ "type": "string",
762
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
763
+ "description": "Logical name of a column of the table."
764
+ },
765
+ "equals": {
766
+ "anyOf": [
767
+ {
768
+ "type": "string"
769
+ },
770
+ {
771
+ "type": "boolean"
772
+ },
773
+ {
774
+ "type": "integer",
775
+ "minimum": -9007199254740991,
776
+ "maximum": 9007199254740991
777
+ }
778
+ ],
779
+ "description": "Literal the column must equal: a string for a text or uuid column, a boolean, or an integer."
780
+ }
781
+ },
782
+ "required": [
783
+ "column",
784
+ "equals"
785
+ ],
786
+ "additionalProperties": false
787
+ },
788
+ {
789
+ "type": "object",
790
+ "properties": {
791
+ "column": {
792
+ "type": "string",
793
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
794
+ "description": "Logical name of a column of the table."
795
+ },
796
+ "isNull": {
797
+ "type": "boolean",
798
+ "description": "true: the column must be NULL; false: must not be NULL."
799
+ }
800
+ },
801
+ "required": [
802
+ "column",
803
+ "isNull"
804
+ ],
805
+ "additionalProperties": false
806
+ }
807
+ ],
808
+ "description": "Condition on a row of the table: a column equals a literal or is (not) NULL."
809
+ }
810
+ }
811
+ },
812
+ "required": [
813
+ "column",
814
+ "references",
815
+ "key"
816
+ ],
817
+ "additionalProperties": false
818
+ }
819
+ ],
820
+ "description": "Column with the role key declared by a role in sourceKeys, or a reference to an adopted role table with the key column."
821
+ },
822
+ "scope": {
823
+ "description": "Scope level only: column with the scope of the row, which must equal the scope of the member; null takes the scope from the member; omitted means the scopeColumn of the table.",
824
+ "anyOf": [
825
+ {
826
+ "type": "string",
827
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
828
+ "description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
829
+ },
830
+ {
831
+ "type": "null"
832
+ }
833
+ ]
632
834
  },
633
835
  "container": {
634
836
  "description": "Column with the container; required for the container level only.",
@@ -647,6 +849,66 @@
647
849
  ],
648
850
  "additionalProperties": false,
649
851
  "description": "Logical names of the table columns."
852
+ },
853
+ "where": {
854
+ "default": [],
855
+ "description": "Conditions every row of the source must meet (a conjunction); rows that fail them are not part of the source.",
856
+ "type": "array",
857
+ "items": {
858
+ "anyOf": [
859
+ {
860
+ "type": "object",
861
+ "properties": {
862
+ "column": {
863
+ "type": "string",
864
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
865
+ "description": "Logical name of a column of the table."
866
+ },
867
+ "equals": {
868
+ "anyOf": [
869
+ {
870
+ "type": "string"
871
+ },
872
+ {
873
+ "type": "boolean"
874
+ },
875
+ {
876
+ "type": "integer",
877
+ "minimum": -9007199254740991,
878
+ "maximum": 9007199254740991
879
+ }
880
+ ],
881
+ "description": "Literal the column must equal: a string for a text or uuid column, a boolean, or an integer."
882
+ }
883
+ },
884
+ "required": [
885
+ "column",
886
+ "equals"
887
+ ],
888
+ "additionalProperties": false
889
+ },
890
+ {
891
+ "type": "object",
892
+ "properties": {
893
+ "column": {
894
+ "type": "string",
895
+ "pattern": "^[A-Za-z][A-Za-z0-9_]*$",
896
+ "description": "Logical name of a column of the table."
897
+ },
898
+ "isNull": {
899
+ "type": "boolean",
900
+ "description": "true: the column must be NULL; false: must not be NULL."
901
+ }
902
+ },
903
+ "required": [
904
+ "column",
905
+ "isNull"
906
+ ],
907
+ "additionalProperties": false
908
+ }
909
+ ],
910
+ "description": "Condition on a row of the table: a column equals a literal or is (not) NULL."
911
+ }
650
912
  }
651
913
  },
652
914
  "required": [
@@ -170,7 +170,9 @@
170
170
  "delete",
171
171
  "post",
172
172
  "unpost",
173
- "write"
173
+ "write",
174
+ "publish",
175
+ "unpublish"
174
176
  ],
175
177
  "description": "Standard action word; selects every object of the role level that has it."
176
178
  }
@@ -297,7 +297,9 @@
297
297
  "delete",
298
298
  "post",
299
299
  "unpost",
300
- "write"
300
+ "write",
301
+ "publish",
302
+ "unpublish"
301
303
  ],
302
304
  "description": "Standard action word; selects every object of the role level that has it."
303
305
  }
@@ -420,7 +422,9 @@
420
422
  "delete",
421
423
  "post",
422
424
  "unpost",
423
- "write"
425
+ "write",
426
+ "publish",
427
+ "unpublish"
424
428
  ],
425
429
  "description": "Standard action word; selects every object of the role level that has it."
426
430
  }