@middag-io/react 0.47.0 → 0.49.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-lib/base/shell/BasicShell.d.ts +1 -1
- package/dist-lib/base/utils/icon-registry.d.ts +3 -2
- package/dist-lib/base/utils/icon-registry.d.ts.map +1 -1
- package/dist-lib/contracts/generated/index.d.ts +4 -4
- package/dist-lib/contracts/generated/index.d.ts.map +1 -1
- package/dist-lib/contracts/generated/schemas.d.ts +131 -163
- package/dist-lib/contracts/generated/schemas.d.ts.map +1 -1
- package/dist-lib/contracts/generated/types.d.ts +69 -43
- package/dist-lib/contracts/generated/types.d.ts.map +1 -1
- package/dist-lib/contracts/navigation.d.ts +5 -38
- package/dist-lib/contracts/navigation.d.ts.map +1 -1
- package/dist-lib/contracts/page-contract-schema.d.ts +3 -3
- package/dist-lib/contracts/shared-props.d.ts +10 -71
- package/dist-lib/contracts/shared-props.d.ts.map +1 -1
- package/dist-lib/engine/providers/auth.d.ts +2 -2
- package/dist-lib/engine/providers/auth.d.ts.map +1 -1
- package/dist-lib/engine/providers/flash.d.ts.map +1 -1
- package/dist-lib/index.d.ts +2 -3
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/middag-react.js +6166 -6144
- package/docs/public/schemas/ai-contract-manifest.json +9 -16
- package/docs/public/schemas/fragment.json +155 -87
- package/docs/public/schemas/manifest.json +4 -12
- package/docs/public/schemas/page-contract.json +155 -87
- package/docs/public/schemas/shared-props.json +2457 -114
- package/package.json +1 -1
- package/src/base/shell/BasicShell.tsx +7 -7
- package/src/base/utils/icon-registry.ts +3 -3
- package/src/contracts/generated/index.ts +4 -4
- package/src/contracts/generated/schemas.ts +66 -35
- package/src/contracts/generated/types.ts +71 -51
- package/src/contracts/navigation.ts +5 -52
- package/src/contracts/page-contract-schema.ts +2 -2
- package/src/contracts/shared-props.ts +10 -75
- package/src/engine/providers/auth.tsx +1 -1
- package/src/engine/providers/flash.tsx +0 -5
- package/dist-lib/contracts/connectors.d.ts +0 -50
- package/dist-lib/contracts/connectors.d.ts.map +0 -1
- package/docs/public/schemas/connectors.json +0 -97
- package/docs/public/schemas/navigation.json +0 -72
- package/src/contracts/connectors.ts +0 -60
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connectors VOs — TypeScript mirror of PHP VOs in
|
|
3
|
-
* `classes/extensions/core/connectors/connector/*`.
|
|
4
|
-
*/
|
|
5
|
-
export type ConnectorStatus = "unconfigured" | "configured" | "connected" | "degraded" | "disconnected";
|
|
6
|
-
export interface CredentialField {
|
|
7
|
-
key: string;
|
|
8
|
-
label: string;
|
|
9
|
-
type: "text" | "password" | "url" | "select";
|
|
10
|
-
required?: boolean;
|
|
11
|
-
placeholder?: string | null;
|
|
12
|
-
}
|
|
13
|
-
export interface HealthCheckResult {
|
|
14
|
-
success: boolean;
|
|
15
|
-
latency_ms: number | null;
|
|
16
|
-
error_message: string | null;
|
|
17
|
-
resulting_status: string;
|
|
18
|
-
checked_at: number;
|
|
19
|
-
}
|
|
20
|
-
export interface ConnectorListItem {
|
|
21
|
-
id: number;
|
|
22
|
-
fullname: string;
|
|
23
|
-
connector_type: string;
|
|
24
|
-
extension: string;
|
|
25
|
-
status: ConnectorStatus;
|
|
26
|
-
enabled: boolean;
|
|
27
|
-
last_check_at: number | null;
|
|
28
|
-
latency_ms: number | null;
|
|
29
|
-
}
|
|
30
|
-
export interface ConnectorDetail {
|
|
31
|
-
id: number;
|
|
32
|
-
fullname: string;
|
|
33
|
-
description: string | null;
|
|
34
|
-
connector_type: string;
|
|
35
|
-
endpoint: string | null;
|
|
36
|
-
extension: string;
|
|
37
|
-
status: ConnectorStatus;
|
|
38
|
-
enabled: boolean;
|
|
39
|
-
created_at: number;
|
|
40
|
-
modified_at: number;
|
|
41
|
-
credential_fields: CredentialField[];
|
|
42
|
-
health_history: HealthCheckResult[];
|
|
43
|
-
}
|
|
44
|
-
export interface ConnectorTypeInfo {
|
|
45
|
-
type: string;
|
|
46
|
-
name: string;
|
|
47
|
-
extension: string;
|
|
48
|
-
credential_fields: CredentialField[];
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=connectors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../../src/contracts/connectors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,YAAY,GACZ,WAAW,GACX,UAAU,GACV,cAAc,CAAC;AAEnB,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,eAAe,EAAE,CAAC;IACrC,cAAc,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,eAAe,EAAE,CAAC;CACtC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://ui-docs.middag.io/schemas/connectors.json",
|
|
4
|
-
"title": "MIDDAG Connectors Contract",
|
|
5
|
-
"description": "TypeScript contract types for the connector management subsystem. Mirrors PHP VOs in classes/extensions/core/connectors/connector/*. Used for connector list pages, detail views, health checks, and type catalogs.",
|
|
6
|
-
|
|
7
|
-
"types": {
|
|
8
|
-
"ConnectorStatus": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"enum": ["unconfigured", "configured", "connected", "degraded", "disconnected"],
|
|
11
|
-
"description": "Lifecycle state of a connector instance.",
|
|
12
|
-
"x-ai-purpose": "Use to display status badges in connector lists and details. Maps to semantic colors: connected→success, degraded→warning, disconnected→destructive, configured→info, unconfigured→neutral."
|
|
13
|
-
},
|
|
14
|
-
"CredentialField": {
|
|
15
|
-
"type": "object",
|
|
16
|
-
"description": "Schema for a single credential input in the connector configuration form.",
|
|
17
|
-
"properties": {
|
|
18
|
-
"key": { "type": "string", "description": "Field identifier." },
|
|
19
|
-
"label": { "type": "string", "description": "Display label." },
|
|
20
|
-
"type": { "type": "string", "enum": ["text", "password", "url", "select"], "description": "Input component type." },
|
|
21
|
-
"required": { "type": "boolean", "description": "Whether the field is required." },
|
|
22
|
-
"placeholder": { "type": ["string", "null"], "description": "Placeholder text." }
|
|
23
|
-
},
|
|
24
|
-
"required": ["key", "label", "type"]
|
|
25
|
-
},
|
|
26
|
-
"HealthCheckResult": {
|
|
27
|
-
"type": "object",
|
|
28
|
-
"description": "Result of a single health check probe against a connector.",
|
|
29
|
-
"properties": {
|
|
30
|
-
"success": { "type": "boolean", "description": "Whether the health check passed." },
|
|
31
|
-
"latency_ms": { "type": ["number", "null"], "description": "Response time in milliseconds." },
|
|
32
|
-
"error_message": { "type": ["string", "null"], "description": "Error details when check fails." },
|
|
33
|
-
"resulting_status": { "type": "string", "description": "ConnectorStatus after this check." },
|
|
34
|
-
"checked_at": { "type": "number", "description": "Unix timestamp of the check." }
|
|
35
|
-
},
|
|
36
|
-
"required": ["success", "latency_ms", "error_message", "resulting_status", "checked_at"]
|
|
37
|
-
},
|
|
38
|
-
"ConnectorListItem": {
|
|
39
|
-
"type": "object",
|
|
40
|
-
"description": "Summary connector data for list/table views.",
|
|
41
|
-
"properties": {
|
|
42
|
-
"id": { "type": "number" },
|
|
43
|
-
"fullname": { "type": "string" },
|
|
44
|
-
"connector_type": { "type": "string" },
|
|
45
|
-
"extension": { "type": "string", "description": "Owning extension (e.g. 'local_middag')." },
|
|
46
|
-
"status": { "$ref": "#/types/ConnectorStatus" },
|
|
47
|
-
"enabled": { "type": "boolean" },
|
|
48
|
-
"last_check_at": { "type": ["number", "null"], "description": "Unix timestamp of last health check." },
|
|
49
|
-
"latency_ms": { "type": ["number", "null"] }
|
|
50
|
-
},
|
|
51
|
-
"required": ["id", "fullname", "connector_type", "extension", "status", "enabled"]
|
|
52
|
-
},
|
|
53
|
-
"ConnectorDetail": {
|
|
54
|
-
"type": "object",
|
|
55
|
-
"description": "Full connector data for detail/edit views.",
|
|
56
|
-
"properties": {
|
|
57
|
-
"id": { "type": "number" },
|
|
58
|
-
"fullname": { "type": "string" },
|
|
59
|
-
"description": { "type": ["string", "null"] },
|
|
60
|
-
"connector_type": { "type": "string" },
|
|
61
|
-
"endpoint": { "type": ["string", "null"], "description": "API endpoint URL." },
|
|
62
|
-
"extension": { "type": "string" },
|
|
63
|
-
"status": { "$ref": "#/types/ConnectorStatus" },
|
|
64
|
-
"enabled": { "type": "boolean" },
|
|
65
|
-
"created_at": { "type": "number" },
|
|
66
|
-
"modified_at": { "type": "number" },
|
|
67
|
-
"credential_fields": {
|
|
68
|
-
"type": "array",
|
|
69
|
-
"items": { "$ref": "#/types/CredentialField" },
|
|
70
|
-
"description": "Schema for the connector's credential form."
|
|
71
|
-
},
|
|
72
|
-
"health_history": {
|
|
73
|
-
"type": "array",
|
|
74
|
-
"items": { "$ref": "#/types/HealthCheckResult" },
|
|
75
|
-
"description": "Recent health check history (most recent first)."
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"required": ["id", "fullname", "connector_type", "extension", "status", "enabled", "created_at", "modified_at", "credential_fields", "health_history"]
|
|
79
|
-
},
|
|
80
|
-
"ConnectorTypeInfo": {
|
|
81
|
-
"type": "object",
|
|
82
|
-
"description": "Catalog entry for a connector type (not an instance).",
|
|
83
|
-
"properties": {
|
|
84
|
-
"type": { "type": "string", "description": "Unique type identifier." },
|
|
85
|
-
"name": { "type": "string", "description": "Display name." },
|
|
86
|
-
"extension": { "type": "string" },
|
|
87
|
-
"credential_fields": {
|
|
88
|
-
"type": "array",
|
|
89
|
-
"items": { "$ref": "#/types/CredentialField" }
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
"required": ["type", "name", "extension", "credential_fields"]
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
"x-ai-purpose": "These types are used when building connector management pages (list, detail, configuration). They are NOT part of the PageContract block system — connectors are a separate subsystem with its own pages that happen to use the same block types (dense_table for lists, detail_panel for details, form_panel for configuration)."
|
|
97
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://ui-docs.middag.io/schemas/navigation.json",
|
|
4
|
-
"title": "MIDDAG Navigation Contract",
|
|
5
|
-
"description": "TypeScript contract for the sidebar navigation tree. Serialized from PHP navigation_registry during boot(). Consumed by ProductShell's SidebarNav component via usePage().props.navigation.",
|
|
6
|
-
|
|
7
|
-
"types": {
|
|
8
|
-
"NavigationEntityType": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"enum": [
|
|
11
|
-
"connector", "workflow", "segment", "instancegroup", "condition",
|
|
12
|
-
"compliance", "offering", "order", "course", "form", "certificate"
|
|
13
|
-
],
|
|
14
|
-
"description": "Entity types for automatic icon resolution. When a NavigationNode has entityType set but no explicit icon, the Icon Registry resolves the icon from registerEntityIcon() mappings.",
|
|
15
|
-
"x-ai-purpose": "Use entityType instead of icon when the node represents a known entity. The icon registry will automatically resolve the correct icon, ensuring visual consistency across the app."
|
|
16
|
-
},
|
|
17
|
-
"NavigationNode": {
|
|
18
|
-
"type": "object",
|
|
19
|
-
"description": "A single node in the navigation tree. Can be a leaf (link) or a branch (group with children).",
|
|
20
|
-
"properties": {
|
|
21
|
-
"key": { "type": "string", "description": "Unique identifier within the tree." },
|
|
22
|
-
"label": { "type": "string", "description": "Display text." },
|
|
23
|
-
"icon": { "type": "string", "description": "Lucide icon name (kebab-case, e.g. 'graduation-cap'). Optional if entityType is set." },
|
|
24
|
-
"entityType": { "$ref": "#/types/NavigationEntityType", "description": "Entity type for automatic icon resolution via Icon Registry." },
|
|
25
|
-
"href": { "type": "string", "description": "Navigation URL. Omit for non-navigable group headers." },
|
|
26
|
-
"badge": { "type": ["string", "number"], "description": "Badge content (count or text)." },
|
|
27
|
-
"badgeVariant": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"enum": ["count", "alert"],
|
|
30
|
-
"description": "'count' shows muted text (default). 'alert' shows a red pill badge."
|
|
31
|
-
},
|
|
32
|
-
"active": { "type": "boolean", "description": "Whether this node is the current page." },
|
|
33
|
-
"drilldown": { "type": "boolean", "description": "When true, clicking replaces sidebar with this node's children + back button." },
|
|
34
|
-
"collapsible": { "type": "boolean", "description": "When true, group renders with expand/collapse toggle." },
|
|
35
|
-
"defaultOpen": { "type": "boolean", "description": "Whether a collapsible group starts expanded (default: false)." },
|
|
36
|
-
"statusColor": { "type": "string", "description": "CSS color for status dot next to drilldown title (e.g. 'var(--success)')." },
|
|
37
|
-
"target": { "type": "string", "description": "Link target attribute. External URLs (http/https) auto-detect '_blank'." },
|
|
38
|
-
"children": {
|
|
39
|
-
"type": "array",
|
|
40
|
-
"items": { "$ref": "#/types/NavigationNode" },
|
|
41
|
-
"description": "Child nodes (subtree)."
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"required": ["key", "label"]
|
|
45
|
-
},
|
|
46
|
-
"NavigationTreePayload": {
|
|
47
|
-
"type": "object",
|
|
48
|
-
"description": "The complete navigation payload sent via Inertia shared props. Contains the tree, active node key, drilldown state, and persistent footer items.",
|
|
49
|
-
"properties": {
|
|
50
|
-
"tree": {
|
|
51
|
-
"type": "array",
|
|
52
|
-
"items": { "$ref": "#/types/NavigationNode" },
|
|
53
|
-
"description": "Root-level navigation nodes (sidebar sections)."
|
|
54
|
-
},
|
|
55
|
-
"activeKey": { "type": "string", "description": "Key of the currently active navigation node." },
|
|
56
|
-
"drilldownStack": {
|
|
57
|
-
"type": "array",
|
|
58
|
-
"items": { "type": "string" },
|
|
59
|
-
"description": "Stack of drilled-down node keys for back navigation."
|
|
60
|
-
},
|
|
61
|
-
"footer": {
|
|
62
|
-
"type": "array",
|
|
63
|
-
"items": { "$ref": "#/types/NavigationNode" },
|
|
64
|
-
"description": "Persistent footer items (Settings, Help) always visible at sidebar bottom."
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"required": ["tree", "activeKey", "footer"]
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
"x-ai-purpose": "These types describe the sidebar navigation structure. The tree is built server-side (PHP navigation_registry) and sent to the frontend via Inertia shared props. AI agents should understand this tree structure when generating pages that include navigation context. The Icon Registry (registerEntityIcon) auto-resolves icons for known entity types."
|
|
72
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connectors VOs — TypeScript mirror of PHP VOs in
|
|
3
|
-
* `classes/extensions/core/connectors/connector/*`.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type ConnectorStatus =
|
|
7
|
-
| "unconfigured"
|
|
8
|
-
| "configured"
|
|
9
|
-
| "connected"
|
|
10
|
-
| "degraded"
|
|
11
|
-
| "disconnected";
|
|
12
|
-
|
|
13
|
-
export interface CredentialField {
|
|
14
|
-
key: string;
|
|
15
|
-
label: string;
|
|
16
|
-
type: "text" | "password" | "url" | "select";
|
|
17
|
-
required?: boolean;
|
|
18
|
-
placeholder?: string | null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface HealthCheckResult {
|
|
22
|
-
success: boolean;
|
|
23
|
-
latency_ms: number | null;
|
|
24
|
-
error_message: string | null;
|
|
25
|
-
resulting_status: string;
|
|
26
|
-
checked_at: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface ConnectorListItem {
|
|
30
|
-
id: number;
|
|
31
|
-
fullname: string;
|
|
32
|
-
connector_type: string;
|
|
33
|
-
extension: string;
|
|
34
|
-
status: ConnectorStatus;
|
|
35
|
-
enabled: boolean;
|
|
36
|
-
last_check_at: number | null;
|
|
37
|
-
latency_ms: number | null;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface ConnectorDetail {
|
|
41
|
-
id: number;
|
|
42
|
-
fullname: string;
|
|
43
|
-
description: string | null;
|
|
44
|
-
connector_type: string;
|
|
45
|
-
endpoint: string | null;
|
|
46
|
-
extension: string;
|
|
47
|
-
status: ConnectorStatus;
|
|
48
|
-
enabled: boolean;
|
|
49
|
-
created_at: number;
|
|
50
|
-
modified_at: number;
|
|
51
|
-
credential_fields: CredentialField[];
|
|
52
|
-
health_history: HealthCheckResult[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface ConnectorTypeInfo {
|
|
56
|
-
type: string;
|
|
57
|
-
name: string;
|
|
58
|
-
extension: string;
|
|
59
|
-
credential_fields: CredentialField[];
|
|
60
|
-
}
|