@medyll/idae-machine 0.124.0 → 0.126.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/dist/db/dataModel.d.ts +2 -1
- package/dist/db/dataModel.js +0 -38
- package/dist/db/dbSchema.d.ts +169 -169
- package/dist/db/fieldTypes.d.ts +13 -0
- package/dist/db/fieldTypes.js +67 -0
- package/dist/{db → demo}/testDbSchema.d.ts +1 -1
- package/dist/form/CreateUpdate.svelte +2 -1
- package/dist/index.d.ts +17 -8
- package/dist/index.js +17 -8
- package/dist/main/machine/IDbCollection.d.ts +71 -0
- package/dist/main/machine/IDbCollection.js +102 -0
- package/dist/main/machine/IDbCollectionFieldForge.d.ts +42 -0
- package/dist/main/machine/IDbCollectionFieldForge.js +74 -0
- package/dist/main/machine/IDbCollectionFieldValues.d.ts +57 -0
- package/dist/main/machine/IDbCollectionFieldValues.js +82 -0
- package/dist/main/machine/IDbCollectionValues.d.ts +78 -0
- package/dist/main/machine/IDbCollectionValues.js +203 -0
- package/dist/main/machine/IDbError.d.ts +6 -0
- package/dist/main/machine/IDbError.js +61 -0
- package/dist/main/machine/IDbFormValidate.d.ts +55 -0
- package/dist/main/machine/IDbFormValidate.js +183 -0
- package/dist/main/machine/IDbValidationError.d.ts +19 -0
- package/dist/main/machine/IDbValidationError.js +24 -0
- package/dist/main/machine/types.d.ts +1 -0
- package/dist/main/machine/types.js +1 -0
- package/dist/main/machineDb.d.ts +15 -222
- package/dist/main/machineDb.js +33 -687
- package/dist/main/machineForge.d.ts +57 -0
- package/dist/main/machineForge.js +105 -0
- package/dist/{form → ui}/CollectionButton.svelte +2 -2
- package/dist/{form → ui}/CollectionButton.svelte.d.ts +1 -1
- package/dist/{form → ui}/CollectionFks.svelte +3 -5
- package/dist/{form → ui}/CollectionList.svelte +1 -1
- package/dist/{form → ui}/CollectionListMenu.svelte +3 -2
- package/package.json +3 -3
- package/dist/form/DataList.svelte +0 -60
- package/dist/form/DataList.svelte.d.ts +0 -10
- /package/dist/{db → demo}/testDbSchema.js +0 -0
- /package/dist/{form → ui}/CollectionFieldGuess.svelte +0 -0
- /package/dist/{form → ui}/CollectionFieldGuess.svelte.d.ts +0 -0
- /package/dist/{form → ui}/CollectionFks.svelte.d.ts +0 -0
- /package/dist/{form → ui}/CollectionList.svelte.d.ts +0 -0
- /package/dist/{form → ui}/CollectionListMenu.svelte.d.ts +0 -0
- /package/dist/{form → ui}/CollectionReverseFks.svelte +0 -0
- /package/dist/{form → ui}/CollectionReverseFks.svelte.d.ts +0 -0
package/dist/db/dataModel.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FieldType } from './fieldTypes';
|
|
1
2
|
export type DbDataModel<T = Record<string, CollectionDbModel>> = {
|
|
2
3
|
readonly [K in keyof T]: CollectionDbModel<T[K]>;
|
|
3
4
|
};
|
|
@@ -8,7 +9,7 @@ export interface CollectionDbModel<T = Record<string, any>> {
|
|
|
8
9
|
template?: {
|
|
9
10
|
index: string;
|
|
10
11
|
presentation: any;
|
|
11
|
-
fields?:
|
|
12
|
+
fields?: Record<string, FieldType | string>;
|
|
12
13
|
fks?: {
|
|
13
14
|
code: string;
|
|
14
15
|
multiple: boolean;
|
package/dist/db/dataModel.js
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
const monModel = {
|
|
2
|
-
agent: {
|
|
3
|
-
keyPath: '++id, promptId, created_at',
|
|
4
|
-
ts: {},
|
|
5
|
-
model: {},
|
|
6
|
-
template: {
|
|
7
|
-
index: 'id',
|
|
8
|
-
presentation: 'name model',
|
|
9
|
-
fields: {
|
|
10
|
-
id: 'id (readonly)',
|
|
11
|
-
name: 'text (private)',
|
|
12
|
-
code: 'text',
|
|
13
|
-
model: 'text',
|
|
14
|
-
prompt: 'text-long',
|
|
15
|
-
created_at: 'date (private)',
|
|
16
|
-
ia_lock: 'boolean (private)',
|
|
17
|
-
agentPromptId: 'fk-agentPrompt.id (required)'
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
agentPrompt: {
|
|
22
|
-
keyPath: '++id, created_at',
|
|
23
|
-
ts: {},
|
|
24
|
-
model: {},
|
|
25
|
-
template: {
|
|
26
|
-
index: 'id',
|
|
27
|
-
presentation: 'name',
|
|
28
|
-
fields: {
|
|
29
|
-
id: 'id (readonly)',
|
|
30
|
-
created_at: 'date (private)',
|
|
31
|
-
value: 'text-long (required)',
|
|
32
|
-
name: 'text (required)',
|
|
33
|
-
code: 'text (required)',
|
|
34
|
-
ia_lock: 'boolean (private)'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
1
|
export {};
|
|
40
2
|
//
|
package/dist/db/dbSchema.d.ts
CHANGED
|
@@ -13,20 +13,20 @@ export declare const schemeModelDb: {
|
|
|
13
13
|
index: string;
|
|
14
14
|
presentation: string;
|
|
15
15
|
fields: {
|
|
16
|
-
id:
|
|
17
|
-
name:
|
|
18
|
-
code:
|
|
19
|
-
model:
|
|
20
|
-
prompt:
|
|
21
|
-
created_at:
|
|
22
|
-
ia_lock:
|
|
23
|
-
agentPromptId:
|
|
16
|
+
id: "id (readonly)";
|
|
17
|
+
name: "text (private)";
|
|
18
|
+
code: "text";
|
|
19
|
+
model: "text";
|
|
20
|
+
prompt: "text-long";
|
|
21
|
+
created_at: "date (private)";
|
|
22
|
+
ia_lock: "boolean (private)";
|
|
23
|
+
agentPromptId: "fk-agentPrompt.id (required)";
|
|
24
24
|
};
|
|
25
25
|
fks: {
|
|
26
26
|
agentPrompt: {
|
|
27
27
|
code: string;
|
|
28
|
-
rules:
|
|
29
|
-
multiple:
|
|
28
|
+
rules: "readonly private";
|
|
29
|
+
multiple: true;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -39,12 +39,12 @@ export declare const schemeModelDb: {
|
|
|
39
39
|
index: string;
|
|
40
40
|
presentation: string;
|
|
41
41
|
fields: {
|
|
42
|
-
id:
|
|
43
|
-
created_at:
|
|
44
|
-
value:
|
|
45
|
-
name:
|
|
46
|
-
code:
|
|
47
|
-
ia_lock:
|
|
42
|
+
id: "id (readonly)";
|
|
43
|
+
created_at: "date (private)";
|
|
44
|
+
value: "text-long (required)";
|
|
45
|
+
name: "text (required)";
|
|
46
|
+
code: "text (required)";
|
|
47
|
+
ia_lock: "boolean (private)";
|
|
48
48
|
};
|
|
49
49
|
fks: {};
|
|
50
50
|
};
|
|
@@ -57,9 +57,9 @@ export declare const schemeModelDb: {
|
|
|
57
57
|
index: string;
|
|
58
58
|
presentation: string;
|
|
59
59
|
fields: {
|
|
60
|
-
code:
|
|
61
|
-
name:
|
|
62
|
-
context:
|
|
60
|
+
code: "text";
|
|
61
|
+
name: "text";
|
|
62
|
+
context: "array-of-number";
|
|
63
63
|
};
|
|
64
64
|
fks: {};
|
|
65
65
|
};
|
|
@@ -72,23 +72,23 @@ export declare const schemeModelDb: {
|
|
|
72
72
|
index: string;
|
|
73
73
|
presentation: string;
|
|
74
74
|
fields: {
|
|
75
|
-
id:
|
|
76
|
-
chatId:
|
|
77
|
-
chatPassKey:
|
|
78
|
-
created_at:
|
|
79
|
-
category:
|
|
80
|
-
categoryId:
|
|
81
|
-
dateLastMessage:
|
|
82
|
-
name:
|
|
83
|
-
description:
|
|
84
|
-
ia_lock:
|
|
85
|
-
spaceId:
|
|
75
|
+
id: "id";
|
|
76
|
+
chatId: "fk.chat.id ";
|
|
77
|
+
chatPassKey: "text";
|
|
78
|
+
created_at: "date";
|
|
79
|
+
category: "text";
|
|
80
|
+
categoryId: "id";
|
|
81
|
+
dateLastMessage: "date";
|
|
82
|
+
name: "text";
|
|
83
|
+
description: "text";
|
|
84
|
+
ia_lock: "boolean";
|
|
85
|
+
spaceId: "fk-space.id (required)";
|
|
86
86
|
};
|
|
87
87
|
fks: {
|
|
88
88
|
space: {
|
|
89
89
|
code: string;
|
|
90
|
-
rules:
|
|
91
|
-
multiple:
|
|
90
|
+
rules: "private required";
|
|
91
|
+
multiple: false;
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
94
|
};
|
|
@@ -101,10 +101,10 @@ export declare const schemeModelDb: {
|
|
|
101
101
|
index: string;
|
|
102
102
|
presentation: string;
|
|
103
103
|
fields: {
|
|
104
|
-
id:
|
|
105
|
-
code:
|
|
106
|
-
name:
|
|
107
|
-
ia_lock:
|
|
104
|
+
id: "id";
|
|
105
|
+
code: "text";
|
|
106
|
+
name: "text";
|
|
107
|
+
ia_lock: "boolean (private)";
|
|
108
108
|
};
|
|
109
109
|
fks: {};
|
|
110
110
|
};
|
|
@@ -117,10 +117,10 @@ export declare const schemeModelDb: {
|
|
|
117
117
|
index: string;
|
|
118
118
|
presentation: string;
|
|
119
119
|
fields: {
|
|
120
|
-
id:
|
|
121
|
-
code:
|
|
122
|
-
name:
|
|
123
|
-
ia_lock:
|
|
120
|
+
id: "id";
|
|
121
|
+
code: "text";
|
|
122
|
+
name: "text";
|
|
123
|
+
ia_lock: "boolean (private)";
|
|
124
124
|
};
|
|
125
125
|
fks: {};
|
|
126
126
|
};
|
|
@@ -133,10 +133,10 @@ export declare const schemeModelDb: {
|
|
|
133
133
|
index: string;
|
|
134
134
|
presentation: string;
|
|
135
135
|
fields: {
|
|
136
|
-
id:
|
|
137
|
-
code:
|
|
138
|
-
name:
|
|
139
|
-
ia_lock:
|
|
136
|
+
id: "id";
|
|
137
|
+
code: "text";
|
|
138
|
+
name: "text";
|
|
139
|
+
ia_lock: "boolean (private)";
|
|
140
140
|
};
|
|
141
141
|
fks: {};
|
|
142
142
|
};
|
|
@@ -149,16 +149,16 @@ export declare const schemeModelDb: {
|
|
|
149
149
|
index: string;
|
|
150
150
|
presentation: string;
|
|
151
151
|
fields: {
|
|
152
|
-
id:
|
|
153
|
-
chatId:
|
|
154
|
-
messageId:
|
|
155
|
-
created_at:
|
|
156
|
-
content:
|
|
157
|
-
status:
|
|
158
|
-
context:
|
|
159
|
-
resume:
|
|
160
|
-
model:
|
|
161
|
-
ia_lock:
|
|
152
|
+
id: "id";
|
|
153
|
+
chatId: "id";
|
|
154
|
+
messageId: "id";
|
|
155
|
+
created_at: "date";
|
|
156
|
+
content: "text-long";
|
|
157
|
+
status: "text";
|
|
158
|
+
context: "array-of-number";
|
|
159
|
+
resume: "text";
|
|
160
|
+
model: "text";
|
|
161
|
+
ia_lock: "boolean";
|
|
162
162
|
};
|
|
163
163
|
fks: {};
|
|
164
164
|
};
|
|
@@ -171,12 +171,12 @@ export declare const schemeModelDb: {
|
|
|
171
171
|
index: string;
|
|
172
172
|
presentation: string;
|
|
173
173
|
fields: {
|
|
174
|
-
id:
|
|
175
|
-
name:
|
|
176
|
-
code:
|
|
177
|
-
value:
|
|
178
|
-
created_at:
|
|
179
|
-
ia_lock:
|
|
174
|
+
id: "id";
|
|
175
|
+
name: "text";
|
|
176
|
+
code: "text";
|
|
177
|
+
value: "text";
|
|
178
|
+
created_at: "date";
|
|
179
|
+
ia_lock: "boolean";
|
|
180
180
|
};
|
|
181
181
|
fks: {};
|
|
182
182
|
};
|
|
@@ -189,13 +189,13 @@ export declare const schemeModelDb: {
|
|
|
189
189
|
index: string;
|
|
190
190
|
presentation: string;
|
|
191
191
|
fields: {
|
|
192
|
-
id:
|
|
193
|
-
userId:
|
|
194
|
-
created_at:
|
|
195
|
-
updated_at:
|
|
196
|
-
code:
|
|
197
|
-
value:
|
|
198
|
-
ia_lock:
|
|
192
|
+
id: "id";
|
|
193
|
+
userId: "id";
|
|
194
|
+
created_at: "date (readonly)";
|
|
195
|
+
updated_at: "date (readonly)";
|
|
196
|
+
code: "text";
|
|
197
|
+
value: "text";
|
|
198
|
+
ia_lock: "boolean (private)";
|
|
199
199
|
};
|
|
200
200
|
fks: {};
|
|
201
201
|
};
|
|
@@ -208,13 +208,13 @@ export declare const schemeModelDb: {
|
|
|
208
208
|
index: string;
|
|
209
209
|
presentation: string;
|
|
210
210
|
fields: {
|
|
211
|
-
id:
|
|
212
|
-
name:
|
|
213
|
-
color:
|
|
214
|
-
created_at:
|
|
215
|
-
email:
|
|
216
|
-
password:
|
|
217
|
-
ia_lock:
|
|
211
|
+
id: "id";
|
|
212
|
+
name: "text";
|
|
213
|
+
color: "text";
|
|
214
|
+
created_at: "date (readonly)";
|
|
215
|
+
email: "email";
|
|
216
|
+
password: "password";
|
|
217
|
+
ia_lock: "boolean (private)";
|
|
218
218
|
};
|
|
219
219
|
fks: {};
|
|
220
220
|
};
|
|
@@ -227,20 +227,20 @@ export declare const schemeModelDb: {
|
|
|
227
227
|
index: string;
|
|
228
228
|
presentation: string;
|
|
229
229
|
fields: {
|
|
230
|
-
id:
|
|
231
|
-
userId:
|
|
232
|
-
title:
|
|
233
|
-
description:
|
|
234
|
-
created_at:
|
|
235
|
-
updated_at:
|
|
236
|
-
status:
|
|
237
|
-
ia_lock:
|
|
230
|
+
id: "id (readonly)";
|
|
231
|
+
userId: "id";
|
|
232
|
+
title: "text-long (required)";
|
|
233
|
+
description: "text-area";
|
|
234
|
+
created_at: "date (readonly)";
|
|
235
|
+
updated_at: "date";
|
|
236
|
+
status: "text";
|
|
237
|
+
ia_lock: "boolean (private)";
|
|
238
238
|
};
|
|
239
239
|
fks: {
|
|
240
240
|
user: {
|
|
241
241
|
code: string;
|
|
242
|
-
multiple:
|
|
243
|
-
rules:
|
|
242
|
+
multiple: false;
|
|
243
|
+
rules: "readonly";
|
|
244
244
|
};
|
|
245
245
|
};
|
|
246
246
|
};
|
|
@@ -253,20 +253,20 @@ export declare const schemeModelDb: {
|
|
|
253
253
|
index: string;
|
|
254
254
|
presentation: string;
|
|
255
255
|
fields: {
|
|
256
|
-
id:
|
|
257
|
-
bookId:
|
|
258
|
-
title:
|
|
259
|
-
content:
|
|
260
|
-
order:
|
|
261
|
-
created_at:
|
|
262
|
-
updated_at:
|
|
263
|
-
ia_lock:
|
|
256
|
+
id: "id (readonly)";
|
|
257
|
+
bookId: "id";
|
|
258
|
+
title: "text-long (required)";
|
|
259
|
+
content: "text-area";
|
|
260
|
+
order: "number";
|
|
261
|
+
created_at: "date (readonly)";
|
|
262
|
+
updated_at: "date";
|
|
263
|
+
ia_lock: "boolean (private readonly)";
|
|
264
264
|
};
|
|
265
265
|
fks: {
|
|
266
266
|
book: {
|
|
267
267
|
code: string;
|
|
268
|
-
multiple:
|
|
269
|
-
rules:
|
|
268
|
+
multiple: false;
|
|
269
|
+
rules: "readonly";
|
|
270
270
|
};
|
|
271
271
|
};
|
|
272
272
|
};
|
|
@@ -279,26 +279,26 @@ export declare const schemeModelDb: {
|
|
|
279
279
|
index: string;
|
|
280
280
|
presentation: string;
|
|
281
281
|
fields: {
|
|
282
|
-
id:
|
|
283
|
-
userId:
|
|
284
|
-
bookId:
|
|
285
|
-
description:
|
|
286
|
-
targetWordCount:
|
|
287
|
-
deadline:
|
|
288
|
-
created_at:
|
|
289
|
-
updated_at:
|
|
290
|
-
ia_lock:
|
|
282
|
+
id: "id (readonly)";
|
|
283
|
+
userId: "id";
|
|
284
|
+
bookId: "id";
|
|
285
|
+
description: "text (required)";
|
|
286
|
+
targetWordCount: "number";
|
|
287
|
+
deadline: "date";
|
|
288
|
+
created_at: "date (readonly)";
|
|
289
|
+
updated_at: "date";
|
|
290
|
+
ia_lock: "boolean (private)";
|
|
291
291
|
};
|
|
292
292
|
fks: {
|
|
293
293
|
user: {
|
|
294
294
|
code: string;
|
|
295
|
-
multiple:
|
|
296
|
-
rules:
|
|
295
|
+
multiple: false;
|
|
296
|
+
rules: "readonly";
|
|
297
297
|
};
|
|
298
298
|
book: {
|
|
299
299
|
code: string;
|
|
300
|
-
multiple:
|
|
301
|
-
rules:
|
|
300
|
+
multiple: false;
|
|
301
|
+
rules: "readonly";
|
|
302
302
|
};
|
|
303
303
|
};
|
|
304
304
|
};
|
|
@@ -311,42 +311,42 @@ export declare const schemeModelDb: {
|
|
|
311
311
|
index: string;
|
|
312
312
|
presentation: string;
|
|
313
313
|
fields: {
|
|
314
|
-
id:
|
|
315
|
-
bookId:
|
|
316
|
-
characterLinkIds:
|
|
317
|
-
characterAttributesIds:
|
|
318
|
-
firstName:
|
|
319
|
-
lastName:
|
|
320
|
-
nickname:
|
|
321
|
-
age:
|
|
322
|
-
gender:
|
|
323
|
-
occupation:
|
|
324
|
-
role:
|
|
325
|
-
description:
|
|
326
|
-
backstory:
|
|
327
|
-
physicalDescription:
|
|
328
|
-
personalityTraits:
|
|
329
|
-
goals:
|
|
330
|
-
conflicts:
|
|
331
|
-
created_at:
|
|
332
|
-
updated_at:
|
|
333
|
-
ia_lock:
|
|
314
|
+
id: "id (readonly)";
|
|
315
|
+
bookId: "id";
|
|
316
|
+
characterLinkIds: "array-of-fk-characterLink.id (private)";
|
|
317
|
+
characterAttributesIds: "array-of-fk-characterAttributes.id (private)";
|
|
318
|
+
firstName: "text (required)";
|
|
319
|
+
lastName: "text";
|
|
320
|
+
nickname: "text";
|
|
321
|
+
age: "number";
|
|
322
|
+
gender: "text";
|
|
323
|
+
occupation: "text";
|
|
324
|
+
role: "text";
|
|
325
|
+
description: "text-area";
|
|
326
|
+
backstory: "text-area";
|
|
327
|
+
physicalDescription: "text-area";
|
|
328
|
+
personalityTraits: "array-of-text";
|
|
329
|
+
goals: "text-area";
|
|
330
|
+
conflicts: "text-area";
|
|
331
|
+
created_at: "date (readonly private)";
|
|
332
|
+
updated_at: "date (readonly private)";
|
|
333
|
+
ia_lock: "boolean (private)";
|
|
334
334
|
};
|
|
335
335
|
fks: {
|
|
336
336
|
characterAttributes: {
|
|
337
337
|
code: string;
|
|
338
|
-
multiple:
|
|
339
|
-
rules:
|
|
338
|
+
multiple: true;
|
|
339
|
+
rules: "";
|
|
340
340
|
};
|
|
341
341
|
book: {
|
|
342
342
|
code: string;
|
|
343
|
-
multiple:
|
|
344
|
-
rules:
|
|
343
|
+
multiple: false;
|
|
344
|
+
rules: "readonly";
|
|
345
345
|
};
|
|
346
346
|
characterLink: {
|
|
347
347
|
code: string;
|
|
348
|
-
multiple:
|
|
349
|
-
rules:
|
|
348
|
+
multiple: true;
|
|
349
|
+
rules: "";
|
|
350
350
|
};
|
|
351
351
|
};
|
|
352
352
|
};
|
|
@@ -359,11 +359,11 @@ export declare const schemeModelDb: {
|
|
|
359
359
|
index: string;
|
|
360
360
|
presentation: string;
|
|
361
361
|
fields: {
|
|
362
|
-
id:
|
|
363
|
-
attribute:
|
|
364
|
-
name:
|
|
365
|
-
created_at:
|
|
366
|
-
updated_at:
|
|
362
|
+
id: "id (readonly)";
|
|
363
|
+
attribute: "text";
|
|
364
|
+
name: "text";
|
|
365
|
+
created_at: "date (readonly)";
|
|
366
|
+
updated_at: "date";
|
|
367
367
|
};
|
|
368
368
|
fks: {};
|
|
369
369
|
};
|
|
@@ -376,17 +376,17 @@ export declare const schemeModelDb: {
|
|
|
376
376
|
index: string;
|
|
377
377
|
presentation: string;
|
|
378
378
|
fields: {
|
|
379
|
-
id:
|
|
380
|
-
characterId:
|
|
381
|
-
type:
|
|
382
|
-
description:
|
|
383
|
-
active:
|
|
379
|
+
id: "id";
|
|
380
|
+
characterId: "array-of-fk-character.id";
|
|
381
|
+
type: "text-short";
|
|
382
|
+
description: "text-medium";
|
|
383
|
+
active: "boolean";
|
|
384
384
|
};
|
|
385
385
|
fks: {
|
|
386
386
|
character: {
|
|
387
387
|
code: string;
|
|
388
|
-
multiple:
|
|
389
|
-
rules:
|
|
388
|
+
multiple: true;
|
|
389
|
+
rules: "";
|
|
390
390
|
};
|
|
391
391
|
};
|
|
392
392
|
};
|
|
@@ -399,27 +399,27 @@ export declare const schemeModelDb: {
|
|
|
399
399
|
index: string;
|
|
400
400
|
presentation: string;
|
|
401
401
|
fields: {
|
|
402
|
-
id:
|
|
403
|
-
characterId:
|
|
404
|
-
chapterId:
|
|
405
|
-
status:
|
|
406
|
-
role:
|
|
407
|
-
actions:
|
|
408
|
-
development:
|
|
409
|
-
notes:
|
|
410
|
-
created_at:
|
|
411
|
-
updated_at:
|
|
402
|
+
id: "id (readonly)";
|
|
403
|
+
characterId: "id";
|
|
404
|
+
chapterId: "id";
|
|
405
|
+
status: "text";
|
|
406
|
+
role: "text";
|
|
407
|
+
actions: "text-long";
|
|
408
|
+
development: "text-area";
|
|
409
|
+
notes: "text-long";
|
|
410
|
+
created_at: "date (readonly)";
|
|
411
|
+
updated_at: "date";
|
|
412
412
|
};
|
|
413
413
|
fks: {
|
|
414
414
|
character: {
|
|
415
415
|
code: string;
|
|
416
|
-
multiple:
|
|
417
|
-
rules:
|
|
416
|
+
multiple: false;
|
|
417
|
+
rules: "readonly";
|
|
418
418
|
};
|
|
419
419
|
chapter: {
|
|
420
420
|
code: string;
|
|
421
|
-
multiple:
|
|
422
|
-
rules:
|
|
421
|
+
multiple: false;
|
|
422
|
+
rules: "readonly";
|
|
423
423
|
};
|
|
424
424
|
};
|
|
425
425
|
};
|
|
@@ -432,20 +432,20 @@ export declare const schemeModelDb: {
|
|
|
432
432
|
index: string;
|
|
433
433
|
presentation: string;
|
|
434
434
|
fields: {
|
|
435
|
-
id:
|
|
436
|
-
bookId:
|
|
437
|
-
name:
|
|
438
|
-
category:
|
|
439
|
-
content:
|
|
440
|
-
created_at:
|
|
441
|
-
updated_at:
|
|
442
|
-
ia_lock:
|
|
435
|
+
id: "id (readonly)";
|
|
436
|
+
bookId: "id";
|
|
437
|
+
name: "text (required)";
|
|
438
|
+
category: "text";
|
|
439
|
+
content: "text-area";
|
|
440
|
+
created_at: "date (readonly)";
|
|
441
|
+
updated_at: "date";
|
|
442
|
+
ia_lock: "boolean (private)";
|
|
443
443
|
};
|
|
444
444
|
fks: {
|
|
445
445
|
book: {
|
|
446
446
|
code: string;
|
|
447
|
-
multiple:
|
|
448
|
-
rules:
|
|
447
|
+
multiple: false;
|
|
448
|
+
rules: "readonly";
|
|
449
449
|
};
|
|
450
450
|
};
|
|
451
451
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type FieldTypeId = 'id' | 'text' | 'text-short' | 'text-medium' | 'text-long' | 'text-area' | 'number' | 'boolean' | 'date' | 'email' | 'password' | 'object-any' | `fk-${string}.id` | `array-of-${string}` | `object-of-${string}` | `array-of-fk-${string}.id`;
|
|
2
|
+
export interface FieldTypeDef {
|
|
3
|
+
id: FieldTypeId;
|
|
4
|
+
formatter: (value: any) => any;
|
|
5
|
+
validator?: (value: any) => boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function registerFieldType(def: FieldTypeDef): void;
|
|
8
|
+
/**
|
|
9
|
+
* Ajoute plusieurs types de champs d'un coup
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerFieldTypes(defs: FieldTypeDef[]): void;
|
|
12
|
+
export declare function getFieldType(id: FieldTypeId): FieldTypeDef | undefined;
|
|
13
|
+
export declare function getAllFieldTypes(): FieldTypeDef[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/lib/db/fieldTypes.ts
|
|
2
|
+
const fieldTypeRegistry = {};
|
|
3
|
+
export function registerFieldType(def) {
|
|
4
|
+
fieldTypeRegistry[def.id] = def;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Ajoute plusieurs types de champs d'un coup
|
|
8
|
+
*/
|
|
9
|
+
export function registerFieldTypes(defs) {
|
|
10
|
+
defs.forEach(registerFieldType);
|
|
11
|
+
}
|
|
12
|
+
export function getFieldType(id) {
|
|
13
|
+
return fieldTypeRegistry[id];
|
|
14
|
+
}
|
|
15
|
+
export function getAllFieldTypes() {
|
|
16
|
+
return Object.values(fieldTypeRegistry);
|
|
17
|
+
}
|
|
18
|
+
// Enregistrement des types de base
|
|
19
|
+
registerFieldType({
|
|
20
|
+
id: 'id',
|
|
21
|
+
formatter: (v) => v
|
|
22
|
+
});
|
|
23
|
+
registerFieldType({
|
|
24
|
+
id: 'text',
|
|
25
|
+
formatter: (v) => (typeof v === 'string' ? v : String(v))
|
|
26
|
+
});
|
|
27
|
+
registerFieldType({
|
|
28
|
+
id: 'text-short',
|
|
29
|
+
formatter: (v) => (typeof v === 'string' ? v : String(v))
|
|
30
|
+
});
|
|
31
|
+
registerFieldType({
|
|
32
|
+
id: 'text-medium',
|
|
33
|
+
formatter: (v) => (typeof v === 'string' ? v : String(v))
|
|
34
|
+
});
|
|
35
|
+
registerFieldType({
|
|
36
|
+
id: 'text-long',
|
|
37
|
+
formatter: (v) => (typeof v === 'string' ? v : String(v))
|
|
38
|
+
});
|
|
39
|
+
registerFieldType({
|
|
40
|
+
id: 'text-area',
|
|
41
|
+
formatter: (v) => (typeof v === 'string' ? v : String(v))
|
|
42
|
+
});
|
|
43
|
+
registerFieldType({
|
|
44
|
+
id: 'number',
|
|
45
|
+
formatter: (v) => Number(v)
|
|
46
|
+
});
|
|
47
|
+
registerFieldType({
|
|
48
|
+
id: 'boolean',
|
|
49
|
+
formatter: (v) => Boolean(v)
|
|
50
|
+
});
|
|
51
|
+
registerFieldType({
|
|
52
|
+
id: 'date',
|
|
53
|
+
formatter: (v) => (v ? new Date(v) : null)
|
|
54
|
+
});
|
|
55
|
+
registerFieldType({
|
|
56
|
+
id: 'email',
|
|
57
|
+
formatter: (v) => (typeof v === 'string' ? v : String(v))
|
|
58
|
+
});
|
|
59
|
+
registerFieldType({
|
|
60
|
+
id: 'password',
|
|
61
|
+
formatter: (v) => (typeof v === 'string' ? v : String(v))
|
|
62
|
+
});
|
|
63
|
+
registerFieldType({
|
|
64
|
+
id: 'object-any',
|
|
65
|
+
formatter: (v) => v
|
|
66
|
+
});
|
|
67
|
+
// Pour les types dynamiques (fk-*, array-of-*) il faudra un traitement spécial à l'enregistrement
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DBAgent, DbAgentPrompt } from '$types/db';
|
|
2
2
|
import { type IdbqModel } from '@medyll/idae-idbql';
|
|
3
|
-
import type { DbDataModelTs } from '
|
|
3
|
+
import type { DbDataModelTs } from '../db/dataModel.js';
|
|
4
4
|
export declare const schemeModelTestDb: {
|
|
5
5
|
agent: {
|
|
6
6
|
keyPath: string;
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
-->
|
|
5
5
|
|
|
6
6
|
<script lang="ts" generics="COL = Record<string,any>">
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
import { IDbFormValidate } from '../main/IDbFormValidate';
|
|
8
9
|
import type { CreateUpdateProps } from './types';
|
|
9
10
|
import CollectionReverseFks from './CollectionReverseFks.svelte';
|
|
10
11
|
import FieldInput from './FieldValue.svelte';
|