letopis 1.4.2 → 2.0.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.
- package/AGENT-CHEATSHEET.md +329 -281
- package/CHANGELOG.md +418 -0
- package/README.md +572 -1053
- package/dist/acl.d.ts +78 -1
- package/dist/acl.js +264 -13
- package/dist/admin.d.ts +10 -141
- package/dist/admin.js +24 -184
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +5 -15
- package/dist/cache.d.ts +8 -1
- package/dist/cache.js +30 -8
- package/dist/chain.d.ts +18 -41
- package/dist/chain.js +165 -203
- package/dist/cli.js +45 -90
- package/dist/demo/booking.d.ts +352 -36
- package/dist/describe.d.ts +47 -0
- package/dist/describe.js +195 -0
- package/dist/errors.d.ts +59 -13
- package/dist/errors.js +190 -29
- package/dist/index.d.ts +52 -70
- package/dist/index.js +189 -122
- package/dist/internal.d.ts +5 -0
- package/dist/jsonschema.js +18 -17
- package/dist/load.d.ts +20 -12
- package/dist/load.js +207 -181
- package/dist/mcp.d.ts +5 -7
- package/dist/mcp.js +168 -214
- package/dist/messages/access.d.ts +90 -0
- package/dist/messages/access.js +113 -0
- package/dist/messages/api.d.ts +171 -0
- package/dist/messages/api.js +215 -0
- package/dist/messages/boot.d.ts +201 -0
- package/dist/messages/boot.js +256 -0
- package/dist/messages/codes.d.ts +172 -0
- package/dist/messages/codes.js +173 -0
- package/dist/messages/index.d.ts +95 -0
- package/dist/messages/index.js +118 -0
- package/dist/messages/mcp.d.ts +306 -0
- package/dist/messages/mcp.js +387 -0
- package/dist/messages/model.d.ts +233 -0
- package/dist/messages/model.js +283 -0
- package/dist/messages/query.d.ts +131 -0
- package/dist/messages/query.js +158 -0
- package/dist/messages/sql-access.d.ts +70 -0
- package/dist/messages/sql-access.js +87 -0
- package/dist/messages/sql-core.d.ts +150 -0
- package/dist/messages/sql-core.js +181 -0
- package/dist/messages/sql-time.d.ts +71 -0
- package/dist/messages/sql-time.js +88 -0
- package/dist/messages/sql-write.d.ts +246 -0
- package/dist/messages/sql-write.js +270 -0
- package/dist/messages/time.d.ts +23 -0
- package/dist/messages/time.js +29 -0
- package/dist/messages/types.d.ts +27 -0
- package/dist/messages/types.js +5 -0
- package/dist/messages/write.d.ts +405 -0
- package/dist/messages/write.js +509 -0
- package/dist/model.d.ts +73 -60
- package/dist/model.js +20 -29
- package/dist/ops.d.ts +35 -0
- package/dist/ops.js +101 -0
- package/dist/pglite.d.ts +0 -9
- package/dist/pglite.js +3 -1
- package/dist/registry.d.ts +3 -19
- package/dist/registry.js +3 -16
- package/dist/signals.d.ts +1 -5
- package/dist/signals.js +1 -5
- package/dist/sql.d.ts +7 -1
- package/dist/sql.js +101 -85
- package/dist/sync.d.ts +9 -3
- package/dist/sync.js +40 -17
- package/dist/tx.d.ts +11 -1
- package/dist/tx.js +32 -11
- package/dist/typed.d.ts +240 -45
- package/dist/types.d.ts +15 -90
- package/dist/types.js +12 -14
- package/dist/up.d.ts +53 -32
- package/dist/up.js +180 -74
- package/dist/uuid.js +5 -5
- package/dist/validate.d.ts +13 -1
- package/dist/validate.js +61 -29
- package/dist/watch.d.ts +5 -16
- package/dist/watch.js +23 -77
- package/dist/write.d.ts +9 -16
- package/dist/write.js +102 -185
- package/llms.txt +22 -25
- package/package.json +2 -9
- package/sql/10-core.sql +7 -50
- package/sql/15-errors.sql +64 -10
- package/sql/20-context.sql +7 -6
- package/sql/30-validate.sql +35 -27
- package/sql/40-class.sql +20 -114
- package/sql/50-acl.sql +8 -13
- package/sql/60-write.sql +220 -676
- package/sql/70-read.sql +11 -13
- package/sql/80-auth.sql +23 -27
- package/sql/90-time.sql +77 -944
- package/sql/95-seed.system.sql +7 -14
- package/sql/99-revision.sql +2 -1
- package/sql/README.md +32 -24
- package/sql/migrate/README.md +14 -0
- package/AGENT-CHEATSHEET.en.md +0 -488
- package/MIGRATION.md +0 -190
- package/README.en.md +0 -2910
- package/dist/import.d.ts +0 -185
- package/dist/import.js +0 -820
- package/dist/project.d.ts +0 -359
- package/dist/project.js +0 -1258
- package/sql/75-history.sql +0 -436
- package/sql/88-derived.sql +0 -1236
- package/sql/migrate/0006-changed-paths.sql +0 -3
- package/sql/migrate/0007-secret-account-fk.sql +0 -12
package/dist/demo/booking.d.ts
CHANGED
|
@@ -14,13 +14,19 @@ export declare const Org: import("../model.js").Model<"Org", {
|
|
|
14
14
|
} | undefined;
|
|
15
15
|
} | undefined;
|
|
16
16
|
} | undefined;
|
|
17
|
-
}, {} & {}, "Организация">;
|
|
17
|
+
}, {} & {}, "Организация", {}, "Org">;
|
|
18
18
|
export declare const Person: import("../model.js").Model<"Person", {
|
|
19
19
|
name: string;
|
|
20
20
|
phone: string;
|
|
21
21
|
}, {
|
|
22
22
|
readonly Org: string;
|
|
23
|
-
} & {}, "Контрагент"
|
|
23
|
+
} & {}, "Контрагент", {
|
|
24
|
+
readonly Org: {
|
|
25
|
+
targets: "Org";
|
|
26
|
+
many: false;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
}, "Person">;
|
|
24
30
|
export declare const Staff: import("../model.js").Model<"Staff", Omit<{
|
|
25
31
|
name: string;
|
|
26
32
|
phone: string;
|
|
@@ -30,7 +36,13 @@ export declare const Staff: import("../model.js").Model<"Staff", Omit<{
|
|
|
30
36
|
specialization?: string | undefined;
|
|
31
37
|
}, Omit<{
|
|
32
38
|
readonly Org: string;
|
|
33
|
-
} & {}, never> & {} & {}, "Мастер"
|
|
39
|
+
} & {}, never> & {} & {}, "Мастер", Omit<{
|
|
40
|
+
readonly Org: {
|
|
41
|
+
targets: "Org";
|
|
42
|
+
many: false;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
}, never> & {}, "Person" | "Staff">;
|
|
34
46
|
export declare const Customer: import("../model.js").Model<"Customer", Omit<{
|
|
35
47
|
name: string;
|
|
36
48
|
phone: string;
|
|
@@ -39,7 +51,13 @@ export declare const Customer: import("../model.js").Model<"Customer", Omit<{
|
|
|
39
51
|
notes?: string | undefined;
|
|
40
52
|
}, Omit<{
|
|
41
53
|
readonly Org: string;
|
|
42
|
-
} & {}, never> & {} & {}, "Клиент"
|
|
54
|
+
} & {}, never> & {} & {}, "Клиент", Omit<{
|
|
55
|
+
readonly Org: {
|
|
56
|
+
targets: "Org";
|
|
57
|
+
many: false;
|
|
58
|
+
required: true;
|
|
59
|
+
};
|
|
60
|
+
}, never> & {}, "Person" | "Customer">;
|
|
43
61
|
export declare const Location: import("../model.js").Model<"Location", {
|
|
44
62
|
address: string;
|
|
45
63
|
coordinates?: {
|
|
@@ -49,13 +67,25 @@ export declare const Location: import("../model.js").Model<"Location", {
|
|
|
49
67
|
description?: string | undefined;
|
|
50
68
|
}, {
|
|
51
69
|
readonly Org: string;
|
|
52
|
-
} & {}, "Локация"
|
|
70
|
+
} & {}, "Локация", {
|
|
71
|
+
readonly Org: {
|
|
72
|
+
targets: "Org";
|
|
73
|
+
many: false;
|
|
74
|
+
required: true;
|
|
75
|
+
};
|
|
76
|
+
}, "Location">;
|
|
53
77
|
export declare const Element: import("../model.js").Model<"Element", {
|
|
54
78
|
name: string;
|
|
55
79
|
description?: string | undefined;
|
|
56
80
|
}, {
|
|
57
81
|
readonly Org: string;
|
|
58
|
-
} & {}, "Элемент"
|
|
82
|
+
} & {}, "Элемент", {
|
|
83
|
+
readonly Org: {
|
|
84
|
+
targets: "Org";
|
|
85
|
+
many: false;
|
|
86
|
+
required: true;
|
|
87
|
+
};
|
|
88
|
+
}, "Element">;
|
|
59
89
|
export declare const Service: import("../model.js").Model<"Service", Omit<{
|
|
60
90
|
name: string;
|
|
61
91
|
description?: string | undefined;
|
|
@@ -63,7 +93,13 @@ export declare const Service: import("../model.js").Model<"Service", Omit<{
|
|
|
63
93
|
duration?: number | undefined;
|
|
64
94
|
}, Omit<{
|
|
65
95
|
readonly Org: string;
|
|
66
|
-
} & {}, never> & {} & {}, "Услуга"
|
|
96
|
+
} & {}, never> & {} & {}, "Услуга", Omit<{
|
|
97
|
+
readonly Org: {
|
|
98
|
+
targets: "Org";
|
|
99
|
+
many: false;
|
|
100
|
+
required: true;
|
|
101
|
+
};
|
|
102
|
+
}, never> & {}, "Service" | "Element">;
|
|
67
103
|
export declare const Product: import("../model.js").Model<"Product", Omit<{
|
|
68
104
|
name: string;
|
|
69
105
|
description?: string | undefined;
|
|
@@ -72,7 +108,13 @@ export declare const Product: import("../model.js").Model<"Product", Omit<{
|
|
|
72
108
|
sku?: string | undefined;
|
|
73
109
|
}, Omit<{
|
|
74
110
|
readonly Org: string;
|
|
75
|
-
} & {}, never> & {} & {}, "Товар"
|
|
111
|
+
} & {}, never> & {} & {}, "Товар", Omit<{
|
|
112
|
+
readonly Org: {
|
|
113
|
+
targets: "Org";
|
|
114
|
+
many: false;
|
|
115
|
+
required: true;
|
|
116
|
+
};
|
|
117
|
+
}, never> & {}, "Element" | "Product">;
|
|
76
118
|
export declare const Complex: import("../model.js").Model<"Complex", Omit<{
|
|
77
119
|
name: string;
|
|
78
120
|
description?: string | undefined;
|
|
@@ -81,28 +123,62 @@ export declare const Complex: import("../model.js").Model<"Complex", Omit<{
|
|
|
81
123
|
duration: number;
|
|
82
124
|
}, Omit<{
|
|
83
125
|
readonly Org: string;
|
|
84
|
-
} & {}, never> & {} & {}, "Комплекс"
|
|
126
|
+
} & {}, never> & {} & {}, "Комплекс", Omit<{
|
|
127
|
+
readonly Org: {
|
|
128
|
+
targets: "Org";
|
|
129
|
+
many: false;
|
|
130
|
+
required: true;
|
|
131
|
+
};
|
|
132
|
+
}, never> & {}, "Element" | "Complex">;
|
|
85
133
|
export declare const Schedule: import("../model.js").Model<"Schedule", {
|
|
86
134
|
name: string;
|
|
87
135
|
year: number;
|
|
88
136
|
month: number;
|
|
89
137
|
}, {
|
|
90
138
|
readonly Org: string;
|
|
91
|
-
} & {}, "Расписание"
|
|
139
|
+
} & {}, "Расписание", {
|
|
140
|
+
readonly Org: {
|
|
141
|
+
targets: "Org";
|
|
142
|
+
many: false;
|
|
143
|
+
required: true;
|
|
144
|
+
};
|
|
145
|
+
}, "Schedule">;
|
|
92
146
|
export declare const Folder: import("../model.js").Model<"Folder", {
|
|
93
147
|
name: string;
|
|
94
148
|
}, {
|
|
95
149
|
readonly Org: string;
|
|
96
150
|
} & {
|
|
97
151
|
readonly Parent?: string | undefined;
|
|
98
|
-
}, "Папка"
|
|
152
|
+
}, "Папка", {
|
|
153
|
+
readonly Org: {
|
|
154
|
+
targets: "Org";
|
|
155
|
+
many: false;
|
|
156
|
+
required: true;
|
|
157
|
+
};
|
|
158
|
+
readonly Parent: {
|
|
159
|
+
targets: "Folder";
|
|
160
|
+
many: false;
|
|
161
|
+
required: false;
|
|
162
|
+
};
|
|
163
|
+
}, "Folder">;
|
|
99
164
|
export declare const address: import("../model.js").Model<"address", {
|
|
100
165
|
default: boolean;
|
|
101
166
|
schedule_info?: string | undefined;
|
|
102
167
|
}, {
|
|
103
168
|
readonly Staff: string;
|
|
104
169
|
readonly Location: string;
|
|
105
|
-
} & {}, "адрес"
|
|
170
|
+
} & {}, "адрес", {
|
|
171
|
+
readonly Staff: {
|
|
172
|
+
targets: "Staff";
|
|
173
|
+
many: false;
|
|
174
|
+
required: true;
|
|
175
|
+
};
|
|
176
|
+
readonly Location: {
|
|
177
|
+
targets: "Location";
|
|
178
|
+
many: false;
|
|
179
|
+
required: true;
|
|
180
|
+
};
|
|
181
|
+
}, "address">;
|
|
106
182
|
export declare const slot: import("../model.js").Model<"slot", {
|
|
107
183
|
start_datetime: string;
|
|
108
184
|
end_datetime: string;
|
|
@@ -110,7 +186,23 @@ export declare const slot: import("../model.js").Model<"slot", {
|
|
|
110
186
|
readonly Staff: string;
|
|
111
187
|
readonly Location: string;
|
|
112
188
|
readonly Schedule: string;
|
|
113
|
-
} & {}, "окно"
|
|
189
|
+
} & {}, "окно", {
|
|
190
|
+
readonly Staff: {
|
|
191
|
+
targets: "Staff";
|
|
192
|
+
many: false;
|
|
193
|
+
required: true;
|
|
194
|
+
};
|
|
195
|
+
readonly Location: {
|
|
196
|
+
targets: "Location";
|
|
197
|
+
many: false;
|
|
198
|
+
required: true;
|
|
199
|
+
};
|
|
200
|
+
readonly Schedule: {
|
|
201
|
+
targets: "Schedule";
|
|
202
|
+
many: false;
|
|
203
|
+
required: true;
|
|
204
|
+
};
|
|
205
|
+
}, "slot">;
|
|
114
206
|
export declare const booking: import("../model.js").Model<"booking", Omit<{
|
|
115
207
|
start_datetime: string;
|
|
116
208
|
end_datetime: string;
|
|
@@ -124,32 +216,98 @@ export declare const booking: import("../model.js").Model<"booking", Omit<{
|
|
|
124
216
|
readonly Item: string;
|
|
125
217
|
} & {
|
|
126
218
|
readonly Customer?: string | undefined;
|
|
127
|
-
}, "запись"
|
|
219
|
+
}, "запись", Omit<{
|
|
220
|
+
readonly Staff: {
|
|
221
|
+
targets: "Staff";
|
|
222
|
+
many: false;
|
|
223
|
+
required: true;
|
|
224
|
+
};
|
|
225
|
+
readonly Location: {
|
|
226
|
+
targets: "Location";
|
|
227
|
+
many: false;
|
|
228
|
+
required: true;
|
|
229
|
+
};
|
|
230
|
+
readonly Schedule: {
|
|
231
|
+
targets: "Schedule";
|
|
232
|
+
many: false;
|
|
233
|
+
required: true;
|
|
234
|
+
};
|
|
235
|
+
}, "Customer" | "Item"> & {
|
|
236
|
+
readonly Item: {
|
|
237
|
+
targets: "Element";
|
|
238
|
+
many: false;
|
|
239
|
+
required: true;
|
|
240
|
+
};
|
|
241
|
+
readonly Customer: {
|
|
242
|
+
targets: "Customer";
|
|
243
|
+
many: false;
|
|
244
|
+
required: false;
|
|
245
|
+
};
|
|
246
|
+
}, "booking" | "slot">;
|
|
128
247
|
export declare const content: import("../model.js").Model<"content", {
|
|
129
248
|
order: number;
|
|
130
249
|
}, {
|
|
131
250
|
readonly Folder: string;
|
|
132
251
|
readonly Item: string;
|
|
133
|
-
} & {}, "содержимое"
|
|
252
|
+
} & {}, "содержимое", {
|
|
253
|
+
readonly Folder: {
|
|
254
|
+
targets: "Folder";
|
|
255
|
+
many: false;
|
|
256
|
+
required: true;
|
|
257
|
+
};
|
|
258
|
+
readonly Item: {
|
|
259
|
+
targets: "Element";
|
|
260
|
+
many: false;
|
|
261
|
+
required: true;
|
|
262
|
+
};
|
|
263
|
+
}, "content">;
|
|
134
264
|
export declare const compo: import("../model.js").Model<"compo", {
|
|
135
265
|
order: number;
|
|
136
266
|
quantity: number;
|
|
137
267
|
}, {
|
|
138
268
|
readonly Complex: string;
|
|
139
269
|
readonly Part: string;
|
|
140
|
-
} & {}, "состав"
|
|
270
|
+
} & {}, "состав", {
|
|
271
|
+
readonly Complex: {
|
|
272
|
+
targets: "Complex";
|
|
273
|
+
many: false;
|
|
274
|
+
required: true;
|
|
275
|
+
};
|
|
276
|
+
readonly Part: {
|
|
277
|
+
targets: "Service" | "Product";
|
|
278
|
+
many: false;
|
|
279
|
+
required: true;
|
|
280
|
+
};
|
|
281
|
+
}, "compo">;
|
|
141
282
|
export declare const skill: import("../model.js").Model<"skill", {
|
|
142
283
|
level: "basic" | "intermediate" | "advanced" | "expert";
|
|
143
284
|
}, {
|
|
144
285
|
readonly Staff: string;
|
|
145
286
|
readonly Service: string;
|
|
146
|
-
} & {}, "навык"
|
|
287
|
+
} & {}, "навык", {
|
|
288
|
+
readonly Staff: {
|
|
289
|
+
targets: "Staff";
|
|
290
|
+
many: false;
|
|
291
|
+
required: true;
|
|
292
|
+
};
|
|
293
|
+
readonly Service: {
|
|
294
|
+
targets: "Service";
|
|
295
|
+
many: false;
|
|
296
|
+
required: true;
|
|
297
|
+
};
|
|
298
|
+
}, "skill">;
|
|
147
299
|
export declare const price: import("../model.js").Model<"price", {
|
|
148
300
|
note: string;
|
|
149
301
|
amounts: Partial<Record<"RUB" | "USD" | "EUR" | "AED", number>>;
|
|
150
302
|
}, {
|
|
151
303
|
readonly Item: string;
|
|
152
|
-
} & {}, "цена"
|
|
304
|
+
} & {}, "цена", {
|
|
305
|
+
readonly Item: {
|
|
306
|
+
targets: "Element";
|
|
307
|
+
many: false;
|
|
308
|
+
required: true;
|
|
309
|
+
};
|
|
310
|
+
}, "price">;
|
|
153
311
|
/** Все классы в порядке «предок раньше потомка». */
|
|
154
312
|
export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
155
313
|
name: string;
|
|
@@ -166,12 +324,18 @@ export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
|
166
324
|
} | undefined;
|
|
167
325
|
} | undefined;
|
|
168
326
|
} | undefined;
|
|
169
|
-
}, {} & {}, "Организация">, import("../model.js").Model<"Person", {
|
|
327
|
+
}, {} & {}, "Организация", {}, "Org">, import("../model.js").Model<"Person", {
|
|
170
328
|
name: string;
|
|
171
329
|
phone: string;
|
|
172
330
|
}, {
|
|
173
331
|
readonly Org: string;
|
|
174
|
-
} & {}, "Контрагент"
|
|
332
|
+
} & {}, "Контрагент", {
|
|
333
|
+
readonly Org: {
|
|
334
|
+
targets: "Org";
|
|
335
|
+
many: false;
|
|
336
|
+
required: true;
|
|
337
|
+
};
|
|
338
|
+
}, "Person">, import("../model.js").Model<"Staff", Omit<{
|
|
175
339
|
name: string;
|
|
176
340
|
phone: string;
|
|
177
341
|
}, "description" | "photo" | "specialization"> & {
|
|
@@ -180,7 +344,13 @@ export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
|
180
344
|
specialization?: string | undefined;
|
|
181
345
|
}, Omit<{
|
|
182
346
|
readonly Org: string;
|
|
183
|
-
} & {}, never> & {} & {}, "Мастер"
|
|
347
|
+
} & {}, never> & {} & {}, "Мастер", Omit<{
|
|
348
|
+
readonly Org: {
|
|
349
|
+
targets: "Org";
|
|
350
|
+
many: false;
|
|
351
|
+
required: true;
|
|
352
|
+
};
|
|
353
|
+
}, never> & {}, "Person" | "Staff">, import("../model.js").Model<"Customer", Omit<{
|
|
184
354
|
name: string;
|
|
185
355
|
phone: string;
|
|
186
356
|
}, "notes" | "preferred_contact"> & {
|
|
@@ -188,7 +358,13 @@ export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
|
188
358
|
notes?: string | undefined;
|
|
189
359
|
}, Omit<{
|
|
190
360
|
readonly Org: string;
|
|
191
|
-
} & {}, never> & {} & {}, "Клиент"
|
|
361
|
+
} & {}, never> & {} & {}, "Клиент", Omit<{
|
|
362
|
+
readonly Org: {
|
|
363
|
+
targets: "Org";
|
|
364
|
+
many: false;
|
|
365
|
+
required: true;
|
|
366
|
+
};
|
|
367
|
+
}, never> & {}, "Person" | "Customer">, import("../model.js").Model<"Location", {
|
|
192
368
|
address: string;
|
|
193
369
|
coordinates?: {
|
|
194
370
|
lat: number;
|
|
@@ -197,19 +373,37 @@ export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
|
197
373
|
description?: string | undefined;
|
|
198
374
|
}, {
|
|
199
375
|
readonly Org: string;
|
|
200
|
-
} & {}, "Локация"
|
|
376
|
+
} & {}, "Локация", {
|
|
377
|
+
readonly Org: {
|
|
378
|
+
targets: "Org";
|
|
379
|
+
many: false;
|
|
380
|
+
required: true;
|
|
381
|
+
};
|
|
382
|
+
}, "Location">, import("../model.js").Model<"Element", {
|
|
201
383
|
name: string;
|
|
202
384
|
description?: string | undefined;
|
|
203
385
|
}, {
|
|
204
386
|
readonly Org: string;
|
|
205
|
-
} & {}, "Элемент"
|
|
387
|
+
} & {}, "Элемент", {
|
|
388
|
+
readonly Org: {
|
|
389
|
+
targets: "Org";
|
|
390
|
+
many: false;
|
|
391
|
+
required: true;
|
|
392
|
+
};
|
|
393
|
+
}, "Element">, import("../model.js").Model<"Service", Omit<{
|
|
206
394
|
name: string;
|
|
207
395
|
description?: string | undefined;
|
|
208
396
|
}, "duration"> & {
|
|
209
397
|
duration?: number | undefined;
|
|
210
398
|
}, Omit<{
|
|
211
399
|
readonly Org: string;
|
|
212
|
-
} & {}, never> & {} & {}, "Услуга"
|
|
400
|
+
} & {}, never> & {} & {}, "Услуга", Omit<{
|
|
401
|
+
readonly Org: {
|
|
402
|
+
targets: "Org";
|
|
403
|
+
many: false;
|
|
404
|
+
required: true;
|
|
405
|
+
};
|
|
406
|
+
}, never> & {}, "Service" | "Element">, import("../model.js").Model<"Product", Omit<{
|
|
213
407
|
name: string;
|
|
214
408
|
description?: string | undefined;
|
|
215
409
|
}, "sku" | "unit"> & {
|
|
@@ -217,7 +411,13 @@ export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
|
217
411
|
sku?: string | undefined;
|
|
218
412
|
}, Omit<{
|
|
219
413
|
readonly Org: string;
|
|
220
|
-
} & {}, never> & {} & {}, "Товар"
|
|
414
|
+
} & {}, never> & {} & {}, "Товар", Omit<{
|
|
415
|
+
readonly Org: {
|
|
416
|
+
targets: "Org";
|
|
417
|
+
many: false;
|
|
418
|
+
required: true;
|
|
419
|
+
};
|
|
420
|
+
}, never> & {}, "Element" | "Product">, import("../model.js").Model<"Complex", Omit<{
|
|
221
421
|
name: string;
|
|
222
422
|
description?: string | undefined;
|
|
223
423
|
}, "duration" | "cost"> & {
|
|
@@ -225,32 +425,82 @@ export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
|
225
425
|
duration: number;
|
|
226
426
|
}, Omit<{
|
|
227
427
|
readonly Org: string;
|
|
228
|
-
} & {}, never> & {} & {}, "Комплекс"
|
|
428
|
+
} & {}, never> & {} & {}, "Комплекс", Omit<{
|
|
429
|
+
readonly Org: {
|
|
430
|
+
targets: "Org";
|
|
431
|
+
many: false;
|
|
432
|
+
required: true;
|
|
433
|
+
};
|
|
434
|
+
}, never> & {}, "Element" | "Complex">, import("../model.js").Model<"Schedule", {
|
|
229
435
|
name: string;
|
|
230
436
|
year: number;
|
|
231
437
|
month: number;
|
|
232
438
|
}, {
|
|
233
439
|
readonly Org: string;
|
|
234
|
-
} & {}, "Расписание"
|
|
440
|
+
} & {}, "Расписание", {
|
|
441
|
+
readonly Org: {
|
|
442
|
+
targets: "Org";
|
|
443
|
+
many: false;
|
|
444
|
+
required: true;
|
|
445
|
+
};
|
|
446
|
+
}, "Schedule">, import("../model.js").Model<"Folder", {
|
|
235
447
|
name: string;
|
|
236
448
|
}, {
|
|
237
449
|
readonly Org: string;
|
|
238
450
|
} & {
|
|
239
451
|
readonly Parent?: string | undefined;
|
|
240
|
-
}, "Папка"
|
|
452
|
+
}, "Папка", {
|
|
453
|
+
readonly Org: {
|
|
454
|
+
targets: "Org";
|
|
455
|
+
many: false;
|
|
456
|
+
required: true;
|
|
457
|
+
};
|
|
458
|
+
readonly Parent: {
|
|
459
|
+
targets: "Folder";
|
|
460
|
+
many: false;
|
|
461
|
+
required: false;
|
|
462
|
+
};
|
|
463
|
+
}, "Folder">, import("../model.js").Model<"address", {
|
|
241
464
|
default: boolean;
|
|
242
465
|
schedule_info?: string | undefined;
|
|
243
466
|
}, {
|
|
244
467
|
readonly Staff: string;
|
|
245
468
|
readonly Location: string;
|
|
246
|
-
} & {}, "адрес"
|
|
469
|
+
} & {}, "адрес", {
|
|
470
|
+
readonly Staff: {
|
|
471
|
+
targets: "Staff";
|
|
472
|
+
many: false;
|
|
473
|
+
required: true;
|
|
474
|
+
};
|
|
475
|
+
readonly Location: {
|
|
476
|
+
targets: "Location";
|
|
477
|
+
many: false;
|
|
478
|
+
required: true;
|
|
479
|
+
};
|
|
480
|
+
}, "address">, import("../model.js").Model<"slot", {
|
|
247
481
|
start_datetime: string;
|
|
248
482
|
end_datetime: string;
|
|
249
483
|
}, {
|
|
250
484
|
readonly Staff: string;
|
|
251
485
|
readonly Location: string;
|
|
252
486
|
readonly Schedule: string;
|
|
253
|
-
} & {}, "окно"
|
|
487
|
+
} & {}, "окно", {
|
|
488
|
+
readonly Staff: {
|
|
489
|
+
targets: "Staff";
|
|
490
|
+
many: false;
|
|
491
|
+
required: true;
|
|
492
|
+
};
|
|
493
|
+
readonly Location: {
|
|
494
|
+
targets: "Location";
|
|
495
|
+
many: false;
|
|
496
|
+
required: true;
|
|
497
|
+
};
|
|
498
|
+
readonly Schedule: {
|
|
499
|
+
targets: "Schedule";
|
|
500
|
+
many: false;
|
|
501
|
+
required: true;
|
|
502
|
+
};
|
|
503
|
+
}, "slot">, import("../model.js").Model<"booking", Omit<{
|
|
254
504
|
start_datetime: string;
|
|
255
505
|
end_datetime: string;
|
|
256
506
|
}, "notes"> & {
|
|
@@ -263,27 +513,93 @@ export declare const BOOKING: readonly [import("../model.js").Model<"Org", {
|
|
|
263
513
|
readonly Item: string;
|
|
264
514
|
} & {
|
|
265
515
|
readonly Customer?: string | undefined;
|
|
266
|
-
}, "запись"
|
|
516
|
+
}, "запись", Omit<{
|
|
517
|
+
readonly Staff: {
|
|
518
|
+
targets: "Staff";
|
|
519
|
+
many: false;
|
|
520
|
+
required: true;
|
|
521
|
+
};
|
|
522
|
+
readonly Location: {
|
|
523
|
+
targets: "Location";
|
|
524
|
+
many: false;
|
|
525
|
+
required: true;
|
|
526
|
+
};
|
|
527
|
+
readonly Schedule: {
|
|
528
|
+
targets: "Schedule";
|
|
529
|
+
many: false;
|
|
530
|
+
required: true;
|
|
531
|
+
};
|
|
532
|
+
}, "Customer" | "Item"> & {
|
|
533
|
+
readonly Item: {
|
|
534
|
+
targets: "Element";
|
|
535
|
+
many: false;
|
|
536
|
+
required: true;
|
|
537
|
+
};
|
|
538
|
+
readonly Customer: {
|
|
539
|
+
targets: "Customer";
|
|
540
|
+
many: false;
|
|
541
|
+
required: false;
|
|
542
|
+
};
|
|
543
|
+
}, "booking" | "slot">, import("../model.js").Model<"content", {
|
|
267
544
|
order: number;
|
|
268
545
|
}, {
|
|
269
546
|
readonly Folder: string;
|
|
270
547
|
readonly Item: string;
|
|
271
|
-
} & {}, "содержимое"
|
|
548
|
+
} & {}, "содержимое", {
|
|
549
|
+
readonly Folder: {
|
|
550
|
+
targets: "Folder";
|
|
551
|
+
many: false;
|
|
552
|
+
required: true;
|
|
553
|
+
};
|
|
554
|
+
readonly Item: {
|
|
555
|
+
targets: "Element";
|
|
556
|
+
many: false;
|
|
557
|
+
required: true;
|
|
558
|
+
};
|
|
559
|
+
}, "content">, import("../model.js").Model<"compo", {
|
|
272
560
|
order: number;
|
|
273
561
|
quantity: number;
|
|
274
562
|
}, {
|
|
275
563
|
readonly Complex: string;
|
|
276
564
|
readonly Part: string;
|
|
277
|
-
} & {}, "состав"
|
|
565
|
+
} & {}, "состав", {
|
|
566
|
+
readonly Complex: {
|
|
567
|
+
targets: "Complex";
|
|
568
|
+
many: false;
|
|
569
|
+
required: true;
|
|
570
|
+
};
|
|
571
|
+
readonly Part: {
|
|
572
|
+
targets: "Service" | "Product";
|
|
573
|
+
many: false;
|
|
574
|
+
required: true;
|
|
575
|
+
};
|
|
576
|
+
}, "compo">, import("../model.js").Model<"skill", {
|
|
278
577
|
level: "basic" | "intermediate" | "advanced" | "expert";
|
|
279
578
|
}, {
|
|
280
579
|
readonly Staff: string;
|
|
281
580
|
readonly Service: string;
|
|
282
|
-
} & {}, "навык"
|
|
581
|
+
} & {}, "навык", {
|
|
582
|
+
readonly Staff: {
|
|
583
|
+
targets: "Staff";
|
|
584
|
+
many: false;
|
|
585
|
+
required: true;
|
|
586
|
+
};
|
|
587
|
+
readonly Service: {
|
|
588
|
+
targets: "Service";
|
|
589
|
+
many: false;
|
|
590
|
+
required: true;
|
|
591
|
+
};
|
|
592
|
+
}, "skill">, import("../model.js").Model<"price", {
|
|
283
593
|
note: string;
|
|
284
594
|
amounts: Partial<Record<"RUB" | "USD" | "EUR" | "AED", number>>;
|
|
285
595
|
}, {
|
|
286
596
|
readonly Item: string;
|
|
287
|
-
} & {}, "цена"
|
|
597
|
+
} & {}, "цена", {
|
|
598
|
+
readonly Item: {
|
|
599
|
+
targets: "Element";
|
|
600
|
+
many: false;
|
|
601
|
+
required: true;
|
|
602
|
+
};
|
|
603
|
+
}, "price">];
|
|
288
604
|
/** Текст lib/sql/seed.booking.sql: строки Class системного арендатора, записанные владельцем. */
|
|
289
605
|
export declare function bookingSeedSql(models?: readonly AnyModel[]): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Registry } from './registry.js';
|
|
2
|
+
/** Описание модели: ответ `letopis_model`. */
|
|
3
|
+
export interface ModelDescription {
|
|
4
|
+
schema: string;
|
|
5
|
+
tenant: string | null;
|
|
6
|
+
classes: {
|
|
7
|
+
name: string;
|
|
8
|
+
kind: 'hub' | 'link';
|
|
9
|
+
alias?: string;
|
|
10
|
+
abstract: boolean;
|
|
11
|
+
parent?: string;
|
|
12
|
+
ancestors: string[];
|
|
13
|
+
system: boolean;
|
|
14
|
+
fields: Record<string, unknown>;
|
|
15
|
+
required: string[];
|
|
16
|
+
/** Условия по нескольким полям (`fields.anyOf` описания с учётом наследования): хотя бы одно должно выполняться. */
|
|
17
|
+
anyOf?: unknown[];
|
|
18
|
+
/** Условия по нескольким полям (`fields.oneOf`): ровно одно должно выполняться. */
|
|
19
|
+
oneOf?: unknown[];
|
|
20
|
+
ends: Record<string, unknown>;
|
|
21
|
+
key: string[];
|
|
22
|
+
history: boolean;
|
|
23
|
+
ownerDefault: string;
|
|
24
|
+
cache?: {
|
|
25
|
+
ttl?: number;
|
|
26
|
+
};
|
|
27
|
+
meta: Record<string, unknown>;
|
|
28
|
+
/**
|
|
29
|
+
* Рабочие цепочки из реестра (план 2.0, этап 3, п. 7), текст TypeScript. `create` — создать: поля ключа и
|
|
30
|
+
* обязательные поля без умолчания с образцами значений (`examples` из JSON Schema поля, `const`, `default`, первое
|
|
31
|
+
* из `enum`, иначе по типу), обязательные концы и концы ключа — слотами; у абстрактного и
|
|
32
|
+
* системного класса его нет. `find` — найти: по ключу — `first()`, иначе по обязательному полю — `rows()`.
|
|
33
|
+
* `neighbors` — перейти к соседям: по каждому концу класса и к классам, чьи концы ведут на него. `'<id Класс>'` —
|
|
34
|
+
* место для id объекта этого класса или его потомка (`'<id A|B>'` — любого из них, `'<id Класс #2>'` — второго).
|
|
35
|
+
*/
|
|
36
|
+
examples: {
|
|
37
|
+
create?: string;
|
|
38
|
+
find: string;
|
|
39
|
+
neighbors: string[];
|
|
40
|
+
};
|
|
41
|
+
}[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Описание модели арендатора вместе с метаданными классов (этап 6, п. 12) и примерами цепочек (план 2.0, этап 3, п. 7):
|
|
45
|
+
* reg — реестр подключения (классы арендатора сессии и System), schema и tenant — схема установки и арендатор сессии.
|
|
46
|
+
*/
|
|
47
|
+
export declare function describeModel(reg: Registry, schema: string, tenant: string | null): ModelDescription;
|