@builder-builder/builder 0.0.27 → 0.0.29
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.js +9 -10
- package/dist/client/client.d.ts +2 -1
- package/dist/client/client.js +4 -1
- package/dist/client/public.d.ts +2 -2
- package/dist/client/public.js +1 -1
- package/dist/client/schema.d.ts +126 -45
- package/dist/client/schema.js +6 -1
- package/dist/components/BuilderOption.svelte.d.ts +12 -12
- package/dist/components/BuilderOptionValueBoolean.svelte.d.ts +20 -0
- package/dist/components/BuilderOptionValueNumber.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionValueSelect.svelte.d.ts +21 -0
- package/dist/components/BuilderOptionValueString.svelte.d.ts +21 -0
- package/dist/components/BuilderRender.svelte.d.ts +2 -2
- package/dist/components/index.d.ts +8 -8
- package/dist/components/index.js +4376 -4258
- package/dist/components/index.min.js +3 -0
- package/dist/entities/collection/collection.d.ts +191 -401
- package/dist/entities/collection/collection.js +7 -4
- package/dist/entities/collection/{when.d.ts → condition.d.ts} +4 -5
- package/dist/entities/collection/condition.js +2 -0
- package/dist/entities/collection/config.d.ts +62 -80
- package/dist/entities/collection/index.d.ts +4 -4
- package/dist/entities/collection/index.js +2 -2
- package/dist/entities/component/component.d.ts +71 -83
- package/dist/entities/component/component.js +4 -4
- package/dist/entities/component/condition.d.ts +10 -0
- package/dist/entities/component/{when.js → condition.js} +3 -9
- package/dist/entities/component/config.d.ts +33 -33
- package/dist/entities/component/config.js +18 -16
- package/dist/entities/component/detail.d.ts +61 -0
- package/dist/entities/component/detail.js +71 -0
- package/dist/entities/component/index.d.ts +6 -6
- package/dist/entities/component/index.js +3 -3
- package/dist/entities/{when.d.ts → condition.d.ts} +23 -36
- package/dist/entities/{when.js → condition.js} +20 -25
- package/dist/entities/expectation.d.ts +135 -3
- package/dist/entities/expectation.js +6 -2
- package/dist/entities/index.d.ts +9 -9
- package/dist/entities/index.js +4 -4
- package/dist/entities/kind.d.ts +4 -4
- package/dist/entities/kind.js +24 -25
- package/dist/entities/model/bind.d.ts +5 -5
- package/dist/entities/model/methods.d.ts +18 -27
- package/dist/entities/model/methods.js +4 -22
- package/dist/entities/model/model.d.ts +3 -1
- package/dist/entities/model/model.js +25 -27
- package/dist/entities/option/condition.d.ts +9 -0
- package/dist/entities/option/condition.js +2 -0
- package/dist/entities/option/config.d.ts +47 -72
- package/dist/entities/option/config.js +6 -6
- package/dist/entities/option/expectation.d.ts +6 -1
- package/dist/entities/option/expectation.js +2 -2
- package/dist/entities/option/index.d.ts +8 -8
- package/dist/entities/option/index.js +4 -4
- package/dist/entities/option/option.d.ts +179 -210
- package/dist/entities/option/option.js +4 -4
- package/dist/entities/option/select.d.ts +16 -43
- package/dist/entities/option/select.js +8 -31
- package/dist/entities/option/value.d.ts +73 -0
- package/dist/entities/option/value.js +99 -0
- package/dist/entities/paths.d.ts +2 -2
- package/dist/entities/pricing/expression.d.ts +16 -39
- package/dist/entities/pricing/expression.js +1 -16
- package/dist/entities/pricing/index.d.ts +1 -1
- package/dist/entities/pricing/rates.d.ts +1 -1
- package/dist/entities/references.d.ts +124 -84
- package/dist/entities/serialise.d.ts +175 -109
- package/dist/entities/serialise.js +32 -27
- package/dist/entities/ui/describe.d.ts +1 -1
- package/dist/entities/ui/input.d.ts +2 -2
- package/dist/entities/ui/page.d.ts +1 -1
- package/dist/entities/ui/pages.d.ts +2 -2
- package/dist/entities/validated.d.ts +3 -3
- package/dist/environment.d.ts +2 -2
- package/dist/errors/errors.d.ts +94 -58
- package/dist/errors/errors.js +41 -7
- package/dist/errors/exception.d.ts +3 -3
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/public.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/instance.d.ts +53 -9
- package/dist/instance.js +6 -2
- package/dist/mappers/dependencies.d.ts +3 -0
- package/dist/mappers/dependencies.js +45 -0
- package/dist/mappers/index.d.ts +2 -2
- package/dist/mappers/index.js +2 -1
- package/dist/mappers/instance.js +26 -21
- package/dist/mappers/price.js +6 -4
- package/dist/mappers/resolve.js +23 -22
- package/dist/mappers/variants/index.d.ts +1 -2
- package/dist/mappers/variants/index.js +1 -2
- package/dist/mappers/variants/option-graph.d.ts +1 -2
- package/dist/mappers/variants/option-graph.js +4 -18
- package/dist/mappers/variants/variants.d.ts +3 -6
- package/dist/mappers/variants/variants.js +34 -11
- package/dist/primitive.d.ts +3 -0
- package/dist/primitive.js +2 -0
- package/dist/public.d.ts +20 -20
- package/dist/public.js +17 -9
- package/dist/validate/builder.d.ts +2 -2
- package/dist/validate/builder.js +15 -15
- package/dist/validate/expectations.d.ts +2 -2
- package/dist/validate/expectations.js +23 -5
- package/dist/validate/instance.d.ts +2 -2
- package/dist/validate/instance.js +31 -13
- package/dist/validate/model.d.ts +4 -4
- package/dist/validate/model.js +57 -51
- package/dist/validate/paths.d.ts +2 -2
- package/dist/validate/paths.js +19 -14
- package/dist/validate/pricing.d.ts +4 -4
- package/dist/validate/pricing.js +31 -31
- package/dist/validate/resolve.d.ts +2 -2
- package/dist/validate/resolve.js +27 -31
- package/dist/validate/ui.d.ts +4 -4
- package/dist/validate/ui.js +38 -38
- package/dist/validate/variants.d.ts +3 -3
- package/dist/validate/variants.js +32 -31
- package/package.json +4 -2
- package/dist/components/BuilderOptionSelect.svelte.d.ts +0 -21
- package/dist/components/BuilderOptionToggleBoolean.svelte.d.ts +0 -20
- package/dist/components/BuilderOptionToggleNumber.svelte.d.ts +0 -21
- package/dist/components/BuilderOptionToggleString.svelte.d.ts +0 -21
- package/dist/entities/collection/when.js +0 -2
- package/dist/entities/component/field.d.ts +0 -59
- package/dist/entities/component/field.js +0 -52
- package/dist/entities/component/when.d.ts +0 -11
- package/dist/entities/option/toggle.d.ts +0 -45
- package/dist/entities/option/toggle.js +0 -66
- package/dist/entities/option/when.d.ts +0 -10
- package/dist/entities/option/when.js +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Paramable } from '../../references';
|
|
2
2
|
import type { BuilderPaths } from '../paths';
|
|
3
3
|
import type { BuilderTags } from '../tags';
|
|
4
|
-
import type {
|
|
4
|
+
import type { BuilderConditionSerialised } from '../condition';
|
|
5
5
|
import type { BuilderOptionConfig, BuilderOptionConfigSerialised } from './config';
|
|
6
|
-
import type {
|
|
6
|
+
import type { BuilderOptionCondition } from './condition';
|
|
7
7
|
import * as v from 'valibot';
|
|
8
|
-
export type BuilderOptionPayload = BuilderOptionConfig |
|
|
8
|
+
export type BuilderOptionPayload = BuilderOptionConfig | BuilderOptionCondition;
|
|
9
9
|
export declare class BuilderOption<const Name extends string = string, const Payload extends Paramable<BuilderOptionPayload> = Paramable<BuilderOptionPayload>, const Paths extends Paramable<BuilderPaths> = Paramable<BuilderPaths>> {
|
|
10
10
|
readonly type: 'option';
|
|
11
11
|
readonly name: Name;
|
|
@@ -17,43 +17,45 @@ export declare class BuilderOption<const Name extends string = string, const Pay
|
|
|
17
17
|
}
|
|
18
18
|
export declare const BuilderOptionSchema: v.InstanceSchema<typeof BuilderOption, undefined>;
|
|
19
19
|
export type BuilderOptions = ReadonlyArray<BuilderOption>;
|
|
20
|
-
export declare const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
defaultValue: string | null;
|
|
20
|
+
export declare const BuilderOptionConditionSerialisedSchema: v.GenericSchema<BuilderConditionSerialised<Readonly<{
|
|
21
|
+
kind: "string" | "number" | "boolean";
|
|
22
|
+
type: "value";
|
|
23
|
+
defaultValue: string | number | boolean | null;
|
|
24
24
|
isOptional: boolean;
|
|
25
|
-
optionLabels: {
|
|
26
|
-
[x: string]: string;
|
|
27
|
-
};
|
|
28
25
|
tags?: readonly string[] | undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
}> | Readonly<{
|
|
27
|
+
kind: "select";
|
|
28
|
+
readonly options: readonly [string, ...string[]];
|
|
29
|
+
optionLabels?: {
|
|
30
|
+
[x: string]: string;
|
|
31
|
+
} | undefined;
|
|
32
|
+
type: "value";
|
|
32
33
|
defaultValue: string | number | boolean | null;
|
|
33
34
|
isOptional: boolean;
|
|
34
35
|
tags?: readonly string[] | undefined;
|
|
35
|
-
}
|
|
36
|
-
export type
|
|
36
|
+
}>>>;
|
|
37
|
+
export type BuilderOptionConditionSerialised = BuilderConditionSerialised<BuilderOptionConfigSerialised>;
|
|
37
38
|
export declare const BuilderOptionSelectMapSerialisedSchema: v.GenericSchema<import("..").BuilderMatchSelectMap<Readonly<{
|
|
38
39
|
type: "parameter";
|
|
39
40
|
id: string;
|
|
40
41
|
name: string;
|
|
41
|
-
}> | Readonly<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
defaultValue: string | null;
|
|
42
|
+
}> | Readonly<{
|
|
43
|
+
kind: "string" | "number" | "boolean";
|
|
44
|
+
type: "value";
|
|
45
|
+
defaultValue: string | number | boolean | null;
|
|
45
46
|
isOptional: boolean;
|
|
46
|
-
optionLabels: {
|
|
47
|
-
[x: string]: string;
|
|
48
|
-
};
|
|
49
47
|
tags?: readonly string[] | undefined;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
}> | Readonly<{
|
|
49
|
+
kind: "select";
|
|
50
|
+
readonly options: readonly [string, ...string[]];
|
|
51
|
+
optionLabels?: {
|
|
52
|
+
[x: string]: string;
|
|
53
|
+
} | undefined;
|
|
54
|
+
type: "value";
|
|
53
55
|
defaultValue: string | number | boolean | null;
|
|
54
56
|
isOptional: boolean;
|
|
55
57
|
tags?: readonly string[] | undefined;
|
|
56
|
-
}
|
|
58
|
+
}>>>;
|
|
57
59
|
export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
58
60
|
readonly name: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
59
61
|
readonly payload: v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
@@ -70,65 +72,53 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
|
|
|
70
72
|
}, undefined>, v.ReadonlyAction<{
|
|
71
73
|
type: "ref";
|
|
72
74
|
id: string;
|
|
73
|
-
}>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"
|
|
74
|
-
readonly
|
|
75
|
-
readonly
|
|
76
|
-
readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
+
}>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"kind", [v.StrictObjectSchema<{
|
|
76
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
77
|
+
readonly type: v.LiteralSchema<"value", undefined>;
|
|
78
|
+
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
77
79
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
78
|
-
readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
79
80
|
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
80
|
-
}, undefined>, v.
|
|
81
|
-
|
|
82
|
-
readonly options: readonly [string, ...string[]]
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
optionLabels: {
|
|
86
|
-
[x: string]: string;
|
|
87
|
-
};
|
|
88
|
-
tags?: readonly string[] | undefined;
|
|
89
|
-
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
90
|
-
readonly type: v.LiteralSchema<"toggle", undefined>;
|
|
91
|
-
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
81
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
82
|
+
readonly kind: v.LiteralSchema<"select", undefined>;
|
|
83
|
+
readonly options: v.SchemaWithPipe<readonly [v.TupleWithRestSchema<[v.StringSchema<undefined>], v.StringSchema<undefined>, undefined>, v.ReadonlyAction<[string, ...string[]]>]>;
|
|
84
|
+
readonly optionLabels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
85
|
+
readonly type: v.LiteralSchema<"value", undefined>;
|
|
92
86
|
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
93
87
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
94
88
|
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
95
|
-
}, undefined>, v.ReadonlyAction<{
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
}, undefined>], undefined>, v.ReadonlyAction<{
|
|
90
|
+
kind: "string" | "number" | "boolean";
|
|
91
|
+
type: "value";
|
|
98
92
|
defaultValue: string | number | boolean | null;
|
|
99
93
|
isOptional: boolean;
|
|
100
94
|
tags?: readonly string[] | undefined;
|
|
101
|
-
}
|
|
102
|
-
|
|
95
|
+
} | {
|
|
96
|
+
kind: "select";
|
|
103
97
|
readonly options: readonly [string, ...string[]];
|
|
104
|
-
|
|
105
|
-
isOptional: boolean;
|
|
106
|
-
optionLabels: {
|
|
98
|
+
optionLabels?: {
|
|
107
99
|
[x: string]: string;
|
|
108
|
-
};
|
|
100
|
+
} | undefined;
|
|
101
|
+
type: "value";
|
|
102
|
+
defaultValue: string | number | boolean | null;
|
|
103
|
+
isOptional: boolean;
|
|
109
104
|
tags?: readonly string[] | undefined;
|
|
110
|
-
}>
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
}>]>, v.GenericSchema<BuilderConditionSerialised<Readonly<{
|
|
106
|
+
kind: "string" | "number" | "boolean";
|
|
107
|
+
type: "value";
|
|
113
108
|
defaultValue: string | number | boolean | null;
|
|
114
109
|
isOptional: boolean;
|
|
115
110
|
tags?: readonly string[] | undefined;
|
|
116
|
-
}
|
|
117
|
-
|
|
111
|
+
}> | Readonly<{
|
|
112
|
+
kind: "select";
|
|
118
113
|
readonly options: readonly [string, ...string[]];
|
|
119
|
-
|
|
120
|
-
isOptional: boolean;
|
|
121
|
-
optionLabels: {
|
|
114
|
+
optionLabels?: {
|
|
122
115
|
[x: string]: string;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
}>> | Readonly<Readonly<{
|
|
126
|
-
type: "toggle";
|
|
127
|
-
valueType: "string" | "number" | "boolean";
|
|
116
|
+
} | undefined;
|
|
117
|
+
type: "value";
|
|
128
118
|
defaultValue: string | number | boolean | null;
|
|
129
119
|
isOptional: boolean;
|
|
130
120
|
tags?: readonly string[] | undefined;
|
|
131
|
-
}
|
|
121
|
+
}>>>], undefined>], undefined>;
|
|
132
122
|
readonly paths: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
133
123
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
134
124
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -154,37 +144,39 @@ export declare const BuilderOptionSerialisedSchema: v.SchemaWithPipe<readonly [v
|
|
|
154
144
|
}> | Readonly<{
|
|
155
145
|
type: "ref";
|
|
156
146
|
id: string;
|
|
157
|
-
}> | Readonly<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
defaultValue: string | null;
|
|
147
|
+
}> | Readonly<{
|
|
148
|
+
kind: "string" | "number" | "boolean";
|
|
149
|
+
type: "value";
|
|
150
|
+
defaultValue: string | number | boolean | null;
|
|
161
151
|
isOptional: boolean;
|
|
162
|
-
|
|
152
|
+
tags?: readonly string[] | undefined;
|
|
153
|
+
}> | Readonly<{
|
|
154
|
+
kind: "select";
|
|
155
|
+
readonly options: readonly [string, ...string[]];
|
|
156
|
+
optionLabels?: {
|
|
163
157
|
[x: string]: string;
|
|
164
|
-
};
|
|
158
|
+
} | undefined;
|
|
159
|
+
type: "value";
|
|
160
|
+
defaultValue: string | number | boolean | null;
|
|
161
|
+
isOptional: boolean;
|
|
165
162
|
tags?: readonly string[] | undefined;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
}> | BuilderConditionSerialised<Readonly<{
|
|
164
|
+
kind: "string" | "number" | "boolean";
|
|
165
|
+
type: "value";
|
|
169
166
|
defaultValue: string | number | boolean | null;
|
|
170
167
|
isOptional: boolean;
|
|
171
168
|
tags?: readonly string[] | undefined;
|
|
172
|
-
}
|
|
173
|
-
|
|
169
|
+
}> | Readonly<{
|
|
170
|
+
kind: "select";
|
|
174
171
|
readonly options: readonly [string, ...string[]];
|
|
175
|
-
|
|
176
|
-
isOptional: boolean;
|
|
177
|
-
optionLabels: {
|
|
172
|
+
optionLabels?: {
|
|
178
173
|
[x: string]: string;
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
}>> | Readonly<Readonly<{
|
|
182
|
-
type: "toggle";
|
|
183
|
-
valueType: "string" | "number" | "boolean";
|
|
174
|
+
} | undefined;
|
|
175
|
+
type: "value";
|
|
184
176
|
defaultValue: string | number | boolean | null;
|
|
185
177
|
isOptional: boolean;
|
|
186
178
|
tags?: readonly string[] | undefined;
|
|
187
|
-
}
|
|
179
|
+
}>>;
|
|
188
180
|
paths?: Readonly<{
|
|
189
181
|
type: "parameter";
|
|
190
182
|
id: string;
|
|
@@ -212,65 +204,53 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
212
204
|
}, undefined>, v.ReadonlyAction<{
|
|
213
205
|
type: "ref";
|
|
214
206
|
id: string;
|
|
215
|
-
}>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
218
|
-
readonly defaultValue: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
207
|
+
}>]>, v.UnionSchema<[v.SchemaWithPipe<readonly [v.VariantSchema<"kind", [v.StrictObjectSchema<{
|
|
208
|
+
readonly kind: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
209
|
+
readonly type: v.LiteralSchema<"value", undefined>;
|
|
210
|
+
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
219
211
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
220
|
-
readonly optionLabels: v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>;
|
|
221
212
|
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
222
|
-
}, undefined>, v.
|
|
223
|
-
|
|
224
|
-
readonly options: readonly [string, ...string[]]
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
optionLabels: {
|
|
228
|
-
[x: string]: string;
|
|
229
|
-
};
|
|
230
|
-
tags?: readonly string[] | undefined;
|
|
231
|
-
}>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
232
|
-
readonly type: v.LiteralSchema<"toggle", undefined>;
|
|
233
|
-
readonly valueType: v.PicklistSchema<["string", "boolean", "number"], undefined>;
|
|
213
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
214
|
+
readonly kind: v.LiteralSchema<"select", undefined>;
|
|
215
|
+
readonly options: v.SchemaWithPipe<readonly [v.TupleWithRestSchema<[v.StringSchema<undefined>], v.StringSchema<undefined>, undefined>, v.ReadonlyAction<[string, ...string[]]>]>;
|
|
216
|
+
readonly optionLabels: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
217
|
+
readonly type: v.LiteralSchema<"value", undefined>;
|
|
234
218
|
readonly defaultValue: v.NullableSchema<v.UnionSchema<[v.BooleanSchema<undefined>, v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>;
|
|
235
219
|
readonly isOptional: v.BooleanSchema<undefined>;
|
|
236
220
|
readonly tags: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>, v.ReadonlyAction<string[]>]>, undefined>;
|
|
237
|
-
}, undefined>, v.ReadonlyAction<{
|
|
238
|
-
|
|
239
|
-
|
|
221
|
+
}, undefined>], undefined>, v.ReadonlyAction<{
|
|
222
|
+
kind: "string" | "number" | "boolean";
|
|
223
|
+
type: "value";
|
|
240
224
|
defaultValue: string | number | boolean | null;
|
|
241
225
|
isOptional: boolean;
|
|
242
226
|
tags?: readonly string[] | undefined;
|
|
243
|
-
}
|
|
244
|
-
|
|
227
|
+
} | {
|
|
228
|
+
kind: "select";
|
|
245
229
|
readonly options: readonly [string, ...string[]];
|
|
246
|
-
|
|
247
|
-
isOptional: boolean;
|
|
248
|
-
optionLabels: {
|
|
230
|
+
optionLabels?: {
|
|
249
231
|
[x: string]: string;
|
|
250
|
-
};
|
|
232
|
+
} | undefined;
|
|
233
|
+
type: "value";
|
|
234
|
+
defaultValue: string | number | boolean | null;
|
|
235
|
+
isOptional: boolean;
|
|
251
236
|
tags?: readonly string[] | undefined;
|
|
252
|
-
}>
|
|
253
|
-
|
|
254
|
-
|
|
237
|
+
}>]>, v.GenericSchema<BuilderConditionSerialised<Readonly<{
|
|
238
|
+
kind: "string" | "number" | "boolean";
|
|
239
|
+
type: "value";
|
|
255
240
|
defaultValue: string | number | boolean | null;
|
|
256
241
|
isOptional: boolean;
|
|
257
242
|
tags?: readonly string[] | undefined;
|
|
258
|
-
}
|
|
259
|
-
|
|
243
|
+
}> | Readonly<{
|
|
244
|
+
kind: "select";
|
|
260
245
|
readonly options: readonly [string, ...string[]];
|
|
261
|
-
|
|
262
|
-
isOptional: boolean;
|
|
263
|
-
optionLabels: {
|
|
246
|
+
optionLabels?: {
|
|
264
247
|
[x: string]: string;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
}>> | Readonly<Readonly<{
|
|
268
|
-
type: "toggle";
|
|
269
|
-
valueType: "string" | "number" | "boolean";
|
|
248
|
+
} | undefined;
|
|
249
|
+
type: "value";
|
|
270
250
|
defaultValue: string | number | boolean | null;
|
|
271
251
|
isOptional: boolean;
|
|
272
252
|
tags?: readonly string[] | undefined;
|
|
273
|
-
}
|
|
253
|
+
}>>>], undefined>], undefined>;
|
|
274
254
|
readonly paths: v.OptionalSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
275
255
|
readonly type: v.LiteralSchema<"parameter", undefined>;
|
|
276
256
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -296,37 +276,39 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
296
276
|
}> | Readonly<{
|
|
297
277
|
type: "ref";
|
|
298
278
|
id: string;
|
|
299
|
-
}> | Readonly<
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
defaultValue: string | null;
|
|
279
|
+
}> | Readonly<{
|
|
280
|
+
kind: "string" | "number" | "boolean";
|
|
281
|
+
type: "value";
|
|
282
|
+
defaultValue: string | number | boolean | null;
|
|
303
283
|
isOptional: boolean;
|
|
304
|
-
|
|
284
|
+
tags?: readonly string[] | undefined;
|
|
285
|
+
}> | Readonly<{
|
|
286
|
+
kind: "select";
|
|
287
|
+
readonly options: readonly [string, ...string[]];
|
|
288
|
+
optionLabels?: {
|
|
305
289
|
[x: string]: string;
|
|
306
|
-
};
|
|
290
|
+
} | undefined;
|
|
291
|
+
type: "value";
|
|
292
|
+
defaultValue: string | number | boolean | null;
|
|
293
|
+
isOptional: boolean;
|
|
307
294
|
tags?: readonly string[] | undefined;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
295
|
+
}> | BuilderConditionSerialised<Readonly<{
|
|
296
|
+
kind: "string" | "number" | "boolean";
|
|
297
|
+
type: "value";
|
|
311
298
|
defaultValue: string | number | boolean | null;
|
|
312
299
|
isOptional: boolean;
|
|
313
300
|
tags?: readonly string[] | undefined;
|
|
314
|
-
}
|
|
315
|
-
|
|
301
|
+
}> | Readonly<{
|
|
302
|
+
kind: "select";
|
|
316
303
|
readonly options: readonly [string, ...string[]];
|
|
317
|
-
|
|
318
|
-
isOptional: boolean;
|
|
319
|
-
optionLabels: {
|
|
304
|
+
optionLabels?: {
|
|
320
305
|
[x: string]: string;
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
}>> | Readonly<Readonly<{
|
|
324
|
-
type: "toggle";
|
|
325
|
-
valueType: "string" | "number" | "boolean";
|
|
306
|
+
} | undefined;
|
|
307
|
+
type: "value";
|
|
326
308
|
defaultValue: string | number | boolean | null;
|
|
327
309
|
isOptional: boolean;
|
|
328
310
|
tags?: readonly string[] | undefined;
|
|
329
|
-
}
|
|
311
|
+
}>>;
|
|
330
312
|
paths?: Readonly<{
|
|
331
313
|
type: "parameter";
|
|
332
314
|
id: string;
|
|
@@ -345,37 +327,39 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
345
327
|
}> | Readonly<{
|
|
346
328
|
type: "ref";
|
|
347
329
|
id: string;
|
|
348
|
-
}> | Readonly<
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
defaultValue: string | null;
|
|
330
|
+
}> | Readonly<{
|
|
331
|
+
kind: "string" | "number" | "boolean";
|
|
332
|
+
type: "value";
|
|
333
|
+
defaultValue: string | number | boolean | null;
|
|
352
334
|
isOptional: boolean;
|
|
353
|
-
|
|
335
|
+
tags?: readonly string[] | undefined;
|
|
336
|
+
}> | Readonly<{
|
|
337
|
+
kind: "select";
|
|
338
|
+
readonly options: readonly [string, ...string[]];
|
|
339
|
+
optionLabels?: {
|
|
354
340
|
[x: string]: string;
|
|
355
|
-
};
|
|
341
|
+
} | undefined;
|
|
342
|
+
type: "value";
|
|
343
|
+
defaultValue: string | number | boolean | null;
|
|
344
|
+
isOptional: boolean;
|
|
356
345
|
tags?: readonly string[] | undefined;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
|
|
346
|
+
}> | BuilderConditionSerialised<Readonly<{
|
|
347
|
+
kind: "string" | "number" | "boolean";
|
|
348
|
+
type: "value";
|
|
360
349
|
defaultValue: string | number | boolean | null;
|
|
361
350
|
isOptional: boolean;
|
|
362
351
|
tags?: readonly string[] | undefined;
|
|
363
|
-
}
|
|
364
|
-
|
|
352
|
+
}> | Readonly<{
|
|
353
|
+
kind: "select";
|
|
365
354
|
readonly options: readonly [string, ...string[]];
|
|
366
|
-
|
|
367
|
-
isOptional: boolean;
|
|
368
|
-
optionLabels: {
|
|
355
|
+
optionLabels?: {
|
|
369
356
|
[x: string]: string;
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
}>> | Readonly<Readonly<{
|
|
373
|
-
type: "toggle";
|
|
374
|
-
valueType: "string" | "number" | "boolean";
|
|
357
|
+
} | undefined;
|
|
358
|
+
type: "value";
|
|
375
359
|
defaultValue: string | number | boolean | null;
|
|
376
360
|
isOptional: boolean;
|
|
377
361
|
tags?: readonly string[] | undefined;
|
|
378
|
-
}
|
|
362
|
+
}>>;
|
|
379
363
|
paths?: Readonly<{
|
|
380
364
|
type: "parameter";
|
|
381
365
|
id: string;
|
|
@@ -387,40 +371,23 @@ export declare const BuilderOptionsSerialisedSchema: v.SchemaWithPipe<readonly [
|
|
|
387
371
|
tags?: readonly string[] | undefined;
|
|
388
372
|
}>[]>]>;
|
|
389
373
|
export type BuilderOptionsSerialised = v.InferOutput<typeof BuilderOptionsSerialisedSchema>;
|
|
390
|
-
export declare const
|
|
391
|
-
readonly type: "enable";
|
|
392
|
-
readonly payload: {
|
|
393
|
-
readonly type: "select";
|
|
394
|
-
readonly options: readonly [string, ...string[]];
|
|
395
|
-
readonly defaultValue: string | null;
|
|
396
|
-
readonly isOptional: boolean;
|
|
397
|
-
readonly optionLabels: {
|
|
398
|
-
readonly [x: string]: string;
|
|
399
|
-
} & import("../../validate").BuilderValidatedBrand;
|
|
400
|
-
readonly tags?: readonly string[] | undefined;
|
|
401
|
-
} | {
|
|
402
|
-
readonly type: "toggle";
|
|
403
|
-
readonly valueType: "string" | "number" | "boolean";
|
|
404
|
-
readonly defaultValue: string | number | boolean | null;
|
|
405
|
-
readonly isOptional: boolean;
|
|
406
|
-
readonly tags?: readonly string[] | undefined;
|
|
407
|
-
};
|
|
408
|
-
} | {
|
|
374
|
+
export declare const validateOptionCondition: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors").BuilderIssuesScope) => import("..").ValidationResult<{
|
|
409
375
|
readonly type: "match";
|
|
410
376
|
readonly matchPath: readonly (string | number)[];
|
|
411
377
|
readonly selectMap: {
|
|
412
378
|
readonly [x: string]: {
|
|
413
|
-
readonly
|
|
414
|
-
readonly
|
|
415
|
-
readonly defaultValue: string | null;
|
|
379
|
+
readonly kind: "string" | "number" | "boolean";
|
|
380
|
+
readonly type: "value";
|
|
381
|
+
readonly defaultValue: string | number | boolean | null;
|
|
416
382
|
readonly isOptional: boolean;
|
|
417
|
-
readonly optionLabels: {
|
|
418
|
-
readonly [x: string]: string;
|
|
419
|
-
} & import("../../validate").BuilderValidatedBrand;
|
|
420
383
|
readonly tags?: readonly string[] | undefined;
|
|
421
384
|
} | {
|
|
422
|
-
readonly
|
|
423
|
-
readonly
|
|
385
|
+
readonly kind: "select";
|
|
386
|
+
readonly options: readonly [string, ...string[]];
|
|
387
|
+
readonly optionLabels?: ({
|
|
388
|
+
readonly [x: string]: string;
|
|
389
|
+
} & import("../../validate").BuilderValidatedBrand) | undefined;
|
|
390
|
+
readonly type: "value";
|
|
424
391
|
readonly defaultValue: string | number | boolean | null;
|
|
425
392
|
readonly isOptional: boolean;
|
|
426
393
|
readonly tags?: readonly string[] | undefined;
|
|
@@ -431,35 +398,37 @@ export declare const validateOptionWhen: (input: unknown, references?: import(".
|
|
|
431
398
|
readonly unlessPath: readonly (string | number)[];
|
|
432
399
|
readonly disabledValues: readonly (string | number | boolean | null)[];
|
|
433
400
|
readonly payload: {
|
|
434
|
-
readonly
|
|
435
|
-
readonly
|
|
436
|
-
readonly defaultValue: string | null;
|
|
401
|
+
readonly kind: "string" | "number" | "boolean";
|
|
402
|
+
readonly type: "value";
|
|
403
|
+
readonly defaultValue: string | number | boolean | null;
|
|
437
404
|
readonly isOptional: boolean;
|
|
438
|
-
readonly optionLabels: {
|
|
439
|
-
readonly [x: string]: string;
|
|
440
|
-
} & import("../../validate").BuilderValidatedBrand;
|
|
441
405
|
readonly tags?: readonly string[] | undefined;
|
|
442
406
|
} | {
|
|
443
|
-
readonly
|
|
444
|
-
readonly
|
|
407
|
+
readonly kind: "select";
|
|
408
|
+
readonly options: readonly [string, ...string[]];
|
|
409
|
+
readonly optionLabels?: ({
|
|
410
|
+
readonly [x: string]: string;
|
|
411
|
+
} & import("../../validate").BuilderValidatedBrand) | undefined;
|
|
412
|
+
readonly type: "value";
|
|
445
413
|
readonly defaultValue: string | number | boolean | null;
|
|
446
414
|
readonly isOptional: boolean;
|
|
447
415
|
readonly tags?: readonly string[] | undefined;
|
|
448
416
|
};
|
|
449
417
|
}>;
|
|
450
|
-
export declare const validateOptionSelectMap: (input: unknown, references?: import("..").BuilderReferences,
|
|
418
|
+
export declare const validateOptionSelectMap: (input: unknown, references?: import("..").BuilderReferences, issues?: import("../../errors").BuilderIssuesScope) => import("..").ValidationResult<{
|
|
451
419
|
readonly [x: string]: {
|
|
452
|
-
readonly
|
|
453
|
-
readonly
|
|
454
|
-
readonly defaultValue: string | null;
|
|
420
|
+
readonly kind: "string" | "number" | "boolean";
|
|
421
|
+
readonly type: "value";
|
|
422
|
+
readonly defaultValue: string | number | boolean | null;
|
|
455
423
|
readonly isOptional: boolean;
|
|
456
|
-
readonly optionLabels: {
|
|
457
|
-
readonly [x: string]: string;
|
|
458
|
-
} & import("../../validate").BuilderValidatedBrand;
|
|
459
424
|
readonly tags?: readonly string[] | undefined;
|
|
460
425
|
} | {
|
|
461
|
-
readonly
|
|
462
|
-
readonly
|
|
426
|
+
readonly kind: "select";
|
|
427
|
+
readonly options: readonly [string, ...string[]];
|
|
428
|
+
readonly optionLabels?: ({
|
|
429
|
+
readonly [x: string]: string;
|
|
430
|
+
} & import("../../validate").BuilderValidatedBrand) | undefined;
|
|
431
|
+
readonly type: "value";
|
|
463
432
|
readonly defaultValue: string | number | boolean | null;
|
|
464
433
|
readonly isOptional: boolean;
|
|
465
434
|
readonly tags?: readonly string[] | undefined;
|
|
@@ -5,7 +5,7 @@ import { createEntityValidator } from '../kind.js';
|
|
|
5
5
|
import { BuilderPathsSchema } from '../paths.js';
|
|
6
6
|
import { serialisable } from '../serialisable.js';
|
|
7
7
|
import { BuilderTagsSchema } from '../tags.js';
|
|
8
|
-
import { createSelectMapSerialisedSchema,
|
|
8
|
+
import { createSelectMapSerialisedSchema, createConditionSerialisedSchema } from '../condition.js';
|
|
9
9
|
import { BuilderOptionConfigSerialisedSchema } from './config.js';
|
|
10
10
|
export class BuilderOption {
|
|
11
11
|
name;
|
|
@@ -23,14 +23,14 @@ export class BuilderOption {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
export const BuilderOptionSchema = v.instance(BuilderOption);
|
|
26
|
-
export const
|
|
26
|
+
export const BuilderOptionConditionSerialisedSchema = createConditionSerialisedSchema(BuilderOptionConfigSerialisedSchema);
|
|
27
27
|
export const BuilderOptionSelectMapSerialisedSchema = createSelectMapSerialisedSchema(BuilderOptionConfigSerialisedSchema);
|
|
28
28
|
export const BuilderOptionSerialisedSchema = serialisable(v.object({
|
|
29
29
|
name: NameSchema,
|
|
30
|
-
payload: paramable(v.union([BuilderOptionConfigSerialisedSchema,
|
|
30
|
+
payload: paramable(v.union([BuilderOptionConfigSerialisedSchema, BuilderOptionConditionSerialisedSchema])),
|
|
31
31
|
paths: v.optional(paramable(BuilderPathsSchema)),
|
|
32
32
|
tags: v.optional(BuilderTagsSchema)
|
|
33
33
|
}));
|
|
34
34
|
export const BuilderOptionsSerialisedSchema = v.pipe(v.array(BuilderOptionSerialisedSchema), v.readonly());
|
|
35
|
-
export const
|
|
35
|
+
export const validateOptionCondition = createEntityValidator('optionCondition', BuilderOptionConditionSerialisedSchema);
|
|
36
36
|
export const validateOptionSelectMap = createEntityValidator('optionSelectMap', BuilderOptionSelectMapSerialisedSchema);
|