@builder-builder/builder 0.0.13 → 0.0.15
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/bb.d.ts +3 -1
- package/dist/bb.js +6 -1
- package/dist/check.d.ts +2 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +53 -0
- package/dist/codegen/index.d.ts +7 -0
- package/dist/codegen/index.js +212 -0
- package/dist/codegen/template.d.ts +5 -0
- package/dist/codegen/template.js +17 -0
- package/dist/entities/builder/builder.d.ts +11 -1
- package/dist/entities/builder/builder.js +22 -6
- package/dist/entities/collection/collection.d.ts +7 -1
- package/dist/entities/collection/collection.js +9 -2
- package/dist/entities/collection/config.d.ts +6 -1
- package/dist/entities/collection/config.js +9 -2
- package/dist/entities/component/component.d.ts +41 -1
- package/dist/entities/component/component.js +9 -2
- package/dist/entities/component/details.d.ts +11 -2
- package/dist/entities/component/details.js +9 -2
- package/dist/entities/component/field.d.ts +10 -1
- package/dist/entities/component/field.js +13 -3
- package/dist/entities/index.d.ts +7 -3
- package/dist/entities/index.js +3 -1
- package/dist/entities/kind.d.ts +1 -1
- package/dist/entities/model/model.d.ts +5 -1
- package/dist/entities/model/model.js +10 -3
- package/dist/entities/model/models.js +9 -5
- package/dist/entities/option/option.d.ts +41 -1
- package/dist/entities/option/option.js +9 -2
- package/dist/entities/option/select.d.ts +7 -1
- package/dist/entities/option/select.js +17 -6
- package/dist/entities/option/toggle.d.ts +7 -1
- package/dist/entities/option/toggle.js +16 -4
- package/dist/entities/option/values.d.ts +6 -0
- package/dist/entities/pricing.d.ts +64 -0
- package/dist/entities/pricing.js +48 -0
- package/dist/entities/serialise.d.ts +632 -8
- package/dist/entities/serialise.js +33 -12
- package/dist/entities/tags.d.ts +3 -0
- package/dist/entities/tags.js +2 -0
- package/dist/entities/ui/describe.d.ts +231 -8
- package/dist/entities/ui/describe.js +12 -5
- package/dist/entities/ui/index.d.ts +2 -0
- package/dist/entities/ui/index.js +1 -0
- package/dist/entities/ui/input.d.ts +343 -0
- package/dist/entities/ui/input.js +51 -0
- package/dist/entities/ui/page.d.ts +231 -8
- package/dist/entities/ui/page.js +12 -5
- package/dist/entities/ui/pages.d.ts +5 -1
- package/dist/entities/ui/pages.js +9 -2
- package/dist/entities/ui/ui.d.ts +9 -4
- package/dist/entities/ui/ui.js +29 -11
- package/dist/entities/validated.d.ts +7 -3
- package/dist/exception.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/instance.d.ts +9 -0
- package/dist/instance.js +3 -1
- package/dist/mappers/index.d.ts +6 -4
- package/dist/mappers/index.js +3 -2
- package/dist/mappers/pricing.d.ts +3 -0
- package/dist/mappers/pricing.js +101 -0
- package/dist/mappers/render/index.d.ts +1 -1
- package/dist/mappers/render/pages.d.ts +8 -0
- package/dist/mappers/render/pages.js +2 -1
- package/dist/mappers/render/render.js +19 -3
- package/dist/mappers/resolve.d.ts +4 -4
- package/dist/mappers/variants/index.d.ts +2 -1
- package/dist/mappers/variants/index.js +2 -1
- package/dist/mappers/variants/variants.d.ts +5 -2
- package/dist/mappers/variants/variants.js +2 -2
- package/dist/validate/brand.d.ts +0 -7
- package/dist/validate/brand.js +5 -5
- package/dist/validate/builder.d.ts +2 -1
- package/dist/validate/builder.js +19 -13
- package/dist/validate/errors.d.ts +138 -0
- package/dist/validate/errors.js +148 -0
- package/dist/validate/expectations.d.ts +3 -10
- package/dist/validate/expectations.js +8 -10
- package/dist/validate/index.d.ts +10 -14
- package/dist/validate/index.js +5 -7
- package/dist/validate/instance.d.ts +2 -15
- package/dist/validate/instance.js +41 -40
- package/dist/validate/model.d.ts +4 -31
- package/dist/validate/model.js +157 -176
- package/dist/validate/pricing.d.ts +6 -0
- package/dist/validate/pricing.js +71 -0
- package/dist/validate/resolve.d.ts +3 -15
- package/dist/validate/resolve.js +66 -69
- package/dist/validate/result.d.ts +1 -7
- package/dist/validate/result.js +1 -4
- package/dist/validate/ui.d.ts +4 -4
- package/dist/validate/ui.js +80 -62
- package/dist/validate/variants.d.ts +2 -53
- package/dist/validate/variants.js +83 -86
- package/package.json +12 -3
|
@@ -6,8 +6,9 @@ import { BuilderCollectionConfigSchema, BuilderCollectionConfigSerialisedSchema,
|
|
|
6
6
|
import { BuilderComponentDetailsSchema, BuilderComponentDetailsSerialisedSchema, BuilderComponentFieldSchema, BuilderComponentSchema, BuilderComponentSelectMapSerialisedSchema, BuilderComponentWhenSerialisedSchema } from './component/index.js';
|
|
7
7
|
import { BuilderExpectationSchema, BuilderExpectationsSchema, BuilderExpectationsSerialisedSchema } from './expectation.js';
|
|
8
8
|
import { BuilderModelSchema, BuilderModelSerialisedSchema } from './model/index.js';
|
|
9
|
+
import { BuilderPricingSchema } from './pricing.js';
|
|
9
10
|
import { BuilderOptionSchema, BuilderOptionSelectMapSerialisedSchema, BuilderOptionWhenSerialisedSchema, BuilderSelectTypeSchema, BuilderSelectTypeSerialisedSchema, BuilderToggleTypeSchema, BuilderToggleTypeSerialisedSchema } from './option/index.js';
|
|
10
|
-
import { BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPageSchema, BuilderUIPageSerialisedSchema, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema, BuilderUISchema, BuilderUISerialisedSchema } from './ui/index.js';
|
|
11
|
+
import { BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema, BuilderUIInputSchema, BuilderUIInputSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPageSchema, BuilderUIPageSerialisedSchema, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema, BuilderUISchema, BuilderUISerialisedSchema } from './ui/index.js';
|
|
11
12
|
import { BuilderSchema, BuilderSerialisedSchema } from './builder/index.js';
|
|
12
13
|
export const entitiesMap = {
|
|
13
14
|
builder: { runtime: BuilderSchema, serialised: BuilderSerialisedSchema },
|
|
@@ -18,6 +19,8 @@ export const entitiesMap = {
|
|
|
18
19
|
uiPage: { runtime: BuilderUIPageSchema, serialised: BuilderUIPageSerialisedSchema },
|
|
19
20
|
uiDescribe: { runtime: BuilderUIDescribeSchema, serialised: BuilderUIDescribeSerialisedSchema },
|
|
20
21
|
uiPages: { runtime: BuilderUIPagesSchema, serialised: BuilderUIPagesSerialisedSchema },
|
|
22
|
+
uiInput: { runtime: BuilderUIInputSchema, serialised: BuilderUIInputSerialisedSchema },
|
|
23
|
+
pricing: { runtime: BuilderPricingSchema, serialised: BuilderPricingSchema },
|
|
21
24
|
componentDetails: {
|
|
22
25
|
runtime: BuilderComponentDetailsSchema,
|
|
23
26
|
serialised: BuilderComponentDetailsSerialisedSchema
|
|
@@ -92,63 +95,78 @@ const serialiserMap = [
|
|
|
92
95
|
serialiser(BuilderSchema, (value) => ({
|
|
93
96
|
model: serialiseValue(value.model),
|
|
94
97
|
ui: serialiseValue(value.ui),
|
|
95
|
-
bindings: serialiseRecord(value.bindings)
|
|
98
|
+
bindings: serialiseRecord(value.bindings),
|
|
99
|
+
tags: value.tags,
|
|
100
|
+
pricing: value.pricing
|
|
96
101
|
})),
|
|
97
102
|
serialiser(BuilderModelSchema, (value) => ({
|
|
98
103
|
models: value.models.map(serialiseValue),
|
|
99
104
|
options: value.options.map(serialiseValue),
|
|
100
105
|
components: value.components.map(serialiseValue),
|
|
101
106
|
collections: value.collections.map(serialiseValue),
|
|
102
|
-
expectations: value.expectations.map(serialiseValue)
|
|
107
|
+
expectations: value.expectations.map(serialiseValue),
|
|
108
|
+
tags: value.tags
|
|
103
109
|
})),
|
|
104
110
|
serialiser(BuilderUISchema, (value) => ({
|
|
105
111
|
uis: value.uis.map(serialiseValue),
|
|
106
112
|
items: value.items.map(serialiseValue),
|
|
107
|
-
expectations: value.expectations.map(serialiseValue)
|
|
113
|
+
expectations: value.expectations.map(serialiseValue),
|
|
114
|
+
tags: value.tags
|
|
108
115
|
})),
|
|
109
116
|
serialiser(BuilderUIPageSchema, (value) => ({
|
|
110
117
|
type: 'page',
|
|
111
118
|
label: serialiseValue(value.label),
|
|
112
|
-
|
|
119
|
+
inputs: serialiseValue(value.inputs),
|
|
120
|
+
tags: value.tags
|
|
113
121
|
})),
|
|
114
122
|
serialiser(BuilderUIDescribeSchema, (value) => ({
|
|
115
123
|
type: 'describe',
|
|
116
124
|
label: serialiseValue(value.label),
|
|
117
|
-
|
|
125
|
+
inputs: serialiseValue(value.inputs),
|
|
126
|
+
tags: value.tags
|
|
118
127
|
})),
|
|
119
128
|
serialiser(BuilderUIPagesSchema, (value) => ({
|
|
120
129
|
type: 'pages',
|
|
121
130
|
name: value.name,
|
|
122
131
|
label: serialiseValue(value.label),
|
|
123
|
-
items: serialiseValue(value.items)
|
|
132
|
+
items: serialiseValue(value.items),
|
|
133
|
+
tags: value.tags
|
|
124
134
|
})),
|
|
135
|
+
serialiser(BuilderUIInputSchema, (value) => serialiseRecord({ ...value })),
|
|
125
136
|
serialiser(BuilderOptionSchema, serialiseNamedEntry),
|
|
126
137
|
serialiser(BuilderComponentSchema, serialiseNamedEntry),
|
|
127
138
|
serialiser(BuilderCollectionSchema, serialiseNamedEntry),
|
|
128
|
-
serialiser(BuilderComponentDetailsSchema, (value) => ({
|
|
139
|
+
serialiser(BuilderComponentDetailsSchema, (value) => ({
|
|
140
|
+
fields: serialiseValue(value.fields),
|
|
141
|
+
tags: value.tags
|
|
142
|
+
})),
|
|
129
143
|
serialiser(BuilderComponentFieldSchema, (value) => ({
|
|
130
144
|
type: 'component-field',
|
|
131
145
|
name: value.name,
|
|
132
146
|
valueType: value.valueType,
|
|
133
|
-
isOptional: value.isOptional
|
|
147
|
+
isOptional: value.isOptional,
|
|
148
|
+
tags: value.tags
|
|
134
149
|
})),
|
|
135
150
|
serialiser(BuilderCollectionConfigSchema, (value) => ({
|
|
136
151
|
model: serialiseValue(value.model),
|
|
137
152
|
min: serialiseValue(value.min),
|
|
138
|
-
max: serialiseValue(value.max)
|
|
153
|
+
max: serialiseValue(value.max),
|
|
154
|
+
tags: value.tags
|
|
139
155
|
})),
|
|
140
156
|
serialiser(BuilderSelectTypeSchema, (value) => ({
|
|
141
157
|
type: 'select',
|
|
142
158
|
options: value.options,
|
|
143
159
|
defaultValue: value.defaultValue,
|
|
144
160
|
isOptional: value.isOptional,
|
|
145
|
-
optionLabels: value.optionLabels
|
|
161
|
+
optionLabels: value.optionLabels,
|
|
162
|
+
tags: value.tags
|
|
146
163
|
})),
|
|
147
164
|
serialiser(BuilderToggleTypeSchema, (value) => ({
|
|
148
165
|
type: 'toggle',
|
|
149
166
|
valueType: value.valueType,
|
|
150
167
|
defaultValue: value.defaultValue,
|
|
151
|
-
isOptional: value.isOptional
|
|
168
|
+
isOptional: value.isOptional,
|
|
169
|
+
tags: value.tags
|
|
152
170
|
})),
|
|
153
171
|
serialiser(BuilderExpectationSchema, (value) => ({ name: value.name, kind: value.kind }))
|
|
154
172
|
];
|
|
@@ -160,6 +178,9 @@ function serialiseNamedEntry(value) {
|
|
|
160
178
|
if (value.paths != null) {
|
|
161
179
|
entry.paths = serialiseValue(value.paths);
|
|
162
180
|
}
|
|
181
|
+
if (value.tags != null) {
|
|
182
|
+
entry.tags = serialiseValue(value.tags);
|
|
183
|
+
}
|
|
163
184
|
return entry;
|
|
164
185
|
}
|
|
165
186
|
function serialiseRecord(record) {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import type { BuilderPaths } from '../../paths';
|
|
2
1
|
import type { Paramable } from '../../references';
|
|
2
|
+
import type { BuilderTags } from '../tags';
|
|
3
|
+
import type { BuilderUIInputs } from './input';
|
|
3
4
|
import * as v from 'valibot';
|
|
4
5
|
export declare const BuilderDescriptionItemSchema: v.SchemaWithPipe<readonly [v.TupleSchema<[v.StringSchema<undefined>, v.StringSchema<undefined>], undefined>, v.ReadonlyAction<[string, string]>]>;
|
|
5
6
|
export type BuilderDescriptionItem = v.InferOutput<typeof BuilderDescriptionItemSchema>;
|
|
6
7
|
export declare const BuilderDescriptionSchema: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.TupleSchema<[v.StringSchema<undefined>, v.StringSchema<undefined>], undefined>, v.ReadonlyAction<[string, string]>]>, undefined>, v.ReadonlyAction<(readonly [string, string])[]>]>;
|
|
7
8
|
export type BuilderDescription = v.InferOutput<typeof BuilderDescriptionSchema>;
|
|
8
|
-
export declare class BuilderUIDescribe<const Label extends Paramable<string> = Paramable<string>, const
|
|
9
|
+
export declare class BuilderUIDescribe<const Label extends Paramable<string> = Paramable<string>, const Inputs extends Paramable<BuilderUIInputs> = Paramable<BuilderUIInputs>> {
|
|
9
10
|
readonly type: "describe";
|
|
10
11
|
readonly label: Label;
|
|
11
|
-
readonly
|
|
12
|
-
|
|
12
|
+
readonly inputs: Inputs;
|
|
13
|
+
readonly tags?: BuilderTags;
|
|
14
|
+
constructor(label: Label, inputs: Inputs, tags?: BuilderTags);
|
|
15
|
+
tag(...tags: Array<string>): BuilderUIDescribe<Label, Inputs>;
|
|
13
16
|
}
|
|
14
17
|
export declare const BuilderUIDescribeSchema: v.InstanceSchema<typeof BuilderUIDescribe, undefined>;
|
|
15
18
|
export declare const BuilderUIDescribeSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
@@ -29,7 +32,7 @@ export declare const BuilderUIDescribeSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
29
32
|
type: "ref";
|
|
30
33
|
id: string;
|
|
31
34
|
}>]>, v.StringSchema<undefined>], undefined>;
|
|
32
|
-
readonly
|
|
35
|
+
readonly inputs: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
33
36
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
34
37
|
readonly id: v.StringSchema<undefined>;
|
|
35
38
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -43,7 +46,182 @@ export declare const BuilderUIDescribeSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
43
46
|
}, undefined>, v.ReadonlyAction<{
|
|
44
47
|
type: "ref";
|
|
45
48
|
id: string;
|
|
46
|
-
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.
|
|
49
|
+
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
50
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
51
|
+
readonly id: v.StringSchema<undefined>;
|
|
52
|
+
readonly name: v.StringSchema<undefined>;
|
|
53
|
+
}, undefined>, v.ReadonlyAction<{
|
|
54
|
+
type: "parameter";
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
58
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
59
|
+
readonly id: v.StringSchema<undefined>;
|
|
60
|
+
}, undefined>, v.ReadonlyAction<{
|
|
61
|
+
type: "ref";
|
|
62
|
+
id: string;
|
|
63
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
64
|
+
readonly type: v.LiteralSchema<"input", undefined>;
|
|
65
|
+
readonly path: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
66
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
67
|
+
readonly id: v.StringSchema<undefined>;
|
|
68
|
+
readonly name: v.StringSchema<undefined>;
|
|
69
|
+
}, undefined>, v.ReadonlyAction<{
|
|
70
|
+
type: "parameter";
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
74
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
75
|
+
readonly id: v.StringSchema<undefined>;
|
|
76
|
+
}, undefined>, v.ReadonlyAction<{
|
|
77
|
+
type: "ref";
|
|
78
|
+
id: string;
|
|
79
|
+
}>]>, v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.ReadonlyAction<(string | number)[]>]>], undefined>;
|
|
80
|
+
readonly displayName: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
81
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
82
|
+
readonly id: v.StringSchema<undefined>;
|
|
83
|
+
readonly name: v.StringSchema<undefined>;
|
|
84
|
+
}, undefined>, v.ReadonlyAction<{
|
|
85
|
+
type: "parameter";
|
|
86
|
+
id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
89
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
90
|
+
readonly id: v.StringSchema<undefined>;
|
|
91
|
+
}, undefined>, v.ReadonlyAction<{
|
|
92
|
+
type: "ref";
|
|
93
|
+
id: string;
|
|
94
|
+
}>]>, v.StringSchema<undefined>], undefined>, undefined>;
|
|
95
|
+
readonly kind: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
96
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
97
|
+
readonly id: v.StringSchema<undefined>;
|
|
98
|
+
readonly name: v.StringSchema<undefined>;
|
|
99
|
+
}, undefined>, v.ReadonlyAction<{
|
|
100
|
+
type: "parameter";
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
104
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
105
|
+
readonly id: v.StringSchema<undefined>;
|
|
106
|
+
}, undefined>, v.ReadonlyAction<{
|
|
107
|
+
type: "ref";
|
|
108
|
+
id: string;
|
|
109
|
+
}>]>, v.StringSchema<undefined>], undefined>, undefined>;
|
|
110
|
+
readonly metadata: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
111
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
112
|
+
readonly id: v.StringSchema<undefined>;
|
|
113
|
+
readonly name: v.StringSchema<undefined>;
|
|
114
|
+
}, undefined>, v.ReadonlyAction<{
|
|
115
|
+
type: "parameter";
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
119
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
120
|
+
readonly id: v.StringSchema<undefined>;
|
|
121
|
+
}, undefined>, v.ReadonlyAction<{
|
|
122
|
+
type: "ref";
|
|
123
|
+
id: string;
|
|
124
|
+
}>]>, v.SchemaWithPipe<readonly [v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
125
|
+
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
126
|
+
readonly id: v.StringSchema<undefined>;
|
|
127
|
+
readonly name: v.StringSchema<undefined>;
|
|
128
|
+
}, undefined>, v.ReadonlyAction<{
|
|
129
|
+
type: "parameter";
|
|
130
|
+
id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
133
|
+
readonly type: v.LiteralSchema<"ref", undefined>;
|
|
134
|
+
readonly id: v.StringSchema<undefined>;
|
|
135
|
+
}, undefined>, v.ReadonlyAction<{
|
|
136
|
+
type: "ref";
|
|
137
|
+
id: string;
|
|
138
|
+
}>]>, v.UnknownSchema], undefined>, undefined>, v.ReadonlyAction<{
|
|
139
|
+
[x: string]: unknown;
|
|
140
|
+
}>]>], undefined>, undefined>;
|
|
141
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
142
|
+
}, undefined>, v.ReadonlyAction<{
|
|
143
|
+
type: "input";
|
|
144
|
+
path: readonly (string | number)[] | Readonly<{
|
|
145
|
+
type: "parameter";
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
}> | Readonly<{
|
|
149
|
+
type: "ref";
|
|
150
|
+
id: string;
|
|
151
|
+
}>;
|
|
152
|
+
displayName?: string | Readonly<{
|
|
153
|
+
type: "parameter";
|
|
154
|
+
id: string;
|
|
155
|
+
name: string;
|
|
156
|
+
}> | Readonly<{
|
|
157
|
+
type: "ref";
|
|
158
|
+
id: string;
|
|
159
|
+
}> | undefined;
|
|
160
|
+
kind?: string | Readonly<{
|
|
161
|
+
type: "parameter";
|
|
162
|
+
id: string;
|
|
163
|
+
name: string;
|
|
164
|
+
}> | Readonly<{
|
|
165
|
+
type: "ref";
|
|
166
|
+
id: string;
|
|
167
|
+
}> | undefined;
|
|
168
|
+
metadata?: Readonly<{
|
|
169
|
+
type: "parameter";
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
}> | Readonly<{
|
|
173
|
+
type: "ref";
|
|
174
|
+
id: string;
|
|
175
|
+
}> | Readonly<{
|
|
176
|
+
[x: string]: unknown;
|
|
177
|
+
}> | undefined;
|
|
178
|
+
tags?: readonly string[] | undefined;
|
|
179
|
+
}>]>], undefined>, undefined>, v.ReadonlyAction<(Readonly<{
|
|
180
|
+
type: "parameter";
|
|
181
|
+
id: string;
|
|
182
|
+
name: string;
|
|
183
|
+
}> | Readonly<{
|
|
184
|
+
type: "ref";
|
|
185
|
+
id: string;
|
|
186
|
+
}> | Readonly<{
|
|
187
|
+
type: "input";
|
|
188
|
+
path: readonly (string | number)[] | Readonly<{
|
|
189
|
+
type: "parameter";
|
|
190
|
+
id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
}> | Readonly<{
|
|
193
|
+
type: "ref";
|
|
194
|
+
id: string;
|
|
195
|
+
}>;
|
|
196
|
+
displayName?: string | Readonly<{
|
|
197
|
+
type: "parameter";
|
|
198
|
+
id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
}> | Readonly<{
|
|
201
|
+
type: "ref";
|
|
202
|
+
id: string;
|
|
203
|
+
}> | undefined;
|
|
204
|
+
kind?: string | Readonly<{
|
|
205
|
+
type: "parameter";
|
|
206
|
+
id: string;
|
|
207
|
+
name: string;
|
|
208
|
+
}> | Readonly<{
|
|
209
|
+
type: "ref";
|
|
210
|
+
id: string;
|
|
211
|
+
}> | undefined;
|
|
212
|
+
metadata?: Readonly<{
|
|
213
|
+
type: "parameter";
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
}> | Readonly<{
|
|
217
|
+
type: "ref";
|
|
218
|
+
id: string;
|
|
219
|
+
}> | Readonly<{
|
|
220
|
+
[x: string]: unknown;
|
|
221
|
+
}> | undefined;
|
|
222
|
+
tags?: readonly string[] | undefined;
|
|
223
|
+
}>)[]>]>], undefined>;
|
|
224
|
+
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
47
225
|
}, undefined>, v.ReadonlyAction<{
|
|
48
226
|
type: "describe";
|
|
49
227
|
label: string | Readonly<{
|
|
@@ -54,13 +232,58 @@ export declare const BuilderUIDescribeSerialisedSchema: v.SchemaWithPipe<readonl
|
|
|
54
232
|
type: "ref";
|
|
55
233
|
id: string;
|
|
56
234
|
}>;
|
|
57
|
-
|
|
235
|
+
inputs: Readonly<{
|
|
58
236
|
type: "parameter";
|
|
59
237
|
id: string;
|
|
60
238
|
name: string;
|
|
61
239
|
}> | Readonly<{
|
|
62
240
|
type: "ref";
|
|
63
241
|
id: string;
|
|
64
|
-
}
|
|
242
|
+
}> | readonly (Readonly<{
|
|
243
|
+
type: "parameter";
|
|
244
|
+
id: string;
|
|
245
|
+
name: string;
|
|
246
|
+
}> | Readonly<{
|
|
247
|
+
type: "ref";
|
|
248
|
+
id: string;
|
|
249
|
+
}> | Readonly<{
|
|
250
|
+
type: "input";
|
|
251
|
+
path: readonly (string | number)[] | Readonly<{
|
|
252
|
+
type: "parameter";
|
|
253
|
+
id: string;
|
|
254
|
+
name: string;
|
|
255
|
+
}> | Readonly<{
|
|
256
|
+
type: "ref";
|
|
257
|
+
id: string;
|
|
258
|
+
}>;
|
|
259
|
+
displayName?: string | Readonly<{
|
|
260
|
+
type: "parameter";
|
|
261
|
+
id: string;
|
|
262
|
+
name: string;
|
|
263
|
+
}> | Readonly<{
|
|
264
|
+
type: "ref";
|
|
265
|
+
id: string;
|
|
266
|
+
}> | undefined;
|
|
267
|
+
kind?: string | Readonly<{
|
|
268
|
+
type: "parameter";
|
|
269
|
+
id: string;
|
|
270
|
+
name: string;
|
|
271
|
+
}> | Readonly<{
|
|
272
|
+
type: "ref";
|
|
273
|
+
id: string;
|
|
274
|
+
}> | undefined;
|
|
275
|
+
metadata?: Readonly<{
|
|
276
|
+
type: "parameter";
|
|
277
|
+
id: string;
|
|
278
|
+
name: string;
|
|
279
|
+
}> | Readonly<{
|
|
280
|
+
type: "ref";
|
|
281
|
+
id: string;
|
|
282
|
+
}> | Readonly<{
|
|
283
|
+
[x: string]: unknown;
|
|
284
|
+
}> | undefined;
|
|
285
|
+
tags?: readonly string[] | undefined;
|
|
286
|
+
}>)[];
|
|
287
|
+
tags?: readonly string[] | undefined;
|
|
65
288
|
}>]>;
|
|
66
289
|
export type BuilderUIDescribeSerialised = v.InferOutput<typeof BuilderUIDescribeSerialisedSchema>;
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { BuilderPathsSchema } from '../../paths.js';
|
|
3
2
|
import { paramable } from '../../references.js';
|
|
4
3
|
import { serialisable } from '../../serialisable.js';
|
|
4
|
+
import { BuilderTagsSchema } from '../tags.js';
|
|
5
|
+
import { BuilderUIInputsSerialisedSchema } from './input.js';
|
|
5
6
|
export const BuilderDescriptionItemSchema = v.pipe(v.tuple([v.string(), v.string()]), v.readonly());
|
|
6
7
|
export const BuilderDescriptionSchema = v.pipe(v.array(BuilderDescriptionItemSchema), v.readonly());
|
|
7
8
|
export class BuilderUIDescribe {
|
|
8
9
|
type = 'describe';
|
|
9
10
|
label;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
inputs;
|
|
12
|
+
tags;
|
|
13
|
+
constructor(label, inputs, tags) {
|
|
12
14
|
this.label = label;
|
|
13
|
-
this.
|
|
15
|
+
this.inputs = inputs;
|
|
16
|
+
this.tags = tags;
|
|
17
|
+
}
|
|
18
|
+
tag(...tags) {
|
|
19
|
+
return new BuilderUIDescribe(this.label, this.inputs, tags);
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
22
|
export const BuilderUIDescribeSchema = v.instance(BuilderUIDescribe);
|
|
17
23
|
export const BuilderUIDescribeSerialisedSchema = serialisable(v.object({
|
|
18
24
|
type: v.literal('describe'),
|
|
19
25
|
label: paramable(v.string()),
|
|
20
|
-
|
|
26
|
+
inputs: paramable(BuilderUIInputsSerialisedSchema),
|
|
27
|
+
tags: v.optional(BuilderTagsSchema)
|
|
21
28
|
}));
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export type { BuilderDescription, BuilderDescriptionItem, BuilderUIDescribeSerialised } from './describe';
|
|
2
|
+
export type { BuilderUIInputMetadata, BuilderUIInputMetadataSerialised, BuilderUIInputs, BuilderUIInputsSerialised, BuilderUIInputSerialised } from './input';
|
|
2
3
|
export type { BuilderUIPageSerialised } from './page';
|
|
3
4
|
export type { BuilderUIItem, BuilderUIItems, BuilderUIItemSerialised, BuilderUIItemsSerialised, BuilderUIPagesSerialised } from './pages';
|
|
4
5
|
export type { BuilderUIs, BuilderUIsSerialised, BuilderUISerialised } from './ui';
|
|
5
6
|
export { BuilderDescriptionItemSchema, BuilderDescriptionSchema, BuilderUIDescribe, BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema } from './describe.js';
|
|
7
|
+
export { BuilderUIInput, BuilderUIInputMetadataSchema, BuilderUIInputSchema, BuilderUIInputSerialisedSchema, BuilderUIInputsSerialisedSchema, input } from './input.js';
|
|
6
8
|
export { BuilderUIPage, BuilderUIPageSchema, BuilderUIPageSerialisedSchema } from './page.js';
|
|
7
9
|
export { BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPages, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema } from './pages.js';
|
|
8
10
|
export { BuilderUI, BuilderUISchema, BuilderUISerialisedSchema } from './ui.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { BuilderDescriptionItemSchema, BuilderDescriptionSchema, BuilderUIDescribe, BuilderUIDescribeSchema, BuilderUIDescribeSerialisedSchema } from './describe.js';
|
|
2
|
+
export { BuilderUIInput, BuilderUIInputMetadataSchema, BuilderUIInputSchema, BuilderUIInputSerialisedSchema, BuilderUIInputsSerialisedSchema, input } from './input.js';
|
|
2
3
|
export { BuilderUIPage, BuilderUIPageSchema, BuilderUIPageSerialisedSchema } from './page.js';
|
|
3
4
|
export { BuilderUIItemSerialisedSchema, BuilderUIItemsSerialisedSchema, BuilderUIPages, BuilderUIPagesSchema, BuilderUIPagesSerialisedSchema } from './pages.js';
|
|
4
5
|
export { BuilderUI, BuilderUISchema, BuilderUISerialisedSchema } from './ui.js';
|