@objectql/types 1.6.1 → 1.7.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.
@@ -0,0 +1,604 @@
1
+ {
2
+ "$ref": "#/definitions/PageConfig",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "ComponentAction": {
6
+ "additionalProperties": false,
7
+ "description": "Action triggered by component interaction",
8
+ "properties": {
9
+ "action": {
10
+ "description": "Action name to execute (for type: run_action)",
11
+ "type": "string"
12
+ },
13
+ "confirm": {
14
+ "description": "Confirmation message before executing",
15
+ "type": "string"
16
+ },
17
+ "handler": {
18
+ "description": "Custom handler function",
19
+ "type": "string"
20
+ },
21
+ "modal": {
22
+ "description": "Modal component to open (for type: open_modal)",
23
+ "type": "string"
24
+ },
25
+ "object": {
26
+ "description": "Target object for action",
27
+ "type": "string"
28
+ },
29
+ "on_error": {
30
+ "description": "Error handling",
31
+ "enum": [
32
+ "show_toast",
33
+ "show_modal",
34
+ "ignore"
35
+ ],
36
+ "type": "string"
37
+ },
38
+ "path": {
39
+ "description": "Navigation path (for type: navigate)",
40
+ "type": "string"
41
+ },
42
+ "success_message": {
43
+ "description": "Success message after execution",
44
+ "type": "string"
45
+ },
46
+ "type": {
47
+ "description": "Action type",
48
+ "enum": [
49
+ "navigate",
50
+ "open_modal",
51
+ "run_action",
52
+ "submit_form",
53
+ "refresh",
54
+ "custom"
55
+ ],
56
+ "type": "string"
57
+ }
58
+ },
59
+ "required": [
60
+ "type"
61
+ ],
62
+ "type": "object"
63
+ },
64
+ "ComponentDataSource": {
65
+ "additionalProperties": false,
66
+ "description": "Data source configuration for components",
67
+ "properties": {
68
+ "expand": {
69
+ "description": "Related objects to expand",
70
+ "type": "object"
71
+ },
72
+ "fields": {
73
+ "description": "Fields to display",
74
+ "items": {
75
+ "type": "string"
76
+ },
77
+ "type": "array"
78
+ },
79
+ "filters": {
80
+ "description": "Filter conditions",
81
+ "items": {},
82
+ "type": "array"
83
+ },
84
+ "limit": {
85
+ "description": "Maximum records to fetch",
86
+ "type": "number"
87
+ },
88
+ "object": {
89
+ "description": "Object name to query",
90
+ "type": "string"
91
+ },
92
+ "paginate": {
93
+ "description": "Enable pagination",
94
+ "type": "boolean"
95
+ },
96
+ "query": {
97
+ "description": "Custom query override"
98
+ },
99
+ "sort": {
100
+ "description": "Sort configuration",
101
+ "items": {
102
+ "items": [
103
+ {
104
+ "type": "string"
105
+ },
106
+ {
107
+ "enum": [
108
+ "asc",
109
+ "desc"
110
+ ],
111
+ "type": "string"
112
+ }
113
+ ],
114
+ "maxItems": 2,
115
+ "minItems": 2,
116
+ "type": "array"
117
+ },
118
+ "type": "array"
119
+ }
120
+ },
121
+ "type": "object"
122
+ },
123
+ "ComponentStyle": {
124
+ "additionalProperties": false,
125
+ "description": "Styling configuration for components",
126
+ "properties": {
127
+ "background": {
128
+ "description": "Background color",
129
+ "type": "string"
130
+ },
131
+ "border": {
132
+ "description": "Border",
133
+ "type": "string"
134
+ },
135
+ "border_radius": {
136
+ "description": "Border radius",
137
+ "type": "string"
138
+ },
139
+ "class_name": {
140
+ "description": "Custom CSS classes",
141
+ "type": "string"
142
+ },
143
+ "color": {
144
+ "description": "Text color",
145
+ "type": "string"
146
+ },
147
+ "custom_css": {
148
+ "description": "Inline styles",
149
+ "type": "object"
150
+ },
151
+ "height": {
152
+ "description": "Height",
153
+ "type": "string"
154
+ },
155
+ "margin": {
156
+ "description": "Margin",
157
+ "type": "string"
158
+ },
159
+ "min_height": {
160
+ "description": "Minimum height",
161
+ "type": "string"
162
+ },
163
+ "min_width": {
164
+ "description": "Minimum width",
165
+ "type": "string"
166
+ },
167
+ "padding": {
168
+ "description": "Padding",
169
+ "type": "string"
170
+ },
171
+ "width": {
172
+ "description": "Width (e.g., '100%', '300px', 'auto')",
173
+ "type": "string"
174
+ }
175
+ },
176
+ "type": "object"
177
+ },
178
+ "PageComponent": {
179
+ "additionalProperties": false,
180
+ "description": "Base component configuration",
181
+ "properties": {
182
+ "actions": {
183
+ "additionalProperties": {
184
+ "anyOf": [
185
+ {
186
+ "$ref": "#/definitions/ComponentAction"
187
+ },
188
+ {
189
+ "not": {}
190
+ }
191
+ ]
192
+ },
193
+ "description": "Actions triggered by this component",
194
+ "properties": {
195
+ "on_change": {
196
+ "$ref": "#/definitions/ComponentAction"
197
+ },
198
+ "on_click": {
199
+ "$ref": "#/definitions/ComponentAction"
200
+ },
201
+ "on_load": {
202
+ "$ref": "#/definitions/ComponentAction"
203
+ },
204
+ "on_submit": {
205
+ "$ref": "#/definitions/ComponentAction"
206
+ }
207
+ },
208
+ "type": "object"
209
+ },
210
+ "component": {
211
+ "description": "Custom component reference",
212
+ "type": "string"
213
+ },
214
+ "components": {
215
+ "description": "Nested components (for containers, tabs, etc.)",
216
+ "items": {
217
+ "$ref": "#/definitions/PageComponent"
218
+ },
219
+ "type": "array"
220
+ },
221
+ "config": {
222
+ "description": "Component-specific configuration",
223
+ "type": "object"
224
+ },
225
+ "data_source": {
226
+ "$ref": "#/definitions/ComponentDataSource",
227
+ "description": "Data source configuration"
228
+ },
229
+ "description": {
230
+ "description": "Component description",
231
+ "type": "string"
232
+ },
233
+ "grid": {
234
+ "additionalProperties": false,
235
+ "description": "Grid position (for dashboard layout)",
236
+ "properties": {
237
+ "h": {
238
+ "type": "number"
239
+ },
240
+ "w": {
241
+ "type": "number"
242
+ },
243
+ "x": {
244
+ "type": "number"
245
+ },
246
+ "y": {
247
+ "type": "number"
248
+ }
249
+ },
250
+ "required": [
251
+ "x",
252
+ "y",
253
+ "w",
254
+ "h"
255
+ ],
256
+ "type": "object"
257
+ },
258
+ "id": {
259
+ "description": "Unique component identifier within the page",
260
+ "type": "string"
261
+ },
262
+ "label": {
263
+ "description": "Display label",
264
+ "type": "string"
265
+ },
266
+ "permissions": {
267
+ "description": "Access control",
268
+ "items": {
269
+ "type": "string"
270
+ },
271
+ "type": "array"
272
+ },
273
+ "responsive": {
274
+ "$ref": "#/definitions/ResponsiveConfig",
275
+ "description": "Responsive behavior"
276
+ },
277
+ "style": {
278
+ "$ref": "#/definitions/ComponentStyle",
279
+ "description": "Visual styling"
280
+ },
281
+ "type": {
282
+ "$ref": "#/definitions/PageComponentType",
283
+ "description": "Component type"
284
+ },
285
+ "visible_when": {
286
+ "description": "Visibility conditions",
287
+ "type": "object"
288
+ }
289
+ },
290
+ "required": [
291
+ "id",
292
+ "type"
293
+ ],
294
+ "type": "object"
295
+ },
296
+ "PageComponentType": {
297
+ "description": "Component types that can be placed on a page",
298
+ "enum": [
299
+ "data_grid",
300
+ "form",
301
+ "detail_view",
302
+ "chart",
303
+ "metric",
304
+ "list",
305
+ "calendar",
306
+ "kanban",
307
+ "timeline",
308
+ "text",
309
+ "html",
310
+ "iframe",
311
+ "button",
312
+ "tabs",
313
+ "container",
314
+ "divider",
315
+ "image",
316
+ "custom"
317
+ ],
318
+ "type": "string"
319
+ },
320
+ "PageConfig": {
321
+ "additionalProperties": false,
322
+ "description": "Page metadata configuration",
323
+ "properties": {
324
+ "actions": {
325
+ "additionalProperties": {
326
+ "$ref": "#/definitions/ComponentAction"
327
+ },
328
+ "description": "Page-level actions",
329
+ "type": "object"
330
+ },
331
+ "ai_context": {
332
+ "additionalProperties": false,
333
+ "description": "AI context for page generation and understanding",
334
+ "properties": {
335
+ "intent": {
336
+ "description": "Purpose of the page",
337
+ "type": "string"
338
+ },
339
+ "persona": {
340
+ "description": "Target user persona",
341
+ "type": "string"
342
+ },
343
+ "tasks": {
344
+ "description": "Key user tasks",
345
+ "items": {
346
+ "type": "string"
347
+ },
348
+ "type": "array"
349
+ }
350
+ },
351
+ "type": "object"
352
+ },
353
+ "components": {
354
+ "description": "Components (alternative to sections for simple layouts)",
355
+ "items": {
356
+ "$ref": "#/definitions/PageComponent"
357
+ },
358
+ "type": "array"
359
+ },
360
+ "data_sources": {
361
+ "additionalProperties": {
362
+ "$ref": "#/definitions/ComponentDataSource"
363
+ },
364
+ "description": "Page-level data sources",
365
+ "type": "object"
366
+ },
367
+ "description": {
368
+ "description": "Page description",
369
+ "type": "string"
370
+ },
371
+ "handler": {
372
+ "description": "Custom page handler/controller",
373
+ "type": "string"
374
+ },
375
+ "icon": {
376
+ "description": "Icon for navigation",
377
+ "type": "string"
378
+ },
379
+ "label": {
380
+ "description": "Display label",
381
+ "type": "string"
382
+ },
383
+ "layout": {
384
+ "$ref": "#/definitions/PageLayoutType",
385
+ "description": "Layout type"
386
+ },
387
+ "meta": {
388
+ "additionalProperties": false,
389
+ "description": "SEO and metadata",
390
+ "properties": {
391
+ "description": {
392
+ "type": "string"
393
+ },
394
+ "keywords": {
395
+ "items": {
396
+ "type": "string"
397
+ },
398
+ "type": "array"
399
+ },
400
+ "title": {
401
+ "type": "string"
402
+ }
403
+ },
404
+ "type": "object"
405
+ },
406
+ "name": {
407
+ "description": "Unique page identifier",
408
+ "type": "string"
409
+ },
410
+ "permissions": {
411
+ "additionalProperties": false,
412
+ "description": "Access control",
413
+ "properties": {
414
+ "edit": {
415
+ "description": "Roles allowed to edit this page",
416
+ "items": {
417
+ "type": "string"
418
+ },
419
+ "type": "array"
420
+ },
421
+ "view": {
422
+ "description": "Roles allowed to view this page",
423
+ "items": {
424
+ "type": "string"
425
+ },
426
+ "type": "array"
427
+ }
428
+ },
429
+ "type": "object"
430
+ },
431
+ "realtime": {
432
+ "description": "Enable real-time updates",
433
+ "type": "boolean"
434
+ },
435
+ "refresh_interval": {
436
+ "description": "Refresh interval in seconds",
437
+ "type": "number"
438
+ },
439
+ "responsive": {
440
+ "$ref": "#/definitions/ResponsiveConfig",
441
+ "description": "Responsive configuration"
442
+ },
443
+ "sections": {
444
+ "description": "Page sections",
445
+ "items": {
446
+ "$ref": "#/definitions/PageSection"
447
+ },
448
+ "type": "array"
449
+ },
450
+ "state": {
451
+ "additionalProperties": false,
452
+ "description": "Page state management",
453
+ "properties": {
454
+ "initial": {
455
+ "description": "Initial state values",
456
+ "type": "object"
457
+ },
458
+ "persist": {
459
+ "description": "State persistence",
460
+ "type": "boolean"
461
+ },
462
+ "storage_key": {
463
+ "description": "Storage key for persistence",
464
+ "type": "string"
465
+ }
466
+ },
467
+ "type": "object"
468
+ },
469
+ "style": {
470
+ "$ref": "#/definitions/ComponentStyle",
471
+ "description": "Page styling"
472
+ }
473
+ },
474
+ "required": [
475
+ "name",
476
+ "label",
477
+ "layout"
478
+ ],
479
+ "type": "object"
480
+ },
481
+ "PageLayoutType": {
482
+ "description": "Layout types for page arrangement",
483
+ "enum": [
484
+ "single_column",
485
+ "two_column",
486
+ "three_column",
487
+ "dashboard",
488
+ "canvas",
489
+ "tabs",
490
+ "wizard",
491
+ "custom"
492
+ ],
493
+ "type": "string"
494
+ },
495
+ "PageSection": {
496
+ "additionalProperties": false,
497
+ "description": "Page section/region configuration",
498
+ "properties": {
499
+ "collapsed": {
500
+ "description": "Default collapsed state",
501
+ "type": "boolean"
502
+ },
503
+ "collapsible": {
504
+ "description": "Collapsible section",
505
+ "type": "boolean"
506
+ },
507
+ "components": {
508
+ "description": "Components in this section",
509
+ "items": {
510
+ "$ref": "#/definitions/PageComponent"
511
+ },
512
+ "type": "array"
513
+ },
514
+ "id": {
515
+ "description": "Section identifier",
516
+ "type": "string"
517
+ },
518
+ "label": {
519
+ "description": "Section label",
520
+ "type": "string"
521
+ },
522
+ "style": {
523
+ "$ref": "#/definitions/ComponentStyle",
524
+ "description": "Section styling"
525
+ },
526
+ "type": {
527
+ "description": "Section type",
528
+ "enum": [
529
+ "header",
530
+ "sidebar",
531
+ "content",
532
+ "footer",
533
+ "custom"
534
+ ],
535
+ "type": "string"
536
+ },
537
+ "visible_when": {
538
+ "description": "Visibility conditions",
539
+ "type": "object"
540
+ }
541
+ },
542
+ "required": [
543
+ "id",
544
+ "components"
545
+ ],
546
+ "type": "object"
547
+ },
548
+ "ResponsiveConfig": {
549
+ "additionalProperties": false,
550
+ "description": "Responsive breakpoint configuration",
551
+ "properties": {
552
+ "desktop": {
553
+ "additionalProperties": false,
554
+ "description": "Desktop viewport (> 1024px)",
555
+ "properties": {
556
+ "columns": {
557
+ "type": "number"
558
+ },
559
+ "order": {
560
+ "type": "number"
561
+ },
562
+ "visible": {
563
+ "type": "boolean"
564
+ }
565
+ },
566
+ "type": "object"
567
+ },
568
+ "mobile": {
569
+ "additionalProperties": false,
570
+ "description": "Mobile viewport (< 640px)",
571
+ "properties": {
572
+ "columns": {
573
+ "type": "number"
574
+ },
575
+ "order": {
576
+ "type": "number"
577
+ },
578
+ "visible": {
579
+ "type": "boolean"
580
+ }
581
+ },
582
+ "type": "object"
583
+ },
584
+ "tablet": {
585
+ "additionalProperties": false,
586
+ "description": "Tablet viewport (640px - 1024px)",
587
+ "properties": {
588
+ "columns": {
589
+ "type": "number"
590
+ },
591
+ "order": {
592
+ "type": "number"
593
+ },
594
+ "visible": {
595
+ "type": "boolean"
596
+ }
597
+ },
598
+ "type": "object"
599
+ }
600
+ },
601
+ "type": "object"
602
+ }
603
+ }
604
+ }
package/CHANGELOG.md DELETED
@@ -1,62 +0,0 @@
1
- # @objectql/core
2
-
3
- ## 1.6.1
4
-
5
- ## 1.6.0
6
-
7
- ### Minor Changes
8
-
9
- - Minor version release - 1.6.0
10
-
11
- ## 1.5.0
12
-
13
- ### Minor Changes
14
-
15
- - Minor version release - 1.5.0
16
-
17
- ## 1.4.0
18
-
19
- ### Minor Changes
20
-
21
- - Release version 1.4.0 with new features and enhancements:
22
- - Added complete REST API implementation with CRUD operations
23
- - Enhanced error handling with standardized error codes and HTTP status mapping
24
- - Added AI context support for tracking intent and use cases
25
- - Enhanced metadata API with detailed field information and action listing
26
- - Improved JSON-RPC API with better error categorization
27
- - Added hooks and actions validation and implementation
28
- - Updated documentation and examples
29
-
30
- ## 1.3.1
31
-
32
- ## 1.3.0
33
-
34
- ### Minor Changes
35
-
36
- - Refactor core architecture: split logic into modules (driver, remote, action, hook, object, plugin).
37
- Rename `ObjectRegistry` to `MetadataRegistry` to support generic metadata.
38
- Add `addLoader` API to support custom metadata loaders in plugins.
39
- Update initialization lifecycle to allow plugins to register loaders before source scanning.
40
-
41
- ## 1.2.0
42
-
43
- ### Minor Changes
44
-
45
- - 7df2977: 拆分 objectos
46
-
47
- ## 1.1.0
48
-
49
- ### Minor Changes
50
-
51
- - add metadata loader
52
-
53
- ### Patch Changes
54
-
55
- - Updated dependencies
56
- - @objectql/metadata@0.2.0
57
-
58
- ## 1.0.0
59
-
60
- ### Major Changes
61
-
62
- - first release
package/jest.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- testMatch: ['**/test/**/*.test.ts'],
5
- };