@mobile-reality/mdma-spec 0.3.1 → 0.5.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/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/blueprint-manifest.d.ts +2 -2
- package/dist/schemas/components/chart.d.ts +18 -3
- package/dist/schemas/components/chart.d.ts.map +1 -1
- package/dist/schemas/components/chart.js +2 -1
- package/dist/schemas/components/chart.js.map +1 -1
- package/dist/schemas/components/custom.d.ts +46 -0
- package/dist/schemas/components/custom.d.ts.map +1 -0
- package/dist/schemas/components/custom.js +23 -0
- package/dist/schemas/components/custom.js.map +1 -0
- package/dist/schemas/components/form.d.ts +35 -2
- package/dist/schemas/components/form.d.ts.map +1 -1
- package/dist/schemas/components/form.js +6 -1
- package/dist/schemas/components/form.js.map +1 -1
- package/dist/schemas/components/index.d.ts +94 -11
- package/dist/schemas/components/index.d.ts.map +1 -1
- package/dist/schemas/components/index.js +5 -0
- package/dist/schemas/components/index.js.map +1 -1
- package/dist/schemas/components/table.d.ts +19 -4
- package/dist/schemas/components/table.d.ts.map +1 -1
- package/dist/schemas/components/table.js +2 -1
- package/dist/schemas/components/table.js.map +1 -1
- package/dist/schemas/components/tasklist.d.ts +3 -3
- package/dist/schemas/data-source.d.ts +149 -0
- package/dist/schemas/data-source.d.ts.map +1 -0
- package/dist/schemas/data-source.js +44 -0
- package/dist/schemas/data-source.js.map +1 -0
- package/dist/schemas/document.d.ts +2 -2
- package/dist/schemas/event-log.d.ts +4 -4
- package/dist/schemas/event-log.d.ts.map +1 -1
- package/dist/schemas/event-log.js +3 -0
- package/dist/schemas/event-log.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export { MDMA_LANG_TAG, MDMA_SPEC_VERSION } from './constants.js';
|
|
2
2
|
export { ComponentBaseSchema } from './schemas/component-base.js';
|
|
3
3
|
export { BindingExpressionSchema, bindable } from './schemas/binding.js';
|
|
4
|
-
export {
|
|
4
|
+
export { DataSourceRefSchema, DataSourceDescriptorSchema, DataSourceColumnDescriptorSchema, DataSourceParamDescriptorSchema, isDataSourceRef, defineDataSource, indexDataSources, } from './schemas/data-source.js';
|
|
5
|
+
export { MdmaComponentSchema, FormComponentSchema, ButtonComponentSchema, TasklistComponentSchema, TableComponentSchema, CalloutComponentSchema, ApprovalGateComponentSchema, WebhookComponentSchema, ChartComponentSchema, ThinkingComponentSchema, CustomComponentSchema, componentSchemaRegistry, COMPONENT_TYPES, } from './schemas/components/index.js';
|
|
5
6
|
export { EventLogEntrySchema, EventTypeSchema, EventActorSchema } from './schemas/event-log.js';
|
|
6
7
|
export { PolicySchema, PolicyRuleSchema } from './schemas/policy.js';
|
|
7
8
|
export { DocumentMetadataSchema } from './schemas/document.js';
|
|
8
9
|
export { BlueprintManifestSchema, BlueprintMaturitySchema } from './schemas/blueprint-manifest.js';
|
|
9
|
-
export type { MdmaBlock, MdmaRoot, StoreAction, AttachableDefinition, ComponentBase, BindingExpression, MdmaComponent, ComponentType, FormComponent, FormField, ButtonComponent, TasklistComponent, TaskItem, TableComponent, TableColumn, CalloutComponent, ApprovalGateComponent, WebhookComponent, ChartComponent, ThinkingComponent, EventLogEntry, EventType, EventActor, Policy, PolicyRule, DocumentMetadata, BlueprintManifest, BlueprintMaturity, } from './types/index.js';
|
|
10
|
+
export type { MdmaBlock, MdmaRoot, StoreAction, AttachableDefinition, ComponentBase, BindingExpression, MdmaComponent, ComponentType, FormComponent, FormField, ButtonComponent, TasklistComponent, TaskItem, TableComponent, TableColumn, CalloutComponent, ApprovalGateComponent, WebhookComponent, ChartComponent, ThinkingComponent, CustomComponent, EventLogEntry, EventType, EventActor, Policy, PolicyRule, DocumentMetadata, BlueprintManifest, BlueprintMaturity, DataSourceRef, DataSourceParamValue, DataSourceDescriptor, DataSourceColumnDescriptor, DataSourceParamDescriptor, DataSourceDefinition, DataSourceResolver, DataSourceRequest, DataSourceResult, DataSourceSort, DataSourceSortDirection, } from './types/index.js';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGlE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAGnG,YAAY,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,S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EACf,aAAa,EACb,SAAS,EACT,UAAU,EACV,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,8 @@ export { MDMA_LANG_TAG, MDMA_SPEC_VERSION } from './constants.js';
|
|
|
3
3
|
// Schemas
|
|
4
4
|
export { ComponentBaseSchema } from './schemas/component-base.js';
|
|
5
5
|
export { BindingExpressionSchema, bindable } from './schemas/binding.js';
|
|
6
|
-
export {
|
|
6
|
+
export { DataSourceRefSchema, DataSourceDescriptorSchema, DataSourceColumnDescriptorSchema, DataSourceParamDescriptorSchema, isDataSourceRef, defineDataSource, indexDataSources, } from './schemas/data-source.js';
|
|
7
|
+
export { MdmaComponentSchema, FormComponentSchema, ButtonComponentSchema, TasklistComponentSchema, TableComponentSchema, CalloutComponentSchema, ApprovalGateComponentSchema, WebhookComponentSchema, ChartComponentSchema, ThinkingComponentSchema, CustomComponentSchema, componentSchemaRegistry, COMPONENT_TYPES, } from './schemas/components/index.js';
|
|
7
8
|
export { EventLogEntrySchema, EventTypeSchema, EventActorSchema } from './schemas/event-log.js';
|
|
8
9
|
export { PolicySchema, PolicyRuleSchema } from './schemas/policy.js';
|
|
9
10
|
export { DocumentMetadataSchema } from './schemas/document.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAElE,UAAU;AACV,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;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,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -80,8 +80,8 @@ export declare const BlueprintManifestSchema: z.ZodObject<{
|
|
|
80
80
|
docs?: string[] | undefined;
|
|
81
81
|
}>>;
|
|
82
82
|
}, "strip", z.ZodTypeAny, {
|
|
83
|
-
name: string;
|
|
84
83
|
description: string;
|
|
84
|
+
name: string;
|
|
85
85
|
version: string;
|
|
86
86
|
domain: string;
|
|
87
87
|
maturity: "experimental" | "stable" | "enterprise-ready";
|
|
@@ -101,8 +101,8 @@ export declare const BlueprintManifestSchema: z.ZodObject<{
|
|
|
101
101
|
docs?: string[] | undefined;
|
|
102
102
|
} | undefined;
|
|
103
103
|
}, {
|
|
104
|
-
name: string;
|
|
105
104
|
description: string;
|
|
105
|
+
name: string;
|
|
106
106
|
version: string;
|
|
107
107
|
domain: string;
|
|
108
108
|
maturity: "experimental" | "stable" | "enterprise-ready";
|
|
@@ -9,7 +9,16 @@ export declare const ChartComponentSchema: z.ZodObject<{
|
|
|
9
9
|
} & {
|
|
10
10
|
type: z.ZodLiteral<"chart">;
|
|
11
11
|
variant: z.ZodDefault<z.ZodEnum<["line", "bar", "area", "pie"]>>;
|
|
12
|
-
data: z.ZodUnion<[z.ZodString, z.ZodString
|
|
12
|
+
data: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodObject<{
|
|
13
|
+
source: z.ZodString;
|
|
14
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
source: string;
|
|
17
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
source: string;
|
|
20
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
21
|
+
}>]>;
|
|
13
22
|
xAxis: z.ZodOptional<z.ZodString>;
|
|
14
23
|
yAxis: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
15
24
|
colors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -24,7 +33,10 @@ export declare const ChartComponentSchema: z.ZodObject<{
|
|
|
24
33
|
disabled: string | boolean;
|
|
25
34
|
visible: string | boolean;
|
|
26
35
|
variant: "line" | "bar" | "area" | "pie";
|
|
27
|
-
data: string
|
|
36
|
+
data: string | {
|
|
37
|
+
source: string;
|
|
38
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
39
|
+
};
|
|
28
40
|
showLegend: boolean;
|
|
29
41
|
showGrid: boolean;
|
|
30
42
|
height: number;
|
|
@@ -37,7 +49,10 @@ export declare const ChartComponentSchema: z.ZodObject<{
|
|
|
37
49
|
}, {
|
|
38
50
|
type: "chart";
|
|
39
51
|
id: string;
|
|
40
|
-
data: string
|
|
52
|
+
data: string | {
|
|
53
|
+
source: string;
|
|
54
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
55
|
+
};
|
|
41
56
|
label?: string | undefined;
|
|
42
57
|
sensitive?: boolean | undefined;
|
|
43
58
|
disabled?: string | boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ComponentBaseSchema } from '../component-base.js';
|
|
3
3
|
import { BindingExpressionSchema } from '../binding.js';
|
|
4
|
+
import { DataSourceRefSchema } from '../data-source.js';
|
|
4
5
|
export const ChartComponentSchema = ComponentBaseSchema.extend({
|
|
5
6
|
type: z.literal('chart'),
|
|
6
7
|
variant: z.enum(['line', 'bar', 'area', 'pie']).default('line'),
|
|
7
|
-
data: z.union([z.string(), BindingExpressionSchema]),
|
|
8
|
+
data: z.union([z.string(), BindingExpressionSchema, DataSourceRefSchema]),
|
|
8
9
|
xAxis: z.string().optional(),
|
|
9
10
|
yAxis: z.union([z.string(), z.array(z.string())]).optional(),
|
|
10
11
|
colors: z.array(z.string()).optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../../../src/schemas/components/chart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC/D,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,uBAAu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AAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACpC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A host-extensible component. `custom` is a stable envelope that core always
|
|
4
|
+
* understands; the `name` selects which host-registered variant to render and
|
|
5
|
+
* validate. `props` is intentionally open so the schema stays maximally
|
|
6
|
+
* flexible — a host tightens it per `name` by registering a props schema (see
|
|
7
|
+
* the parser's `customSchemas`), and describes it to the model via the prompt
|
|
8
|
+
* catalog. Presentation lives entirely in the host renderer, never here.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CustomComponentSchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
label: z.ZodOptional<z.ZodString>;
|
|
13
|
+
sensitive: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
disabled: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
15
|
+
visible: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
16
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
17
|
+
} & {
|
|
18
|
+
type: z.ZodLiteral<"custom">;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
+
actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
type: "custom";
|
|
24
|
+
id: string;
|
|
25
|
+
sensitive: boolean;
|
|
26
|
+
disabled: string | boolean;
|
|
27
|
+
visible: string | boolean;
|
|
28
|
+
name: string;
|
|
29
|
+
props: Record<string, unknown>;
|
|
30
|
+
label?: string | undefined;
|
|
31
|
+
meta?: Record<string, unknown> | undefined;
|
|
32
|
+
actions?: Record<string, string> | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
type: "custom";
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
label?: string | undefined;
|
|
38
|
+
sensitive?: boolean | undefined;
|
|
39
|
+
disabled?: string | boolean | undefined;
|
|
40
|
+
visible?: string | boolean | undefined;
|
|
41
|
+
meta?: Record<string, unknown> | undefined;
|
|
42
|
+
props?: Record<string, unknown> | undefined;
|
|
43
|
+
actions?: Record<string, string> | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export type CustomComponent = z.infer<typeof CustomComponentSchema>;
|
|
46
|
+
//# sourceMappingURL=custom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/custom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ComponentBaseSchema } from '../component-base.js';
|
|
3
|
+
/**
|
|
4
|
+
* A host-extensible component. `custom` is a stable envelope that core always
|
|
5
|
+
* understands; the `name` selects which host-registered variant to render and
|
|
6
|
+
* validate. `props` is intentionally open so the schema stays maximally
|
|
7
|
+
* flexible — a host tightens it per `name` by registering a props schema (see
|
|
8
|
+
* the parser's `customSchemas`), and describes it to the model via the prompt
|
|
9
|
+
* catalog. Presentation lives entirely in the host renderer, never here.
|
|
10
|
+
*/
|
|
11
|
+
export const CustomComponentSchema = ComponentBaseSchema.extend({
|
|
12
|
+
type: z.literal('custom'),
|
|
13
|
+
name: z.string().min(1).describe('Registered custom component variant, e.g. "signature-pad"'),
|
|
14
|
+
props: z
|
|
15
|
+
.record(z.unknown())
|
|
16
|
+
.default({})
|
|
17
|
+
.describe('Intent payload for the variant; validated per `name` by the host'),
|
|
18
|
+
actions: z
|
|
19
|
+
.record(z.string())
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('Maps a variant event (e.g. "onCapture") to an action label'),
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=custom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom.js","sourceRoot":"","sources":["../../../src/schemas/components/custom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC9D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,2DAA2D,CAAC;IAC7F,KAAK,EAAE,CAAC;SACL,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,kEAAkE,CAAC;IAC/E,OAAO,EAAE,CAAC;SACP,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SAClB,QAAQ,EAAE;SACV,QAAQ,CAAC,4DAA4D,CAAC;CAC1E,CAAC,CAAC"}
|
|
@@ -15,7 +15,19 @@ export declare const FormFieldSchema: z.ZodObject<{
|
|
|
15
15
|
}, {
|
|
16
16
|
value: string;
|
|
17
17
|
label: string;
|
|
18
|
-
}>, "many">, z.ZodString
|
|
18
|
+
}>, "many">, z.ZodString, z.ZodObject<{
|
|
19
|
+
source: z.ZodString;
|
|
20
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
source: string;
|
|
23
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
source: string;
|
|
26
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
27
|
+
}>]>>, string | {
|
|
28
|
+
source: string;
|
|
29
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
30
|
+
} | {
|
|
19
31
|
value: string;
|
|
20
32
|
label: string;
|
|
21
33
|
}[] | undefined, unknown>;
|
|
@@ -43,6 +55,9 @@ export declare const FormFieldSchema: z.ZodObject<{
|
|
|
43
55
|
name: string;
|
|
44
56
|
required: boolean;
|
|
45
57
|
options?: string | {
|
|
58
|
+
source: string;
|
|
59
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
60
|
+
} | {
|
|
46
61
|
value: string;
|
|
47
62
|
label: string;
|
|
48
63
|
}[] | undefined;
|
|
@@ -95,7 +110,19 @@ export declare const FormComponentSchema: z.ZodObject<{
|
|
|
95
110
|
}, {
|
|
96
111
|
value: string;
|
|
97
112
|
label: string;
|
|
98
|
-
}>, "many">, z.ZodString
|
|
113
|
+
}>, "many">, z.ZodString, z.ZodObject<{
|
|
114
|
+
source: z.ZodString;
|
|
115
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
source: string;
|
|
118
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
source: string;
|
|
121
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
122
|
+
}>]>>, string | {
|
|
123
|
+
source: string;
|
|
124
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
125
|
+
} | {
|
|
99
126
|
value: string;
|
|
100
127
|
label: string;
|
|
101
128
|
}[] | undefined, unknown>;
|
|
@@ -123,6 +150,9 @@ export declare const FormComponentSchema: z.ZodObject<{
|
|
|
123
150
|
name: string;
|
|
124
151
|
required: boolean;
|
|
125
152
|
options?: string | {
|
|
153
|
+
source: string;
|
|
154
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
155
|
+
} | {
|
|
126
156
|
value: string;
|
|
127
157
|
label: string;
|
|
128
158
|
}[] | undefined;
|
|
@@ -164,6 +194,9 @@ export declare const FormComponentSchema: z.ZodObject<{
|
|
|
164
194
|
name: string;
|
|
165
195
|
required: boolean;
|
|
166
196
|
options?: string | {
|
|
197
|
+
source: string;
|
|
198
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
199
|
+
} | {
|
|
167
200
|
value: string;
|
|
168
201
|
label: string;
|
|
169
202
|
}[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B1B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ComponentBaseSchema } from '../component-base.js';
|
|
3
3
|
import { BindingExpressionSchema } from '../binding.js';
|
|
4
|
+
import { DataSourceRefSchema } from '../data-source.js';
|
|
4
5
|
export const FormFieldSchema = z.object({
|
|
5
6
|
name: z.string().min(1),
|
|
6
7
|
type: z.enum(['text', 'number', 'email', 'date', 'select', 'checkbox', 'textarea', 'file']),
|
|
@@ -13,7 +14,11 @@ export const FormFieldSchema = z.object({
|
|
|
13
14
|
return val;
|
|
14
15
|
return val.map((item) => (typeof item === 'string' ? { label: item, value: item } : item));
|
|
15
16
|
}, z
|
|
16
|
-
.union([
|
|
17
|
+
.union([
|
|
18
|
+
z.array(z.object({ label: z.string(), value: z.string() })),
|
|
19
|
+
z.string().min(1),
|
|
20
|
+
DataSourceRefSchema,
|
|
21
|
+
])
|
|
17
22
|
.optional()),
|
|
18
23
|
validation: z
|
|
19
24
|
.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../../src/schemas/components/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAA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AAQ,EAAE;IACb,IAAI,EAAE,uBAAuB,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CAChE,CAAC,CAAC"}
|
|
@@ -8,6 +8,7 @@ export { ApprovalGateComponentSchema, type ApprovalGateComponent, } from './appr
|
|
|
8
8
|
export { WebhookComponentSchema, type WebhookComponent } from './webhook.js';
|
|
9
9
|
export { ChartComponentSchema, type ChartComponent } from './chart.js';
|
|
10
10
|
export { ThinkingComponentSchema, type ThinkingComponent } from './thinking.js';
|
|
11
|
+
export { CustomComponentSchema, type CustomComponent } from './custom.js';
|
|
11
12
|
export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
12
13
|
id: z.ZodString;
|
|
13
14
|
label: z.ZodOptional<z.ZodString>;
|
|
@@ -33,7 +34,19 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
33
34
|
}, {
|
|
34
35
|
value: string;
|
|
35
36
|
label: string;
|
|
36
|
-
}>, "many">, z.ZodString
|
|
37
|
+
}>, "many">, z.ZodString, z.ZodObject<{
|
|
38
|
+
source: z.ZodString;
|
|
39
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
source: string;
|
|
42
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
source: string;
|
|
45
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
46
|
+
}>]>>, string | {
|
|
47
|
+
source: string;
|
|
48
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
49
|
+
} | {
|
|
37
50
|
value: string;
|
|
38
51
|
label: string;
|
|
39
52
|
}[] | undefined, unknown>;
|
|
@@ -61,6 +74,9 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
61
74
|
name: string;
|
|
62
75
|
required: boolean;
|
|
63
76
|
options?: string | {
|
|
77
|
+
source: string;
|
|
78
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
79
|
+
} | {
|
|
64
80
|
value: string;
|
|
65
81
|
label: string;
|
|
66
82
|
}[] | undefined;
|
|
@@ -102,6 +118,9 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
102
118
|
name: string;
|
|
103
119
|
required: boolean;
|
|
104
120
|
options?: string | {
|
|
121
|
+
source: string;
|
|
122
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
123
|
+
} | {
|
|
105
124
|
value: string;
|
|
106
125
|
label: string;
|
|
107
126
|
}[] | undefined;
|
|
@@ -221,8 +240,8 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
221
240
|
bind: z.ZodOptional<z.ZodString>;
|
|
222
241
|
}, "strip", z.ZodTypeAny, {
|
|
223
242
|
id: string;
|
|
224
|
-
text: string;
|
|
225
243
|
required: boolean;
|
|
244
|
+
text: string;
|
|
226
245
|
checked: boolean;
|
|
227
246
|
bind?: string | undefined;
|
|
228
247
|
}, {
|
|
@@ -241,8 +260,8 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
241
260
|
visible: string | boolean;
|
|
242
261
|
items: {
|
|
243
262
|
id: string;
|
|
244
|
-
text: string;
|
|
245
263
|
required: boolean;
|
|
264
|
+
text: string;
|
|
246
265
|
checked: boolean;
|
|
247
266
|
bind?: string | undefined;
|
|
248
267
|
}[];
|
|
@@ -299,7 +318,16 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
299
318
|
sortable: boolean;
|
|
300
319
|
width?: string | undefined;
|
|
301
320
|
}, unknown>, "many">;
|
|
302
|
-
data: z.ZodUnion<[z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">, z.ZodString
|
|
321
|
+
data: z.ZodUnion<[z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">, z.ZodString, z.ZodObject<{
|
|
322
|
+
source: z.ZodString;
|
|
323
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
324
|
+
}, "strip", z.ZodTypeAny, {
|
|
325
|
+
source: string;
|
|
326
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
327
|
+
}, {
|
|
328
|
+
source: string;
|
|
329
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
330
|
+
}>]>;
|
|
303
331
|
sortable: z.ZodDefault<z.ZodBoolean>;
|
|
304
332
|
filterable: z.ZodDefault<z.ZodBoolean>;
|
|
305
333
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -309,7 +337,6 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
309
337
|
sensitive: boolean;
|
|
310
338
|
disabled: string | boolean;
|
|
311
339
|
visible: string | boolean;
|
|
312
|
-
sortable: boolean;
|
|
313
340
|
columns: {
|
|
314
341
|
sensitive: boolean;
|
|
315
342
|
key: string;
|
|
@@ -317,7 +344,11 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
317
344
|
sortable: boolean;
|
|
318
345
|
width?: string | undefined;
|
|
319
346
|
}[];
|
|
320
|
-
|
|
347
|
+
sortable: boolean;
|
|
348
|
+
data: string | {
|
|
349
|
+
source: string;
|
|
350
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
351
|
+
} | Record<string, unknown>[];
|
|
321
352
|
filterable: boolean;
|
|
322
353
|
label?: string | undefined;
|
|
323
354
|
meta?: Record<string, unknown> | undefined;
|
|
@@ -326,7 +357,10 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
326
357
|
type: "table";
|
|
327
358
|
id: string;
|
|
328
359
|
columns: unknown[];
|
|
329
|
-
data: string |
|
|
360
|
+
data: string | {
|
|
361
|
+
source: string;
|
|
362
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
363
|
+
} | Record<string, unknown>[];
|
|
330
364
|
label?: string | undefined;
|
|
331
365
|
sensitive?: boolean | undefined;
|
|
332
366
|
disabled?: string | boolean | undefined;
|
|
@@ -474,7 +508,16 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
474
508
|
} & {
|
|
475
509
|
type: z.ZodLiteral<"chart">;
|
|
476
510
|
variant: z.ZodDefault<z.ZodEnum<["line", "bar", "area", "pie"]>>;
|
|
477
|
-
data: z.ZodUnion<[z.ZodString, z.ZodString
|
|
511
|
+
data: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodObject<{
|
|
512
|
+
source: z.ZodString;
|
|
513
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
514
|
+
}, "strip", z.ZodTypeAny, {
|
|
515
|
+
source: string;
|
|
516
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
517
|
+
}, {
|
|
518
|
+
source: string;
|
|
519
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
520
|
+
}>]>;
|
|
478
521
|
xAxis: z.ZodOptional<z.ZodString>;
|
|
479
522
|
yAxis: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
480
523
|
colors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -489,7 +532,10 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
489
532
|
disabled: string | boolean;
|
|
490
533
|
visible: string | boolean;
|
|
491
534
|
variant: "line" | "bar" | "area" | "pie";
|
|
492
|
-
data: string
|
|
535
|
+
data: string | {
|
|
536
|
+
source: string;
|
|
537
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
538
|
+
};
|
|
493
539
|
showLegend: boolean;
|
|
494
540
|
showGrid: boolean;
|
|
495
541
|
height: number;
|
|
@@ -502,7 +548,10 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
502
548
|
}, {
|
|
503
549
|
type: "chart";
|
|
504
550
|
id: string;
|
|
505
|
-
data: string
|
|
551
|
+
data: string | {
|
|
552
|
+
source: string;
|
|
553
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
554
|
+
};
|
|
506
555
|
label?: string | undefined;
|
|
507
556
|
sensitive?: boolean | undefined;
|
|
508
557
|
disabled?: string | boolean | undefined;
|
|
@@ -550,9 +599,43 @@ export declare const MdmaComponentSchema: z.ZodDiscriminatedUnion<"type", [z.Zod
|
|
|
550
599
|
visible?: string | boolean | undefined;
|
|
551
600
|
meta?: Record<string, unknown> | undefined;
|
|
552
601
|
collapsed?: boolean | undefined;
|
|
602
|
+
}>, z.ZodObject<{
|
|
603
|
+
id: z.ZodString;
|
|
604
|
+
label: z.ZodOptional<z.ZodString>;
|
|
605
|
+
sensitive: z.ZodDefault<z.ZodBoolean>;
|
|
606
|
+
disabled: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
607
|
+
visible: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
608
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
609
|
+
} & {
|
|
610
|
+
type: z.ZodLiteral<"custom">;
|
|
611
|
+
name: z.ZodString;
|
|
612
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
613
|
+
actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
614
|
+
}, "strip", z.ZodTypeAny, {
|
|
615
|
+
type: "custom";
|
|
616
|
+
id: string;
|
|
617
|
+
sensitive: boolean;
|
|
618
|
+
disabled: string | boolean;
|
|
619
|
+
visible: string | boolean;
|
|
620
|
+
name: string;
|
|
621
|
+
props: Record<string, unknown>;
|
|
622
|
+
label?: string | undefined;
|
|
623
|
+
meta?: Record<string, unknown> | undefined;
|
|
624
|
+
actions?: Record<string, string> | undefined;
|
|
625
|
+
}, {
|
|
626
|
+
type: "custom";
|
|
627
|
+
id: string;
|
|
628
|
+
name: string;
|
|
629
|
+
label?: string | undefined;
|
|
630
|
+
sensitive?: boolean | undefined;
|
|
631
|
+
disabled?: string | boolean | undefined;
|
|
632
|
+
visible?: string | boolean | undefined;
|
|
633
|
+
meta?: Record<string, unknown> | undefined;
|
|
634
|
+
props?: Record<string, unknown> | undefined;
|
|
635
|
+
actions?: Record<string, string> | undefined;
|
|
553
636
|
}>]>;
|
|
554
637
|
export type MdmaComponent = z.infer<typeof MdmaComponentSchema>;
|
|
555
|
-
export declare const COMPONENT_TYPES: readonly ["form", "button", "tasklist", "table", "callout", "approval-gate", "webhook", "chart", "thinking"];
|
|
638
|
+
export declare const COMPONENT_TYPES: readonly ["form", "button", "tasklist", "table", "callout", "approval-gate", "webhook", "chart", "thinking", "custom"];
|
|
556
639
|
export type ComponentType = (typeof COMPONENT_TYPES)[number];
|
|
557
640
|
/** Registry mapping component type names to their Zod schemas */
|
|
558
641
|
export declare const componentSchemaRegistry: Map<string, z.ZodType<any, z.ZodTypeDef, any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/index.ts"],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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAW9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,eAAe,wHAWlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,iEAAiE;AACjE,eAAO,MAAM,uBAAuB,gDAWlC,CAAC"}
|
|
@@ -8,6 +8,7 @@ import { ApprovalGateComponentSchema } from './approval-gate.js';
|
|
|
8
8
|
import { WebhookComponentSchema } from './webhook.js';
|
|
9
9
|
import { ChartComponentSchema } from './chart.js';
|
|
10
10
|
import { ThinkingComponentSchema } from './thinking.js';
|
|
11
|
+
import { CustomComponentSchema } from './custom.js';
|
|
11
12
|
export { FormComponentSchema } from './form.js';
|
|
12
13
|
export { ButtonComponentSchema } from './button.js';
|
|
13
14
|
export { TasklistComponentSchema, } from './tasklist.js';
|
|
@@ -17,6 +18,7 @@ export { ApprovalGateComponentSchema, } from './approval-gate.js';
|
|
|
17
18
|
export { WebhookComponentSchema } from './webhook.js';
|
|
18
19
|
export { ChartComponentSchema } from './chart.js';
|
|
19
20
|
export { ThinkingComponentSchema } from './thinking.js';
|
|
21
|
+
export { CustomComponentSchema } from './custom.js';
|
|
20
22
|
export const MdmaComponentSchema = z.discriminatedUnion('type', [
|
|
21
23
|
FormComponentSchema,
|
|
22
24
|
ButtonComponentSchema,
|
|
@@ -27,6 +29,7 @@ export const MdmaComponentSchema = z.discriminatedUnion('type', [
|
|
|
27
29
|
WebhookComponentSchema,
|
|
28
30
|
ChartComponentSchema,
|
|
29
31
|
ThinkingComponentSchema,
|
|
32
|
+
CustomComponentSchema,
|
|
30
33
|
]);
|
|
31
34
|
export const COMPONENT_TYPES = [
|
|
32
35
|
'form',
|
|
@@ -38,6 +41,7 @@ export const COMPONENT_TYPES = [
|
|
|
38
41
|
'webhook',
|
|
39
42
|
'chart',
|
|
40
43
|
'thinking',
|
|
44
|
+
'custom',
|
|
41
45
|
];
|
|
42
46
|
/** Registry mapping component type names to their Zod schemas */
|
|
43
47
|
export const componentSchemaRegistry = new Map([
|
|
@@ -50,5 +54,6 @@ export const componentSchemaRegistry = new Map([
|
|
|
50
54
|
['webhook', WebhookComponentSchema],
|
|
51
55
|
['chart', ChartComponentSchema],
|
|
52
56
|
['thinking', ThinkingComponentSchema],
|
|
57
|
+
['custom', CustomComponentSchema],
|
|
53
58
|
]);
|
|
54
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schemas/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO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AAM,YAAY,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAA0B,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAwB,MAAM,aAAa,CAAC;AAE1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC9D,mBAAmB;IACnB,qBAAqB;IACrB,uBAAuB;IACvB,oBAAoB;IACpB,sBAAsB;IACtB,2BAA2B;IAC3B,sBAAsB;IACtB,oBAAoB;IACpB,uBAAuB;IACvB,qBAAqB;CACtB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,SAAS;IACT,eAAe;IACf,SAAS;IACT,OAAO;IACP,UAAU;IACV,QAAQ;CACA,CAAC;AAIX,iEAAiE;AACjE,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAoB;IAChE,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAC7B,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACjC,CAAC,UAAU,EAAE,uBAAuB,CAAC;IACrC,CAAC,OAAO,EAAE,oBAAoB,CAAC;IAC/B,CAAC,SAAS,EAAE,sBAAsB,CAAC;IACnC,CAAC,eAAe,EAAE,2BAA2B,CAAC;IAC9C,CAAC,SAAS,EAAE,sBAAsB,CAAC;IACnC,CAAC,OAAO,EAAE,oBAAoB,CAAC;IAC/B,CAAC,UAAU,EAAE,uBAAuB,CAAC;IACrC,CAAC,QAAQ,EAAE,qBAAqB,CAAC;CAClC,CAAC,CAAC"}
|
|
@@ -58,7 +58,16 @@ export declare const TableComponentSchema: z.ZodObject<{
|
|
|
58
58
|
sortable: boolean;
|
|
59
59
|
width?: string | undefined;
|
|
60
60
|
}, unknown>, "many">;
|
|
61
|
-
data: z.ZodUnion<[z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">, z.ZodString
|
|
61
|
+
data: z.ZodUnion<[z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">, z.ZodString, z.ZodObject<{
|
|
62
|
+
source: z.ZodString;
|
|
63
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
source: string;
|
|
66
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
source: string;
|
|
69
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
70
|
+
}>]>;
|
|
62
71
|
sortable: z.ZodDefault<z.ZodBoolean>;
|
|
63
72
|
filterable: z.ZodDefault<z.ZodBoolean>;
|
|
64
73
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
@@ -68,7 +77,6 @@ export declare const TableComponentSchema: z.ZodObject<{
|
|
|
68
77
|
sensitive: boolean;
|
|
69
78
|
disabled: string | boolean;
|
|
70
79
|
visible: string | boolean;
|
|
71
|
-
sortable: boolean;
|
|
72
80
|
columns: {
|
|
73
81
|
sensitive: boolean;
|
|
74
82
|
key: string;
|
|
@@ -76,7 +84,11 @@ export declare const TableComponentSchema: z.ZodObject<{
|
|
|
76
84
|
sortable: boolean;
|
|
77
85
|
width?: string | undefined;
|
|
78
86
|
}[];
|
|
79
|
-
|
|
87
|
+
sortable: boolean;
|
|
88
|
+
data: string | {
|
|
89
|
+
source: string;
|
|
90
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
91
|
+
} | Record<string, unknown>[];
|
|
80
92
|
filterable: boolean;
|
|
81
93
|
label?: string | undefined;
|
|
82
94
|
meta?: Record<string, unknown> | undefined;
|
|
@@ -85,7 +97,10 @@ export declare const TableComponentSchema: z.ZodObject<{
|
|
|
85
97
|
type: "table";
|
|
86
98
|
id: string;
|
|
87
99
|
columns: unknown[];
|
|
88
|
-
data: string |
|
|
100
|
+
data: string | {
|
|
101
|
+
source: string;
|
|
102
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
103
|
+
} | Record<string, unknown>[];
|
|
89
104
|
label?: string | undefined;
|
|
90
105
|
sensitive?: boolean | undefined;
|
|
91
106
|
disabled?: string | boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/schemas/components/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;WAuB7B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO/B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ComponentBaseSchema } from '../component-base.js';
|
|
3
3
|
import { BindingExpressionSchema } from '../binding.js';
|
|
4
|
+
import { DataSourceRefSchema } from '../data-source.js';
|
|
4
5
|
export const TableColumnSchema = z.preprocess((val) => {
|
|
5
6
|
if (typeof val !== 'object' || val === null)
|
|
6
7
|
return val;
|
|
@@ -26,7 +27,7 @@ export const TableColumnSchema = z.preprocess((val) => {
|
|
|
26
27
|
export const TableComponentSchema = ComponentBaseSchema.extend({
|
|
27
28
|
type: z.literal('table'),
|
|
28
29
|
columns: z.array(TableColumnSchema).min(1),
|
|
29
|
-
data: z.union([z.array(z.record(z.unknown())), BindingExpressionSchema]),
|
|
30
|
+
data: z.union([z.array(z.record(z.unknown())), BindingExpressionSchema, DataSourceRefSchema]),
|
|
30
31
|
sortable: z.boolean().default(false),
|
|
31
32
|
filterable: z.boolean().default(false),
|
|
32
33
|
pageSize: z.number().positive().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../../src/schemas/components/table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,UAAU,CAC3C,CAAC,GAAG,EAAE,EAAE;IACN,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,GAAG,CAAC;IACxD,MAAM,GAAG,GAAG,GAA8B,CAAC;IAC3C,MAAM,MAAM,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC1B,6CAA6C;IAC7C,IAAI,OAAO,IAAI,MAAM,IAAI,CAAC,CAAC,KAAK,IAAI,MAAM,CAAC,EAAE,CAAC;QAC5C,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,CAAC;IACD,IAAI,OAAO,IAAI,MAAM,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;QAC7B,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,EACD,CAAC,CAAC,MAAM,CAAC;IACP,GAAG,EAAE,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AE,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;IAC7F,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACpC,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
|
|
@@ -7,8 +7,8 @@ export declare const TaskItemSchema: z.ZodObject<{
|
|
|
7
7
|
bind: z.ZodOptional<z.ZodString>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
9
|
id: string;
|
|
10
|
-
text: string;
|
|
11
10
|
required: boolean;
|
|
11
|
+
text: string;
|
|
12
12
|
checked: boolean;
|
|
13
13
|
bind?: string | undefined;
|
|
14
14
|
}, {
|
|
@@ -35,8 +35,8 @@ export declare const TasklistComponentSchema: z.ZodObject<{
|
|
|
35
35
|
bind: z.ZodOptional<z.ZodString>;
|
|
36
36
|
}, "strip", z.ZodTypeAny, {
|
|
37
37
|
id: string;
|
|
38
|
-
text: string;
|
|
39
38
|
required: boolean;
|
|
39
|
+
text: string;
|
|
40
40
|
checked: boolean;
|
|
41
41
|
bind?: string | undefined;
|
|
42
42
|
}, {
|
|
@@ -55,8 +55,8 @@ export declare const TasklistComponentSchema: z.ZodObject<{
|
|
|
55
55
|
visible: string | boolean;
|
|
56
56
|
items: {
|
|
57
57
|
id: string;
|
|
58
|
-
text: string;
|
|
59
58
|
required: boolean;
|
|
59
|
+
text: string;
|
|
60
60
|
checked: boolean;
|
|
61
61
|
bind?: string | undefined;
|
|
62
62
|
}[];
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const DataSourceParamValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
|
|
3
|
+
export declare const DataSourceRefSchema: z.ZodObject<{
|
|
4
|
+
source: z.ZodString;
|
|
5
|
+
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
source: string;
|
|
8
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
source: string;
|
|
11
|
+
params?: Record<string, string | number | boolean | null> | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
export type DataSourceParamValue = z.infer<typeof DataSourceParamValueSchema>;
|
|
14
|
+
export type DataSourceRef = z.infer<typeof DataSourceRefSchema>;
|
|
15
|
+
export declare function isDataSourceRef(value: unknown): value is DataSourceRef;
|
|
16
|
+
export declare const DataSourceColumnDescriptorSchema: z.ZodObject<{
|
|
17
|
+
key: z.ZodString;
|
|
18
|
+
type: z.ZodEnum<["string", "number", "boolean", "date"]>;
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
sensitive: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
type: "string" | "number" | "boolean" | "date";
|
|
23
|
+
sensitive: boolean;
|
|
24
|
+
key: string;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
type: "string" | "number" | "boolean" | "date";
|
|
28
|
+
key: string;
|
|
29
|
+
sensitive?: boolean | undefined;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const DataSourceParamDescriptorSchema: z.ZodObject<{
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
type: z.ZodEnum<["string", "number", "boolean"]>;
|
|
35
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
+
allowed: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
type: "string" | "number" | "boolean";
|
|
39
|
+
name: string;
|
|
40
|
+
required: boolean;
|
|
41
|
+
allowed?: (string | number | boolean)[] | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
type: "string" | "number" | "boolean";
|
|
44
|
+
name: string;
|
|
45
|
+
required?: boolean | undefined;
|
|
46
|
+
allowed?: (string | number | boolean)[] | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const DataSourceDescriptorSchema: z.ZodObject<{
|
|
49
|
+
name: z.ZodString;
|
|
50
|
+
description: z.ZodOptional<z.ZodString>;
|
|
51
|
+
kind: z.ZodEnum<["options", "rows", "series"]>;
|
|
52
|
+
columns: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
|
+
key: z.ZodString;
|
|
54
|
+
type: z.ZodEnum<["string", "number", "boolean", "date"]>;
|
|
55
|
+
description: z.ZodOptional<z.ZodString>;
|
|
56
|
+
sensitive: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
type: "string" | "number" | "boolean" | "date";
|
|
59
|
+
sensitive: boolean;
|
|
60
|
+
key: string;
|
|
61
|
+
description?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
type: "string" | "number" | "boolean" | "date";
|
|
64
|
+
key: string;
|
|
65
|
+
sensitive?: boolean | undefined;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
}>, "many">>;
|
|
68
|
+
params: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
type: z.ZodEnum<["string", "number", "boolean"]>;
|
|
71
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
allowed: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
type: "string" | "number" | "boolean";
|
|
75
|
+
name: string;
|
|
76
|
+
required: boolean;
|
|
77
|
+
allowed?: (string | number | boolean)[] | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
type: "string" | "number" | "boolean";
|
|
80
|
+
name: string;
|
|
81
|
+
required?: boolean | undefined;
|
|
82
|
+
allowed?: (string | number | boolean)[] | undefined;
|
|
83
|
+
}>, "many">>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
name: string;
|
|
86
|
+
kind: "options" | "rows" | "series";
|
|
87
|
+
params?: {
|
|
88
|
+
type: "string" | "number" | "boolean";
|
|
89
|
+
name: string;
|
|
90
|
+
required: boolean;
|
|
91
|
+
allowed?: (string | number | boolean)[] | undefined;
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
description?: string | undefined;
|
|
94
|
+
columns?: {
|
|
95
|
+
type: "string" | "number" | "boolean" | "date";
|
|
96
|
+
sensitive: boolean;
|
|
97
|
+
key: string;
|
|
98
|
+
description?: string | undefined;
|
|
99
|
+
}[] | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
name: string;
|
|
102
|
+
kind: "options" | "rows" | "series";
|
|
103
|
+
params?: {
|
|
104
|
+
type: "string" | "number" | "boolean";
|
|
105
|
+
name: string;
|
|
106
|
+
required?: boolean | undefined;
|
|
107
|
+
allowed?: (string | number | boolean)[] | undefined;
|
|
108
|
+
}[] | undefined;
|
|
109
|
+
description?: string | undefined;
|
|
110
|
+
columns?: {
|
|
111
|
+
type: "string" | "number" | "boolean" | "date";
|
|
112
|
+
key: string;
|
|
113
|
+
sensitive?: boolean | undefined;
|
|
114
|
+
description?: string | undefined;
|
|
115
|
+
}[] | undefined;
|
|
116
|
+
}>;
|
|
117
|
+
export type DataSourceColumnDescriptor = z.infer<typeof DataSourceColumnDescriptorSchema>;
|
|
118
|
+
export type DataSourceParamDescriptor = z.infer<typeof DataSourceParamDescriptorSchema>;
|
|
119
|
+
export type DataSourceDescriptor = z.infer<typeof DataSourceDescriptorSchema>;
|
|
120
|
+
export type DataSourceSortDirection = 'asc' | 'desc';
|
|
121
|
+
export interface DataSourceSort {
|
|
122
|
+
key: string;
|
|
123
|
+
direction: DataSourceSortDirection;
|
|
124
|
+
}
|
|
125
|
+
export interface DataSourceRequest {
|
|
126
|
+
source: string;
|
|
127
|
+
params: Record<string, unknown>;
|
|
128
|
+
page?: number;
|
|
129
|
+
pageSize?: number;
|
|
130
|
+
sort?: DataSourceSort;
|
|
131
|
+
filter?: string;
|
|
132
|
+
}
|
|
133
|
+
export interface DataSourceResult<TRow = unknown> {
|
|
134
|
+
rows: TRow[];
|
|
135
|
+
/**
|
|
136
|
+
* Total row count across all pages. When omitted, `rows` is taken as exactly the requested page:
|
|
137
|
+
* the runtime applies no client-side paging, sorting or filtering and the total stays unknown.
|
|
138
|
+
*/
|
|
139
|
+
total?: number;
|
|
140
|
+
}
|
|
141
|
+
export type DataSourceResolver = (request: DataSourceRequest, ctx: {
|
|
142
|
+
signal: AbortSignal;
|
|
143
|
+
}) => Promise<DataSourceResult>;
|
|
144
|
+
export interface DataSourceDefinition extends DataSourceDescriptor {
|
|
145
|
+
resolve?: unknown[] | DataSourceResolver;
|
|
146
|
+
}
|
|
147
|
+
export declare function defineDataSource<const T extends DataSourceDefinition>(definition: T): T;
|
|
148
|
+
export declare function indexDataSources<T extends DataSourceDescriptor>(definitions: readonly T[]): Record<string, T>;
|
|
149
|
+
//# sourceMappingURL=data-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../src/schemas/data-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0BAA0B,iEAA2D,CAAC;AAEnG,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAA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AE,MAAM,EAAE,WAAW,CAAA;CAAE,KACzB,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE/B,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC;CAC1C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS,oBAAoB,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAEvF;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,oBAAoB,EAC7D,WAAW,EAAE,SAAS,CAAC,EAAE,GACxB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CASnB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const DataSourceParamValueSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
|
3
|
+
export const DataSourceRefSchema = z.object({
|
|
4
|
+
source: z.string().min(1),
|
|
5
|
+
params: z.record(DataSourceParamValueSchema).optional(),
|
|
6
|
+
});
|
|
7
|
+
export function isDataSourceRef(value) {
|
|
8
|
+
return (typeof value === 'object' &&
|
|
9
|
+
value !== null &&
|
|
10
|
+
typeof value.source === 'string');
|
|
11
|
+
}
|
|
12
|
+
export const DataSourceColumnDescriptorSchema = z.object({
|
|
13
|
+
key: z.string().min(1),
|
|
14
|
+
type: z.enum(['string', 'number', 'boolean', 'date']),
|
|
15
|
+
description: z.string().optional(),
|
|
16
|
+
sensitive: z.boolean().default(false),
|
|
17
|
+
});
|
|
18
|
+
export const DataSourceParamDescriptorSchema = z.object({
|
|
19
|
+
name: z.string().min(1),
|
|
20
|
+
type: z.enum(['string', 'number', 'boolean']),
|
|
21
|
+
required: z.boolean().default(false),
|
|
22
|
+
allowed: z.array(z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
23
|
+
});
|
|
24
|
+
export const DataSourceDescriptorSchema = z.object({
|
|
25
|
+
name: z.string().min(1),
|
|
26
|
+
description: z.string().optional(),
|
|
27
|
+
kind: z.enum(['options', 'rows', 'series']),
|
|
28
|
+
columns: z.array(DataSourceColumnDescriptorSchema).optional(),
|
|
29
|
+
params: z.array(DataSourceParamDescriptorSchema).optional(),
|
|
30
|
+
});
|
|
31
|
+
export function defineDataSource(definition) {
|
|
32
|
+
return definition;
|
|
33
|
+
}
|
|
34
|
+
export function indexDataSources(definitions) {
|
|
35
|
+
const index = {};
|
|
36
|
+
for (const definition of definitions) {
|
|
37
|
+
if (Object.hasOwn(index, definition.name)) {
|
|
38
|
+
throw new Error(`Duplicate data source name "${definition.name}"`);
|
|
39
|
+
}
|
|
40
|
+
index[definition.name] = definition;
|
|
41
|
+
}
|
|
42
|
+
return index;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=data-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-source.js","sourceRoot":"","sources":["../../src/schemas/data-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAC;AAKH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAQ,KAAiC,CAAC,MAAM,KAAK,QAAQ,CAC9D,CAAC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AAC,KAAK,CAAC,gCAAgC,CAAC,CAAC,QAAQ,EAAE;IAC7D,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC,CAAC;AAwCH,MAAM,UAAU,gBAAgB,CAAuC,UAAa;IAClF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,WAAyB;IAEzB,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,+BAA+B,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC;QACrE,CAAC;QACD,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;IACtC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -7,15 +7,15 @@ export declare const DocumentMetadataSchema: z.ZodObject<{
|
|
|
7
7
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
8
|
domain: z.ZodOptional<z.ZodString>;
|
|
9
9
|
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
title?: string | undefined;
|
|
11
10
|
description?: string | undefined;
|
|
11
|
+
title?: string | undefined;
|
|
12
12
|
version?: string | undefined;
|
|
13
13
|
author?: string | undefined;
|
|
14
14
|
tags?: string[] | undefined;
|
|
15
15
|
domain?: string | undefined;
|
|
16
16
|
}, {
|
|
17
|
-
title?: string | undefined;
|
|
18
17
|
description?: string | undefined;
|
|
18
|
+
title?: string | undefined;
|
|
19
19
|
version?: string | undefined;
|
|
20
20
|
author?: string | undefined;
|
|
21
21
|
tags?: string[] | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const EventTypeSchema: z.ZodEnum<["component_rendered", "field_changed", "action_triggered", "integration_called", "approval_granted", "approval_denied", "validation_error", "policy_violation"]>;
|
|
2
|
+
export declare const EventTypeSchema: z.ZodEnum<["component_rendered", "field_changed", "action_triggered", "integration_called", "approval_granted", "approval_denied", "validation_error", "policy_violation", "data_loading", "data_resolved", "data_error"]>;
|
|
3
3
|
export type EventType = z.infer<typeof EventTypeSchema>;
|
|
4
4
|
export declare const EventActorSchema: z.ZodObject<{
|
|
5
5
|
id: z.ZodString;
|
|
@@ -16,7 +16,7 @@ export declare const EventLogEntrySchema: z.ZodObject<{
|
|
|
16
16
|
timestamp: z.ZodString;
|
|
17
17
|
sessionId: z.ZodString;
|
|
18
18
|
documentId: z.ZodString;
|
|
19
|
-
eventType: z.ZodEnum<["component_rendered", "field_changed", "action_triggered", "integration_called", "approval_granted", "approval_denied", "validation_error", "policy_violation"]>;
|
|
19
|
+
eventType: z.ZodEnum<["component_rendered", "field_changed", "action_triggered", "integration_called", "approval_granted", "approval_denied", "validation_error", "policy_violation", "data_loading", "data_resolved", "data_error"]>;
|
|
20
20
|
componentId: z.ZodString;
|
|
21
21
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
22
22
|
redacted: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -34,7 +34,7 @@ export declare const EventLogEntrySchema: z.ZodObject<{
|
|
|
34
34
|
timestamp: string;
|
|
35
35
|
sessionId: string;
|
|
36
36
|
documentId: string;
|
|
37
|
-
eventType: "component_rendered" | "field_changed" | "action_triggered" | "integration_called" | "approval_granted" | "approval_denied" | "validation_error" | "policy_violation";
|
|
37
|
+
eventType: "component_rendered" | "field_changed" | "action_triggered" | "integration_called" | "approval_granted" | "approval_denied" | "validation_error" | "policy_violation" | "data_loading" | "data_resolved" | "data_error";
|
|
38
38
|
componentId: string;
|
|
39
39
|
payload: Record<string, unknown>;
|
|
40
40
|
redacted: boolean;
|
|
@@ -46,7 +46,7 @@ export declare const EventLogEntrySchema: z.ZodObject<{
|
|
|
46
46
|
timestamp: string;
|
|
47
47
|
sessionId: string;
|
|
48
48
|
documentId: string;
|
|
49
|
-
eventType: "component_rendered" | "field_changed" | "action_triggered" | "integration_called" | "approval_granted" | "approval_denied" | "validation_error" | "policy_violation";
|
|
49
|
+
eventType: "component_rendered" | "field_changed" | "action_triggered" | "integration_called" | "approval_granted" | "approval_denied" | "validation_error" | "policy_violation" | "data_loading" | "data_resolved" | "data_error";
|
|
50
50
|
componentId: string;
|
|
51
51
|
payload: Record<string, unknown>;
|
|
52
52
|
redacted?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-log.d.ts","sourceRoot":"","sources":["../../src/schemas/event-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"event-log.d.ts","sourceRoot":"","sources":["../../src/schemas/event-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,4NAY1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-log.js","sourceRoot":"","sources":["../../src/schemas/event-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;
|
|
1
|
+
{"version":3,"file":"event-log.js","sourceRoot":"","sources":["../../src/schemas/event-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,oBAAoB;IACpB,eAAe;IACf,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,YAAY;CACb,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,SAAS,EAAE,eAAe;IAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACpC,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export type { StoreAction } from './events.js';
|
|
|
3
3
|
export type { AttachableDefinition } from './attachable.js';
|
|
4
4
|
export type { ComponentBase } from '../schemas/component-base.js';
|
|
5
5
|
export type { BindingExpression } from '../schemas/binding.js';
|
|
6
|
-
export type {
|
|
6
|
+
export type { DataSourceRef, DataSourceParamValue, DataSourceDescriptor, DataSourceColumnDescriptor, DataSourceParamDescriptor, DataSourceDefinition, DataSourceResolver, DataSourceRequest, DataSourceResult, DataSourceSort, DataSourceSortDirection, } from '../schemas/data-source.js';
|
|
7
|
+
export type { MdmaComponent, ComponentType, FormComponent, FormField, ButtonComponent, TasklistComponent, TaskItem, TableComponent, TableColumn, CalloutComponent, ApprovalGateComponent, WebhookComponent, ChartComponent, ThinkingComponent, CustomComponent, } from '../schemas/components/index.js';
|
|
7
8
|
export type { EventLogEntry, EventType, EventActor } from '../schemas/event-log.js';
|
|
8
9
|
export type { Policy, PolicyRule } from '../schemas/policy.js';
|
|
9
10
|
export type { DocumentMetadata } from '../schemas/document.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG5D,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG5D,YAAY,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,GACxB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACpF,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,kCAAkC,CAAC"}
|