simetra 0.3.0-next.1 → 0.3.0-next.3
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/dist/compiler/index.d.ts +20 -3
- package/dist/compiler/index.js +302 -23
- package/dist/data/index.js +225 -94
- package/dist/model/index.d.ts +157 -3
- package/dist/model/index.js +47 -4
- package/dist/schema/index.d.ts +29 -7
- package/dist/schema/index.js +58 -15
- package/dist/shell/index.d.ts +12 -0
- package/dist/shell/index.js +12 -1
- package/dist/ui/index.js +25 -2
- package/package.json +2 -1
- package/schemas/project.schema.json +179 -0
- package/schemas/rights-sets.schema.json +15 -0
- package/schemas/roles.schema.json +15 -0
package/dist/shell/index.js
CHANGED
|
@@ -145,4 +145,15 @@ function routerNavigation(router) {
|
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
|
|
148
|
+
// src/shell/hydration.ts
|
|
149
|
+
/**
|
|
150
|
+
* Маркер кінця гідратації (спека «Споживач поза монорепо» §5.5, T6):
|
|
151
|
+
* `<html data-hydrated="true">` ставиться раз, після того як клієнт узяв
|
|
152
|
+
* серверну розмітку під себе. Тест застосунку чекає `html[data-hydrated]`
|
|
153
|
+
* замість таймера; атрибут є й у production-збірці. Корінь застосунку кличе
|
|
154
|
+
* цю функцію в ефекті гідратації.
|
|
155
|
+
*/
|
|
156
|
+
function markHydrated(doc) {
|
|
157
|
+
doc.documentElement.setAttribute("data-hydrated", "true");
|
|
158
|
+
}
|
|
159
|
+
export { entityCardRoute, entityListRoute, markHydrated, routerNavigation, simetraApp };
|
package/dist/ui/index.js
CHANGED
|
@@ -421,6 +421,27 @@ const STATE_CELL_WIDTH = "var(--simetra-state-cell-width, 160px)";
|
|
|
421
421
|
const SELECTION_PANEL_HEIGHT = "var(--simetra-selection-panel-height, 32px)";
|
|
422
422
|
/** Width of the reserved selection-count slot; override with `--simetra-selection-count-width`. */
|
|
423
423
|
const SELECTION_COUNT_WIDTH = "var(--simetra-selection-count-width, 96px)";
|
|
424
|
+
// src/ui/view-markers.ts
|
|
425
|
+
/**
|
|
426
|
+
* `loading` — даних ще немає; `refreshing` — дані є, перечитуються; усе
|
|
427
|
+
* інше (`ready`, `error`, `purged`) — `ready`: подання вже не чекає даних, а
|
|
428
|
+
* причину відмови показує власний слот.
|
|
429
|
+
*/
|
|
430
|
+
function viewStateOf(status) {
|
|
431
|
+
return status === "loading" || status === "refreshing" ? status : "ready";
|
|
432
|
+
}
|
|
433
|
+
/** `pending`, коли хоч один рядок області чекає запису: стан `pending` чи `unknown`. */
|
|
434
|
+
function writesOf(rows) {
|
|
435
|
+
for (const row of rows) if (row.state === "pending" || row.state === "unknown") return "pending";
|
|
436
|
+
return "idle";
|
|
437
|
+
}
|
|
438
|
+
/** Атрибути області `[data-region="list"]` і `[data-region="card"]`. */
|
|
439
|
+
function viewMarkers(status, rows) {
|
|
440
|
+
return {
|
|
441
|
+
"data-view-state": viewStateOf(status),
|
|
442
|
+
"data-writes": writesOf(rows)
|
|
443
|
+
};
|
|
444
|
+
}
|
|
424
445
|
// src/ui/list/selection-panel.ts
|
|
425
446
|
function Button$1(props) {
|
|
426
447
|
return createElement("button", {
|
|
@@ -668,7 +689,8 @@ function ListHost(props) {
|
|
|
668
689
|
return createElement("div", {
|
|
669
690
|
"data-region": "list",
|
|
670
691
|
"data-object": object,
|
|
671
|
-
role: "grid"
|
|
692
|
+
role: "grid",
|
|
693
|
+
...viewMarkers(view.status, rows)
|
|
672
694
|
}, createElement(SelectionPanel, { view }), createElement("div", {
|
|
673
695
|
role: "row",
|
|
674
696
|
style: {
|
|
@@ -1049,7 +1071,8 @@ function CardBody(props) {
|
|
|
1049
1071
|
"data-object": object,
|
|
1050
1072
|
"data-key": id,
|
|
1051
1073
|
"data-state": row === void 0 ? void 0 : displayState(row),
|
|
1052
|
-
"data-draft": draft.state
|
|
1074
|
+
"data-draft": draft.state,
|
|
1075
|
+
...viewMarkers(card.status, row === void 0 ? [] : [row])
|
|
1053
1076
|
}, createElement("div", { "data-region": "card-status" }, createElement("span", {
|
|
1054
1077
|
"aria-live": "polite",
|
|
1055
1078
|
"data-card": "status"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simetra",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.3",
|
|
4
4
|
"description": "Metadata-driven platform for business applications on Postgres: metamodel, compiler and schema engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"metadata",
|
|
@@ -135,6 +135,7 @@
|
|
|
135
135
|
"publishConfig": {
|
|
136
136
|
"access": "public"
|
|
137
137
|
},
|
|
138
|
+
"gitHead": "02c584e117fd4495e4b75baa9872bb8ac54e3af0",
|
|
138
139
|
"scripts": {
|
|
139
140
|
"build": "tsc --noEmit",
|
|
140
141
|
"build:package": "tsdown",
|
|
@@ -91,6 +91,185 @@
|
|
|
91
91
|
"description": "Whether users may register themselves; enables the self sign-up warning and host start check.",
|
|
92
92
|
"type": "boolean"
|
|
93
93
|
},
|
|
94
|
+
"selfSignUpAccepted": {
|
|
95
|
+
"description": "What the self sign-up warning no longer reports: it names only objects and grants open to anyone that are not listed here.",
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"objects": {
|
|
99
|
+
"default": [],
|
|
100
|
+
"description": "Objects accepted as open to every signed-in user (publicRead authenticated).",
|
|
101
|
+
"type": "array",
|
|
102
|
+
"items": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"properties": {
|
|
105
|
+
"object": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"kind": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"enum": [
|
|
111
|
+
"Catalog",
|
|
112
|
+
"Document",
|
|
113
|
+
"Enumeration",
|
|
114
|
+
"InformationRegister",
|
|
115
|
+
"AccumulationRegister",
|
|
116
|
+
"Constant",
|
|
117
|
+
"CustomTable",
|
|
118
|
+
"PgEnum",
|
|
119
|
+
"EventSubscription",
|
|
120
|
+
"RightsSet",
|
|
121
|
+
"Role"
|
|
122
|
+
],
|
|
123
|
+
"description": "Kind of the referenced metadata object."
|
|
124
|
+
},
|
|
125
|
+
"name": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
128
|
+
"description": "Logical name of the referenced object."
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"required": [
|
|
132
|
+
"kind",
|
|
133
|
+
"name"
|
|
134
|
+
],
|
|
135
|
+
"additionalProperties": false,
|
|
136
|
+
"description": "Object with publicRead authenticated accepted as open to anyone."
|
|
137
|
+
},
|
|
138
|
+
"published": {
|
|
139
|
+
"description": "Accept only the published rows (the conditional publicRead); without it every row is accepted.",
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
"const": true
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": [
|
|
145
|
+
"object"
|
|
146
|
+
],
|
|
147
|
+
"additionalProperties": false
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"grants": {
|
|
151
|
+
"default": [],
|
|
152
|
+
"description": "Grants of everyUser roles accepted as open to anyone.",
|
|
153
|
+
"type": "array",
|
|
154
|
+
"items": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"properties": {
|
|
157
|
+
"role": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"properties": {
|
|
160
|
+
"kind": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"enum": [
|
|
163
|
+
"Catalog",
|
|
164
|
+
"Document",
|
|
165
|
+
"Enumeration",
|
|
166
|
+
"InformationRegister",
|
|
167
|
+
"AccumulationRegister",
|
|
168
|
+
"Constant",
|
|
169
|
+
"CustomTable",
|
|
170
|
+
"PgEnum",
|
|
171
|
+
"EventSubscription",
|
|
172
|
+
"RightsSet",
|
|
173
|
+
"Role"
|
|
174
|
+
],
|
|
175
|
+
"description": "Kind of the referenced metadata object."
|
|
176
|
+
},
|
|
177
|
+
"name": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
180
|
+
"description": "Logical name of the referenced object."
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"required": [
|
|
184
|
+
"kind",
|
|
185
|
+
"name"
|
|
186
|
+
],
|
|
187
|
+
"additionalProperties": false,
|
|
188
|
+
"description": "Role of the everyUser level."
|
|
189
|
+
},
|
|
190
|
+
"object": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"properties": {
|
|
193
|
+
"kind": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"enum": [
|
|
196
|
+
"Catalog",
|
|
197
|
+
"Document",
|
|
198
|
+
"Enumeration",
|
|
199
|
+
"InformationRegister",
|
|
200
|
+
"AccumulationRegister",
|
|
201
|
+
"Constant",
|
|
202
|
+
"CustomTable",
|
|
203
|
+
"PgEnum",
|
|
204
|
+
"EventSubscription",
|
|
205
|
+
"RightsSet",
|
|
206
|
+
"Role"
|
|
207
|
+
],
|
|
208
|
+
"description": "Kind of the referenced metadata object."
|
|
209
|
+
},
|
|
210
|
+
"name": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
213
|
+
"description": "Logical name of the referenced object."
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"required": [
|
|
217
|
+
"kind",
|
|
218
|
+
"name"
|
|
219
|
+
],
|
|
220
|
+
"additionalProperties": false,
|
|
221
|
+
"description": "Object of the grant."
|
|
222
|
+
},
|
|
223
|
+
"actions": {
|
|
224
|
+
"minItems": 1,
|
|
225
|
+
"type": "array",
|
|
226
|
+
"items": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
229
|
+
"description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
|
|
230
|
+
},
|
|
231
|
+
"description": "Accepted actions: standard words or custom action names."
|
|
232
|
+
},
|
|
233
|
+
"extent": {
|
|
234
|
+
"anyOf": [
|
|
235
|
+
{
|
|
236
|
+
"type": "string",
|
|
237
|
+
"const": "any"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"type": "string",
|
|
241
|
+
"const": "own"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"type": "object",
|
|
245
|
+
"properties": {
|
|
246
|
+
"dimension": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
249
|
+
"description": "Name of a project access dimension."
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"required": [
|
|
253
|
+
"dimension"
|
|
254
|
+
],
|
|
255
|
+
"additionalProperties": false
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"description": "Rows the grant opens: any row, own rows, or rows with a value of an access dimension of the user."
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"required": [
|
|
262
|
+
"role",
|
|
263
|
+
"object",
|
|
264
|
+
"actions",
|
|
265
|
+
"extent"
|
|
266
|
+
],
|
|
267
|
+
"additionalProperties": false
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"additionalProperties": false
|
|
272
|
+
},
|
|
94
273
|
"scopeKinds": {
|
|
95
274
|
"default": [],
|
|
96
275
|
"description": "Scope kinds of the application; leave empty for a single-tenant application.",
|
|
@@ -17,6 +17,21 @@
|
|
|
17
17
|
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
18
18
|
"description": "Logical object name in PascalCase."
|
|
19
19
|
},
|
|
20
|
+
"title": {
|
|
21
|
+
"description": "Human-readable title of the object.",
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"uk": {
|
|
25
|
+
"description": "Ukrainian text.",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"en": {
|
|
29
|
+
"description": "English text.",
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
},
|
|
20
35
|
"kind": {
|
|
21
36
|
"type": "string",
|
|
22
37
|
"const": "RightsSet",
|
|
@@ -17,6 +17,21 @@
|
|
|
17
17
|
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
18
18
|
"description": "Logical object name in PascalCase."
|
|
19
19
|
},
|
|
20
|
+
"title": {
|
|
21
|
+
"description": "Human-readable title of the object.",
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"uk": {
|
|
25
|
+
"description": "Ukrainian text.",
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"en": {
|
|
29
|
+
"description": "English text.",
|
|
30
|
+
"type": "string"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
},
|
|
20
35
|
"kind": {
|
|
21
36
|
"type": "string",
|
|
22
37
|
"const": "Role",
|